def interaction_exist(interaction, interactions, interaction_1_key=
    'uniprot_1', interaction_2_key='uniprot_2'):
    """
    Checks if interaction already exists in first dataframe.
    """
    if len(interactions[(interactions[interaction_1_key] == interaction[
        interaction_1_key]) & (interactions[interaction_2_key] ==
        interaction[interaction_2_key])]):
        return True
    if len(interactions[(interactions[interaction_2_key] == interaction[
        interaction_1_key]) & (interactions[interaction_1_key] ==
        interaction[interaction_2_key])]):
        return True
    return False
