Question: samtools sort stuck during merging
0
gravatar for Carlo Yague
17 months ago by
Carlo Yague4.3k
Belgium
Carlo Yague4.3k wrote:

Hi !

I got a new computer recently and had to re-install samtools (version 1.5) and a few other programs. Now when I try to sort a bam file, everything goes well (samtools creates all those little intermediate files) until the merging process :

[bam_sort_core] merging from 58 files...

Then it gets stuck. I get no error message but the output file (sorted.bam) remains empty even if I wait hours. When I monitor the activity of samtools, I see that it is reading a lot, but not writing. Any idea on what is going on ?

In case this is useful, I'm on MacOS 10.12, 8 Go, 4 cores and I tried two different settings for sorting :

samtools sort in.bam > sorted.bam              # 1st setting
samtools sort -@ 4 -m 1G in.bam > sorted.bam   # 2d setting
sort bamtools samtools next-gen • 894 views
ADD COMMENTlink written 17 months ago by Carlo Yague4.3k
2

Have you tried explicitly specifying the output file using the -o argument?

ADD REPLYlink written 17 months ago by WouterDeCoster35k

Ok, I just tried that (I had little hope) but IT WORKED ! Thank you ! But WTF is going on ? samtools sort used to work perfectly well with stdout...

ADD REPLYlink written 17 months ago by Carlo Yague4.3k

I would argue it's a bug. Definitely given that the manual states:

The sorted output is written to standard output by default, or to the specified file (out.bam) when -o is used.

ADD REPLYlink written 17 months ago by WouterDeCoster35k
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: 2174 users visited in the last hour