Either while writing BGZF MAF files (and packing MAF blocks into BGZF blocks) or while parsing them to build the index, track whether each BGZF block spills, i.e. ends in an alignment block fragment rather than having an integer number of alignment blocks.
The Parser could have a reference to the KyotoIndex for this purpose.
On parsing, index#chunk_spills? could be called to determine whether the last-block-start detection and fragment-joining logic needs to kick in.
Either while writing BGZF MAF files (and packing MAF blocks into BGZF blocks) or while parsing them to build the index, track whether each BGZF block spills, i.e. ends in an alignment block fragment rather than having an integer number of alignment blocks.
The Parser could have a reference to the KyotoIndex for this purpose.
On parsing, index#chunk_spills? could be called to determine whether the last-block-start detection and fragment-joining logic needs to kick in.