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?
• 1,905 views
•
link
0 answers
No answers yet.
Log in to answer this question.
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...