schrodinger.livedesign.convert module¶
- class schrodinger.livedesign.convert.Format(value)[source]¶
Bases:
enum.Enum
An enumeration.
- SDF = 1¶
- SMILES = 2¶
- CXSMILES = 3¶
- SMARTS = 4¶
- INCHI = 5¶
- schrodinger.livedesign.convert.convert(data: str, input_format: schrodinger.livedesign.convert.Format, output_format: schrodinger.livedesign.convert.Format) str [source]¶
Main entrypoint for converting one serialization to another. A few convience functions are provided below for common LD conversions.
- Parameters
data – input text string
input_format – expected format for input string
output_format – desired format for output string
- Returns
converted text string
- schrodinger.livedesign.convert.sdf_to_rdkit(molblock: str) Union[rdkit.Chem.rdchem.Mol, rdkit.Chem.rdChemReactions.ChemicalReaction] [source]¶
- Parameters
molblock – given SDF or RXN molblock
- Returns
corresponding RDKit mol or reaction
- schrodinger.livedesign.convert.rdkit_to_sdf(mol: rdkit.Chem.rdchem.Mol, kekulize: bool = True) str [source]¶
- Parameters
input – given RDKit mol
kekulize – whether to kekulize mol
- Returns
corresponding SDF molblock
- schrodinger.livedesign.convert.rdkit_to_cxsmiles(mol: rdkit.Chem.rdchem.Mol) str [source]¶
- Parameters
mol – given RDKit mol
- Returns
corresponding CXSMILES stripped of coordinates
- schrodinger.livedesign.convert.get_sd_reader(molblock: str) Generator[rdkit.Chem.rdchem.Mol, None, None] [source]¶
- Parameters
molblock – string of SDF molblocks
- Returns
generator that provides mols from SDF molblcoks
- schrodinger.livedesign.convert.add_hs_to_aromatic_nitrogen(mol)[source]¶
Intended to be used with molecules which have kekulization failures due to aromatic system(s) containing Ns where the user hasn’t provided the location of the implicit Hs in the system.
This picks an arbitrary (but canonical) aromatic N to add an H to in each aromatic system.
Returns the original mol if it can’t fix it.
- schrodinger.livedesign.convert.add_polymer_brackets(mol, revert_to_mol=None, keep_existing_brackets=False)[source]¶
Add polymer brackets back to mol.
- Parameters
mol – RDKit mol to add polymer brackets to
revert_to_mol – RDKit mol to revert to if polymer brackets cannot be added correctly to provided mol. This will occur when brackets cross more than one bond.
keep_existing_brackets – whether to recalculate the positions of brackets that are already present
- Returns
RDKit mol with polymer brackets