getInChIKey.obabel: Convert SMILES to an InChIKey with OpenBabel (obabel)

Description Usage Arguments Value Author(s) See Also Examples

View source: R/ChemicalCuration.R

Description

A small wrapper function to convert SMILES to an InChIKey with OpenBabel (http://openbabel.org/wiki/Main_Page). Requires pre-installation of OpenBabel. If this is not the case, use webservices instead via getSuspectInChIKey. Note this supercedes getSuspectInChIKey.babel This function uses Babel default InChI options; standard InChIKeys will be generated.

Usage

1
getInChIKey.obabel(smiles,babel_dir)

Arguments

smiles

SMILES code to convert to the InChIKey.

babel_dir

Location of folder containing "obabel.exe".

Value

Returns the InChIKey retrieved, or alternative output from Babel. Run InChIKey_test to determine if valid.

Author(s)

Emma Schymanski <emma.schymanski@uni.lu>

See Also

getSuspectInChIKey, InChIKey_test, getSuspectInChIKey.babel.

Examples

1
2
3
4
5
6
babel_dir <- "C:/Program Files (x86)/OpenBabel-2.3.2"
getInChIKey.obabel("c1ccccc1", babel_dir)
Various failed conversions:
getInChIKey.obabel("blah", babel_dir)
getInChIKey.obabel("", babel_dir)
InChIKey_test(getInChIKey.obabel("blah",babel_dir))

schymane/RChemMass documentation built on Jan. 25, 2021, 5:45 a.m.