@groovy.util.logging.Log class Pairs extends ToolBase
Extracts read pairs from BAM or CRAM files sorted in coordinate order.
Extracting paired reads from BAM files when sorted in coordinate order is problematic because each read's mate may be stored at a distance from the read itself within the BAM file. Random lookup of each mate is too slow, so it is necessary to buffer reads until their mate becomes available through efficient linear scan. This in turn however leads to significant memory usage, requiring careful design to balance performance and memory.
Groovy Documentation