Question: samtools sort doesn't finish sorting bam file, just hangs for hours
0
gravatar for dec986
6 months ago by
dec986190
United States
dec986190 wrote:

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 • 298 views
ADD COMMENTlink written 6 months ago by dec986190
1

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

ADD REPLYlink written 6 months ago by Jeffin Rockey1.1k

Use top to see if the process is still running.

ADD REPLYlink written 6 months ago by ATpoint16k

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

How much RAM do you have?

ADD REPLYlink written 6 months ago by genomax67k
3
gravatar for Vijay Lakhujani
6 months ago by
Vijay Lakhujani4.1k
India
Vijay Lakhujani4.1k wrote:

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 COMMENTlink written 6 months ago by Vijay Lakhujani4.1k

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 REPLYlink written 6 months ago by dec986190

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 REPLYlink written 6 months ago by WouterDeCoster39k
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: 1971 users visited in the last hour