MolecularDiffusion.modules.models.syncogen.constants.utils

Functions

get_partial_atom_features(→ torch.Tensor)

Get atom features for a batch of molecules.

get_partial_bond_features(X_indices[, mode])

Constructs a batched adjacency matrix for the full atom graph from fragment adjacency matrices.

get_partial_maccs_keys(→ torch.Tensor)

Get MACCS keys for a batch of molecules.

Module Contents

MolecularDiffusion.modules.models.syncogen.constants.utils.get_partial_atom_features(X_indices: torch.Tensor) torch.Tensor

Get atom features for a batch of molecules.

MolecularDiffusion.modules.models.syncogen.constants.utils.get_partial_bond_features(X_indices, mode='adj')

Constructs a batched adjacency matrix for the full atom graph from fragment adjacency matrices.

Parameters:
  • X_indices – Fragment indices tensor [BS, n_frags]

  • mode – String indicating which features to use - must be “adj” or “feats”

Returns:

[single, double, triple, aromatic, is_masked]

Return type:

Adjacency matrix [BS, n_frags*max_atoms, n_frags*max_atoms, 5] where last dim is onehot

MolecularDiffusion.modules.models.syncogen.constants.utils.get_partial_maccs_keys(X_indices: torch.Tensor) torch.Tensor

Get MACCS keys for a batch of molecules.