<jupyter_start><jupyter_text>Bio Unit                        The asymmetric unit of PDB ID 2o2q                            The biological assembly 1 of PDB ID 2o2q                            The biological assembly 2 of PDB ID 2o2q                            The biological assembly 3 of PDB ID 2o2q                                                                                                                                     Validation<jupyter_code>pdb_demo = PDB('2o2q')
@unsync
async def pipe_demo(pdb_demo):
    assg_oper_df = await pdb_demo.fetch_from_modelServer_api(
        'atoms',
        data_collection=await pdb_demo.pipe_assg_data_collection(), 
        then_func=PDB.to_assg_oper_df)
    res2eec_df = await pdb_demo.get_res2eec_df()
    ed_as_df = await pdb_demo.fetch_from_web_api('api/pdb/entry/assembly/', PDB.assembly2eec)
    eec_as_df = await pdb_demo.get_eec_as_df() # NOTE: TO BE CHECK
    return assg_oper_df, res2eec_df, ed_as_df, eec_as_df


%time assg_oper_df, res2eec_df, ed_as_df, eec_as_df = pipe_demo(pdb_demo).result()
%styledf pdb_demo.fetch_from_web_api('api/pdb/entry/assembly/', PDB.to_dataframe).result()[['pdb_id', 'assembly_id', 'entity_id', 'molecule_name', 'molecule_type','in_chains']]
pdb_demo.fetch_from_web_api('api/pdb/entry/molecules/', PDB.to_dataframe).result()
assg_oper_df.merge(res2eec_df,how='outer')
new_id_dict = dict()
for entity_id in res2eec_df.entity_id.unique():
    original_id = res2eec_df.struct_asym_id[res2eec_df.entity_id.eq(entity_id)]
    new_id = ed_as_df[ed_as_df.entity_id.eq(entity_id) & ~ed_as_df.struct_asym_id_in_assembly.isin(original_id)].struct_asym_id_in_assembly.unique()
    new_id_dict[entity_id] = new_id

new_id_check_dict = [(key, chain) for key, value in new_id_dict.items() for chain in value if chain in res2eec_df.struct_asym_id.unique()]

new_id_dict
new_id_check_dict
pdb_demo.set_assembly().result()
pdb_demo.assembly
pdb_demo.assembly[3].pipe_protein_ligand_interface().result()
# pdb_demo.assembly[3].interface
pdb_demo_3_ifl = pdb_demo.assembly[3].fetch_from_web_api('api/pisa/interfacelist/', PDBAssemble.to_interfacelist_df).result()[['struct_asym_id_in_assembly_1', 'structure_1.range', 'struct_asym_id_in_assembly_2', 'structure_2.range' ,'interface_id', 'structure_2.symmetry_operator']]

%styledf pdb_demo_3_ifl<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10136286201022146, 'fraction_numerical': 0.014054514480408859, 'mean_word_length': 3.716867469879518, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '569943', 'license': 'MIT', 'n_tokens_mistral': 898, 'n_tokens_neox': 875, 'n_words': 126, 'path': 'test/test_chain_id.ipynb', 'repo_name': 'NatureGeorge/pdb-profiling', 'size': '2348'}