def delete_chain(fhandle, chain_set):
    """Removes specific chains from the structure.
    """
    records = 'ATOM', 'HETATM', 'TER', 'ANISOU'
    for line in fhandle:
        if line.startswith(records):
            if line[21] in chain_set:
                continue
        yield line
