BWA MEM output directory
0
0
Entering edit mode
4.3 years ago

hi everyone! I've a problem with output directory with bwa mem. this is my code for multiple fastq files:

for file in ./*.fastq;
do
    bwa mem hg19_index ${file} > ${file%.fastq}.sam
done

I want to put the output .sam files in another directory so I wrote:

for file in ./*.fastq;
do
    bwa mem hg19_index ${file} > path_to_output_directory/${file%.fastq}.sam
done

but it dosen't work! :( bwa mem puts the output files in the same directory of hg19_index files!

what is wrong? thank you!

bash bwa directory • 3.4k views
ADD COMMENT
0
Entering edit mode

is your path a valid system path?

ADD REPLY
0
Entering edit mode

"path_to_output_directory" is the absolute path. I tried with with two or three files and it works

ADD REPLY
0
Entering edit mode

is it possible that bwa wants fastq and sam in the same folder?

ADD REPLY
0
Entering edit mode

BWA uses the STDOUT stream, so the location is not defined by the program

ADD REPLY
0
Entering edit mode

It may not resolve the issue, but you should soft-quote your variables (" ").

ADD REPLY

Login before adding your answer.

Traffic: 1669 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