This is a test version of Biostars. For the public version, visit https://www.biostars.org.
BWA MEM fail to open file for output SAM

I am practicing to change fastaq into sam file via BWE in ubuntu.

I used index file of 'GRCh37_latest_genomic.fna' (given) with 2 trimmed fastq files.

commands were like below:

    sudo ./bwa-0.7.17/bwa mem -t 6 
 /data/GRCh37_latest_genomic.fna 
/data/trimmed_fasq/trimmed_QC18010001_1.fastq 
/data/trimmed_fastq/trimmed_QC18010001_2.fastq > /data/QC18010001_pe.sam

The results were:

-bash: data/QC18010001_pe.sam: No such file or directory
  1. permission checked - 777
  2. disk usage checked - 22GB left
  3. index files: generated index files for GRCh37_latest_genomic.fna

Q. Why No such file appears for command ">" or -o ? I don't know what the problem is.

sam index bwa output

-bash: data/QC18010001_pe.sam: No such file or directory

it's not a bwa error, it's a bash error. did you put some backslash at the end of the lines ?

./bwa-0.7.17/bwa mem -t 6 \
 /data/GRCh37_latest_genomic.fna \ 
/data/trimmed_fasq/trimmed_QC18010001_1.fastq \
/data/trimmed_fastq/trimmed_QC18010001_2.fastq > /data/QC18010001_pe.sam

Yes, those lines for just readability. Thanks. I suspect it might be another bash error, though.

Yes, the path to the folder is most likely incorrect, this is why I asked for that pwd output.

If your user has write permission in that directory you don't have to run the BWA as sudo. The R1 file path is missing a t it should be /data/trimmed_fastq/trimmed_QC18010001_1.fastq. Also, make sure you are using the correct file extension (.fastq/.fastq.gz).

What is the output of pwd when running it while being in the folder that this screenshot is from?

0 answers

No answers yet.

Log in to answer this question.