def hetero2homo_graph(hetero_graph,mol): rd_mol = mol rdkit.Chem.SanitizeMol(rd_mol) atom_featurizer = CanonicalAtomFeaturizer() ### convert DGL hetero graph to DGL graph homo_graph = dgl.DGLGraph() homo_graph.from_networkx(hetero_graph.to_networkx()) homo_graph.ndata.update(atom_featurizer(rd_mol)) homo_graph.edata['e'] = hetero_graph.edata['distance'] return homo_graph
from utils import chirality GCN_Tox21 = { 'random_seed': 0, 'batch_size': 128, 'lr': 1e-3, 'num_epochs': 100, 'atom_data_field': 'h', 'frac_train': 0.8, 'frac_val': 0.1, 'frac_test': 0.1, 'in_feats': 74, 'gcn_hidden_feats': [64, 64], 'classifier_hidden_feats': 64, 'patience': 10, 'atom_featurizer': CanonicalAtomFeaturizer(), 'metric_name': 'roc_auc' } GAT_Tox21 = { 'random_seed': 0, 'batch_size': 128, 'lr': 1e-3, 'num_epochs': 100, 'atom_data_field': 'h', 'frac_train': 0.8, 'frac_val': 0.1, 'frac_test': 0.1, 'in_feats': 74, 'gat_hidden_feats': [32, 32], 'classifier_hidden_feats': 64,
def smiles_to_dgl_graph( smiles_str: str, node_featurizer: BaseAtomFeaturizer = CanonicalAtomFeaturizer() ) -> DGLGraph: return smiles_to_bigraph(smiles_str, atom_featurizer=node_featurizer)