rdkit.Chem.rdmolfiles module

Module containing RDKit functionality for working with molecular file formats.

rdkit.Chem.rdmolfiles.AddMetadataToPNGFile((dict)metadata, (AtomPairsParameters)filename) object :

Adds metadata to PNG data read from a file.

ARGUMENTS:

  • metadata: dict with the metadata to be written

    (keys and values should be strings)

  • filename: the PNG filename

RETURNS:

the updated PNG data

C++ signature :

boost::python::api::object AddMetadataToPNGFile(boost::python::dict,boost::python::api::object)

rdkit.Chem.rdmolfiles.AddMetadataToPNGString((dict)metadata, (AtomPairsParameters)png) object :

Adds metadata to a PNG string.

ARGUMENTS:

  • metadata: dict with the metadata to be written

    (keys and values should be strings)

  • png: the PNG string

RETURNS:

the updated PNG data

C++ signature :

boost::python::api::object AddMetadataToPNGString(boost::python::dict,boost::python::api::object)

rdkit.Chem.rdmolfiles.AtomFromSmarts((str)SMARTS) Atom :

Construct an atom from a SMARTS string

C++ signature :

RDKit::Atom* AtomFromSmarts(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)

rdkit.Chem.rdmolfiles.AtomFromSmiles((str)SMILES) Atom :

Construct an atom from a SMILES string

C++ signature :

RDKit::Atom* AtomFromSmiles(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)

rdkit.Chem.rdmolfiles.BondFromSmarts((str)SMILES) Bond :

Construct a bond from a SMARTS string

C++ signature :

RDKit::Bond* BondFromSmarts(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)

rdkit.Chem.rdmolfiles.BondFromSmiles((str)SMILES) Bond :

Construct a bond from a SMILES string

C++ signature :

RDKit::Bond* BondFromSmiles(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)

class rdkit.Chem.rdmolfiles.CXSmilesFields

Bases: enum

CX_ALL = rdkit.Chem.rdmolfiles.CXSmilesFields.CX_ALL
CX_ALL_BUT_COORDS = rdkit.Chem.rdmolfiles.CXSmilesFields.CX_ALL_BUT_COORDS
CX_ATOM_LABELS = rdkit.Chem.rdmolfiles.CXSmilesFields.CX_ATOM_LABELS
CX_ATOM_PROPS = rdkit.Chem.rdmolfiles.CXSmilesFields.CX_ATOM_PROPS
CX_BOND_ATROPISOMER = rdkit.Chem.rdmolfiles.CXSmilesFields.CX_BOND_ATROPISOMER
CX_BOND_CFG = rdkit.Chem.rdmolfiles.CXSmilesFields.CX_BOND_CFG
CX_COORDINATE_BONDS = rdkit.Chem.rdmolfiles.CXSmilesFields.CX_COORDINATE_BONDS
CX_COORDS = rdkit.Chem.rdmolfiles.CXSmilesFields.CX_COORDS
CX_ENHANCEDSTEREO = rdkit.Chem.rdmolfiles.CXSmilesFields.CX_ENHANCEDSTEREO
CX_LINKNODES = rdkit.Chem.rdmolfiles.CXSmilesFields.CX_LINKNODES
CX_MOLFILE_VALUES = rdkit.Chem.rdmolfiles.CXSmilesFields.CX_MOLFILE_VALUES
CX_NONE = rdkit.Chem.rdmolfiles.CXSmilesFields.CX_NONE
CX_POLYMER = rdkit.Chem.rdmolfiles.CXSmilesFields.CX_POLYMER
CX_RADICALS = rdkit.Chem.rdmolfiles.CXSmilesFields.CX_RADICALS
CX_SGROUPS = rdkit.Chem.rdmolfiles.CXSmilesFields.CX_SGROUPS
names = {'CX_ALL': rdkit.Chem.rdmolfiles.CXSmilesFields.CX_ALL, 'CX_ALL_BUT_COORDS': rdkit.Chem.rdmolfiles.CXSmilesFields.CX_ALL_BUT_COORDS, 'CX_ATOM_LABELS': rdkit.Chem.rdmolfiles.CXSmilesFields.CX_ATOM_LABELS, 'CX_ATOM_PROPS': rdkit.Chem.rdmolfiles.CXSmilesFields.CX_ATOM_PROPS, 'CX_BOND_ATROPISOMER': rdkit.Chem.rdmolfiles.CXSmilesFields.CX_BOND_ATROPISOMER, 'CX_BOND_CFG': rdkit.Chem.rdmolfiles.CXSmilesFields.CX_BOND_CFG, 'CX_COORDINATE_BONDS': rdkit.Chem.rdmolfiles.CXSmilesFields.CX_COORDINATE_BONDS, 'CX_COORDS': rdkit.Chem.rdmolfiles.CXSmilesFields.CX_COORDS, 'CX_ENHANCEDSTEREO': rdkit.Chem.rdmolfiles.CXSmilesFields.CX_ENHANCEDSTEREO, 'CX_LINKNODES': rdkit.Chem.rdmolfiles.CXSmilesFields.CX_LINKNODES, 'CX_MOLFILE_VALUES': rdkit.Chem.rdmolfiles.CXSmilesFields.CX_MOLFILE_VALUES, 'CX_NONE': rdkit.Chem.rdmolfiles.CXSmilesFields.CX_NONE, 'CX_POLYMER': rdkit.Chem.rdmolfiles.CXSmilesFields.CX_POLYMER, 'CX_RADICALS': rdkit.Chem.rdmolfiles.CXSmilesFields.CX_RADICALS, 'CX_SGROUPS': rdkit.Chem.rdmolfiles.CXSmilesFields.CX_SGROUPS}
values = {0: rdkit.Chem.rdmolfiles.CXSmilesFields.CX_NONE, 1: rdkit.Chem.rdmolfiles.CXSmilesFields.CX_ATOM_LABELS, 2: rdkit.Chem.rdmolfiles.CXSmilesFields.CX_MOLFILE_VALUES, 4: rdkit.Chem.rdmolfiles.CXSmilesFields.CX_COORDS, 8: rdkit.Chem.rdmolfiles.CXSmilesFields.CX_RADICALS, 16: rdkit.Chem.rdmolfiles.CXSmilesFields.CX_ATOM_PROPS, 32: rdkit.Chem.rdmolfiles.CXSmilesFields.CX_LINKNODES, 64: rdkit.Chem.rdmolfiles.CXSmilesFields.CX_ENHANCEDSTEREO, 128: rdkit.Chem.rdmolfiles.CXSmilesFields.CX_SGROUPS, 256: rdkit.Chem.rdmolfiles.CXSmilesFields.CX_POLYMER, 512: rdkit.Chem.rdmolfiles.CXSmilesFields.CX_BOND_CFG, 1024: rdkit.Chem.rdmolfiles.CXSmilesFields.CX_BOND_ATROPISOMER, 2048: rdkit.Chem.rdmolfiles.CXSmilesFields.CX_COORDINATE_BONDS, 2147483643: rdkit.Chem.rdmolfiles.CXSmilesFields.CX_ALL_BUT_COORDS, 2147483647: rdkit.Chem.rdmolfiles.CXSmilesFields.CX_ALL}
rdkit.Chem.rdmolfiles.CanonicalRankAtoms((Mol)mol[, (bool)breakTies=True[, (bool)includeChirality=True[, (bool)includeIsotopes=True[, (bool)includeAtomMaps=True[, (bool)includeChiralPresence=False]]]]]) _vectj :
Returns the canonical atom ranking for each atom of a molecule fragment.

If breakTies is False, this returns the symmetry class for each atom. The symmetry class is used by the canonicalization routines to type each atom based on the whole chemistry of the molecular graph. Any atom with the same rank (symmetry class) is indistinguishable. For example:

>>> mol = MolFromSmiles('C1NCN1')
>>> list(CanonicalRankAtoms(mol, breakTies=False))
[0,1,0,1]

In this case the carbons have the same symmetry class and the nitrogens have the same symmetry class. From the perspective of the Molecular Graph, they are identical.

ARGUMENTS:

  • mol: the molecule

  • breakTies: (optional) force breaking of ranked ties [default=True]

  • includeChirality: (optional) use chiral information when computing rank [default=True]

  • includeIsotopes: (optional) use isotope information when computing rank [default=True]

  • includeAtomMaps: (optional) use atom map information when computing rank [default=True]

  • includeChiralPresence: (optional) use information about whether or not chirality is specified when computing rank [default=False]

RETURNS:

a string

C++ signature :

std::vector<unsigned int, std::allocator<unsigned int> > CanonicalRankAtoms(RDKit::ROMol [,bool=True [,bool=True [,bool=True [,bool=True [,bool=False]]]]])

rdkit.Chem.rdmolfiles.CanonicalRankAtomsInFragment((Mol)mol, (AtomPairsParameters)atomsToUse[, (AtomPairsParameters)bondsToUse=0[, (AtomPairsParameters)atomSymbols=0[, (bool)breakTies=True[, (bool)includeChirality=True[, (bool)includeIsotopes=True[, (bool)includeAtomMaps=True[, (bool)includeChiralPresence=False]]]]]]]) _vecti :
Returns the canonical atom ranking for each atom of a molecule fragment

See help(CanonicalRankAtoms) for more information.

>>> mol = MolFromSmiles('C1NCN1.C1NCN1')
>>> list(CanonicalRankAtomsInFragment(mol, atomsToUse=range(0,4), breakTies=False))
[4,6,4,6,-1,-1,-1,-1]
>>> list(CanonicalRankAtomsInFragment(mol, atomsToUse=range(4,8), breakTies=False))
[-1,-1,-1,-1,4,6,4,6]

ARGUMENTS:

  • mol: the molecule

  • atomsToUse : a list of atoms to include in the fragment

  • bondsToUse : (optional) a list of bonds to include in the fragment if not provided, all bonds between the atoms provided will be included.

  • atomSymbols : (optional) a list with the symbols to use for the atoms in the SMILES. This should have be mol.GetNumAtoms() long.

  • breakTies: (optional) force breaking of ranked ties

  • includeChirality: (optional) use chiral information when computing rank [default=True]

  • includeIsotopes: (optional) use isotope information when computing rank [default=True]

  • includeAtomMaps: (optional) use atom map information when computing rank [default=True]

  • includeChiralPresence: (optional) use information about whether or not chirality is specified when computing rank [default=False]

RETURNS:

a string

C++ signature :

std::vector<int, std::allocator<int> > CanonicalRankAtomsInFragment(RDKit::ROMol,boost::python::api::object [,boost::python::api::object=0 [,boost::python::api::object=0 [,bool=True [,bool=True [,bool=True [,bool=True [,bool=False]]]]]]])

rdkit.Chem.rdmolfiles.CanonicalizeEnhancedStereo((Mol)mol) None :
C++ signature :

void CanonicalizeEnhancedStereo(RDKit::ROMol {lvalue})

rdkit.Chem.rdmolfiles.CreateAtomBoolPropertyList((Mol)mol, (str)propName[, (str)missingValueMarker=''[, (int)lineSize=190]]) None :

creates a list property on the molecule from individual atom property values

C++ signature :

void CreateAtomBoolPropertyList(RDKit::ROMol {lvalue},std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > [,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >=’’ [,unsigned int=190]])

rdkit.Chem.rdmolfiles.CreateAtomDoublePropertyList((Mol)mol, (str)propName[, (str)missingValueMarker=''[, (int)lineSize=190]]) None :

creates a list property on the molecule from individual atom property values

C++ signature :

void CreateAtomDoublePropertyList(RDKit::ROMol {lvalue},std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > [,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >=’’ [,unsigned int=190]])

rdkit.Chem.rdmolfiles.CreateAtomIntPropertyList((Mol)mol, (str)propName[, (str)missingValueMarker=''[, (int)lineSize=190]]) None :

creates a list property on the molecule from individual atom property values

C++ signature :

void CreateAtomIntPropertyList(RDKit::ROMol {lvalue},std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > [,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >=’’ [,unsigned int=190]])

