def pair_sorter(aln):
    """Get the alignment name and attributes for sorting."""
    return (
        aln.name,
        not aln.first_in_pair,
        aln.unmapped,
        aln.supplementary_alignment,
        aln.secondary_alignment)