Question: samtools view: failed to open "sort" for reading: No such file or directory
0
gravatar for oars
14 months ago by
oars150
oars150 wrote:

I'm having an issue with the "SAM-BAM conversion and sorting steps together" command. After the following command...

bwa mem -t2 -R '@RG\tID:NA12878\tSM:NA12878\tLB:NA12878' genome.fa SRR1611183_1.fastq.gz `SRR1611183_2.fastq.gz |samtools view -u -samtools sort -@2 - > SRR1611183.bam`

...I get the following error:

E::hts_open_format] Failed to open file sort
samtools view: failed to open "sort" for reading: No such file or directory
[M::bwa_idx_load_from_disk] read 0 ALT contigs
[M::process] read 200000 sequences (20000000 bp)...
[M::process] read 200000 sequences (20000000 bp)...
[M::mem_pestat] # candidate unique pairs for (FF, FR, RF, RR): (5, 72922, 1, 3)
[M::mem_pestat] skip orientation FF as there are not enough pairs
[M::mem_pestat] analyzing insert size distribution for orientation FR...
[M::mem_pestat] (25, 50, 75) percentile: (216, 239, 258)
[M::mem_pestat] low and high boundaries for computing mean and std.dev: (132, 342)
[M::mem_pestat] mean and std.dev: (235.53, 32.36)
[M::mem_pestat] low and high boundaries for proper pairs: (90, 384)
[M::mem_pestat] skip orientation RF as there are not enough pairs
[M::mem_pestat] skip orientation RR as there are not enough pairs
[M::mem_process_seqs] Processed 200000 reads in 32.785 CPU sec, 16.249 real sec

The command actually still runs but changes your SRR1611183.bam so that there is now 0 bytes on data in the file.

I'm a little scared to repeat this command since you need to reconstruct your SRR1611183.bam file which takes about 30-40 mins. I'd hate to wipe it out again.

Does anyone see a glaring error in my bwa mem script?

samtools • 1.1k views
ADD COMMENTlink modified 14 months ago by Pierre Lindenbaum120k • written 14 months ago by oars150
1

samtools view -u -samtools

Looks weird to me. Why's there a -samtools flag? Is it supposed to be a | samtools perhaps?

ADD REPLYlink modified 14 months ago • written 14 months ago by RamRS21k
1

|samtools view -u -samtools sort

you are missing a pipe here.

ADD REPLYlink written 14 months ago by h.mon25k
3
gravatar for Pierre Lindenbaum
14 months ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum120k wrote:

the problem is here:

... |samtools view -u -samtools sort -@2

you want (with a recent version of samtools)

 .... | samtools sort -@2  -T SRR1611183tmp  -o SRR1611183.bam -
ADD COMMENTlink written 14 months ago by Pierre Lindenbaum120k

Thanks - I see the pipe I missed. Many thanks to all!

ADD REPLYlink written 14 months ago by oars150
1
gravatar for Chris Miller
14 months ago by
Chris Miller20k
Washington University in St. Louis, MO
Chris Miller20k wrote:

Why not just this?

bwa mem -t2 -R '@RG\tID:NA12878\tSM:NA12878\tLB:NA12878' genome.fa SRR1611183_1.fastq.gz SRR1611183_2.fastq.gz | samtools sort -@2 - > SRR1611183.bam
ADD COMMENTlink modified 14 months ago by RamRS21k • written 14 months ago by Chris Miller20k
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: 797 users visited in the last hour