def create_input_list(pdb_list_fname):
    """
    create a list of tuples (pdb_id, chain) from a text file
    """
    pdb_list = []
    with open(pdb_list_fname, 'r') as f:
        for record in f.read().splitlines():
            pdb_id, chain = record[:-1], record[-1]

            # check PDB ID and chain are valid
            if not pdb_id.isalnum() or len(pdb_id) != 4 or not chain.isalpha() or len(chain) != 1:
                continue

            pdb_list.append((pdb_id, chain))

    return pdb_list