Error: failed to locate the BWA index.
1
0
Entering edit mode
3.7 years ago
L_LANKA • 0

Hello!

Today I had attempts to write code for automation my pipeline. I tried make It in Jupyter but some packages, for example os.startfile (path[, operation]), not intended for Unix sistem. Now I attempt make it in R-studio and I have some questions:

1) How I should run program? For example, I had attempts run bwa mem and I have problem. I wrote in terminal:

bwa.path <- "/home/valera/Utilits/bwa-0.7.16a/bwakit/"
system(paste(bwa.path, "run-bwamem -M /home/valera/bam/GRCh38_latest_genomic.fna /home/valera/bam/Rep2.fastq.gz>/home/valera/bam/Prob_obr.sam","index", sep=""))

and the program makes output ERROR: failed to locate the BWA index.

2) Second question from first, what I should indicate in "index"?

3) Is It good idea write automatically pipeline on R-language?

R bwa • 1.1k views
ADD COMMENT
1
Entering edit mode

Hello L_LANKA,

Please use the formatting bar (especially the code option) to present your post better. I've done it for you this time.
code_formatting

Thank you!

ADD REPLY
0
Entering edit mode
3.7 years ago
JC 13k

The system in R is creating a command like the one you type in your terminal, the index is the location of the index base name, the intriguing part in the "run-bwamem", that looks like is a script or wrapper. If you are just running BWA mem, the minimal command will be:

bwa.path <- "/home/valera/Utilits/bwa-0.7.16a/bwa"
index.path <- "/home/valera/bam/GRCh38_latest_genomic"
system(paste(bwa.path, "-M", index.path, "/home/valera/bam/Rep2.fastq.gz", ">", "/home/valera/bam/Prob_obr.sam", sep=" "))

for the last question, it is not impossible to have a pipeline in R, but maybe Bash or other workflow managers (SnakeMake, NextFlow) are better for this.

ADD COMMENT
0
Entering edit mode

Thank you so mush! I tried use it now. I have error:

/home/valera/Utilits/bwa-0.7.16a/bwa: not found

and

Предупреждение:
В system(paste(bwa.path, "-M", index.path, "/home/valera/bam/Rep2.fastq.gz",  :
  ошибка запуска команды
ADD REPLY
0
Entering edit mode

where is installed BWA? /usr/local/bin/bwa?

ADD REPLY
0
Entering edit mode

Yes! When I used it in terminal, i wrote:

cd ~/Utilits/bwa-0.7.16a/bwakit
bwa

It`s work normal.

ADD REPLY
0
Entering edit mode

the your code should be:

bwa.path <- "/home/valera/Utilits/bwa-0.7.16a/bwakit/bwa"

Also check your index, where did you run "bwa index"? You should see some file with extension ".rpac, .amb, .ann, .pac, .bwt, .rbwt, .rsa, .sa"

ADD REPLY
0
Entering edit mode

I don't understand what is wrong. I make index by:

bwa.path <- "/home/valera/Utilits/bwa-0.7.16a/bwa"
system("bwa index -a bwtsw /home/valera/bam/GRCh38_alignment.fa")

and It works good!!! When It finished worked (It made index), I ran script for sam. It prints again message about error. I had attempts change script :

system(paste(bwa.path, "-M", index.path, " /home/valera/bam/Rep2.fastq.gz > /home/valera/bam/Prob_obr.sam"

I have old error. It's so sad :(

ADD REPLY
0
Entering edit mode

I decided this problem. When I wrote in script:

system("bwa mem /home/valera/bam/GRCh38_alignment.fa /home/valera/bam/Rep2.fastq.gz > /home/valera/bam/Prob_obr.sam")

It`s work normal.

ADD REPLY

Login before adding your answer.

Traffic: 1999 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6