rdkit.Chem.rdmolfiles.CreateAtomStringPropertyList((Mol)mol, (str)propName[, (str)missingValueMarker=''[, (int)lineSize=190]]) None :

creates a list property on the molecule from individual atom property values

C++ signature :

void CreateAtomStringPropertyList(RDKit::ROMol {lvalue},std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > [,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >=’’ [,unsigned int=190]])

class rdkit.Chem.rdmolfiles.ForwardSDMolSupplier((object)self, (AtomPairsParameters)fileobj[, (bool)sanitize=True[, (bool)removeHs=True[, (bool)strictParsing=True]]])

Bases: instance

A class which supplies molecules from file-like object containing SD data.

Usage examples:

  1. Lazy evaluation: the molecules are not constructed until we ask for them:

    >>> suppl = ForwardSDMolSupplier(file('in.sdf'))
    >>> for mol in suppl:
    ...    if mol is not None: mol.GetNumAtoms()
    
  2. we can also read from compressed files:

    >>> import gzip
    >>> suppl = ForwardSDMolSupplier(gzip.open('in.sdf.gz'))
    >>> for mol in suppl:
    ...   if mol is not None: print mol.GetNumAtoms()
    

Properties in the SD file are used to set properties on each molecule. The properties are accessible using the mol.GetProp(propName) method.

C++ signature :

void __init__(_object*,boost::python::api::object {lvalue} [,bool=True [,bool=True [,bool=True]]])

__init__( (object)self, (streambuf)streambuf [, (bool)sanitize=True [, (bool)removeHs=True [, (bool)strictParsing=True]]]) -> None :

C++ signature :

void __init__(_object*,boost_adaptbx::python::streambuf {lvalue} [,bool=True [,bool=True [,bool=True]]])

__init__( (object)self, (str)filename [, (bool)sanitize=True [, (bool)removeHs=True [, (bool)strictParsing=True]]]) -> None :

C++ signature :

void __init__(_object*,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > [,bool=True [,bool=True [,bool=True]]])

GetEOFHitOnRead((ForwardSDMolSupplier)self) bool :

Returns whether or EOF was hit while parsing the previous entry.

C++ signature :

bool GetEOFHitOnRead((anonymous namespace)::LocalForwardSDMolSupplier {lvalue})

GetProcessPropertyLists((ForwardSDMolSupplier)self) bool :

returns whether or not any property lists that are present will be processed when reading molecules

C++ signature :

bool GetProcessPropertyLists((anonymous namespace)::LocalForwardSDMolSupplier {lvalue})

SetProcessPropertyLists((ForwardSDMolSupplier)self, (bool)val) None :

sets whether or not any property lists that are present will be processed when reading molecules

C++ signature :

void SetProcessPropertyLists((anonymous namespace)::LocalForwardSDMolSupplier {lvalue},bool)

atEnd((ForwardSDMolSupplier)self) bool :

Returns whether or not we have hit EOF.

C++ signature :

bool atEnd((anonymous namespace)::LocalForwardSDMolSupplier {lvalue})

class rdkit.Chem.rdmolfiles.MaeMolSupplier((object)self)

Bases: instance

A class which supplies molecules from file-like object containing Maestro data.

Usage examples:

  1. Lazy evaluation: the molecules are not constructed until we ask for them:

    >>> suppl = MaeMolSupplier(file('in.mae'))
    >>> for mol in suppl:
    ...    if mol is not None: mol.GetNumAtoms()
    
  2. we can also read from compressed files:

    >>> import gzip
    >>> suppl = MaeMolSupplier(gzip.open('in.maegz'))
    >>> for mol in suppl:
    ...   if mol is not None: print mol.GetNumAtoms()
    

Properties in the Maestro file are used to set properties on each molecule. The properties are accessible using the mol.GetProp(propName) method.

C++ signature :

void __init__(_object*)

__init__( (object)self, (AtomPairsParameters)fileobj [, (bool)sanitize=True [, (bool)removeHs=True]]) -> None :

C++ signature :

void __init__(_object*,boost::python::api::object {lvalue} [,bool=True [,bool=True]])

__init__( (object)self, (streambuf)streambuf [, (bool)sanitize=True [, (bool)removeHs=True]]) -> None :

C++ signature :

void __init__(_object*,boost_adaptbx::python::streambuf {lvalue} [,bool=True [,bool=True]])

__init__( (object)self, (str)filename [, (bool)sanitize=True [, (bool)removeHs=True]]) -> None :

C++ signature :

void __init__(_object*,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > [,bool=True [,bool=True]])

SetData((MaeMolSupplier)self, (str)data[, (bool)sanitize=True[, (bool)removeHs=True]]) None :

Sets the text to be parsed

C++ signature :

void SetData((anonymous namespace)::LocalMaeMolSupplier {lvalue},std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > [,bool=True [,bool=True]])

atEnd((MaeMolSupplier)self) bool :

Returns whether or not we have hit EOF.

C++ signature :

bool atEnd((anonymous namespace)::LocalMaeMolSupplier {lvalue})

reset((MaeMolSupplier)self) None :

Resets our position in the file to the beginning.

C++ signature :

void reset((anonymous namespace)::LocalMaeMolSupplier {lvalue})

class rdkit.Chem.rdmolfiles.MaeWriter((object)self, (AtomPairsParameters)fileobj)

Bases: instance

An experimental class for writing molecules to Maestro files.

Usage examples:

  1. writing to a named file:

    >>> writer = MaeWriter('out.mae')
    >>> for mol in list_of_mols:
    ...    writer.write(mol)
    
  2. writing to a file-like object:

    >>> import gzip
    >>> outf=gzip.open('out.mae.gz','wt+')
    >>> writer = MaeWriter(outf)
    >>> for mol in list_of_mols:
    ...   writer.write(mol)
    >>> writer.close()
    >>> outf.close()
    

By default all non-private molecule, atom and bond properties are written to the Maestro file. This can be changed using the SetProps method:

>>> writer = MaeWriter('out.mae')
>>> writer.SetProps(['prop1','prop2'])

Properties that are specified, but are not present will be ignored.

Kekulization is mandatory, as the Maestro format does not have the concept of an aromatic bond

As this is an experimental writer, many features are not supported yet, e.g. chirality and bond stereo labels, stereo groups, substance groups, isotopes, or even dummy atoms. Note that these aren’t supported by MaeMolSupplier either.

C++ signature :

void __init__(_object*,boost::python::api::object {lvalue})

__init__( (object)self, (streambuf)streambuf) -> None :

C++ signature :

void __init__(_object*,boost_adaptbx::python::streambuf {lvalue})

__init__( (object)self, (str)filename) -> None :

C++ signature :

void __init__(_object*,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)

static GetText((Mol)mol[, (int)confId=-1[, (_vectNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE)props_list=<rdkit.rdBase._vectNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE object at 0x7500b322c740>]]) str :

returns the Maestro ct block text for a molecule

C++ signature :

std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > GetText(RDKit::ROMol [,int=-1 [,std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >=<rdkit.rdBase._vectNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE object at 0x7500b322c740>]])

NumMols((MaeWriter)self) int :

Returns the number of molecules written so far.

C++ signature :

unsigned int NumMols(RDKit::LocalMaeWriter {lvalue})

SetProps((MaeWriter)self, (_vectNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE)props_list) None :

Sets the atom and mol properties to be written to the output file

ARGUMENTS:

  • props: a list or tuple of atom and mol property names

C++ signature :

void SetProps(RDKit::LocalMaeWriter {lvalue},std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >)

close((MaeWriter)self) None :

Flushes the output file and closes it. The Writer cannot be used after this.

C++ signature :

void close(RDKit::LocalMaeWriter {lvalue})

flush((MaeWriter)self) None :

Flushes the output file (forces the disk file to be updated).

C++ signature :

void flush(RDKit::LocalMaeWriter {lvalue})

write((MaeWriter)self, (Mol)mol[, (int)confId=-1]) None :

Writes a molecule to the output file.

ARGUMENTS:

  • mol: the Mol to be written

  • confId: (optional) ID of the conformation to write

C++ signature :

void write(RDKit::LocalMaeWriter {lvalue},RDKit::ROMol [,int=-1])

rdkit.Chem.rdmolfiles.MetadataFromPNGFile((AtomPairsParameters)filename) dict :

Returns a dict with all metadata from the PNG file. Keys are strings, values are bytes.

C++ signature :

boost::python::dict MetadataFromPNGFile(boost::python::api::object)

rdkit.Chem.rdmolfiles.MetadataFromPNGString((AtomPairsParameters)png) dict :

Returns a dict with all metadata from the PNG string. Keys are strings, values are bytes.

C++ signature :

boost::python::dict MetadataFromPNGString(boost::python::api::object)

rdkit.Chem.rdmolfiles.MolFragmentToCXSmarts((Mol)mol, (AtomPairsParameters)atomsToUse[, (AtomPairsParameters)bondsToUse=0[, (bool)isomericSmarts=True]]) str :
Returns a SMARTS string for a fragment of a molecule

ARGUMENTS:

  • mol: the molecule

  • atomsToUse: indices of atoms to include in the SMARTS string

  • bondsToUse: indices of bonds to include in the SMARTS string (optional)

  • isomericSmarts: (optional) include information about stereochemistry in the SMARTS. Defaults to true.

RETURNS:

a string

C++ signature :

std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > MolFragmentToCXSmarts(RDKit::ROMol,boost::python::api::object [,boost::python::api::object=0 [,bool=True]])

rdkit.Chem.rdmolfiles.MolFragmentToCXSmiles((Mol)mol, (SmilesWriteParams)params, (AtomPairsParameters)atomsToUse[, (AtomPairsParameters)bondsToUse=0[, (AtomPairsParameters)atomSymbols=0[, (AtomPairsParameters)bondSymbols=0]]]) str :
Returns the CXSMILES string for a fragment of a molecule

ARGUMENTS:

  • mol: the molecule

  • params: the SmilesWriteParams

  • atomsToUse : a list of atoms to include in the fragment

  • bondsToUse : (optional) a list of bonds to include in the fragment if not provided, all bonds between the atoms provided will be included.

  • atomSymbols : (optional) a list with the symbols to use for the atoms in the SMILES. This should have be mol.GetNumAtoms() long.

  • bondSymbols : (optional) a list with the symbols to use for the bonds in the SMILES. This should have be mol.GetNumBonds() long.

RETURNS:

a string

C++ signature :

std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > MolFragmentToCXSmiles(RDKit::ROMol,RDKit::SmilesWriteParams,boost::python::api::object [,boost::python::api::object=0 [,boost::python::api::object=0 [,boost::python::api::object=0]]])

MolFragmentToCXSmiles( (Mol)mol, (AtomPairsParameters)atomsToUse [, (AtomPairsParameters)bondsToUse=0 [, (AtomPairsParameters)atomSymbols=0 [, (AtomPairsParameters)bondSymbols=0 [, (bool)isomericSmiles=True [, (bool)kekuleSmiles=False [, (int)rootedAtAtom=-1 [, (bool)canonical=True [, (bool)allBondsExplicit=False [, (bool)allHsExplicit=False]]]]]]]]]) -> str :
Returns the CXSMILES string for a fragment of a molecule

ARGUMENTS:

  • mol: the molecule

  • atomsToUse : a list of atoms to include in the fragment

  • bondsToUse : (optional) a list of bonds to include in the fragment if not provided, all bonds between the atoms provided will be included.

  • atomSymbols : (optional) a list with the symbols to use for the atoms in the SMILES. This should have be mol.GetNumAtoms() long.

  • bondSymbols : (optional) a list with the symbols to use for the bonds in the SMILES. This should have be mol.GetNumBonds() long.

  • isomericSmiles: (optional) include information about stereochemistry in the SMILES. Defaults to true.

  • kekuleSmiles: (optional) use the Kekule form (no aromatic bonds) in the SMILES. Defaults to false.

  • rootedAtAtom: (optional) if non-negative, this forces the SMILES to start at a particular atom. Defaults to -1.

  • canonical: (optional) if false no attempt will be made to canonicalize the molecule. Defaults to true.

  • allBondsExplicit: (optional) if true, all bond orders will be explicitly indicated in the output SMILES. Defaults to false.

  • allHsExplicit: (optional) if true, all H counts will be explicitly indicated in the output SMILES. Defaults to false.

