def get_existing_residue_types(residue_types_txt_file):
    """
    Given a 'residue_types_txt_file', this function gets a list of residue types that are in the file.
    (Commented out lines/residue types are ignored.)

    Parameters
    ----------

    residue_types_txt_file: The path to a PyRosetta residue types fi
le ('residue_types.txt')

    Returns
    -------

    existing_residue_types_list: A list of residue types that are currently in 'residue_types.txt'.

    """
    existing_residue_types_list = []
    file_obj = open(residue_types_txt_file, 'r')
    lines = file_obj.readlines()
    for line in lines:
        if line[0] != '#':
            if '.params' in line:
                residue_type = line.split('/')[-1].split('.params')[0]
                existing_residue_types_list.append(residue_type)
    return(existing_residue_types_list)