samtools sort doesn't finish sorting bam file, just hangs for hours
1
0
Entering edit mode
6.0 years ago
dec986 ▴ 380

I am trying to sort a bam file, which is 4.1 GB in size using simply samtools sort -o sorted.bam start.bam, but the file hangs after about 6.5 hours when the sorted file is 3.1 GB, no warning messages or anything. None of the temp files have been deleted either. I don't think the computer ran out of RAM. This has happened on my second attempt.

Why can't I sort this bam file? How can I get the sort to finish?

samtools • 3.0k views
ADD COMMENT
1
Entering edit mode

Very odd. Command seems fine. If you want to try a different tool use sambamba.

ADD REPLY
0
Entering edit mode

Use top to see if the process is still running.

ADD REPLY
0
Entering edit mode

I don't think the computer ran out of RAM.

How much RAM do you have?

ADD REPLY
3
Entering edit mode
6.0 years ago

Check 1 : is your BAM file okay? see below link

How to systematically check if a bam file is truncated

Check 2 : do you have enough space on disk ?

df -h
ADD COMMENT
0
Entering edit mode

indeed, the issue was disk space, silly me. It would have been nice had samtools provided an error, however, the temp files used more space than I anticipated.

ADD REPLY
0
Entering edit mode

If an answer was helpful you should upvote it, if the answer resolved your question you should mark it as accepted.
Upvote|Bookmark|Accept

ADD REPLY

Login before adding your answer.

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