RETURNS:

a string

C++ signature :

std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > MolFragmentToCXSmiles(RDKit::ROMol,boost::python::api::object [,boost::python::api::object=0 [,boost::python::api::object=0 [,boost::python::api::object=0 [,bool=True [,bool=False [,int=-1 [,bool=True [,bool=False [,bool=False]]]]]]]]])

rdkit.Chem.rdmolfiles.MolFragmentToSmarts((Mol)mol, (AtomPairsParameters)atomsToUse[, (AtomPairsParameters)bondsToUse=0[, (bool)isomericSmarts=True]]) str :
Returns a SMARTS string for a fragment of a molecule

ARGUMENTS:

  • mol: the molecule

  • atomsToUse: indices of atoms to include in the SMARTS string

  • bondsToUse: indices of bonds to include in the SMARTS string (optional)

  • isomericSmarts: (optional) include information about stereochemistry in the SMARTS. Defaults to true.

RETURNS:

a string

C++ signature :

std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > MolFragmentToSmarts(RDKit::ROMol,boost::python::api::object [,boost::python::api::object=0 [,bool=True]])

rdkit.Chem.rdmolfiles.MolFragmentToSmiles((Mol)mol, (SmilesWriteParams)params, (AtomPairsParameters)atomsToUse[, (AtomPairsParameters)bondsToUse=0[, (AtomPairsParameters)atomSymbols=0[, (AtomPairsParameters)bondSymbols=0]]]) str :
Returns the canonical SMILES string for a fragment of a molecule

ARGUMENTS:

  • mol: the molecule

  • params: the SmilesWriteParams

  • atomsToUse : a list of atoms to include in the fragment

  • bondsToUse : (optional) a list of bonds to include in the fragment if not provided, all bonds between the atoms provided will be included.

  • atomSymbols : (optional) a list with the symbols to use for the atoms in the SMILES. This should have be mol.GetNumAtoms() long.

  • bondSymbols : (optional) a list with the symbols to use for the bonds in the SMILES. This should have be mol.GetNumBonds() long.

RETURNS:

a string

C++ signature :

std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > MolFragmentToSmiles(RDKit::ROMol,RDKit::SmilesWriteParams,boost::python::api::object [,boost::python::api::object=0 [,boost::python::api::object=0 [,boost::python::api::object=0]]])

MolFragmentToSmiles( (Mol)mol, (AtomPairsParameters)atomsToUse [, (AtomPairsParameters)bondsToUse=0 [, (AtomPairsParameters)atomSymbols=0 [, (AtomPairsParameters)bondSymbols=0 [, (bool)isomericSmiles=True [, (bool)kekuleSmiles=False [, (int)rootedAtAtom=-1 [, (bool)canonical=True [, (bool)allBondsExplicit=False [, (bool)allHsExplicit=False]]]]]]]]]) -> str :
Returns the canonical SMILES string for a fragment of a molecule

ARGUMENTS:

  • mol: the molecule

  • atomsToUse : a list of atoms to include in the fragment

  • bondsToUse : (optional) a list of bonds to include in the fragment if not provided, all bonds between the atoms provided will be included.

  • atomSymbols : (optional) a list with the symbols to use for the atoms in the SMILES. This should have be mol.GetNumAtoms() long.

  • bondSymbols : (optional) a list with the symbols to use for the bonds in the SMILES. This should have be mol.GetNumBonds() long.

  • isomericSmiles: (optional) include information about stereochemistry in the SMILES. Defaults to true.

  • kekuleSmiles: (optional) use the Kekule form (no aromatic bonds) in the SMILES. Defaults to false.

  • rootedAtAtom: (optional) if non-negative, this forces the SMILES to start at a particular atom. Defaults to -1.

  • canonical: (optional) if false no attempt will be made to canonicalize the molecule. Defaults to true.

  • allBondsExplicit: (optional) if true, all bond orders will be explicitly indicated in the output SMILES. Defaults to false.

  • allHsExplicit: (optional) if true, all H counts will be explicitly indicated in the output SMILES. Defaults to false.

RETURNS:

a string

C++ signature :

std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > MolFragmentToSmiles(RDKit::ROMol,boost::python::api::object [,boost::python::api::object=0 [,boost::python::api::object=0 [,boost::python::api::object=0 [,bool=True [,bool=False [,int=-1 [,bool=True [,bool=False [,bool=False]]]]]]]]])

rdkit.Chem.rdmolfiles.MolFromFASTA((AtomPairsParameters)text[, (bool)sanitize=True[, (int)flavor=0]]) Mol :

Construct a molecule from a FASTA string (currently only supports peptides).

ARGUMENTS:

  • text: string containing the FASTA

  • sanitize: (optional) toggles sanitization of the molecule. Defaults to True.

  • flavor: (optional)
    • 0 Protein, L amino acids (default)

    • 1 Protein, D amino acids

    • 2 RNA, no cap

    • 3 RNA, 5’ cap

    • 4 RNA, 3’ cap

    • 5 RNA, both caps

    • 6 DNA, no cap

    • 7 DNA, 5’ cap

    • 8 DNA, 3’ cap

    • 9 DNA, both caps

    RETURNS:

    a Mol object, None on failure.

C++ signature :

RDKit::ROMol* MolFromFASTA(boost::python::api::object [,bool=True [,int=0]])

rdkit.Chem.rdmolfiles.MolFromHELM((AtomPairsParameters)text[, (bool)sanitize=True]) Mol :

Construct a molecule from a HELM string (currently only supports peptides).

ARGUMENTS:

  • text: string containing the HELM

  • sanitize: (optional) toggles sanitization of the molecule. Defaults to true.

RETURNS:

a Mol object, None on failure.

C++ signature :

RDKit::ROMol* MolFromHELM(boost::python::api::object [,bool=True])

rdkit.Chem.rdmolfiles.MolFromMol2Block((str)mol2Block[, (bool)sanitize=True[, (bool)removeHs=True[, (bool)cleanupSubstructures=True]]]) Mol :

Construct a molecule from a Tripos Mol2 block.

NOTE:

The parser expects the atom-typing scheme used by Corina. Atom types from Tripos’ dbtranslate are less supported. Other atom typing schemes are unlikely to work.

ARGUMENTS:

  • mol2Block: string containing the Mol2 block

  • sanitize: (optional) toggles sanitization of the molecule. Defaults to True.

  • removeHs: (optional) toggles removing hydrogens from the molecule. This only make sense when sanitization is done. Defaults to true.

  • cleanupSubstructures: (optional) toggles standardizing some substructures found in mol2 files. Defaults to true.

RETURNS:

a Mol object, None on failure.

C++ signature :

RDKit::ROMol* MolFromMol2Block(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > [,bool=True [,bool=True [,bool=True]]])

rdkit.Chem.rdmolfiles.MolFromMol2File((str)mol2FileName[, (bool)sanitize=True[, (bool)removeHs=True[, (bool)cleanupSubstructures=True]]]) Mol :

Construct a molecule from a Tripos Mol2 file.

NOTE:

The parser expects the atom-typing scheme used by Corina. Atom types from Tripos’ dbtranslate are less supported. Other atom typing schemes are unlikely to work.

ARGUMENTS:

  • mol2FileName: name of the file to read

  • sanitize: (optional) toggles sanitization of the molecule. Defaults to true.

  • removeHs: (optional) toggles removing hydrogens from the molecule. This only make sense when sanitization is done. Defaults to true.

  • cleanupSubstructures: (optional) toggles standardizing some substructures found in mol2 files. Defaults to true.

RETURNS:

a Mol object, None on failure.

C++ signature :

RDKit::ROMol* MolFromMol2File(char const* [,bool=True [,bool=True [,bool=True]]])

rdkit.Chem.rdmolfiles.MolFromMolBlock((AtomPairsParameters)molBlock[, (bool)sanitize=True[, (bool)removeHs=True[, (bool)strictParsing=True]]]) Mol :

Construct a molecule from a Mol block.

ARGUMENTS:

  • molBlock: string containing the Mol block

  • sanitize: (optional) toggles sanitization of the molecule. Defaults to True.

  • removeHs: (optional) toggles removing hydrogens from the molecule. This only make sense when sanitization is done. Defaults to true.

  • strictParsing: (optional) if this is false, the parser is more lax about. correctness of the content. Defaults to true.

RETURNS:

a Mol object, None on failure.

C++ signature :

RDKit::ROMol* MolFromMolBlock(boost::python::api::object [,bool=True [,bool=True [,bool=True]]])

MolFromMolBlock( (AtomPairsParameters)molBlock [, (bool)sanitize=True [, (bool)removeHs=True [, (bool)strictParsing=True]]]) -> Mol :

Construct a molecule from a Mol block.

ARGUMENTS:

  • molBlock: string containing the Mol block

  • sanitize: (optional) toggles sanitization of the molecule. Defaults to True.

  • removeHs: (optional) toggles removing hydrogens from the molecule. This only make sense when sanitization is done. Defaults to true.

  • strictParsing: (optional) if this is false, the parser is more lax about. correctness of the content. Defaults to true.

RETURNS:

a Mol object, None on failure.

C++ signature :

RDKit::ROMol* MolFromMolBlock(boost::python::api::object [,bool=True [,bool=True [,bool=True]]])

rdkit.Chem.rdmolfiles.MolFromMolFile((str)molFileName[, (bool)sanitize=True[, (bool)removeHs=True[, (bool)strictParsing=True]]]) Mol :

Construct a molecule from a Mol file.

ARGUMENTS:

  • fileName: name of the file to read

  • sanitize: (optional) toggles sanitization of the molecule. Defaults to true.

  • removeHs: (optional) toggles removing hydrogens from the molecule. This only make sense when sanitization is done. Defaults to true.

  • strictParsing: (optional) if this is false, the parser is more lax about. correctness of the content. Defaults to true.

RETURNS:

a Mol object, None on failure.

C++ signature :

RDKit::ROMol* MolFromMolFile(char const* [,bool=True [,bool=True [,bool=True]]])

MolFromMolFile( (str)molFileName [, (bool)sanitize=True [, (bool)removeHs=True [, (bool)strictParsing=True]]]) -> Mol :

Construct a molecule from a Mol file.

ARGUMENTS:

  • molFileName: name of the file to read

  • sanitize: (optional) toggles sanitization of the molecule. Defaults to true.

  • removeHs: (optional) toggles removing hydrogens from the molecule. This only make sense when sanitization is done. Defaults to true.

  • strictParsing: (optional) if this is false, the parser is more lax about. correctness of the content. Defaults to true.

RETURNS:

a Mol object, None on failure.

C++ signature :

RDKit::ROMol* MolFromMolFile(char const* [,bool=True [,bool=True [,bool=True]]])

rdkit.Chem.rdmolfiles.MolFromMrvBlock((AtomPairsParameters)mrvBlock[, (bool)sanitize=True[, (bool)removeHs=True]]) Mol :

Construct a molecule from a Marvin (mrv) block.

ARGUMENTS:

  • molBlock: string containing the Marvin block

  • sanitize: (optional) toggles sanitization of the molecule. Defaults to True.

  • removeHs: (optional) toggles removing hydrogens from the molecule. This only make sense when sanitization is done. Defaults to true.

RETURNS:

a Mol object, None on failure.

C++ signature :

RDKit::ROMol* MolFromMrvBlock(boost::python::api::object [,bool=True [,bool=True]])

rdkit.Chem.rdmolfiles.MolFromMrvFile((str)molFileName[, (bool)sanitize=True[, (bool)removeHs=True]]) Mol :

Construct a molecule from a Marvin (Mrv) file.

ARGUMENTS:

  • fileName: name of the file to read

  • sanitize: (optional) toggles sanitization of the molecule. Defaults to true.

  • removeHs: (optional) toggles removing hydrogens from the molecule. This only make sense when sanitization is done. Defaults to true.

