def get_similarity_score(aa1, aa2, score_df):
    """Take two amino acid (residues) and return their similarity score
    according to the blosum62 matrix from NCBI.
    """
    aa1 = aa1.upper()
    aa2 = aa2.upper()
    valid_aa_list = ['A','R','N','D','C','Q','E','G','H','I','L','K','M','F','P','S','T','W','Y','V','B','Z','X','*']

    assert aa1 in valid_aa_list and aa2 in valid_aa_list, """Invalid input amino acid
    codes."""

    return int(score_df.loc[aa1][aa2])