graphein icon indicating copy to clipboard operation
graphein copied to clipboard

Can not find a function ProteinGraph function anymore

Open velocirraptor23 opened this issue 1 year ago • 4 comments

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

velocirraptor23 avatar Jun 17 '24 16:06 velocirraptor23

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

a-r-j avatar Jun 19 '24 16:06 a-r-j

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

velocirraptor23 avatar Jul 01 '24 16:07 velocirraptor23

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

a-r-j avatar Jul 01 '24 16:07 a-r-j

Perfect. I am going to try this.

BW,

Cesar

velocirraptor23 avatar Jul 09 '24 16:07 velocirraptor23

Closing, feel free to reopen if not resolved.

a-r-j avatar Oct 12 '24 22:10 a-r-j