def check_if_exists(cur, protein_id):
    """
    Check if alignment already exists.

    Args:
        cur: Cursor object.
        protein_id: Protein id.

    Returns:
        True if alignment already exists, False otherwise.
    """
    ali_id = cur.execute('SELECT id FROM alignments WHERE id=?', (protein_id,)).fetchone()
    if ali_id:
        return True
    else:
        return False