Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions chebai_graph/preprocessing/datasets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@
ChEBI50_WFGE_WGN_AsPerNodeType,
ChEBI50_WFGE_WGN_GraphProp,
ChEBI50GraphData,
ChEBI25GraphProperties,
ChEBI50GraphProperties,
ChEBI100GraphProperties,
)
from .pubchem import PubChemGraphProperties

__all__ = [
"ChEBI50GraphFGAugmentorReader",
"ChEBI25GraphProperties",
"ChEBI50GraphProperties",
"ChEBI100GraphProperties",
"ChEBI50GraphData",
Expand Down
7 changes: 7 additions & 0 deletions chebai_graph/preprocessing/datasets/chebi.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import torch
import tqdm
from chebai.preprocessing.datasets.chebi import (
ChEBIOver25,
ChEBIOver50,
ChEBIOver100,
ChEBIOverX,
Expand Down Expand Up @@ -705,6 +706,12 @@ def load_processed_data_from_file(self, filename):
return base_df[base_data[0].keys()].to_dict("records")


class ChEBI25GraphProperties(GraphPropertiesMixIn, ChEBIOver25):
"""ChEBIOver25 dataset with molecular property encodings."""

THRESHOLD = 25


class ChEBI50GraphProperties(GraphPropertiesMixIn, ChEBIOver50):
"""ChEBIOver50 dataset with molecular property encodings."""

Expand Down
14 changes: 14 additions & 0 deletions configs/data/chebi25_graph_properties.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
class_path: chebai_graph.preprocessing.datasets.ChEBI25GraphProperties
init_args:
properties:
- chebai_graph.preprocessing.properties.AtomType
- chebai_graph.preprocessing.properties.NumAtomBonds
- chebai_graph.preprocessing.properties.AtomCharge
- chebai_graph.preprocessing.properties.AtomAromaticity
- chebai_graph.preprocessing.properties.AtomHybridization
- chebai_graph.preprocessing.properties.AtomNumHs
- chebai_graph.preprocessing.properties.BondType
- chebai_graph.preprocessing.properties.BondInRing
- chebai_graph.preprocessing.properties.BondAromaticity
#- chebai_graph.preprocessing.properties.MoleculeNumRings
- chebai_graph.preprocessing.properties.RDKit2DNormalized
5 changes: 3 additions & 2 deletions configs/model/gat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ init_args:
optimizer_kwargs:
lr: 1e-3
config:
in_channels: 158 # number of node/atom properties
in_channels: 161 # number of node/atom properties
hidden_channels: 256
out_channels: 512
num_layers: 4
edge_dim: 7 # number of bond properties
edge_dim: 8 # number of bond properties
heads: 8 # the number of heads should be divisible by output channels (hidden channels if output channel not given)
v2: True # This uses `torch_geometric.nn.conv.GATv2Conv` convolution layers, set False to use `GATConv`
dropout: 0
n_molecule_properties: 0
n_linear_layers: 1
4 changes: 2 additions & 2 deletions configs/model/resgated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ init_args:
optimizer_kwargs:
lr: 1e-3
config:
in_channels: 158 # number of node/atom properties
in_channels: 161 # number of node/atom properties
hidden_channels: 256
out_channels: 512
num_layers: 4
edge_dim: 7 # number of bond properties
edge_dim: 8 # number of bond properties
dropout: 0
n_molecule_properties: 0
n_linear_layers: 1
Loading