RETURNS:

a Mol object, None on failure.

C++ signature :

RDKit::ROMol* MolFromMrvFile(char const* [,bool=True [,bool=True]])

rdkit.Chem.rdmolfiles.MolFromPDBBlock((AtomPairsParameters)molBlock[, (bool)sanitize=True[, (bool)removeHs=True[, (int)flavor=0[, (bool)proximityBonding=True]]]]) Mol :

Construct a molecule from a PDB block.

ARGUMENTS:

  • molBlock: string containing the PDB block

  • sanitize: (optional) toggles sanitization of the molecule. Defaults to True.

  • removeHs: (optional) toggles removing hydrogens from the molecule. This only make sense when sanitization is done. Defaults to true.

  • flavor: (optional)

  • proximityBonding: (optional) toggles automatic proximity bonding

RETURNS:

a Mol object, None on failure.

C++ signature :

RDKit::ROMol* MolFromPDBBlock(boost::python::api::object [,bool=True [,bool=True [,unsigned int=0 [,bool=True]]]])

rdkit.Chem.rdmolfiles.MolFromPDBFile((str)pdbFileName[, (bool)sanitize=True[, (bool)removeHs=True[, (int)flavor=0[, (bool)proximityBonding=True]]]]) Mol :

Construct a molecule from a PDB file.

ARGUMENTS:

  • pdbFileName: name of the file to read

  • sanitize: (optional) toggles sanitization of the molecule. Defaults to true.

  • removeHs: (optional) toggles removing hydrogens from the molecule. This only make sense when sanitization is done. Defaults to true.

  • flavor: (optional)

  • proximityBonding: (optional) toggles automatic proximity bonding

RETURNS:

a Mol object, None on failure.

C++ signature :

RDKit::ROMol* MolFromPDBFile(char const* [,bool=True [,bool=True [,unsigned int=0 [,bool=True]]]])

rdkit.Chem.rdmolfiles.MolFromPNGFile((str)filename[, (AtomPairsParameters)params=None]) Mol :

Construct a molecule from metadata in a PNG file.

ARGUMENTS:

  • filename: the PNG filename

  • params: used to provide optional parameters for the metadata parsing

RETURNS:

a Mol object, None on failure.

C++ signature :

RDKit::ROMol* MolFromPNGFile(char const* [,boost::python::api::object=None])

rdkit.Chem.rdmolfiles.MolFromPNGString((AtomPairsParameters)png[, (AtomPairsParameters)params=None]) Mol :

Construct a molecule from metadata in a PNG string.

ARGUMENTS:

  • png: the PNG string

  • params: used to provide optional parameters for the metadata parsing

RETURNS:

a Mol object, None on failure.

C++ signature :

RDKit::ROMol* MolFromPNGString(boost::python::api::object [,boost::python::api::object=None])

rdkit.Chem.rdmolfiles.MolFromRDKitSVG((AtomPairsParameters)svg[, (bool)sanitize=True[, (bool)removeHs=True]]) Mol :

Construct a molecule from an RDKit-generate SVG string.

ARGUMENTS:

  • svg: string containing the SVG data (must include molecule metadata)

  • sanitize: (optional) toggles sanitization of the molecule. Defaults to True.

  • removeHs: (optional) toggles removing hydrogens from the molecule. This only make sense when sanitization is done. Defaults to true.

RETURNS:

a Mol object, None on failure.

NOTE: this functionality should be considered beta.

C++ signature :

RDKit::ROMol* MolFromRDKitSVG(boost::python::api::object [,bool=True [,bool=True]])

rdkit.Chem.rdmolfiles.MolFromSequence((AtomPairsParameters)text[, (bool)sanitize=True[, (int)flavor=0]]) Mol :

Construct a molecule from a sequence string (currently only supports peptides).

ARGUMENTS:

  • text: string containing the sequence

  • sanitize: (optional) toggles sanitization of the molecule. Defaults to True.

  • flavor: (optional)
    • 0 Protein, L amino acids (default)

    • 1 Protein, D amino acids

    • 2 RNA, no cap

    • 3 RNA, 5’ cap

    • 4 RNA, 3’ cap

    • 5 RNA, both caps

    • 6 DNA, no cap

    • 7 DNA, 5’ cap

    • 8 DNA, 3’ cap

    • 9 DNA, both caps

RETURNS:

a Mol object, None on failure.

C++ signature :

RDKit::ROMol* MolFromSequence(boost::python::api::object [,bool=True [,int=0]])

rdkit.Chem.rdmolfiles.MolFromSmarts((AtomPairsParameters)SMARTS[, (bool)mergeHs=False[, (dict)replacements={}]]) Mol :

Construct a molecule from a SMARTS string.

ARGUMENTS:

  • SMARTS: the smarts string

  • mergeHs: (optional) toggles the merging of explicit Hs in the query into the attached atoms. So, for example, ‘C[H]’ becomes ‘[C;!H0]’. Defaults to 0.

  • replacements: (optional) a dictionary of replacement strings (see below) Defaults to {}. See the documentation for MolFromSmiles for an explanation.

RETURNS:

a Mol object, None on failure.

C++ signature :

RDKit::ROMol* MolFromSmarts(boost::python::api::object [,bool=False [,boost::python::dict={}]])

MolFromSmarts( (AtomPairsParameters)SMARTS, (SmartsParserParams)params) -> Mol :

Construct a molecule from a SMARTS string.

ARGUMENTS:

  • SMARTS: the smarts string

  • params: used to provide optional parameters for the SMARTS parsing

RETURNS:

a Mol object, None on failure.

C++ signature :

RDKit::ROMol* MolFromSmarts(boost::python::api::object,RDKit::v1::SmartsParserParams)

rdkit.Chem.rdmolfiles.MolFromSmiles((AtomPairsParameters)SMILES, (SmilesParserParams)params) Mol :

Construct a molecule from a SMILES string.

ARGUMENTS:

  • SMILES: the smiles string

  • params: used to provide optional parameters for the SMILES parsing

RETURNS:

a Mol object, None on failure.

C++ signature :

RDKit::ROMol* MolFromSmiles(boost::python::api::object,RDKit::v1::SmilesParserParams)

MolFromSmiles( (AtomPairsParameters)SMILES [, (bool)sanitize=True [, (dict)replacements={}]]) -> Mol :

Construct a molecule from a SMILES string.

ARGUMENTS:

  • SMILES: the smiles string

  • sanitize: (optional) toggles sanitization of the molecule. Defaults to True.

  • replacements: (optional) a dictionary of replacement strings (see below) Defaults to {}.

RETURNS:

a Mol object, None on failure.

The optional replacements dict can be used to do string substitution of abbreviations in the input SMILES. The set of substitutions is repeatedly looped through until the string no longer changes. It is the responsibility of the caller to make sure that substitutions results in legal and sensible SMILES.

Examples of replacements:

CC{Q}C with {‘{Q}’:’OCCO’} -> CCOCCOC

C{A}C{Q}C with {‘{Q}’:’OCCO’, ‘{A}’:’C1(CC1)’} -> CC1(CC1)COCCOC

C{A}C{Q}C with {‘{Q}’:’{X}CC{X}’, ‘{A}’:’C1CC1’, ‘{X}’:’N’} -> CC1CC1CNCCNC

C++ signature :

RDKit::ROMol* MolFromSmiles(boost::python::api::object [,bool=True [,boost::python::dict={}]])

rdkit.Chem.rdmolfiles.MolFromTPLBlock((AtomPairsParameters)tplBlock[, (bool)sanitize=True[, (bool)skipFirstConf=False]]) Mol :

Construct a molecule from a TPL block.

ARGUMENTS:

  • tplBlock: string containing the TPL block

  • sanitize: (optional) toggles sanitization of the molecule. Defaults to True.

  • skipFirstConf: (optional) skips reading the first conformer. Defaults to False. This should be set to True when reading TPLs written by the CombiCode.

RETURNS:

a Mol object, None on failure.

C++ signature :

RDKit::ROMol* MolFromTPLBlock(boost::python::api::object [,bool=True [,bool=False]])

rdkit.Chem.rdmolfiles.MolFromTPLFile((str)fileName[, (bool)sanitize=True[, (bool)skipFirstConf=False]]) Mol :

Construct a molecule from a TPL file.

ARGUMENTS:

  • fileName: name of the file to read

  • sanitize: (optional) toggles sanitization of the molecule. Defaults to True.

  • skipFirstConf: (optional) skips reading the first conformer. Defaults to False. This should be set to True when reading TPLs written by the CombiCode.

RETURNS:

a Mol object, None on failure.

C++ signature :

RDKit::ROMol* MolFromTPLFile(char const* [,bool=True [,bool=False]])

rdkit.Chem.rdmolfiles.MolFromXYZBlock((AtomPairsParameters)xyzBlock) Mol :

Construct a molecule from an XYZ string.

ARGUMENTS:

  • xyzBlock: the XYZ data to read

RETURNS:

a Mol object, None on failure.

C++ signature :

RDKit::ROMol* MolFromXYZBlock(boost::python::api::object)

rdkit.Chem.rdmolfiles.MolFromXYZFile((str)xyzFileName) Mol :

Construct a molecule from an XYZ file.

ARGUMENTS:

  • xyzFileName: name of the file to read

RETURNS:

a Mol object, None on failure.

C++ signature :

RDKit::ROMol* MolFromXYZFile(char const*)

rdkit.Chem.rdmolfiles.MolMetadataToPNGFile((Mol)mol, (AtomPairsParameters)filename[, (bool)includePkl=True[, (bool)includeSmiles=True[, (bool)includeMol=False]]]) object :

Adds molecular metadata to PNG data read from a file.

ARGUMENTS:

  • mol: the molecule

  • filename: the PNG filename

  • includePkl: include the RDKit’s internal binary format in the output

  • includeSmiles: include CXSmiles in the output

  • includeMol: include CTAB (Mol) in the output

RETURNS:

the updated PNG data

C++ signature :

boost::python::api::object MolMetadataToPNGFile(RDKit::ROMol,boost::python::api::object [,bool=True [,bool=True [,bool=False]]])

rdkit.Chem.rdmolfiles.MolMetadataToPNGString((Mol)mol, (AtomPairsParameters)png[, (bool)includePkl=True[, (bool)includeSmiles=True[, (bool)includeMol=False]]]) object :

Adds molecular metadata to a PNG string.

ARGUMENTS:

  • mol: the molecule

  • png: the PNG string

  • includePkl: include the RDKit’s internal binary format in the output

  • includeSmiles: include CXSmiles in the output

  • includeMol: include CTAB (Mol) in the output

RETURNS:

the updated PNG data

C++ signature :

boost::python::api::object MolMetadataToPNGString(RDKit::ROMol,boost::python::api::object [,bool=True [,bool=True [,bool=False]]])

rdkit.Chem.rdmolfiles.MolToCMLBlock((Mol)mol[, (int)confId=-1[, (bool)kekulize=True]]) str :
Writes a CML block for a molecule

ARGUMENTS:

  • mol: the molecule

  • confId: (optional) selects which conformation to output

  • kekulize: (optional) triggers kekulization of the molecule before it’s written

C++ signature :

std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > MolToCMLBlock(RDKit::ROMol [,int=-1 [,bool=True]])

rdkit.Chem.rdmolfiles.MolToCMLFile((Mol)mol, (str)filename[, (int)confId=-1[, (bool)kekulize=True]]) None :
Writes a CML file for a molecule

ARGUMENTS:

  • mol: the molecule

  • filename: the file to write to

  • confId: (optional) selects which conformation to output

  • kekulize: (optional) triggers kekulization of the molecule before it’s written

C++ signature :

void MolToCMLFile(RDKit::ROMol,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > [,int=-1 [,bool=True]])

rdkit.Chem.rdmolfiles.MolToCXSmarts((Mol)mol[, (bool)isomericSmiles=True]) str :
Returns a SMARTS string for a molecule

ARGUMENTS:

  • mol: the molecule

  • isomericSmiles: (optional) include information about stereochemistry in the SMARTS. Defaults to true.

