def hash_fasta(seq, ignore_case=False, ignore_N=False, ignore_stop=False, checksum="MD5"):
    """
    Generates checksum of input sequence element
    """
    if ignore_stop:
        seq = seq.rstrip("*")
    if ignore_case:
        seq = seq.upper()
    if ignore_N:
        if not all('ATGCN' in c.upper() for c in seq):
            seq = re.sub('X', '', seq)
        else:
            seq = re.sub('N', '', seq)

    if checksum == "MD5":
        hashed = md5(seq).hexdigest()
    elif checksum == "GCG":
        hashed = seguid(seq)

    return hashed
dataset/ETHPy150Open tanghaibao/jcvi/formats/fasta.py/hash_fasta/swapped operands of `in`