Merges sequences in BAM alignments