schrodinger.livedesign.biologics.rdmol_hierarchy module

schrodinger.livedesign.biologics.rdmol_hierarchy.add_substance_group(mol: Mol, atoms: list[rdkit.Chem.rdchem.Atom] = None, chains: set[str] = None)

Add a substance group to the RDMol. The RDMol is a mol consisting of atoms. The substance group groups these atoms within the mol creating relationships within the mol that denote the heirarchy.

Parameters:
  • mol – RDMol object

  • atoms – A list of atoms to include in the substance group. If not supplied, the substance group will contain all the atoms in the mol.

  • chains – A set of chain IDs to include in the substance group.

schrodinger.livedesign.biologics.rdmol_hierarchy.make_substance_group(mol: Mol, atoms: list[rdkit.Chem.rdchem.Atom])

Create a substance group in the RDMol with the given atoms.

Parameters:
  • mol – RDMol object

  • atoms – List of atoms to include in the substance group

schrodinger.livedesign.biologics.rdmol_hierarchy.get_chain_atoms(mol: Mol, chain_names: list[str]) list[rdkit.Chem.rdchem.Atom]

Get all atoms in the RDMol that belong to a specific chain.

Parameters:
  • mol – RDMol object

  • chain_names – Chain IDs to filter atoms by

Returns:

List of atoms in the specified chain

schrodinger.livedesign.biologics.rdmol_hierarchy.get_group_indices(mol: Mol) list[set[int]]

Get the indices of all the atoms in the substance groups of the RDMol.

Parameters:

mol – RDMol object

Returns:

List of sets, each set contains the indices of atoms in a substance group

schrodinger.livedesign.biologics.rdmol_hierarchy.get_chemical_model(rdmol_binaries: list[tuple[str, int]]) Mol

Given a list of tuples containing rdmol_binary strings and their counts, return the corresponding chemical model.

Parameters:

rdmol_binaries – A list of tuples containing rdmol_binary strings and their counts.

Returns:

The corresponding chemical model.

schrodinger.livedesign.biologics.rdmol_hierarchy.combine_chemical_models(chemical_models: list[rdkit.Chem.rdchem.Mol]) Mol

Given a list of chemical models, combine them into a single chemical model.

The function uses the CombineMols function from RDKit to combine the models. This function combines two molecules into one, and the function reduce from functools is used to apply this function iteratively to the list of chemical models.

Parameters:

chemical_models – A list of chemical models.

Returns:

The combined chemical model.