This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Split BAM file into parts with headers rebuilt

Hi, I have a BAM file with 12000 contigs, I need to split it into several parts (let's say 12 parts with 1000 contigs each), and I also need the header to be rebuilt to include only the contigs relevant to this part. Could you please suggest a way to do that?

rna-seq bam split contigs

and I also need the header to be rebuilt to include only the contigs relevant to this part.

I wonder why

the downstream tool that I am trying to use works by loading all contigs into memory. Because this particular input has too many contigs, the tool crashes due to prohibitively high memory usage. One solution that I was advised is to split the input BAM into parts, and include only a subset of contigs in the header, so that the tool loads and works with only a subset of contigs.

I hope you don't ever have paired-end reads with mates on different contigs...

0 answers

No answers yet.

Log in to answer this question.