RETURNS:

a string

C++ signature :

std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > MolToCXSmarts(RDKit::ROMol [,bool=True])

rdkit.Chem.rdmolfiles.MolToCXSmiles((Mol)mol, (SmilesWriteParams)params[, (int)flags=rdkit.Chem.rdmolfiles.CXSmilesFields.CX_ALL[, (RestoreBondDirOption)restoreBondDirs=rdkit.Chem.rdmolfiles.RestoreBondDirOption.RestoreBondDirOptionClear]]) str :

Returns the CXSMILES string for a molecule

C++ signature :

std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > MolToCXSmiles(RDKit::ROMol,RDKit::SmilesWriteParams [,unsigned int=rdkit.Chem.rdmolfiles.CXSmilesFields.CX_ALL [,RDKit::RestoreBondDirOption=rdkit.Chem.rdmolfiles.RestoreBondDirOption.RestoreBondDirOptionClear]])

MolToCXSmiles( (Mol)mol [, (bool)isomericSmiles=True [, (bool)kekuleSmiles=False [, (int)rootedAtAtom=-1 [, (bool)canonical=True [, (bool)allBondsExplicit=False [, (bool)allHsExplicit=False [, (bool)doRandom=False]]]]]]]) -> str :
Returns the CXSMILES string for a molecule

ARGUMENTS:

  • mol: the molecule

  • isomericSmiles: (optional) include information about stereochemistry in the SMILES. Defaults to true.

  • kekuleSmiles: (optional) use the Kekule form (no aromatic bonds) in the SMILES. Defaults to false.

  • rootedAtAtom: (optional) if non-negative, this forces the SMILES to start at a particular atom. Defaults to -1.

  • canonical: (optional) if false no attempt will be made to canonicalize the molecule. Defaults to true.

  • allBondsExplicit: (optional) if true, all bond orders will be explicitly indicated in the output SMILES. Defaults to false.

  • allHsExplicit: (optional) if true, all H counts will be explicitly indicated in the output SMILES. Defaults to false.

  • doRandom: (optional) if true, randomized the trasversal of the molecule graph, so we can generate random smiles. Defaults to false.

RETURNS:

a string

C++ signature :

std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > MolToCXSmiles(RDKit::ROMol [,bool=True [,bool=False [,int=-1 [,bool=True [,bool=False [,bool=False [,bool=False]]]]]]])

rdkit.Chem.rdmolfiles.MolToFASTA((Mol)mol) str :
Returns the FASTA string for a molecule

ARGUMENTS:

  • mol: the molecule

NOTE: the molecule should contain monomer information in AtomMonomerInfo structures

RETURNS:

a string

C++ signature :

std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > MolToFASTA(RDKit::ROMol)

rdkit.Chem.rdmolfiles.MolToHELM((Mol)mol) str :
Returns the HELM string for a molecule

ARGUMENTS:

  • mol: the molecule

NOTE: the molecule should contain monomer information in AtomMonomerInfo structures

RETURNS:

a string

C++ signature :

std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > MolToHELM(RDKit::ROMol)

rdkit.Chem.rdmolfiles.MolToMolBlock((Mol)mol, (MolWriterParams)params[, (int)confId=-1]) str :
Returns a Mol block for a molecule
Arguments:
  • mol: the molecule

  • params: the MolWriterParams

  • confId: (optional) selects which conformation to output (-1 = default)

RETURNS:

a string

C++ signature :

std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > MolToMolBlock(RDKit::ROMol,RDKit::MolWriterParams [,int=-1])

MolToMolBlock( (Mol)mol [, (bool)includeStereo=True [, (int)confId=-1 [, (bool)kekulize=True [, (bool)forceV3000=False]]]]) -> str :
Returns a Mol block for a molecule

ARGUMENTS:

  • mol: the molecule

  • includeStereo: (optional) toggles inclusion of stereochemical information in the output

  • confId: (optional) selects which conformation to output (-1 = default)

  • kekulize: (optional) triggers kekulization of the molecule before it’s written, as suggested by the MDL spec.

  • forceV3000 (optional) force generation a V3000 mol block (happens automatically with more than 999 atoms or bonds)

RETURNS:

a string

C++ signature :

std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > MolToMolBlock(RDKit::ROMol [,bool=True [,int=-1 [,bool=True [,bool=False]]]])

rdkit.Chem.rdmolfiles.MolToMolFile((Mol)mol, (str)filename, (MolWriterParams)params[, (int)confId=-1]) None :
Writes a Mol file for a molecule

ARGUMENTS:

  • mol: the molecule

  • filename: the file to write to

  • params: the MolWriterParams

  • confId: (optional) selects which conformation to output (-1 = default)

C++ signature :

void MolToMolFile(RDKit::ROMol,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >,RDKit::MolWriterParams [,int=-1])

MolToMolFile( (Mol)mol, (str)filename [, (bool)includeStereo=True [, (int)confId=-1 [, (bool)kekulize=True [, (bool)forceV3000=False]]]]) -> None :
Writes a Mol file for a molecule

ARGUMENTS:

  • mol: the molecule

  • filename: the file to write to

  • includeStereo: (optional) toggles inclusion of stereochemical information in the output

  • confId: (optional) selects which conformation to output (-1 = default)

  • kekulize: (optional) triggers kekulization of the molecule before it’s written, as suggested by the MDL spec.

  • forceV3000 (optional) force generation a V3000 mol block (happens automatically with more than 999 atoms or bonds)

C++ signature :

void MolToMolFile(RDKit::ROMol,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > [,bool=True [,int=-1 [,bool=True [,bool=False]]]])

rdkit.Chem.rdmolfiles.MolToMrvBlock((Mol)mol[, (bool)includeStereo=True[, (int)confId=-1[, (bool)kekulize=True[, (bool)prettyPrint=False]]]]) str :
Returns a Marvin (Mrv) Mol block for a molecule

ARGUMENTS:

  • mol: the molecule

  • includeStereo: (optional) toggles inclusion of stereochemical information in the output

  • confId: (optional) selects which conformation to output (-1 = default)

  • kekulize: (optional) triggers kekulization of the molecule before it’s written.

  • prettyPrint: (optional) makes the output more human readable.

RETURNS:

a string

C++ signature :

std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > MolToMrvBlock(RDKit::ROMol [,bool=True [,int=-1 [,bool=True [,bool=False]]]])

MolToMrvBlock( (Mol)mol, (object)params [, (int)confId=-1]) -> str :
Returns a Marvin (Mrv) Mol block for a molecule

ARGUMENTS:

  • mol: the molecule

  • params: marvin write params

  • confId: (optional) selects which conformation to output (-1 = default)

RETURNS:

a string

C++ signature :

std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > MolToMrvBlock(RDKit::ROMol,RDKit::MrvWriterParams [,int=-1])

rdkit.Chem.rdmolfiles.MolToMrvFile((Mol)mol, (str)filename[, (bool)includeStereo=True[, (int)confId=-1[, (bool)kekulize=True[, (bool)prettyPrint=False]]]]) None :
Writes a Marvin (MRV) file for a molecule

ARGUMENTS:

  • mol: the molecule

  • filename: the file to write to

  • includeStereo: (optional) toggles inclusion of stereochemical information in the output

  • confId: (optional) selects which conformation to output (-1 = default)

  • kekulize: (optional) triggers kekulization of the molecule before it’s written.

  • prettyPrint: (optional) makes the output more human readable.

C++ signature :

void MolToMrvFile(RDKit::ROMol,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > [,bool=True [,int=-1 [,bool=True [,bool=False]]]])

MolToMrvFile( (Mol)mol, (str)filename, (object)params [, (int)confId=-1]) -> None :
Writes a Marvin (MRV) file for a molecule

ARGUMENTS:

  • mol: the molecule

  • filename: the file to write to

  • params: marvin write params

  • confId: (optional) selects which conformation to output (-1 = default)

C++ signature :

void MolToMrvFile(RDKit::ROMol,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >,RDKit::MrvWriterParams [,int=-1])

rdkit.Chem.rdmolfiles.MolToPDBBlock((Mol)mol[, (int)confId=-1[, (int)flavor=0]]) str :
Returns a PDB block for a molecule

ARGUMENTS:

  • mol: the molecule

  • confId: (optional) selects which conformation to output (-1 = default)

  • flavor: (optional)
    • flavor & 1 : Write MODEL/ENDMDL lines around each record

    • flavor & 2 : Don’t write any CONECT records

    • flavor & 4 : Write CONECT records in both directions

    • flavor & 8 : Don’t use multiple CONECTs to encode bond order

    • flavor & 16 : Write MASTER record

    • flavor & 32 : Write TER record

RETURNS:

a string

C++ signature :

std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > MolToPDBBlock(RDKit::ROMol [,int=-1 [,unsigned int=0]])

rdkit.Chem.rdmolfiles.MolToPDBFile((Mol)mol, (str)filename[, (int)confId=-1[, (int)flavor=0]]) None :
Writes a PDB file for a molecule

ARGUMENTS:

  • mol: the molecule

  • filename: name of the file to write

  • confId: (optional) selects which conformation to output (-1 = default)

  • flavor: (optional)
    • flavor & 1 : Write MODEL/ENDMDL lines around each record

    • flavor & 2 : Don’t write any CONECT records

    • flavor & 4 : Write CONECT records in both directions

    • flavor & 8 : Don’t use multiple CONECTs to encode bond order

    • flavor & 16 : Write MASTER record

    • flavor & 32 : Write TER record

C++ signature :

void MolToPDBFile(RDKit::ROMol,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > [,int=-1 [,unsigned int=0]])

rdkit.Chem.rdmolfiles.MolToRandomSmilesVect((Mol)mol, (int)numSmiles[, (int)randomSeed=0[, (bool)isomericSmiles=True[, (bool)kekuleSmiles=False[, (bool)allBondsExplicit=False[, (bool)allHsExplicit=False]]]]]) list :

returns a list of SMILES generated using the randomSmiles algorithm

C++ signature :

boost::python::list MolToRandomSmilesVect(RDKit::ROMol,unsigned int [,unsigned int=0 [,bool=True [,bool=False [,bool=False [,bool=False]]]]])

rdkit.Chem.rdmolfiles.MolToSequence((Mol)mol) str :
Returns the sequence string for a molecule

ARGUMENTS:

  • mol: the molecule

NOTE: the molecule should contain monomer information in AtomMonomerInfo structures

RETURNS:

a string

C++ signature :

std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > MolToSequence(RDKit::ROMol)

rdkit.Chem.rdmolfiles.MolToSmarts((Mol)mol[, (bool)isomericSmiles=True[, (int)rootedAtAtom=-1]]) str :
Returns a SMARTS string for a molecule

ARGUMENTS:

  • mol: the molecule

  • isomericSmiles: (optional) include information about stereochemistry in the SMARTS. Defaults to true.

  • rootedAtomAtom: (optional) the atom index to start the SMARTS from.

RETURNS:

a string

C++ signature :

std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > MolToSmarts(RDKit::ROMol [,bool=True [,int=-1]])

MolToSmarts( (Mol)mol, (SmilesWriteParams)params) -> str :
Returns a SMARTS string for a molecule

ARGUMENTS:

  • mol: the molecule

  • params: SmilesWriteParams controlling the SMARTS generation

RETURNS:

a string

C++ signature :

std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > MolToSmarts(RDKit::ROMol,RDKit::SmilesWriteParams)

rdkit.Chem.rdmolfiles.MolToSmiles((Mol)mol, (SmilesWriteParams)params) str :

Returns the canonical SMILES string for a molecule

C++ signature :

std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > MolToSmiles(RDKit::ROMol,RDKit::SmilesWriteParams)

MolToSmiles( (Mol)mol [, (bool)isomericSmiles=True [, (bool)kekuleSmiles=False [, (int)rootedAtAtom=-1 [, (bool)canonical=True [, (bool)allBondsExplicit=False [, (bool)allHsExplicit=False [, (bool)doRandom=False [, (bool)ignoreAtomMapNumbers=False]]]]]]]]) -> str :
Returns the canonical SMILES string for a molecule

