nanxstats / Rcpi

💊 Molecular informatics toolkit with integration of bioinformatics and cheminformatics tools for drug discovery
https://nanx.me/Rcpi/
Artistic License 2.0
35 stars 12 forks source link

extractDrug...(mol) does _not_ work with one-liner .smi files containing one SMILES #2

Closed tttor closed 7 years ago

tttor commented 7 years ago

RI2.smi contains only one SMILE (the first line of vignettedata/RI.smi): line 1: CCCCCCCCCCCCCCCCCCCCCCC

We got:

smi = system.file('vignettedata/RI2.smi', package = 'Rcpi') mol = readMolFromSmi(smi, type = 'mol') fp = extractDrugKR(mol) Error in get.fingerprint(molecules, type = "kr", verbose = !silent) : Must supply an IAtomContainer or something coercable to it

Env: R version 3.4.0 (2017-04-21) -- "You Stupid Darkness" Platform: x86_64-pc-linux-gnu (64-bit)

nanxstats commented 7 years ago

Hi @tttor ,

-thanks a lot for the feedback. Normally, an SMI file would contain multiple lines of SMILES strings so this seems to be an edge case. Please try the following code, which works for this special situation:

mol = readMolFromSmi("RI2.smi", type = "mol")
fp = extractDrugKR(mol[[1]])

Thanks again, -Nan