addMissingInChIKeys.CSV: Fill in Missing InChIKeys in CSV files

Description Usage Arguments Value Author(s) See Also Examples

View source: R/MetFragConfigR.R

Description

This is a small wrapper function to patch CSV files that are missing some InChIKey entries, using Cactus then Open Babel to fill gaps from SMILES.

Usage

1
addMissingInChIKeys.CSV(csv_file, inchikey_col_number, smiles_col_number, babel_dir, write=TRUE, csv_file_out="")

Arguments

csv_file

Full path and file name to CSV file to fill in InChIKey gaps

inchikey_col_number

Column number of the column containing InChIKeys to check/fill

smiles_col_number

Column number of the SMILES code needed to calculate missing InChIKeys

babel_dir

Path to the directory containing obabel.exe, e.g. "C:/Program Files (x86)/OpenBabel-2.3.2"

write

If TRUE, writes either to csv_file_out (of defined) or overwrites csv_file and returns the file name. If FALSE, returns a list of InChIKeys and does not write to file.

csv_file_out

Full path and file name of output CSV, define to avoid overwriting the original file.

Value

Returns path and file name to CSV file with fixed entries (if necessary) or list of InChIKeys.

Author(s)

Emma Schymanski <emma.schymanski@uni.lu>

See Also

getInChIKey.obabel, getCactus, InChIKey_test

Examples

1
2
3
testCSV <- system.file("extdata","CompToxBatchSearch_MetFrag_MSready_C10H14N2_wSelectMetaData.csv",package="ReSOLUTION")
babel_dir <- "C:/Program Files (x86)/OpenBabel-2.3.2"
InChIKeys <- addMissingInChIKeys.CSV(testCSV,13,5,babel_dir,write=FALSE)

schymane/ReSOLUTION documentation built on May 22, 2021, 3:41 a.m.