Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not find a function ProteinGraph function anymore #399

Open
velocirraptor23 opened this issue Jun 17, 2024 · 4 comments
Open

Can not find a function ProteinGraph function anymore #399

velocirraptor23 opened this issue Jun 17, 2024 · 4 comments

Comments

@velocirraptor23
Copy link

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
Copy link
Owner

a-r-j commented Jun 19, 2024

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

@velocirraptor23
Copy link
Author

velocirraptor23 commented Jul 1, 2024

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
Copy link
Owner

a-r-j commented Jul 1, 2024

Yes, I think it is.

I think the method you want is this one:

def convert_nx_to_dgl(self, G: nx.Graph) -> dgl.DGLGraph:

@velocirraptor23
Copy link
Author

Perfect. I am going to try this.

BW,

Cesar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants