deepfindr / gnn-project

A Graph Neural Network project on HIV data
255 stars 89 forks source link

dataset_featurizer.py referencing a base Class of DeepChem MolGraphConvFeaturizer? #4

Closed shi-kejian closed 2 years ago

shi-kejian commented 2 years ago

Hi! Thanks for the great effort.

self.process()
  File "/..../dataset_featurizer.py", line 53, in process
    f = featurizer.featurize(mol["smiles"])
  > data = f[0].to_pyg_graph()
AttributeError: 'numpy.ndarray' object has no attribute 'to_pyg_graph'

It seems like the return of featurizer.featurize is a np array not an GraphData object.

shi-kejian commented 2 years ago

making a PR to solve this

claudiofernandez commented 1 year ago

Hello, I am currently dealing with a related issue in the code, when converting to PyTorch Geometric graph in dataset_featurizer.py: data = f.to_pyg_graph() I run into this error: TypeError: type object got multiple values for keyword argument 'pos'

The f in this case looks like this: GraphData(node_features=[46, 30], edge_index=[2, 108], edge_features=[108, 11], pos=[0])

This has been created from row = ('level_0', 0) ('Unnamed: 0', 3999) ('index', 3999) ('smiles', 'CSc1cc2[n+]3c(c1)-c1cccc[n+]1[Zn-4]314([n+]3ccccc3-2)[n+]2ccccc2-c2cc(SC)cc([n+]21)-c1cccc[n+]14.[O-]Cl+3([O-])[O-]') ('activity', 'CI') ('HIV_active', 0)

I don't really know what to do or how to solve it.