def select_segment_id(fhandle, segment_set):
    """Filters the PDB file for specific segment identifiers.
    """
    records = 'ATOM', 'HETATM', 'ANISOU'
    for line in fhandle:
        if line.startswith(records):
            if line[72:76].strip() not in segment_set:
                continue
        yield line
