def orf_sorter(orf):
    """Sorting function for the ORFs."

    :param orf: an ORF to sort
    :type orf: Mikado.serializers.orf.Orf
    """
    return (orf.cds_len, orf.has_start_codon and orf.has_stop_codon, orf.
        has_start_codon or orf.has_stop_codon)
