Splitted sorted BAM files with samtools
1
0
Entering edit mode
11 months ago

Hello. I'm trying to use the command "sort" of samtools (ex: samtools sort alignment.bam -o alignment.sorted.bam), but for some reason, instead of generating one single sorted file (ex: alignment.sorted.bam) it generates many files (ex: alignment.sorted.bam.0000.bam, alignment.sorted.bam.0001.bam, alignment.sorted.bam.0002.bam, ..., alignment.sorted.bam.0020.bam). The odd thing is that I had used the exact same command before for a few data of the same batch and it generated a single file. Does anyone have any idea what could be happening and how do I solve this? I'm also thinking of merging the files, if I can't solve it. How do I find out the correct order to merge? Thanks in advance.

samtools sort • 358 views
1
Entering edit mode
11 months ago
ATpoint 65k

These are intermediate/temporary files that are created once the chunk of sorted reads exceeds the allocated (-m) memory taht is used to store them in RAM. They should be automatically merged into a single file and then cleaned up unless your job got killed for any reason. Any error messages?

0
Entering edit mode

I see. Thank you.

No. I didn't receive any error messages.