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", :
ошибка запуска команды
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?
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.
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", :
ошибка запуска команды
where is installed BWA? /usr/local/bin/bwa?
Yes! When I used it in terminal, i wrote:
cd ~/Utilits/bwa-0.7.16a/bwakit
bwa
It`s work normal.
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"
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 :(
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.
Log in to answer this question.
Hello L_LANKA,
Please use the formatting bar (especially the

codeoption) to present your post better. I've done it for you this time.Thank you!