OEHelmToMol

Attention

This is a preliminary API and may be improved based on user feedback. It is currently available in C++ and Python.

bool OEHelmToMol(OEMolBase& mol, const std::string& helm,
                 const OEMonomerSet& monomers)
bool OEHelmToMol(OEMolBase& mol, const std::string& helm,
                 const OEMonomerSet& monomers,
                 OEHelmParsingResult& result)

Converts a HELM string into a molecule. The function will return true if the HELM string can be parsed and interpreted successfully, otherwise the function will return false and a given molecule will be cleared.

mol

The constructed molecule (OEMolBase).

helm

The HELM string that is parsed into the molecule.

monomers

The monomer set (OEMonomerSet) that stores the monomers that are used to interpret the HELM string.

If the given monomer set supports multiple code sets, OEHelmToMol automatically selects the code set that contains all monomer codes needed to parse the HELM string.

result

Is specified, the OEHelmParsingResult object will store additional parsing information.

After constructing the molecule the following properties are perceived:

Warning

The current implementation of HELM parsing algorithm does not support RNA polymers.

Example

OEHelmToMol can parse HELM strings with embedded SMILES in various styles. The examples below illustrate valid representations of eledoisin:

1PEPTIDE1{[N1[C@@H](CCC1=O)C([R2])=O].P.S.K.D.A.F.I.G.L.M.[am]}$$$$
2PEPTIDE1{[N1[C@@H](CCC1=O)C([*:2])=O].P.S.K.D.A.F.I.G.L.M.[am]}$$$$
3PEPTIDE1{[N1[C@@H](CCC1=O)C(*)=O |$;;;;;;;_R2;$|].P.S.K.D.A.F.I.G.L.M.[am]}$$$$

In case when the OEHelmToMol function successfully parses a HELM string the atoms that are generated for a specific monomer are added to a molecule as a group (OEGroupBase)

See also

OpenEye Python Cookbook Code Example