ARGUMENTS:

  • mol: the molecule

  • isomericSmiles: (optional) include information about stereochemistry in the SMILES. Defaults to true.

  • kekuleSmiles: (optional) use the Kekule form (no aromatic bonds) in the SMILES. Defaults to false.

  • rootedAtAtom: (optional) if non-negative, this forces the SMILES to start at a particular atom. Defaults to -1.

  • canonical: (optional) if false no attempt will be made to canonicalize the molecule. Defaults to true.

  • allBondsExplicit: (optional) if true, all bond orders will be explicitly indicated in the output SMILES. Defaults to false.

  • allHsExplicit: (optional) if true, all H counts will be explicitly indicated in the output SMILES. Defaults to false.

  • doRandom: (optional) if true, randomize the traversal of the molecule graph, so we can generate random smiles. Defaults to false.

  • ignoreAtomMapNumbers (optional) if true, ignores any atom map numbers when canonicalizing the molecule

RETURNS:

a string

C++ signature :

std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > MolToSmiles(RDKit::ROMol [,bool=True [,bool=False [,int=-1 [,bool=True [,bool=False [,bool=False [,bool=False [,bool=False]]]]]]]])

rdkit.Chem.rdmolfiles.MolToTPLBlock((Mol)mol[, (str)partialChargeProp='_GasteigerCharge'[, (bool)writeFirstConfTwice=False]]) str :

Returns the Tpl block for a molecule.

ARGUMENTS:

  • mol: the molecule

  • partialChargeProp: name of the property to use for partial charges Defaults to ‘_GasteigerCharge’.

  • writeFirstConfTwice: Defaults to False. This should be set to True when writing TPLs to be read by the CombiCode.

RETURNS:

a string

C++ signature :

std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > MolToTPLBlock(RDKit::ROMol [,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >=’_GasteigerCharge’ [,bool=False]])

rdkit.Chem.rdmolfiles.MolToTPLFile((Mol)mol, (str)fileName[, (str)partialChargeProp='_GasteigerCharge'[, (bool)writeFirstConfTwice=False]]) None :

Writes a molecule to a TPL file.

ARGUMENTS:

  • mol: the molecule

  • fileName: name of the file to write

  • partialChargeProp: name of the property to use for partial charges Defaults to ‘_GasteigerCharge’.

  • writeFirstConfTwice: Defaults to False. This should be set to True when writing TPLs to be read by the CombiCode.

C++ signature :

void MolToTPLFile(RDKit::ROMol,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > [,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >=’_GasteigerCharge’ [,bool=False]])

rdkit.Chem.rdmolfiles.MolToV2KMolBlock((Mol)mol[, (AtomPairsParameters)params=None[, (int)confId=-1]]) str :
Returns a V2000 Mol block for a molecule

ARGUMENTS:

  • mol: the molecule

  • params: the MolWriterParams

  • confId: (optional) selects which conformation to output (-1 = default)

RETURNS:

a string

NOTE: this function throws a ValueError if the molecule has more than 999 atoms, bonds, or SGroups

C++ signature :

std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > MolToV2KMolBlock(RDKit::ROMol [,boost::python::api::object=None [,int=-1]])

rdkit.Chem.rdmolfiles.MolToV3KMolBlock((Mol)mol, (MolWriterParams)params[, (int)confId=-1]) str :
Returns a V3000 Mol block for a molecule

ARGUMENTS:

  • mol: the molecule

  • params: the MolWriterParams

  • confId: (optional) selects which conformation to output (-1 = default)

RETURNS:

a string

C++ signature :

std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > MolToV3KMolBlock(RDKit::ROMol,RDKit::MolWriterParams [,int=-1])

MolToV3KMolBlock( (Mol)mol [, (bool)includeStereo=True [, (int)confId=-1 [, (bool)kekulize=True]]]) -> str :
Returns a V3000 Mol block for a molecule

ARGUMENTS:

  • mol: the molecule

  • includeStereo: (optional) toggles inclusion of stereochemical information in the output

  • confId: (optional) selects which conformation to output (-1 = default)

  • kekulize: (optional) triggers kekulization of the molecule before it’s written, as suggested by the MDL spec.

RETURNS:

a string

C++ signature :

std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > MolToV3KMolBlock(RDKit::ROMol [,bool=True [,int=-1 [,bool=True]]])

rdkit.Chem.rdmolfiles.MolToV3KMolFile((Mol)mol, (str)filename[, (MolWriterParams)params=True[, (int)confId=-1]]) None :
Writes a V3000 Mol file for a molecule

ARGUMENTS:

  • mol: the molecule

  • filename: the file to write to

  • params: the MolWriterParams

  • confId: (optional) selects which conformation to output (-1 = default)

C++ signature :

void MolToV3KMolFile(RDKit::ROMol,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > [,RDKit::MolWriterParams=True [,int=-1]])

MolToV3KMolFile( (Mol)mol, (str)filename [, (bool)includeStereo=True [, (int)confId=-1 [, (bool)kekulize=True]]]) -> None :
Writes a V3000 Mol file for a molecule

ARGUMENTS:

  • mol: the molecule

  • filename: the file to write to

  • includeStereo: (optional) toggles inclusion of stereochemical information in the output

  • confId: (optional) selects which conformation to output (-1 = default)

  • kekulize: (optional) triggers kekulization of the molecule before it’s written, as suggested by the MDL spec.

C++ signature :

void MolToV3KMolFile(RDKit::ROMol,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > [,bool=True [,int=-1 [,bool=True]]])

rdkit.Chem.rdmolfiles.MolToXYZBlock((Mol)mol[, (int)confId=-1[, (int)precision=6]]) str :
Returns a XYZ block for a molecule

ARGUMENTS:

  • mol: the molecule

  • confId: (optional) selects which conformation to output (-1 = default)

  • precision: precision of the coordinates

RETURNS:

a string

C++ signature :

std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > MolToXYZBlock(RDKit::ROMol [,int=-1 [,unsigned int=6]])

rdkit.Chem.rdmolfiles.MolToXYZFile((Mol)mol, (str)filename[, (int)confId=-1[, (int)precision=6]]) None :
Writes a XYZ file for a molecule

ARGUMENTS:

  • mol: the molecule

  • filename: the file to write to

  • confId: (optional) selects which conformation to output (-1 = default)

  • precision: precision of the coordinates

C++ signature :

void MolToXYZFile(RDKit::ROMol,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > [,int=-1 [,unsigned int=6]])

class rdkit.Chem.rdmolfiles.MolWriterParams((object)arg1)

Bases: instance

Parameters controlling Mol writing

C++ signature :

void __init__(_object*)

property forceV3000

force generation a V3000 mol block (happens automatically with more than 999 atoms or bonds)(default=False)

property includeStereo

toggles inclusion of stereochemistry information (default=True)

property kekulize

triggers kekulization of the molecule before it is written (default=True)

property precision

precision of coordinates (only available in V3000)(default=false)

rdkit.Chem.rdmolfiles.MolsFromCDXML((AtomPairsParameters)cdxml[, (bool)sanitize=True[, (bool)removeHs=True]]) tuple :

Construct a molecule from a cdxml string.

Note that the CDXML format is large and complex, the RDKit doesn’t support full functionality, just the base ones required for molecule and reaction parsing.

ARGUMENTS:

  • cdxml: the cdxml string

  • sanitize: if True, sanitize the molecules [default True]

  • removeHs: if True, convert explicit Hs into implicit Hs. [default True]

RETURNS:

an iterator of parsed Mol objects.

C++ signature :

boost::python::tuple MolsFromCDXML(boost::python::api::object [,bool=True [,bool=True]])

rdkit.Chem.rdmolfiles.MolsFromCDXMLFile((str)filename[, (bool)sanitize=True[, (bool)removeHs=True]]) object :

Construct a molecule from a cdxml file.

Note that the CDXML format is large and complex, the RDKit doesn’t support full functionality, just the base ones required for molecule and reaction parsing.

ARGUMENTS:

  • filename: the cdxml filename

  • sanitize: if True, sanitize the molecules [default True]

  • removeHs: if True, convert explicit Hs into implicit Hs. [default True]

RETURNS:

an iterator of parsed Mol objects.

C++ signature :

boost::python::api::object MolsFromCDXMLFile(char const* [,bool=True [,bool=True]])

rdkit.Chem.rdmolfiles.MolsFromPNGFile((str)filename[, (str)tag='rdkitPKL'[, (AtomPairsParameters)params=None]]) object :

returns a tuple of molecules constructed from the PNG file

C++ signature :

boost::python::api::object MolsFromPNGFile(char const* [,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >=’rdkitPKL’ [,boost::python::api::object=None]])

rdkit.Chem.rdmolfiles.MolsFromPNGString((AtomPairsParameters)png[, (str)tag='rdkitPKL'[, (AtomPairsParameters)params=None]]) tuple :

returns a tuple of molecules constructed from the PNG string

C++ signature :

boost::python::tuple MolsFromPNGString(boost::python::api::object [,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >=’rdkitPKL’ [,boost::python::api::object=None]])

class rdkit.Chem.rdmolfiles.MultithreadedSDMolSupplier((object)self)

Bases: instance

A class which concurrently supplies molecules from a text file. Please note that this class is still a bit experimental and the API may change in future releases.

Usage examples:

  1. Lazy evaluation: the molecules might not be constructed until we ask for them:

    >>> suppl = MultithreadedSDMolSupplier('in.sdf')
    >>> for mol in suppl:
    ...    if(mol):
    ...      mol.GetNumAtoms()
    
  2. Lazy evaluation 2:

    >>> suppl = MultithreadedSDMolSupplier('in.sdf')
    >>> while (!suppl.atEnd()):
    ...    mol = next(mol)
    ...    if(mol):
    ...      mol.GetNumAtoms()
    
C++ signature :

void __init__(_object*)

__init__( (object)self, (str)fileName [, (bool)sanitize=True [, (bool)removeHs=True [, (bool)strictParsing=True [, (int)numWriterThreads=1 [, (int)sizeInputQueue=5 [, (int)sizeOutputQueue=5]]]]]]) -> None :

Constructor

ARGUMENTS:

  • fileName: name of the file to be read

  • sanitize: (optional) toggles sanitization of molecules as they are read. Defaults to true.

  • removeHs: (optional) removes Hs. Defaults to true.

  • strictParsing: (optional) allows strict or lax parsing. Defaults to true.

  • numWriterThreads: (optional) number of writer threads. Defaults to 1.

  • sizeInputQueue: (optional) size of input/reader queue. Defaults to 5.

  • sizeOutputQueue: (optional) size of output/writer queue. Defaults to 5.

C++ signature :

void __init__(_object*,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > [,bool=True [,bool=True [,bool=True [,unsigned int=1 [,unsigned long=5 [,unsigned long=5]]]]]])

GetLastItemText((MultithreadedSDMolSupplier)self) str :

Returns the text for the last extracted item.

C++ signature :

std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > GetLastItemText(RDKit::v1::MultithreadedSDMolSupplier*)

GetLastRecordId((MultithreadedSDMolSupplier)self) int :

Returns the record id for the last extracted item.

C++ signature :

unsigned int GetLastRecordId(RDKit::v1::MultithreadedSDMolSupplier*)

GetProcessPropertyLists((MultithreadedSDMolSupplier)self) bool :

returns whether or not any property lists that are present will be processed when reading molecules

C++ signature :

bool GetProcessPropertyLists(RDKit::v1::MultithreadedSDMolSupplier {lvalue})

SetProcessPropertyLists((MultithreadedSDMolSupplier)self, (bool)val) None :

sets whether or not any property lists that are present will be processed when reading molecules

C++ signature :

void SetProcessPropertyLists(RDKit::v1::MultithreadedSDMolSupplier {lvalue},bool)

atEnd((MultithreadedSDMolSupplier)self) bool :

Returns true if we have read all records else false.

C++ signature :

bool atEnd(RDKit::v1::MultithreadedSDMolSupplier {lvalue})

class rdkit.Chem.rdmolfiles.MultithreadedSmilesMolSupplier((object)self)

Bases: instance

A class which concurrently supplies molecules from a text file. Please note that this class is still a bit experimental and the API may change in future releases.

Usage examples:

  1. Lazy evaluation: the molecules might not be constructed until we ask for them:

    >>> suppl = MultithreadedSmilesMolSupplier('in.smi')
    >>> for mol in suppl:
    ...    if(mol):
    ...      mol.GetNumAtoms()
    
  2. Lazy evaluation 2:

    >>> suppl = MultithreadedSmilesMolSupplier('in.smi')
    >>> while (!suppl.atEnd()):
    ...    mol = next(mol)
    ...    if(mol):
    ...      mol.GetNumAtoms()
    
C++ signature :

void __init__(_object*)

__init__( (object)self, (str)fileName [, (str)delimiter=’ t’ [, (int)smilesColumn=0 [, (int)nameColumn=1 [, (bool)titleLine=True [, (bool)sanitize=True [, (int)numWriterThreads=1 [, (int)sizeInputQueue=5 [, (int)sizeOutputQueue=5]]]]]]]]) -> None :

Constructor

ARGUMENTS:

  • fileName: name of the file to be read

  • delimiter: (optional) text delimiter (a string). Defauts to ‘ ‘.

  • smilesColumn: (optional) index of the column containing the SMILES data. Defaults to 0.

  • nameColumn: (optional) index of the column containing molecule names. Defaults to 1.

  • titleLine: (optional) set this toggle if the file contains a title line. Defaults to true.

  • sanitize: (optional) toggles sanitization of molecules as they are read. Defaults to true.

  • numWriterThreads: (optional) number of writer threads. Defaults to 1.

  • sizeInputQueue: (optional) size of input/reader queue. Defaults to 5.

  • sizeOutputQueue: (optional) size of output/writer queue. Defaults to 5.

C++ signature :

void __init__(_object*,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > [,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >=’ t’ [,int=0 [,int=1 [,bool=True [,bool=True [,unsigned int=1 [,unsigned long=5 [,unsigned long=5]]]]]]]])

GetLastItemText((MultithreadedSmilesMolSupplier)self) str :

Returns the text for the last extracted item.

C++ signature :

std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > GetLastItemText(RDKit::v1::MultithreadedSmilesMolSupplier*)

GetLastRecordId((MultithreadedSmilesMolSupplier)self) int :

Returns the record id for the last extracted item.

C++ signature :

unsigned int GetLastRecordId(RDKit::v1::MultithreadedSmilesMolSupplier*)

atEnd((MultithreadedSmilesMolSupplier)self) bool :

Returns true if we have read all records else false.

C++ signature :

bool atEnd(RDKit::v1::MultithreadedSmilesMolSupplier {lvalue})

class rdkit.Chem.rdmolfiles.PDBWriter((AtomPairsParameters)arg1, (AtomPairsParameters)fileObj[, (int)flavor=0])

Bases: instance

A class for writing molecules to PDB files.

C++ signature :

void* __init__(boost::python::api::object,boost::python::api::object {lvalue} [,unsigned int=0])

__init__( (object)self, (str)fileName [, (int)flavor=0]) -> None :

Constructor.

ARGUMENTS:

  • fileName: name of the output file. (‘-’ to write to stdout)

  • flavor: (optional)

C++ signature :

void __init__(_object*,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > [,unsigned int=0])

NumMols((PDBWriter)self) int :

Returns the number of molecules written so far.

C++ signature :

unsigned int NumMols(RDKit::PDBWriter {lvalue})

close((PDBWriter)self) None :

Flushes the output file and closes it. The Writer cannot be used after this.

C++ signature :

void close(RDKit::PDBWriter {lvalue})

flush((PDBWriter)self) None :

Flushes the output file (forces the disk file to be updated).

C++ signature :

void flush(RDKit::PDBWriter {lvalue})

write((PDBWriter)self, (Mol)mol[, (int)confId=-1]) None :

Writes a molecule to the output file.

ARGUMENTS:

  • mol: the Mol to be written

  • confId: (optional) ignored

C++ signature :

void write(RDKit::PDBWriter {lvalue},RDKit::ROMol [,int=-1])

class rdkit.Chem.rdmolfiles.RestoreBondDirOption

Bases: enum

RestoreBondDirOptionClear = rdkit.Chem.rdmolfiles.RestoreBondDirOption.RestoreBondDirOptionClear
RestoreBondDirOptionTrue = rdkit.Chem.rdmolfiles.RestoreBondDirOption.RestoreBondDirOptionTrue
names = {'RestoreBondDirOptionClear': rdkit.Chem.rdmolfiles.RestoreBondDirOption.RestoreBondDirOptionClear, 'RestoreBondDirOptionTrue': rdkit.Chem.rdmolfiles.RestoreBondDirOption.RestoreBondDirOptionTrue}
values = {0: rdkit.Chem.rdmolfiles.RestoreBondDirOption.RestoreBondDirOptionTrue, 1: rdkit.Chem.rdmolfiles.RestoreBondDirOption.RestoreBondDirOptionClear}
class rdkit.Chem.rdmolfiles.SDMolSupplier((object)self)

Bases: instance

A class which supplies molecules from an SD file.

Usage examples:

  1. Lazy evaluation: the molecules are not constructed until we ask for them:

    >>> suppl = SDMolSupplier('in.sdf')
    >>> for mol in suppl:
    ...    mol.GetNumAtoms()
    
  2. Lazy evaluation 2:

    >>> suppl = SDMolSupplier('in.sdf')
    >>> mol1 = next(suppl)
    >>> mol2 = next(suppl)
    >>> suppl.reset()
    >>> mol3 = next(suppl)
    # mol3 and mol1 are the same:
    >>> MolToSmiles(mol3)==MolToSmiles(mol1)
    
  3. Random Access:

    >>> suppl = SDMolSupplier('in.sdf')
    >>> mol1 = suppl[0] 
    >>> mol2 = suppl[1] 
    # NOTE: this will generate an IndexError if the supplier doesn't have that many
    molecules.
    
  4. Random Access 2: looping over all molecules

    >>> suppl = SDMolSupplier('in.sdf')
    >>> nMols = len(suppl)
    >>> for i in range(nMols):
    ...   suppl[i].GetNumAtoms()
    

Properties in the SD file are used to set properties on each molecule. The properties are accessible using the mol.GetProp(propName) method.

C++ signature :

void __init__(_object*)

__init__( (object)self, (str)fileName [, (bool)sanitize=True [, (bool)removeHs=True [, (bool)strictParsing=True]]]) -> None :

C++ signature :

void __init__(_object*,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > [,bool=True [,bool=True [,bool=True]]])

GetItemText((SDMolSupplier)self, (int)index) str :

returns the text for an item

C++ signature :

std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > GetItemText(RDKit::v1::SDMolSupplier {lvalue},unsigned int)

GetProcessPropertyLists((SDMolSupplier)self) bool :

returns whether or not any property lists that are present will be processed when reading molecules

C++ signature :

bool GetProcessPropertyLists(RDKit::v1::SDMolSupplier {lvalue})

SetData((SDMolSupplier)self, (str)data[, (bool)sanitize=True[, (bool)removeHs=True[, (bool)strictParsing=True]]]) None :

Sets the text to be parsed

C++ signature :

void SetData(RDKit::v1::SDMolSupplier {lvalue},std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > [,bool=True [,bool=True [,bool=True]]])

SetProcessPropertyLists((SDMolSupplier)self, (bool)val) None :

sets whether or not any property lists that are present will be processed when reading molecules

C++ signature :

void SetProcessPropertyLists(RDKit::v1::SDMolSupplier {lvalue},bool)

atEnd((SDMolSupplier)self) bool :

Returns whether or not we have hit EOF.

C++ signature :

bool atEnd(RDKit::v1::SDMolSupplier {lvalue})

reset((SDMolSupplier)self) None :

Resets our position in the file to the beginning.

C++ signature :

void reset(RDKit::v1::SDMolSupplier {lvalue})

class rdkit.Chem.rdmolfiles.SDWriter((AtomPairsParameters)arg1, (AtomPairsParameters)arg2)

Bases: instance

A class for writing molecules to SD files.

Usage examples:

  1. writing to a named file:

    >>> writer = SDWriter('out.sdf')
    >>> for mol in list_of_mols:
    ...    writer.write(mol)
    
  2. writing to a file-like object:

    >>> import gzip
    >>> outf=gzip.open('out.sdf.gz','wt+')
    >>> writer = SDWriter(outf)
    >>> for mol in list_of_mols:
    ...   writer.write(mol)
    >>> writer.close()
    >>> outf.close()
    

By default all non-private molecular properties are written to the SD file. This can be changed using the SetProps method:

>>> writer = SDWriter('out.sdf')
>>> writer.SetProps(['prop1','prop2'])
C++ signature :

void* __init__(boost::python::api::object,boost::python::api::object {lvalue})

__init__( (object)self, (str)fileName) -> None :

Constructor.

If a string argument is provided, it will be treated as the name of the output file. If a file-like object is provided, output will be sent there.

C++ signature :

void __init__(_object*,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)

GetForceV3000((SDWriter)self) bool :

Returns whether or not V3000 mol file writing is being forced.

C++ signature :

bool GetForceV3000(RDKit::SDWriter {lvalue})

GetKekulize((SDWriter)self) bool :

Returns whether or not molecules are kekulized on writing.

C++ signature :

bool GetKekulize(RDKit::SDWriter {lvalue})

static GetText((Mol)mol[, (int)confId=-1[, (bool)kekulize=True[, (bool)force_v3000=False[, (int)molid=-1]]]]) str :

returns the SD text for a molecule

C++ signature :

std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > GetText(RDKit::ROMol [,int=-1 [,bool=True [,bool=False [,int=-1]]]])

NumMols((SDWriter)self) int :

Returns the number of molecules written so far.

C++ signature :

unsigned int NumMols(RDKit::SDWriter {lvalue})

SetForceV3000((SDWriter)self, (bool)val) None :

Sets whether or not V3000 mol file writing is being forced.

C++ signature :

void SetForceV3000(RDKit::SDWriter {lvalue},bool)

SetKekulize((SDWriter)self, (bool)val) None :

Sets whether or not molecules are kekulized on writing.

C++ signature :

void SetKekulize(RDKit::SDWriter {lvalue},bool)

SetProps((SDWriter)self, (AtomPairsParameters)props) None :

Sets the properties to be written to the output file

ARGUMENTS:

  • props: a list or tuple of property names

C++ signature :

void SetProps(RDKit::SDWriter {lvalue},boost::python::api::object)

close((SDWriter)self) None :

Flushes the output file and closes it. The Writer cannot be used after this.

C++ signature :

void close(RDKit::SDWriter {lvalue})

flush((SDWriter)self) None :

Flushes the output file (forces the disk file to be updated).

C++ signature :

void flush(RDKit::SDWriter {lvalue})

write((SDWriter)self, (Mol)mol[, (int)confId=-1]) None :

Writes a molecule to the output file.

ARGUMENTS:

  • mol: the Mol to be written

  • confId: (optional) ID of the conformation to write

C++ signature :

void write(RDKit::SDWriter {lvalue},RDKit::ROMol {lvalue} [,int=-1])

class rdkit.Chem.rdmolfiles.SmartsParserParams((object)arg1)

Bases: instance

Parameters controlling SMARTS Parsing

C++ signature :

void __init__(_object*)

property allowCXSMILES

controls whether or not the CXSMILES extensions are parsed

property debugParse

controls the amount of debugging information produced

property mergeHs

toggles merging H atoms in the SMARTS into neighboring atoms

property parseName

controls whether or not the molecule name is also parsed

property strictCXSMILES

controls whether or not problems in CXSMILES parsing causes molecule parsing to fail

class rdkit.Chem.rdmolfiles.SmilesMolSupplier((object)self, (str)data[, (str)delimiter=' '[, (int)smilesColumn=0[, (int)nameColumn=1[, (bool)titleLine=True[, (bool)sanitize=True]]]]])

