diff --git a/.gitignore b/.gitignore index d01eecf..95daf78 100644 --- a/.gitignore +++ b/.gitignore @@ -174,3 +174,5 @@ electra_pretrained.ckpt *.out *.sh *.ckpt + +!configs/data/augmented/aug-ablation/*.sh diff --git a/chebai_graph/models/architectures/base.py b/chebai_graph/models/architectures/base.py index 514e287..64dca7c 100644 --- a/chebai_graph/models/architectures/base.py +++ b/chebai_graph/models/architectures/base.py @@ -26,7 +26,20 @@ def _get_prediction_and_labels( Returns: tuple[torch.Tensor, torch.Tensor]: Tuple of (predictions, labels). """ - return torch.sigmoid(output), labels.int() + valid_label_mask = data["loss_kwargs"]["valid_label_mask"] + predictions = torch.sigmoid(output) + labels = labels.int() + + if valid_label_mask is not None: + labels[~valid_label_mask] = -1 # Mark invalid labels as -1 + # https://lightning.ai/docs/torchmetrics/stable/classification/auroc#multilabelauroc + # -1 as we torchmetrics ignores -1 labels in multilabel metrics + # metric = MultilabelAUROC( + # num_labels=labels.shape[1], + # ignore_index=-1, + # ) + + return predictions, labels def _process_labels_in_batch(self, batch: XYData) -> torch.Tensor | None: """ @@ -183,3 +196,25 @@ def forward(self, batch: dict) -> torch.Tensor: if self.use_batch_norm: a = self.batch_norm(a) return self.lin_sequential(a) + + def configure_optimizers(self, **kwargs) -> torch.optim.Optimizer: + optimizer_kwargs = dict(self.optimizer_kwargs) + + default_lr = optimizer_kwargs.pop("lr", None) + gnn_lr = optimizer_kwargs.pop("lr_gnn", default_lr) + linear_lr = optimizer_kwargs.pop("lr_linear", default_lr) + + if gnn_lr is None or linear_lr is None: + raise ValueError("Set lr or both lr_gnn and lr_linear") + + linear_params = list(self.lin_sequential.parameters()) + if self.use_batch_norm: + linear_params.extend(self.batch_norm.parameters()) + + return torch.optim.Adamax( + [ + {"params": self.gnn.parameters(), "lr": gnn_lr}, + {"params": linear_params, "lr": linear_lr}, + ], + **optimizer_kwargs, + ) diff --git a/chebai_graph/preprocessing/bin/bace/AtomCharge/indices_one_hot.txt b/chebai_graph/preprocessing/bin/bace/AtomCharge/indices_one_hot.txt new file mode 100644 index 0000000..d7e52d1 --- /dev/null +++ b/chebai_graph/preprocessing/bin/bace/AtomCharge/indices_one_hot.txt @@ -0,0 +1,3 @@ +0 +1 +-1 diff --git a/chebai_graph/preprocessing/bin/bace/AtomFunctionalGroup/indices_one_hot.txt b/chebai_graph/preprocessing/bin/bace/AtomFunctionalGroup/indices_one_hot.txt new file mode 100644 index 0000000..b621c2a --- /dev/null +++ b/chebai_graph/preprocessing/bin/bace/AtomFunctionalGroup/indices_one_hot.txt @@ -0,0 +1,44 @@ +RING_6 +difluoromethyl +RING_5 +ether +alkyne +alkyl +primary_amine +fluoro +amide +graph_fg +NO_FG +alkene +tertiary_carbon +alkene_carbon +nitrile +trifluoromethyl +ketone +chloro +quaternary_carbon +sulfonyl +hydroxyl +bromo +secondary_amine +ester +aldoxime +sulfide +iodo +tertiary_amine +RING_4 +secondary_ketimine +ketoxime +RING_3 +carboxylate +acetal +sulfinyl +RING_7 +RING_16 +RING_15 +nitro +primary_ketimine +sulfonate_ester +RING_8 +RING_14 +RING_13 diff --git a/chebai_graph/preprocessing/bin/bace/AtomHybridization/indices_one_hot.txt b/chebai_graph/preprocessing/bin/bace/AtomHybridization/indices_one_hot.txt new file mode 100644 index 0000000..7c99da3 --- /dev/null +++ b/chebai_graph/preprocessing/bin/bace/AtomHybridization/indices_one_hot.txt @@ -0,0 +1,3 @@ +SP2 +SP3 +SP diff --git a/chebai_graph/preprocessing/bin/bace/AtomNodeLevel/indices_one_hot.txt b/chebai_graph/preprocessing/bin/bace/AtomNodeLevel/indices_one_hot.txt new file mode 100644 index 0000000..2d65776 --- /dev/null +++ b/chebai_graph/preprocessing/bin/bace/AtomNodeLevel/indices_one_hot.txt @@ -0,0 +1,3 @@ +atom_node_lvl +fg_node_lvl +graph_node_level diff --git a/chebai_graph/preprocessing/bin/bace/AtomNumHs/indices_one_hot.txt b/chebai_graph/preprocessing/bin/bace/AtomNumHs/indices_one_hot.txt new file mode 100644 index 0000000..c4b216a --- /dev/null +++ b/chebai_graph/preprocessing/bin/bace/AtomNumHs/indices_one_hot.txt @@ -0,0 +1,4 @@ +0 +1 +3 +2 diff --git a/chebai_graph/preprocessing/bin/bace/AtomType/indices_one_hot.txt b/chebai_graph/preprocessing/bin/bace/AtomType/indices_one_hot.txt new file mode 100644 index 0000000..6da4980 --- /dev/null +++ b/chebai_graph/preprocessing/bin/bace/AtomType/indices_one_hot.txt @@ -0,0 +1,8 @@ +6 +7 +8 +9 +17 +16 +35 +53 diff --git a/chebai_graph/preprocessing/bin/bace/BondLevel/indices_one_hot.txt b/chebai_graph/preprocessing/bin/bace/BondLevel/indices_one_hot.txt new file mode 100644 index 0000000..6b48d66 --- /dev/null +++ b/chebai_graph/preprocessing/bin/bace/BondLevel/indices_one_hot.txt @@ -0,0 +1,4 @@ +within_atoms_lvl +atom_fg_lvl +within_fg_lvl +to_graphNode_lvl diff --git a/chebai_graph/preprocessing/bin/bace/BondType/indices_one_hot.txt b/chebai_graph/preprocessing/bin/bace/BondType/indices_one_hot.txt new file mode 100644 index 0000000..f1a2ce5 --- /dev/null +++ b/chebai_graph/preprocessing/bin/bace/BondType/indices_one_hot.txt @@ -0,0 +1,4 @@ +SINGLE +AROMATIC +TRIPLE +DOUBLE diff --git a/chebai_graph/preprocessing/bin/bace/NumAtomBonds/indices_one_hot.txt b/chebai_graph/preprocessing/bin/bace/NumAtomBonds/indices_one_hot.txt new file mode 100644 index 0000000..cf286d6 --- /dev/null +++ b/chebai_graph/preprocessing/bin/bace/NumAtomBonds/indices_one_hot.txt @@ -0,0 +1,4 @@ +3 +2 +4 +1 diff --git a/chebai_graph/preprocessing/bin/bbbp/AtomCharge/indices_one_hot.txt b/chebai_graph/preprocessing/bin/bbbp/AtomCharge/indices_one_hot.txt new file mode 100644 index 0000000..7b6a00a --- /dev/null +++ b/chebai_graph/preprocessing/bin/bbbp/AtomCharge/indices_one_hot.txt @@ -0,0 +1,4 @@ +0 +1 +-1 +2 diff --git a/chebai_graph/preprocessing/bin/bbbp/AtomFunctionalGroup/indices_one_hot.txt b/chebai_graph/preprocessing/bin/bbbp/AtomFunctionalGroup/indices_one_hot.txt new file mode 100644 index 0000000..d2ee211 --- /dev/null +++ b/chebai_graph/preprocessing/bin/bbbp/AtomFunctionalGroup/indices_one_hot.txt @@ -0,0 +1,80 @@ +alkyl +ester +chloro +RING_6 +tertiary_amine +graph_fg +tertiary_carbon +primary_amine +dichloromethyl +sulfonyl +ketone +secondary_amine +hydroxyl +ether +quaternary_carbon +amide +NO_FG +carboxyl +nitro +alkene +alkene_carbon +secondary_ketimine +secondary_aldimine +carboxylate +iodo +aldoxime +bromo +alkyne +fluoro +carbamate +trifluoromethyl +sulfide +trichloromethyl +hemiacetal +primary_ketimine +azide +4_ammonium_ion +sulfonate_ester +ketoxime +nitroso +sulfhydryl +difluoromethyl +fluorochloromethyl +chlorobromomethyl +phosphono +carbodithio +disulfide +difluorochloromethyl +carbonate_ester +phosphate +RING_5 +thiolester +RING_7 +nitrile +phosphoryl +aldehyde +sulfinyl +thioketone +acetal +RING_4 +sulfonic_acid +imide +RING_14 +RING_24 +amidine +RING_3 +RING_9 +RING_19 +RING_16 +RING_8 +isonitrile +RING_23 +RING_12 +RING_21 +RING_17 +RING_30 +RING_33 +RING_36 +azo +RING_15 diff --git a/chebai_graph/preprocessing/bin/bbbp/AtomHybridization/indices_one_hot.txt b/chebai_graph/preprocessing/bin/bbbp/AtomHybridization/indices_one_hot.txt new file mode 100644 index 0000000..0e4a9aa --- /dev/null +++ b/chebai_graph/preprocessing/bin/bbbp/AtomHybridization/indices_one_hot.txt @@ -0,0 +1,4 @@ +SP3 +SP2 +S +SP diff --git a/chebai_graph/preprocessing/bin/bbbp/AtomNodeLevel/indices_one_hot.txt b/chebai_graph/preprocessing/bin/bbbp/AtomNodeLevel/indices_one_hot.txt new file mode 100644 index 0000000..2d65776 --- /dev/null +++ b/chebai_graph/preprocessing/bin/bbbp/AtomNodeLevel/indices_one_hot.txt @@ -0,0 +1,3 @@ +atom_node_lvl +fg_node_lvl +graph_node_level diff --git a/chebai_graph/preprocessing/bin/bbbp/AtomNumHs/indices_one_hot.txt b/chebai_graph/preprocessing/bin/bbbp/AtomNumHs/indices_one_hot.txt new file mode 100644 index 0000000..35f5032 --- /dev/null +++ b/chebai_graph/preprocessing/bin/bbbp/AtomNumHs/indices_one_hot.txt @@ -0,0 +1,4 @@ +2 +0 +1 +3 diff --git a/chebai_graph/preprocessing/bin/bbbp/AtomType/indices_one_hot.txt b/chebai_graph/preprocessing/bin/bbbp/AtomType/indices_one_hot.txt new file mode 100644 index 0000000..9500570 --- /dev/null +++ b/chebai_graph/preprocessing/bin/bbbp/AtomType/indices_one_hot.txt @@ -0,0 +1,13 @@ +6 +17 +8 +7 +16 +11 +53 +35 +9 +1 +15 +5 +20 diff --git a/chebai_graph/preprocessing/bin/bbbp/BondLevel/indices_one_hot.txt b/chebai_graph/preprocessing/bin/bbbp/BondLevel/indices_one_hot.txt new file mode 100644 index 0000000..6b48d66 --- /dev/null +++ b/chebai_graph/preprocessing/bin/bbbp/BondLevel/indices_one_hot.txt @@ -0,0 +1,4 @@ +within_atoms_lvl +atom_fg_lvl +within_fg_lvl +to_graphNode_lvl diff --git a/chebai_graph/preprocessing/bin/bbbp/BondType/indices_one_hot.txt b/chebai_graph/preprocessing/bin/bbbp/BondType/indices_one_hot.txt new file mode 100644 index 0000000..a134437 --- /dev/null +++ b/chebai_graph/preprocessing/bin/bbbp/BondType/indices_one_hot.txt @@ -0,0 +1,4 @@ +DOUBLE +SINGLE +AROMATIC +TRIPLE diff --git a/chebai_graph/preprocessing/bin/bbbp/NumAtomBonds/indices_one_hot.txt b/chebai_graph/preprocessing/bin/bbbp/NumAtomBonds/indices_one_hot.txt new file mode 100644 index 0000000..5d07eee --- /dev/null +++ b/chebai_graph/preprocessing/bin/bbbp/NumAtomBonds/indices_one_hot.txt @@ -0,0 +1,5 @@ +2 +4 +1 +3 +0 diff --git a/chebai_graph/preprocessing/bin/clin_tox/AtomCharge/indices_one_hot.txt b/chebai_graph/preprocessing/bin/clin_tox/AtomCharge/indices_one_hot.txt new file mode 100644 index 0000000..374de68 --- /dev/null +++ b/chebai_graph/preprocessing/bin/clin_tox/AtomCharge/indices_one_hot.txt @@ -0,0 +1,6 @@ +0 +-1 +1 +3 +2 +-2 diff --git a/chebai_graph/preprocessing/bin/clin_tox/AtomFunctionalGroup/indices_one_hot.txt b/chebai_graph/preprocessing/bin/clin_tox/AtomFunctionalGroup/indices_one_hot.txt new file mode 100644 index 0000000..36bc343 --- /dev/null +++ b/chebai_graph/preprocessing/bin/clin_tox/AtomFunctionalGroup/indices_one_hot.txt @@ -0,0 +1,84 @@ +alkyl +chloro +RING_6 +ether +secondary_amine +fluoro +graph_fg +tertiary_carbon +hydroxyl +ketone +sulfonyl +carboxylate +RING_5 +NO_FG +amide +sulfide +RING_4 +quaternary_carbon +alkyne +alkene +primary_amine +carboxyl +trifluoromethyl +ester +alkene_carbon +RING_20 +sulfhydryl +nitrile +RING_3 +RING_29 +RING_7 +4_ammonium_ion +acetal +RING_9 +iodo +RING_38 +sulfinyl +difluoromethyl +imide +RING_16 +tertiary_amine +nitro +RING_8 +secondary_ketimine +nitrate +sulfonic_acid +carbamate +secondary_aldimine +bromo +thioketone +RING_14 +azo +RING_33 +trichloromethyl +RING_15 +ketoxime +phosphodiester +RING_24 +RING_22 +aldehyde +RING_18 +RING_21 +nitroso +dichloromethyl +carbonate_ester +silyl_ether +thiolester +borono +aldoxime +sulfonate_ester +RING_23 +RING_19 +RING_25 +carbodithio +disulfide +RING_36 +RING_31 +fluorochloromethyl +RING_12 +phosphate +azide +chlorobromomethyl +bromodifluoromethyl +phosphino diff --git a/chebai_graph/preprocessing/bin/clin_tox/AtomHybridization/indices_one_hot.txt b/chebai_graph/preprocessing/bin/clin_tox/AtomHybridization/indices_one_hot.txt new file mode 100644 index 0000000..a96b9b3 --- /dev/null +++ b/chebai_graph/preprocessing/bin/clin_tox/AtomHybridization/indices_one_hot.txt @@ -0,0 +1,7 @@ +SP3 +SP2 +SP +S +SP3D2 +UNSPECIFIED +SP3D diff --git a/chebai_graph/preprocessing/bin/clin_tox/AtomNodeLevel/indices_one_hot.txt b/chebai_graph/preprocessing/bin/clin_tox/AtomNodeLevel/indices_one_hot.txt new file mode 100644 index 0000000..2d65776 --- /dev/null +++ b/chebai_graph/preprocessing/bin/clin_tox/AtomNodeLevel/indices_one_hot.txt @@ -0,0 +1,3 @@ +atom_node_lvl +fg_node_lvl +graph_node_level diff --git a/chebai_graph/preprocessing/bin/clin_tox/AtomNumHs/indices_one_hot.txt b/chebai_graph/preprocessing/bin/clin_tox/AtomNumHs/indices_one_hot.txt new file mode 100644 index 0000000..1127527 --- /dev/null +++ b/chebai_graph/preprocessing/bin/clin_tox/AtomNumHs/indices_one_hot.txt @@ -0,0 +1,4 @@ +3 +0 +2 +1 diff --git a/chebai_graph/preprocessing/bin/clin_tox/AtomType/indices_one_hot.txt b/chebai_graph/preprocessing/bin/clin_tox/AtomType/indices_one_hot.txt new file mode 100644 index 0000000..2c8a324 --- /dev/null +++ b/chebai_graph/preprocessing/bin/clin_tox/AtomType/indices_one_hot.txt @@ -0,0 +1,30 @@ +6 +17 +7 +8 +9 +16 +15 +53 +80 +1 +13 +35 +79 +0 +27 +22 +78 +33 +34 +30 +14 +5 +29 +24 +81 +43 +83 +25 +20 +26 diff --git a/chebai_graph/preprocessing/bin/clin_tox/BondLevel/indices_one_hot.txt b/chebai_graph/preprocessing/bin/clin_tox/BondLevel/indices_one_hot.txt new file mode 100644 index 0000000..6b48d66 --- /dev/null +++ b/chebai_graph/preprocessing/bin/clin_tox/BondLevel/indices_one_hot.txt @@ -0,0 +1,4 @@ +within_atoms_lvl +atom_fg_lvl +within_fg_lvl +to_graphNode_lvl diff --git a/chebai_graph/preprocessing/bin/clin_tox/BondType/indices_one_hot.txt b/chebai_graph/preprocessing/bin/clin_tox/BondType/indices_one_hot.txt new file mode 100644 index 0000000..bdc90d7 --- /dev/null +++ b/chebai_graph/preprocessing/bin/clin_tox/BondType/indices_one_hot.txt @@ -0,0 +1,5 @@ +SINGLE +AROMATIC +DOUBLE +TRIPLE +DATIVE diff --git a/chebai_graph/preprocessing/bin/clin_tox/NumAtomBonds/indices_one_hot.txt b/chebai_graph/preprocessing/bin/clin_tox/NumAtomBonds/indices_one_hot.txt new file mode 100644 index 0000000..3c2db51 --- /dev/null +++ b/chebai_graph/preprocessing/bin/clin_tox/NumAtomBonds/indices_one_hot.txt @@ -0,0 +1,6 @@ +1 +3 +2 +4 +0 +6 diff --git a/chebai_graph/preprocessing/bin/hiv/AtomCharge/indices_one_hot.txt b/chebai_graph/preprocessing/bin/hiv/AtomCharge/indices_one_hot.txt new file mode 100644 index 0000000..22aacd7 --- /dev/null +++ b/chebai_graph/preprocessing/bin/hiv/AtomCharge/indices_one_hot.txt @@ -0,0 +1,9 @@ +0 +1 +-1 +3 +-4 +-3 +-2 +2 +-5 diff --git a/chebai_graph/preprocessing/bin/hiv/AtomFunctionalGroup/indices_one_hot.txt b/chebai_graph/preprocessing/bin/hiv/AtomFunctionalGroup/indices_one_hot.txt new file mode 100644 index 0000000..e5b33d4 --- /dev/null +++ b/chebai_graph/preprocessing/bin/hiv/AtomFunctionalGroup/indices_one_hot.txt @@ -0,0 +1,122 @@ +alkyl +RING_6 +chloro +NO_FG +secondary_amine +graph_fg +carboxyl +primary_amine +sulfonic_acid +nitro +ketone +hydroxyl +sulfonyl +ester +nitroso +sulfhydryl +tertiary_carbon +tertiary_amine +dichloromethyl +nitrile +primary_ketimine +alkyne +alkene +ether +iodo +sulfide +secondary_aldimine +phosphoryl +thioketone +alkene_carbon +secondary_ketimine +nitrate +4_ammonium_ion +ketoxime +amide +amidine +trichloromethyl +fluoro +quaternary_carbon +hydrazone +disulfide +thiocyanate +carbamate +trifluoromethyl +phosphate +sulfonate_ester +sulfinyl +azo +bromo +imide +carbodithioic_acid +carbodithio +sulfino +silyl_ether +aldehyde +phosphono +azide +aldoxime +phosphino +trimethylsilyl +thionoester +thiolester +isonitrile +acetal +difluorochloromethyl +dibromomethyl +ketal +diiodomethyl +borono +isothiocyanate +difluoromethyl +tribromomethyl +carbonate_ester +hemiacetal +phosphodiester +carboxylate +orthoester +isocyanate +primary_aldimine +hemiketal +borinate +RING_5 +cyanate +RING_4 +RING_24 +RING_3 +thial +RING_7 +RING_12 +RING_9 +RING_16 +hydroperoxy +RING_15 +RING_18 +RING_8 +RING_35 +RING_10 +RING_19 +RING_17 +RING_29 +RING_23 +RING_27 +RING_11 +RING_14 +RING_20 +RING_33 +RING_13 +RING_31 +RING_21 +RING_28 +RING_22 +RING_30 +RING_34 +RING_54 +RING_38 +RING_36 +RING_26 +RING_32 +carboxylic_anhydride +RING_25 +carbothioic_S-acid +RING_40 diff --git a/chebai_graph/preprocessing/bin/hiv/AtomHybridization/indices_one_hot.txt b/chebai_graph/preprocessing/bin/hiv/AtomHybridization/indices_one_hot.txt new file mode 100644 index 0000000..cdc6985 --- /dev/null +++ b/chebai_graph/preprocessing/bin/hiv/AtomHybridization/indices_one_hot.txt @@ -0,0 +1,7 @@ +SP3 +SP2 +SP +S +SP3D2 +SP3D +UNSPECIFIED diff --git a/chebai_graph/preprocessing/bin/hiv/AtomNodeLevel/indices_one_hot.txt b/chebai_graph/preprocessing/bin/hiv/AtomNodeLevel/indices_one_hot.txt new file mode 100644 index 0000000..2d65776 --- /dev/null +++ b/chebai_graph/preprocessing/bin/hiv/AtomNodeLevel/indices_one_hot.txt @@ -0,0 +1,3 @@ +atom_node_lvl +fg_node_lvl +graph_node_level diff --git a/chebai_graph/preprocessing/bin/hiv/AtomNumHs/indices_one_hot.txt b/chebai_graph/preprocessing/bin/hiv/AtomNumHs/indices_one_hot.txt new file mode 100644 index 0000000..df4a3e9 --- /dev/null +++ b/chebai_graph/preprocessing/bin/hiv/AtomNumHs/indices_one_hot.txt @@ -0,0 +1,5 @@ +3 +1 +0 +2 +4 diff --git a/chebai_graph/preprocessing/bin/hiv/AtomType/indices_one_hot.txt b/chebai_graph/preprocessing/bin/hiv/AtomType/indices_one_hot.txt new file mode 100644 index 0000000..95c9cba --- /dev/null +++ b/chebai_graph/preprocessing/bin/hiv/AtomType/indices_one_hot.txt @@ -0,0 +1,54 @@ +6 +17 +8 +7 +15 +16 +33 +53 +9 +35 +14 +11 +34 +79 +50 +80 +32 +51 +82 +5 +19 +3 +83 +29 +67 +44 +65 +74 +27 +55 +25 +26 +75 +42 +78 +47 +24 +46 +89 +20 +31 +12 +30 +28 +77 +1 +40 +81 +45 +22 +52 +64 +92 +23 diff --git a/chebai_graph/preprocessing/bin/hiv/BondLevel/indices_one_hot.txt b/chebai_graph/preprocessing/bin/hiv/BondLevel/indices_one_hot.txt new file mode 100644 index 0000000..6b48d66 --- /dev/null +++ b/chebai_graph/preprocessing/bin/hiv/BondLevel/indices_one_hot.txt @@ -0,0 +1,4 @@ +within_atoms_lvl +atom_fg_lvl +within_fg_lvl +to_graphNode_lvl diff --git a/chebai_graph/preprocessing/bin/hiv/BondType/indices_one_hot.txt b/chebai_graph/preprocessing/bin/hiv/BondType/indices_one_hot.txt new file mode 100644 index 0000000..58c0a5c --- /dev/null +++ b/chebai_graph/preprocessing/bin/hiv/BondType/indices_one_hot.txt @@ -0,0 +1,5 @@ +SINGLE +DOUBLE +AROMATIC +TRIPLE +DATIVE diff --git a/chebai_graph/preprocessing/bin/hiv/NumAtomBonds/indices_one_hot.txt b/chebai_graph/preprocessing/bin/hiv/NumAtomBonds/indices_one_hot.txt new file mode 100644 index 0000000..88ddb48 --- /dev/null +++ b/chebai_graph/preprocessing/bin/hiv/NumAtomBonds/indices_one_hot.txt @@ -0,0 +1,11 @@ +1 +2 +3 +4 +0 +5 +6 +9 +7 +8 +10 diff --git a/chebai_graph/preprocessing/bin/muv/AtomCharge/indices_one_hot.txt b/chebai_graph/preprocessing/bin/muv/AtomCharge/indices_one_hot.txt new file mode 100644 index 0000000..d7e52d1 --- /dev/null +++ b/chebai_graph/preprocessing/bin/muv/AtomCharge/indices_one_hot.txt @@ -0,0 +1,3 @@ +0 +1 +-1 diff --git a/chebai_graph/preprocessing/bin/muv/AtomFunctionalGroup/indices_one_hot.txt b/chebai_graph/preprocessing/bin/muv/AtomFunctionalGroup/indices_one_hot.txt new file mode 100644 index 0000000..c55dc92 --- /dev/null +++ b/chebai_graph/preprocessing/bin/muv/AtomFunctionalGroup/indices_one_hot.txt @@ -0,0 +1,68 @@ +primary_amine +RING_6 +ketone +carboxyl +alkyl +tertiary_carbon +secondary_amine +graph_fg +hydroxyl +alkene +thioketone +bromo +fluoro +ester +ether +tertiary_amine +NO_FG +chloro +sulfonyl +difluoromethyl +quaternary_carbon +nitro +amide +alkyne +trifluoromethyl +aldoxime +alkene_carbon +nitrile +sulfide +secondary_aldimine +ketoxime +carbodithio +secondary_ketimine +thionoester +thiolester +sulfinyl +carbamate +thiocyanate +aldehyde +sulfonate_ester +amidine +trichloromethyl +sulfhydryl +sulfonic_acid +RING_5 +nitroso +acetal +carbonate_ester +imide +azo +primary_ketimine +dichloromethyl +RING_7 +RING_3 +RING_8 +hydrazone +RING_4 +RING_15 +RING_12 +azide +RING_13 +RING_18 +difluorochloromethyl +RING_14 +RING_9 +RING_11 +disulfide +4_ammonium_ion diff --git a/chebai_graph/preprocessing/bin/muv/AtomHybridization/indices_one_hot.txt b/chebai_graph/preprocessing/bin/muv/AtomHybridization/indices_one_hot.txt new file mode 100644 index 0000000..7c99da3 --- /dev/null +++ b/chebai_graph/preprocessing/bin/muv/AtomHybridization/indices_one_hot.txt @@ -0,0 +1,3 @@ +SP2 +SP3 +SP diff --git a/chebai_graph/preprocessing/bin/muv/AtomNodeLevel/indices_one_hot.txt b/chebai_graph/preprocessing/bin/muv/AtomNodeLevel/indices_one_hot.txt new file mode 100644 index 0000000..2d65776 --- /dev/null +++ b/chebai_graph/preprocessing/bin/muv/AtomNodeLevel/indices_one_hot.txt @@ -0,0 +1,3 @@ +atom_node_lvl +fg_node_lvl +graph_node_level diff --git a/chebai_graph/preprocessing/bin/muv/AtomNumHs/indices_one_hot.txt b/chebai_graph/preprocessing/bin/muv/AtomNumHs/indices_one_hot.txt new file mode 100644 index 0000000..52db5ae --- /dev/null +++ b/chebai_graph/preprocessing/bin/muv/AtomNumHs/indices_one_hot.txt @@ -0,0 +1,4 @@ +2 +1 +0 +3 diff --git a/chebai_graph/preprocessing/bin/muv/AtomType/indices_one_hot.txt b/chebai_graph/preprocessing/bin/muv/AtomType/indices_one_hot.txt new file mode 100644 index 0000000..c36ddc7 --- /dev/null +++ b/chebai_graph/preprocessing/bin/muv/AtomType/indices_one_hot.txt @@ -0,0 +1,7 @@ +7 +6 +8 +35 +9 +16 +17 diff --git a/chebai_graph/preprocessing/bin/muv/BondLevel/indices_one_hot.txt b/chebai_graph/preprocessing/bin/muv/BondLevel/indices_one_hot.txt new file mode 100644 index 0000000..6b48d66 --- /dev/null +++ b/chebai_graph/preprocessing/bin/muv/BondLevel/indices_one_hot.txt @@ -0,0 +1,4 @@ +within_atoms_lvl +atom_fg_lvl +within_fg_lvl +to_graphNode_lvl diff --git a/chebai_graph/preprocessing/bin/muv/BondType/indices_one_hot.txt b/chebai_graph/preprocessing/bin/muv/BondType/indices_one_hot.txt new file mode 100644 index 0000000..f14a241 --- /dev/null +++ b/chebai_graph/preprocessing/bin/muv/BondType/indices_one_hot.txt @@ -0,0 +1,4 @@ +SINGLE +DOUBLE +AROMATIC +TRIPLE diff --git a/chebai_graph/preprocessing/bin/muv/NumAtomBonds/indices_one_hot.txt b/chebai_graph/preprocessing/bin/muv/NumAtomBonds/indices_one_hot.txt new file mode 100644 index 0000000..94ebaf9 --- /dev/null +++ b/chebai_graph/preprocessing/bin/muv/NumAtomBonds/indices_one_hot.txt @@ -0,0 +1,4 @@ +1 +2 +3 +4 diff --git a/chebai_graph/preprocessing/bin/pcba/AtomCharge/indices_one_hot.txt b/chebai_graph/preprocessing/bin/pcba/AtomCharge/indices_one_hot.txt new file mode 100644 index 0000000..7897486 --- /dev/null +++ b/chebai_graph/preprocessing/bin/pcba/AtomCharge/indices_one_hot.txt @@ -0,0 +1,8 @@ +0 +1 +-1 +3 +2 +4 +5 +6 diff --git a/chebai_graph/preprocessing/bin/pcba/AtomFunctionalGroup/indices_one_hot.txt b/chebai_graph/preprocessing/bin/pcba/AtomFunctionalGroup/indices_one_hot.txt new file mode 100644 index 0000000..89e00f3 --- /dev/null +++ b/chebai_graph/preprocessing/bin/pcba/AtomFunctionalGroup/indices_one_hot.txt @@ -0,0 +1,127 @@ +alkyl +RING_6 +sulfide +RING_5 +ketone +trifluoromethyl +secondary_amine +graph_fg +NO_FG +amide +sulfonyl +ether +quaternary_carbon +tertiary_carbon +imide +carboxyl +nitrile +ester +primary_amine +alkyne +fluoro +tertiary_amine +nitro +RING_7 +chloro +hydroxyl +RING_3 +alkene +secondary_aldimine +bromo +thioketone +sulfinyl +RING_4 +secondary_ketimine +RING_12 +primary_ketimine +alkene_carbon +carbamate +aldehyde +phosphoryl +trimethylsilyl +carboxylate +ketoxime +RING_23 +difluoromethyl +sulfonate_ester +RING_14 +iodo +thiocyanate +RING_8 +disulfide +carbonate_ester +RING_19 +sulfhydryl +nitroso +acetal +aldoxime +borono +RING_16 +phosphono +RING_9 +RING_15 +hydrazone +RING_11 +4_ammonium_ion +thiolester +trichloromethyl +carbodithio +azo +azide +sulfonic_acid +dichloromethyl +phosphodiester +borinate +RING_13 +RING_18 +thial +RING_21 +RING_10 +isocyanate +isonitrile +RING_22 +RING_36 +RING_20 +phosphate +amidine +dibromomethyl +RING_17 +peroxy +RING_40 +silyl_ether +thionoester +nitrate +haloformyl +hemiacetal +RING_25 +isothiocyanate +difluorochloromethyl +RING_24 +nitrosooxy +RING_32 +carbodithioic_acid +hydroperoxy +sulfino +RING_26 +tribromomethyl +RING_30 +RING_29 +diiodomethyl +phosphino +chlorobromomethyl +RING_33 +RING_38 +RING_34 +bromodifluoromethyl +carboxylic_anhydride +bromodichloromethyl +RING_27 +dichlorosilane +RING_42 +ketal +RING_28 +RING_56 +RING_31 +RING_35 +fluorochloromethyl +RING_54 diff --git a/chebai_graph/preprocessing/bin/pcba/AtomHybridization/indices_one_hot.txt b/chebai_graph/preprocessing/bin/pcba/AtomHybridization/indices_one_hot.txt new file mode 100644 index 0000000..fb3232b --- /dev/null +++ b/chebai_graph/preprocessing/bin/pcba/AtomHybridization/indices_one_hot.txt @@ -0,0 +1,7 @@ +SP3 +SP2 +SP +SP3D +S +UNSPECIFIED +SP3D2 diff --git a/chebai_graph/preprocessing/bin/pcba/AtomNodeLevel/indices_one_hot.txt b/chebai_graph/preprocessing/bin/pcba/AtomNodeLevel/indices_one_hot.txt new file mode 100644 index 0000000..2d65776 --- /dev/null +++ b/chebai_graph/preprocessing/bin/pcba/AtomNodeLevel/indices_one_hot.txt @@ -0,0 +1,3 @@ +atom_node_lvl +fg_node_lvl +graph_node_level diff --git a/chebai_graph/preprocessing/bin/pcba/AtomNumHs/indices_one_hot.txt b/chebai_graph/preprocessing/bin/pcba/AtomNumHs/indices_one_hot.txt new file mode 100644 index 0000000..cad2399 --- /dev/null +++ b/chebai_graph/preprocessing/bin/pcba/AtomNumHs/indices_one_hot.txt @@ -0,0 +1,6 @@ +3 +1 +0 +2 +6 +4 diff --git a/chebai_graph/preprocessing/bin/pcba/AtomType/indices_one_hot.txt b/chebai_graph/preprocessing/bin/pcba/AtomType/indices_one_hot.txt new file mode 100644 index 0000000..166ffe2 --- /dev/null +++ b/chebai_graph/preprocessing/bin/pcba/AtomType/indices_one_hot.txt @@ -0,0 +1,44 @@ +6 +16 +7 +8 +9 +17 +35 +15 +14 +53 +5 +29 +79 +38 +50 +30 +33 +34 +48 +51 +1 +26 +82 +27 +78 +80 +3 +28 +22 +56 +44 +11 +13 +46 +25 +83 +47 +60 +24 +64 +32 +49 +74 +31 diff --git a/chebai_graph/preprocessing/bin/pcba/BondLevel/indices_one_hot.txt b/chebai_graph/preprocessing/bin/pcba/BondLevel/indices_one_hot.txt new file mode 100644 index 0000000..6b48d66 --- /dev/null +++ b/chebai_graph/preprocessing/bin/pcba/BondLevel/indices_one_hot.txt @@ -0,0 +1,4 @@ +within_atoms_lvl +atom_fg_lvl +within_fg_lvl +to_graphNode_lvl diff --git a/chebai_graph/preprocessing/bin/pcba/BondType/indices_one_hot.txt b/chebai_graph/preprocessing/bin/pcba/BondType/indices_one_hot.txt new file mode 100644 index 0000000..c819d38 --- /dev/null +++ b/chebai_graph/preprocessing/bin/pcba/BondType/indices_one_hot.txt @@ -0,0 +1,4 @@ +SINGLE +AROMATIC +DOUBLE +TRIPLE diff --git a/chebai_graph/preprocessing/bin/pcba/NumAtomBonds/indices_one_hot.txt b/chebai_graph/preprocessing/bin/pcba/NumAtomBonds/indices_one_hot.txt new file mode 100644 index 0000000..2efbda4 --- /dev/null +++ b/chebai_graph/preprocessing/bin/pcba/NumAtomBonds/indices_one_hot.txt @@ -0,0 +1,6 @@ +1 +2 +3 +4 +0 +5 diff --git a/chebai_graph/preprocessing/bin/sider/AtomCharge/indices_one_hot.txt b/chebai_graph/preprocessing/bin/sider/AtomCharge/indices_one_hot.txt new file mode 100644 index 0000000..6f89a5d --- /dev/null +++ b/chebai_graph/preprocessing/bin/sider/AtomCharge/indices_one_hot.txt @@ -0,0 +1,6 @@ +0 +1 +-1 +3 +2 +-2 diff --git a/chebai_graph/preprocessing/bin/sider/AtomFunctionalGroup/indices_one_hot.txt b/chebai_graph/preprocessing/bin/sider/AtomFunctionalGroup/indices_one_hot.txt new file mode 100644 index 0000000..6fbc2c2 --- /dev/null +++ b/chebai_graph/preprocessing/bin/sider/AtomFunctionalGroup/indices_one_hot.txt @@ -0,0 +1,93 @@ +alkyl +RING_6 +carboxyl +alkene +fluoro +sulfinyl +RING_5 +graph_fg +tertiary_carbon +secondary_amine +ketone +primary_amine +primary_ketimine +NO_FG +sulfide +hydroxyl +sulfonic_acid +bromo +4_ammonium_ion +chloro +quaternary_carbon +ether +carboxylate +tertiary_amine +amide +RING_3 +trifluoromethyl +ester +nitro +sulfonyl +iodo +secondary_ketimine +RING_7 +aldehyde +phosphono +alkyne +nitrile +carbamate +alkene_carbon +carbonate_ester +RING_4 +RING_18 +RING_24 +RING_14 +imide +sulfonate_ester +RING_81 +RING_20 +RING_8 +nitroso +RING_29 +RING_16 +RING_12 +RING_21 +sulfhydryl +thiolester +difluoromethyl +thioketone +RING_25 +RING_78 +RING_68 +RING_77 +nitrate +azo +RING_36 +phosphate +ketoxime +secondary_aldimine +dichloromethyl +carboxylic_anhydride +RING_33 +borono +RING_15 +diiodomethyl +RING_23 +carbodithio +disulfide +acetal +RING_40 +phosphodiester +fluorochloromethyl +RING_22 +RING_10 +RING_9 +azide +phosphino +RING_31 +RING_28 +RING_53 +RING_56 +RING_41 +RING_43 +RING_35 diff --git a/chebai_graph/preprocessing/bin/sider/AtomHybridization/indices_one_hot.txt b/chebai_graph/preprocessing/bin/sider/AtomHybridization/indices_one_hot.txt new file mode 100644 index 0000000..e9958eb --- /dev/null +++ b/chebai_graph/preprocessing/bin/sider/AtomHybridization/indices_one_hot.txt @@ -0,0 +1,6 @@ +SP3 +SP2 +S +SP3D +SP +SP3D2 diff --git a/chebai_graph/preprocessing/bin/sider/AtomNodeLevel/indices_one_hot.txt b/chebai_graph/preprocessing/bin/sider/AtomNodeLevel/indices_one_hot.txt new file mode 100644 index 0000000..2d65776 --- /dev/null +++ b/chebai_graph/preprocessing/bin/sider/AtomNodeLevel/indices_one_hot.txt @@ -0,0 +1,3 @@ +atom_node_lvl +fg_node_lvl +graph_node_level diff --git a/chebai_graph/preprocessing/bin/sider/AtomNumHs/indices_one_hot.txt b/chebai_graph/preprocessing/bin/sider/AtomNumHs/indices_one_hot.txt new file mode 100644 index 0000000..df4a3e9 --- /dev/null +++ b/chebai_graph/preprocessing/bin/sider/AtomNumHs/indices_one_hot.txt @@ -0,0 +1,5 @@ +3 +1 +0 +2 +4 diff --git a/chebai_graph/preprocessing/bin/sider/AtomType/indices_one_hot.txt b/chebai_graph/preprocessing/bin/sider/AtomType/indices_one_hot.txt new file mode 100644 index 0000000..384eb37 --- /dev/null +++ b/chebai_graph/preprocessing/bin/sider/AtomType/indices_one_hot.txt @@ -0,0 +1,40 @@ +6 +8 +9 +16 +7 +35 +17 +11 +64 +15 +24 +53 +47 +49 +1 +25 +29 +20 +62 +3 +19 +78 +39 +43 +31 +26 +5 +12 +38 +79 +33 +30 +56 +98 +34 +32 +27 +88 +81 +57 diff --git a/chebai_graph/preprocessing/bin/sider/BondLevel/indices_one_hot.txt b/chebai_graph/preprocessing/bin/sider/BondLevel/indices_one_hot.txt new file mode 100644 index 0000000..6b48d66 --- /dev/null +++ b/chebai_graph/preprocessing/bin/sider/BondLevel/indices_one_hot.txt @@ -0,0 +1,4 @@ +within_atoms_lvl +atom_fg_lvl +within_fg_lvl +to_graphNode_lvl diff --git a/chebai_graph/preprocessing/bin/sider/BondType/indices_one_hot.txt b/chebai_graph/preprocessing/bin/sider/BondType/indices_one_hot.txt new file mode 100644 index 0000000..f14a241 --- /dev/null +++ b/chebai_graph/preprocessing/bin/sider/BondType/indices_one_hot.txt @@ -0,0 +1,4 @@ +SINGLE +DOUBLE +AROMATIC +TRIPLE diff --git a/chebai_graph/preprocessing/bin/sider/NumAtomBonds/indices_one_hot.txt b/chebai_graph/preprocessing/bin/sider/NumAtomBonds/indices_one_hot.txt new file mode 100644 index 0000000..dfb5c6d --- /dev/null +++ b/chebai_graph/preprocessing/bin/sider/NumAtomBonds/indices_one_hot.txt @@ -0,0 +1,6 @@ +1 +2 +3 +4 +0 +6 diff --git a/chebai_graph/preprocessing/bin/tox21/AtomCharge/indices_one_hot.txt b/chebai_graph/preprocessing/bin/tox21/AtomCharge/indices_one_hot.txt new file mode 100644 index 0000000..a8bd8c3 --- /dev/null +++ b/chebai_graph/preprocessing/bin/tox21/AtomCharge/indices_one_hot.txt @@ -0,0 +1,6 @@ +0 +1 +-1 +2 +3 +-2 diff --git a/chebai_graph/preprocessing/bin/tox21/AtomFunctionalGroup/indices_one_hot.txt b/chebai_graph/preprocessing/bin/tox21/AtomFunctionalGroup/indices_one_hot.txt new file mode 100644 index 0000000..5aa0016 --- /dev/null +++ b/chebai_graph/preprocessing/bin/tox21/AtomFunctionalGroup/indices_one_hot.txt @@ -0,0 +1,115 @@ +alkyl +hemiacetal +ether +graph_fg +RING_18 +NO_FG +RING_6 +ester +tertiary_carbon +secondary_amine +ketone +carboxyl +RING_5 +amide +primary_amine +RING_4 +carboxylate +alkene +nitro +imide +4_ammonium_ion +bromo +chloro +hydroxyl +sulfonyl +fluoro +quaternary_carbon +alkene_carbon +RING_3 +alkyne +secondary_ketimine +nitrile +isocyanate +azo +tertiary_amine +trifluoromethyl +aldehyde +thiolester +sulfide +nitroso +phosphate +phosphoryl +RING_7 +iodo +acetal +carbodithio +carbonate_ester +RING_21 +difluoromethyl +disulfide +RING_25 +nitrate +carbamate +secondary_aldimine +sulfonic_acid +haloformyl +amidine +sulfhydryl +phosphono +dibromomethyl +RING_23 +trichloromethyl +sulfonate_ester +RING_40 +RING_24 +RING_15 +primary_ketimine +RING_29 +thioketone +aldoxime +RING_16 +nitrosooxy +sulfino +RING_36 +peroxy +RING_14 +ketoxime +thiocyanate +RING_8 +RING_17 +sulfinyl +dichloromethyl +primary_aldimine +tribromomethyl +RING_19 +RING_9 +silyl_ether +phosphodiester +RING_33 +azide +RING_27 +RING_26 +RING_20 +phosphino +RING_12 +trimethylsilyl +carboxylic_anhydride +orthoester +RING_10 +thionoester +isothiocyanate +borono +chlorobromomethyl +dichlorosilane +hydroperoxy +RING_35 +RING_30 +RING_28 +fluorochloromethyl +RING_13 +bromodichloromethyl +ketal +difluorochloromethyl +bromodifluoromethyl +RING_11 diff --git a/chebai_graph/preprocessing/bin/tox21/AtomHybridization/indices_one_hot.txt b/chebai_graph/preprocessing/bin/tox21/AtomHybridization/indices_one_hot.txt new file mode 100644 index 0000000..cdc6985 --- /dev/null +++ b/chebai_graph/preprocessing/bin/tox21/AtomHybridization/indices_one_hot.txt @@ -0,0 +1,7 @@ +SP3 +SP2 +SP +S +SP3D2 +SP3D +UNSPECIFIED diff --git a/chebai_graph/preprocessing/bin/tox21/AtomNodeLevel/indices_one_hot.txt b/chebai_graph/preprocessing/bin/tox21/AtomNodeLevel/indices_one_hot.txt new file mode 100644 index 0000000..2d65776 --- /dev/null +++ b/chebai_graph/preprocessing/bin/tox21/AtomNodeLevel/indices_one_hot.txt @@ -0,0 +1,3 @@ +atom_node_lvl +fg_node_lvl +graph_node_level diff --git a/chebai_graph/preprocessing/bin/tox21/AtomNumHs/indices_one_hot.txt b/chebai_graph/preprocessing/bin/tox21/AtomNumHs/indices_one_hot.txt new file mode 100644 index 0000000..5a694e8 --- /dev/null +++ b/chebai_graph/preprocessing/bin/tox21/AtomNumHs/indices_one_hot.txt @@ -0,0 +1,6 @@ +3 +2 +1 +0 +4 +6 diff --git a/chebai_graph/preprocessing/bin/tox21/AtomType/indices_one_hot.txt b/chebai_graph/preprocessing/bin/tox21/AtomType/indices_one_hot.txt new file mode 100644 index 0000000..64e481b --- /dev/null +++ b/chebai_graph/preprocessing/bin/tox21/AtomType/indices_one_hot.txt @@ -0,0 +1,50 @@ +6 +8 +7 +16 +15 +35 +17 +9 +56 +30 +26 +80 +53 +28 +5 +51 +14 +47 +11 +78 +40 +79 +4 +29 +20 +34 +81 +50 +82 +23 +32 +38 +48 +46 +60 +27 +83 +64 +25 +19 +33 +22 +3 +12 +42 +66 +24 +1 +49 +70 diff --git a/chebai_graph/preprocessing/bin/tox21/BondLevel/indices_one_hot.txt b/chebai_graph/preprocessing/bin/tox21/BondLevel/indices_one_hot.txt new file mode 100644 index 0000000..6b48d66 --- /dev/null +++ b/chebai_graph/preprocessing/bin/tox21/BondLevel/indices_one_hot.txt @@ -0,0 +1,4 @@ +within_atoms_lvl +atom_fg_lvl +within_fg_lvl +to_graphNode_lvl diff --git a/chebai_graph/preprocessing/bin/tox21/BondType/indices_one_hot.txt b/chebai_graph/preprocessing/bin/tox21/BondType/indices_one_hot.txt new file mode 100644 index 0000000..c819d38 --- /dev/null +++ b/chebai_graph/preprocessing/bin/tox21/BondType/indices_one_hot.txt @@ -0,0 +1,4 @@ +SINGLE +AROMATIC +DOUBLE +TRIPLE diff --git a/chebai_graph/preprocessing/bin/tox21/NumAtomBonds/indices_one_hot.txt b/chebai_graph/preprocessing/bin/tox21/NumAtomBonds/indices_one_hot.txt new file mode 100644 index 0000000..21b19a8 --- /dev/null +++ b/chebai_graph/preprocessing/bin/tox21/NumAtomBonds/indices_one_hot.txt @@ -0,0 +1,7 @@ +1 +2 +3 +4 +0 +5 +6 diff --git a/chebai_graph/preprocessing/bin/toxcast/AtomCharge/indices_one_hot.txt b/chebai_graph/preprocessing/bin/toxcast/AtomCharge/indices_one_hot.txt new file mode 100644 index 0000000..c857ab5 --- /dev/null +++ b/chebai_graph/preprocessing/bin/toxcast/AtomCharge/indices_one_hot.txt @@ -0,0 +1,6 @@ +0 +-1 +1 +2 +3 +-2 diff --git a/chebai_graph/preprocessing/bin/toxcast/AtomFunctionalGroup/indices_one_hot.txt b/chebai_graph/preprocessing/bin/toxcast/AtomFunctionalGroup/indices_one_hot.txt new file mode 100644 index 0000000..500ebf5 --- /dev/null +++ b/chebai_graph/preprocessing/bin/toxcast/AtomFunctionalGroup/indices_one_hot.txt @@ -0,0 +1,117 @@ +ester +RING_6 +sulfonyl +alkyl +NO_FG +4_ammonium_ion +graph_fg +sulfide +primary_amine +carboxyl +chloro +quaternary_carbon +hydroxyl +secondary_amine +fluoro +ketone +tertiary_carbon +ether +alkene +nitro +tertiary_amine +aldehyde +RING_5 +alkyne +nitrile +RING_7 +alkene_carbon +carbonate_ester +trifluoromethyl +imide +sulfonic_acid +primary_ketimine +disulfide +sulfonate_ester +amide +nitroso +iodo +RING_3 +carboxylate +RING_8 +RING_20 +acetal +bromo +carbamate +RING_12 +ketoxime +RING_18 +silyl_ether +RING_4 +dichloromethyl +sulfinyl +aldoxime +thioketone +secondary_ketimine +isothiocyanate +isocyanate +RING_14 +sulfhydryl +phosphono +carbodithioic_acid +secondary_aldimine +haloformyl +phosphoryl +azo +nitrate +RING_35 +thiocyanate +hemiacetal +thiolester +difluorochloromethyl +dibromomethyl +difluoromethyl +phosphino +RING_29 +chlorobromomethyl +RING_9 +tribromomethyl +trichloromethyl +RING_28 +RING_16 +nitrosooxy +bromodichloromethyl +carbodithio +phosphodiester +RING_23 +phosphate +carboxylic_anhydride +RING_13 +RING_24 +RING_30 +RING_11 +RING_17 +azide +RING_40 +primary_aldimine +RING_15 +peroxy +RING_33 +trimethylsilyl +sulfino +ketal +RING_10 +thionoester +borono +amidine +orthoester +RING_27 +RING_26 +RING_38 +hydroperoxy +RING_21 +RING_19 +dichlorosilane +diiodomethyl +fluorochloromethyl +bromodifluoromethyl +RING_36 diff --git a/chebai_graph/preprocessing/bin/toxcast/AtomHybridization/indices_one_hot.txt b/chebai_graph/preprocessing/bin/toxcast/AtomHybridization/indices_one_hot.txt new file mode 100644 index 0000000..5d039f5 --- /dev/null +++ b/chebai_graph/preprocessing/bin/toxcast/AtomHybridization/indices_one_hot.txt @@ -0,0 +1,7 @@ +SP2 +SP3 +SP +S +UNSPECIFIED +SP3D2 +SP3D diff --git a/chebai_graph/preprocessing/bin/toxcast/AtomNodeLevel/indices_one_hot.txt b/chebai_graph/preprocessing/bin/toxcast/AtomNodeLevel/indices_one_hot.txt new file mode 100644 index 0000000..2d65776 --- /dev/null +++ b/chebai_graph/preprocessing/bin/toxcast/AtomNodeLevel/indices_one_hot.txt @@ -0,0 +1,3 @@ +atom_node_lvl +fg_node_lvl +graph_node_level diff --git a/chebai_graph/preprocessing/bin/toxcast/AtomNumHs/indices_one_hot.txt b/chebai_graph/preprocessing/bin/toxcast/AtomNumHs/indices_one_hot.txt new file mode 100644 index 0000000..ed1daa5 --- /dev/null +++ b/chebai_graph/preprocessing/bin/toxcast/AtomNumHs/indices_one_hot.txt @@ -0,0 +1,5 @@ +0 +1 +3 +2 +4 diff --git a/chebai_graph/preprocessing/bin/toxcast/AtomType/indices_one_hot.txt b/chebai_graph/preprocessing/bin/toxcast/AtomType/indices_one_hot.txt new file mode 100644 index 0000000..9c59d72 --- /dev/null +++ b/chebai_graph/preprocessing/bin/toxcast/AtomType/indices_one_hot.txt @@ -0,0 +1,53 @@ +8 +6 +7 +16 +17 +9 +50 +19 +22 +14 +11 +53 +35 +33 +49 +78 +15 +51 +12 +3 +83 +28 +26 +13 +20 +47 +29 +5 +1 +30 +38 +80 +27 +34 +79 +56 +81 +24 +23 +21 +64 +70 +60 +46 +32 +4 +82 +66 +25 +48 +63 +40 +42 diff --git a/chebai_graph/preprocessing/bin/toxcast/BondLevel/indices_one_hot.txt b/chebai_graph/preprocessing/bin/toxcast/BondLevel/indices_one_hot.txt new file mode 100644 index 0000000..6b48d66 --- /dev/null +++ b/chebai_graph/preprocessing/bin/toxcast/BondLevel/indices_one_hot.txt @@ -0,0 +1,4 @@ +within_atoms_lvl +atom_fg_lvl +within_fg_lvl +to_graphNode_lvl diff --git a/chebai_graph/preprocessing/bin/toxcast/BondType/indices_one_hot.txt b/chebai_graph/preprocessing/bin/toxcast/BondType/indices_one_hot.txt new file mode 100644 index 0000000..f14a241 --- /dev/null +++ b/chebai_graph/preprocessing/bin/toxcast/BondType/indices_one_hot.txt @@ -0,0 +1,4 @@ +SINGLE +DOUBLE +AROMATIC +TRIPLE diff --git a/chebai_graph/preprocessing/bin/toxcast/NumAtomBonds/indices_one_hot.txt b/chebai_graph/preprocessing/bin/toxcast/NumAtomBonds/indices_one_hot.txt new file mode 100644 index 0000000..a61fff5 --- /dev/null +++ b/chebai_graph/preprocessing/bin/toxcast/NumAtomBonds/indices_one_hot.txt @@ -0,0 +1,7 @@ +2 +1 +3 +4 +0 +6 +5 diff --git a/chebai_graph/preprocessing/collate.py b/chebai_graph/preprocessing/collate.py index 53bdde5..b2bc4a0 100644 --- a/chebai_graph/preprocessing/collate.py +++ b/chebai_graph/preprocessing/collate.py @@ -15,11 +15,16 @@ def __call__(self, data): # Unpack labels and optional identifiers y, idents = zip(*((d["labels"], d.get("ident")) for d in data)) - # Replace labels with `y` inside graph features and collect them + valid_label_mask = self._get_valid_label_mask(y) + + # Keep labels in XYGraphData.y instead of graph attributes. Mixed labelled + # and unlabelled batches otherwise make PyG collate a partial `y` key. merged_data = [] for row in data: - row["features"].y = row["labels"] - merged_data.append(row["features"]) + features = row["features"] + if "y" in features: + del features.y + merged_data.append(features) # Add empty edge_attr for graphs with no edges to prevent PyG errors for mdata in merged_data: @@ -31,6 +36,11 @@ def __call__(self, data): for attr in merged_data[0].keys(): for data in merged_data: for store in data.stores: + if attr not in store: + continue + if store[attr] is None: + del store[attr] + continue # Im not sure why the following conversion is needed, but it solves this error: # packages/torch_geometric/data/collate.py", line 177, in _collate # value = torch.cat(values, dim=cat_dim or 0, out=out) @@ -69,6 +79,7 @@ def __call__(self, data): x[0].x = x[0].x.to(dtype=torch.int64) # x is a Tuple[BaseData, Mapping, Mapping] + loss_kwargs["valid_label_mask"] = valid_label_mask return XYGraphData( x, y, diff --git a/chebai_graph/preprocessing/datasets/__init__.py b/chebai_graph/preprocessing/datasets/__init__.py index 9ee9856..24e9648 100644 --- a/chebai_graph/preprocessing/datasets/__init__.py +++ b/chebai_graph/preprocessing/datasets/__init__.py @@ -1,14 +1,25 @@ from .chebi import ( + ChEBI25GraphProperties, ChEBI50_Atom_WGNOnly_GraphProp, ChEBI50_GN_WithAllNodes_FG_WithAtoms_FGE, ChEBI50_GN_WithAllNodes_FG_WithAtoms_NoFGE, ChEBI50_GN_WithAtoms_FG_WithAtoms_FGE, ChEBI50_GN_WithAtoms_FG_WithAtoms_NoFGE, + ChEBI50_GNWA_FGWA_WFGE_AsPerNodeType, + ChEBI50_GNWA_FGWA_WFGE_ForAllPropsExceptNodeLevel, + ChEBI50_GNWA_FGWA_WFGE_ForAtomAndFGLevelOnly, + ChEBI50_GNWA_FGWA_WFGE_ForAtomLevelAndGraphNodeOnly, + ChEBI50_GNWA_FGWA_WFGE_ForAtomLevelOnly, + ChEBI50_GNWA_FGWA_WFGE_ForFGLevelAndGraphNodeOnly, + ChEBI50_GNWA_FGWA_WFGE_ForFGLevelOnly, + ChEBI50_GNWA_FGWA_WFGE_ForGraphNodeOnly, + ChEBI50_GNWA_FGWA_WFGE_ForNodeLevelPropOnlyForAllNodes, ChEBI50_NFGE_NGN_GraphProp, ChEBI50_NFGE_WGN_GraphProp, ChEBI50_StaticGNI, ChEBI50_WFGE_NGN_GraphProp, ChEBI50_WFGE_WGN_AsPerNodeType, + ChEBI50_WFGE_WGN_ForAllPropsExceptNodeLevel, ChEBI50_WFGE_WGN_ForAtomAndFGLevelOnly, ChEBI50_WFGE_WGN_ForAtomLevelAndGraphNodeOnly, ChEBI50_WFGE_WGN_ForAtomLevelOnly, @@ -18,41 +29,65 @@ ChEBI50_WFGE_WGN_ForNodeLevelPropOnlyForAllNodes, ChEBI50_WFGE_WGN_GraphProp, ChEBI50GraphData, - ChEBI25GraphProperties, ChEBI50GraphProperties, ChEBI100GraphProperties, ) from .molecule_net_classification import ( + BACE_GNWA_FGWA_WFGE_AsPerNodeType, BACE_WFGE_WGN_AsPerNodeType, + BBBP_GNWA_FGWA_WFGE_AsPerNodeType, BBBP_WFGE_WGN_AsPerNodeType, + ClinTox_GNWA_FGWA_WFGE_AsPerNodeType, ClinTox_WFGE_WGN_AsPerNodeType, + HIV_GNWA_FGWA_WFGE_AsPerNodeType, HIV_WFGE_WGN_AsPerNodeType, + MUV_GNWA_FGWA_WFGE_AsPerNodeType, MUV_WFGE_WGN_AsPerNodeType, + PCBA_GNWA_FGWA_WFGE_AsPerNodeType, PCBA_WFGE_WGN_AsPerNodeType, + SIDER_GNWA_FGWA_WFGE_AsPerNodeType, SIDER_WFGE_WGN_AsPerNodeType, + Tox21_Atom_WGNOnly_GraphProp, + Tox21_GN_WithAllNodes_FG_WithAtoms_FGE, + Tox21_GN_WithAllNodes_FG_WithAtoms_NoFGE, + Tox21_GN_WithAtoms_FG_WithAtoms_FGE, + Tox21_GN_WithAtoms_FG_WithAtoms_NoFGE, + Tox21_GNWA_FGWA_WFGE_AsPerNodeType, + Tox21_NFGE_NGN_GraphProp, + Tox21_NFGE_WGN_GraphProp, + Tox21_WFGE_NGN_GraphProp, Tox21_WFGE_WGN_AsPerNodeType, + Tox21_WFGE_WGN_GraphProp, + Tox21GraphProperties, + ToxCast_Atom_WGNOnly_GraphProp, + ToxCast_GN_WithAllNodes_FG_WithAtoms_FGE, + ToxCast_GN_WithAllNodes_FG_WithAtoms_NoFGE, + ToxCast_GN_WithAtoms_FG_WithAtoms_FGE, + ToxCast_GN_WithAtoms_FG_WithAtoms_NoFGE, + ToxCast_GNWA_FGWA_WFGE_AsPerNodeType, + ToxCast_NFGE_NGN_GraphProp, + ToxCast_NFGE_WGN_GraphProp, + ToxCast_WFGE_NGN_GraphProp, ToxCast_WFGE_WGN_AsPerNodeType, + ToxCast_WFGE_WGN_GraphProp, + ToxCastGraphProperties, ) from .pubchem import PubChemGraphProperties __all__ = [ - "ChEBI50GraphFGAugmentorReader", - "ChEBI25GraphProperties", - "ChEBI50GraphProperties", - "ChEBI100GraphProperties", - "ChEBI50GraphData", - "PubChemGraphProperties", - "ChEBI50_Atom_WGNOnly_GraphProp", + # ---------- CHEBI Augmentation ablation classes -------- + "ChEBI50GraphProperties", # -- baseline class for chebi "ChEBI50_NFGE_NGN_GraphProp", "ChEBI50_NFGE_WGN_GraphProp", "ChEBI50_WFGE_NGN_GraphProp", "ChEBI50_WFGE_WGN_GraphProp", - "ChEBI50_StaticGNI", "ChEBI50_WFGE_WGN_AsPerNodeType", "ChEBI50_GN_WithAllNodes_FG_WithAtoms_FGE", "ChEBI50_GN_WithAllNodes_FG_WithAtoms_NoFGE", "ChEBI50_GN_WithAtoms_FG_WithAtoms_FGE", "ChEBI50_GN_WithAtoms_FG_WithAtoms_NoFGE", + "ChEBI50_Atom_WGNOnly_GraphProp", + # ----- CHEBI FGN+E+FGE Properties ablation classes ----- "ChEBI50_WFGE_WGN_ForAtomLevelOnly", "ChEBI50_WFGE_WGN_ForFGLevelOnly", "ChEBI50_WFGE_WGN_ForGraphNodeOnly", @@ -60,6 +95,8 @@ "ChEBI50_WFGE_WGN_ForAtomLevelAndGraphNodeOnly", "ChEBI50_WFGE_WGN_ForFGLevelAndGraphNodeOnly", "ChEBI50_WFGE_WGN_ForNodeLevelPropOnlyForAllNodes", + "ChEBI50_WFGE_WGN_ForAllPropsExceptNodeLevel", + # ----- MoleculeNet Dataset FGN+E+FGE Final classes ----- "BACE_WFGE_WGN_AsPerNodeType", "BBBP_WFGE_WGN_AsPerNodeType", "ClinTox_WFGE_WGN_AsPerNodeType", @@ -69,4 +106,52 @@ "Tox21_WFGE_WGN_AsPerNodeType", "ToxCast_WFGE_WGN_AsPerNodeType", "PCBA_WFGE_WGN_AsPerNodeType", + # ----- MoleculeNet Dataset GNWA+FGWA+WFGE Final classes ----- + "Tox21_GNWA_FGWA_WFGE_AsPerNodeType", + "ToxCast_GNWA_FGWA_WFGE_AsPerNodeType", + "BACE_GNWA_FGWA_WFGE_AsPerNodeType", + "BBBP_GNWA_FGWA_WFGE_AsPerNodeType", + "ClinTox_GNWA_FGWA_WFGE_AsPerNodeType", + "HIV_GNWA_FGWA_WFGE_AsPerNodeType", + "MUV_GNWA_FGWA_WFGE_AsPerNodeType", + "PCBA_GNWA_FGWA_WFGE_AsPerNodeType", + "SIDER_GNWA_FGWA_WFGE_AsPerNodeType", + # ----- CHEBI GNWA_FGWA_WFGE Properties ablation classes ----- + "ChEBI50_GNWA_FGWA_WFGE_AsPerNodeType", + "ChEBI50_GNWA_FGWA_WFGE_ForAllPropsExceptNodeLevel", + "ChEBI50_GNWA_FGWA_WFGE_ForAtomAndFGLevelOnly", + "ChEBI50_GNWA_FGWA_WFGE_ForAtomLevelAndGraphNodeOnly", + "ChEBI50_GNWA_FGWA_WFGE_ForAtomLevelOnly", + "ChEBI50_GNWA_FGWA_WFGE_ForFGLevelAndGraphNodeOnly", + "ChEBI50_GNWA_FGWA_WFGE_ForFGLevelOnly", + "ChEBI50_GNWA_FGWA_WFGE_ForGraphNodeOnly", + "ChEBI50_GNWA_FGWA_WFGE_ForNodeLevelPropOnlyForAllNodes", + # ----- Tox21 Augmentation Ablation classes ----- + "Tox21_Atom_WGNOnly_GraphProp", + "Tox21_GN_WithAllNodes_FG_WithAtoms_FGE", + "Tox21_GN_WithAllNodes_FG_WithAtoms_NoFGE", + "Tox21_GN_WithAtoms_FG_WithAtoms_FGE", + "Tox21_GN_WithAtoms_FG_WithAtoms_NoFGE", + "Tox21_NFGE_NGN_GraphProp", + "Tox21_NFGE_WGN_GraphProp", + "Tox21_WFGE_NGN_GraphProp", + "Tox21_WFGE_WGN_GraphProp", + "Tox21GraphProperties", # -- baseline class for Tox21 + # ----- ToxCast Augmentation Ablation classes ----- + "ToxCast_Atom_WGNOnly_GraphProp", + "ToxCast_GN_WithAllNodes_FG_WithAtoms_FGE", + "ToxCast_GN_WithAllNodes_FG_WithAtoms_NoFGE", + "ToxCast_GN_WithAtoms_FG_WithAtoms_FGE", + "ToxCast_GN_WithAtoms_FG_WithAtoms_NoFGE", + "ToxCast_NFGE_NGN_GraphProp", + "ToxCast_NFGE_WGN_GraphProp", + "ToxCast_WFGE_NGN_GraphProp", + "ToxCast_WFGE_WGN_GraphProp", + "ToxCastGraphProperties", # -- baseline class for ToxCast + # ------ Others ----- + "ChEBI50_StaticGNI", + "ChEBI25GraphProperties", + "ChEBI100GraphProperties", + "ChEBI50GraphData", + "PubChemGraphProperties", ] diff --git a/chebai_graph/preprocessing/datasets/augmentation_base.py b/chebai_graph/preprocessing/datasets/augmentation_base.py index 9bf6cdc..20ce564 100644 --- a/chebai_graph/preprocessing/datasets/augmentation_base.py +++ b/chebai_graph/preprocessing/datasets/augmentation_base.py @@ -177,3 +177,10 @@ def _fill_node_tensor_with_molecule_type_property( is_graph_node: torch.Tensor, ) -> torch.Tensor: return node_tensor + + +class GraphPropAllPropsExceptNodeLevel(GraphPropAsPerNodeType): + def _fill_node_tensor_with_all_node_type_property( + self, node_tensor: torch.Tensor, property_values: torch.Tensor, offset: int + ) -> torch.Tensor: + return node_tensor diff --git a/chebai_graph/preprocessing/datasets/base.py b/chebai_graph/preprocessing/datasets/base.py index 4e8e6c3..84d42be 100644 --- a/chebai_graph/preprocessing/datasets/base.py +++ b/chebai_graph/preprocessing/datasets/base.py @@ -462,6 +462,7 @@ def load_processed_data( base_data = super().load_processed_data(kind, filename) base_df = pd.DataFrame(base_data) base_df["ident"] = base_df["ident"].astype(str) + len_base_df_before_merge = len(base_df) props_categories = { "AllNodeTypeProperties": [], "FGNodeTypeProperties": [], @@ -524,11 +525,21 @@ def load_processed_data( ) property_df = pd.DataFrame(property_data) + assert len(property_df) == len(property_df["ident"].unique()), ( + f"Duplicate entries found in property {property.name} data. " + f"Unique entries {len(property_df['ident'].unique())}. " + f"Total entries {len(property_df)}. " + ) property_df["ident"] = property_df["ident"].astype(str) property_df.rename( columns={property.name: f"{property.name}"}, inplace=True ) + base_df = base_df.merge(property_df, on="ident", how="left") + assert len(base_df) == len_base_df_before_merge, ( + f"Length mismatch after merging property {property.name}. " + f"Expected {len_base_df_before_merge}, got {len(base_df)}" + ) base_df["features"] = base_df.apply( lambda row: self._merge_props_into_base( diff --git a/chebai_graph/preprocessing/datasets/chebi.py b/chebai_graph/preprocessing/datasets/chebi.py index 1962c31..7a68dc6 100644 --- a/chebai_graph/preprocessing/datasets/chebi.py +++ b/chebai_graph/preprocessing/datasets/chebi.py @@ -25,6 +25,7 @@ from .augmentation_base import ( AugGraphPropMixIn_NoGraphNode, AugGraphPropMixIn_WithGraphNode, + GraphPropAllPropsExceptNodeLevel, GraphPropForAtomAndFGLevelOnly, GraphPropForAtomLevelAndGraphNodeOnly, GraphPropForAtomLevelOnly, @@ -168,42 +169,94 @@ class ChEBI50_WFGE_WGN_AsPerNodeType(GraphPropAsPerNodeType, ChEBIOver50): READER = AtomFGReader_WithFGEdges_WithGraphNode +class ChEBI50_GNWA_FGWA_WFGE_AsPerNodeType(GraphPropAsPerNodeType, ChEBIOver50): + READER = GN_WithAtoms_FG_WithAtoms_FGE + + class ChEBI50_WFGE_WGN_ForAtomLevelOnly(GraphPropForAtomLevelOnly, ChEBIOver50): READER = AtomFGReader_WithFGEdges_WithGraphNode +class ChEBI50_GNWA_FGWA_WFGE_ForAtomLevelOnly(GraphPropForAtomLevelOnly, ChEBIOver50): + READER = GN_WithAtoms_FG_WithAtoms_FGE + + class ChEBI50_WFGE_WGN_ForFGLevelOnly(GraphPropForFGLevelOnly, ChEBIOver50): READER = AtomFGReader_WithFGEdges_WithGraphNode +class ChEBI50_GNWA_FGWA_WFGE_ForFGLevelOnly(GraphPropForFGLevelOnly, ChEBIOver50): + READER = GN_WithAtoms_FG_WithAtoms_FGE + + class ChEBI50_WFGE_WGN_ForGraphNodeOnly(GraphPropForGraphNodeOnly, ChEBIOver50): READER = AtomFGReader_WithFGEdges_WithGraphNode +class ChEBI50_GNWA_FGWA_WFGE_ForGraphNodeOnly(GraphPropForGraphNodeOnly, ChEBIOver50): + READER = GN_WithAtoms_FG_WithAtoms_FGE + + class ChEBI50_WFGE_WGN_ForAtomAndFGLevelOnly( GraphPropForAtomAndFGLevelOnly, ChEBIOver50 ): READER = AtomFGReader_WithFGEdges_WithGraphNode +class ChEBI50_GNWA_FGWA_WFGE_ForAtomAndFGLevelOnly( + GraphPropForAtomAndFGLevelOnly, ChEBIOver50 +): + READER = GN_WithAtoms_FG_WithAtoms_FGE + + class ChEBI50_WFGE_WGN_ForAtomLevelAndGraphNodeOnly( GraphPropForAtomLevelAndGraphNodeOnly, ChEBIOver50 ): READER = AtomFGReader_WithFGEdges_WithGraphNode +class ChEBI50_GNWA_FGWA_WFGE_ForAtomLevelAndGraphNodeOnly( + GraphPropForAtomLevelAndGraphNodeOnly, ChEBIOver50 +): + READER = GN_WithAtoms_FG_WithAtoms_FGE + + class ChEBI50_WFGE_WGN_ForFGLevelAndGraphNodeOnly( GraphPropForFGLevelAndGraphNodeOnly, ChEBIOver50 ): READER = AtomFGReader_WithFGEdges_WithGraphNode +class ChEBI50_GNWA_FGWA_WFGE_ForFGLevelAndGraphNodeOnly( + GraphPropForFGLevelAndGraphNodeOnly, ChEBIOver50 +): + READER = GN_WithAtoms_FG_WithAtoms_FGE + + class ChEBI50_WFGE_WGN_ForNodeLevelPropOnlyForAllNodes( GraphPropNodeLevelPropOnlyForAllNodes, ChEBIOver50 ): READER = AtomFGReader_WithFGEdges_WithGraphNode +class ChEBI50_GNWA_FGWA_WFGE_ForNodeLevelPropOnlyForAllNodes( + GraphPropNodeLevelPropOnlyForAllNodes, ChEBIOver50 +): + READER = GN_WithAtoms_FG_WithAtoms_FGE + + +class ChEBI50_WFGE_WGN_ForAllPropsExceptNodeLevel( + GraphPropAllPropsExceptNodeLevel, ChEBIOver50 +): + READER = AtomFGReader_WithFGEdges_WithGraphNode + + +class ChEBI50_GNWA_FGWA_WFGE_ForAllPropsExceptNodeLevel( + GraphPropAllPropsExceptNodeLevel, ChEBIOver50 +): + READER = GN_WithAtoms_FG_WithAtoms_FGE + + # ---------- Final Augmentation: Different Thresholds ------------------------------ class ChEBI100_WFGE_WGN_AsPerNodeType(GraphPropAsPerNodeType, ChEBIOver100): READER = AtomFGReader_WithFGEdges_WithGraphNode diff --git a/chebai_graph/preprocessing/datasets/molecule_net_classification.py b/chebai_graph/preprocessing/datasets/molecule_net_classification.py index 9afaf71..2132965 100644 --- a/chebai_graph/preprocessing/datasets/molecule_net_classification.py +++ b/chebai_graph/preprocessing/datasets/molecule_net_classification.py @@ -12,9 +12,23 @@ from chebai_graph.preprocessing.datasets.base import ( GraphPropAsPerNodeType, + GraphPropertiesMixIn, ) -from chebai_graph.preprocessing.reader.augmented_reader import ( +from chebai_graph.preprocessing.reader import ( + AtomFGReader_NoFGEdges_WithGraphNode, + AtomFGReader_WithFGEdges_NoGraphNode, AtomFGReader_WithFGEdges_WithGraphNode, + AtomReader_WithGraphNodeOnly, + AtomsFGReader_NoFGEdges_NoGraphNode, + GN_WithAllNodes_FG_WithAtoms_FGE, + GN_WithAllNodes_FG_WithAtoms_NoFGE, + GN_WithAtoms_FG_WithAtoms_FGE, + GN_WithAtoms_FG_WithAtoms_NoFGE, +) + +from .augmentation_base import ( + AugGraphPropMixIn_NoGraphNode, + AugGraphPropMixIn_WithGraphNode, ) @@ -22,38 +36,226 @@ class PCBA_WFGE_WGN_AsPerNodeType(GraphPropAsPerNodeType, PCBA): READER = AtomFGReader_WithFGEdges_WithGraphNode +class PCBA_GNWA_FGWA_WFGE_AsPerNodeType(GraphPropAsPerNodeType, PCBA): + READER = GN_WithAtoms_FG_WithAtoms_FGE + + class BACE_WFGE_WGN_AsPerNodeType(GraphPropAsPerNodeType, BACE): READER = AtomFGReader_WithFGEdges_WithGraphNode +class BACE_GNWA_FGWA_WFGE_AsPerNodeType(GraphPropAsPerNodeType, BACE): + READER = GN_WithAtoms_FG_WithAtoms_FGE + + class BBBP_WFGE_WGN_AsPerNodeType(GraphPropAsPerNodeType, BBBP): READER = AtomFGReader_WithFGEdges_WithGraphNode +class BBBP_GNWA_FGWA_WFGE_AsPerNodeType(GraphPropAsPerNodeType, BBBP): + READER = GN_WithAtoms_FG_WithAtoms_FGE + + class ClinTox_WFGE_WGN_AsPerNodeType(GraphPropAsPerNodeType, ClinTox): READER = AtomFGReader_WithFGEdges_WithGraphNode +class ClinTox_GNWA_FGWA_WFGE_AsPerNodeType(GraphPropAsPerNodeType, ClinTox): + READER = GN_WithAtoms_FG_WithAtoms_FGE + + class HIV_WFGE_WGN_AsPerNodeType(GraphPropAsPerNodeType, HIV): READER = AtomFGReader_WithFGEdges_WithGraphNode +class HIV_GNWA_FGWA_WFGE_AsPerNodeType(GraphPropAsPerNodeType, HIV): + READER = GN_WithAtoms_FG_WithAtoms_FGE + + class SIDER_WFGE_WGN_AsPerNodeType(GraphPropAsPerNodeType, SIDER): READER = AtomFGReader_WithFGEdges_WithGraphNode +class SIDER_GNWA_FGWA_WFGE_AsPerNodeType(GraphPropAsPerNodeType, SIDER): + READER = GN_WithAtoms_FG_WithAtoms_FGE + + class MUV_WFGE_WGN_AsPerNodeType(GraphPropAsPerNodeType, MUV): READER = AtomFGReader_WithFGEdges_WithGraphNode +class MUV_GNWA_FGWA_WFGE_AsPerNodeType(GraphPropAsPerNodeType, MUV): + READER = GN_WithAtoms_FG_WithAtoms_FGE + + class Tox21_WFGE_WGN_AsPerNodeType(GraphPropAsPerNodeType, Tox21): READER = AtomFGReader_WithFGEdges_WithGraphNode +class Tox21_GNWA_FGWA_WFGE_AsPerNodeType(GraphPropAsPerNodeType, Tox21): + READER = GN_WithAtoms_FG_WithAtoms_FGE + + class ToxCast_WFGE_WGN_AsPerNodeType(GraphPropAsPerNodeType, ToxCast): READER = AtomFGReader_WithFGEdges_WithGraphNode +class ToxCast_GNWA_FGWA_WFGE_AsPerNodeType(GraphPropAsPerNodeType, ToxCast): + READER = GN_WithAtoms_FG_WithAtoms_FGE + + +# ---- Augmentation: Variants with graph Node connected to FG nodes only ------------- +class Tox21_WFGE_WGN_GraphProp(AugGraphPropMixIn_WithGraphNode, Tox21): + """Tox21 with with FG nodes and FG edges and graph node.""" + + READER = AtomFGReader_WithFGEdges_WithGraphNode + + +class ToxCast_WFGE_WGN_GraphProp(AugGraphPropMixIn_WithGraphNode, ToxCast): + """ToxCast with with FG nodes and FG edges and graph node.""" + + READER = AtomFGReader_WithFGEdges_WithGraphNode + + +class Tox21_NFGE_WGN_GraphProp(AugGraphPropMixIn_WithGraphNode, Tox21): + """Tox21 with FG nodes but without FG edges, with graph node.""" + + READER = AtomFGReader_NoFGEdges_WithGraphNode + + +class ToxCast_NFGE_WGN_GraphProp(AugGraphPropMixIn_WithGraphNode, ToxCast): + """ToxCast with FG nodes but without FG edges, with graph node.""" + + READER = AtomFGReader_NoFGEdges_WithGraphNode + + +class Tox21_WFGE_NGN_GraphProp(AugGraphPropMixIn_NoGraphNode, Tox21): + """Tox21 with FG nodes and FG edges, no graph node.""" + + READER = AtomFGReader_WithFGEdges_NoGraphNode + + +class ToxCast_WFGE_NGN_GraphProp(AugGraphPropMixIn_NoGraphNode, ToxCast): + """ToxCast with FG nodes and FG edges, no graph node.""" + + READER = AtomFGReader_WithFGEdges_NoGraphNode + + +class Tox21_NFGE_NGN_GraphProp(AugGraphPropMixIn_NoGraphNode, Tox21): + """Tox21 with FG nodes but without FG edges or graph node.""" + + READER = AtomsFGReader_NoFGEdges_NoGraphNode + + +class ToxCast_NFGE_NGN_GraphProp(AugGraphPropMixIn_NoGraphNode, ToxCast): + """ToxCast with FG nodes but without FG edges or graph node.""" + + READER = AtomsFGReader_NoFGEdges_NoGraphNode + + +class Tox21_Atom_WGNOnly_GraphProp(AugGraphPropMixIn_WithGraphNode, Tox21): + """Tox21 with atom-level nodes and graph node only.""" + + READER = AtomReader_WithGraphNodeOnly + + +class ToxCast_Atom_WGNOnly_GraphProp(AugGraphPropMixIn_WithGraphNode, ToxCast): + """ToxCast with atom-level nodes and graph node only.""" + + READER = AtomReader_WithGraphNodeOnly + + +# ------- Augmentation: Variants with graph Node connected to all others nodes (FG and atoms) -------------- +class Tox21_GN_WithAllNodes_FG_WithAtoms_FGE(AugGraphPropMixIn_WithGraphNode, Tox21): + """ + Tox21 with FG nodes (connected to their respective atom nodes) with functional group + edges, and adds a graph-level node connected to all nodes (fg + atoms). + """ + + READER = GN_WithAllNodes_FG_WithAtoms_FGE + + +class ToxCast_GN_WithAllNodes_FG_WithAtoms_FGE( + AugGraphPropMixIn_WithGraphNode, ToxCast +): + """ + ToxCast with FG nodes (connected to their respective atom nodes) with functional group + edges, and adds a graph-level node connected to all nodes (fg + atoms). + """ + + READER = GN_WithAllNodes_FG_WithAtoms_FGE + + +class Tox21_GN_WithAllNodes_FG_WithAtoms_NoFGE(AugGraphPropMixIn_WithGraphNode, Tox21): + """ + Tox21 with FG nodes (connected to their respective atom nodes) without functional group + edges, and adds a graph-level node connected to all nodes (fg + atoms). + """ + + READER = GN_WithAllNodes_FG_WithAtoms_NoFGE + + +class ToxCast_GN_WithAllNodes_FG_WithAtoms_NoFGE( + AugGraphPropMixIn_WithGraphNode, ToxCast +): + """ + ToxCast with FG nodes (connected to their respective atom nodes) without functional group + edges, and adds a graph-level node connected to all nodes (fg + atoms). + """ + + READER = GN_WithAllNodes_FG_WithAtoms_NoFGE + + +# ------- Augmentation: Variants with graph node connected to atom nodes ONLY ----------- +class Tox21_GN_WithAtoms_FG_WithAtoms_FGE(AugGraphPropMixIn_WithGraphNode, Tox21): + """ + Tox21 with FG nodes (connected to their respective atom nodes) with functional group + edges, and adds a graph-level node connected to all atom nodes. + """ + + READER = GN_WithAtoms_FG_WithAtoms_FGE + + +class ToxCast_GN_WithAtoms_FG_WithAtoms_FGE(AugGraphPropMixIn_WithGraphNode, ToxCast): + """ + ToxCast with FG nodes (connected to their respective atom nodes) with functional group + edges, and adds a graph-level node connected to all atom nodes. + """ + + READER = GN_WithAtoms_FG_WithAtoms_FGE + + +class Tox21_GN_WithAtoms_FG_WithAtoms_NoFGE(AugGraphPropMixIn_WithGraphNode, Tox21): + """ + Tox21 with FG nodes (connected to their respective atom nodes) without functional group + edges, and adds a graph-level node connected to all atom nodes. + """ + + READER = GN_WithAtoms_FG_WithAtoms_NoFGE + + +class ToxCast_GN_WithAtoms_FG_WithAtoms_NoFGE(AugGraphPropMixIn_WithGraphNode, ToxCast): + """ + ToxCast with FG nodes (connected to their respective atom nodes) without functional group + edges, and adds a graph-level node connected to all atom nodes. + """ + + READER = GN_WithAtoms_FG_WithAtoms_NoFGE + + +# ---------------------------Baselines classes for Tox21 and ToxCast datasets +class Tox21GraphProperties(GraphPropertiesMixIn, Tox21): + """Tox21 dataset with molecular property encodings.""" + + pass + + +class ToxCastGraphProperties(GraphPropertiesMixIn, ToxCast): + """ToxCast dataset with molecular property encodings.""" + + pass + + if __name__ == "__main__": dataset = BACE_WFGE_WGN_AsPerNodeType() dataset.prepare_data() diff --git a/chebai_graph/preprocessing/properties/base.py b/chebai_graph/preprocessing/properties/base.py index f148df8..1f2e0aa 100644 --- a/chebai_graph/preprocessing/properties/base.py +++ b/chebai_graph/preprocessing/properties/base.py @@ -209,8 +209,8 @@ def on_finish(self) -> None: hasattr(self.encoder, "cache") and len(self.encoder.cache) > self.encoder.index_length_start ): - raise ValueError( - f"{self.__class__.__name__} attempted to add new tokens " + print( + f"{self.__class__.__name__} added new tokens " f"to a frozen encoder at {self.encoder.index_path}" ) super().on_finish() diff --git a/configs/data/augmented/aug-ablation/aug-ablation-chebi.sh b/configs/data/augmented/aug-ablation/aug-ablation-chebi.sh new file mode 100644 index 0000000..eb82031 --- /dev/null +++ b/configs/data/augmented/aug-ablation/aug-ablation-chebi.sh @@ -0,0 +1,191 @@ +#!/bin/bash + +#SBATCH --time=48:00:00 +#SBATCH --ntasks=1 +#SBATCH --cpus-per-task=32 +#SBATCH --threads-per-core=1 +#SBATCH --mem=256000 + +#SBATCH --partition=gpu +#SBATCH --gres=gpu:1 +#SBATCH --constraint="A100|H100.80gb" + +# ============================================================ +# Job array +# +# 10 data configurations × 3 seeds = 30 experiments +# Maximum 10 experiments running simultaneously +# ============================================================ + +#SBATCH --array=0-29%10 + +#SBATCH --job-name=aug-ablation + +# Separate output/error file for every array task +#SBATCH --output=aug-ablation_%A_%a.out +#SBATCH --error=aug-ablation_%A_%a.err + + +# ============================================================ +# Shell settings +# ============================================================ + +set -x +set -euo pipefail + +# ============================================================ +# Seeds +# ============================================================ + +SEEDS=(0 42 12345) + +# ============================================================ +# Data configurations +# +# Add/remove configs here. +# +# IMPORTANT: +# The number of array tasks must be: +# +# number of data configs × number of seeds +# +# ============================================================ + +DATA_CONFIG_DIR=( + "$CHEBAI_GRAPH_DIR/configs/data/augmented/aug-ablation/tox21" +) +DATA_CONFIGS=( + "$DATA_CONFIG_DIR/FGN.yml" + "$DATA_CONFIG_DIR/FGN+E.yml" + "$DATA_CONFIG_DIR/FGN+E+WGN.yml" + "$DATA_CONFIG_DIR/FGN+WGN.yml" + "$DATA_CONFIG_DIR/gn_wall_fgwa_nfge.yml" + "$DATA_CONFIG_DIR/gn_wall_fgwa_wfge.yml" + "$DATA_CONFIG_DIR/gnwa_fgwa_nfge.yml" + "$DATA_CONFIG_DIR/gnwa_fgwa_wfge.yml" + "$DATA_CONFIG_DIR/WGN.yml" + "$DATA_CONFIG_DIR/baseline.yml" +) + +# ============================================================ +# Determine data config and seed from array task ID +# ============================================================ + +# Array task ordering: +# All data configurations are run for seed 0 first, +# followed by all data configurations for seed 42, +# and finally all data configurations for seed 12345. +# This is intentionally because the data is generated in first run for each data configuration. +# Then the following runs for the same data configuration can re-use the same generated data. + +NUM_SEEDS=${#SEEDS[@]} +NUM_DATA_CONFIGS=${#DATA_CONFIGS[@]} + +SEED_INDEX=$((SLURM_ARRAY_TASK_ID / NUM_DATA_CONFIGS)) +DATA_INDEX=$((SLURM_ARRAY_TASK_ID % NUM_DATA_CONFIGS)) + +DATA_CONFIG=${DATA_CONFIGS[$DATA_INDEX]} +SEED=${SEEDS[$SEED_INDEX]} + +# ============================================================ +# Create experiment name +# ============================================================ + +DATA_NAME=$(basename "$DATA_CONFIG" .yml) +RUN_NAME="${DATA_NAME}_s${SEED}" + +# ============================================================ +# Print job information +# ============================================================ + +echo "============================================================" +echo "Job ID: $SLURM_JOB_ID" +echo "Array Job ID: $SLURM_ARRAY_JOB_ID" +echo "Array Task ID: $SLURM_ARRAY_TASK_ID" +echo "Data index: $DATA_INDEX" +echo "Seed index: $SEED_INDEX" +echo "Data config: $DATA_CONFIG" +echo "Data name: $DATA_NAME" +echo "Seed: $SEED" +echo "Run name: $RUN_NAME" +echo "Node: $(hostname)" +echo "Date: $(date)" +echo "============================================================" + +echo "GPU information:" +nvidia-smi + +echo "============================================================" + +# ============================================================ +# Temporary directory +# ============================================================ + +export TMPDIR=/home/staff/a/akhedekar/atmp_dir/ + +# ============================================================ +# Activate Python environment +# ============================================================ + +source /home/staff/a/akhedekar/python-chebai-graph/.venv/bin/activate + +# ============================================================ +# Set working directory +# ============================================================ + +CHEBAI_DIR="/home/staff/a/akhedekar/python-chebai" +cd "$CHEBAI_DIR" +export SSL_CERT_FILE=$(python -m certifi) + +# ============================================================ +# Check selected configuration +# ============================================================ + +if [[ ! -f "$DATA_CONFIG" ]]; then + echo "ERROR: Data configuration does not exist:" + echo "$DATA_CONFIG" + exit 1 +fi + +# ============================================================ +# Run training +# ============================================================ + +python -m chebai fit \ + --trainer=configs/training/default_trainer.yml \ + --trainer.logger=configs/training/wandb_logger.yml \ + --model=../python-chebai-graph/configs/model/baselines/gat.yml \ + --model.train_metrics=configs/metrics/micro-macro-f1.yml \ + --model.test_metrics=configs/metrics/micro-macro-f1.yml \ + --model.val_metrics=configs/metrics/micro-macro-f1.yml \ + --data="$DATA_CONFIG" \ + --data.init_args.batch_size=64 \ + --trainer.accumulate_grad_batches=1 \ + --data.init_args.num_workers=10 \ + --model.pass_loss_kwargs=false \ + --data.init_args.chebi_version=252 \ + --trainer.min_epochs=200 \ + --trainer.max_epochs=200 \ + --model.criterion=configs/loss/bce_unweighted.yml \ + --trainer.logger.init_args.name="$RUN_NAME" \ + --model.init_args.optimizer_kwargs.lr=0.002 \ + --data.init_args.splits_file_path=data/chebi_v252/ChEBI50/processed/splits.csv \ + --trainer.logger.init_args.tags='["augmented_paper","aug-ablation"]' \ + --seed_everything="$SEED" + + +# ============================================================ +# Finished +# ============================================================ + +echo "============================================================" +echo "Training finished successfully" +echo "============================================================" +echo "Job ID: $SLURM_JOB_ID" +echo "Array Task ID: $SLURM_ARRAY_TASK_ID" +echo "Data config: $DATA_CONFIG" +echo "Seed: $SEED" +echo "Run name: $RUN_NAME" +echo "Node: $(hostname)" +echo "Date: $(date)" +echo "============================================================" diff --git a/configs/data/augmented/aug-ablation/aug-ablation-tox21.sh b/configs/data/augmented/aug-ablation/aug-ablation-tox21.sh new file mode 100644 index 0000000..8a66149 --- /dev/null +++ b/configs/data/augmented/aug-ablation/aug-ablation-tox21.sh @@ -0,0 +1,127 @@ +#!/bin/bash + +# ============================================================ +# Local single-GPU adaptation of ../aug-ablation-script.sh +# Run this script using: `bash configs/data/augmented/aug-ablation/aug-ablation-tox21.sh` +# +# The original is a Slurm job-array script (10 data configs x 3 +# seeds = 30 experiments, 10 concurrent). This version runs the +# SAME experiments serially on a single local GPU, without Slurm. +# +# Changes vs. the Slurm version: +# - Removed all #SBATCH scheduling directives. +# - Fixed hardcoded /home/staff/a/akhedekar paths -> local user. +# - Replaced SLURM_ARRAY_TASK_ID array fan-out with a serial +# loop over [seeds] x [data configs]. +# +# Requires (verified on this machine): +# - local venv: /home/aditya/python-chebai-graph/.venv +# - chebai CLI: /home/aditya/python-chebai (python -m chebai) +# - chebai_graph src: /home/aditya/python-chebai-graph. +# - wandb credentials in ~/.netrc (or run with a local logger). +# ============================================================ + +set -x +set -euo pipefail + +# ============================================================ +# Local paths +# ============================================================ +CHEBAI_DIR="/home/aditya/python-chebai" +CHEBAI_GRAPH_DIR="/home/aditya/python-chebai-graph" + + +# ============================================================ +# Seeds +# ============================================================ +SEEDS=(0 42 12345) + +# ============================================================ +# Data configurations (all resolved to absolute local paths) +# ============================================================ +DATA_CONFIG_DIR=( + "$CHEBAI_GRAPH_DIR/configs/data/augmented/aug-ablation/tox21" +) +DATA_CONFIGS=( + "$DATA_CONFIG_DIR/FGN.yml" + "$DATA_CONFIG_DIR/FGN+E.yml" + "$DATA_CONFIG_DIR/FGN+E+WGN.yml" + "$DATA_CONFIG_DIR/FGN+WGN.yml" + "$DATA_CONFIG_DIR/gn_wall_fgwa_nfge.yml" + "$DATA_CONFIG_DIR/gn_wall_fgwa_wfge.yml" + "$DATA_CONFIG_DIR/gnwa_fgwa_nfge.yml" + "$DATA_CONFIG_DIR/gnwa_fgwa_wfge.yml" + "$DATA_CONFIG_DIR/WGN.yml" + "$DATA_CONFIG_DIR/baseline.yml" +) + +# ============================================================ +# Activate Python environment +# ============================================================ +source "$CHEBAI_GRAPH_DIR/.venv/bin/activate" + +# ============================================================ +# Set working directory (chebai CLI looks up configs/... from cwd) +# ============================================================ +cd "$CHEBAI_DIR" +export SSL_CERT_FILE=$(python -m certifi) + +echo "============================================================" +echo "Node: $(hostname)" +echo "Date: $(date)" +echo "GPU:" +nvidia-smi +echo "============================================================" + +# ============================================================ +# Serial loop over all seeds and data configurations +# ============================================================ +for SEED in "${SEEDS[@]}"; do + for DATA_CONFIG in "${DATA_CONFIGS[@]}"; do + + if [[ ! -f "$DATA_CONFIG" ]]; then + echo "ERROR: Data configuration does not exist: $DATA_CONFIG" + exit 1 + fi + + DATA_NAME=$(basename "$DATA_CONFIG" .yml) + RUN_NAME="${DATA_NAME}_s${SEED}" + + echo "============================================================" + echo "Starting run: $RUN_NAME" + echo "Seed: $SEED" + echo "Config: $DATA_CONFIG" + echo "============================================================" + + python -m chebai fit \ + --trainer=configs/training/default_trainer.yml \ + --trainer.logger=configs/training/wandb_logger.yml \ + --trainer.callbacks=configs/training/roc-auc_callbacks.yml \ + --model="$CHEBAI_GRAPH_DIR/configs/model/baselines/gat.yml" \ + --model.train_metrics=configs/metrics/micro-macro-f1-roc-auc.yml \ + --model.test_metrics=configs/metrics/micro-macro-f1-roc-auc.yml \ + --model.val_metrics=configs/metrics/micro-macro-f1-roc-auc.yml \ + --data="$DATA_CONFIG" \ + --data.init_args.batch_size=64 \ + --trainer.accumulate_grad_batches=2 \ + --data.init_args.num_workers=10 \ + --model.pass_loss_kwargs=false \ + --trainer.min_epochs=100 \ + --trainer.max_epochs=100 \ + --model.criterion=configs/loss/bce_unweighted.yml \ + --trainer.logger.init_args.name="$RUN_NAME" \ + --data.init_args.splits_file_path=data/Tox21:MNClassification/Tox21/processed/splits.csv \ + --trainer.logger.init_args.tags='["augmented_paper","aug-ablation", "tox21"]' \ + --model.config.edge_dim=6 \ + --model.config.in_channels=77 \ + --seed_everything="$SEED" + + echo "============================================================" + echo "Finished run: $RUN_NAME" + echo "============================================================" + done +done + +echo "============================================================" +echo "All experiments finished successfully" +echo "============================================================" \ No newline at end of file diff --git a/configs/data/augmented/aug-ablation/aug-ablation-toxcast.sh b/configs/data/augmented/aug-ablation/aug-ablation-toxcast.sh new file mode 100644 index 0000000..5ab542f --- /dev/null +++ b/configs/data/augmented/aug-ablation/aug-ablation-toxcast.sh @@ -0,0 +1,127 @@ +#!/bin/bash + +# ============================================================ +# Local single-GPU adaptation of ../aug-ablation-script.sh +# # Run this script using: `bash configs/data/augmented/aug-ablation/aug-ablation-toxcast.sh` +# +# The original is a Slurm job-array script (10 data configs x 3 +# seeds = 30 experiments, 10 concurrent). This version runs the +# SAME experiments serially on a single local GPU, without Slurm. +# +# Changes vs. the Slurm version: +# - Removed all #SBATCH scheduling directives. +# - Fixed hardcoded /home/staff/a/akhedekar paths -> local user. +# - Replaced SLURM_ARRAY_TASK_ID array fan-out with a serial +# loop over [seeds] x [data configs]. +# +# Requires (verified on this machine): +# - local venv: /home/aditya/python-chebai-graph/.venv +# - chebai CLI: /home/aditya/python-chebai (python -m chebai) +# - chebai_graph src: /home/aditya/python-chebai-graph. +# - wandb credentials in ~/.netrc (or run with a local logger). +# ============================================================ + +set -x +set -euo pipefail + +# ============================================================ +# Local paths +# ============================================================ +CHEBAI_DIR="/home/aditya/python-chebai" +CHEBAI_GRAPH_DIR="/home/aditya/python-chebai-graph" + + +# ============================================================ +# Seeds +# ============================================================ +SEEDS=(0 42 12345) + +# ============================================================ +# Data configurations (all resolved to absolute local paths) +# ============================================================ +DATA_CONFIG_DIR=( + "$CHEBAI_GRAPH_DIR/configs/data/augmented/aug-ablation/toxcast" +) +DATA_CONFIGS=( + "$DATA_CONFIG_DIR/FGN.yml" + "$DATA_CONFIG_DIR/FGN+E.yml" + "$DATA_CONFIG_DIR/FGN+E+WGN.yml" + "$DATA_CONFIG_DIR/FGN+WGN.yml" + "$DATA_CONFIG_DIR/gn_wall_fgwa_nfge.yml" + "$DATA_CONFIG_DIR/gn_wall_fgwa_wfge.yml" + "$DATA_CONFIG_DIR/gnwa_fgwa_nfge.yml" + "$DATA_CONFIG_DIR/gnwa_fgwa_wfge.yml" + "$DATA_CONFIG_DIR/WGN.yml" + "$DATA_CONFIG_DIR/baseline.yml" +) + +# ============================================================ +# Activate Python environment +# ============================================================ +source "$CHEBAI_GRAPH_DIR/.venv/bin/activate" + +# ============================================================ +# Set working directory (chebai CLI looks up configs/... from cwd) +# ============================================================ +cd "$CHEBAI_DIR" +export SSL_CERT_FILE=$(python -m certifi) + +echo "============================================================" +echo "Node: $(hostname)" +echo "Date: $(date)" +echo "GPU:" +nvidia-smi +echo "============================================================" + +# ============================================================ +# Serial loop over all seeds and data configurations +# ============================================================ +for SEED in "${SEEDS[@]}"; do + for DATA_CONFIG in "${DATA_CONFIGS[@]}"; do + + if [[ ! -f "$DATA_CONFIG" ]]; then + echo "ERROR: Data configuration does not exist: $DATA_CONFIG" + exit 1 + fi + + DATA_NAME=$(basename "$DATA_CONFIG" .yml) + RUN_NAME="${DATA_NAME}_s${SEED}" + + echo "============================================================" + echo "Starting run: $RUN_NAME" + echo "Seed: $SEED" + echo "Config: $DATA_CONFIG" + echo "============================================================" + + python -m chebai fit \ + --trainer=configs/training/default_trainer.yml \ + --trainer.logger=configs/training/wandb_logger.yml \ + --trainer.callbacks=configs/training/roc-auc_callbacks.yml \ + --model="$CHEBAI_GRAPH_DIR/configs/model/baselines/gat.yml" \ + --model.train_metrics=configs/metrics/micro-macro-f1-roc-auc.yml \ + --model.test_metrics=configs/metrics/micro-macro-f1-roc-auc.yml \ + --model.val_metrics=configs/metrics/micro-macro-f1-roc-auc.yml \ + --data="$DATA_CONFIG" \ + --data.init_args.batch_size=64 \ + --trainer.accumulate_grad_batches=2 \ + --data.init_args.num_workers=10 \ + --model.pass_loss_kwargs=false \ + --trainer.min_epochs=100 \ + --trainer.max_epochs=100 \ + --model.criterion=configs/loss/bce_unweighted.yml \ + --trainer.logger.init_args.name="$RUN_NAME" \ + --data.init_args.splits_file_path=data/ToxCast:MNClassification/ToxCast/processed/splits.csv \ + --trainer.logger.init_args.tags='["augmented_paper","aug-ablation", "toxcast"]' \ + --model.config.edge_dim=6 \ + --model.config.in_channels=79 \ + --seed_everything="$SEED" + + echo "============================================================" + echo "Finished run: $RUN_NAME" + echo "============================================================" + done +done + +echo "============================================================" +echo "All experiments finished successfully" +echo "============================================================" \ No newline at end of file diff --git a/configs/data/augmented/aug-ablation/FGN+E+WGN.yml b/configs/data/augmented/aug-ablation/chebi/FGN+E+WGN.yml similarity index 100% rename from configs/data/augmented/aug-ablation/FGN+E+WGN.yml rename to configs/data/augmented/aug-ablation/chebi/FGN+E+WGN.yml diff --git a/configs/data/augmented/aug-ablation/FGN+E.yml b/configs/data/augmented/aug-ablation/chebi/FGN+E.yml similarity index 100% rename from configs/data/augmented/aug-ablation/FGN+E.yml rename to configs/data/augmented/aug-ablation/chebi/FGN+E.yml diff --git a/configs/data/augmented/aug-ablation/FGN+WGN.yml b/configs/data/augmented/aug-ablation/chebi/FGN+WGN.yml similarity index 100% rename from configs/data/augmented/aug-ablation/FGN+WGN.yml rename to configs/data/augmented/aug-ablation/chebi/FGN+WGN.yml diff --git a/configs/data/augmented/aug-ablation/FGN.yml b/configs/data/augmented/aug-ablation/chebi/FGN.yml similarity index 100% rename from configs/data/augmented/aug-ablation/FGN.yml rename to configs/data/augmented/aug-ablation/chebi/FGN.yml diff --git a/configs/data/augmented/aug-ablation/WGN.yml b/configs/data/augmented/aug-ablation/chebi/WGN.yml similarity index 100% rename from configs/data/augmented/aug-ablation/WGN.yml rename to configs/data/augmented/aug-ablation/chebi/WGN.yml diff --git a/configs/data/augmented/aug-ablation/chebi/baseline.yml b/configs/data/augmented/aug-ablation/chebi/baseline.yml new file mode 100644 index 0000000..ce9dfa0 --- /dev/null +++ b/configs/data/augmented/aug-ablation/chebi/baseline.yml @@ -0,0 +1,12 @@ +class_path: chebai_graph.preprocessing.datasets.ChEBI50GraphProperties +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 diff --git a/configs/data/augmented/aug-ablation/gn_wall_fgwa_nfge.yml b/configs/data/augmented/aug-ablation/chebi/gn_wall_fgwa_nfge.yml similarity index 100% rename from configs/data/augmented/aug-ablation/gn_wall_fgwa_nfge.yml rename to configs/data/augmented/aug-ablation/chebi/gn_wall_fgwa_nfge.yml diff --git a/configs/data/augmented/aug-ablation/gn_wall_fgwa_wfge.yml b/configs/data/augmented/aug-ablation/chebi/gn_wall_fgwa_wfge.yml similarity index 100% rename from configs/data/augmented/aug-ablation/gn_wall_fgwa_wfge.yml rename to configs/data/augmented/aug-ablation/chebi/gn_wall_fgwa_wfge.yml diff --git a/configs/data/augmented/aug-ablation/gnwa_fgwa_nfge.yml b/configs/data/augmented/aug-ablation/chebi/gnwa_fgwa_nfge.yml similarity index 100% rename from configs/data/augmented/aug-ablation/gnwa_fgwa_nfge.yml rename to configs/data/augmented/aug-ablation/chebi/gnwa_fgwa_nfge.yml diff --git a/configs/data/augmented/aug-ablation/gnwa_fgwa_wfge.yml b/configs/data/augmented/aug-ablation/chebi/gnwa_fgwa_wfge.yml similarity index 100% rename from configs/data/augmented/aug-ablation/gnwa_fgwa_wfge.yml rename to configs/data/augmented/aug-ablation/chebi/gnwa_fgwa_wfge.yml diff --git a/configs/data/augmented/aug-ablation/tox21/FGN+E+WGN.yml b/configs/data/augmented/aug-ablation/tox21/FGN+E+WGN.yml new file mode 100644 index 0000000..9b1f918 --- /dev/null +++ b/configs/data/augmented/aug-ablation/tox21/FGN+E+WGN.yml @@ -0,0 +1,12 @@ +class_path: chebai_graph.preprocessing.datasets.Tox21_WFGE_WGN_GraphProp +init_args: + properties: + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugBondType + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondAromaticity diff --git a/configs/data/augmented/aug-ablation/tox21/FGN+E.yml b/configs/data/augmented/aug-ablation/tox21/FGN+E.yml new file mode 100644 index 0000000..193eec0 --- /dev/null +++ b/configs/data/augmented/aug-ablation/tox21/FGN+E.yml @@ -0,0 +1,12 @@ +class_path: chebai_graph.preprocessing.datasets.Tox21_WFGE_NGN_GraphProp +init_args: + properties: + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugBondType + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondAromaticity diff --git a/configs/data/augmented/aug-ablation/tox21/FGN+WGN.yml b/configs/data/augmented/aug-ablation/tox21/FGN+WGN.yml new file mode 100644 index 0000000..3515dfb --- /dev/null +++ b/configs/data/augmented/aug-ablation/tox21/FGN+WGN.yml @@ -0,0 +1,12 @@ +class_path: chebai_graph.preprocessing.datasets.Tox21_NFGE_WGN_GraphProp +init_args: + properties: + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugBondType + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondAromaticity diff --git a/configs/data/augmented/aug-ablation/tox21/FGN.yml b/configs/data/augmented/aug-ablation/tox21/FGN.yml new file mode 100644 index 0000000..50feae1 --- /dev/null +++ b/configs/data/augmented/aug-ablation/tox21/FGN.yml @@ -0,0 +1,12 @@ +class_path: chebai_graph.preprocessing.datasets.Tox21_NFGE_NGN_GraphProp +init_args: + properties: + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugBondType + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondAromaticity diff --git a/configs/data/augmented/aug-ablation/tox21/WGN.yml b/configs/data/augmented/aug-ablation/tox21/WGN.yml new file mode 100644 index 0000000..bdb347f --- /dev/null +++ b/configs/data/augmented/aug-ablation/tox21/WGN.yml @@ -0,0 +1,12 @@ +class_path: chebai_graph.preprocessing.datasets.Tox21_Atom_WGNOnly_GraphProp +init_args: + properties: + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugBondType + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondAromaticity diff --git a/configs/data/augmented/aug-ablation/tox21/baseline.yml b/configs/data/augmented/aug-ablation/tox21/baseline.yml new file mode 100644 index 0000000..c0aeeda --- /dev/null +++ b/configs/data/augmented/aug-ablation/tox21/baseline.yml @@ -0,0 +1,12 @@ +class_path: chebai_graph.preprocessing.datasets.Tox21GraphProperties +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 diff --git a/configs/data/augmented/aug-ablation/tox21/gn_wall_fgwa_nfge.yml b/configs/data/augmented/aug-ablation/tox21/gn_wall_fgwa_nfge.yml new file mode 100644 index 0000000..88ddd67 --- /dev/null +++ b/configs/data/augmented/aug-ablation/tox21/gn_wall_fgwa_nfge.yml @@ -0,0 +1,12 @@ +class_path: chebai_graph.preprocessing.datasets.Tox21_GN_WithAllNodes_FG_WithAtoms_NoFGE +init_args: + properties: + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugBondType + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondAromaticity diff --git a/configs/data/augmented/aug-ablation/tox21/gn_wall_fgwa_wfge.yml b/configs/data/augmented/aug-ablation/tox21/gn_wall_fgwa_wfge.yml new file mode 100644 index 0000000..a227629 --- /dev/null +++ b/configs/data/augmented/aug-ablation/tox21/gn_wall_fgwa_wfge.yml @@ -0,0 +1,12 @@ +class_path: chebai_graph.preprocessing.datasets.Tox21_GN_WithAllNodes_FG_WithAtoms_FGE +init_args: + properties: + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugBondType + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondAromaticity diff --git a/configs/data/augmented/aug-ablation/tox21/gnwa_fgwa_nfge.yml b/configs/data/augmented/aug-ablation/tox21/gnwa_fgwa_nfge.yml new file mode 100644 index 0000000..5102fdf --- /dev/null +++ b/configs/data/augmented/aug-ablation/tox21/gnwa_fgwa_nfge.yml @@ -0,0 +1,12 @@ +class_path: chebai_graph.preprocessing.datasets.Tox21_GN_WithAtoms_FG_WithAtoms_NoFGE +init_args: + properties: + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugBondType + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondAromaticity diff --git a/configs/data/augmented/aug-ablation/tox21/gnwa_fgwa_wfge.yml b/configs/data/augmented/aug-ablation/tox21/gnwa_fgwa_wfge.yml new file mode 100644 index 0000000..d79a0ea --- /dev/null +++ b/configs/data/augmented/aug-ablation/tox21/gnwa_fgwa_wfge.yml @@ -0,0 +1,12 @@ +class_path: chebai_graph.preprocessing.datasets.Tox21_GN_WithAtoms_FG_WithAtoms_FGE +init_args: + properties: + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugBondType + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondAromaticity diff --git a/configs/data/augmented/aug-ablation/toxcast/FGN+E+WGN.yml b/configs/data/augmented/aug-ablation/toxcast/FGN+E+WGN.yml new file mode 100644 index 0000000..662da11 --- /dev/null +++ b/configs/data/augmented/aug-ablation/toxcast/FGN+E+WGN.yml @@ -0,0 +1,12 @@ +class_path: chebai_graph.preprocessing.datasets.ToxCast_WFGE_WGN_GraphProp +init_args: + properties: + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugBondType + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondAromaticity diff --git a/configs/data/augmented/aug-ablation/toxcast/FGN+E.yml b/configs/data/augmented/aug-ablation/toxcast/FGN+E.yml new file mode 100644 index 0000000..1c5b321 --- /dev/null +++ b/configs/data/augmented/aug-ablation/toxcast/FGN+E.yml @@ -0,0 +1,12 @@ +class_path: chebai_graph.preprocessing.datasets.ToxCast_WFGE_NGN_GraphProp +init_args: + properties: + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugBondType + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondAromaticity diff --git a/configs/data/augmented/aug-ablation/toxcast/FGN+WGN.yml b/configs/data/augmented/aug-ablation/toxcast/FGN+WGN.yml new file mode 100644 index 0000000..875a57d --- /dev/null +++ b/configs/data/augmented/aug-ablation/toxcast/FGN+WGN.yml @@ -0,0 +1,12 @@ +class_path: chebai_graph.preprocessing.datasets.ToxCast_NFGE_WGN_GraphProp +init_args: + properties: + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugBondType + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondAromaticity diff --git a/configs/data/augmented/aug-ablation/toxcast/FGN.yml b/configs/data/augmented/aug-ablation/toxcast/FGN.yml new file mode 100644 index 0000000..d046445 --- /dev/null +++ b/configs/data/augmented/aug-ablation/toxcast/FGN.yml @@ -0,0 +1,12 @@ +class_path: chebai_graph.preprocessing.datasets.ToxCast_NFGE_NGN_GraphProp +init_args: + properties: + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugBondType + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondAromaticity diff --git a/configs/data/augmented/aug-ablation/toxcast/WGN.yml b/configs/data/augmented/aug-ablation/toxcast/WGN.yml new file mode 100644 index 0000000..1464be0 --- /dev/null +++ b/configs/data/augmented/aug-ablation/toxcast/WGN.yml @@ -0,0 +1,12 @@ +class_path: chebai_graph.preprocessing.datasets.ToxCast_Atom_WGNOnly_GraphProp +init_args: + properties: + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugBondType + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondAromaticity diff --git a/configs/data/augmented/aug-ablation/toxcast/baseline.yml b/configs/data/augmented/aug-ablation/toxcast/baseline.yml new file mode 100644 index 0000000..5a7e18c --- /dev/null +++ b/configs/data/augmented/aug-ablation/toxcast/baseline.yml @@ -0,0 +1,12 @@ +class_path: chebai_graph.preprocessing.datasets.ToxCastGraphProperties +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 diff --git a/configs/data/augmented/aug-ablation/toxcast/gn_wall_fgwa_nfge.yml b/configs/data/augmented/aug-ablation/toxcast/gn_wall_fgwa_nfge.yml new file mode 100644 index 0000000..c38ced5 --- /dev/null +++ b/configs/data/augmented/aug-ablation/toxcast/gn_wall_fgwa_nfge.yml @@ -0,0 +1,12 @@ +class_path: chebai_graph.preprocessing.datasets.ToxCast_GN_WithAllNodes_FG_WithAtoms_NoFGE +init_args: + properties: + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugBondType + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondAromaticity diff --git a/configs/data/augmented/aug-ablation/toxcast/gn_wall_fgwa_wfge.yml b/configs/data/augmented/aug-ablation/toxcast/gn_wall_fgwa_wfge.yml new file mode 100644 index 0000000..8d28ad9 --- /dev/null +++ b/configs/data/augmented/aug-ablation/toxcast/gn_wall_fgwa_wfge.yml @@ -0,0 +1,12 @@ +class_path: chebai_graph.preprocessing.datasets.ToxCast_GN_WithAllNodes_FG_WithAtoms_FGE +init_args: + properties: + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugBondType + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondAromaticity diff --git a/configs/data/augmented/aug-ablation/toxcast/gnwa_fgwa_nfge.yml b/configs/data/augmented/aug-ablation/toxcast/gnwa_fgwa_nfge.yml new file mode 100644 index 0000000..bae368f --- /dev/null +++ b/configs/data/augmented/aug-ablation/toxcast/gnwa_fgwa_nfge.yml @@ -0,0 +1,12 @@ +class_path: chebai_graph.preprocessing.datasets.ToxCast_GN_WithAtoms_FG_WithAtoms_NoFGE +init_args: + properties: + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugBondType + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondAromaticity diff --git a/configs/data/augmented/aug-ablation/toxcast/gnwa_fgwa_wfge.yml b/configs/data/augmented/aug-ablation/toxcast/gnwa_fgwa_wfge.yml new file mode 100644 index 0000000..d754e25 --- /dev/null +++ b/configs/data/augmented/aug-ablation/toxcast/gnwa_fgwa_wfge.yml @@ -0,0 +1,12 @@ +class_path: chebai_graph.preprocessing.datasets.ToxCast_GN_WithAtoms_FG_WithAtoms_FGE +init_args: + properties: + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugBondType + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondAromaticity diff --git a/configs/data/augmented/final/BACE_final_augmented.yml b/configs/data/augmented/final/BACE_final_augmented.yml index 7ea67f0..fc95a55 100644 --- a/configs/data/augmented/final/BACE_final_augmented.yml +++ b/configs/data/augmented/final/BACE_final_augmented.yml @@ -1,4 +1,4 @@ -class_path: chebai_graph.preprocessing.datasets.BACE_WFGE_WGN_AsPerNodeType +class_path: chebai_graph.preprocessing.datasets.BACE_GNWA_FGWA_WFGE_AsPerNodeType init_args: properties: # All Node type properties diff --git a/configs/data/augmented/final/BBBP_final_augmented.yml b/configs/data/augmented/final/BBBP_final_augmented.yml index 9a7ee90..fdef5ca 100644 --- a/configs/data/augmented/final/BBBP_final_augmented.yml +++ b/configs/data/augmented/final/BBBP_final_augmented.yml @@ -1,4 +1,4 @@ -class_path: chebai_graph.preprocessing.datasets.BBBP_WFGE_WGN_AsPerNodeType +class_path: chebai_graph.preprocessing.datasets.BBBP_GNWA_FGWA_WFGE_AsPerNodeType init_args: properties: # All Node type properties diff --git a/configs/data/augmented/final/ClinTox_final_augmented.yml b/configs/data/augmented/final/ClinTox_final_augmented.yml index a4023b3..774103a 100644 --- a/configs/data/augmented/final/ClinTox_final_augmented.yml +++ b/configs/data/augmented/final/ClinTox_final_augmented.yml @@ -1,4 +1,4 @@ -class_path: chebai_graph.preprocessing.datasets.ClinTox_WFGE_WGN_AsPerNodeType +class_path: chebai_graph.preprocessing.datasets.ClinTox_GNWA_FGWA_WFGE_AsPerNodeType init_args: properties: # All Node type properties diff --git a/configs/data/augmented/final/HIV_final_augmented.yml b/configs/data/augmented/final/HIV_final_augmented.yml index 596fc19..126a919 100644 --- a/configs/data/augmented/final/HIV_final_augmented.yml +++ b/configs/data/augmented/final/HIV_final_augmented.yml @@ -1,4 +1,4 @@ -class_path: chebai_graph.preprocessing.datasets.HIV_WFGE_WGN_AsPerNodeType +class_path: chebai_graph.preprocessing.datasets.HIV_GNWA_FGWA_WFGE_AsPerNodeType init_args: properties: # All Node type properties diff --git a/configs/data/augmented/final/MUV_final_augmented.yml b/configs/data/augmented/final/MUV_final_augmented.yml index 56a3e1e..a3ade9c 100644 --- a/configs/data/augmented/final/MUV_final_augmented.yml +++ b/configs/data/augmented/final/MUV_final_augmented.yml @@ -1,4 +1,4 @@ -class_path: chebai_graph.preprocessing.datasets.MUV_WFGE_WGN_AsPerNodeType +class_path: chebai_graph.preprocessing.datasets.MUV_GNWA_FGWA_WFGE_AsPerNodeType init_args: properties: # All Node type properties diff --git a/configs/data/augmented/final/PCBA_final_augmented.yml b/configs/data/augmented/final/PCBA_final_augmented.yml index 40688f4..dbacc76 100644 --- a/configs/data/augmented/final/PCBA_final_augmented.yml +++ b/configs/data/augmented/final/PCBA_final_augmented.yml @@ -1,4 +1,4 @@ -class_path: chebai_graph.preprocessing.datasets.PCBA_WFGE_WGN_AsPerNodeType +class_path: chebai_graph.preprocessing.datasets.PCBA_GNWA_FGWA_WFGE_AsPerNodeType init_args: properties: # All Node type properties diff --git a/configs/data/augmented/final/SIDER_final_augmented.yml b/configs/data/augmented/final/SIDER_final_augmented.yml index 5eef128..bcb071c 100644 --- a/configs/data/augmented/final/SIDER_final_augmented.yml +++ b/configs/data/augmented/final/SIDER_final_augmented.yml @@ -1,4 +1,4 @@ -class_path: chebai_graph.preprocessing.datasets.SIDER_WFGE_WGN_AsPerNodeType +class_path: chebai_graph.preprocessing.datasets.SIDER_GNWA_FGWA_WFGE_AsPerNodeType init_args: properties: # All Node type properties diff --git a/configs/data/augmented/final/Tox21_final_augmented.yml b/configs/data/augmented/final/Tox21_final_augmented.yml index 1c88112..cebd0dc 100644 --- a/configs/data/augmented/final/Tox21_final_augmented.yml +++ b/configs/data/augmented/final/Tox21_final_augmented.yml @@ -1,4 +1,4 @@ -class_path: chebai_graph.preprocessing.datasets.Tox21_WFGE_WGN_AsPerNodeType +class_path: chebai_graph.preprocessing.datasets.Tox21_GNWA_FGWA_WFGE_AsPerNodeType init_args: properties: # All Node type properties diff --git a/configs/data/augmented/final/ToxCast_final_augmented.yml b/configs/data/augmented/final/ToxCast_final_augmented.yml index 4831ae5..88f1a17 100644 --- a/configs/data/augmented/final/ToxCast_final_augmented.yml +++ b/configs/data/augmented/final/ToxCast_final_augmented.yml @@ -1,4 +1,4 @@ -class_path: chebai_graph.preprocessing.datasets.ToxCast_WFGE_WGN_AsPerNodeType +class_path: chebai_graph.preprocessing.datasets.ToxCast_GNWA_FGWA_WFGE_AsPerNodeType init_args: properties: # All Node type properties diff --git a/configs/data/augmented/final/chebi50_final_augmented.yml b/configs/data/augmented/final/chebi50_final_augmented.yml index 576cf75..3ff3232 100644 --- a/configs/data/augmented/final/chebi50_final_augmented.yml +++ b/configs/data/augmented/final/chebi50_final_augmented.yml @@ -1,4 +1,4 @@ -class_path: chebai_graph.preprocessing.datasets.ChEBI50_WFGE_WGN_AsPerNodeType +class_path: chebai_graph.preprocessing.datasets.ChEBI50_GNWA_FGWA_WFGE_AsPerNodeType init_args: properties: # All Node type properties diff --git a/configs/data/augmented/properties/FGN+E+WGN/chebi50_all_props_except_node_lvl.yml b/configs/data/augmented/properties/FGN+E+WGN/chebi50_all_props_except_node_lvl.yml new file mode 100644 index 0000000..a03da69 --- /dev/null +++ b/configs/data/augmented/properties/FGN+E+WGN/chebi50_all_props_except_node_lvl.yml @@ -0,0 +1,24 @@ +class_path: chebai_graph.preprocessing.datasets.ChEBI50_WFGE_WGN_ForAllPropsExceptNodeLevel +init_args: + properties: + # All Node type properties + - chebai_graph.preprocessing.properties.AtomNodeLevel + # Atom Node type properties + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + # FG Node type properties + - chebai_graph.preprocessing.properties.AtomFunctionalGroup + - chebai_graph.preprocessing.properties.IsHydrogenBondDonorFG + - chebai_graph.preprocessing.properties.IsHydrogenBondAcceptorFG + - chebai_graph.preprocessing.properties.IsFGAlkyl + # Graph Node type properties + - chebai_graph.preprocessing.properties.AugRDKit2DNormalized + # Bond properties + - chebai_graph.preprocessing.properties.BondLevel + - chebai_graph.preprocessing.properties.AugBondAromaticity + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondType diff --git a/configs/data/augmented/properties/chebi50_atom_fg_prop_only.yml b/configs/data/augmented/properties/FGN+E+WGN/chebi50_atom_fg_prop_only.yml similarity index 100% rename from configs/data/augmented/properties/chebi50_atom_fg_prop_only.yml rename to configs/data/augmented/properties/FGN+E+WGN/chebi50_atom_fg_prop_only.yml diff --git a/configs/data/augmented/properties/chebi50_atom_graph_node_prop_only.yml b/configs/data/augmented/properties/FGN+E+WGN/chebi50_atom_graph_node_prop_only.yml similarity index 100% rename from configs/data/augmented/properties/chebi50_atom_graph_node_prop_only.yml rename to configs/data/augmented/properties/FGN+E+WGN/chebi50_atom_graph_node_prop_only.yml diff --git a/configs/data/augmented/properties/chebi50_atom_prop_only.yml b/configs/data/augmented/properties/FGN+E+WGN/chebi50_atom_prop_only.yml similarity index 100% rename from configs/data/augmented/properties/chebi50_atom_prop_only.yml rename to configs/data/augmented/properties/FGN+E+WGN/chebi50_atom_prop_only.yml diff --git a/configs/data/augmented/properties/chebi50_fg_graph_node_prop_only.yml b/configs/data/augmented/properties/FGN+E+WGN/chebi50_fg_graph_node_prop_only.yml similarity index 100% rename from configs/data/augmented/properties/chebi50_fg_graph_node_prop_only.yml rename to configs/data/augmented/properties/FGN+E+WGN/chebi50_fg_graph_node_prop_only.yml diff --git a/configs/data/augmented/properties/chebi50_fg_prop_only.yml b/configs/data/augmented/properties/FGN+E+WGN/chebi50_fg_prop_only.yml similarity index 100% rename from configs/data/augmented/properties/chebi50_fg_prop_only.yml rename to configs/data/augmented/properties/FGN+E+WGN/chebi50_fg_prop_only.yml diff --git a/configs/data/augmented/properties/chebi50_graph_node_prop_only.yml b/configs/data/augmented/properties/FGN+E+WGN/chebi50_graph_node_prop_only.yml similarity index 100% rename from configs/data/augmented/properties/chebi50_graph_node_prop_only.yml rename to configs/data/augmented/properties/FGN+E+WGN/chebi50_graph_node_prop_only.yml diff --git a/configs/data/augmented/properties/chebi50_node_level_prop_only.yml b/configs/data/augmented/properties/FGN+E+WGN/chebi50_node_level_prop_only.yml similarity index 100% rename from configs/data/augmented/properties/chebi50_node_level_prop_only.yml rename to configs/data/augmented/properties/FGN+E+WGN/chebi50_node_level_prop_only.yml diff --git a/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_all_props.yml b/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_all_props.yml new file mode 100644 index 0000000..3ff3232 --- /dev/null +++ b/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_all_props.yml @@ -0,0 +1,24 @@ +class_path: chebai_graph.preprocessing.datasets.ChEBI50_GNWA_FGWA_WFGE_AsPerNodeType +init_args: + properties: + # All Node type properties + - chebai_graph.preprocessing.properties.AtomNodeLevel + # Atom Node type properties + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + # FG Node type properties + - chebai_graph.preprocessing.properties.AtomFunctionalGroup + - chebai_graph.preprocessing.properties.IsHydrogenBondDonorFG + - chebai_graph.preprocessing.properties.IsHydrogenBondAcceptorFG + - chebai_graph.preprocessing.properties.IsFGAlkyl + # Graph Node type properties + - chebai_graph.preprocessing.properties.AugRDKit2DNormalized + # Bond properties + - chebai_graph.preprocessing.properties.BondLevel + - chebai_graph.preprocessing.properties.AugBondAromaticity + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondType diff --git a/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_all_props_except_node_lvl.yml b/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_all_props_except_node_lvl.yml new file mode 100644 index 0000000..fd33150 --- /dev/null +++ b/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_all_props_except_node_lvl.yml @@ -0,0 +1,24 @@ +class_path: chebai_graph.preprocessing.datasets.ChEBI50_GNWA_FGWA_WFGE_ForAllPropsExceptNodeLevel +init_args: + properties: + # All Node type properties + - chebai_graph.preprocessing.properties.AtomNodeLevel + # Atom Node type properties + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + # FG Node type properties + - chebai_graph.preprocessing.properties.AtomFunctionalGroup + - chebai_graph.preprocessing.properties.IsHydrogenBondDonorFG + - chebai_graph.preprocessing.properties.IsHydrogenBondAcceptorFG + - chebai_graph.preprocessing.properties.IsFGAlkyl + # Graph Node type properties + - chebai_graph.preprocessing.properties.AugRDKit2DNormalized + # Bond properties + - chebai_graph.preprocessing.properties.BondLevel + - chebai_graph.preprocessing.properties.AugBondAromaticity + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondType diff --git a/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_atom_fg_prop_only.yml b/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_atom_fg_prop_only.yml new file mode 100644 index 0000000..d9053ae --- /dev/null +++ b/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_atom_fg_prop_only.yml @@ -0,0 +1,24 @@ +class_path: chebai_graph.preprocessing.datasets.ChEBI50_GNWA_FGWA_WFGE_ForAtomAndFGLevelOnly +init_args: + properties: + # All Node type properties + - chebai_graph.preprocessing.properties.AtomNodeLevel + # Atom Node type properties + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + # FG Node type properties + - chebai_graph.preprocessing.properties.AtomFunctionalGroup + - chebai_graph.preprocessing.properties.IsHydrogenBondDonorFG + - chebai_graph.preprocessing.properties.IsHydrogenBondAcceptorFG + - chebai_graph.preprocessing.properties.IsFGAlkyl + # Graph Node type properties + - chebai_graph.preprocessing.properties.AugRDKit2DNormalized + # Bond properties + - chebai_graph.preprocessing.properties.BondLevel + - chebai_graph.preprocessing.properties.AugBondAromaticity + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondType diff --git a/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_atom_graph_node_prop_only.yml b/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_atom_graph_node_prop_only.yml new file mode 100644 index 0000000..7ab3ecb --- /dev/null +++ b/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_atom_graph_node_prop_only.yml @@ -0,0 +1,24 @@ +class_path: chebai_graph.preprocessing.datasets.ChEBI50_GNWA_FGWA_WFGE_ForAtomLevelAndGraphNodeOnly +init_args: + properties: + # All Node type properties + - chebai_graph.preprocessing.properties.AtomNodeLevel + # Atom Node type properties + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + # FG Node type properties + - chebai_graph.preprocessing.properties.AtomFunctionalGroup + - chebai_graph.preprocessing.properties.IsHydrogenBondDonorFG + - chebai_graph.preprocessing.properties.IsHydrogenBondAcceptorFG + - chebai_graph.preprocessing.properties.IsFGAlkyl + # Graph Node type properties + - chebai_graph.preprocessing.properties.AugRDKit2DNormalized + # Bond properties + - chebai_graph.preprocessing.properties.BondLevel + - chebai_graph.preprocessing.properties.AugBondAromaticity + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondType diff --git a/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_atom_prop_only.yml b/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_atom_prop_only.yml new file mode 100644 index 0000000..50d18ba --- /dev/null +++ b/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_atom_prop_only.yml @@ -0,0 +1,24 @@ +class_path: chebai_graph.preprocessing.datasets.ChEBI50_GNWA_FGWA_WFGE_ForAtomLevelOnly +init_args: + properties: + # All Node type properties + - chebai_graph.preprocessing.properties.AtomNodeLevel + # Atom Node type properties + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + # FG Node type properties + - chebai_graph.preprocessing.properties.AtomFunctionalGroup + - chebai_graph.preprocessing.properties.IsHydrogenBondDonorFG + - chebai_graph.preprocessing.properties.IsHydrogenBondAcceptorFG + - chebai_graph.preprocessing.properties.IsFGAlkyl + # Graph Node type properties + - chebai_graph.preprocessing.properties.AugRDKit2DNormalized + # Bond properties + - chebai_graph.preprocessing.properties.BondLevel + - chebai_graph.preprocessing.properties.AugBondAromaticity + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondType diff --git a/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_fg_graph_node_prop_only.yml b/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_fg_graph_node_prop_only.yml new file mode 100644 index 0000000..c56edff --- /dev/null +++ b/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_fg_graph_node_prop_only.yml @@ -0,0 +1,24 @@ +class_path: chebai_graph.preprocessing.datasets.ChEBI50_GNWA_FGWA_WFGE_ForFGLevelAndGraphNodeOnly +init_args: + properties: + # All Node type properties + - chebai_graph.preprocessing.properties.AtomNodeLevel + # Atom Node type properties + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + # FG Node type properties + - chebai_graph.preprocessing.properties.AtomFunctionalGroup + - chebai_graph.preprocessing.properties.IsHydrogenBondDonorFG + - chebai_graph.preprocessing.properties.IsHydrogenBondAcceptorFG + - chebai_graph.preprocessing.properties.IsFGAlkyl + # Graph Node type properties + - chebai_graph.preprocessing.properties.AugRDKit2DNormalized + # Bond properties + - chebai_graph.preprocessing.properties.BondLevel + - chebai_graph.preprocessing.properties.AugBondAromaticity + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondType diff --git a/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_fg_prop_only.yml b/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_fg_prop_only.yml new file mode 100644 index 0000000..9b42371 --- /dev/null +++ b/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_fg_prop_only.yml @@ -0,0 +1,24 @@ +class_path: chebai_graph.preprocessing.datasets.ChEBI50_GNWA_FGWA_WFGE_ForFGLevelOnly +init_args: + properties: + # All Node type properties + - chebai_graph.preprocessing.properties.AtomNodeLevel + # Atom Node type properties + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + # FG Node type properties + - chebai_graph.preprocessing.properties.AtomFunctionalGroup + - chebai_graph.preprocessing.properties.IsHydrogenBondDonorFG + - chebai_graph.preprocessing.properties.IsHydrogenBondAcceptorFG + - chebai_graph.preprocessing.properties.IsFGAlkyl + # Graph Node type properties + - chebai_graph.preprocessing.properties.AugRDKit2DNormalized + # Bond properties + - chebai_graph.preprocessing.properties.BondLevel + - chebai_graph.preprocessing.properties.AugBondAromaticity + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondType diff --git a/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_graph_node_prop_only.yml b/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_graph_node_prop_only.yml new file mode 100644 index 0000000..f1921ff --- /dev/null +++ b/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_graph_node_prop_only.yml @@ -0,0 +1,24 @@ +class_path: chebai_graph.preprocessing.datasets.ChEBI50_GNWA_FGWA_WFGE_ForGraphNodeOnly +init_args: + properties: + # All Node type properties + - chebai_graph.preprocessing.properties.AtomNodeLevel + # Atom Node type properties + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + # FG Node type properties + - chebai_graph.preprocessing.properties.AtomFunctionalGroup + - chebai_graph.preprocessing.properties.IsHydrogenBondDonorFG + - chebai_graph.preprocessing.properties.IsHydrogenBondAcceptorFG + - chebai_graph.preprocessing.properties.IsFGAlkyl + # Graph Node type properties + - chebai_graph.preprocessing.properties.AugRDKit2DNormalized + # Bond properties + - chebai_graph.preprocessing.properties.BondLevel + - chebai_graph.preprocessing.properties.AugBondAromaticity + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondType diff --git a/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_node_level_prop_only.yml b/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_node_level_prop_only.yml new file mode 100644 index 0000000..db61465 --- /dev/null +++ b/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_node_level_prop_only.yml @@ -0,0 +1,24 @@ +class_path: chebai_graph.preprocessing.datasets.ChEBI50_GNWA_FGWA_WFGE_ForNodeLevelPropOnlyForAllNodes +init_args: + properties: + # All Node type properties + - chebai_graph.preprocessing.properties.AtomNodeLevel + # Atom Node type properties + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + # FG Node type properties + - chebai_graph.preprocessing.properties.AtomFunctionalGroup + - chebai_graph.preprocessing.properties.IsHydrogenBondDonorFG + - chebai_graph.preprocessing.properties.IsHydrogenBondAcceptorFG + - chebai_graph.preprocessing.properties.IsFGAlkyl + # Graph Node type properties + - chebai_graph.preprocessing.properties.AugRDKit2DNormalized + # Bond properties + - chebai_graph.preprocessing.properties.BondLevel + - chebai_graph.preprocessing.properties.AugBondAromaticity + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondType diff --git a/tests/unit/test_collate.py b/tests/unit/test_collate.py new file mode 100644 index 0000000..d55ad9a --- /dev/null +++ b/tests/unit/test_collate.py @@ -0,0 +1,48 @@ +import unittest + +import torch +from torch_geometric.data import Data as GeomData + +from chebai_graph.preprocessing.collate import GraphCollator + + +class TestGraphCollator(unittest.TestCase): + @staticmethod + def _graph(): + return GeomData( + x=torch.tensor([[6]]), + edge_index=torch.empty((2, 0), dtype=torch.long), + ) + + def test_mixed_missing_labels_do_not_enter_graph_collate(self): + batch = GraphCollator()( + [ + { + "features": self._graph(), + "labels": [1, None, 0, 0, 1], + "ident": "a", + }, + {"features": self._graph(), "labels": None, "ident": "b"}, + { + "features": self._graph(), + "labels": [0, 1, None, 0, 1], + "ident": "c", + }, + ] + ) + + expected_labels = torch.tensor( + [ + [True, False, False, False, True], + [False, True, False, False, True], + ] + ) + self.assertTrue(torch.equal(batch.y, expected_labels)) + self.assertEqual( + batch.additional_fields["loss_kwargs"]["non_null_labels"], [0, 2] + ) + self.assertNotIn("y", batch.x[0]) + + +if __name__ == "__main__": + unittest.main()