def full_to_one(full):
    """
    Convert full amino acid name to one-letter amino acid code.
    """
    assert full.lower() in [
        "phenylalanine",
        "leucine",
        "serine",
        "tyrosine",
        "stop",
        "cysteine",
        "tryptophan",
        "proline",
        "histidine",
        "glutamine",
        "arginine",
        "isoleucine",
        "methionine",
        "threonine",
        "asparagine",
        "lysine",
        "valine",
        "alanine",
        "aspartic acid",
        "glutamic acid",
        "glycine",
        "unnatural aa",
    ], (
        "Error, %s is not a valid amino acid" % full
    )

    AA = {
        "phenylalanine": "F",
        "leucine": "L",
        "serine": "S",
        "tyrosine": "Y",
        "stop": "*",
        "cysteine": "C",
        "tryptophan": "W",
        "proline": "P",
        "histidine": "H",
        "glutamine": "Q",
        "arginine": "R",
        "isoleucine": "I",
        "methionine": "M",
        "threonine": "T",
        "asparagine": "N",
        "lysine": "K",
        "valine": "V",
        "alanine": "A",
        "aspartic acid": "D",
        "glutamic acid": "E",
        "glycine": "G",
        "unnatural aa": "U",
    }
    return AA[full.lower()]