Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem pulling ranks below species from tropicos #491

Closed
scelmendorf opened this issue Jan 7, 2016 · 4 comments
Closed

Problem pulling ranks below species from tropicos #491

scelmendorf opened this issue Jan 7, 2016 · 4 comments
Assignees
Labels
Milestone

Comments

@scelmendorf
Copy link

Hi,
I'm trying to pull info for a variety, that is in tropicos.

Here's an example:
Acroporium fuscoflavum var. baldwinii

If you follow the code below I think it illustrated the problem better than my verbal description could.

library (taxize)
thisWorksWell<-get_tpsid(sciname='Pinus contorta')
thisWorksWell
thisFailsEntirely<-get_tpsid(sciname='Acroporium fuscoflavum var. baldwinii')
thisFailsEntirely
thisAlmostWorks<-get_tpsid(sciname=gsub (' var.', '', 'Acroporium fuscoflavum var. baldwinii'))
thisAlmostWorks

why can't I get all of this?

change API key before runningexample

XMLq<-'http://services.tropicos.org/Name/Search?name=Acroporium+fuscoflavum+baldwinii&type=wildcard&apikey=MyAPIKeyThatImNotPostingOnGit&format=xml'
dataQ<-xmlParse(XMLq)
xmlData <- xmlToList(dataQ)
dataQ<-as.data.frame(t(data.frame(as.list(xmlData))))
dataQ$V1['Name.ScientificName']

@sckott sckott added the bug label Jan 7, 2016
@sckott sckott added this to the v0.7.2 milestone Jan 7, 2016
@sckott sckott self-assigned this Jan 7, 2016
@sckott
Copy link
Contributor

sckott commented Jan 7, 2016

Hi @scelmendorf - Thanks for the report. Tropicos has a few problems:

  1. They don't allow a period in the query, even if it's URL encoded. The query fails on their server with a period. So i'm fixing that to replace periods with the url encoded equivalent. However, see 2 below
  2. Tropicos doesn't like sub-specific rank names. That is, Acroporium fuscoflavum var. baldwinii' isn't found at all, but Acroporium fuscoflavum baldwinii' is found.

I am putting in some warnings to catch when users include periods and when var/subsp/etc. are included and updating documentation

@scelmendorf
Copy link
Author

Thanks - that sounds great.
While you're at it wrt the warnings, I would look for
terminal:
sp.
sp

all forms of subspecies abbreviation
ssp.
subsp.
subspecies

all forms of variety
var.
varietas

and all forms of form
fo.
f.
forma

@sckott
Copy link
Contributor

sckott commented Jan 7, 2016

thanks for the additional things to look for, will do

@sckott sckott closed this as completed in f4ec198 Jan 7, 2016
@sckott
Copy link
Contributor

sckott commented Jan 7, 2016

@scelmendorf try again after reinstalling. let me know if it works as expected now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants