CDK-R / rpubchem

An R interface to the PubChem Compound and Bioassay Resource
Apache License 2.0
0 stars 2 forks source link

get.synonyms not returning data #1

Open cbroeckl opened 4 years ago

cbroeckl commented 4 years ago

I tried to use 'get.synonyms' to retreive chemical descriptions. My favorite test case:

rpubchem::get.synonyms(name = 'caffeine', quiet = FALSE) data frame with 0 columns and 0 rows

I went into the function and found that the created 'url' was valid and had many synonyms. the 'out' object was also full of synonyms. The only thing I had to change was to change the last line from:

out

to:

return(out)

and the function now works to return the data.frame successfully.

sessionInfo() R version 3.6.1 (2019-07-05) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 17134)

Matrix products: default

locale: [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252 [4] LC_NUMERIC=C LC_TIME=English_United States.1252

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] data.table_1.12.6 XML_3.98-1.20 RCurl_1.95-4.12 bitops_1.0-6

loaded via a namespace (and not attached): [1] zip_2.0.4 Rcpp_1.0.2 pillar_1.4.2 compiler_3.6.1 cellranger_1.1.0 forcats_0.4.0 base64enc_0.1-3
[8] iterators_1.0.12 tools_3.6.1 zeallot_0.1.0 tibble_2.1.3 pkgconfig_2.0.3 rlang_0.4.1 openxlsx_4.1.2
[15] rstudioapi_0.10 curl_4.2 parallel_3.6.1 haven_2.1.1 rio_0.5.16 stringr_1.4.0 vctrs_0.2.0
[22] hms_0.5.2 readxl_1.3.1 rpubchem_1.5.10 foreign_0.8-71 RJSONIO_1.3-1.3 carData_3.0-2 car_3.0-4
[29] magrittr_1.5 backports_1.1.5 itertools_0.1-3 abind_1.4-5 fingerprint_3.5.7 stringi_1.4.3 crayon_1.3.4

rajarshi commented 4 years ago

Could you put in a patch, which I can then merge?

On Tue, Nov 5, 2019 at 11:10 AM Corey Broeckling notifications@github.com wrote:

I tried to use 'get.synonyms' to retreive chemical descriptions. My favorite test case:

rpubchem::get.synonyms(name = 'caffeine', quiet = FALSE) data frame with 0 columns and 0 rows

I went into the function and found that the created 'url' was valid and had many synonyms. the 'out' object was also full of synonyms. The only thing I had to change was to change the last line from:

out

to:

return(out)

and the function now works to return the data.frame successfully.

sessionInfo() R version 3.6.1 (2019-07-05) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 17134)

Matrix products: default

locale: [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252 [4] LC_NUMERIC=C LC_TIME=English_United States.1252

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] data.table_1.12.6 XML_3.98-1.20 RCurl_1.95-4.12 bitops_1.0-6

loaded via a namespace (and not attached): [1] zip_2.0.4 Rcpp_1.0.2 pillar_1.4.2 compiler_3.6.1 cellranger_1.1.0 forcats_0.4.0 base64enc_0.1-3 [8] iterators_1.0.12 tools_3.6.1 zeallot_0.1.0 tibble_2.1.3 pkgconfig_2.0.3 rlang_0.4.1 openxlsx_4.1.2 [15] rstudioapi_0.10 curl_4.2 parallel_3.6.1 haven_2.1.1 rio_0.5.16 stringr_1.4.0 vctrs_0.2.0 [22] hms_0.5.2 readxl_1.3.1 rpubchem_1.5.10 foreign_0.8-71 RJSONIO_1.3-1.3 carData_3.0-2 car_3.0-4 [29] magrittr_1.5 backports_1.1.5 itertools_0.1-3 abind_1.4-5 fingerprint_3.5.7 stringi_1.4.3 crayon_1.3.4

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/CDK-R/rpubchem/issues/1?email_source=notifications&email_token=AAAIMOIR44VYGI3GVQJ4TT3QSGLJBA5CNFSM4JJEJ76KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HW5ZPVQ, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAIMOMHRWVJKLHEPZPFNTDQSGLJBANCNFSM4JJEJ76A .

-- Rajarshi Guha | http://blog.rguha.net | @rguha https://twitter.com/rguha

cbroeckl commented 4 years ago

I forked, edited, pushed to my github and created a pull request. I haven't done this much - let me know if this works!!