I am trying to figure out a way to split up a BAM file into many small pieces without splitting up read pairs. The resulting BAM files needs to be name-sorted, although that operation could be performed on each chunk after the splitting process.
As far as I can tell, there aren't any existing tools that do this. Does anyone know of anything?
It would be highly likely that name sorting it first and then splitting will be much much easier as pairs have the same name in a BAM file!
First thing that comes to my mind is that you could probably split over the centromere without issues, but I assume you want to split more than once.