a-r-j / graphein

Protein Graph Library
https://graphein.ai/
MIT License
1.04k stars 132 forks source link

Can not find a function ProteinGraph function anymore #399

Closed velocirraptor23 closed 1 month ago

velocirraptor23 commented 5 months ago

I was trying to reproduce the notebooks to train the PSCDB data set but I can not find this function: from graphein.construct_graphs import ProteinGraph

Any way you can help me with this?

BW,

Cesar

a-r-j commented 5 months ago

Could you point me to the line in question? I suspect it should be ProteinGraphConfig.

velocirraptor23 commented 4 months ago

Thanks a lot for your response. seems there is a change in the code from the newer versions. And your suggestion worked. Now I am facing another issue: 0%| | 0/757 [00:00<?, ?it/s]


AttributeError Traceback (most recent call last) Cell In[7], line 12 5 pg = ProteinGraphConfig(granularity='CA', insertions=False, keep_hets=[], 6 node_featuriser='meiler', get_contacts_path='/Users/arianjamasb/github/getcontacts', 7 pdb_dir='../../examples/pdbs/', 8 contacts_dir='../../examples/contacts/', 9 exclude_waters=True, covalent_bonds=False, include_ss=True) 11 # Build Graphs ---> 12 train_graphs = [pg.dgl_graph_from_pdb_code(pdb_code=x_train['Free PDB'].iloc[i], 13 chain_selection=list(x_train['Free Chains'].iloc[i])) for i in tqdm(range(len(x_train)))] 15 test_graphs = [pg.dgl_graph_from_pdb_code(pdb_code=x_test['Free PDB'].iloc[i], 16 chain_selection=list(x_test['Free Chains'].iloc[i])) for i in tqdm(range(len(x_test)))]

Cell In[7], line 12, in (.0) 5 pg = ProteinGraphConfig(granularity='CA', insertions=False, keep_hets=[], 6 node_featuriser='meiler', get_contacts_path='/Users/arianjamasb/github/getcontacts', 7 pdb_dir='../../examples/pdbs/', 8 contacts_dir='../../examples/contacts/', 9 exclude_waters=True, covalent_bonds=False, include_ss=True) 11 # Build Graphs ---> 12 train_graphs = [pg.dgl_graph_from_pdb_code(pdb_code=x_train['Free PDB'].iloc[i], 13 chain_selection=list(x_train['Free Chains'].iloc[i])) for i in tqdm(range(len(x_train)))] 15 test_graphs = [pg.dgl_graph_from_pdb_code(pdb_code=x_test['Free PDB'].iloc[i], 16 chain_selection=list(x_test['Free Chains'].iloc[i])) for i in tqdm(range(len(x_test)))]

AttributeError: 'ProteinGraphConfig' object has no attribute 'dgl_graph_from_pdb_code'

This function is not found anymore. dgl_graph_from_pdb_code.

Just wonderign if this outdated as well.

BW,

Cesar

a-r-j commented 4 months ago

Yes, I think it is.

I think the method you want is this one: https://github.com/a-r-j/graphein/blob/27463a5ca0b9714ba131486e0838eceebcb1ea15/graphein/ml/conversion.py#L190

velocirraptor23 commented 4 months ago

Perfect. I am going to try this.

BW,

Cesar

a-r-j commented 1 month ago

Closing, feel free to reopen if not resolved.