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

the function downstream I started doesn't work #24

Closed
sckott opened this issue Sep 4, 2012 · 8 comments
Closed

the function downstream I started doesn't work #24

sckott opened this issue Sep 4, 2012 · 8 comments

Comments

@sckott
Copy link
Contributor

sckott commented Sep 4, 2012

The point of the function is to automate getting all data you would like downstream of a certain taxon. For example, you may want to get all the families (and their TSNs) with the Class Insecta. I think I may have a working version somewhere on my machine, will try to dig it up.

The reason we need this stems from the fact that the ITIS API only allows you to go down to direct children using their method getHierarchyDownFromTSN (e.g., you can only get species within a genus, not subspecies too)..

@ghost ghost assigned sckott Sep 4, 2012
@sckott
Copy link
Contributor Author

sckott commented Sep 4, 2012

Hey @Edild, let me know if the function I just added downstream2 works for you? I am attempting to grab all taxonomic names downstream from an TSN, but it's been a bit challenging.

@sckott
Copy link
Contributor Author

sckott commented Sep 4, 2012

@Edild - akk, downstream2 doesn't work, trying to fix it now.

@eduardszoecs
Copy link
Member

Seems to work like a charm :) Nice!

downstream2(114989)
http://www.itis.gov/ITISWebService/services/ITISService/getTaxonomicRankNameFromTSN?tsn=114989
http://www.itis.gov/ITISWebService/services/ITISService/getHierarchyDownFromTSN?tsn=114989
http://www.itis.gov/ITISWebService/services/ITISService/getTaxonomicRankNameFromTSN?tsn=665931
http://www.itis.gov/ITISWebService/services/ITISService/getTaxonomicRankNameFromTSN?tsn=665932
http://www.itis.gov/ITISWebService/services/ITISService/getTaxonomicRankNameFromTSN?tsn=665931
http://www.itis.gov/ITISWebService/services/ITISService/getTaxonomicRankNameFromTSN?tsn=665932
http://www.itis.gov/ITISWebService/services/ITISService/getHierarchyDownFromTSN?tsn=665931
http://www.itis.gov/ITISWebService/services/ITISService/getHierarchyDownFromTSN?tsn=665932
http://www.itis.gov/ITISWebService/services/ITISService/getTaxonomicRankNameFromTSN?tsn=114990
http://www.itis.gov/ITISWebService/services/ITISService/getTaxonomicRankNameFromTSN?tsn=665935
http://www.itis.gov/ITISWebService/services/ITISService/getTaxonomicRankNameFromTSN?tsn=114991
http://www.itis.gov/ITISWebService/services/ITISService/getTaxonomicRankNameFromTSN?tsn=114992
http://www.itis.gov/ITISWebService/services/ITISService/getTaxonomicRankNameFromTSN?tsn=114993
http://www.itis.gov/ITISWebService/services/ITISService/getTaxonomicRankNameFromTSN?tsn=665933
http://www.itis.gov/ITISWebService/services/ITISService/getTaxonomicRankNameFromTSN?tsn=665934
http://www.itis.gov/ITISWebService/services/ITISService/getTaxonomicRankNameFromTSN?tsn=665936
http://www.itis.gov/ITISWebService/services/ITISService/getTaxonomicRankNameFromTSN?tsn=665937
$not
     parentName parentTsn rankName         taxonName    tsn
1 Mengenillidia    665931   Family         Mengeidae 114990
2 Mengenillidia    665931   Family     Mengenillidae 665935
3    Stylopidia    665932   Family        Stylopidae 114991
4    Stylopidia    665932   Family        Elenchidae 114992
5    Stylopidia    665932   Family   Halictophagidae 114993
6    Stylopidia    665932   Family    Myrmecolacidae 665933
7    Stylopidia    665932   Family      Corioxenidae 665934
8    Stylopidia    665932   Family     Bohartillidae 665936
9    Stylopidia    665932   Family Callipharixenidae 665937

I think this could be also easily done from the NCBI taxonomy-browser(http://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?id=30261)... Using rentrez und get_uid()... I`ll make up a function/method these days...

Are there any restrictions with the usage of the ITIS-Api (eg like the NCBI-API. only 3 requests per second)? Not that they block any IP...

@sckott
Copy link
Contributor Author

sckott commented Sep 4, 2012

Cool. So it does work sometimes, but sometimes not. Working on it now.

@eduardszoecs
Copy link
Member

Returns all Families: For me all queries worked yet...

> check <- downstream2(101594)
http://www.itis.gov/ITISWebService/services/ITISService/getTaxonomicRankNameFromTSN?tsn=101594
http://www.itis.gov/ITISWebService/services/ITISService/getHierarchyDownFromTSN?tsn=101594
http://www.itis.gov/ITISWebService/services/ITISService/getTaxonomicRankNameFromTSN?tsn=101596
http://www.itis.gov/ITISWebService/services/ITISService/getTaxonomicRankNameFromTSN?tsn=101659
http://www.itis.gov/ITISWebService/services/ITISService/getTaxonomicRankNameFromTSN?tsn=101664
http://www.itis.gov/ITISWebService/services/ITISService/getTaxonomicRankNameFromTSN?tsn=101797
http://www.itis.gov/ITISWebService/services/ITISService/getTaxonomicRankNameFromTSN?tsn=102020
http://www.itis.gov/ITISWebService/services/ITISService/getTaxonomicRankNameFromTSN?tsn=102026
http://www.itis.gov/ITISWebService/services/ITISService/getTaxonomicRankNameFromTSN?tsn=591725
http://www.itis.gov/ITISWebService/services/ITISService/getTaxonomicRankNameFromTSN?tsn=591726
> check
$not
  parentName parentTsn rankName        taxonName    tsn
1 Anisoptera    101594   Family        Aeshnidae 101596
2 Anisoptera    101594   Family      Petaluridae 101659
3 Anisoptera    101594   Family        Gomphidae 101664
4 Anisoptera    101594   Family     Libellulidae 101797
5 Anisoptera    101594   Family      Corduliidae 102020
6 Anisoptera    101594   Family Cordulegastridae 102026
7 Anisoptera    101594   Family Austropetaliidae 591725
8 Anisoptera    101594   Family    Neopetaliidae 591726

> str(check)
List of 1
 $ not:'data.frame':    8 obs. of  5 variables:
  ..$ parentName: Factor w/ 1 level "Anisoptera": 1 1 1 1 1 1 1 1
  ..$ parentTsn : Factor w/ 1 level "101594": 1 1 1 1 1 1 1 1
  ..$ rankName  : chr [1:8] "Family" "Family" "Family" "Family" ...
  ..$ taxonName : Factor w/ 8 levels "Aeshnidae","Austropetaliidae",..: 1 8 5 6 4 3 2 7
  ..$ tsn       : Factor w/ 8 levels "101596","101659",..: 1 2 3 4 5 6 7 8

So you want in the long run all families in a list-entry, all sub-families in a list entry etc...
Good idea...

@eduardszoecs
Copy link
Member

When is see this:

Wouldn`t it be better when the data.frames are returned with 'stringsAsFactors = FALSE'?
What do you think?

@sckott
Copy link
Contributor Author

sckott commented Sep 5, 2012

Yeah, that would probably be better

@sckott
Copy link
Contributor Author

sckott commented Oct 17, 2012

works now., closed

@sckott sckott closed this as completed Oct 17, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants