OEMolToHelm
Attention
This is a preliminary API and may be improved based on user feedback. It is currently available in C++ and Python.
std::string OEMolToHelm(const OEMolBase& mol,
const OEMonomerSet& monomers)
std::string OEMolToHelm(const OEMolBase& mol,
const OEMonomerSet& monomers,
OEHelmGenerationResult& result)
std::string OEMolToHelm(const OEMolBase& mol,
const OEMonomerSet& monomers,
const OEHelmGenerationOptions& options)
std::string OEMolToHelm(const OEMolBase& mol,
const OEMonomerSet& monomers,
const OEHelmGenerationOptions& options,
OEHelmGenerationResult& result)
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
#include <iterator>
#include <string>
#include <openeye.h>
#include <oechem.h>
using namespace OEChem;
int main()
{
// read monomer set
OEMonomerSet monomers;
OELoadOpenEyeMonomerSet(monomers);
// generate HELM
OEGraphMol mol;
const std::string 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";
OESmilesToMol(mol, smiles);
OEHelmGenerationResult result;
const std::string helm = OEMolToHelm(mol, monomers, result);
if (helm != "")
{ // successful generation
std::cout << "Peptide HELM: " << helm << std::endl;
const std::vector<std::string> codes = OEGetHelmMonomerCodes(helm);
std::cout << "Monomer sequence length: " << codes.size() << std::endl;
std::cout << "Monomer sequence: ";
std::copy(codes.begin(), codes.end(), std::ostream_iterator<std::string>(std::cout, " "));
std::cout << std::endl;
}
else
{ // failed generation
std::cout << "Warning:" << result.GetWarning() << std::endl;
}
return 0;
}
See also
[Zhang-2012] publications
OEHelmToMolfunction
OpenEye Python Cookbook Code Example