Closed jranke closed 9 years ago
Thanks for reporting this! Isomers, are always not easy to handle... Will investigate....
This is a case when there are multiple links on the webpage. Should be fixed now, Please check/use/test the current version on the master branch (next cran release is planned for next year):
install.packages("devtools")
library("devtools")
install_github("ropensci/webchem")
With the new version we get:
> require(webchem)
> alanwood("S-Metolachlor", type = "commonname")$inchikey
# More then one link found! Returning first.
#
# Querying s-metolachlor.html
# [1] "major component (S)-isomer:WVQBLGZPHOPPFO-LBPRGKRZSA-Nminor component (R)-isomer:WVQBLGZPHOPPFO-GFCCVEGCSA-N"
@EDiLD I confirm this is better. What would you think about returning a vector of two INCHI keys, named with the isomer description ("major component (S)-isomer")?
Good idea, I opened a new issue #42.
For example in the case of S-Metolachlor
http://www.alanwood.net/pesticides/s-metolachlor.html
the HTML snippet for the InChiKey is
and we get
which is duplicated (already the query as it seems).