1414# '
1515getSupportedSpecies <- function () {
1616 data.frame (
17- taxId = c(10090 , 9606 , 6239 , 7955 , 7227 , 4932 , 284812 ),
17+ taxId = c(10090 , 9606 , 6239 , 7955 , 7227 , 4932 , 284812 , 28377 ,
18+ 9913 , 9615 , 9796 , 9685 , 9031 , 9544 , 13616 , 9258 ,
19+ 9598 , 10116 , 9823 , 8364 ),
1820 species = c(" Mus musculus" , " Homo sapiens" , " Caenorhabditis elegans" ,
1921 " Danio rerio" , " Drosophila melanogaster" ,
2022 " Saccharomyces cerevisiae" ,
21- " Schizosaccharomyces pombe 972h-" ),
23+ " Schizosaccharomyces pombe 972h-" ,
24+ " Anolis carolinensis" , " Bos taurus" ,
25+ " Canis lupus familiaris" , " Equus caballus" ,
26+ " Felis catus" , " Gallus gallus" ,
27+ " Macaca mulatta" , " Monodelphis domestica" ,
28+ " Ornithorhynchus anatinus" , " Pan troglodytes" ,
29+ " Rattus norvegicus" , " Sus scrofa" ,
30+ " Xenopus tropicalis" ),
2231 speciesCommon = c(" mouse" , " human" , " roundworm" , " zebrafish" ,
23- " fruitfly" , " baker's yeast" , " fission yeast" )
32+ " fruitfly" , " baker's yeast" , " fission yeast" ,
33+ " green anole" , " bovine" , " dog" , " horse" , " cat" ,
34+ " chicken" , " rhesus macaque" , " opossum" ,
35+ " platypus" , " chimpanzee" , " Norway rat" ,
36+ " pig" , " tropical clawed frog" )
2437 )
2538}
2639
@@ -44,6 +57,8 @@ getSupportedSpecies <- function() {
4457# ' getSpeciesInfo("mouse")
4558# ' getSpeciesInfo(6239)
4659# ' getSpeciesInfo("Homo sapiens")
60+ # ' ## unsupported species
61+ # ' getSpeciesInfo("E.coli")
4762# '
4863getSpeciesInfo <- function (species ) {
4964 stopifnot(length(species ) == 1 )
@@ -56,21 +71,26 @@ getSpeciesInfo <- function(species) {
5671 species_common <-
5772 taxTable $ speciesCommon [match(tolower(species ),
5873 tolower(taxTable $ speciesCommon ))]
74+ tax_id <- taxTable $ taxId [match(species_id , taxTable $ species )]
5975 } else if (tolower(species ) %in% tolower(taxTable $ species )) {
6076 species_id <- taxTable $ species [match(tolower(species ),
6177 tolower(taxTable $ species ))]
6278 species_common <-
6379 taxTable $ speciesCommon [match(tolower(species ),
6480 tolower(taxTable $ species ))]
81+ tax_id <- taxTable $ taxId [match(species_id , taxTable $ species )]
6582 } else if (species %in% taxTable $ taxId ) {
6683 species_id <- taxTable $ species [match(species ,
6784 taxTable $ taxId )]
6885 species_common <- taxTable $ speciesCommon [match(species ,
6986 taxTable $ taxId )]
87+ tax_id <- taxTable $ taxId [match(species_id , taxTable $ species )]
7088 } else {
71- stop(" Unknown species " , species )
89+ warning(" Unknown species " , species )
90+ species_id <- species
91+ species_common <- " "
92+ tax_id <- NA_real_
7293 }
73- tax_id <- taxTable $ taxId [match(species_id , taxTable $ species )]
7494
7595 list (species = species_id ,
7696 speciesCommon = species_common ,
0 commit comments