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.
samtools sort doesn't finish sorting bam file, just hangs for hours
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?
• 3,817 views
•
link
1 answer
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
• 1 views
•
link
• 1 views
•
link
If an answer was helpful you should upvote it, if the answer resolved your question you should mark it as accepted.

• 1 views
•
link
Log in to answer this question.
Very odd. Command seems fine. If you want to try a different tool use sambamba.
Use
topto see if the process is still running.How much RAM do you have?