masskit.small_molecule package

Submodules

masskit.small_molecule.react module

class masskit.small_molecule.react.Reactor(standardization_function=<function standardize_mol>)

Bases: object

class for doing several reactions on molecules with multiple steps

apply_reactions(molecules, max_products=1000, mass_range=None)

apply a series of reactions to a list of molecules

Parameters:
  • molecules – list of rdkit Mol

  • max_products – maximum number of products per reaction

  • mass_range – tuple containing low and high value of allowed mass of product

Returns:

list of product molecules

create_reactions(reactant_names=None, functional_group_names=None)

create a set of reactions using functional groups that are modified by the addition of replacement groups

Parameters:
  • reactant_names – list of replacement group names

  • functional_group_names – list of functional group names

property functional_group_names

returns a list of functional group names

Returns:

list of functional group names

react(molecules, reactant_names=None, functional_group_names=None, max_products=1000, max_passes=100, include_original_molecules=False, num_tautomers=0, mass_range=None)

Given a list of molecules, react them using the named reactions

Parameters:
  • molecules – standardized molecule or list of molecules to be reacted

  • reactant_names – list of names of replacement groups added in the reaction. None or [None] means all

  • functional_group_names – list of names of the functional groups where reactions take place. None or [None] means all

  • max_products – maximum number of products per reaction and overall. an approximate bound

  • max_passes – iteratively apply the reactions to reaction products up to max_passes

  • include_original_molecules – add the original molecules to the returned products

  • num_tautomers – create up to this this number of tautomers from the input structures

  • mass_range – tuple containing low and high value of allowed mass of product

Returns:

list of reaction products as rdkit Mol

property reactant_names

returns a list of replacement group names

Returns:

list of replacement group names

masskit.small_molecule.threed module

masskit.small_molecule.threed.bounding_box(mol, conformer_id=-1)

given a mol with a conformer, return the bounding box of the conformer

Parameters:
  • mol – the rdkit mol

  • conformer_id – the conformer to use

Returns:

the bounding box as an np array

masskit.small_molecule.threed.create_conformer(mol, num_conformers=10)

create a conformer for a rdkit mol

Parameters:
  • mol – rdkit molecule. *note that an rdkit molecule is passed by value, not reference*

  • num_conformers – max number of 3D conformers created per molecule

Returns:

molecule, conformer ids, success/failure

masskit.small_molecule.utils module

masskit.small_molecule.utils.AdjustAromaticNs(m, nitrogenPattern='[n&D2&H0;r5,r6]')

default nitrogen pattern matches Ns in 5 rings and 6 rings in order to be able to fix: O=c1ccncc1 nitrogenPattern is aromatic n in ring of size 5 or 6 with 2 further explict connections, with 0 further H

masskit.small_molecule.utils.get_unspec_double_bonds(m)

get list of double bonds with undefined stereochemistry. Copied from https://github.com/DrrDom/rdkit-scripts/blob/master/sanitize_rdkit.py

Parameters:

m – molecule

Returns:

list of bonds

masskit.small_molecule.utils.is_transition_metal(at)
masskit.small_molecule.utils.set_dative_bonds(mol, fromAtoms=(7, 8))

convert some bonds to dative

Replaces some single bonds between metals and atoms with atomic numbers in fomAtoms with dative bonds. The replacement is only done if the atom has “too many” bonds.

Returns the modified molecule.

masskit.small_molecule.utils.standardize_mol(mol)

standardize molecule

Parameters:

mol – rdkit mol to standardize

Returns:

standardized mol

masskit.small_molecule.utils.yang_polarizability(mol)

calculate group additivity values per atom

Parameters:

mol – the molecule

Returns:

dict that maps atom number to group additivity value, calculated polarizability

Module contents