schrodinger.livedesign.convert module¶
- schrodinger.livedesign.convert.convert(data: str, input_format: schrodinger.rdkit_extensions.Format, output_format: schrodinger.rdkit_extensions.Format, additional_properties: Optional[Dict] = None) str ¶
Main entrypoint for converting one serialization to another. A few convenience 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.set_properties(mol: rdkit.Chem.rdchem.Mol, new_props: dict)¶
- Parameters
mol – molecule to set given properties on
new_props – map of properties to add onto the molecule
- schrodinger.livedesign.convert.sdf_to_rdkit(molblock: str) Union[rdkit.Chem.rdchem.Mol, rdkit.Chem.rdChemReactions.ChemicalReaction] ¶
- Parameters
molblock – given MDL or MDL RXN
- Returns
corresponding RDKit mol or reaction
- schrodinger.livedesign.convert.rdkit_to_sdf(mol: rdkit.Chem.rdchem.Mol) str ¶
- Parameters
input – given RDKit mol
- Returns
corresponding sdf molblock
- schrodinger.livedesign.convert.get_sd_reader(molblocks: str) Iterator[Union[rdkit.Chem.rdchem.Mol, ValueError]] ¶
- Parameters
molblocks – string of sdf molblocks
- Returns
generator that provides mols from sdf molblocks or ValueError if the SDF cannot be read
- schrodinger.livedesign.convert.add_hs_to_aromatic_nitrogen(mol)¶
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.is_polymer(s_group)¶
- schrodinger.livedesign.convert.clean_up_polymer_brackets(mol, revert_to_mol=None, keep_existing_brackets=False)¶
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
- schrodinger.livedesign.convert.rdkit_to_fasta(mol: rdkit.Chem.rdchem.Mol) str ¶
Stub function intended to eventually call an rdkit-based polymer sequence extraction function to convert an rdmol into a FASTA sequence file.
For now, it expects a single coarse-grain rdmol with single-letter monomer names. It treats all sequences as proteins for the convenience of using ProteinAlignment.
- Parameters
input – given RDKit mol
- Returns
corresponding FASTA string
- schrodinger.livedesign.convert.get_nucleobase_atoms(atoms: iter[Chem.rdchem.Atom]) list[Chem.rdchem.Atom] ¶
Get the nucleobase atoms from a list of atoms
- Parameters
atoms – a list of course-grain atoms
- Returns
a list of nucleobase atoms
- schrodinger.livedesign.convert.get_monomer_names(atoms: iter[Chem.rdchem.Atom]) list[str] ¶
Get the monomer names from a list of atoms
- Parameters
atoms – a list of course-grain atoms
- Returns
a list of monomer names
- schrodinger.livedesign.convert.get_seq_object(monomer_names: list[str], polymer_type: PolymerType) sequence.Sequence ¶
Get a sequence object of the appropriate type from a list of monomer names
- Parameters
monomer_names – a list of single-letter monomer names
polymer_type – the origin polymer type of the monomers
- Returns
a sequence object consisting of the supplied monomers