OEMolToHelm
Attention
This is a preliminary API and may be improved based on user feedback. It is currently available in C++ and Python.
OEMolToHelm(mol: Union[OEGraphMol,OEMol,OEQMol],
monomers: OEMonomerSet) -> str
OEMolToHelm(mol: Union[OEGraphMol,OEMol,OEQMol],
monomers: OEMonomerSet, result: OEHelmGenerationResult) -> str
OEMolToHelm(mol: Union[OEGraphMol,OEMol,OEQMol],
monomers: OEMonomerSet, options: OEHelmGenerationOptions) -> str
OEMolToHelm(mol: Union[OEGraphMol,OEMol,OEQMol],
monomers: OEMonomerSet, options: OEHelmGenerationOptions,
result: OEHelmGenerationResult) -> str
Converts a molecule into HELM string. The function will return HELM string if it can be generated successfully, otherwise the function will return an empty string.
- mol
The molecule (
OEMolBase) the HELM string is generated from.- monomers
The monomer set (
OEMonomerSet) that stores the monomers that are used to generate the HELM string.If the given monomer set supports multiple code sets,
OEHelmToMolautomatically selects the primary code set.- options
The options for HELM generation (
OEHelmGenerationOptions).- result
Is specified, the
OEHelmGenerationResultobject will store additional information about the success or failure of the HELM generation.
Example
from openeye import oechem
# read monomer set
monomers = oechem.OEMonomerSet()
oechem.OELoadOpenEyeMonomerSet(monomers)
# generate HELM
mol = oechem.OEGraphMol()
smiles = (
"CC[C@H](C)[C@H]1C(=O)N[C@H](C(=O)N[C@H](C(=O)N[C@@H](CSSC[C@@H](C(=O)N[C@H]"
"(C(=O)N1)Cc2ccc(cc2)O)N)C(=O)N3CCC[C@H]3C(=O)N[C@@H](CC(C)C)C(=O)NCC(=O)N)CC(=O)N)CCC(=O)N"
)
oechem.OESmilesToMol(mol, smiles)
result = oechem.OEHelmGenerationResult()
helm = oechem.OEMolToHelm(mol, monomers, result)
if helm:
# successful generation
print("Peptide HELM: ", helm)
codes = oechem.OEGetHelmMonomerCodes(helm)
print(f"Monomer sequence length: {len(codes)}")
print(f"Monomer sequence: {' '.join(codes)}")
else:
# failed generation
print(f"Warning: {result.GetWarning()}")
See also
[Zhang-2012] publications
OEHelmToMolfunction
OpenEye Python Cookbook Code Example