Question: Error: failed to locate the BWA index.
0
gravatar for L_LANKA
3 months ago by
L_LANKA0
L_LANKA0 wrote:

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?

bwa R • 160 views
ADD COMMENTlink modified 3 months ago by JC12k • written 3 months ago by L_LANKA0
1

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 REPLYlink written 3 months ago by lieven.sterck9.0k
0
gravatar for JC
3 months ago by
JC12k
Mexico
JC12k wrote:

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 COMMENTlink written 3 months ago by JC12k

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 REPLYlink written 3 months ago by L_LANKA0

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

ADD REPLYlink written 3 months ago by JC12k

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

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

It`s work normal.

ADD REPLYlink written 3 months ago by L_LANKA0

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 REPLYlink written 3 months ago by JC12k

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 REPLYlink modified 3 months ago • written 3 months ago by L_LANKA0

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 REPLYlink written 3 months ago by L_LANKA0
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 2110 users visited in the last hour