std::string OECapitalizeName(const char *ptr)
Capitalize the appropriate first letter of a name generated by OECreateIUPACName. This function should be called after translating the name to a foreign langauge, but before converting the character set encoding.
std::string OECreateIUPACName(const OEChem::OEMolBase &mol,
const unsigned char *style=OENamStyleOpenEye)
This function attempts to generate a ‘reasonable’ IUPAC name for the given molecule, mol, and return the result in a C++ STL string. These ‘reasonable’ names attempts to be one of the recommended IUPAC names for a compound, however occassionally this function may fall back to using IUPAC ‘systematic’ naming for parts of a molecule. Any parts of a molecule that cannot be named, result in the substring BLAH appearing in the returned string.
The optional style argument can be used to control and customize the style of the names generated by this function. The nine currently predefined name styles are OEIUPAC::OENamStyleOpenEye (the default), OEIUPAC::OENamStyleIUPAC, OEIUPAC::OENamStyleIUPAC79, OEIUPAC::OENamStyleIUPAC93, OEIUPAC::OENamStyleTraditional, OEIUPAC::OENamStyleAutoNom, OEIUPAC::OENamStyleCAS, OEIUPAC::OENamStyleCASIndex and OEIUPAC::OENamStyleSystematic.
After the name has been generated it may be translated into one of several languages, for example using the OEToGerman or OEToJapanese functions, then optionally capitalized using OECapitalizeName, and finally converted into a final character encoding, for example using OEToUTF8 or OEToHTML.
std::string OEFromChinese(const char *ptr)
Convert the chemical name specified by ‘ptr’ from simplified or traditional Chinese to English.
std::string OEFromDanish(const char *ptr)
Convert the chemical name specified by ‘ptr’ from Danish to English.
std::string OEFromDutch(const char *ptr)
Convert the chemical name specified by ‘ptr’ from Dutch to English.
std::string OEFromFrench(const char *ptr)
Convert the chemical name specified by ‘ptr’ from French to English.
std::string OEFromGerman(const char *ptr)
Convert the chemical name specified by ‘ptr’ from German to English.
std::string OEFromGreek(const char *ptr)
Convert the chemical name specified by ‘ptr’ from Greek to English.
std::string OEFromHungarian(const char *ptr)
Convert the chemical name specified by ‘ptr’ from Hungarian to English.
std::string OEFromIrish(const char *ptr)
Convert the chemical name specified by ‘ptr’ from Irish to English.
std::string OEFromItalian(const char *ptr)
Convert the chemical name specified by ‘ptr’ from Italian to English.
std::string OEFromJapanese(const char *ptr)
Convert the chemical name specified by ‘ptr’ from Japanese to English.
std::string OEFromKOI8R(const char *ptr)
Convert the string ‘ptr’ from the Russian KOI-8 character encoding to Lexichem‘s default encoding using \u escapes to represent non-ASCII unicode characters.
std::string OEFromLanguage(const char *ptr, unsigned int lang)
This is a helper wrapper function that can be used to convert the chemical name specified by ‘ptr’ from the language specified by ‘lang’ to English. The languages are specified by the constants with the OE_LANG_ prefix described in the OEIUPAC namespace.
std::string OEFromPolish(const char *ptr)
Convert the chemical name specified by ‘ptr’ from Polish to English.
std::string OEFromRomanian(const char *ptr)
Convert the chemical name specified by ‘ptr’ from Romanian to English.
std::string OEFromRussian(const char *ptr)
Convert the chemical name specified by ‘ptr’ from Russian to English.
std::string OEFromSlovak(const char *ptr)
Convert the chemical name specified by ‘ptr’ from Slovak to English.
std::string OEFromSpanish(const char *ptr)
Convert the chemical name specified by ‘ptr’ from Spanish to English.
std::string OEFromSwedish(const char *ptr)
Convert the chemical name specified by ‘ptr’ from Swedish to English.
std::string OEFromUTF8(const char *ptr)
Convert the string ‘ptr’ from the UTF-8 character encoding to Lexichem‘s default encoding using ‘u’ escapes to represent non-ASCII unicode characters.
std::string OEFromWelsh(const char *ptr)
Convert the chemical name specified by ‘ptr’ from simplified or traditional Welsh to English.
char OEGetCIPStereo(const OEChem::OEMolBase &mol,
const OEChem::OEAtomBase *atm)
char OEGetCIPStereo(const OEChem::OEMolBase &mol,
const OEChem::OEBondBase *bnd)
These functions return the Cahn-Ingold-Prelog descriptor for the given atom or bond stereo center, from the stereochemistry set on the OEMolBase. For chiral atom centers, the OEAtomBase form of this function returns either ‘R’ or ‘S’ for specified CIP stereo centers, ‘N’ for CIP stereo centers that don’t have stereo specified (i.e. OEAtomBase::HasStereoSpecified returns false), and ‘X’ for atoms that are not CIP stereo centers. For double bonds, the OEBondBase form of this function returns either ‘E’ or ‘Z’ specified CIP stereo centers, ‘N’ for CIP stereo centers that don’t have stereo specified (i.e. OEBondBase::HasStereoSpecified returns false), and ‘X’ for bonds that are not CIP stereo centers.
const char *OEIUPACGetArch()
bool OEIUPACGetLicensee(std::string &licensee)
const char *OEIUPACGetPlatform()
const char *OEIUPACGetRelease()
bool OEIUPACGetSite(std::string &site)
unsigned int OEIUPACGetVersion()
bool OEIUPACIsLicensed(const char *feature=0, unsigned int *expdate=0)
Determine whether a valid license file is present. This function may be called without a legitimate run-time license to determine whether it is safe to call any of OEIUPAC’s functionality.
The ‘features’ argument can be used to check for a valid license to OEIUPAC along with that feature. For example, to verify that OEIUPAC can be used from Python:
if (!OEIUPACIsLicensed("python"))
OEThrow.Warning("OEIUPAC is not licensed for the python feature");
The second argument can be used to get the expiration date of the license. This is an array of size three with the date returned as {day, month, year}. Even if the function returns false due to an expired license, the expdate will show that expiration date. A value of a zeroes implies that no license or date was found.
unsigned int expdate[3];
if (OEIUPACIsLicensed(0, expdate))
{
OEThrow.Info("License expires: day: %d month: %d year: %d",
expdate[0], expdate[1], expdate[2]);
}
std::string OELowerCaseName(const char *ptr)
Convert the specified compound name to lower-case. This function understands chemical nomenclature and foreign alphabets. This function should be called prior to translating a name from a foreign language, as the language translation routines assume that the name is lower-case.
std::string OENameLocant(unsigned int loc, bool iupac=false)
Generate the lexical form of a LexiChem locant index. The molecule’s created by the function OEParseIUPACName are annotated with locant infomation in each atom’s integer atom type field. These locant indices may be retrieved using OEChem’s OEAtomBase::GetIntType method.
bool OEParseIUPACName(OEChem::OEMolBase &mol, const char *name)
This function parses the compound name (not necessarily a systematic or preferred IUPAC name) from the NUL-terminated string given by name, and places the processed molecule in mol. This function returns true if the name could be parsed without problems. When returning false, the contents of mol contain as much of the name as could be processed.
std::string OEReorderIndexName(const char *ptr)
Attempt to reorder the specified permuted index name. The permute strings such as “benzene, chloro-” into the form “chloro-benzene” which can then be processed by Lexichem‘s OEParseIUPACName function.
This function returns an empty string (or the original input string) if it’s argument is not recognized as a permuted index name.
bool OESetCIPStereo(OEChem::OEMolBase &mol, OEChem::OEAtomBase *atm, char s)
bool OESetCIPStereo(OEChem::OEMolBase &mol, OEChem::OEBondBase *bnd, char s)
These functions set the internal OEChem stereochemistry from the given CIP stereo descriptor. For the OEAtomBase form, the descriptor s must be either ‘R’ or ‘S’, and for the OEBondBase form, the descriptor s must be either ‘E’ or ‘Z’. This function returns true if the stereochemistry was successfully set, and false otherwise: i.e. the descriptor was invalid or the specified atom or bond was not a CIP stereo center.
std::string OEToASCII(const char *ptr)
Convert the string ‘ptr’, typically the output of the function OECreateIUPACName post-processed by a language translation function, from the default ISO-8859-1 encoding, which includes 8-bit European characters, into a reduced 7-bit ASCII representation by stripping the accents off of the 8-bit characters.
std::string OEToBritish(const char *ptr, bool sulph)
Convert the string ‘ptr’, typically the output of the function OECreateIUPACName, from the default American output, to either British spelling (when ‘sulph’ is true) or IUPAC international spelling (when ‘sulph’ is false).
std::string OEToChinese(const char *ptr)
Convert the string ‘ptr’, typically the output of the function OECreateIUPACName, from English to Simplified Chinese.
std::string OEToDanish(const char *ptr)
std::string OEToDutch(const char *ptr)
Convert the string ‘ptr’, typically the output of the function OECreateIUPACName, from English to Dutch.
std::string OEToEUCJP(const char *ptr)
Convert the string ‘ptr’, typically the output of the function OECreateIUPACName post-processed by a call to OEToJapanese, from the default encoding which uses ‘u’ escapes to represent unicode characters to instead use the EUC-JP character encoding for japanese characters.
std::string OEToFrench(const char *ptr)
Convert the string ‘ptr’, typically the output of the function OECreateIUPACName, from English to French.
std::string OEToGerman(const char *ptr)
Convert the string ‘ptr’, typically the output of the function OECreateIUPACName, from English to German.
std::string OEToGreek(const char *ptr)
std::string OEToHTML(const char *ptr)
Convert the string ‘ptr’, typically the output of the function OECreateIUPACName possibly post-processed by a language translation function, from the default encoding to use HTML mark-up to represent accented characters, unicode characters and superscripts.
std::string OEToHungarian(const char *ptr)
Convert the string ‘ptr’, typically the output of the function OECreateIUPACName, from English to Hungarian.
std::string OEToIrish(const char *ptr)
Convert the string ‘ptr’, typically the output of the function OECreateIUPACName, from English to Irish.
std::string OEToItalian(const char *ptr)
Convert the string ‘ptr’, typically the output of the function OECreateIUPACName, from English to Italian.
std::string OEToJapanese(const char *ptr)
Convert the string ‘ptr’, typically the output of the function OECreateIUPACName, from English to Japanese.
std::string OEToLanguage(const char *ptr, unsigned int lang)
This is a helper wrapper function that can be used to convert the chemical name specified by ‘ptr’ from English to the language specified by ‘lang’. The languages are specified by the constants with the OE_LANG_ prefix described in the OEIUPAC namespace.
std::string OEToPolish(const char *ptr)
Convert the string ‘ptr’, typically the output of the function OECreateIUPACName, from English to Polish.
std::string OEToRomanian(const char *ptr)
Convert the string ‘ptr’, typically the output of the function OECreateIUPACName, from English to Romanian.
std::string OEToRussian(const char *ptr)
Convert the string ‘ptr’, typically the output of the function OECreateIUPACName, from English to Russian.
std::string OEToSJIS(const char *ptr)
Convert the string ‘ptr’, typically the output of the function OECreateIUPACName post-processed by a call to OEToJapanese, from the default encoding which uses ‘u’ escapes to represent unicode characters to instead use the Shift-JIS character encoding for japanese characters.
std::string OEToSlovak(const char *ptr)
Convert the string ‘ptr’, typically the output of the function OECreateIUPACName, from English to Slovak.
std::string OEToSpanish(const char *ptr)
Convert the string ‘ptr’, typically the output of the function OECreateIUPACName, from English to Spanish.
std::string OEToSwedish(const char *ptr)
Convert the string ‘ptr’, typically the output of the function OECreateIUPACName, from English to Swedish.
std::string OEToUTF8(const char *ptr)
Convert the string ‘ptr’, typically the output of the function OECreateIUPACName post-processed by a language translation function, from the default ISO-8859-1 encoding which uses ‘u’ escapes to represent unicode characters to instead use the UTF-8 character encoding for accented and other characters.
std::string OEToWelsh(const char *ptr)
Convert the string ‘ptr’, typically the output of the function OECreateIUPACName, from English to Welsh.