-
Notifications
You must be signed in to change notification settings - Fork 58
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
Comments
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. |
@Edild - akk, downstream2 doesn't work, trying to fix it now. |
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... |
Cool. So it does work sometimes, but sometimes not. Working on it now. |
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... |
When is see this: Wouldn`t it be better when the data.frames are returned with 'stringsAsFactors = FALSE'? |
Yeah, that would probably be better |
works now., closed |
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)..The text was updated successfully, but these errors were encountered: