DGLMoleculeDatasetEntry

class openff.nagl.nn.DGLMoleculeDatasetEntry(molecule: DGLMolecule, labels: Dict[str, Tensor])[source]

Bases: NamedTuple

A named tuple containing a featurized molecule graph, a tensor of the atom features, and a tensor of the molecule label.

Methods

from_mapped_smiles

Create a dataset entry from a mapped SMILES string.

from_openff

to

Attributes

labels

Alias for field number 1

molecule

Alias for field number 0

classmethod from_mapped_smiles(mapped_smiles: str, labels: Dict[str, Any], atom_features: List[AtomFeature], bond_features: List[BondFeature], atom_feature_tensor: Tensor | None = None, bond_feature_tensor: Tensor | None = None)[source]

Create a dataset entry from a mapped SMILES string.

Parameters:
  • mapped_smiles – The mapped SMILES string.

  • labels – The labels for the dataset entry. These will be converted to Pytorch tensors.

  • atom_features – The atom features to use. If this is provided, an atom_feature_tensor should not be provided as it will be generated during featurization.

  • bond_features – The bond features to use. If this is provided, a bond_feature_tensor should not be provided as it will be generated during featurization.

  • atom_feature_tensor – The atom feature tensor to use. If this is provided, atom_features should not be provided as it will be ignored.

  • bond_feature_tensor – The bond feature tensor to use. If this is provided, bond_features should not be provided as it will be ignored.

classmethod from_openff(openff_molecule: Molecule, labels: Dict[str, Any], atom_features: List[AtomFeature], bond_features: List[BondFeature], atom_feature_tensor: Tensor | None = None, bond_feature_tensor: Tensor | None = None)[source]
labels: Dict[str, Tensor]

Alias for field number 1

molecule: DGLMolecule

Alias for field number 0

to(device: str)[source]