Bases: instance

A class which supplies molecules from a text file.

Usage examples:

  1. Lazy evaluation: the molecules are not constructed until we ask for them:

    >>> suppl = SmilesMolSupplier('in.smi')
    >>> for mol in suppl:
    ...    mol.GetNumAtoms()
    
  2. Lazy evaluation 2:

    >>> suppl = SmilesMolSupplier('in.smi')
    >>> mol1 = next(suppl)
    >>> mol2 = next(suppl)
    >>> suppl.reset()
    >>> mol3 = next(suppl)
    # mol3 and mol1 are the same:
    >>> MolToSmiles(mol3)==MolToSmiles(mol1)
    
  3. Random Access: all molecules are constructed as soon as we ask for the length:

    >>> suppl = SmilesMolSupplier('in.smi')
    >>> nMols = len(suppl)
    >>> for i in range(nMols):
    ...   suppl[i].GetNumAtoms()
    

If the input file has a title line and more than two columns (smiles and id), the additional columns will be used to set properties on each molecule. The properties are accessible using the mol.GetProp(propName) method.

Constructor

ARGUMENTS:

  • fileName: name of the file to be read

  • delimiter: (optional) text delimiter (a string). Defauts to ‘ ‘.

  • smilesColumn: (optional) index of the column containing the SMILES data. Defaults to 0.

  • nameColumn: (optional) index of the column containing molecule names. Defaults to 1.

  • titleLine: (optional) set this toggle if the file contains a title line. Defaults to 1.

  • sanitize: (optional) toggles sanitization of molecules as they are read. Defaults to 1.

C++ signature :

void __init__(_object*,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > [,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >=’ ‘ [,int=0 [,int=1 [,bool=True [,bool=True]]]]])

__init__( (object)self) -> None :

C++ signature :

void __init__(_object*)

GetItemText((SmilesMolSupplier)self, (int)index) str :

returns the text for an item

C++ signature :

std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > GetItemText(RDKit::v1::SmilesMolSupplier {lvalue},unsigned int)

SetData((SmilesMolSupplier)self, (str)data[, (str)delimiter=' '[, (int)smilesColumn=0[, (int)nameColumn=1[, (bool)titleLine=True[, (bool)sanitize=True]]]]]) None :

Sets the text to be parsed

C++ signature :

void SetData(RDKit::v1::SmilesMolSupplier {lvalue},std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > [,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >=’ ‘ [,int=0 [,int=1 [,bool=True [,bool=True]]]]])

reset((SmilesMolSupplier)self) None :

Resets our position in the file to the beginning.

C++ signature :

void reset(RDKit::v1::SmilesMolSupplier {lvalue})

rdkit.Chem.rdmolfiles.SmilesMolSupplierFromText((str)text[, (str)delimiter=' '[, (int)smilesColumn=0[, (int)nameColumn=1[, (bool)titleLine=True[, (bool)sanitize=True]]]]]) SmilesMolSupplier :
C++ signature :

RDKit::v1::SmilesMolSupplier* SmilesMolSupplierFromText(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > [,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >=’ ‘ [,int=0 [,int=1 [,bool=True [,bool=True]]]]])

class rdkit.Chem.rdmolfiles.SmilesParserParams((object)arg1)

Bases: instance

Parameters controlling SMILES Parsing

C++ signature :

void __init__(_object*)

property allowCXSMILES

controls whether or not the CXSMILES extensions are parsed

property debugParse

controls the amount of debugging information produced

property parseName

controls whether or not the molecule name is also parsed

property removeHs

controls whether or not Hs are removed before the molecule is returned

property sanitize

controls whether or not the molecule is sanitized before being returned

property strictCXSMILES

controls whether or not problems in CXSMILES parsing causes molecule parsing to fail

class rdkit.Chem.rdmolfiles.SmilesWriteParams((object)arg1)

Bases: instance

Parameters controlling SMILES writing

C++ signature :

void __init__(_object*)

property allBondsExplicit

include symbols for all bonds

property allHsExplicit

provide hydrogen counts for every atom

property canonical

generate canonical SMILES

property doIsomericSmiles

include stereochemistry and isotope information

property doKekule

kekulize the molecule before generating the SMILES and output single/double bonds. NOTE that the output is not canonical and that this will thrown an exception if the molecule cannot be kekulized

property doRandom

randomize the output order. The resulting SMILES is not canonical

property ignoreAtomMapNumbers

ignore atom map numbers when canonicalizing the molecule

property includeDativeBonds

include the RDKit extension for dative bonds. Otherwise dative bonds will be written as single bonds

property rootedAtAtom

make sure the SMILES starts at the specified atom. The resulting SMILES is not canonical

class rdkit.Chem.rdmolfiles.SmilesWriter((AtomPairsParameters)arg1, (AtomPairsParameters)fileObj[, (str)delimiter=' '[, (str)nameHeader='Name'[, (bool)includeHeader=True[, (bool)isomericSmiles=True[, (bool)kekuleSmiles=False]]]]])

Bases: instance

A class for writing molecules to text files.

C++ signature :

void* __init__(boost::python::api::object,boost::python::api::object {lvalue} [,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >=’ ‘ [,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >=’Name’ [,bool=True [,bool=True [,bool=False]]]]])

__init__( (object)self, (str)fileName [, (str)delimiter=’ ‘ [, (str)nameHeader=’Name’ [, (bool)includeHeader=True [, (bool)isomericSmiles=True [, (bool)kekuleSmiles=False]]]]]) -> None :

Constructor.

ARGUMENTS:

  • fileName: name of the output file. (‘-’ to write to stdout)

  • delimiter: (optional) delimiter to be used to separate entries on each line.

  • nameHeader: (optional) text to use for the name column in the header line.

    If this is blank, names will not be included in the output.

  • includeHeader: (optional) toggles inclusion of a header line in the output file.

  • isomericSmiles: (optional) toggles output of isomeric smiles (includes stereochem information).

  • kekuleSmiles: (optional) toggles output of kekule smiles (no aromatic bonds for molecules that have been kekulized).

C++ signature :

void __init__(_object*,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > [,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >=’ ‘ [,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >=’Name’ [,bool=True [,bool=True [,bool=False]]]]])

NumMols((SmilesWriter)self) int :

Returns the number of molecules written so far.

C++ signature :

unsigned int NumMols(RDKit::SmilesWriter {lvalue})

SetProps((SmilesWriter)self, (AtomPairsParameters)props) None :

Sets the properties to be written to the output file

ARGUMENTS:

  • props: a list or tuple of property names

C++ signature :

void SetProps(RDKit::SmilesWriter {lvalue},boost::python::api::object)

close((SmilesWriter)self) None :

Flushes the output file and closes it. The Writer cannot be used after this.

C++ signature :

void close(RDKit::SmilesWriter {lvalue})

flush((SmilesWriter)self) None :

Flushes the output file (forces the disk file to be updated).

C++ signature :

void flush(RDKit::SmilesWriter {lvalue})

write((SmilesWriter)self, (Mol)mol[, (int)confId=-1]) None :

Writes a molecule to the output file.

ARGUMENTS:

  • mol: the Mol to be written

  • confId: (optional) ignored

C++ signature :

void write(RDKit::SmilesWriter {lvalue},RDKit::ROMol [,int=-1])

class rdkit.Chem.rdmolfiles.TDTMolSupplier((object)self)

Bases: instance

A class which supplies molecules from a TDT file.

Usage examples:

  1. Lazy evaluation: the molecules are not constructed until we ask for them:

    >>> suppl = TDTMolSupplier('in.smi')
    >>> for mol in suppl:
    ...    mol.GetNumAtoms()
    
  2. Lazy evaluation 2:

    >>> suppl = TDTMolSupplier('in.smi')
    >>> mol1 = next(suppl)
    >>> mol2 = next(suppl)
    >>> suppl.reset()
    >>> mol3 = next(suppl)
    

    # mol3 and mol1 are the same: >>> MolToSmiles(mol3)==MolToSmiles(mol1)

  3. Random Access: all molecules are constructed as soon as we ask for the length:

    >>> suppl = TDTMolSupplier('in.smi')
    >>> nMols = len(suppl)
    >>> for i in range(nMols):
    ...   suppl[i].GetNumAtoms()
    

Properties in the file are used to set properties on each molecule. The properties are accessible using the mol.GetProp(propName) method.

C++ signature :

void __init__(_object*)

__init__( (object)self, (str)fileName [, (str)nameRecord=’’ [, (int)confId2D=-1 [, (int)confId3D=-1 [, (bool)sanitize=True]]]]) -> None :

C++ signature :

void __init__(_object*,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > [,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >=’’ [,int=-1 [,int=-1 [,bool=True]]]])

GetItemText((TDTMolSupplier)self, (int)index) str :

returns the text for an item

C++ signature :

std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > GetItemText(RDKit::v1::TDTMolSupplier {lvalue},unsigned int)

SetData((TDTMolSupplier)self, (str)data[, (str)nameRecord=''[, (int)confId2D=-1[, (int)confId3D=-1[, (bool)sanitize=True]]]]) None :

Sets the text to be parsed

C++ signature :

void SetData(RDKit::v1::TDTMolSupplier {lvalue},std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > [,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >=’’ [,int=-1 [,int=-1 [,bool=True]]]])

reset((TDTMolSupplier)self) None :

Resets our position in the file to the beginning.

C++ signature :

void reset(RDKit::v1::TDTMolSupplier {lvalue})

class rdkit.Chem.rdmolfiles.TDTWriter((AtomPairsParameters)arg1, (AtomPairsParameters)arg2)

Bases: instance

A class for writing molecules to TDT files.

C++ signature :

void* __init__(boost::python::api::object,boost::python::api::object {lvalue})

__init__( (object)self, (str)fileName) -> None :

Constructor.

If a string argument is provided, it will be treated as the name of the output file. If a file-like object is provided, output will be sent there.

C++ signature :

void __init__(_object*,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)

GetNumDigits((TDTWriter)self) int :
C++ signature :

unsigned int GetNumDigits(RDKit::TDTWriter {lvalue})

GetWrite2D((TDTWriter)self) bool :
C++ signature :

bool GetWrite2D(RDKit::TDTWriter {lvalue})

GetWriteNames((TDTWriter)self) bool :
C++ signature :

bool GetWriteNames(RDKit::TDTWriter {lvalue})

NumMols((TDTWriter)self) int :

Returns the number of molecules written so far.

C++ signature :

unsigned int NumMols(RDKit::TDTWriter {lvalue})

SetNumDigits((TDTWriter)self, (int)numDigits) None :

sets the number of digits to be written for coordinates

C++ signature :

void SetNumDigits(RDKit::TDTWriter {lvalue},unsigned int)

SetProps((TDTWriter)self, (AtomPairsParameters)props) None :

Sets the properties to be written to the output file

ARGUMENTS:

  • props: a list or tuple of property names

C++ signature :

void SetProps(RDKit::TDTWriter {lvalue},boost::python::api::object)

SetWrite2D((TDTWriter)self[, (bool)state=True]) None :

causes 2D conformations to be written (default is 3D conformations)

C++ signature :

void SetWrite2D(RDKit::TDTWriter {lvalue} [,bool=True])

SetWriteNames((TDTWriter)self[, (bool)state=True]) None :

causes names to be written to the output file as NAME records

C++ signature :

void SetWriteNames(RDKit::TDTWriter {lvalue} [,bool=True])

close((TDTWriter)self) None :

Flushes the output file and closes it. The Writer cannot be used after this.

C++ signature :

void close(RDKit::TDTWriter {lvalue})

flush((TDTWriter)self) None :

Flushes the output file (forces the disk file to be updated).

C++ signature :

void flush(RDKit::TDTWriter {lvalue})

write((TDTWriter)self, (Mol)mol[, (int)confId=-1]) None :

Writes a molecule to the output file.

ARGUMENTS:

  • mol: the Mol to be written

  • confId: (optional) ID of the conformation to write

C++ signature :

void write(RDKit::TDTWriter {lvalue},RDKit::ROMol [,int=-1])