getSuspectInChIKey.babel: Convert SMILES to an InChIKey with OpenBabel (superceded)

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 creates "temp_smiles.smi" in the temp_dir directory and will overwrite any previous file of the same name. This function uses Babel default InChI options; standard InChIKeys will be generated. This is superceded by getInChIKey.obabel.

Usage

1
getSuspectInChIKey.babel(smiles,babel_dir,temp_dir)

Arguments

smiles

Valid SMILES code used to convert to the InChIKey.

babel_dir

Location of folder containing "babel.exe".

temp_dir

Location of folder to save "temp_smiles.smi".

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, getInChIKey.obabel, InChIKey_test.

Examples

1
2
3
4
getSuspectInChIKey.babel("c1ccccc1", "C:/Program Files (x86)/OpenBabel-2.3.2", "C:/DATA")
Various failed conversions:
getSuspectInChIKey.babel("blah", "C:/Program Files (x86)/OpenBabel-2.3.2", "C:/DATA")
getSuspectInChIKey.babel("", "C:/Program Files (x86)/OpenBabel-2.3.2", "C:/DATA")

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