taxize/0000755000176200001440000000000013163021640011552 5ustar liggesuserstaxize/inst/0000755000176200001440000000000013162233432012532 5ustar liggesuserstaxize/inst/examples/0000755000176200001440000000000012672106003014346 5ustar liggesuserstaxize/inst/examples/species.txt0000644000176200001440000000033312672106003016541 0ustar liggesusersAchnatherum eminens Achnatherum inebrians Achnatherum lettermanii Achnatherum lobatum Achnatherum nelsonii Achnatherum pinetorum Achnatherum purpurascens Achnatherum robustum Achnatherum sibiricum Achnatherum speciosum taxize/inst/CITATION0000644000176200001440000000235112732140256013673 0ustar liggesuserscitHeader("To cite taxize in publications use at least the first, if not both:") citEntry(entry = "Article", title = "taxize - taxonomic search and retrieval in R", journal = "F1000Research", author = personList(person("Scott Chamberlain"), person("Eduard Szocs")), year = "2013", url = "http://f1000research.com/articles/2-191/v2", textVersion = paste("Scott Chamberlain and Eduard Szocs (2013).", "taxize - taxonomic search and retrieval in R.", "F1000Research, 2:191. URL: http://f1000research.com/articles/2-191/v2.") ) citEntry(entry = "Manual", title = "taxize: Taxonomic information from around the web", author = "Scott Chamberlain and Eduard Szocs and Carl Boettiger and Karthik Ram and Ignasi Bartomeus and John Baumgartner and Zachary Foster and James O'Donnell", year = "2016", note = "R package version 0.7.8", url = "https://github.com/ropensci/taxize", textVersion = paste("Scott Chamberlain, Eduard Szocs, Carl Boettiger, Karthik Ram, Ignasi Bartomeus, John Baumgartner, Zachary Foster, and James O'Donnell (2016) taxize: Taxonomic information from around the web. R package version 0.7.8. https://github.com/ropensci/taxize") ) taxize/inst/ignore/0000755000176200001440000000000013162233432014015 5ustar liggesuserstaxize/inst/ignore/rbladj.r0000644000176200001440000000613012672032225015440 0ustar liggesusers#' Run Phylocom's bladj from R #' #' @import ape #' @importFrom phytools read_newick #' @param tree (phylo/character) If left NULL, it is expected that you already have a #' phylo file with your newick tree in your directory with your phylocom executable #' @param ages (data.frame) If left NULL, it is expected that you already have an #' ages file with your node names and ages in your directory with your Phylocom executable #' @param path (character) Path to the folder with at least the Phylocom executable #' @param fixroot (logical) If TRUE root name is changed to the oldest root in your ages file. #' If FALSE (default), #' @export #' @examples \donttest{ #' taxa <- names_list("species", 15) #' tree <- phylomatic_tree(taxa=taxa, get = 'POST') #' # set path to where your dir is with phylocom executable, and optionally phylo #' # and/or ages files #' path = "path to phylocom executable directory" #' g <- rbladj(tree, path=path, fixroot=TRUE) #' g$edge.length #' plot(g) #' } rbladj <- function(tree=NULL, ages=NULL, path=NULL, fixroot=FALSE) { #download phylocom download.file("http://phylodiversity.net/phylocom/phylocom-4.2.zip") #set path if(!is.null(path)){ setwd(path) } else { stop("You must provide a path to where phylocom executable is stored on your machine") } #phylo if(!is.null(tree)){ if(any(class(tree) == "character")){ tree <- read_newick(file=paste(path,"phylo",sep="")) } else if(any(class(tree) == "phylo")) { tree <- tree } else { stop("need newick tree as text string or phylo object") } setwd(path) write.tree(tree, "phylo") } #ages if(is.null(ages)){ tmp <- tryCatch(read.table(paste(path, "ages", sep="")), error = function(e) e) if(any(class(tmp) == "error")){ stop("You must provide an ages data.frame or a path to the ages file") } } else { if(is(ages, "data.frame")){ write.table(ages, file = paste(path,"ages",sep=""), sep = "\t", col.names = FALSE, row.names = FALSE, quote = FALSE) } else { stop("ages, it not a path, must be a data.frame with two columns, node name, and node age") } } # check if root node in phylogeny is in the ages file if(is.null(tree)){ tree <- read_newick(file=paste(path,"phylo",sep="")) } if(is.null(ages)){ ages <- read.table(paste(path, "ages", sep="")) names(ages) <- c("names","ages") } rootnode <- as.character(tree$node.label[1]) if(!rootnode %in% as.character(ages[,1])){ if(fixroot){ ages_sorted <- sort_df(ages, "ages") newroot <- as.character(ages_sorted[nrow(ages_sorted),1]) tree <- read.tree(text=sub(rootnode, newroot, write.tree(tree))) setwd(path) write.tree(tree, "phylo") } else { stop("Your root node in your phylogeny must be in your ages file - names must match exactly") } } #bladj if(.Platform$OS.type != "unix"){ setwd(path) shell("phylocom bladj > phyloout.txt") } else { setwd(path) system("./phylocom bladj > phyloout.txt") } #read tree back in tr <- read_newick(paste(path, "phyloout.txt", sep="")) return( tr ) }taxize/inst/ignore/taxonclass2.R0000644000176200001440000001346012672032225016407 0ustar liggesusers(out <- make_taxon(genus="Poa", epithet="annua", authority="L.")) (out <- make_taxon(genus="Poa", epithet="annua", authority="L.", family='Poaceae', clazz='Poales', kingdom='Plantae', variety='annua')) (out <- make_taxon(genus="Poa")) make_taxon(epithet="annua") # errors out@binomial out@binomial@canonical out@binomial@species out@binomial@authority out@classification out@classification@family out[['family']] # get a single rank out['family','kingdom'] # get a range of ranks out['variety','genus'] # get a range of ranks gethier(out) # get hierarchy as data.frame df <- data.frame(rank=c('family','tribe','subtribe','genus','subgenus','species'), name=c('Helianthi','Helianthi','Helianthi','Poa','Festuci','Poa annua'), id=c(1,2,3,4,5,6), stringsAsFactors = FALSE) apply(df, 1, make_taxon_fromclass) make_taxon_fromclass <- function(x, authority="none", ...){ rank <- x[['rank']] name <- x[['name']] id <- as.numeric(x[['id']]) res <- list(new("taxonref", rank=rank, name=name, id=id)) names(res) <- rank res[1] } # species <- x[ x$rank %in% 'species', 'name'] # epithet <- strsplit(species, " ")[[1]][[2]] # res <- new("binomial", # genus=genus, # epithet=epithet, # canonical=paste(genus,epithet,collapse=" "), # species=paste(genus,epithet,authority,collapse=" "), # authority=authority) # hier <- new("classification", # genus=new("taxonref", name=genus), # species=new("taxonref", name=paste(genus,epithet,collapse=" "))) # if(length(input) > 0){ # output <- list() # for(i in seq_along(input)){ # slot(hier, names(input)[i]) <- new("taxonref", name=input[[i]]) # } # } # new("taxon", binomial=res, classification=hier) # } make_taxon <- function(genus="none", epithet="none", authority="none", ...){ if(genus=='none') stop("You must supply at least genus") res <- new("binomial", genus=genus, epithet=epithet, canonical=paste(genus,epithet,collapse=" "), species=paste(genus,epithet,authority,collapse=" "), authority=authority) input <- list(...) hier <- new("classification", genus=new("taxonref", name=genus), species=new("taxonref", name=paste(genus,epithet,collapse=" "))) if(length(input) > 0){ output <- list() for(i in seq_along(input)){ slot(hier, names(input)[i]) <- new("taxonref", name=input[[i]]) } } new("taxon", binomial=res, classification=hier) } setClass("binomial", slots = c(genus="character", epithet="character", canonical="character", species="character", authority="character")) setClass("taxonref", slots = c(rank='character', name='character', id='numeric', source='character'), prototype = prototype(rank='none', name='none', id=NaN, source='none')) setClass("ListOfTaxonRefs", slots = c(names="character"), contains="list") setAs("character", "taxonref", function(from) new("taxonref", name=from)) # setMethod("combinetaxonref", "ListOfTaxonRefs", function(...){ # input <- list(...) # assert_that(all(sapply(input, is, "ListOfTaxonRefs"))) # # }) # new("ListOfTaxonRefs", lapply(list(kingdom="adfa", family="adf"), as, "taxonref")) setClass("classification", slots = c( kingdom="taxonref", subkingdom="taxonref", infrakingdom="taxonref", division="taxonref", phylum="taxonref", subdivision="taxonref", infradavision="taxonref", superclass="taxonref", clazz="taxonref", subclass="taxonref", infraclass="taxonref", superorder="taxonref", order="taxonref", suborder="taxonref", infraorder="taxonref", superfamily="taxonref", family="taxonref", subfamily="taxonref", tribe="taxonref", subtribe="taxonref", genus="taxonref", subgenus="taxonref", section="taxonref", subsection="taxonref", species="taxonref", subspecies="taxonref", variety="taxonref", race="taxonref", subvariety="taxonref", stirp="taxonref", morph="taxonref", form="taxonref", aberration="taxonref", subform="taxonref", unspecified="taxonref" ), contains = "list") # , contains = "list") setClass("taxon", slots = c(binomial = 'binomial', classification = 'classification')) setClass("ListOfTaxa", slots = c(taxon = 'taxon'), prototype = prototype(list()), contains = 'list') # # new('ListOfTaxa', taxon=out) # out2 <- list(make_taxon(genus="Poa", epithet="annua", authority="L."), # make_taxon(genus="Helianthus", epithet="annuus", authority="Baker")) # gg <- new('ListOfTaxa', lapply(out2, as, "taxon")) # class(gg) # length(gg@.Data) setMethod("[[", "taxon", function(x, i, ...){ tmp <- x@classification slot(tmp, i)@name }) setMethod("[", "taxon", function(x, i, j, ...){ tmp <- x@classification nn <- slotNames(tmp) from <- match(j, nn) to <- match(i, nn) vapply(nn[to:from], function(g) slot(tmp, g)@name, "") }) setGeneric("gethier", function(x) standardGeneric("gethier")) setMethod("gethier", "taxon", function(x){ tmp <- x@classification nn <- slotNames(tmp)[-1] vals <- vapply(nn, function(g) slot(tmp, g)@name, "", USE.NAMES = FALSE) data.frame(rank=nn, value=vals, stringsAsFactors = FALSE) }) #### # subset data.frame using taxonomy df <- data.frame(family=c('Asteraceae','Asteraceae','Asteraceae','Poaceae','Poaceae','Poaceae'), tribe=c('Helianthi','Helianthi','Helianthi','Poaeae','Festuci','Poaeae'), genus=c('Helianthus','Helianthus','Madia','Poa','Festuca','Holodiscus'), stringsAsFactors = FALSE) df_tax <- new('taxonDataFrame', data=df) df_tax['family','Asteraceae'] df_tax['genus','Madia'] df_tax['tribe','Helianthi'] setClass("taxonDataFrame", slots = c(data = 'data.frame')) setMethod("[", "taxonDataFrame", function(x, i, j, ...){ tmp <- x@data tmp[ tmp[[i]] %in% j, ] })taxize/inst/ignore/tests/0000755000176200001440000000000012672032225015161 5ustar liggesuserstaxize/inst/ignore/tests/test-ubio_id.R0000644000176200001440000000104612672032225017674 0ustar liggesusers# tests for ubio_id fxn in taxize context("ubio_id") out <- ubio_id(namebankID = 2483153) test_that("ubio_id returns the correct dimensions", { expect_that(length(out), equals(5)) expect_that(dim(out$data), equals(c(1,8))) expect_that(dim(out$synonyms), equals(c(7,3))) expect_that(dim(out$vernaculars), equals(c(27,5))) expect_that(dim(out$cites), equals(c(7,4))) }) test_that("ubio_id returns the correct class", { expect_that(out, is_a("list")) expect_that(out$synonyms, is_a("data.frame")) expect_that(out$cites, is_a("data.frame")) })taxize/inst/ignore/tests/test-ubio_namebank.R0000644000176200001440000000065612672032225021062 0ustar liggesusers# tests for ubio_namebank fxn in taxize context("ubio_namebank") out <- ubio_search(searchName = 'elephant', sci = 1, vern = 0) test_that("ubio_namebank returns the correct value", { expect_that(out$scientific[ , 1], matches("6938660")) }) test_that("ubio_namebank returns the correct class", { expect_that(out, is_a("list")) expect_that(out$scientific, is_a("data.frame")) expect_that(ncol(out$scientific), equals(8)) }) taxize/inst/ignore/tests/test-ubio_synonyms.R0000644000176200001440000000046312672032225021201 0ustar liggesusers# tests for ubio_synonyms fxn in taxize context("ubio_synonyms") out <- ubio_synonyms(hierarchiesID = 4091702) test_that("ubio_synonyms returns the correct value", { expect_that(dim(out), equals(c(1,9))) }) test_that("ubio_synonyms returns the correct class", { expect_that(out, is_a("data.frame")) })taxize/inst/ignore/tests/test-ubio_classification.R0000644000176200001440000000111112672032225022264 0ustar liggesusers# tests for ubio_classification fxn in taxize context("ubio_classification") out <- ubio_classification(hierarchiesID = 2483153) test_that("ubio_classification returns the correct value", { expect_that(names(out)[1], matches("data")) expect_that(as.character(out$data[,1]), matches("84")) }) test_that("ubio_classification returns the correct dimensions", { expect_that(ncol(out$data), equals(8)) expect_that(length(out), equals(5)) }) test_that("ubio_classification returns the correct class", { expect_that(out$data, is_a("data.frame")) expect_that(out, is_a("list")) }) taxize/inst/ignore/tests/test-ubio_search.R0000644000176200001440000000071512672032225020547 0ustar liggesusers# tests for ubio_search fxn in taxize context("ubio_search") out <- ubio_search(searchName = 'elephant', sci = 1, vern = 0) test_that("ubio_search returns the correct dimensions", { expect_that(dim(out$scientific), equals(c(1,8))) }) test_that("ubio_search returns the correct class", { expect_that(out$scientific, is_a("data.frame")) expect_that(out$scientific$basionymunit, is_a("character")) expect_that(out$scientific$rankname, is_a("character")) }) taxize/inst/ignore/phylomatic_tree2.R0000644000176200001440000000551712672032225017424 0ustar liggesusers#' Format tree string, submit to Phylomatic, get newick or nexml tree. #' #' Newer input format to the API, doesn't work that well. Do use phylomatic_tree() #' #' @import httr ape #' @param taxa Phylomatic format input of taxa names. #' @param get 'GET' or 'POST' format for submission to the website. #' @param informat One of newick, nexml, or cdaordf. If using a stored tree, #' informat should always be newick. #' @param method One of phylomatic or convert #' @param storedtree One of R20120829 (Phylomatic tree R20120829 for plants), #' smith2011 (Smith 2011, plants), or binindaemonds2007 (Bininda-Emonds 2007, #' mammals). #' @param outformat One of newick, nexml, or fyt. #' @param clean Return a clean tree or not. #' @details Use the web interface here http://phylodiversity.net/phylomatic/ #' @return Newick formatted tree, or nexml xml object. #' @noRd #' @examples \donttest{ #' # Input taxonomic names #' taxa <- c("Collomia grandiflora", "Lilium lankongense", "Helianthus annuus") #' tree <- phylomatic_tree2(taxa=taxa, get = 'POST', informat='newick', #' method = "phylomatic", storedtree = "smith2011", #' outformat = "newick", clean = "true") #' plot(tree) #' #' # Lots of names #' taxa <- c("Collomia grandiflora", "Lilium lankongense", "Phlox diffusa", #' "Iteadaphne caudata", "Nicotiana tomentosa", "Gagea sarmentosa") #' tree <- phylomatic_tree2(taxa=taxa, get = 'POST', informat='newick', #' method = "phylomatic", storedtree = "smith2011", #' outformat = "newick", clean = "true") #' plot(tree) #' #' # Output NeXML format #' taxa <- c("Gonocarpus leptothecus", "Gonocarpus leptothecus", "Impatiens davidis") #' out <- phylomatic_tree2(taxa=taxa, get = 'POST', informat='newick', method = "phylomatic", #' storedtree = "smith2011", outformat = "nexml", clean = "true") #' library(RNeXML) #' read.nexml(out, type="nexml", asText=TRUE) #' } phylomatic_tree2 <- function(taxa, get = 'GET', informat = "newick", method = "phylomatic", storedtree = "smith2011", outformat = "newick", clean = "true") { url <- "http://phylodiversity.net/phylomatic/pmws" taxa <- sapply(taxa, function(x) gsub("\\s", "_", x), USE.NAMES=FALSE) if (length(taxa) > 1) { taxa <- paste(taxa, collapse = "\n") } else { taxa <- taxa } args <- compact(list(taxa = taxa, informat = informat, method = method, storedtree = storedtree, outformat = outformat, clean = clean)) get <- match.arg(get, choices=c("GET",'POST')) out <- eval(parse(text=get))(url, query=args) stop_for_status(out) tt <- content(out, as="text") outformat <- match.arg(outformat, choices=c("nexml",'newick')) getnewick <- function(x){ tree <- gsub("\n", "", x[[1]]) read.tree(text = colldouble(tree)) } switch(outformat, nexml = tt, newick = getnewick(tt)) }taxize/inst/ignore/taxonclass.R0000644000176200001440000000770212672032225016327 0ustar liggesusersout <- make_taxon(genus="Poa", epithet="annua", authority="L.") out <- make_taxon(genus="Poa", epithet="annua", authority="L.", family='Poaceae', clazz='Poales', kingdom='Plantae', variety='annua') out@binomial out@binomial@canonical out@binomial@species out@binomial@authority out@classification out@classification@family out[['family']] # get a single rank out['family','kingdom'] # get a range of ranks out['variety','genus'] gethier(out) # get hierarchy as data.frame make_taxon <- function(genus, epithet, authority, ...){ res <- new("binomial", genus=genus, epithet=epithet, canonical=paste(genus,epithet,collapse=" "), species=paste(genus,epithet,authority,collapse=" "), authority=authority) hier <- new("classification", genus=genus, species=paste(genus,epithet,collapse=" "), ...) new("taxon", binomial=res, classification=hier) } setClass("binomial", slots = c(genus="character", epithet="character", canonical="character", species="character", authority="character")) setClass("classification", slots = c( superkingdom="character", kingdom="character", subkingdom="character", infrakingdom="character", division="character", phylum="character", subdivision="character", infradavision="character", superclass="character", clazz="character", subclass="character", infraclass="character", superorder="character", order="character", suborder="character", infraorder="character", superfamily="character", family="character", subfamily="character", tribe="character", subtribe="character", genus="character", subgenus="character", section="character", subsection="character", species="character", subspecies="character", variety="character", race="character", subvariety="character", stirp="character", morph="character", form="character", aberration="character", subform="character", unspecified="character" ), prototype = prototype(superkingdom="", kingdom="", subkingdom="", infrakingdom="", division="", phylum="", subdivision="", infradavision="", superclass="", clazz="", subclass="", infraclass="", superorder="", order="", suborder="", infraorder="", superfamily="", family="", subfamily="", tribe="", subtribe="", genus="", subgenus="", section="", subsection="", species="", subspecies="", variety="", race="", subvariety="", stirp="", morph="", form="", aberration="", subform="", unspecified="")) setClass("taxon", slots = c(binomial = 'binomial', classification = 'classification')) # setClass("taxon", contains = c("binomial","classification")) setMethod("[[", "taxon", function(x, i, ...){ tmp <- x@classification slot(tmp, i) }) setMethod("[", "taxon", function(x, i, j, ...){ tmp <- x@classification nn <- slotNames(tmp) from <- match(j, nn) to <- match(i, nn) vapply(nn[to:from], function(g) slot(tmp, g), "") }) setGeneric("gethier", function(x) standardGeneric("gethier")) setMethod("gethier", "taxon", function(x){ tmp <- x@classification nn <- slotNames(tmp) vals <- vapply(nn, function(g) slot(tmp, g), "", USE.NAMES = FALSE) data.frame(rank=nn, value=vals, stringsAsFactors = FALSE) })taxize/inst/ignore/nature_serve.R0000644000176200001440000000421712765031340016650 0ustar liggesusers#' NatureServe #' #' @export #' @param x (character) A name to query. Required. #' @param key (character) API key. Required. #' @param ... Curl options passed on to \code{\link[httr]{GET}} #' @references \url{https://services.natureserve.org/index.jsp} #' @return A data.frame, with columns: #' \itemize{ #' \item sciname - Scientfic name #' \item comname - Common name #' \item uid - UID - the taxonomic identifier NatureServe uses #' \item uri - URL to get to info online for the taxon #' \item taxcomment - comments about the taxon, if any #' } #' @examples \dontrun{ #' head(ns_search("Ruby*")) #' ns_search("Helianthus annuus") #' #' ns_data(uid = 'ELEMENT_GLOBAL.2.100925') #' } ns_search <- function(x, key = "72ddf45a-c751-44c7-9bca-8db3b4513347", ...) { x <- GET(paste0(ns_base(), '/v1/globalSpecies/list/nameSearch'), query = list(name = x, NSAccessKeyId = key)) stop_for_status(x) xml <- xml2::read_xml(content(x, "text")) kids <- xml2::xml_children(xml2::xml_children(xml)[[2]]) dat <- lapply(kids, function(z) { data.frame(sapply(xml_children(z), function(x) { as.list(setNames(xml_text(x), xml_name(x))) }), stringsAsFactors = FALSE) }) df <- setNames(rbind.fill(dat), c('uid', 'uri', 'sciname', 'comname', 'taxcomment')) df <- move_col2(df, "uid") df <- move_col2(df, "uri") move_col2(df, "taxcomment") } #' @export #' @rdname nature_serve ns_data <- function(uid, key = "72ddf45a-c751-44c7-9bca-8db3b4513347", ...) { x <- GET(paste0(ns_base(), '/v1.1/globalSpecies/comprehensive'), query = list(uid = uid, NSAccessKeyId = key)) stop_for_status(x) xml <- xml2::read_xml(content(x, "text")) kids <- xml2::xml_children(xml2::xml_children(xml)[[1]]) dat <- lapply(kids, function(z) { data.frame(sapply(xml_children(z), function(x) { as.list(setNames(xml_text(x), xml_name(x))) }), stringsAsFactors = FALSE) }) df <- setNames(rbind.fill(dat), c('uid', 'uri', 'sciname', 'comname', 'taxcomment')) df <- move_col2(df, "uid") df <- move_col2(df, "uri") move_col2(df, "taxcomment") } ns_base <- function() 'https://services.natureserve.org/idd/rest/ns' taxize/inst/ignore/try_with_timeout.R0000644000176200001440000000146112672032225017563 0ustar liggesusers#' Function to allow user to set timeout on a function call. #' #' This is separate from the curl timeout.ms parameter #' #' @importFrom R.utils evalWithTimeout #' @param test_fn The function call to test #' @param tlimit = 120 A timeout in seconds #' @param defaultvalue Default value #' @return If in a loop, passes on to next thing, or if not, then gives back message #' @examples \donttest{ #' library("taxize") #' try_with_timeout(eol_search('Salix')) #' try_with_timeout(eol_search('Salix'), tlimit=10) #' } try_with_timeout <- function(test_fn, tlimit = 30, defaultvalue = "TimedOut") { results <- tryCatch(expr = evalWithTimeout(test_fn, timeout = tlimit), TimeoutException = function(ex) defaultvalue) if(is(results, "TimedOut")){ return( defaultvalue ) } else { results } } taxize/inst/ignore/aou_notes.R0000644000176200001440000000074012672032225016137 0ustar liggesusers# from http://www.birdpop.org/alphacodes.htm download.file("http://www.birdpop.org/DownloadDocuments/LIST14.zip", destfile = "~/LIST14.zip") unzip("~/LIST14.zip", exdir = "~/") library(foreign) res <- foreign::read.dbf("~/LIST14.DBF", as.is = TRUE) head(res) # checklist from http://checklist.aou.org/taxa/ chklst <- read.csv('http://checklist.aou.org/taxa.csv', header = TRUE, sep = ",", stringsAsFactors = FALSE) head(chklst) pryr::object_size(res) pryr::object_size(chklst) taxize/inst/ignore/taxonid.R0000644000176200001440000000372412672106003015612 0ustar liggesuserslibrary('R6') MultiTaxonId <- R6Class( "MultiTaxonId", #inherit = TaxonId, public = list( ids = NA, print = function() { cat(paste0(" ", paste0(self$fetch_ids(), collapse = ", ")), sep = "") invisible(self) }, get_ids = function(x) { tmp <- unclass(get_uid(x)) taxa <- list() for (i in seq_along(tmp)) { taxa[[i]] <- TaxonId$new(tmp[i], x[i], attr(tmp, "uri")[i], attr(tmp, "match")[i]) } self$ids <- taxa }, fetch_uris = function() { res <- c() for (i in seq_along(self$ids)) res[i] <- self$ids[[i]]$uri return(res) }, fetch_matches = function() { res <- c() for (i in seq_along(self$ids)) res[i] <- self$ids[[i]]$match return(res) }, fetch_taxa = function() { res <- c() for (i in seq_along(self$ids)) res[i] <- self$ids[[i]]$taxa return(res) }, fetch_ids = function() { res <- c() for (i in seq_along(self$ids)) res[i] <- self$ids[[i]]$id return(res) } ) ) TaxonId <- R6Class( "TaxonId", public = list( id = NA, taxa = NA, uri = NA, match = NA, initialize = function(id, taxa, uri, match) { if (!missing(id)) self$id <- id if (!missing(taxa)) self$taxa <- taxa if (!missing(uri)) self$uri <- uri if (!missing(match)) self$match <- match }, print = function() { cat(paste0(" ", self$id), "\n") cat(paste0(" taxon: ", self$taxa), "\n") cat(paste0(" match: ", self$match), "\n") cat(paste0(" uri: ", self$uri), "\n") invisible(self) } ) ) `[.MultiTaxonId` <- function(x, i) { x$ids[i] } `[[.MultiTaxonId` <- function(x, i) { x$ids[[i]] } `[.TaxonId` <- function(x, i) { x$id[i] } x <- MultiTaxonId$new() x$get_ids(c("Chironomus riparius", "Quercus douglasii", "Poa annua")) x x$ids x$fetch_ids() x$fetch_uris() x$fetch_matches() x$fetch_taxa() # subset x$ids[[1]] x$ids[3] x$ids[[3]] x$ids[2:3] taxize/inst/ignore/phytools_fxns_touse.r0000644000176200001440000000776412672032225020356 0ustar liggesusers#' read newick files, copied directly from phytools #' @param file file path #' @param text text string #' @export #' @keywords internal read_newick <- function (file = "", text) { if (file != "") text <- scan(file, sep = "\n", what = "character") if (length(text) > 1) { tree <- lapply(text, newick) class(tree) <- "multiPhylo" } else tree <- newick(text) return(tree) } #' Newick function required by read_newick #' @param text input text #' @export #' @keywords internal newick <- function (text) { text <- unlist(strsplit(text, NULL)) tip.label <- vector(mode = "character") node.label <- vector(mode = "character") edge <- matrix(c(1, NA), 1, 2) edge.length <- vector() currnode <- 1 Nnode <- currnode i <- j <- k <- 1 while (text[i] != ";") { if (text[i] == "(") { if (j > nrow(edge)) edge <- rbind(edge, c(NA, NA)) edge[j, 1] <- currnode i <- i + 1 if (is.na(match(text[i], c("(", ")", ",", ":", ";")))) { temp <- get_label(text, i) tip.label[k] <- temp$label i <- temp$end edge[j, 2] <- -k k <- k + 1 if (text[i] == ":") { temp <- getEdgeLength(text, i) edge.length[j] <- temp$edge.length i <- temp$end } } else if (text[i] == "(") { Nnode <- Nnode + 1 currnode <- Nnode edge[j, 2] <- currnode } j <- j + 1 } else if (text[i] == ")") { i <- i + 1 if (is.na(match(text[i], c("(", ")", ",", ":", ";")))) { temp <- get_label(text, i) node.label[currnode] <- temp$label i <- temp$end } if (text[i] == ":") { temp <- getEdgeLength(text, i) if (currnode > 1) { ii <- match(currnode, edge[, 2]) edge.length[ii] <- temp$edge.length } else root.edge <- temp$edge.length i <- temp$end } if (currnode > 1) currnode <- edge[match(currnode, edge[, 2]), 1] } else if (text[i] == ",") { if (j > nrow(edge)) edge <- rbind(edge, c(NA, NA)) edge[j, 1] <- currnode i <- i + 1 if (is.na(match(text[i], c("(", ")", ",", ":", ";")))) { temp <- get_label(text, i) tip.label[k] <- temp$label i <- temp$end edge[j, 2] <- -k k <- k + 1 if (text[i] == ":") { temp <- getEdgeLength(text, i) edge.length[j] <- temp$edge.length i <- temp$end } } else if (text[i] == "(") { Nnode <- Nnode + 1 currnode <- Nnode edge[j, 2] <- currnode } j <- j + 1 } } Ntip <- k - 1 edge[edge > 0] <- edge[edge > 0] + Ntip edge[edge < 0] <- -edge[edge < 0] edge.length[is.na(edge.length)] <- 0 if (length(edge.length) == 0) edge.length <- NULL node.label[is.na(node.label)] <- "" if (length(node.label) == 0) node.label <- NULL tree <- list(edge = edge, Nnode = as.integer(Nnode), tip.label = tip.label, edge.length = edge.length, node.label = node.label) class(tree) <- "phylo" return(tree) } #' get label function from phytools #' @param text input text #' @param start start at #' @export #' @keywords internal get_label <- function (text, start) { i <- 0 label <- vector() while (is.na(match(text[i + start], c(",", ":", ")")))) { label[i + 1] <- text[i + start] i <- i + 1 } return(list(label = paste(label, collapse = ""), end = i + start)) }taxize/inst/doc/0000755000176200001440000000000013162233431013276 5ustar liggesuserstaxize/inst/doc/taxize_vignette.html0000644000176200001440000015637513162233431017416 0ustar liggesusers taxize vignette - a taxonomic toolbelt for R

taxize vignette - a taxonomic toolbelt for R

taxize is a taxonomic toolbelt for R. taxize wraps APIs for a large suite of taxonomic databases availab on the web.

Installation

First, install and load taxize into the R session.

install.packages("taxize")
library("taxize")

Advanced users can also download and install the latest development copy from GitHub.

Resolve taxonomic name

This is a common task in biology. We often have a list of species names and we want to know a) if we have the most up to date names, b) if our names are spelled correctly, and c) the scientific name for a common name. One way to resolve names is via the Global Names Resolver (GNR) service provided by the Encyclopedia of Life. Here, we are searching for two misspelled names:

temp <- gnr_resolve(names = c("Helianthos annus", "Homo saapiens"))
head(temp)
#>   user_supplied_name   submitted_name         matched_name
#> 1   Helianthos annus Helianthos annus     Helianthus annus
#> 2   Helianthos annus Helianthos annus  Helianthus annus L.
#> 3   Helianthos annus Helianthos annus     Helianthus annus
#> 4   Helianthos annus Helianthos annus     Helianthus annus
#> 5   Helianthos annus Helianthos annus Helianthus annuus L.
#> 6   Helianthos annus Helianthos annus Helianthus annuus L.
#>                      data_source_title score
#> 1                                  EOL  0.75
#> 2                                  EOL  0.75
#> 3                        uBio NameBank  0.75
#> 4 Open Tree of Life Reference Taxonomy  0.75
#> 5                    Catalogue of Life  0.75
#> 6                                 ITIS  0.75

The correct spellings are Helianthus annuus and Homo sapiens. Another approach uses the Taxonomic Name Resolution Service via the Taxosaurus API developed by iPLant and the Phylotastic organization. In this example, we provide a list of species names, some of which are misspelled, and we'll call the API with the tnrs function.

mynames <- c("Helianthus annuus", "Pinus contort", "Poa anua", "Abis magnifica",
    "Rosa california", "Festuca arundinace", "Sorbus occidentalos","Madia sateva")
tnrs(query = mynames, source = "iPlant_TNRS")[ , -c(5:7)]
#>         submittedname        acceptedname    sourceid score
#> 1 Sorbus occidentalos Sorbus occidentalis iPlant_TNRS  0.99
#> 2  Festuca arundinace Festuca arundinacea iPlant_TNRS  0.99
#> 3      Abis magnifica     Abies magnifica iPlant_TNRS  0.96
#> 4       Pinus contort      Pinus contorta iPlant_TNRS  0.98
#> 5            Poa anua           Poa annua iPlant_TNRS  0.96
#> 6        Madia sateva        Madia sativa iPlant_TNRS  0.97
#> 7   Helianthus annuus   Helianthus annuus iPlant_TNRS     1
#> 8     Rosa california    Rosa californica iPlant_TNRS  0.99

It turns out there are a few corrections: e.g., Madia sateva should be Madia sativa, and Rosa california should be Rosa californica. Note that this search worked because fuzzy matching was employed to retrieve names that were close, but not exact matches. Fuzzy matching is only available for plants in the TNRS service, so we advise using EOL's Global Names Resolver if you need to resolve animal names.

taxize takes the approach that the user should be able to make decisions about what resource to trust, rather than making the decision. Both the EOL GNR and the TNRS services provide data from a variety of data sources. The user may trust a specific data source, thus may want to use the names from that data source. In the future, we may provide the ability for taxize to suggest the best match from a variety of sources.

Another common use case is when there are many synonyms for a species. In this example, we have three synonyms of the currently accepted name for a species.

mynames <- c("Helianthus annuus ssp. jaegeri", "Helianthus annuus ssp. lenticularis", "Helianthus annuus ssp. texanus")
(tsn <- get_tsn(mynames, accepted = FALSE))
[1] "525928" "525929" "525930"
attr(,"match")
[1] "found" "found" "found"
attr(,"multiple_matches")
[1] FALSE FALSE FALSE
attr(,"pattern_match")
[1] FALSE FALSE FALSE
attr(,"uri")
[1] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=525928"
[2] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=525929"
[3] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=525930"
attr(,"class")
[1] "tsn"
lapply(tsn, itis_acceptname)
[[1]]
  submittedtsn      acceptedname acceptedtsn author
1       525928 Helianthus annuus       36616     L.

[[2]]
  submittedtsn      acceptedname acceptedtsn author
1       525929 Helianthus annuus       36616     L.

[[3]]
  submittedtsn      acceptedname acceptedtsn author
1       525930 Helianthus annuus       36616     L.

Retrieve higher taxonomic names

Another task biologists often face is getting higher taxonomic names for a taxa list. Having the higher taxonomy allows you to put into context the relationships of your species list. For example, you may find out that species A and species B are in Family C, which may lead to some interesting insight, as opposed to not knowing that Species A and B are closely related. This also makes it easy to aggregate/standardize data to a specific taxonomic level (e.g., family level) or to match data to other databases with different taxonomic resolution (e.g., trait databases).

A number of data sources in taxize provide the capability to retrieve higher taxonomic names, but we will highlight two of the more useful ones: Integrated Taxonomic Information System (ITIS) and National Center for Biotechnology Information (NCBI). First, we'll search for two species, Abies procera} and *Pinus contorta within ITIS.

specieslist <- c("Abies procera","Pinus contorta")
classification(specieslist, db = 'itis')
#> $`Abies procera`
#>               name          rank     id
#> 1          Plantae       kingdom 202422
#> 2    Viridiplantae    subkingdom 954898
#> 3     Streptophyta  infrakingdom 846494
#> 4      Embryophyta superdivision 954900
#> 5     Tracheophyta      division 846496
#> 6  Spermatophytina   subdivision 846504
#> 7        Pinopsida         class 500009
#> 8          Pinidae      subclass 954916
#> 9          Pinales         order 500028
#> 10        Pinaceae        family  18030
#> 11           Abies         genus  18031
#> 12   Abies procera       species 181835
#> 
#> $`Pinus contorta`
#>               name          rank     id
#> 1          Plantae       kingdom 202422
#> 2    Viridiplantae    subkingdom 954898
#> 3     Streptophyta  infrakingdom 846494
#> 4      Embryophyta superdivision 954900
#> 5     Tracheophyta      division 846496
#> 6  Spermatophytina   subdivision 846504
#> 7        Pinopsida         class 500009
#> 8          Pinidae      subclass 954916
#> 9          Pinales         order 500028
#> 10        Pinaceae        family  18030
#> 11           Pinus         genus  18035
#> 12  Pinus contorta       species 183327
#> 
#> attr(,"class")
#> [1] "classification"
#> attr(,"db")
#> [1] "itis"

It turns out both species are in the family Pinaceae. You can also get this type of information from the NCBI by doing classification(specieslist, db = 'ncbi').

Instead of a full classification, you may only want a single name, say a family name for your species of interest. The function *tax_name} is built just for this purpose. As with the classification function you can specify the data source with the db argument, either ITIS or NCBI.

tax_name(query = "Helianthus annuus", get = "family", db = "ncbi")
#>     db             query     family
#> 1 ncbi Helianthus annuus Asteraceae

I may happen that a data source does not provide information on the queried species, than one could take the result from another source and union the results from the different sources.

Interactive name selection

As mentioned most databases use a numeric code to reference a species. A general workflow in taxize is: Retrieve Code for the queried species and then use this code to query more data/information.

Below are a few examples. When you run these examples in R, you are presented with a command prompt asking for the row that contains the name you would like back; that output is not printed below for brevity. In this example, the search term has many matches. The function returns a data frame of the matches, and asks for the user to input what row number to accept.

get_uid(sciname = "Pinus")
#>   status     rank    division scientificname commonname    uid genus
#> 1 active subgenus seed plants          Pinus hard pines 139271      
#> 2 active    genus seed plants          Pinus              3337      
#>   species subsp modificationdate
#> 1               2015/09/16 00:00
#> 2               2004/09/10 00:00
#> [1] "139271"
#> attr(,"class")
#> [1] "uid"
#> attr(,"match")
#> [1] "found"
#> attr(,"multiple_matches")
#> [1] TRUE
#> attr(,"pattern_match")
#> [1] FALSE
#> attr(,"uri")
#> [1] "https://www.ncbi.nlm.nih.gov/taxonomy/139271"

In another example, you can pass in a long character vector of taxonomic names (although this one is rather short for demo purposes):

splist <- c("annona cherimola", 'annona muricata', "quercus robur")
get_tsn(searchterm = splist, searchtype = "scientific")
#> [1] "506198" "18098"  "19405" 
#> attr(,"match")
#> [1] "found" "found" "found"
#> attr(,"multiple_matches")
#> [1] FALSE FALSE  TRUE
#> attr(,"pattern_match")
#> [1] FALSE FALSE  TRUE
#> attr(,"uri")
#> [1] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=506198"
#> [2] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=18098" 
#> [3] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=19405" 
#> attr(,"class")
#> [1] "tsn"

There are functions for many other sources

Sometimes with these functions you get a lot of data back. In these cases you may want to limit your choices. Soon we will incorporate the ability to filter using regex to limit matches, but for now, we have a new parameter, rows, which lets you select certain rows. For example, you can select the first row of each given name, which means there is no interactive component:

get_nbnid(c("Zootoca vivipara","Pinus contorta"), rows = 1)
#> [1] "NHMSYS0001706186" "NBNSYS0000004786"
#> attr(,"class")
#> [1] "nbnid"
#> attr(,"match")
#> [1] "found" "found"
#> attr(,"multiple_matches")
#> [1] TRUE TRUE
#> attr(,"pattern_match")
#> [1] FALSE FALSE
#> attr(,"uri")
#> [1] "https://data.nbn.org.uk/Taxa/NHMSYS0001706186"
#> [2] "https://data.nbn.org.uk/Taxa/NBNSYS0000004786"

Or you can select a range of rows

get_nbnid(c("Zootoca vivipara","Pinus contorta"), rows = 1:3)
#>              nbnid                    scientificName       rank
#> 1 NHMSYS0001706186                  Zootoca vivipara    species
#> 2 NHMSYS0020784960 Zootoca vivipara subsp. pannonica subspecies
#> 3 NHMSYS0000461615                 Bistorta vivipara    species
#>   taxonomicStatus
#> 1        accepted
#> 2        accepted
#> 3         synonym
#>              nbnid                  scientificName       rank
#> 1 NBNSYS0000004786                  Pinus contorta    species
#> 2 NHMSYS0000494848  Pinus contorta subsp. contorta subspecies
#> 3 NHMSYS0000494858 Pinus contorta subsp. murreyana subspecies
#>   taxonomicStatus
#> 1        accepted
#> 2         synonym
#> 3         synonym
#> [1] "NHMSYS0001706186" "NBNSYS0000004786"
#> attr(,"class")
#> [1] "nbnid"
#> attr(,"match")
#> [1] "found" "found"
#> attr(,"multiple_matches")
#> [1] TRUE TRUE
#> attr(,"pattern_match")
#> [1] FALSE FALSE
#> attr(,"uri")
#> [1] "https://data.nbn.org.uk/Taxa/NHMSYS0001706186"
#> [2] "https://data.nbn.org.uk/Taxa/NBNSYS0000004786"

In addition, in case you don't want to do interactive name selection in the case where there are a lot of names, you can get all data back with functions of the form, e.g., get_tsn_(), and likewise for other data sources. For example:

out <- get_nbnid_("Poa annua")
NROW(out$`Poa annua`)
#> [1] 25

That's a lot of data, so we can get only certain rows back

get_nbnid_("Poa annua", rows = 1:10)
#> $`Poa annua`
#>                guid    scientificName    rank taxonomicStatus
#> 1  NBNSYS0000002544         Poa annua species        accepted
#> 2  NBNSYS0000002739      Adonis annua species         synonym
#> 3  NBNSYS0200001901      Bellis annua species        accepted
#> 4  NHMSYS0000456951 Carrichtera annua species         synonym
#> 5  NBNSYS0200003392  Triumfetta annua species        accepted
#> 6  NBNSYS0000002918     Lunaria annua species        accepted
#> 7  NBNSYS0200002555       Lonas annua species        accepted
#> 8  NBNSYS0000033325   Artemisia annua species        accepted
#> 9  NHMSYS0000456951 Carrichtera annua species        accepted
#> 10 NHMSYS0000461806     Poa imbecilla species         synonym

Coerce numerics/alphanumerics to taxon IDs

We've also introduced in v0.5 the ability to coerce numerics and alphanumerics to taxonomic ID classes that are usually only retrieved via get_*() functions.

For example, adfafd

as.gbifid(get_gbifid("Poa annua")) # already a uid, returns the same
#>    gbifid             scientificname    rank   status matchtype
#> 1 2704179               Poa annua L. species ACCEPTED     EXACT
#> 2 8422205 Poa annua Cham. & Schltdl. species  SYNONYM     EXACT
#> 3 7730008           Poa annua Steud. species DOUBTFUL     EXACT
#> [1] "2704179"
#> attr(,"class")
#> [1] "gbifid"
#> attr(,"match")
#> [1] "found"
#> attr(,"multiple_matches")
#> [1] TRUE
#> attr(,"pattern_match")
#> [1] FALSE
#> attr(,"uri")
#> [1] "http://www.gbif.org/species/2704179"
as.gbifid(2704179) # numeric
#> [1] "2704179"
#> attr(,"class")
#> [1] "gbifid"
#> attr(,"match")
#> [1] "found"
#> attr(,"multiple_matches")
#> [1] FALSE
#> attr(,"pattern_match")
#> [1] FALSE
#> attr(,"uri")
#> [1] "http://www.gbif.org/species/2704179"
as.gbifid("2704179") # character
#> [1] "2704179"
#> attr(,"class")
#> [1] "gbifid"
#> attr(,"match")
#> [1] "found"
#> attr(,"multiple_matches")
#> [1] FALSE
#> attr(,"pattern_match")
#> [1] FALSE
#> attr(,"uri")
#> [1] "http://www.gbif.org/species/2704179"
as.gbifid(list("2704179","2435099","3171445")) # list, either numeric or character
#> [1] "2704179" "2435099" "3171445"
#> attr(,"class")
#> [1] "gbifid"
#> attr(,"match")
#> [1] "found" "found" "found"
#> attr(,"multiple_matches")
#> [1] FALSE FALSE FALSE
#> attr(,"pattern_match")
#> [1] FALSE FALSE FALSE
#> attr(,"uri")
#> [1] "http://www.gbif.org/species/2704179"
#> [2] "http://www.gbif.org/species/2435099"
#> [3] "http://www.gbif.org/species/3171445"

These as.*() functions do a quick check of the web resource to make sure it's a real ID. However, you can turn this check off, making this coercion much faster:

system.time( replicate(3, as.gbifid(c("2704179","2435099","3171445"), check=TRUE)) )
#>    user  system elapsed 
#>   0.072   0.002   1.656
system.time( replicate(3, as.gbifid(c("2704179","2435099","3171445"), check=FALSE)) )
#>    user  system elapsed 
#>   0.002   0.000   0.002

What taxa are downstream of my taxon of interest?

If someone is not a taxonomic specialist on a particular taxon he likely does not know what children taxa are within a family, or within a genus. This task becomes especially unwieldy when there are a large number of taxa downstream. You can of course go to a website like Wikispecies or Encyclopedia of Life to get downstream names. However, taxize provides an easy way to programatically search for downstream taxa, both for the Catalogue of Life (CoL) and the Integrated Taxonomic Information System. Here is a short example using the CoL in which we want to find all the species within the genus Apis (honey bees).

downstream("Apis", downto = "Species", db = "col")
#>                     name    rank                            colid
#> 1                   Apis   genus 015be25f6b061ba517f495394b80f108
#> 2      Actinomadura apis species 1182a102a18b40aa19385bf5f1f53367
#> 3    Anisocentropus apis species 8891d18874dde14e44df52e931c44206
#> 4     Apis andreniformis species 7a4a38c5095963949d6d6ec917d471de
#> 5            Apis cerana species 39610a4ceff7e5244e334a3fbc5e47e5
#> 6           Apis dorsata species e1d4cbf3872c6c310b7a1c17ddd00ebc
#> 7            Apis florea species 92dca82a063fedd1da94b3f3972d7b22
#> 8     Apis koschevnikovi species 4bbc06b9dfbde0b72c619810b564c6e6
#> 9         Apis mellifera species 67cbbcf92cd60748759e58e802d98518
#> 10      Apis nigrocincta species 213668a26ba6d2aad9575218f10d422f
#> 11      Ascosphaera apis species 088549f2fb602367e84d5ffdb8c1d4fc
#> 12          Candida apis species 3219a9635d3438e8b76a645cecf87287
#> 13        Eristalis apis species 16d7c8023308d38f6bb831ed5fa82002
#> 14           Hister apis species d2d7483acf488b5ed932f49b0aa51d19
#> 15        Ifephylus apis species 9b4d00e009b58bbfc003b51bd3d0c6f0
#> 16  Impatiens nidus-apis species 6aecf448e6aa0cb46387066db94426d1
#> 17      Kirkaldykra apis species 70a68f13454abd937aabf56746f4a6ad
#> 18          Mallota apis species 10c3c3921d2ea9f9425ef9fd41914520
#> 19 Melanosella mors-apis species 4ac238f1597847dbc7998d97b8d45a0e
#> 20         Microdon apis species 9be92242562eb923e711dc24b7bbab9a
#> 21           Nosema apis species 5b2838dfd0ec15844fc6f659f7580322
#> 22       Scutirodes apis species 164ab3ac910547bc945cdbb994be1ee5
#> 23      Spiroplasma apis species 789f91571ce55de4df9821f2d05efab0
#> 24   Trichomonascus apis species 17dc4d840323e2c5b87e67a952f6dff3
#> 25       Pericystis apis species 088549f2fb602367e84d5ffdb8c1d4fc
#> 26       Pericystis apis species 088549f2fb602367e84d5ffdb8c1d4fc
#> 27       Torulopsis apis species 3219a9635d3438e8b76a645cecf87287
#> 28       Torulopsis apis species 3219a9635d3438e8b76a645cecf87287
#> 29         Apis aestuans species a517bc572c3c2697fe3bbfabc46a1493
#> 30           Apis alpina species f2781627115e4212ddab5979cdd425d2
#> 31         Apis bicornis species e67e82d00faae69da173bb31f9914056
#> 32        Apis canescens species d6b8850db971d65d6079e3a22f35e10e
#> 33         Apis clypeata species 706060924801130f6c3abf454087c100
#> 34      Apis cunicularia species ebc3c5166ce2cabf419c4c6dc332cf3b
#> 35          Apis etrusca species 6d27fd39a1d8b10050ba4e331987f3c9
#> 36          Apis globosa species 254c8e847ca4ff128bba57fe94deb98d
#> 37        Apis hispanica species e8d2057a3efeb2cfdaebe27ea8191cd5
#> 38         Apis hypnorum species dfb743f54f50b9b9dbee378473542821
#> 39      Apis ichneumonea species 13c35287e20ab9373fa445dbc44981ea
#> 40        Apis lapidaria species f8da5667af3562ebc0f6a83e1ec408f0
#> 41         Apis muscorum species 5bbfe59da5ce7fe59eb9ca3a7a45916c
#> 42         Apis mystacea species fba8e4752a7fa5939a7eae293ba633ec
#> 43         Apis obsoleta species da42bcb6cc0267903fb175f8a215aecb
#> 44         Apis rostrata species e155a4277b66d1114182cafd875afbe3
#> 45         Apis rostrata species e155a4277b66d1114182cafd875afbe3
#> 46             Apis rufa species e67e82d00faae69da173bb31f9914056
#> 47          Apis signata species 551f101ad3b9bc17b24575585b2500c1
#> 48       Apis smaragdula species 4bc5c886b061e17e9aecb537a04c616d
#> 49        Apis spinulosa species 56e7e9f854c9ed31ea6d0a06567607d0
#> 50      Apis subterranea species 3d2adff364a87bf7dd30524aa8071807
#>          name_status  kingdom              family              acc_name
#> 1      accepted name Animalia              Apidae                  <NA>
#> 2      accepted name Bacteria Thermomonosporaceae                  <NA>
#> 3      accepted name Animalia     Calamoceratidae                  <NA>
#> 4      accepted name Animalia              Apidae                  <NA>
#> 5      accepted name Animalia              Apidae                  <NA>
#> 6      accepted name Animalia              Apidae                  <NA>
#> 7      accepted name Animalia              Apidae                  <NA>
#> 8      accepted name Animalia              Apidae                  <NA>
#> 9      accepted name Animalia              Apidae                  <NA>
#> 10     accepted name Animalia              Apidae                  <NA>
#> 11     accepted name    Fungi     Ascosphaeraceae                  <NA>
#> 12     accepted name    Fungi        Not assigned                  <NA>
#> 13     accepted name Animalia           Syrphidae                  <NA>
#> 14     accepted name Animalia          Histeridae                  <NA>
#> 15     accepted name Animalia             Miridae                  <NA>
#> 16     accepted name  Plantae       Balsaminaceae                  <NA>
#> 17     accepted name Animalia        Cicadellidae                  <NA>
#> 18     accepted name Animalia           Syrphidae                  <NA>
#> 19     accepted name    Fungi        Not assigned                  <NA>
#> 20     accepted name Animalia           Syrphidae                  <NA>
#> 21     accepted name Protozoa         Nosematidae                  <NA>
#> 22     accepted name Animalia           Noctuidae                  <NA>
#> 23     accepted name Bacteria   Spiroplasmataceae                  <NA>
#> 24     accepted name    Fungi   Trichomonascaceae                  <NA>
#> 25 ambiguous synonym     <NA>                <NA>      Ascosphaera apis
#> 26 ambiguous synonym     <NA>                <NA>      Ascosphaera apis
#> 27 ambiguous synonym     <NA>                <NA>          Candida apis
#> 28 ambiguous synonym     <NA>                <NA>          Candida apis
#> 29           synonym     <NA>                <NA>     Xylocopa aestuans
#> 30           synonym     <NA>                <NA>        Bombus alpinus
#> 31           synonym     <NA>                <NA>            Osmia rufa
#> 32           synonym     <NA>                <NA>      Bembix canescens
#> 33           synonym     <NA>                <NA>      Lestica clypeata
#> 34           synonym     <NA>                <NA> Colletes cunicularius
#> 35           synonym     <NA>                <NA>     Tachytes etruscus
#> 36           synonym     <NA>                <NA>   Exomalopsis similis
#> 37           synonym     <NA>                <NA> Tachytes freygessneri
#> 38           synonym     <NA>                <NA>       Bombus hypnorum
#> 39           synonym     <NA>                <NA>    Sphex ichneumoneus
#> 40           synonym     <NA>                <NA>     Bombus lapidarius
#> 41           synonym     <NA>                <NA>       Bombus muscorum
#> 42           synonym     <NA>                <NA> Argogorytes mystaceus
#> 43           synonym     <NA>                <NA>    Tachytes obsoletus
#> 44           synonym     <NA>                <NA>       Bembix rostrata
#> 45           synonym     <NA>                <NA>       Bembix rostrata
#> 46           synonym     <NA>                <NA>            Osmia rufa
#> 47           synonym     <NA>                <NA>       Stictia signata
#> 48           synonym     <NA>                <NA>   Ceratina smaragdula
#> 49           synonym     <NA>                <NA>   Hoplosmia spinulosa
#> 50           synonym     <NA>                <NA>   Bombus subterraneus
#> $Apis
#>                       childtaxa_id     childtaxa_name childtaxa_rank
#> 1 7a4a38c5095963949d6d6ec917d471de Apis andreniformis        species
#> 2 39610a4ceff7e5244e334a3fbc5e47e5        Apis cerana        species
#> 3 e1d4cbf3872c6c310b7a1c17ddd00ebc       Apis dorsata        species
#> 4 92dca82a063fedd1da94b3f3972d7b22        Apis florea        species
#> 5 4bbc06b9dfbde0b72c619810b564c6e6 Apis koschevnikovi        species
#> 6 67cbbcf92cd60748759e58e802d98518     Apis mellifera        species
#> 7 213668a26ba6d2aad9575218f10d422f   Apis nigrocincta        species
#> 
#> attr(,"class")
#> [1] "downstream"
#> attr(,"db")
#> [1] "col"

We can also request data from ITIS

downstream("Apis", downto = "Species", db = "itis")
#> $Apis
#>      tsn parentname parenttsn          taxonname rankid rankname
#> 1 154396       Apis    154395     Apis mellifera    220  species
#> 2 763550       Apis    154395 Apis andreniformis    220  species
#> 3 763551       Apis    154395        Apis cerana    220  species
#> 4 763552       Apis    154395       Apis dorsata    220  species
#> 5 763553       Apis    154395        Apis florea    220  species
#> 6 763554       Apis    154395 Apis koschevnikovi    220  species
#> 7 763555       Apis    154395   Apis nigrocincta    220  species
#> 
#> attr(,"class")
#> [1] "downstream"
#> attr(,"db")
#> [1] "itis"

Direct children

You may sometimes only want the direct children. We got you covered on that front, with methods for ITIS, NCBI, and Catalogue of Life. For example, let's get direct children (species in this case) of the bee genus Apis using COL data:

children(get_colid("Apis"))
#>                     name    rank                            colid
#> 1                   Apis   genus 015be25f6b061ba517f495394b80f108
#> 2      Actinomadura apis species 1182a102a18b40aa19385bf5f1f53367
#> 3    Anisocentropus apis species 8891d18874dde14e44df52e931c44206
#> 4     Apis andreniformis species 7a4a38c5095963949d6d6ec917d471de
#> 5            Apis cerana species 39610a4ceff7e5244e334a3fbc5e47e5
#> 6           Apis dorsata species e1d4cbf3872c6c310b7a1c17ddd00ebc
#> 7            Apis florea species 92dca82a063fedd1da94b3f3972d7b22
#> 8     Apis koschevnikovi species 4bbc06b9dfbde0b72c619810b564c6e6
#> 9         Apis mellifera species 67cbbcf92cd60748759e58e802d98518
#> 10      Apis nigrocincta species 213668a26ba6d2aad9575218f10d422f
#> 11      Ascosphaera apis species 088549f2fb602367e84d5ffdb8c1d4fc
#> 12          Candida apis species 3219a9635d3438e8b76a645cecf87287
#> 13        Eristalis apis species 16d7c8023308d38f6bb831ed5fa82002
#> 14           Hister apis species d2d7483acf488b5ed932f49b0aa51d19
#> 15        Ifephylus apis species 9b4d00e009b58bbfc003b51bd3d0c6f0
#> 16  Impatiens nidus-apis species 6aecf448e6aa0cb46387066db94426d1
#> 17      Kirkaldykra apis species 70a68f13454abd937aabf56746f4a6ad
#> 18          Mallota apis species 10c3c3921d2ea9f9425ef9fd41914520
#> 19 Melanosella mors-apis species 4ac238f1597847dbc7998d97b8d45a0e
#> 20         Microdon apis species 9be92242562eb923e711dc24b7bbab9a
#> 21           Nosema apis species 5b2838dfd0ec15844fc6f659f7580322
#> 22       Scutirodes apis species 164ab3ac910547bc945cdbb994be1ee5
#> 23      Spiroplasma apis species 789f91571ce55de4df9821f2d05efab0
#> 24   Trichomonascus apis species 17dc4d840323e2c5b87e67a952f6dff3
#> 25       Pericystis apis species 088549f2fb602367e84d5ffdb8c1d4fc
#> 26       Pericystis apis species 088549f2fb602367e84d5ffdb8c1d4fc
#> 27       Torulopsis apis species 3219a9635d3438e8b76a645cecf87287
#> 28       Torulopsis apis species 3219a9635d3438e8b76a645cecf87287
#> 29         Apis aestuans species a517bc572c3c2697fe3bbfabc46a1493
#> 30           Apis alpina species f2781627115e4212ddab5979cdd425d2
#> 31         Apis bicornis species e67e82d00faae69da173bb31f9914056
#> 32        Apis canescens species d6b8850db971d65d6079e3a22f35e10e
#> 33         Apis clypeata species 706060924801130f6c3abf454087c100
#> 34      Apis cunicularia species ebc3c5166ce2cabf419c4c6dc332cf3b
#> 35          Apis etrusca species 6d27fd39a1d8b10050ba4e331987f3c9
#> 36          Apis globosa species 254c8e847ca4ff128bba57fe94deb98d
#> 37        Apis hispanica species e8d2057a3efeb2cfdaebe27ea8191cd5
#> 38         Apis hypnorum species dfb743f54f50b9b9dbee378473542821
#> 39      Apis ichneumonea species 13c35287e20ab9373fa445dbc44981ea
#> 40        Apis lapidaria species f8da5667af3562ebc0f6a83e1ec408f0
#> 41         Apis muscorum species 5bbfe59da5ce7fe59eb9ca3a7a45916c
#> 42         Apis mystacea species fba8e4752a7fa5939a7eae293ba633ec
#> 43         Apis obsoleta species da42bcb6cc0267903fb175f8a215aecb
#> 44         Apis rostrata species e155a4277b66d1114182cafd875afbe3
#> 45         Apis rostrata species e155a4277b66d1114182cafd875afbe3
#> 46             Apis rufa species e67e82d00faae69da173bb31f9914056
#> 47          Apis signata species 551f101ad3b9bc17b24575585b2500c1
#> 48       Apis smaragdula species 4bc5c886b061e17e9aecb537a04c616d
#> 49        Apis spinulosa species 56e7e9f854c9ed31ea6d0a06567607d0
#> 50      Apis subterranea species 3d2adff364a87bf7dd30524aa8071807
#>          name_status  kingdom              family              acc_name
#> 1      accepted name Animalia              Apidae                  <NA>
#> 2      accepted name Bacteria Thermomonosporaceae                  <NA>
#> 3      accepted name Animalia     Calamoceratidae                  <NA>
#> 4      accepted name Animalia              Apidae                  <NA>
#> 5      accepted name Animalia              Apidae                  <NA>
#> 6      accepted name Animalia              Apidae                  <NA>
#> 7      accepted name Animalia              Apidae                  <NA>
#> 8      accepted name Animalia              Apidae                  <NA>
#> 9      accepted name Animalia              Apidae                  <NA>
#> 10     accepted name Animalia              Apidae                  <NA>
#> 11     accepted name    Fungi     Ascosphaeraceae                  <NA>
#> 12     accepted name    Fungi        Not assigned                  <NA>
#> 13     accepted name Animalia           Syrphidae                  <NA>
#> 14     accepted name Animalia          Histeridae                  <NA>
#> 15     accepted name Animalia             Miridae                  <NA>
#> 16     accepted name  Plantae       Balsaminaceae                  <NA>
#> 17     accepted name Animalia        Cicadellidae                  <NA>
#> 18     accepted name Animalia           Syrphidae                  <NA>
#> 19     accepted name    Fungi        Not assigned                  <NA>
#> 20     accepted name Animalia           Syrphidae                  <NA>
#> 21     accepted name Protozoa         Nosematidae                  <NA>
#> 22     accepted name Animalia           Noctuidae                  <NA>
#> 23     accepted name Bacteria   Spiroplasmataceae                  <NA>
#> 24     accepted name    Fungi   Trichomonascaceae                  <NA>
#> 25 ambiguous synonym     <NA>                <NA>      Ascosphaera apis
#> 26 ambiguous synonym     <NA>                <NA>      Ascosphaera apis
#> 27 ambiguous synonym     <NA>                <NA>          Candida apis
#> 28 ambiguous synonym     <NA>                <NA>          Candida apis
#> 29           synonym     <NA>                <NA>     Xylocopa aestuans
#> 30           synonym     <NA>                <NA>        Bombus alpinus
#> 31           synonym     <NA>                <NA>            Osmia rufa
#> 32           synonym     <NA>                <NA>      Bembix canescens
#> 33           synonym     <NA>                <NA>      Lestica clypeata
#> 34           synonym     <NA>                <NA> Colletes cunicularius
#> 35           synonym     <NA>                <NA>     Tachytes etruscus
#> 36           synonym     <NA>                <NA>   Exomalopsis similis
#> 37           synonym     <NA>                <NA> Tachytes freygessneri
#> 38           synonym     <NA>                <NA>       Bombus hypnorum
#> 39           synonym     <NA>                <NA>    Sphex ichneumoneus
#> 40           synonym     <NA>                <NA>     Bombus lapidarius
#> 41           synonym     <NA>                <NA>       Bombus muscorum
#> 42           synonym     <NA>                <NA> Argogorytes mystaceus
#> 43           synonym     <NA>                <NA>    Tachytes obsoletus
#> 44           synonym     <NA>                <NA>       Bembix rostrata
#> 45           synonym     <NA>                <NA>       Bembix rostrata
#> 46           synonym     <NA>                <NA>            Osmia rufa
#> 47           synonym     <NA>                <NA>       Stictia signata
#> 48           synonym     <NA>                <NA>   Ceratina smaragdula
#> 49           synonym     <NA>                <NA>   Hoplosmia spinulosa
#> 50           synonym     <NA>                <NA>   Bombus subterraneus
#> $`015be25f6b061ba517f495394b80f108`
#>                       childtaxa_id     childtaxa_name childtaxa_rank
#> 1 7a4a38c5095963949d6d6ec917d471de Apis andreniformis        species
#> 2 39610a4ceff7e5244e334a3fbc5e47e5        Apis cerana        species
#> 3 e1d4cbf3872c6c310b7a1c17ddd00ebc       Apis dorsata        species
#> 4 92dca82a063fedd1da94b3f3972d7b22        Apis florea        species
#> 5 4bbc06b9dfbde0b72c619810b564c6e6 Apis koschevnikovi        species
#> 6 67cbbcf92cd60748759e58e802d98518     Apis mellifera        species
#> 7 213668a26ba6d2aad9575218f10d422f   Apis nigrocincta        species
#> 
#> attr(,"class")
#> [1] "children"
#> attr(,"db")
#> [1] "col"

The direct children (genera in this case) of Pinaceae using NCBI data:

children("Pinaceae", db = "ncbi")
#> $Pinaceae
#>    childtaxa_id childtaxa_name childtaxa_rank
#> 1        123600     Nothotsuga          genus
#> 2         64685        Cathaya          genus
#> 3          3358          Tsuga          genus
#> 4          3356    Pseudotsuga          genus
#> 5          3354    Pseudolarix          genus
#> 6          3337          Pinus          genus
#> 7          3328          Picea          genus
#> 8          3325          Larix          genus
#> 9          3323     Keteleeria          genus
#> 10         3321         Cedrus          genus
#> 11         3319          Abies          genus
#> 
#> attr(,"class")
#> [1] "children"
#> attr(,"db")
#> [1] "ncbi"

Get NCBI ID from GenBank Ids

With accession numbers

genbank2uid(id = 'AJ748748')
#> [1] "282199"
#> attr(,"class")
#> [1] "uid"
#> attr(,"match")
#> [1] "found"
#> attr(,"multiple_matches")
#> [1] FALSE
#> attr(,"pattern_match")
#> [1] FALSE
#> attr(,"uri")
#> [1] "http://www.ncbi.nlm.nih.gov/taxonomy/282199"

With gi numbers

genbank2uid(id = 62689767)
#> [1] "282199"
#> attr(,"class")
#> [1] "uid"
#> attr(,"match")
#> [1] "found"
#> attr(,"multiple_matches")
#> [1] FALSE
#> attr(,"pattern_match")
#> [1] FALSE
#> attr(,"uri")
#> [1] "http://www.ncbi.nlm.nih.gov/taxonomy/282199"

Matching species tables with different taxonomic resolution

Biologist often need to match different sets of data tied to species. For example, trait-based approaches are a promising tool in ecology. One problem is that abundance data must be matched with trait databases. These two data tables may contain species information on different taxonomic levels and possibly data must be aggregated to a joint taxonomic level, so that the data can be merged. taxize can help in this data-cleaning step, providing a reproducible workflow:

We can use the mentioned classification-function to retrieve the taxonomic hierarchy and then search the hierarchies up- and downwards for matches. Here is an example to match a species with names on three different taxonomic levels.

A <- "gammarus roeseli"

B1 <- "gammarus roeseli"
B2 <- "gammarus"
B3 <- "gammaridae"

A_clas <- classification(A, db = 'ncbi')
B1_clas <- classification(B1, db = 'ncbi')
B2_clas <- classification(B2, db = 'ncbi')
B3_clas <- classification(B3, db = 'ncbi')

B1[match(A, B1)]
#> [1] "gammarus roeseli"
A_clas[[1]]$rank[tolower(A_clas[[1]]$name) %in% B2]
#> [1] "genus"
A_clas[[1]]$rank[tolower(A_clas[[1]]$name) %in% B3]
#> [1] "family"

If we find a direct match (here Gammarus roeseli), we are lucky. But we can also match Gammaridae with Gammarus roeseli, but on a lower taxonomic level. A more comprehensive and realistic example (matching a trait table with an abundance table) is given in the vignette on matching.

taxize/inst/doc/taxize_vignette.Rmd0000644000176200001440000010764713125505152017173 0ustar liggesusers taxize vignette - a taxonomic toolbelt for R ====== `taxize` is a taxonomic toolbelt for R. `taxize` wraps APIs for a large suite of taxonomic databases availab on the web. ## Installation First, install and load `taxize` into the R session. ```r install.packages("taxize") ``` ```r library("taxize") ``` Advanced users can also download and install the latest development copy from [GitHub](https://github.com/ropensci/taxize_). ## Resolve taxonomic name This is a common task in biology. We often have a list of species names and we want to know a) if we have the most up to date names, b) if our names are spelled correctly, and c) the scientific name for a common name. One way to resolve names is via the Global Names Resolver (GNR) service provided by the [Encyclopedia of Life][eol]. Here, we are searching for two misspelled names: ```r temp <- gnr_resolve(names = c("Helianthos annus", "Homo saapiens")) head(temp) ``` ``` #> user_supplied_name submitted_name matched_name #> 1 Helianthos annus Helianthos annus Helianthus annus #> 2 Helianthos annus Helianthos annus Helianthus annus L. #> 3 Helianthos annus Helianthos annus Helianthus annus #> 4 Helianthos annus Helianthos annus Helianthus annus #> 5 Helianthos annus Helianthos annus Helianthus annuus L. #> 6 Helianthos annus Helianthos annus Helianthus annuus L. #> data_source_title score #> 1 EOL 0.75 #> 2 EOL 0.75 #> 3 uBio NameBank 0.75 #> 4 Open Tree of Life Reference Taxonomy 0.75 #> 5 Catalogue of Life 0.75 #> 6 ITIS 0.75 ``` The correct spellings are *Helianthus annuus* and *Homo sapiens*. Another approach uses the Taxonomic Name Resolution Service via the Taxosaurus API developed by iPLant and the Phylotastic organization. In this example, we provide a list of species names, some of which are misspelled, and we'll call the API with the *tnrs* function. ```r mynames <- c("Helianthus annuus", "Pinus contort", "Poa anua", "Abis magnifica", "Rosa california", "Festuca arundinace", "Sorbus occidentalos","Madia sateva") tnrs(query = mynames, source = "iPlant_TNRS")[ , -c(5:7)] ``` ``` #> submittedname acceptedname sourceid score #> 1 Sorbus occidentalos Sorbus occidentalis iPlant_TNRS 0.99 #> 2 Festuca arundinace Festuca arundinacea iPlant_TNRS 0.99 #> 3 Abis magnifica Abies magnifica iPlant_TNRS 0.96 #> 4 Pinus contort Pinus contorta iPlant_TNRS 0.98 #> 5 Poa anua Poa annua iPlant_TNRS 0.96 #> 6 Madia sateva Madia sativa iPlant_TNRS 0.97 #> 7 Helianthus annuus Helianthus annuus iPlant_TNRS 1 #> 8 Rosa california Rosa californica iPlant_TNRS 0.99 ``` It turns out there are a few corrections: e.g., *Madia sateva* should be *Madia sativa*, and *Rosa california* should be *Rosa californica*. Note that this search worked because fuzzy matching was employed to retrieve names that were close, but not exact matches. Fuzzy matching is only available for plants in the TNRS service, so we advise using EOL's Global Names Resolver if you need to resolve animal names. taxize takes the approach that the user should be able to make decisions about what resource to trust, rather than making the decision. Both the EOL GNR and the TNRS services provide data from a variety of data sources. The user may trust a specific data source, thus may want to use the names from that data source. In the future, we may provide the ability for taxize to suggest the best match from a variety of sources. Another common use case is when there are many synonyms for a species. In this example, we have three synonyms of the currently accepted name for a species. ```r mynames <- c("Helianthus annuus ssp. jaegeri", "Helianthus annuus ssp. lenticularis", "Helianthus annuus ssp. texanus") (tsn <- get_tsn(mynames, accepted = FALSE)) ``` ``` [1] "525928" "525929" "525930" attr(,"match") [1] "found" "found" "found" attr(,"multiple_matches") [1] FALSE FALSE FALSE attr(,"pattern_match") [1] FALSE FALSE FALSE attr(,"uri") [1] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=525928" [2] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=525929" [3] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=525930" attr(,"class") [1] "tsn" ``` ```r lapply(tsn, itis_acceptname) ``` ``` [[1]] submittedtsn acceptedname acceptedtsn author 1 525928 Helianthus annuus 36616 L. [[2]] submittedtsn acceptedname acceptedtsn author 1 525929 Helianthus annuus 36616 L. [[3]] submittedtsn acceptedname acceptedtsn author 1 525930 Helianthus annuus 36616 L. ``` ## Retrieve higher taxonomic names Another task biologists often face is getting higher taxonomic names for a taxa list. Having the higher taxonomy allows you to put into context the relationships of your species list. For example, you may find out that species A and species B are in Family C, which may lead to some interesting insight, as opposed to not knowing that Species A and B are closely related. This also makes it easy to aggregate/standardize data to a specific taxonomic level (e.g., family level) or to match data to other databases with different taxonomic resolution (e.g., trait databases). A number of data sources in taxize provide the capability to retrieve higher taxonomic names, but we will highlight two of the more useful ones: [Integrated Taxonomic Information System (ITIS)][itis] and [National Center for Biotechnology Information (NCBI)][ncbi]. First, we'll search for two species, *Abies procera} and *Pinus contorta* within ITIS. ```r specieslist <- c("Abies procera","Pinus contorta") classification(specieslist, db = 'itis') ``` ``` #> $`Abies procera` #> name rank id #> 1 Plantae kingdom 202422 #> 2 Viridiplantae subkingdom 954898 #> 3 Streptophyta infrakingdom 846494 #> 4 Embryophyta superdivision 954900 #> 5 Tracheophyta division 846496 #> 6 Spermatophytina subdivision 846504 #> 7 Pinopsida class 500009 #> 8 Pinidae subclass 954916 #> 9 Pinales order 500028 #> 10 Pinaceae family 18030 #> 11 Abies genus 18031 #> 12 Abies procera species 181835 #> #> $`Pinus contorta` #> name rank id #> 1 Plantae kingdom 202422 #> 2 Viridiplantae subkingdom 954898 #> 3 Streptophyta infrakingdom 846494 #> 4 Embryophyta superdivision 954900 #> 5 Tracheophyta division 846496 #> 6 Spermatophytina subdivision 846504 #> 7 Pinopsida class 500009 #> 8 Pinidae subclass 954916 #> 9 Pinales order 500028 #> 10 Pinaceae family 18030 #> 11 Pinus genus 18035 #> 12 Pinus contorta species 183327 #> #> attr(,"class") #> [1] "classification" #> attr(,"db") #> [1] "itis" ``` It turns out both species are in the family Pinaceae. You can also get this type of information from the NCBI by doing `classification(specieslist, db = 'ncbi')`. Instead of a full classification, you may only want a single name, say a family name for your species of interest. The function *tax_name} is built just for this purpose. As with the `classification` function you can specify the data source with the `db` argument, either ITIS or NCBI. ```r tax_name(query = "Helianthus annuus", get = "family", db = "ncbi") ``` ``` #> db query family #> 1 ncbi Helianthus annuus Asteraceae ``` I may happen that a data source does not provide information on the queried species, than one could take the result from another source and union the results from the different sources. ## Interactive name selection As mentioned most databases use a numeric code to reference a species. A general workflow in taxize is: Retrieve Code for the queried species and then use this code to query more data/information. Below are a few examples. When you run these examples in R, you are presented with a command prompt asking for the row that contains the name you would like back; that output is not printed below for brevity. In this example, the search term has many matches. The function returns a data frame of the matches, and asks for the user to input what row number to accept. ```r get_uid(sciname = "Pinus") ``` ``` #> status rank division scientificname commonname uid genus #> 1 active subgenus seed plants Pinus hard pines 139271 #> 2 active genus seed plants Pinus 3337 #> species subsp modificationdate #> 1 2015/09/16 00:00 #> 2 2004/09/10 00:00 ``` ``` #> [1] "139271" #> attr(,"class") #> [1] "uid" #> attr(,"match") #> [1] "found" #> attr(,"multiple_matches") #> [1] TRUE #> attr(,"pattern_match") #> [1] FALSE #> attr(,"uri") #> [1] "https://www.ncbi.nlm.nih.gov/taxonomy/139271" ``` In another example, you can pass in a long character vector of taxonomic names (although this one is rather short for demo purposes): ```r splist <- c("annona cherimola", 'annona muricata', "quercus robur") get_tsn(searchterm = splist, searchtype = "scientific") ``` ``` #> [1] "506198" "18098" "19405" #> attr(,"match") #> [1] "found" "found" "found" #> attr(,"multiple_matches") #> [1] FALSE FALSE TRUE #> attr(,"pattern_match") #> [1] FALSE FALSE TRUE #> attr(,"uri") #> [1] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=506198" #> [2] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=18098" #> [3] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=19405" #> attr(,"class") #> [1] "tsn" ``` There are functions for many other sources * `get_boldid()` * `get_colid()` * `get_eolid()` * `get_gbifid()` * `get_nbnid()` * `get_tpsid()` Sometimes with these functions you get a lot of data back. In these cases you may want to limit your choices. Soon we will incorporate the ability to filter using `regex` to limit matches, but for now, we have a new parameter, `rows`, which lets you select certain rows. For example, you can select the first row of each given name, which means there is no interactive component: ```r get_nbnid(c("Zootoca vivipara","Pinus contorta"), rows = 1) ``` ``` #> [1] "NHMSYS0001706186" "NBNSYS0000004786" #> attr(,"class") #> [1] "nbnid" #> attr(,"match") #> [1] "found" "found" #> attr(,"multiple_matches") #> [1] TRUE TRUE #> attr(,"pattern_match") #> [1] FALSE FALSE #> attr(,"uri") #> [1] "https://data.nbn.org.uk/Taxa/NHMSYS0001706186" #> [2] "https://data.nbn.org.uk/Taxa/NBNSYS0000004786" ``` Or you can select a range of rows ```r get_nbnid(c("Zootoca vivipara","Pinus contorta"), rows = 1:3) ``` ``` #> nbnid scientificName rank #> 1 NHMSYS0001706186 Zootoca vivipara species #> 2 NHMSYS0020784960 Zootoca vivipara subsp. pannonica subspecies #> 3 NHMSYS0000461615 Bistorta vivipara species #> taxonomicStatus #> 1 accepted #> 2 accepted #> 3 synonym #> nbnid scientificName rank #> 1 NBNSYS0000004786 Pinus contorta species #> 2 NHMSYS0000494848 Pinus contorta subsp. contorta subspecies #> 3 NHMSYS0000494858 Pinus contorta subsp. murreyana subspecies #> taxonomicStatus #> 1 accepted #> 2 synonym #> 3 synonym ``` ``` #> [1] "NHMSYS0001706186" "NBNSYS0000004786" #> attr(,"class") #> [1] "nbnid" #> attr(,"match") #> [1] "found" "found" #> attr(,"multiple_matches") #> [1] TRUE TRUE #> attr(,"pattern_match") #> [1] FALSE FALSE #> attr(,"uri") #> [1] "https://data.nbn.org.uk/Taxa/NHMSYS0001706186" #> [2] "https://data.nbn.org.uk/Taxa/NBNSYS0000004786" ``` In addition, in case you don't want to do interactive name selection in the case where there are a lot of names, you can get all data back with functions of the form, e.g., `get_tsn_()`, and likewise for other data sources. For example: ```r out <- get_nbnid_("Poa annua") NROW(out$`Poa annua`) ``` ``` #> [1] 25 ``` That's a lot of data, so we can get only certain rows back ```r get_nbnid_("Poa annua", rows = 1:10) ``` ``` #> $`Poa annua` #> guid scientificName rank taxonomicStatus #> 1 NBNSYS0000002544 Poa annua species accepted #> 2 NBNSYS0000002739 Adonis annua species synonym #> 3 NBNSYS0200001901 Bellis annua species accepted #> 4 NHMSYS0000456951 Carrichtera annua species synonym #> 5 NBNSYS0200003392 Triumfetta annua species accepted #> 6 NBNSYS0000002918 Lunaria annua species accepted #> 7 NBNSYS0200002555 Lonas annua species accepted #> 8 NBNSYS0000033325 Artemisia annua species accepted #> 9 NHMSYS0000456951 Carrichtera annua species accepted #> 10 NHMSYS0000461806 Poa imbecilla species synonym ``` ## Coerce numerics/alphanumerics to taxon IDs We've also introduced in `v0.5` the ability to coerce numerics and alphanumerics to taxonomic ID classes that are usually only retrieved via `get_*()` functions. For example, adfafd ```r as.gbifid(get_gbifid("Poa annua")) # already a uid, returns the same ``` ``` #> gbifid scientificname rank status matchtype #> 1 2704179 Poa annua L. species ACCEPTED EXACT #> 2 8422205 Poa annua Cham. & Schltdl. species SYNONYM EXACT #> 3 7730008 Poa annua Steud. species DOUBTFUL EXACT ``` ``` #> [1] "2704179" #> attr(,"class") #> [1] "gbifid" #> attr(,"match") #> [1] "found" #> attr(,"multiple_matches") #> [1] TRUE #> attr(,"pattern_match") #> [1] FALSE #> attr(,"uri") #> [1] "http://www.gbif.org/species/2704179" ``` ```r as.gbifid(2704179) # numeric ``` ``` #> [1] "2704179" #> attr(,"class") #> [1] "gbifid" #> attr(,"match") #> [1] "found" #> attr(,"multiple_matches") #> [1] FALSE #> attr(,"pattern_match") #> [1] FALSE #> attr(,"uri") #> [1] "http://www.gbif.org/species/2704179" ``` ```r as.gbifid("2704179") # character ``` ``` #> [1] "2704179" #> attr(,"class") #> [1] "gbifid" #> attr(,"match") #> [1] "found" #> attr(,"multiple_matches") #> [1] FALSE #> attr(,"pattern_match") #> [1] FALSE #> attr(,"uri") #> [1] "http://www.gbif.org/species/2704179" ``` ```r as.gbifid(list("2704179","2435099","3171445")) # list, either numeric or character ``` ``` #> [1] "2704179" "2435099" "3171445" #> attr(,"class") #> [1] "gbifid" #> attr(,"match") #> [1] "found" "found" "found" #> attr(,"multiple_matches") #> [1] FALSE FALSE FALSE #> attr(,"pattern_match") #> [1] FALSE FALSE FALSE #> attr(,"uri") #> [1] "http://www.gbif.org/species/2704179" #> [2] "http://www.gbif.org/species/2435099" #> [3] "http://www.gbif.org/species/3171445" ``` These `as.*()` functions do a quick check of the web resource to make sure it's a real ID. However, you can turn this check off, making this coercion much faster: ```r system.time( replicate(3, as.gbifid(c("2704179","2435099","3171445"), check=TRUE)) ) ``` ``` #> user system elapsed #> 0.072 0.002 1.656 ``` ```r system.time( replicate(3, as.gbifid(c("2704179","2435099","3171445"), check=FALSE)) ) ``` ``` #> user system elapsed #> 0.002 0.000 0.002 ``` ## What taxa are downstream of my taxon of interest? If someone is not a taxonomic specialist on a particular taxon he likely does not know what children taxa are within a family, or within a genus. This task becomes especially unwieldy when there are a large number of taxa downstream. You can of course go to a website like [Wikispecies][wikispecies] or [Encyclopedia of Life][eol] to get downstream names. However, taxize provides an easy way to programatically search for downstream taxa, both for the [Catalogue of Life (CoL)][col] and the [Integrated Taxonomic Information System][itis]. Here is a short example using the CoL in which we want to find all the species within the genus *Apis* (honey bees). ```r downstream("Apis", downto = "Species", db = "col") ``` ``` #> name rank colid #> 1 Apis genus 015be25f6b061ba517f495394b80f108 #> 2 Actinomadura apis species 1182a102a18b40aa19385bf5f1f53367 #> 3 Anisocentropus apis species 8891d18874dde14e44df52e931c44206 #> 4 Apis andreniformis species 7a4a38c5095963949d6d6ec917d471de #> 5 Apis cerana species 39610a4ceff7e5244e334a3fbc5e47e5 #> 6 Apis dorsata species e1d4cbf3872c6c310b7a1c17ddd00ebc #> 7 Apis florea species 92dca82a063fedd1da94b3f3972d7b22 #> 8 Apis koschevnikovi species 4bbc06b9dfbde0b72c619810b564c6e6 #> 9 Apis mellifera species 67cbbcf92cd60748759e58e802d98518 #> 10 Apis nigrocincta species 213668a26ba6d2aad9575218f10d422f #> 11 Ascosphaera apis species 088549f2fb602367e84d5ffdb8c1d4fc #> 12 Candida apis species 3219a9635d3438e8b76a645cecf87287 #> 13 Eristalis apis species 16d7c8023308d38f6bb831ed5fa82002 #> 14 Hister apis species d2d7483acf488b5ed932f49b0aa51d19 #> 15 Ifephylus apis species 9b4d00e009b58bbfc003b51bd3d0c6f0 #> 16 Impatiens nidus-apis species 6aecf448e6aa0cb46387066db94426d1 #> 17 Kirkaldykra apis species 70a68f13454abd937aabf56746f4a6ad #> 18 Mallota apis species 10c3c3921d2ea9f9425ef9fd41914520 #> 19 Melanosella mors-apis species 4ac238f1597847dbc7998d97b8d45a0e #> 20 Microdon apis species 9be92242562eb923e711dc24b7bbab9a #> 21 Nosema apis species 5b2838dfd0ec15844fc6f659f7580322 #> 22 Scutirodes apis species 164ab3ac910547bc945cdbb994be1ee5 #> 23 Spiroplasma apis species 789f91571ce55de4df9821f2d05efab0 #> 24 Trichomonascus apis species 17dc4d840323e2c5b87e67a952f6dff3 #> 25 Pericystis apis species 088549f2fb602367e84d5ffdb8c1d4fc #> 26 Pericystis apis species 088549f2fb602367e84d5ffdb8c1d4fc #> 27 Torulopsis apis species 3219a9635d3438e8b76a645cecf87287 #> 28 Torulopsis apis species 3219a9635d3438e8b76a645cecf87287 #> 29 Apis aestuans species a517bc572c3c2697fe3bbfabc46a1493 #> 30 Apis alpina species f2781627115e4212ddab5979cdd425d2 #> 31 Apis bicornis species e67e82d00faae69da173bb31f9914056 #> 32 Apis canescens species d6b8850db971d65d6079e3a22f35e10e #> 33 Apis clypeata species 706060924801130f6c3abf454087c100 #> 34 Apis cunicularia species ebc3c5166ce2cabf419c4c6dc332cf3b #> 35 Apis etrusca species 6d27fd39a1d8b10050ba4e331987f3c9 #> 36 Apis globosa species 254c8e847ca4ff128bba57fe94deb98d #> 37 Apis hispanica species e8d2057a3efeb2cfdaebe27ea8191cd5 #> 38 Apis hypnorum species dfb743f54f50b9b9dbee378473542821 #> 39 Apis ichneumonea species 13c35287e20ab9373fa445dbc44981ea #> 40 Apis lapidaria species f8da5667af3562ebc0f6a83e1ec408f0 #> 41 Apis muscorum species 5bbfe59da5ce7fe59eb9ca3a7a45916c #> 42 Apis mystacea species fba8e4752a7fa5939a7eae293ba633ec #> 43 Apis obsoleta species da42bcb6cc0267903fb175f8a215aecb #> 44 Apis rostrata species e155a4277b66d1114182cafd875afbe3 #> 45 Apis rostrata species e155a4277b66d1114182cafd875afbe3 #> 46 Apis rufa species e67e82d00faae69da173bb31f9914056 #> 47 Apis signata species 551f101ad3b9bc17b24575585b2500c1 #> 48 Apis smaragdula species 4bc5c886b061e17e9aecb537a04c616d #> 49 Apis spinulosa species 56e7e9f854c9ed31ea6d0a06567607d0 #> 50 Apis subterranea species 3d2adff364a87bf7dd30524aa8071807 #> name_status kingdom family acc_name #> 1 accepted name Animalia Apidae #> 2 accepted name Bacteria Thermomonosporaceae #> 3 accepted name Animalia Calamoceratidae #> 4 accepted name Animalia Apidae #> 5 accepted name Animalia Apidae #> 6 accepted name Animalia Apidae #> 7 accepted name Animalia Apidae #> 8 accepted name Animalia Apidae #> 9 accepted name Animalia Apidae #> 10 accepted name Animalia Apidae #> 11 accepted name Fungi Ascosphaeraceae #> 12 accepted name Fungi Not assigned #> 13 accepted name Animalia Syrphidae #> 14 accepted name Animalia Histeridae #> 15 accepted name Animalia Miridae #> 16 accepted name Plantae Balsaminaceae #> 17 accepted name Animalia Cicadellidae #> 18 accepted name Animalia Syrphidae #> 19 accepted name Fungi Not assigned #> 20 accepted name Animalia Syrphidae #> 21 accepted name Protozoa Nosematidae #> 22 accepted name Animalia Noctuidae #> 23 accepted name Bacteria Spiroplasmataceae #> 24 accepted name Fungi Trichomonascaceae #> 25 ambiguous synonym Ascosphaera apis #> 26 ambiguous synonym Ascosphaera apis #> 27 ambiguous synonym Candida apis #> 28 ambiguous synonym Candida apis #> 29 synonym Xylocopa aestuans #> 30 synonym Bombus alpinus #> 31 synonym Osmia rufa #> 32 synonym Bembix canescens #> 33 synonym Lestica clypeata #> 34 synonym Colletes cunicularius #> 35 synonym Tachytes etruscus #> 36 synonym Exomalopsis similis #> 37 synonym Tachytes freygessneri #> 38 synonym Bombus hypnorum #> 39 synonym Sphex ichneumoneus #> 40 synonym Bombus lapidarius #> 41 synonym Bombus muscorum #> 42 synonym Argogorytes mystaceus #> 43 synonym Tachytes obsoletus #> 44 synonym Bembix rostrata #> 45 synonym Bembix rostrata #> 46 synonym Osmia rufa #> 47 synonym Stictia signata #> 48 synonym Ceratina smaragdula #> 49 synonym Hoplosmia spinulosa #> 50 synonym Bombus subterraneus ``` ``` #> $Apis #> childtaxa_id childtaxa_name childtaxa_rank #> 1 7a4a38c5095963949d6d6ec917d471de Apis andreniformis species #> 2 39610a4ceff7e5244e334a3fbc5e47e5 Apis cerana species #> 3 e1d4cbf3872c6c310b7a1c17ddd00ebc Apis dorsata species #> 4 92dca82a063fedd1da94b3f3972d7b22 Apis florea species #> 5 4bbc06b9dfbde0b72c619810b564c6e6 Apis koschevnikovi species #> 6 67cbbcf92cd60748759e58e802d98518 Apis mellifera species #> 7 213668a26ba6d2aad9575218f10d422f Apis nigrocincta species #> #> attr(,"class") #> [1] "downstream" #> attr(,"db") #> [1] "col" ``` We can also request data from ITIS ```r downstream("Apis", downto = "Species", db = "itis") ``` ``` #> $Apis #> tsn parentname parenttsn taxonname rankid rankname #> 1 154396 Apis 154395 Apis mellifera 220 species #> 2 763550 Apis 154395 Apis andreniformis 220 species #> 3 763551 Apis 154395 Apis cerana 220 species #> 4 763552 Apis 154395 Apis dorsata 220 species #> 5 763553 Apis 154395 Apis florea 220 species #> 6 763554 Apis 154395 Apis koschevnikovi 220 species #> 7 763555 Apis 154395 Apis nigrocincta 220 species #> #> attr(,"class") #> [1] "downstream" #> attr(,"db") #> [1] "itis" ``` ## Direct children You may sometimes only want the direct children. We got you covered on that front, with methods for ITIS, NCBI, and Catalogue of Life. For example, let's get direct children (species in this case) of the bee genus _Apis_ using COL data: ```r children(get_colid("Apis")) ``` ``` #> name rank colid #> 1 Apis genus 015be25f6b061ba517f495394b80f108 #> 2 Actinomadura apis species 1182a102a18b40aa19385bf5f1f53367 #> 3 Anisocentropus apis species 8891d18874dde14e44df52e931c44206 #> 4 Apis andreniformis species 7a4a38c5095963949d6d6ec917d471de #> 5 Apis cerana species 39610a4ceff7e5244e334a3fbc5e47e5 #> 6 Apis dorsata species e1d4cbf3872c6c310b7a1c17ddd00ebc #> 7 Apis florea species 92dca82a063fedd1da94b3f3972d7b22 #> 8 Apis koschevnikovi species 4bbc06b9dfbde0b72c619810b564c6e6 #> 9 Apis mellifera species 67cbbcf92cd60748759e58e802d98518 #> 10 Apis nigrocincta species 213668a26ba6d2aad9575218f10d422f #> 11 Ascosphaera apis species 088549f2fb602367e84d5ffdb8c1d4fc #> 12 Candida apis species 3219a9635d3438e8b76a645cecf87287 #> 13 Eristalis apis species 16d7c8023308d38f6bb831ed5fa82002 #> 14 Hister apis species d2d7483acf488b5ed932f49b0aa51d19 #> 15 Ifephylus apis species 9b4d00e009b58bbfc003b51bd3d0c6f0 #> 16 Impatiens nidus-apis species 6aecf448e6aa0cb46387066db94426d1 #> 17 Kirkaldykra apis species 70a68f13454abd937aabf56746f4a6ad #> 18 Mallota apis species 10c3c3921d2ea9f9425ef9fd41914520 #> 19 Melanosella mors-apis species 4ac238f1597847dbc7998d97b8d45a0e #> 20 Microdon apis species 9be92242562eb923e711dc24b7bbab9a #> 21 Nosema apis species 5b2838dfd0ec15844fc6f659f7580322 #> 22 Scutirodes apis species 164ab3ac910547bc945cdbb994be1ee5 #> 23 Spiroplasma apis species 789f91571ce55de4df9821f2d05efab0 #> 24 Trichomonascus apis species 17dc4d840323e2c5b87e67a952f6dff3 #> 25 Pericystis apis species 088549f2fb602367e84d5ffdb8c1d4fc #> 26 Pericystis apis species 088549f2fb602367e84d5ffdb8c1d4fc #> 27 Torulopsis apis species 3219a9635d3438e8b76a645cecf87287 #> 28 Torulopsis apis species 3219a9635d3438e8b76a645cecf87287 #> 29 Apis aestuans species a517bc572c3c2697fe3bbfabc46a1493 #> 30 Apis alpina species f2781627115e4212ddab5979cdd425d2 #> 31 Apis bicornis species e67e82d00faae69da173bb31f9914056 #> 32 Apis canescens species d6b8850db971d65d6079e3a22f35e10e #> 33 Apis clypeata species 706060924801130f6c3abf454087c100 #> 34 Apis cunicularia species ebc3c5166ce2cabf419c4c6dc332cf3b #> 35 Apis etrusca species 6d27fd39a1d8b10050ba4e331987f3c9 #> 36 Apis globosa species 254c8e847ca4ff128bba57fe94deb98d #> 37 Apis hispanica species e8d2057a3efeb2cfdaebe27ea8191cd5 #> 38 Apis hypnorum species dfb743f54f50b9b9dbee378473542821 #> 39 Apis ichneumonea species 13c35287e20ab9373fa445dbc44981ea #> 40 Apis lapidaria species f8da5667af3562ebc0f6a83e1ec408f0 #> 41 Apis muscorum species 5bbfe59da5ce7fe59eb9ca3a7a45916c #> 42 Apis mystacea species fba8e4752a7fa5939a7eae293ba633ec #> 43 Apis obsoleta species da42bcb6cc0267903fb175f8a215aecb #> 44 Apis rostrata species e155a4277b66d1114182cafd875afbe3 #> 45 Apis rostrata species e155a4277b66d1114182cafd875afbe3 #> 46 Apis rufa species e67e82d00faae69da173bb31f9914056 #> 47 Apis signata species 551f101ad3b9bc17b24575585b2500c1 #> 48 Apis smaragdula species 4bc5c886b061e17e9aecb537a04c616d #> 49 Apis spinulosa species 56e7e9f854c9ed31ea6d0a06567607d0 #> 50 Apis subterranea species 3d2adff364a87bf7dd30524aa8071807 #> name_status kingdom family acc_name #> 1 accepted name Animalia Apidae #> 2 accepted name Bacteria Thermomonosporaceae #> 3 accepted name Animalia Calamoceratidae #> 4 accepted name Animalia Apidae #> 5 accepted name Animalia Apidae #> 6 accepted name Animalia Apidae #> 7 accepted name Animalia Apidae #> 8 accepted name Animalia Apidae #> 9 accepted name Animalia Apidae #> 10 accepted name Animalia Apidae #> 11 accepted name Fungi Ascosphaeraceae #> 12 accepted name Fungi Not assigned #> 13 accepted name Animalia Syrphidae #> 14 accepted name Animalia Histeridae #> 15 accepted name Animalia Miridae #> 16 accepted name Plantae Balsaminaceae #> 17 accepted name Animalia Cicadellidae #> 18 accepted name Animalia Syrphidae #> 19 accepted name Fungi Not assigned #> 20 accepted name Animalia Syrphidae #> 21 accepted name Protozoa Nosematidae #> 22 accepted name Animalia Noctuidae #> 23 accepted name Bacteria Spiroplasmataceae #> 24 accepted name Fungi Trichomonascaceae #> 25 ambiguous synonym Ascosphaera apis #> 26 ambiguous synonym Ascosphaera apis #> 27 ambiguous synonym Candida apis #> 28 ambiguous synonym Candida apis #> 29 synonym Xylocopa aestuans #> 30 synonym Bombus alpinus #> 31 synonym Osmia rufa #> 32 synonym Bembix canescens #> 33 synonym Lestica clypeata #> 34 synonym Colletes cunicularius #> 35 synonym Tachytes etruscus #> 36 synonym Exomalopsis similis #> 37 synonym Tachytes freygessneri #> 38 synonym Bombus hypnorum #> 39 synonym Sphex ichneumoneus #> 40 synonym Bombus lapidarius #> 41 synonym Bombus muscorum #> 42 synonym Argogorytes mystaceus #> 43 synonym Tachytes obsoletus #> 44 synonym Bembix rostrata #> 45 synonym Bembix rostrata #> 46 synonym Osmia rufa #> 47 synonym Stictia signata #> 48 synonym Ceratina smaragdula #> 49 synonym Hoplosmia spinulosa #> 50 synonym Bombus subterraneus ``` ``` #> $`015be25f6b061ba517f495394b80f108` #> childtaxa_id childtaxa_name childtaxa_rank #> 1 7a4a38c5095963949d6d6ec917d471de Apis andreniformis species #> 2 39610a4ceff7e5244e334a3fbc5e47e5 Apis cerana species #> 3 e1d4cbf3872c6c310b7a1c17ddd00ebc Apis dorsata species #> 4 92dca82a063fedd1da94b3f3972d7b22 Apis florea species #> 5 4bbc06b9dfbde0b72c619810b564c6e6 Apis koschevnikovi species #> 6 67cbbcf92cd60748759e58e802d98518 Apis mellifera species #> 7 213668a26ba6d2aad9575218f10d422f Apis nigrocincta species #> #> attr(,"class") #> [1] "children" #> attr(,"db") #> [1] "col" ``` The direct children (genera in this case) of _Pinaceae_ using NCBI data: ```r children("Pinaceae", db = "ncbi") ``` ``` #> $Pinaceae #> childtaxa_id childtaxa_name childtaxa_rank #> 1 123600 Nothotsuga genus #> 2 64685 Cathaya genus #> 3 3358 Tsuga genus #> 4 3356 Pseudotsuga genus #> 5 3354 Pseudolarix genus #> 6 3337 Pinus genus #> 7 3328 Picea genus #> 8 3325 Larix genus #> 9 3323 Keteleeria genus #> 10 3321 Cedrus genus #> 11 3319 Abies genus #> #> attr(,"class") #> [1] "children" #> attr(,"db") #> [1] "ncbi" ``` ## Get NCBI ID from GenBank Ids With accession numbers ```r genbank2uid(id = 'AJ748748') ``` ``` #> [1] "282199" #> attr(,"class") #> [1] "uid" #> attr(,"match") #> [1] "found" #> attr(,"multiple_matches") #> [1] FALSE #> attr(,"pattern_match") #> [1] FALSE #> attr(,"uri") #> [1] "http://www.ncbi.nlm.nih.gov/taxonomy/282199" ``` With gi numbers ```r genbank2uid(id = 62689767) ``` ``` #> [1] "282199" #> attr(,"class") #> [1] "uid" #> attr(,"match") #> [1] "found" #> attr(,"multiple_matches") #> [1] FALSE #> attr(,"pattern_match") #> [1] FALSE #> attr(,"uri") #> [1] "http://www.ncbi.nlm.nih.gov/taxonomy/282199" ``` ## Matching species tables with different taxonomic resolution Biologist often need to match different sets of data tied to species. For example, trait-based approaches are a promising tool in ecology. One problem is that abundance data must be matched with trait databases. These two data tables may contain species information on different taxonomic levels and possibly data must be aggregated to a joint taxonomic level, so that the data can be merged. taxize can help in this data-cleaning step, providing a reproducible workflow: We can use the mentioned `classification`-function to retrieve the taxonomic hierarchy and then search the hierarchies up- and downwards for matches. Here is an example to match a species with names on three different taxonomic levels. ```r A <- "gammarus roeseli" B1 <- "gammarus roeseli" B2 <- "gammarus" B3 <- "gammaridae" A_clas <- classification(A, db = 'ncbi') B1_clas <- classification(B1, db = 'ncbi') B2_clas <- classification(B2, db = 'ncbi') B3_clas <- classification(B3, db = 'ncbi') B1[match(A, B1)] ``` ``` #> [1] "gammarus roeseli" ``` ```r A_clas[[1]]$rank[tolower(A_clas[[1]]$name) %in% B2] ``` ``` #> [1] "genus" ``` ```r A_clas[[1]]$rank[tolower(A_clas[[1]]$name) %in% B3] ``` ``` #> [1] "family" ``` If we find a direct match (here *Gammarus roeseli*), we are lucky. But we can also match Gammaridae with *Gammarus roeseli*, but on a lower taxonomic level. A more comprehensive and realistic example (matching a trait table with an abundance table) is given in the vignette on matching. [eol]: http://www.eol.org/ [ncbi]: http://www.ncbi.nlm.nih.gov/ [itis]: http://www.itis.gov/ [wikispecies]: http://species.wikimedia.org/wiki/Main_Page [col]: http://www.catalogueoflife.org/ taxize/inst/doc/name_cleaning.Rmd0000644000176200001440000002470213125505152016530 0ustar liggesusers Strategies for programmatic name cleaning ========================================= `taxize` offers interactive prompts when using `get_*()` functions (e.g., `get_tsn()`). These prompts make it easy in interactive use to select choices when there are more than one match found. However, to make your code reproducible you don't want interactive prompts. This vignette covers some options for programmatic name cleaning. ```r library("taxize") ``` ## get_* functions When using `get_*()` functions programatically, you have a few options. ### rows parameter Normally, if you get more than one result, you get a prompt asking you to select which taxon you want. ```r get_tsn(searchterm = "Quercus b") #> tsn target commonnames nameusage #> 1 19298 Quercus beebiana not accepted #> 2 507263 Quercus berberidifolia scrub oak accepted #> 3 19300 Quercus bicolor swamp white oak accepted #> 4 19303 Quercus borealis not accepted #> 5 195131 Quercus borealis var. maxima not accepted #> 6 195166 Quercus boyntonii Boynton's sand post oak accepted #> 7 506533 Quercus brantii Brant's oak accepted #> 8 195150 Quercus breviloba not accepted #> 9 195099 Quercus breweri not accepted #> 10 195168 Quercus buckleyi Texas oak accepted #> #> More than one TSN found for taxon 'Quercus b'! #> #> Enter rownumber of taxon (other inputs will return 'NA'): #> #> 1: ``` Instead, we can use the rows parameter to specify which records we want by number only (not by a name itself). Here, we want the first 3 records: ```r get_tsn(searchterm = 'Quercus b', rows = 1:3) #> tsn target commonnames nameusage #> 1 19298 Quercus beebiana not accepted #> 2 19300 Quercus bicolor swamp white oak accepted #> 3 19303 Quercus borealis not accepted #> #> More than one TSN found for taxon 'Quercus b'! #> #> Enter rownumber of taxon (other inputs will return 'NA'): #> #> 1: ``` However, you still get a prompt as there is more than one result. Thus, for full programmatic usage, you can specify a single row, if you happen to know which one you want: ```r get_tsn(searchterm = 'Quercus b', rows = 3) #> [1] "19303" #> attr(,"match") #> [1] "found" #> attr(,"multiple_matches") #> [1] TRUE #> attr(,"pattern_match") #> [1] FALSE #> attr(,"uri") #> [1] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=19303" #> attr(,"class") #> [1] "tsn" ``` In reality it is unlikely you'll know which row you want, unless perhaps you just want one result from each query, regardless of what it is. ### underscore methods A better fit for programmatic use are underscore methods. Each `get_*()` function has a sister method with and trailing underscore, e.g., `get_tsn()` and `get_tsn_()`. ```r get_tsn_(searchterm = "Quercus b") #> $`Quercus b` #> # A tibble: 5 x 4 #> tsn scientificName commonNames #> #> 1 19300 Quercus bicolor swamp white oak,chne bicolore #> 2 195166 Quercus boyntonii Boynton's sand post oak,Boynton's oak #> 3 195168 Quercus buckleyi Texas oak,Buckley's oak #> 4 506533 Quercus brantii Brant's oak #> 5 507263 Quercus berberidifolia scrub oak #> # ... with 1 more variables: nameUsage ``` The result is a single data.frame for each taxon queried, which can be processed downstream with whatever logic is required in your workflow. You can also combine `rows` parameter with underscore functions, as a single number of a range of numbers: ```r get_tsn_(searchterm = "Quercus b", rows = 1) #> $`Quercus b` #> # A tibble: 1 x 4 #> tsn scientificName commonNames nameUsage #> #> 1 19300 Quercus bicolor swamp white oak,chne bicolore accepted ``` ```r get_tsn_(searchterm = "Quercus b", rows = 1:2) #> $`Quercus b` #> # A tibble: 2 x 4 #> tsn scientificName commonNames nameUsage #> #> 1 19300 Quercus bicolor swamp white oak,chne bicolore accepted #> 2 195166 Quercus boyntonii Boynton's sand post oak,Boynton's oak accepted ``` ## as.* methods All `get_*()` functions have associated `as.*()` functions (e.g., `get_tsn()` and `as.tsn()`). Many `taxize` functions use taxonomic identifier classes (S3 objects) that are the output of `get_*()` functions. `as.*()` methods make it easy to make the required S3 taxonomic identifier classes if you already know the identifier. For example: Already a tsn, returns the same ```r as.tsn(get_tsn("Quercus douglasii")) #> [1] "19322" #> attr(,"match") #> [1] "found" #> attr(,"multiple_matches") #> [1] FALSE #> attr(,"pattern_match") #> [1] FALSE #> attr(,"uri") #> [1] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=19322" #> attr(,"class") #> [1] "tsn" ``` numeric ```r as.tsn(c(19322, 129313, 506198)) #> [1] "19322" "129313" "506198" #> attr(,"class") #> [1] "tsn" #> attr(,"match") #> [1] "found" "found" "found" #> attr(,"multiple_matches") #> [1] FALSE FALSE FALSE #> attr(,"pattern_match") #> [1] FALSE FALSE FALSE #> attr(,"uri") #> [1] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=19322" #> [2] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=129313" #> [3] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=506198" ``` And you can do the same for character, or list inputs - depending on the data source. The above `as.tsn()` examples have the parameter `check = TRUE`, meaning we ping the data source web service to make sure the identifier exists. You can skip that check if you like by setting `check = FALSE`, and the result is returned much faster: ```r as.tsn(c("19322","129313","506198"), check = FALSE) #> [1] "19322" "129313" "506198" #> attr(,"class") #> [1] "tsn" #> attr(,"match") #> [1] "found" "found" "found" #> attr(,"multiple_matches") #> [1] FALSE FALSE FALSE #> attr(,"pattern_match") #> [1] FALSE FALSE FALSE #> attr(,"uri") #> [1] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=19322" #> [2] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=129313" #> [3] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=506198" ``` With the output of `as.*()` methods, you can then proceed with other `taxize` functions. ## gnr_resolve Some functions in `taxize` are meant specifically for name cleaning. One of those is `gnr_resolve()`. `gnr_resolve()` doesn't provide prompts as do `get_*()` functions, but instead return data.frame's. So we don't face the same problem, and can use `gnr_resolve()` in a programmatic workflow straight away. ```r spp <- names_list(rank = "species", size = 10) gnr_resolve(names = spp, preferred_data_sources = 11) #> user_supplied_name submitted_name #> 1 Helichrysum candollei Helichrysum candollei #> 2 Haworthia retusa Haworthia retusa #> 3 Crypsinus bakeri Crypsinus bakeri #> 4 Mangifera philippinensis Mangifera philippinensis #> 5 Selaginella atirrensis Selaginella atirrensis #> 6 Hymenostomum sullivanii Hymenostomum sullivanii #> 7 Hymenostomum sullivanii Hymenostomum sullivanii #> 8 Cytisus urumoffii Cytisus urumoffii #> 9 Cytisus urumoffii Cytisus urumoffii #> 10 Cytisus urumoffii Cytisus urumoffii #> 11 Baptisia uniflora Baptisia uniflora #> 12 Baptisia uniflora Baptisia uniflora #> 13 Baptisia uniflora Baptisia uniflora #> 14 Baptisia uniflora Baptisia uniflora #> 15 Nephelium xerocarpum Nephelium xerocarpum #> 16 Baccharis gnaphalioides Baccharis gnaphalioides #> 17 Baccharis gnaphalioides Baccharis gnaphalioides #> matched_name #> 1 Helichrysum candollei (Bojer ex DC.) R.Vig. & Humbert #> 2 Haworthia retusa (L.) Duval #> 3 Crypsinus bakeri (Luerss.) Tag. #> 4 Mangifera philippinensis Mukherji #> 5 Selaginella atirrensis Hieron. #> 6 Hymenostomum sullivanii C. Müller ex Geheeb, 1897 #> 7 Hymenostomum sullivanii C. Müller #> 8 Cytisus urumoffii Davidov ex Stoj. #> 9 Cytisus urumoffii Davidoff ex Stoyanoff #> 10 Cytisus urumoffii Davidoff #> 11 Baptisia uniflora Hook. #> 12 Baptisia uniflora (Michx.) Nutt. #> 13 Baptisia uniflora (Michx.) Sm. #> 14 Baptisia uniflora Spreng. #> 15 Nephelium xerocarpum (Bl.) Cambess. #> 16 Baccharis gnaphalioides Spreng. #> 17 Baccharis gnaphalioides DC. #> data_source_title score #> 1 GBIF Backbone Taxonomy 0.988 #> 2 GBIF Backbone Taxonomy 0.988 #> 3 GBIF Backbone Taxonomy 0.988 #> 4 GBIF Backbone Taxonomy 0.988 #> 5 GBIF Backbone Taxonomy 0.988 #> 6 GBIF Backbone Taxonomy 0.988 #> 7 GBIF Backbone Taxonomy 0.988 #> 8 GBIF Backbone Taxonomy 0.988 #> 9 GBIF Backbone Taxonomy 0.988 #> 10 GBIF Backbone Taxonomy 0.988 #> 11 GBIF Backbone Taxonomy 0.988 #> 12 GBIF Backbone Taxonomy 0.988 #> 13 GBIF Backbone Taxonomy 0.988 #> 14 GBIF Backbone Taxonomy 0.988 #> 15 GBIF Backbone Taxonomy 0.988 #> 16 GBIF Backbone Taxonomy 0.988 #> 17 GBIF Backbone Taxonomy 0.988 ``` ## Other functions Some other functions in `taxize` use `get_*()` functions internally (e.g., `classification()`), but you can can generally pass on parameters to the `get_*()` functions internally. ## Feedback? Let us know if you have ideas for better ways to do programmatic name cleaning at or ! taxize/inst/doc/taxize_infotable.Rmd0000644000176200001440000000422513125505152017275 0ustar liggesusers Some key functions in taxize, what they do, and their data sources. ====== Function name | What it does | Source | ----------- | ----------- | ----------- | `children` | Get direct children | COL, NCBI, ITIS | `classification` | Upstream classification | COL, NCBI, ITIS, Tropicos, EOL, GBIF, NBN | `comm2sci` | Get scientific from common names | EOL, NCBI, ITIS, Tropicos | `downstream` | Downstream taxa to specified rank | COL, ITIS, GBIF | `get_ids` | Get taxonomic identifiers | COL, NCBI, ITIS, Tropicos, EOL, GBIF, NBN | `resolve` | Resolve names using many resolvers | GNR, TNRS, iPlant | `gnr_resolve` | Resolve names using Global Names Resolver | GNR | `tnrs` | Phylotastic Taxonomic Name Resolution Service | NCBI, iPlant, MSW3 | `tol_resolve` | Resolve names using any resolver | TOL | `iplant_resolve` | iPlant name resolution| iPlant | `sci2comm` | Get common from scientific names | EOL, NCBI, ITIS | `synonyms` | Retrieve synonyms given input names/identifiers | COL, NCBI, ITIS, Tropicos | `upstream` | Retrieve upstream taxa given names/identifiers | COL, ITIS | `lowest_common` | Retrieve the lowest common taxon and rank for a given taxon name or ID | COL, ITIS, GBIF, TOL, NCBI | `genbank2uid` | Get NCBI taxonomy UID from GenBankID | NCBI | `tax_name` | Get taxonomic names for a given rank | NCBI, ITIS | `tax_rank` | Get rank for a given taxonomic name | BOLD, COL, EOL, GBIF, NATSERV, NBN, TOL, TROPICOS, ITIS, NCBI, WORMS | `tpl_get` | Get The Plant List csv files | TPL | ### Acronyms * COL: Catalogue of Life * NCBI: National Center for Biotechnology Information * ITIS: Integrated Taxonomic Information Service * EOL: Encylopedia of Life * GBIF: Global Biodiversity Information Facility * NBN: National Biodiversity Network (UK) * iPlant: iPlant Name Resolution Service * GNR: Global Names Resolver * TNRS: Taxonomic Name Resolution Service * TOL: Open Tree of Life * MSW3: Mammal Species of the World, 3rd Edition * TPL: The Plant List * BOLD: Barcode of Life * NATSERV: Natureserve * TROPICOS: Tropicos plant database * WORMS: World Register of Marine Species taxize/inst/doc/name_cleaning.html0000644000176200001440000006275613162233431016764 0ustar liggesusers Strategies for programmatic name cleaning

Strategies for programmatic name cleaning

taxize offers interactive prompts when using get_*() functions (e.g., get_tsn()). These prompts make it easy in interactive use to select choices when there are more than one match found.

However, to make your code reproducible you don't want interactive prompts.

This vignette covers some options for programmatic name cleaning.

library("taxize")

get_* functions

When using get_*() functions programatically, you have a few options.

rows parameter

Normally, if you get more than one result, you get a prompt asking you to select which taxon you want.

get_tsn(searchterm = "Quercus b")
#>       tsn                       target             commonnames    nameusage
#> 1   19298             Quercus beebiana                         not accepted
#> 2  507263       Quercus berberidifolia               scrub oak     accepted
#> 3   19300              Quercus bicolor         swamp white oak     accepted
#> 4   19303             Quercus borealis                         not accepted
#> 5  195131 Quercus borealis var. maxima                         not accepted
#> 6  195166            Quercus boyntonii Boynton's sand post oak     accepted
#> 7  506533              Quercus brantii             Brant's oak     accepted
#> 8  195150            Quercus breviloba                         not accepted
#> 9  195099              Quercus breweri                         not accepted
#> 10 195168             Quercus buckleyi               Texas oak     accepted
#>
#> More than one TSN found for taxon 'Quercus b'!
#>
#>             Enter rownumber of taxon (other inputs will return 'NA'):
#>
#> 1:

Instead, we can use the rows parameter to specify which records we want by number only (not by a name itself). Here, we want the first 3 records:

get_tsn(searchterm = 'Quercus b', rows = 1:3)
#>     tsn           target     commonnames    nameusage
#> 1 19298 Quercus beebiana                 not accepted
#> 2 19300  Quercus bicolor swamp white oak     accepted
#> 3 19303 Quercus borealis                 not accepted
#>
#> More than one TSN found for taxon 'Quercus b'!
#>
#>             Enter rownumber of taxon (other inputs will return 'NA'):
#>
#> 1:

However, you still get a prompt as there is more than one result.

Thus, for full programmatic usage, you can specify a single row, if you happen to know which one you want:

get_tsn(searchterm = 'Quercus b', rows = 3)
#> [1] "19303"
#> attr(,"match")
#> [1] "found"
#> attr(,"multiple_matches")
#> [1] TRUE
#> attr(,"pattern_match")
#> [1] FALSE
#> attr(,"uri")
#> [1] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=19303"
#> attr(,"class")
#> [1] "tsn"

In reality it is unlikely you'll know which row you want, unless perhaps you just want one result from each query, regardless of what it is.

underscore methods

A better fit for programmatic use are underscore methods. Each get_*() function has a sister method with and trailing underscore, e.g., get_tsn() and get_tsn_().

get_tsn_(searchterm = "Quercus b")
#> $`Quercus b`
#> # A tibble: 5 x 4
#>      tsn         scientificName                           commonNames
#>    <chr>                  <chr>                                 <chr>
#> 1  19300        Quercus bicolor     swamp white oak,ch<ea>ne bicolore
#> 2 195166      Quercus boyntonii Boynton's sand post oak,Boynton's oak
#> 3 195168       Quercus buckleyi               Texas oak,Buckley's oak
#> 4 506533        Quercus brantii                           Brant's oak
#> 5 507263 Quercus berberidifolia                             scrub oak
#> # ... with 1 more variables: nameUsage <chr>

The result is a single data.frame for each taxon queried, which can be processed downstream with whatever logic is required in your workflow.

You can also combine rows parameter with underscore functions, as a single number of a range of numbers:

get_tsn_(searchterm = "Quercus b", rows = 1)
#> $`Quercus b`
#> # A tibble: 1 x 4
#>     tsn  scientificName                       commonNames nameUsage
#>   <chr>           <chr>                             <chr>     <chr>
#> 1 19300 Quercus bicolor swamp white oak,ch<ea>ne bicolore  accepted
get_tsn_(searchterm = "Quercus b", rows = 1:2)
#> $`Quercus b`
#> # A tibble: 2 x 4
#>      tsn    scientificName                           commonNames nameUsage
#>    <chr>             <chr>                                 <chr>     <chr>
#> 1  19300   Quercus bicolor     swamp white oak,ch<ea>ne bicolore  accepted
#> 2 195166 Quercus boyntonii Boynton's sand post oak,Boynton's oak  accepted

as.* methods

All get_*() functions have associated as.*() functions (e.g., get_tsn() and as.tsn()).

Many taxize functions use taxonomic identifier classes (S3 objects) that are the output of get_*() functions. as.*() methods make it easy to make the required S3 taxonomic identifier classes if you already know the identifier. For example:

Already a tsn, returns the same

as.tsn(get_tsn("Quercus douglasii"))
#> [1] "19322"
#> attr(,"match")
#> [1] "found"
#> attr(,"multiple_matches")
#> [1] FALSE
#> attr(,"pattern_match")
#> [1] FALSE
#> attr(,"uri")
#> [1] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=19322"
#> attr(,"class")
#> [1] "tsn"

numeric

as.tsn(c(19322, 129313, 506198))
#> [1] "19322"  "129313" "506198"
#> attr(,"class")
#> [1] "tsn"
#> attr(,"match")
#> [1] "found" "found" "found"
#> attr(,"multiple_matches")
#> [1] FALSE FALSE FALSE
#> attr(,"pattern_match")
#> [1] FALSE FALSE FALSE
#> attr(,"uri")
#> [1] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=19322" 
#> [2] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=129313"
#> [3] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=506198"

And you can do the same for character, or list inputs - depending on the data source.

The above as.tsn() examples have the parameter check = TRUE, meaning we ping the data source web service to make sure the identifier exists. You can skip that check if you like by setting check = FALSE, and the result is returned much faster:

as.tsn(c("19322","129313","506198"), check = FALSE)
#> [1] "19322"  "129313" "506198"
#> attr(,"class")
#> [1] "tsn"
#> attr(,"match")
#> [1] "found" "found" "found"
#> attr(,"multiple_matches")
#> [1] FALSE FALSE FALSE
#> attr(,"pattern_match")
#> [1] FALSE FALSE FALSE
#> attr(,"uri")
#> [1] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=19322" 
#> [2] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=129313"
#> [3] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=506198"

With the output of as.*() methods, you can then proceed with other taxize functions.

gnr_resolve

Some functions in taxize are meant specifically for name cleaning. One of those is gnr_resolve().

gnr_resolve() doesn't provide prompts as do get_*() functions, but instead return data.frame's. So we don't face the same problem, and can use gnr_resolve() in a programmatic workflow straight away.

spp <- names_list(rank = "species", size = 10)
gnr_resolve(names = spp, preferred_data_sources = 11)
#>          user_supplied_name           submitted_name
#> 1     Helichrysum candollei    Helichrysum candollei
#> 2          Haworthia retusa         Haworthia retusa
#> 3          Crypsinus bakeri         Crypsinus bakeri
#> 4  Mangifera philippinensis Mangifera philippinensis
#> 5    Selaginella atirrensis   Selaginella atirrensis
#> 6   Hymenostomum sullivanii  Hymenostomum sullivanii
#> 7   Hymenostomum sullivanii  Hymenostomum sullivanii
#> 8         Cytisus urumoffii        Cytisus urumoffii
#> 9         Cytisus urumoffii        Cytisus urumoffii
#> 10        Cytisus urumoffii        Cytisus urumoffii
#> 11        Baptisia uniflora        Baptisia uniflora
#> 12        Baptisia uniflora        Baptisia uniflora
#> 13        Baptisia uniflora        Baptisia uniflora
#> 14        Baptisia uniflora        Baptisia uniflora
#> 15     Nephelium xerocarpum     Nephelium xerocarpum
#> 16  Baccharis gnaphalioides  Baccharis gnaphalioides
#> 17  Baccharis gnaphalioides  Baccharis gnaphalioides
#>                                             matched_name
#> 1  Helichrysum candollei (Bojer ex DC.) R.Vig. & Humbert
#> 2                            Haworthia retusa (L.) Duval
#> 3                        Crypsinus bakeri (Luerss.) Tag.
#> 4                      Mangifera philippinensis Mukherji
#> 5                         Selaginella atirrensis Hieron.
#> 6      Hymenostomum sullivanii C. Müller ex Geheeb, 1897
#> 7                      Hymenostomum sullivanii C. Müller
#> 8                     Cytisus urumoffii Davidov ex Stoj.
#> 9                Cytisus urumoffii Davidoff ex Stoyanoff
#> 10                            Cytisus urumoffii Davidoff
#> 11                               Baptisia uniflora Hook.
#> 12                      Baptisia uniflora (Michx.) Nutt.
#> 13                        Baptisia uniflora (Michx.) Sm.
#> 14                             Baptisia uniflora Spreng.
#> 15                   Nephelium xerocarpum (Bl.) Cambess.
#> 16                       Baccharis gnaphalioides Spreng.
#> 17                           Baccharis gnaphalioides DC.
#>         data_source_title score
#> 1  GBIF Backbone Taxonomy 0.988
#> 2  GBIF Backbone Taxonomy 0.988
#> 3  GBIF Backbone Taxonomy 0.988
#> 4  GBIF Backbone Taxonomy 0.988
#> 5  GBIF Backbone Taxonomy 0.988
#> 6  GBIF Backbone Taxonomy 0.988
#> 7  GBIF Backbone Taxonomy 0.988
#> 8  GBIF Backbone Taxonomy 0.988
#> 9  GBIF Backbone Taxonomy 0.988
#> 10 GBIF Backbone Taxonomy 0.988
#> 11 GBIF Backbone Taxonomy 0.988
#> 12 GBIF Backbone Taxonomy 0.988
#> 13 GBIF Backbone Taxonomy 0.988
#> 14 GBIF Backbone Taxonomy 0.988
#> 15 GBIF Backbone Taxonomy 0.988
#> 16 GBIF Backbone Taxonomy 0.988
#> 17 GBIF Backbone Taxonomy 0.988

Other functions

Some other functions in taxize use get_*() functions internally (e.g., classification()), but you can can generally pass on parameters to the get_*() functions internally.

Feedback?

Let us know if you have ideas for better ways to do programmatic name cleaning at https://github.com/ropensci/taxize/issues or https://discuss.ropensci.org/ !

taxize/inst/doc/taxize_infotable.html0000644000176200001440000001260113162233431017513 0ustar liggesusers Some key functions in taxize, what they do, and their data sources.

Some key functions in taxize, what they do, and their data sources.

Function name What it does Source
children Get direct children COL, NCBI, ITIS
classification Upstream classification COL, NCBI, ITIS, Tropicos, EOL, GBIF, NBN
comm2sci Get scientific from common names EOL, NCBI, ITIS, Tropicos
downstream Downstream taxa to specified rank COL, ITIS, GBIF
get_ids Get taxonomic identifiers COL, NCBI, ITIS, Tropicos, EOL, GBIF, NBN
resolve Resolve names using many resolvers GNR, TNRS, iPlant
gnr_resolve Resolve names using Global Names Resolver GNR
tnrs Phylotastic Taxonomic Name Resolution Service NCBI, iPlant, MSW3
tol_resolve Resolve names using any resolver TOL
iplant_resolve iPlant name resolution iPlant
sci2comm Get common from scientific names EOL, NCBI, ITIS
synonyms Retrieve synonyms given input names/identifiers COL, NCBI, ITIS, Tropicos
upstream Retrieve upstream taxa given names/identifiers COL, ITIS
lowest_common Retrieve the lowest common taxon and rank for a given taxon name or ID COL, ITIS, GBIF, TOL, NCBI
genbank2uid Get NCBI taxonomy UID from GenBankID NCBI
tax_name Get taxonomic names for a given rank NCBI, ITIS
tax_rank Get rank for a given taxonomic name BOLD, COL, EOL, GBIF, NATSERV, NBN, TOL, TROPICOS, ITIS, NCBI, WORMS
tpl_get Get The Plant List csv files TPL

Acronyms

  • COL: Catalogue of Life
  • NCBI: National Center for Biotechnology Information
  • ITIS: Integrated Taxonomic Information Service
  • EOL: Encylopedia of Life
  • GBIF: Global Biodiversity Information Facility
  • NBN: National Biodiversity Network (UK)
  • iPlant: iPlant Name Resolution Service
  • GNR: Global Names Resolver
  • TNRS: Taxonomic Name Resolution Service
  • TOL: Open Tree of Life
  • MSW3: Mammal Species of the World, 3rd Edition
  • TPL: The Plant List
  • BOLD: Barcode of Life
  • NATSERV: Natureserve
  • TROPICOS: Tropicos plant database
  • WORMS: World Register of Marine Species
taxize/inst/vign/0000755000176200001440000000000013162233432013475 5ustar liggesuserstaxize/inst/vign/cache/0000755000176200001440000000000012672106003014536 5ustar liggesuserstaxize/inst/vign/cache/taxname_0f3fcc7119f159af267de7a029f64f5e.RData0000644000176200001440000000535712672106003023657 0ustar liggesusers‹eVi8l3Ù‰¯×ÙšQŒû’eìÊL‘³doìdISB–}ßj”BQÂXCYb¢E–f¬ a%£>¾÷Ï{}ßùq?ç\ç>çy~>öÆh8š àþíÓCûÀ8àÝ?Ôìq¾„k>jD"a_ î/ùïÛ÷÷9µïÁK.RG·NjyP…t€P•tŸIêg6ï;/{Ö°Ê»JXt¤“¯£—’™{† %çOÛG‹´#Ûãù“ …` £rx× C‘å÷©ó#7h1Çž¨FªçO x>LQühTÔ}­ÄZ4˜ëqqf >øÕ2G6í)y}HõðûZXËÀ=þHeúYÃqWä´ŒóLêÊÇæKõš†“NÎü]³â\—EýˆHz{_ ü%;Lô©þۨɷ›Åa9°jê3®a8~eÃâù^µêS£/°«F}ÉA2NB^Îcx-o fcø7»™çeqO„k»½Ð£‘ýàbCHVÖ^ZRDÄ­r]­½»ŒŸWì;m¶Gå.z%_LkF¶D&-6¢mÓaتx=0fYHÞË*Êc”§žˆ*j¿¨û“µ J,OsÕ?Ô9ßW¿+r…œÖ˜ýÎóÑn+c8‡äòD1™êü) o'–T"=WO;º²'¿â2üMø–¢¼óS'3R²êýa¢êðOÆíÏw’[ [æÔN¼1´“̱àñÖ_K9•öÊyÆfÊ =+‰Í¿ ƒ…éÉ<òsTÄCÃO0ôíõó~LµþñŒ¸ž„¥„CÙÝEž’hBïœJé¦ÜcQؘ`1¨;pâ:¤w4ǧ8âë!ÎWI'«x2ºüpê–W5y%R°SÓše±¬væÁš2!ã•™çÚë/;-7 8‰O؆‹bzU. b@Y•SqiÀaæD`ýs*;¹¥æÜövw÷XºÅž6£”'Nó’­¦F¯¼ßñÄ2x{ÙZÖn–1Ý.›[ºàÅ„t»ÿ‡–š½_ÕË,“AˆX‘þ¥o %ßj&`pC=¿Í™àbß°Kº—]aæéøÁ]á{÷{‡ëTUªUKÔŸÍΊ‘’óµîç®…ÌóÉÑ-§z†· ¤Ê*¶…™)_á3::^‡-sO‡LÊü4 Zü1UuªÄÑ®IØ)M³Úæ¸6NîM~!&êÃÔ=ÉGy™{STýÚ”^PfL¬«ÂeaFXè2¥ 4'¯^UùØämI𤀳²QêP½q0Àå!ËÁ˜gak~I¢è\\¼*§cG6n^óIÛ¬QŠÏ TçÞev(n@rcE;þ,ê¨5"Â^.nq‡ >Þd<'~¤ð­Þõi´õ©æs[4Õæ—Ž—˜†J™âËU4P-/]•ä&Ÿ œ/Ÿô‹PJØ ¤žµÉhPáÏ v®¸Œ›ÎÊÂŒlë´ÁÞ—Š$Ò¥EÊíR=˜†ïiýç ÞÅÁ_^PŠéØy-ì•¥(¡§ÈBS¤ÿéßúd‘–ù?oD7kK’¿Iÿ[¬‰ÒtJ×±M (k³ÚR~«![[cR(OHPý EWâc©¬c lZó·ïÑß%ZÀÕ+Š$!û³ã€ ú¡–xï0ž[u––<"9uIÌ€?ýBmLf‡G(ôns»bdÔÕ±"¤]CÓšD$ß*¼YÁØrŠŽÍ»q¶Ú cÞ~˜†)Á€O{æv(W£°B_k#Îüà¦SwÚ¡ÑE£g4çæis4*<ñ¹§¾•KyÝŠ`£Ùg¤N#¹XR˜1´°=ñÈQN¿]$”UP¬Ò2ÚO(‹Â65ßèH²hU\R·yÒI\GÊ Ìý“5ÆNÝ0‘·ùvÁ×÷i´2º5RÅþ{f:]åu¨¡ M  †É®”µe:º—²¼0fž1'\ÿ/ºneÏõ`<úpÄÖ¶5¿Ì«ÿë^‡—m}½«JŠD Oè~¶2†˜n<‡ añN9?_¬P_9Ö?æ–ð‰yþ$üǪ?5¯ó²«4z³v]Ô¿²Æ€t“v˜gÞñKþ`GƒåDKMãj ØJf-N9rñ¸'RóQxÌ6û;llíB[É5¸º$ÏSñ¬µñ×Õ#tQžð¥díôlsƒ!ç9v®ºEÈT‚´™„PäÒÔæá?Š—fK H³¹Ëþ›BwÈ ”üÅ´2„Á97~ó1½ÃK³×MÿݹL‰wi›;¾‹”NL1-„.湚Ü%°Òu;¿óUäçG¡è"s`=Š"ÛBõ,£¹îÐô¾U‰9'T•Ö”4Œ½?7òÌ©gj».m.ߪxw,)QWŠLSw³ó‡N£V{ÖSŒw®5 'Qg‘cRdë›ÙHÝ$'0·rsGP„9\µaK(¤/?$—¾î”WœãîÀ§ÚкNÃà›ž¬67Ï躩۴® ó(¡^óà8©¦‡JÖ¼Þ9¿xj’+rÂT$/˜¿ÿÄ o ‡¡ËG7º:Õ…sR¨*·ÕÚ÷ ªGå‹Ï«ÏÆ!¯½oF‰¾²Ìΰré¹|ÝÎïU¬w©ÓI”òaå´FÇ0±æäŠ,q~œKÐíœË p0ZY=x´Z6XY®ì–^°A—_)ׯ)Ö6  c‰¯œN^<n‰´¸ƒ¨ÐkŠFÄ—:;J±{Px½Té(íêÖ`}詆¯©óšÔÃ!2¥æ©»B桌e?3HÑ’3år”ßÂÜâCÈà%?ð›ý¤ürÚ\È®b>[×·¾¢ÏõZ‘ï-èÎâRkmR’–ØŸœ?Ž4Ûº¨ô#b!ƒ·Ø°òõ Jpu¥£aîˆöÀÕ…‰ceÎÙI ¢Ûõ taxize/inst/vign/cache/tnrs_c39c1e0c556437f6b37ba3c369e8be54.rdb0000644000176200001440000000022712672106003022666 0ustar liggesusersÊxœ5Ž9Â@ E­„" v.0W¡A4H4´Ž3!–[š…óãbRx{ÿËö{ ´åÖZ8Zt°‚µÕÓÝFÉsIEJIUØõ,ÆH%kÌv½¢Ù Öy8¹/~„'¦…žšÐž4 /ø|ó)²±ÈÈ‚ä«ryiì˜ñè%cÐåíGF—0ûþÓÌ.utaxize/inst/vign/cache/tnrs_c39c1e0c556437f6b37ba3c369e8be54.RData0000644000176200001440000000576012672106003023121 0ustar liggesusers‹m–y<ÔÝǧ™È¡GhC"†Æ:jìK–±+™132Œ™13¶,I YBö}+J¡Rб†²ÄD‹,ÍX“„‰¨P¿Ñóôúõ׳ée /ÎÌÕjR Çœ\óøÛ§Ä¹Oîß›Nƒ'<¹"%ö:3Xô–þ“ð±'+…ÁY°ª²Û¦²Œê>#¥ Aƒ§ Îçm˜—‰iÖ-k¯s‰«>c®E;zÆ--nÁ>-–¢Üî2ÍC©H¦|Ã%Æ~ ~XïŒ*¹Äz|‰À¾g´€ä%ìW³¦œZ¶¸³Q½eôvÚ¨»7ÑŸ“W²©ÏÕ£.¼–gû2]øW:XG¥Ñ7…ïvÀ» »ÂzÄ Á) ¡¡çKuµ6.1¿à?²o³ù<$sÛ% xmz×hpUdÌb9Â6†ªŒÕs™’õ± Çñ4ªæ" ZŽë~b¯€âKCR<@µ×tŽvÄÔ®‰ž"§Ôe>õ¾¾ÖÄÈòt»)ŸXæú2k·3¡äyG%e׆ì‚ÛÀ[áóò:ªm/k¼Ya’•϶㠽Àïi^]Llº.l=”uwô±¡d–=ƒ±~_Ì¥°QÊ3sÿ]ÎK°yÀ±}ŸL¨ýï?ŒW*r´«vJs¦[}ÞBš‹ÛÓ•xOV#üùøeÉë9éãeúw“º@éQÕÒîr'…™ÁAó‘yAY9µPÅÝc$ÅÆ\’ûknרŽð-€6ªú«$RŽÁÍÍ«¤=¸|Žä›²R­€˜¨Ê¾ÄÂ~‰ô’ëÊ[0‡‘»|ËBCí¡ªâÉbûë§eæ?Ñ;3ál}¨áÈ*Úpßñ«ÜP!\xR ’ºËË€nyȦgJ'="‘E볞¿JF€ò?-û·pǤû~Xfd[£-F8Q ‘ºG¤ÔþZžeøŒÞsK( x}/²šÑBš º…È7EPÔ¿é“Eeüðöª$)‚±wg-©é”ªc©¨ÍnNú¦ŒhjŠJмé Ñå‘GrÇßÊØ= B¥4¼}ñN¢QL jAÞSÈþð ±µ1–Ìs¾ÆÒ’G$«&uð½G¨™ÅjÅA.5´È‡…Ÿ€ ìÖ”ã[Tm3¶\ƒ8Gçœ=\e¶¨Ú²îRä"¦îݪX…D ½¹ªña£ìK $¢À¢|HC-Þqz†>M/S¿ã­oåVZ³ Xgö ¡SG.”föÏÎEŒ^w”Ño bç*5õ`KÂQõ g[,šäçTln¶á–ûàæ”DµáCgLdmÞóu¿ªˆhJ ¬\ß;9‘ªô(ÈPÐ& PÍ?‰X¯¶e9z³}\̼£¸ïí)8ceÏ}u$b{ ØÖ¼:3Ï«ÿõr«mm­»R’Í7?t¥U…‹«;‚ dóŽ»Þy_®²°»g¸.áuçfȇEJYNÛI÷=Î+u°3¢”ŠjÏsôí<3ޝsûZZ‚µÔœéÜ#m%3Þ;róxÅ—å"1.Ÿ×ßÁ†?k ¸Çh‹s²<巛꾞ÞÁå ™KÑNÍ47èwf£¦«ªØtp³I`¤LŠòŒê‡Â¹©b,Âlú$eEè"9 „”=žR·ÀºfÇ®Ü`´š è¶âº©ßÚæ#c½›§÷¯!$„ã“LEó!ÆÛ yN'¶ ,´_È}èòFäÓ ¡ˆ{"Óbz‘òëÐÃ̆†C+‚p¾ÂE=G¨2¥>auezéUËÒözUÜPºZþtwB¼®™®âaGL ;—’Œ¿:ÁÃ#†¥ÈÖç2º NbÛZ»"¬Ê…P[l>cþ¹øQ›¬üô¶vL² ½]¦ºâÍnöðލ¿@o/7ê2ˆ‘Z®¿¦ð}ÉÁç©ë½[&Ù"ÛYòäYóg/Y!Í!0äìûÒ¡åö¶>cá,¸²Òcñ ý]/Н¸÷jñöøá\¸è#!Ëtá4+·Î“gì(¢•™èmN¢‘ÏÔµ\t ã;`NAˆ"×gû=ƒhÑXݶé´È-Ì&v'ÆÙÈY:@Q¦ä¼^€A»_1÷¸‹S´m Ìß_1‘ø~wˆ%Ââ"¼\¯>[ìêš/µÞ‰Äè%ï ×-[íëfôßR#šº~”‚àÂ’:`Þº džÈáÌÛIZ2¦Ü޲«.ûùà2xÉWý¦^*ÞŸ0rTU2Ÿªé^ZÐç~$Ï÷tñý\ÓÝ„­ß[Ñ´çTsò¸Â‡ÐÙœ·z„Šgü+Ī*̘§wh÷žžÝ]âš™À#ó|ui± ÊG9åØ|K±g0£¨™½o9Ò¹ÌÊ­sbœÚJvO….)CB»“µÞ¶GlQÈvãv™å56 ÈõìöeF=ІÓÏßýK®¨[Æ»Eê ÃàuT™Õ'!{)š?W ³n†g”•Fº3¯½³ßÒóíKÙÖ¹÷?ë4=îÙ–ÍÌX´v,I|7VÏÔrÏ+´{åU,g'bUnhÍ6.K‹ýhÊyÌÜç›Ü ÕòWÐåg4Þ¨.^[›É¶çf&«±ÓòSN¢­úþûžEÚ߈Ǿy¤»cÛÓú0»3 “¥lÆš”Ð!¸„K6ÁgþeØÇÐØûy×¹2ªjÃQ@aY]õ*¿ÜQñ„K “u8wÈg FPQ6#×áB° MÎb¸îb’¡øº Mx¡xMF”«4(qÌ´“ñý‘­Iæd(ñþ›—Ö£Qß›¶A²ÿZÞºbñå?ÿzJÊ4Æ §B#R¨î5m w£¡¡©®¦å©é¡¦åVèijãà8 uŽ¿ðÿµ 9> Eáó &¢}qT0 ÆÈCÌp<šHóò§‚ÑD¢¿?¢†Øâ‰œ1†D¤‘(´€„æLû£7m<ì‹>MÄ{â1ÂóBìIT4ƒ&à=I"þ‡Ÿ)ŽJóÇpt"ODcp›ÔDñà¬MÂ`ðX‘†&8;B¬ÐX<LEÓphˆßæéäýüq”`°øŸx•ÀT’?ƒãÞ–À‰ÙÝÑÚÞ¢p¬†bä5k)¸mžïG'£ þÙ¨þ¾x ‡Ý\ç'Dc08ò/ìïÅñX0C¢à6å0ðbýq’ñK8`ð!emíM¹*ü{þ€Ð–«ýæ¿“ýá~eÿ•knÊÕÿ9æ¿nòèw9|S®þ¥ý¼üßÐ&ûãîš?ý~½×ß>àw¹Ö¦\‹ãõ[]þ‘ýKÎi°M9ü‡ùŸŠüý!uÚ›¥Ãy1ßþþ×46u taxize/inst/vign/cache/tnrs_c39c1e0c556437f6b37ba3c369e8be54.rdx0000644000176200001440000000020312672106003022706 0ustar liggesusers‹‹àb```b`f’Ì ¦0`†ÒŒ@Ì –‡€é ,L`qN Íš—˜›Z d ²çV„ÿAÍa€ècüUÊ‘cà‚ÚÁˆ&Ï 5г,±(31)hD€«(5-µ(5/!’œŸ[P”Z\œš2~>XÏtaxize/inst/vign/cache/__packages0000644000176200001440000000026612672106003016541 0ustar liggesusersbase devtools knitr plyr Rdocumentation sacbox slidify slidifyLibraries taxize scimapClient httr XML bitops RCurl curl stringr jsonlite foreach ape reshape2 data.table bold testthat taxize/inst/vign/cache/taxname_0f3fcc7119f159af267de7a029f64f5e.rdx0000644000176200001440000000016112672106003023445 0ustar liggesusers‹ULË €0 ˶“àÏy³‚à¦làç«d…&!i3ZJ2ª"õ1憹‹.PfÑ×W{(î6ƒ}ŸßmrõšÓ¥ÕM—VÃ&Z(Qô¿ã÷p$Ê™æRúx¤ƒÕ°taxize/inst/vign/cache/taxname_0f3fcc7119f159af267de7a029f64f5e.rdb0000644000176200001440000000000012672106003023407 0ustar liggesuserstaxize/inst/vign/taxize_infotable.md0000644000176200001440000000422513125505112017345 0ustar liggesusers Some key functions in taxize, what they do, and their data sources. ====== Function name | What it does | Source | ----------- | ----------- | ----------- | `children` | Get direct children | COL, NCBI, ITIS | `classification` | Upstream classification | COL, NCBI, ITIS, Tropicos, EOL, GBIF, NBN | `comm2sci` | Get scientific from common names | EOL, NCBI, ITIS, Tropicos | `downstream` | Downstream taxa to specified rank | COL, ITIS, GBIF | `get_ids` | Get taxonomic identifiers | COL, NCBI, ITIS, Tropicos, EOL, GBIF, NBN | `resolve` | Resolve names using many resolvers | GNR, TNRS, iPlant | `gnr_resolve` | Resolve names using Global Names Resolver | GNR | `tnrs` | Phylotastic Taxonomic Name Resolution Service | NCBI, iPlant, MSW3 | `tol_resolve` | Resolve names using any resolver | TOL | `iplant_resolve` | iPlant name resolution| iPlant | `sci2comm` | Get common from scientific names | EOL, NCBI, ITIS | `synonyms` | Retrieve synonyms given input names/identifiers | COL, NCBI, ITIS, Tropicos | `upstream` | Retrieve upstream taxa given names/identifiers | COL, ITIS | `lowest_common` | Retrieve the lowest common taxon and rank for a given taxon name or ID | COL, ITIS, GBIF, TOL, NCBI | `genbank2uid` | Get NCBI taxonomy UID from GenBankID | NCBI | `tax_name` | Get taxonomic names for a given rank | NCBI, ITIS | `tax_rank` | Get rank for a given taxonomic name | BOLD, COL, EOL, GBIF, NATSERV, NBN, TOL, TROPICOS, ITIS, NCBI, WORMS | `tpl_get` | Get The Plant List csv files | TPL | ### Acronyms * COL: Catalogue of Life * NCBI: National Center for Biotechnology Information * ITIS: Integrated Taxonomic Information Service * EOL: Encylopedia of Life * GBIF: Global Biodiversity Information Facility * NBN: National Biodiversity Network (UK) * iPlant: iPlant Name Resolution Service * GNR: Global Names Resolver * TNRS: Taxonomic Name Resolution Service * TOL: Open Tree of Life * MSW3: Mammal Species of the World, 3rd Edition * TPL: The Plant List * BOLD: Barcode of Life * NATSERV: Natureserve * TROPICOS: Tropicos plant database * WORMS: World Register of Marine Species taxize/inst/vign/taxize_vignette.md0000644000176200001440000010764713125502652017251 0ustar liggesusers taxize vignette - a taxonomic toolbelt for R ====== `taxize` is a taxonomic toolbelt for R. `taxize` wraps APIs for a large suite of taxonomic databases availab on the web. ## Installation First, install and load `taxize` into the R session. ```r install.packages("taxize") ``` ```r library("taxize") ``` Advanced users can also download and install the latest development copy from [GitHub](https://github.com/ropensci/taxize_). ## Resolve taxonomic name This is a common task in biology. We often have a list of species names and we want to know a) if we have the most up to date names, b) if our names are spelled correctly, and c) the scientific name for a common name. One way to resolve names is via the Global Names Resolver (GNR) service provided by the [Encyclopedia of Life][eol]. Here, we are searching for two misspelled names: ```r temp <- gnr_resolve(names = c("Helianthos annus", "Homo saapiens")) head(temp) ``` ``` #> user_supplied_name submitted_name matched_name #> 1 Helianthos annus Helianthos annus Helianthus annus #> 2 Helianthos annus Helianthos annus Helianthus annus L. #> 3 Helianthos annus Helianthos annus Helianthus annus #> 4 Helianthos annus Helianthos annus Helianthus annus #> 5 Helianthos annus Helianthos annus Helianthus annuus L. #> 6 Helianthos annus Helianthos annus Helianthus annuus L. #> data_source_title score #> 1 EOL 0.75 #> 2 EOL 0.75 #> 3 uBio NameBank 0.75 #> 4 Open Tree of Life Reference Taxonomy 0.75 #> 5 Catalogue of Life 0.75 #> 6 ITIS 0.75 ``` The correct spellings are *Helianthus annuus* and *Homo sapiens*. Another approach uses the Taxonomic Name Resolution Service via the Taxosaurus API developed by iPLant and the Phylotastic organization. In this example, we provide a list of species names, some of which are misspelled, and we'll call the API with the *tnrs* function. ```r mynames <- c("Helianthus annuus", "Pinus contort", "Poa anua", "Abis magnifica", "Rosa california", "Festuca arundinace", "Sorbus occidentalos","Madia sateva") tnrs(query = mynames, source = "iPlant_TNRS")[ , -c(5:7)] ``` ``` #> submittedname acceptedname sourceid score #> 1 Sorbus occidentalos Sorbus occidentalis iPlant_TNRS 0.99 #> 2 Festuca arundinace Festuca arundinacea iPlant_TNRS 0.99 #> 3 Abis magnifica Abies magnifica iPlant_TNRS 0.96 #> 4 Pinus contort Pinus contorta iPlant_TNRS 0.98 #> 5 Poa anua Poa annua iPlant_TNRS 0.96 #> 6 Madia sateva Madia sativa iPlant_TNRS 0.97 #> 7 Helianthus annuus Helianthus annuus iPlant_TNRS 1 #> 8 Rosa california Rosa californica iPlant_TNRS 0.99 ``` It turns out there are a few corrections: e.g., *Madia sateva* should be *Madia sativa*, and *Rosa california* should be *Rosa californica*. Note that this search worked because fuzzy matching was employed to retrieve names that were close, but not exact matches. Fuzzy matching is only available for plants in the TNRS service, so we advise using EOL's Global Names Resolver if you need to resolve animal names. taxize takes the approach that the user should be able to make decisions about what resource to trust, rather than making the decision. Both the EOL GNR and the TNRS services provide data from a variety of data sources. The user may trust a specific data source, thus may want to use the names from that data source. In the future, we may provide the ability for taxize to suggest the best match from a variety of sources. Another common use case is when there are many synonyms for a species. In this example, we have three synonyms of the currently accepted name for a species. ```r mynames <- c("Helianthus annuus ssp. jaegeri", "Helianthus annuus ssp. lenticularis", "Helianthus annuus ssp. texanus") (tsn <- get_tsn(mynames, accepted = FALSE)) ``` ``` [1] "525928" "525929" "525930" attr(,"match") [1] "found" "found" "found" attr(,"multiple_matches") [1] FALSE FALSE FALSE attr(,"pattern_match") [1] FALSE FALSE FALSE attr(,"uri") [1] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=525928" [2] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=525929" [3] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=525930" attr(,"class") [1] "tsn" ``` ```r lapply(tsn, itis_acceptname) ``` ``` [[1]] submittedtsn acceptedname acceptedtsn author 1 525928 Helianthus annuus 36616 L. [[2]] submittedtsn acceptedname acceptedtsn author 1 525929 Helianthus annuus 36616 L. [[3]] submittedtsn acceptedname acceptedtsn author 1 525930 Helianthus annuus 36616 L. ``` ## Retrieve higher taxonomic names Another task biologists often face is getting higher taxonomic names for a taxa list. Having the higher taxonomy allows you to put into context the relationships of your species list. For example, you may find out that species A and species B are in Family C, which may lead to some interesting insight, as opposed to not knowing that Species A and B are closely related. This also makes it easy to aggregate/standardize data to a specific taxonomic level (e.g., family level) or to match data to other databases with different taxonomic resolution (e.g., trait databases). A number of data sources in taxize provide the capability to retrieve higher taxonomic names, but we will highlight two of the more useful ones: [Integrated Taxonomic Information System (ITIS)][itis] and [National Center for Biotechnology Information (NCBI)][ncbi]. First, we'll search for two species, *Abies procera} and *Pinus contorta* within ITIS. ```r specieslist <- c("Abies procera","Pinus contorta") classification(specieslist, db = 'itis') ``` ``` #> $`Abies procera` #> name rank id #> 1 Plantae kingdom 202422 #> 2 Viridiplantae subkingdom 954898 #> 3 Streptophyta infrakingdom 846494 #> 4 Embryophyta superdivision 954900 #> 5 Tracheophyta division 846496 #> 6 Spermatophytina subdivision 846504 #> 7 Pinopsida class 500009 #> 8 Pinidae subclass 954916 #> 9 Pinales order 500028 #> 10 Pinaceae family 18030 #> 11 Abies genus 18031 #> 12 Abies procera species 181835 #> #> $`Pinus contorta` #> name rank id #> 1 Plantae kingdom 202422 #> 2 Viridiplantae subkingdom 954898 #> 3 Streptophyta infrakingdom 846494 #> 4 Embryophyta superdivision 954900 #> 5 Tracheophyta division 846496 #> 6 Spermatophytina subdivision 846504 #> 7 Pinopsida class 500009 #> 8 Pinidae subclass 954916 #> 9 Pinales order 500028 #> 10 Pinaceae family 18030 #> 11 Pinus genus 18035 #> 12 Pinus contorta species 183327 #> #> attr(,"class") #> [1] "classification" #> attr(,"db") #> [1] "itis" ``` It turns out both species are in the family Pinaceae. You can also get this type of information from the NCBI by doing `classification(specieslist, db = 'ncbi')`. Instead of a full classification, you may only want a single name, say a family name for your species of interest. The function *tax_name} is built just for this purpose. As with the `classification` function you can specify the data source with the `db` argument, either ITIS or NCBI. ```r tax_name(query = "Helianthus annuus", get = "family", db = "ncbi") ``` ``` #> db query family #> 1 ncbi Helianthus annuus Asteraceae ``` I may happen that a data source does not provide information on the queried species, than one could take the result from another source and union the results from the different sources. ## Interactive name selection As mentioned most databases use a numeric code to reference a species. A general workflow in taxize is: Retrieve Code for the queried species and then use this code to query more data/information. Below are a few examples. When you run these examples in R, you are presented with a command prompt asking for the row that contains the name you would like back; that output is not printed below for brevity. In this example, the search term has many matches. The function returns a data frame of the matches, and asks for the user to input what row number to accept. ```r get_uid(sciname = "Pinus") ``` ``` #> status rank division scientificname commonname uid genus #> 1 active subgenus seed plants Pinus hard pines 139271 #> 2 active genus seed plants Pinus 3337 #> species subsp modificationdate #> 1 2015/09/16 00:00 #> 2 2004/09/10 00:00 ``` ``` #> [1] "139271" #> attr(,"class") #> [1] "uid" #> attr(,"match") #> [1] "found" #> attr(,"multiple_matches") #> [1] TRUE #> attr(,"pattern_match") #> [1] FALSE #> attr(,"uri") #> [1] "https://www.ncbi.nlm.nih.gov/taxonomy/139271" ``` In another example, you can pass in a long character vector of taxonomic names (although this one is rather short for demo purposes): ```r splist <- c("annona cherimola", 'annona muricata', "quercus robur") get_tsn(searchterm = splist, searchtype = "scientific") ``` ``` #> [1] "506198" "18098" "19405" #> attr(,"match") #> [1] "found" "found" "found" #> attr(,"multiple_matches") #> [1] FALSE FALSE TRUE #> attr(,"pattern_match") #> [1] FALSE FALSE TRUE #> attr(,"uri") #> [1] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=506198" #> [2] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=18098" #> [3] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=19405" #> attr(,"class") #> [1] "tsn" ``` There are functions for many other sources * `get_boldid()` * `get_colid()` * `get_eolid()` * `get_gbifid()` * `get_nbnid()` * `get_tpsid()` Sometimes with these functions you get a lot of data back. In these cases you may want to limit your choices. Soon we will incorporate the ability to filter using `regex` to limit matches, but for now, we have a new parameter, `rows`, which lets you select certain rows. For example, you can select the first row of each given name, which means there is no interactive component: ```r get_nbnid(c("Zootoca vivipara","Pinus contorta"), rows = 1) ``` ``` #> [1] "NHMSYS0001706186" "NBNSYS0000004786" #> attr(,"class") #> [1] "nbnid" #> attr(,"match") #> [1] "found" "found" #> attr(,"multiple_matches") #> [1] TRUE TRUE #> attr(,"pattern_match") #> [1] FALSE FALSE #> attr(,"uri") #> [1] "https://data.nbn.org.uk/Taxa/NHMSYS0001706186" #> [2] "https://data.nbn.org.uk/Taxa/NBNSYS0000004786" ``` Or you can select a range of rows ```r get_nbnid(c("Zootoca vivipara","Pinus contorta"), rows = 1:3) ``` ``` #> nbnid scientificName rank #> 1 NHMSYS0001706186 Zootoca vivipara species #> 2 NHMSYS0020784960 Zootoca vivipara subsp. pannonica subspecies #> 3 NHMSYS0000461615 Bistorta vivipara species #> taxonomicStatus #> 1 accepted #> 2 accepted #> 3 synonym #> nbnid scientificName rank #> 1 NBNSYS0000004786 Pinus contorta species #> 2 NHMSYS0000494848 Pinus contorta subsp. contorta subspecies #> 3 NHMSYS0000494858 Pinus contorta subsp. murreyana subspecies #> taxonomicStatus #> 1 accepted #> 2 synonym #> 3 synonym ``` ``` #> [1] "NHMSYS0001706186" "NBNSYS0000004786" #> attr(,"class") #> [1] "nbnid" #> attr(,"match") #> [1] "found" "found" #> attr(,"multiple_matches") #> [1] TRUE TRUE #> attr(,"pattern_match") #> [1] FALSE FALSE #> attr(,"uri") #> [1] "https://data.nbn.org.uk/Taxa/NHMSYS0001706186" #> [2] "https://data.nbn.org.uk/Taxa/NBNSYS0000004786" ``` In addition, in case you don't want to do interactive name selection in the case where there are a lot of names, you can get all data back with functions of the form, e.g., `get_tsn_()`, and likewise for other data sources. For example: ```r out <- get_nbnid_("Poa annua") NROW(out$`Poa annua`) ``` ``` #> [1] 25 ``` That's a lot of data, so we can get only certain rows back ```r get_nbnid_("Poa annua", rows = 1:10) ``` ``` #> $`Poa annua` #> guid scientificName rank taxonomicStatus #> 1 NBNSYS0000002544 Poa annua species accepted #> 2 NBNSYS0000002739 Adonis annua species synonym #> 3 NBNSYS0200001901 Bellis annua species accepted #> 4 NHMSYS0000456951 Carrichtera annua species synonym #> 5 NBNSYS0200003392 Triumfetta annua species accepted #> 6 NBNSYS0000002918 Lunaria annua species accepted #> 7 NBNSYS0200002555 Lonas annua species accepted #> 8 NBNSYS0000033325 Artemisia annua species accepted #> 9 NHMSYS0000456951 Carrichtera annua species accepted #> 10 NHMSYS0000461806 Poa imbecilla species synonym ``` ## Coerce numerics/alphanumerics to taxon IDs We've also introduced in `v0.5` the ability to coerce numerics and alphanumerics to taxonomic ID classes that are usually only retrieved via `get_*()` functions. For example, adfafd ```r as.gbifid(get_gbifid("Poa annua")) # already a uid, returns the same ``` ``` #> gbifid scientificname rank status matchtype #> 1 2704179 Poa annua L. species ACCEPTED EXACT #> 2 8422205 Poa annua Cham. & Schltdl. species SYNONYM EXACT #> 3 7730008 Poa annua Steud. species DOUBTFUL EXACT ``` ``` #> [1] "2704179" #> attr(,"class") #> [1] "gbifid" #> attr(,"match") #> [1] "found" #> attr(,"multiple_matches") #> [1] TRUE #> attr(,"pattern_match") #> [1] FALSE #> attr(,"uri") #> [1] "http://www.gbif.org/species/2704179" ``` ```r as.gbifid(2704179) # numeric ``` ``` #> [1] "2704179" #> attr(,"class") #> [1] "gbifid" #> attr(,"match") #> [1] "found" #> attr(,"multiple_matches") #> [1] FALSE #> attr(,"pattern_match") #> [1] FALSE #> attr(,"uri") #> [1] "http://www.gbif.org/species/2704179" ``` ```r as.gbifid("2704179") # character ``` ``` #> [1] "2704179" #> attr(,"class") #> [1] "gbifid" #> attr(,"match") #> [1] "found" #> attr(,"multiple_matches") #> [1] FALSE #> attr(,"pattern_match") #> [1] FALSE #> attr(,"uri") #> [1] "http://www.gbif.org/species/2704179" ``` ```r as.gbifid(list("2704179","2435099","3171445")) # list, either numeric or character ``` ``` #> [1] "2704179" "2435099" "3171445" #> attr(,"class") #> [1] "gbifid" #> attr(,"match") #> [1] "found" "found" "found" #> attr(,"multiple_matches") #> [1] FALSE FALSE FALSE #> attr(,"pattern_match") #> [1] FALSE FALSE FALSE #> attr(,"uri") #> [1] "http://www.gbif.org/species/2704179" #> [2] "http://www.gbif.org/species/2435099" #> [3] "http://www.gbif.org/species/3171445" ``` These `as.*()` functions do a quick check of the web resource to make sure it's a real ID. However, you can turn this check off, making this coercion much faster: ```r system.time( replicate(3, as.gbifid(c("2704179","2435099","3171445"), check=TRUE)) ) ``` ``` #> user system elapsed #> 0.072 0.002 1.656 ``` ```r system.time( replicate(3, as.gbifid(c("2704179","2435099","3171445"), check=FALSE)) ) ``` ``` #> user system elapsed #> 0.002 0.000 0.002 ``` ## What taxa are downstream of my taxon of interest? If someone is not a taxonomic specialist on a particular taxon he likely does not know what children taxa are within a family, or within a genus. This task becomes especially unwieldy when there are a large number of taxa downstream. You can of course go to a website like [Wikispecies][wikispecies] or [Encyclopedia of Life][eol] to get downstream names. However, taxize provides an easy way to programatically search for downstream taxa, both for the [Catalogue of Life (CoL)][col] and the [Integrated Taxonomic Information System][itis]. Here is a short example using the CoL in which we want to find all the species within the genus *Apis* (honey bees). ```r downstream("Apis", downto = "Species", db = "col") ``` ``` #> name rank colid #> 1 Apis genus 015be25f6b061ba517f495394b80f108 #> 2 Actinomadura apis species 1182a102a18b40aa19385bf5f1f53367 #> 3 Anisocentropus apis species 8891d18874dde14e44df52e931c44206 #> 4 Apis andreniformis species 7a4a38c5095963949d6d6ec917d471de #> 5 Apis cerana species 39610a4ceff7e5244e334a3fbc5e47e5 #> 6 Apis dorsata species e1d4cbf3872c6c310b7a1c17ddd00ebc #> 7 Apis florea species 92dca82a063fedd1da94b3f3972d7b22 #> 8 Apis koschevnikovi species 4bbc06b9dfbde0b72c619810b564c6e6 #> 9 Apis mellifera species 67cbbcf92cd60748759e58e802d98518 #> 10 Apis nigrocincta species 213668a26ba6d2aad9575218f10d422f #> 11 Ascosphaera apis species 088549f2fb602367e84d5ffdb8c1d4fc #> 12 Candida apis species 3219a9635d3438e8b76a645cecf87287 #> 13 Eristalis apis species 16d7c8023308d38f6bb831ed5fa82002 #> 14 Hister apis species d2d7483acf488b5ed932f49b0aa51d19 #> 15 Ifephylus apis species 9b4d00e009b58bbfc003b51bd3d0c6f0 #> 16 Impatiens nidus-apis species 6aecf448e6aa0cb46387066db94426d1 #> 17 Kirkaldykra apis species 70a68f13454abd937aabf56746f4a6ad #> 18 Mallota apis species 10c3c3921d2ea9f9425ef9fd41914520 #> 19 Melanosella mors-apis species 4ac238f1597847dbc7998d97b8d45a0e #> 20 Microdon apis species 9be92242562eb923e711dc24b7bbab9a #> 21 Nosema apis species 5b2838dfd0ec15844fc6f659f7580322 #> 22 Scutirodes apis species 164ab3ac910547bc945cdbb994be1ee5 #> 23 Spiroplasma apis species 789f91571ce55de4df9821f2d05efab0 #> 24 Trichomonascus apis species 17dc4d840323e2c5b87e67a952f6dff3 #> 25 Pericystis apis species 088549f2fb602367e84d5ffdb8c1d4fc #> 26 Pericystis apis species 088549f2fb602367e84d5ffdb8c1d4fc #> 27 Torulopsis apis species 3219a9635d3438e8b76a645cecf87287 #> 28 Torulopsis apis species 3219a9635d3438e8b76a645cecf87287 #> 29 Apis aestuans species a517bc572c3c2697fe3bbfabc46a1493 #> 30 Apis alpina species f2781627115e4212ddab5979cdd425d2 #> 31 Apis bicornis species e67e82d00faae69da173bb31f9914056 #> 32 Apis canescens species d6b8850db971d65d6079e3a22f35e10e #> 33 Apis clypeata species 706060924801130f6c3abf454087c100 #> 34 Apis cunicularia species ebc3c5166ce2cabf419c4c6dc332cf3b #> 35 Apis etrusca species 6d27fd39a1d8b10050ba4e331987f3c9 #> 36 Apis globosa species 254c8e847ca4ff128bba57fe94deb98d #> 37 Apis hispanica species e8d2057a3efeb2cfdaebe27ea8191cd5 #> 38 Apis hypnorum species dfb743f54f50b9b9dbee378473542821 #> 39 Apis ichneumonea species 13c35287e20ab9373fa445dbc44981ea #> 40 Apis lapidaria species f8da5667af3562ebc0f6a83e1ec408f0 #> 41 Apis muscorum species 5bbfe59da5ce7fe59eb9ca3a7a45916c #> 42 Apis mystacea species fba8e4752a7fa5939a7eae293ba633ec #> 43 Apis obsoleta species da42bcb6cc0267903fb175f8a215aecb #> 44 Apis rostrata species e155a4277b66d1114182cafd875afbe3 #> 45 Apis rostrata species e155a4277b66d1114182cafd875afbe3 #> 46 Apis rufa species e67e82d00faae69da173bb31f9914056 #> 47 Apis signata species 551f101ad3b9bc17b24575585b2500c1 #> 48 Apis smaragdula species 4bc5c886b061e17e9aecb537a04c616d #> 49 Apis spinulosa species 56e7e9f854c9ed31ea6d0a06567607d0 #> 50 Apis subterranea species 3d2adff364a87bf7dd30524aa8071807 #> name_status kingdom family acc_name #> 1 accepted name Animalia Apidae #> 2 accepted name Bacteria Thermomonosporaceae #> 3 accepted name Animalia Calamoceratidae #> 4 accepted name Animalia Apidae #> 5 accepted name Animalia Apidae #> 6 accepted name Animalia Apidae #> 7 accepted name Animalia Apidae #> 8 accepted name Animalia Apidae #> 9 accepted name Animalia Apidae #> 10 accepted name Animalia Apidae #> 11 accepted name Fungi Ascosphaeraceae #> 12 accepted name Fungi Not assigned #> 13 accepted name Animalia Syrphidae #> 14 accepted name Animalia Histeridae #> 15 accepted name Animalia Miridae #> 16 accepted name Plantae Balsaminaceae #> 17 accepted name Animalia Cicadellidae #> 18 accepted name Animalia Syrphidae #> 19 accepted name Fungi Not assigned #> 20 accepted name Animalia Syrphidae #> 21 accepted name Protozoa Nosematidae #> 22 accepted name Animalia Noctuidae #> 23 accepted name Bacteria Spiroplasmataceae #> 24 accepted name Fungi Trichomonascaceae #> 25 ambiguous synonym Ascosphaera apis #> 26 ambiguous synonym Ascosphaera apis #> 27 ambiguous synonym Candida apis #> 28 ambiguous synonym Candida apis #> 29 synonym Xylocopa aestuans #> 30 synonym Bombus alpinus #> 31 synonym Osmia rufa #> 32 synonym Bembix canescens #> 33 synonym Lestica clypeata #> 34 synonym Colletes cunicularius #> 35 synonym Tachytes etruscus #> 36 synonym Exomalopsis similis #> 37 synonym Tachytes freygessneri #> 38 synonym Bombus hypnorum #> 39 synonym Sphex ichneumoneus #> 40 synonym Bombus lapidarius #> 41 synonym Bombus muscorum #> 42 synonym Argogorytes mystaceus #> 43 synonym Tachytes obsoletus #> 44 synonym Bembix rostrata #> 45 synonym Bembix rostrata #> 46 synonym Osmia rufa #> 47 synonym Stictia signata #> 48 synonym Ceratina smaragdula #> 49 synonym Hoplosmia spinulosa #> 50 synonym Bombus subterraneus ``` ``` #> $Apis #> childtaxa_id childtaxa_name childtaxa_rank #> 1 7a4a38c5095963949d6d6ec917d471de Apis andreniformis species #> 2 39610a4ceff7e5244e334a3fbc5e47e5 Apis cerana species #> 3 e1d4cbf3872c6c310b7a1c17ddd00ebc Apis dorsata species #> 4 92dca82a063fedd1da94b3f3972d7b22 Apis florea species #> 5 4bbc06b9dfbde0b72c619810b564c6e6 Apis koschevnikovi species #> 6 67cbbcf92cd60748759e58e802d98518 Apis mellifera species #> 7 213668a26ba6d2aad9575218f10d422f Apis nigrocincta species #> #> attr(,"class") #> [1] "downstream" #> attr(,"db") #> [1] "col" ``` We can also request data from ITIS ```r downstream("Apis", downto = "Species", db = "itis") ``` ``` #> $Apis #> tsn parentname parenttsn taxonname rankid rankname #> 1 154396 Apis 154395 Apis mellifera 220 species #> 2 763550 Apis 154395 Apis andreniformis 220 species #> 3 763551 Apis 154395 Apis cerana 220 species #> 4 763552 Apis 154395 Apis dorsata 220 species #> 5 763553 Apis 154395 Apis florea 220 species #> 6 763554 Apis 154395 Apis koschevnikovi 220 species #> 7 763555 Apis 154395 Apis nigrocincta 220 species #> #> attr(,"class") #> [1] "downstream" #> attr(,"db") #> [1] "itis" ``` ## Direct children You may sometimes only want the direct children. We got you covered on that front, with methods for ITIS, NCBI, and Catalogue of Life. For example, let's get direct children (species in this case) of the bee genus _Apis_ using COL data: ```r children(get_colid("Apis")) ``` ``` #> name rank colid #> 1 Apis genus 015be25f6b061ba517f495394b80f108 #> 2 Actinomadura apis species 1182a102a18b40aa19385bf5f1f53367 #> 3 Anisocentropus apis species 8891d18874dde14e44df52e931c44206 #> 4 Apis andreniformis species 7a4a38c5095963949d6d6ec917d471de #> 5 Apis cerana species 39610a4ceff7e5244e334a3fbc5e47e5 #> 6 Apis dorsata species e1d4cbf3872c6c310b7a1c17ddd00ebc #> 7 Apis florea species 92dca82a063fedd1da94b3f3972d7b22 #> 8 Apis koschevnikovi species 4bbc06b9dfbde0b72c619810b564c6e6 #> 9 Apis mellifera species 67cbbcf92cd60748759e58e802d98518 #> 10 Apis nigrocincta species 213668a26ba6d2aad9575218f10d422f #> 11 Ascosphaera apis species 088549f2fb602367e84d5ffdb8c1d4fc #> 12 Candida apis species 3219a9635d3438e8b76a645cecf87287 #> 13 Eristalis apis species 16d7c8023308d38f6bb831ed5fa82002 #> 14 Hister apis species d2d7483acf488b5ed932f49b0aa51d19 #> 15 Ifephylus apis species 9b4d00e009b58bbfc003b51bd3d0c6f0 #> 16 Impatiens nidus-apis species 6aecf448e6aa0cb46387066db94426d1 #> 17 Kirkaldykra apis species 70a68f13454abd937aabf56746f4a6ad #> 18 Mallota apis species 10c3c3921d2ea9f9425ef9fd41914520 #> 19 Melanosella mors-apis species 4ac238f1597847dbc7998d97b8d45a0e #> 20 Microdon apis species 9be92242562eb923e711dc24b7bbab9a #> 21 Nosema apis species 5b2838dfd0ec15844fc6f659f7580322 #> 22 Scutirodes apis species 164ab3ac910547bc945cdbb994be1ee5 #> 23 Spiroplasma apis species 789f91571ce55de4df9821f2d05efab0 #> 24 Trichomonascus apis species 17dc4d840323e2c5b87e67a952f6dff3 #> 25 Pericystis apis species 088549f2fb602367e84d5ffdb8c1d4fc #> 26 Pericystis apis species 088549f2fb602367e84d5ffdb8c1d4fc #> 27 Torulopsis apis species 3219a9635d3438e8b76a645cecf87287 #> 28 Torulopsis apis species 3219a9635d3438e8b76a645cecf87287 #> 29 Apis aestuans species a517bc572c3c2697fe3bbfabc46a1493 #> 30 Apis alpina species f2781627115e4212ddab5979cdd425d2 #> 31 Apis bicornis species e67e82d00faae69da173bb31f9914056 #> 32 Apis canescens species d6b8850db971d65d6079e3a22f35e10e #> 33 Apis clypeata species 706060924801130f6c3abf454087c100 #> 34 Apis cunicularia species ebc3c5166ce2cabf419c4c6dc332cf3b #> 35 Apis etrusca species 6d27fd39a1d8b10050ba4e331987f3c9 #> 36 Apis globosa species 254c8e847ca4ff128bba57fe94deb98d #> 37 Apis hispanica species e8d2057a3efeb2cfdaebe27ea8191cd5 #> 38 Apis hypnorum species dfb743f54f50b9b9dbee378473542821 #> 39 Apis ichneumonea species 13c35287e20ab9373fa445dbc44981ea #> 40 Apis lapidaria species f8da5667af3562ebc0f6a83e1ec408f0 #> 41 Apis muscorum species 5bbfe59da5ce7fe59eb9ca3a7a45916c #> 42 Apis mystacea species fba8e4752a7fa5939a7eae293ba633ec #> 43 Apis obsoleta species da42bcb6cc0267903fb175f8a215aecb #> 44 Apis rostrata species e155a4277b66d1114182cafd875afbe3 #> 45 Apis rostrata species e155a4277b66d1114182cafd875afbe3 #> 46 Apis rufa species e67e82d00faae69da173bb31f9914056 #> 47 Apis signata species 551f101ad3b9bc17b24575585b2500c1 #> 48 Apis smaragdula species 4bc5c886b061e17e9aecb537a04c616d #> 49 Apis spinulosa species 56e7e9f854c9ed31ea6d0a06567607d0 #> 50 Apis subterranea species 3d2adff364a87bf7dd30524aa8071807 #> name_status kingdom family acc_name #> 1 accepted name Animalia Apidae #> 2 accepted name Bacteria Thermomonosporaceae #> 3 accepted name Animalia Calamoceratidae #> 4 accepted name Animalia Apidae #> 5 accepted name Animalia Apidae #> 6 accepted name Animalia Apidae #> 7 accepted name Animalia Apidae #> 8 accepted name Animalia Apidae #> 9 accepted name Animalia Apidae #> 10 accepted name Animalia Apidae #> 11 accepted name Fungi Ascosphaeraceae #> 12 accepted name Fungi Not assigned #> 13 accepted name Animalia Syrphidae #> 14 accepted name Animalia Histeridae #> 15 accepted name Animalia Miridae #> 16 accepted name Plantae Balsaminaceae #> 17 accepted name Animalia Cicadellidae #> 18 accepted name Animalia Syrphidae #> 19 accepted name Fungi Not assigned #> 20 accepted name Animalia Syrphidae #> 21 accepted name Protozoa Nosematidae #> 22 accepted name Animalia Noctuidae #> 23 accepted name Bacteria Spiroplasmataceae #> 24 accepted name Fungi Trichomonascaceae #> 25 ambiguous synonym Ascosphaera apis #> 26 ambiguous synonym Ascosphaera apis #> 27 ambiguous synonym Candida apis #> 28 ambiguous synonym Candida apis #> 29 synonym Xylocopa aestuans #> 30 synonym Bombus alpinus #> 31 synonym Osmia rufa #> 32 synonym Bembix canescens #> 33 synonym Lestica clypeata #> 34 synonym Colletes cunicularius #> 35 synonym Tachytes etruscus #> 36 synonym Exomalopsis similis #> 37 synonym Tachytes freygessneri #> 38 synonym Bombus hypnorum #> 39 synonym Sphex ichneumoneus #> 40 synonym Bombus lapidarius #> 41 synonym Bombus muscorum #> 42 synonym Argogorytes mystaceus #> 43 synonym Tachytes obsoletus #> 44 synonym Bembix rostrata #> 45 synonym Bembix rostrata #> 46 synonym Osmia rufa #> 47 synonym Stictia signata #> 48 synonym Ceratina smaragdula #> 49 synonym Hoplosmia spinulosa #> 50 synonym Bombus subterraneus ``` ``` #> $`015be25f6b061ba517f495394b80f108` #> childtaxa_id childtaxa_name childtaxa_rank #> 1 7a4a38c5095963949d6d6ec917d471de Apis andreniformis species #> 2 39610a4ceff7e5244e334a3fbc5e47e5 Apis cerana species #> 3 e1d4cbf3872c6c310b7a1c17ddd00ebc Apis dorsata species #> 4 92dca82a063fedd1da94b3f3972d7b22 Apis florea species #> 5 4bbc06b9dfbde0b72c619810b564c6e6 Apis koschevnikovi species #> 6 67cbbcf92cd60748759e58e802d98518 Apis mellifera species #> 7 213668a26ba6d2aad9575218f10d422f Apis nigrocincta species #> #> attr(,"class") #> [1] "children" #> attr(,"db") #> [1] "col" ``` The direct children (genera in this case) of _Pinaceae_ using NCBI data: ```r children("Pinaceae", db = "ncbi") ``` ``` #> $Pinaceae #> childtaxa_id childtaxa_name childtaxa_rank #> 1 123600 Nothotsuga genus #> 2 64685 Cathaya genus #> 3 3358 Tsuga genus #> 4 3356 Pseudotsuga genus #> 5 3354 Pseudolarix genus #> 6 3337 Pinus genus #> 7 3328 Picea genus #> 8 3325 Larix genus #> 9 3323 Keteleeria genus #> 10 3321 Cedrus genus #> 11 3319 Abies genus #> #> attr(,"class") #> [1] "children" #> attr(,"db") #> [1] "ncbi" ``` ## Get NCBI ID from GenBank Ids With accession numbers ```r genbank2uid(id = 'AJ748748') ``` ``` #> [1] "282199" #> attr(,"class") #> [1] "uid" #> attr(,"match") #> [1] "found" #> attr(,"multiple_matches") #> [1] FALSE #> attr(,"pattern_match") #> [1] FALSE #> attr(,"uri") #> [1] "http://www.ncbi.nlm.nih.gov/taxonomy/282199" ``` With gi numbers ```r genbank2uid(id = 62689767) ``` ``` #> [1] "282199" #> attr(,"class") #> [1] "uid" #> attr(,"match") #> [1] "found" #> attr(,"multiple_matches") #> [1] FALSE #> attr(,"pattern_match") #> [1] FALSE #> attr(,"uri") #> [1] "http://www.ncbi.nlm.nih.gov/taxonomy/282199" ``` ## Matching species tables with different taxonomic resolution Biologist often need to match different sets of data tied to species. For example, trait-based approaches are a promising tool in ecology. One problem is that abundance data must be matched with trait databases. These two data tables may contain species information on different taxonomic levels and possibly data must be aggregated to a joint taxonomic level, so that the data can be merged. taxize can help in this data-cleaning step, providing a reproducible workflow: We can use the mentioned `classification`-function to retrieve the taxonomic hierarchy and then search the hierarchies up- and downwards for matches. Here is an example to match a species with names on three different taxonomic levels. ```r A <- "gammarus roeseli" B1 <- "gammarus roeseli" B2 <- "gammarus" B3 <- "gammaridae" A_clas <- classification(A, db = 'ncbi') B1_clas <- classification(B1, db = 'ncbi') B2_clas <- classification(B2, db = 'ncbi') B3_clas <- classification(B3, db = 'ncbi') B1[match(A, B1)] ``` ``` #> [1] "gammarus roeseli" ``` ```r A_clas[[1]]$rank[tolower(A_clas[[1]]$name) %in% B2] ``` ``` #> [1] "genus" ``` ```r A_clas[[1]]$rank[tolower(A_clas[[1]]$name) %in% B3] ``` ``` #> [1] "family" ``` If we find a direct match (here *Gammarus roeseli*), we are lucky. But we can also match Gammaridae with *Gammarus roeseli*, but on a lower taxonomic level. A more comprehensive and realistic example (matching a trait table with an abundance table) is given in the vignette on matching. [eol]: http://www.eol.org/ [ncbi]: http://www.ncbi.nlm.nih.gov/ [itis]: http://www.itis.gov/ [wikispecies]: http://species.wikimedia.org/wiki/Main_Page [col]: http://www.catalogueoflife.org/ taxize/inst/vign/taxize_vignette.Rmd0000644000176200001440000002550612672106003017360 0ustar liggesusers ```{r, eval=TRUE, echo=FALSE} knitr::opts_chunk$set( comment = "#>", warning = FALSE, message = FALSE, cache.path = "cache/" ) ``` taxize vignette - a taxonomic toolbelt for R ====== `taxize` is a taxonomic toolbelt for R. `taxize` wraps APIs for a large suite of taxonomic databases availab on the web. ## Installation First, install and load `taxize` into the R session. ```{r installtaxizecran, eval=FALSE} install.packages("taxize") ``` ```{r loadtaxize} library("taxize") ``` Advanced users can also download and install the latest development copy from [GitHub](https://github.com/ropensci/taxize_). ## Resolve taxonomic name This is a common task in biology. We often have a list of species names and we want to know a) if we have the most up to date names, b) if our names are spelled correctly, and c) the scientific name for a common name. One way to resolve names is via the Global Names Resolver (GNR) service provided by the [Encyclopedia of Life][eol]. Here, we are searching for two misspelled names: ```{r resolvenames} temp <- gnr_resolve(names = c("Helianthos annus", "Homo saapiens")) head(temp) ``` The correct spellings are *Helianthus annuus* and *Homo sapiens*. Another approach uses the Taxonomic Name Resolution Service via the Taxosaurus API developed by iPLant and the Phylotastic organization. In this example, we provide a list of species names, some of which are misspelled, and we'll call the API with the *tnrs* function. ```{r tnrs, cache=TRUE} mynames <- c("Helianthus annuus", "Pinus contort", "Poa anua", "Abis magnifica", "Rosa california", "Festuca arundinace", "Sorbus occidentalos","Madia sateva") tnrs(query = mynames, source = "iPlant_TNRS")[ , -c(5:7)] ``` It turns out there are a few corrections: e.g., *Madia sateva* should be *Madia sativa*, and *Rosa california* should be *Rosa californica*. Note that this search worked because fuzzy matching was employed to retrieve names that were close, but not exact matches. Fuzzy matching is only available for plants in the TNRS service, so we advise using EOL's Global Names Resolver if you need to resolve animal names. taxize takes the approach that the user should be able to make decisions about what resource to trust, rather than making the decision. Both the EOL GNR and the TNRS services provide data from a variety of data sources. The user may trust a specific data source, thus may want to use the names from that data source. In the future, we may provide the ability for taxize to suggest the best match from a variety of sources. Another common use case is when there are many synonyms for a species. In this example, we have three synonyms of the currently accepted name for a species. ```{r synonyms, eval=TRUE, cache=FALSE, message=FALSE, warning=FALSE, comment=NA} mynames <- c("Helianthus annuus ssp. jaegeri", "Helianthus annuus ssp. lenticularis", "Helianthus annuus ssp. texanus") (tsn <- get_tsn(mynames, accepted = FALSE)) lapply(tsn, itis_acceptname) ``` ## Retrieve higher taxonomic names Another task biologists often face is getting higher taxonomic names for a taxa list. Having the higher taxonomy allows you to put into context the relationships of your species list. For example, you may find out that species A and species B are in Family C, which may lead to some interesting insight, as opposed to not knowing that Species A and B are closely related. This also makes it easy to aggregate/standardize data to a specific taxonomic level (e.g., family level) or to match data to other databases with different taxonomic resolution (e.g., trait databases). A number of data sources in taxize provide the capability to retrieve higher taxonomic names, but we will highlight two of the more useful ones: [Integrated Taxonomic Information System (ITIS)][itis] and [National Center for Biotechnology Information (NCBI)][ncbi]. First, we'll search for two species, *Abies procera} and *Pinus contorta* within ITIS. ```{r classification} specieslist <- c("Abies procera","Pinus contorta") classification(specieslist, db = 'itis') ``` It turns out both species are in the family Pinaceae. You can also get this type of information from the NCBI by doing `classification(specieslist, db = 'ncbi')`. Instead of a full classification, you may only want a single name, say a family name for your species of interest. The function *tax_name} is built just for this purpose. As with the `classification` function you can specify the data source with the `db` argument, either ITIS or NCBI. ```{r taxname, eval=TRUE,cache=TRUE} tax_name(query = "Helianthus annuus", get = "family", db = "ncbi") ``` I may happen that a data source does not provide information on the queried species, than one could take the result from another source and union the results from the different sources. ## Interactive name selection As mentioned most databases use a numeric code to reference a species. A general workflow in taxize is: Retrieve Code for the queried species and then use this code to query more data/information. Below are a few examples. When you run these examples in R, you are presented with a command prompt asking for the row that contains the name you would like back; that output is not printed below for brevity. In this example, the search term has many matches. The function returns a data frame of the matches, and asks for the user to input what row number to accept. ```{r interactive, eval=TRUE, echo=TRUE, cache=FALSE} get_uid(sciname = "Pinus") ``` In another example, you can pass in a long character vector of taxonomic names (although this one is rather short for demo purposes): ```{r interactive_many, eval=TRUE, echo=TRUE, cache=FALSE} splist <- c("annona cherimola", 'annona muricata', "quercus robur") get_tsn(searchterm = splist, searchtype = "scientific") ``` There are functions for many other sources * `get_boldid()` * `get_colid()` * `get_eolid()` * `get_gbifid()` * `get_nbnid()` * `get_tpsid()` Sometimes with these functions you get a lot of data back. In these cases you may want to limit your choices. Soon we will incorporate the ability to filter using `regex` to limit matches, but for now, we have a new parameter, `rows`, which lets you select certain rows. For example, you can select the first row of each given name, which means there is no interactive component: ```{r} get_nbnid(c("Zootoca vivipara","Pinus contorta"), rows = 1) ``` Or you can select a range of rows ```{r} get_nbnid(c("Zootoca vivipara","Pinus contorta"), rows = 1:3) ``` In addition, in case you don't want to do interactive name selection in the case where there are a lot of names, you can get all data back with functions of the form, e.g., `get_tsn_()`, and likewise for other data sources. For example: ```{r} out <- get_nbnid_("Poa annua") NROW(out$`Poa annua`) ``` That's a lot of data, so we can get only certain rows back ```{r} get_nbnid_("Poa annua", rows = 1:10) ``` ## Coerce numerics/alphanumerics to taxon IDs We've also introduced in `v0.5` the ability to coerce numerics and alphanumerics to taxonomic ID classes that are usually only retrieved via `get_*()` functions. For example, adfafd ```{r} as.gbifid(get_gbifid("Poa annua")) # already a uid, returns the same as.gbifid(2704179) # numeric as.gbifid("2704179") # character as.gbifid(list("2704179","2435099","3171445")) # list, either numeric or character ``` These `as.*()` functions do a quick check of the web resource to make sure it's a real ID. However, you can turn this check off, making this coercion much faster: ```{r} system.time( replicate(3, as.gbifid(c("2704179","2435099","3171445"), check=TRUE)) ) system.time( replicate(3, as.gbifid(c("2704179","2435099","3171445"), check=FALSE)) ) ``` ## What taxa are downstream of my taxon of interest? If someone is not a taxonomic specialist on a particular taxon he likely does not know what children taxa are within a family, or within a genus. This task becomes especially unwieldy when there are a large number of taxa downstream. You can of course go to a website like [Wikispecies][wikispecies] or [Encyclopedia of Life][eol] to get downstream names. However, taxize provides an easy way to programatically search for downstream taxa, both for the [Catalogue of Life (CoL)][col] and the [Integrated Taxonomic Information System][itis]. Here is a short example using the CoL in which we want to find all the species within the genus *Apis* (honey bees). ```{r downstream1, eval=TRUE, cache=FALSE} downstream("Apis", downto = "Species", db = "col") ``` We can also request data from ITIS ```{r downstream2, eval=TRUE, cache=FALSE} downstream("Apis", downto = "Species", db = "itis") ``` ## Direct children You may sometimes only want the direct children. We got you covered on that front, with methods for ITIS, NCBI, and Catalogue of Life. For example, let's get direct children (species in this case) of the bee genus _Apis_ using COL data: ```{r} children(get_colid("Apis")) ``` The direct children (genera in this case) of _Pinaceae_ using NCBI data: ```{r} children("Pinaceae", db = "ncbi") ``` ## Get NCBI ID from GenBank Ids With accession numbers ```{r} genbank2uid(id = 'AJ748748') ``` With gi numbers ```{r} genbank2uid(id = 62689767) ``` ## Matching species tables with different taxonomic resolution Biologist often need to match different sets of data tied to species. For example, trait-based approaches are a promising tool in ecology. One problem is that abundance data must be matched with trait databases. These two data tables may contain species information on different taxonomic levels and possibly data must be aggregated to a joint taxonomic level, so that the data can be merged. taxize can help in this data-cleaning step, providing a reproducible workflow: We can use the mentioned `classification`-function to retrieve the taxonomic hierarchy and then search the hierarchies up- and downwards for matches. Here is an example to match a species with names on three different taxonomic levels. ```{r tax_match, cache=FALSE, tidy=FALSE, message=FALSE} A <- "gammarus roeseli" B1 <- "gammarus roeseli" B2 <- "gammarus" B3 <- "gammaridae" A_clas <- classification(A, db = 'ncbi') B1_clas <- classification(B1, db = 'ncbi') B2_clas <- classification(B2, db = 'ncbi') B3_clas <- classification(B3, db = 'ncbi') B1[match(A, B1)] A_clas[[1]]$rank[tolower(A_clas[[1]]$name) %in% B2] A_clas[[1]]$rank[tolower(A_clas[[1]]$name) %in% B3] ``` If we find a direct match (here *Gammarus roeseli*), we are lucky. But we can also match Gammaridae with *Gammarus roeseli*, but on a lower taxonomic level. A more comprehensive and realistic example (matching a trait table with an abundance table) is given in the vignette on matching. [eol]: http://www.eol.org/ [ncbi]: http://www.ncbi.nlm.nih.gov/ [itis]: http://www.itis.gov/ [wikispecies]: http://species.wikimedia.org/wiki/Main_Page [col]: http://www.catalogueoflife.org/ taxize/inst/vign/name_cleaning.Rmd0000644000176200001440000001235512744477530016745 0ustar liggesusers ```{r echo=FALSE} knitr::opts_chunk$set( comment = "#>", collapse = TRUE, warning = FALSE, message = FALSE ) ``` Strategies for programmatic name cleaning ========================================= `taxize` offers interactive prompts when using `get_*()` functions (e.g., `get_tsn()`). These prompts make it easy in interactive use to select choices when there are more than one match found. However, to make your code reproducible you don't want interactive prompts. This vignette covers some options for programmatic name cleaning. ```{r} library("taxize") ``` ## get_* functions When using `get_*()` functions programatically, you have a few options. ### rows parameter Normally, if you get more than one result, you get a prompt asking you to select which taxon you want. ```{r eval=FALSE} get_tsn(searchterm = "Quercus b") #> tsn target commonnames nameusage #> 1 19298 Quercus beebiana not accepted #> 2 507263 Quercus berberidifolia scrub oak accepted #> 3 19300 Quercus bicolor swamp white oak accepted #> 4 19303 Quercus borealis not accepted #> 5 195131 Quercus borealis var. maxima not accepted #> 6 195166 Quercus boyntonii Boynton's sand post oak accepted #> 7 506533 Quercus brantii Brant's oak accepted #> 8 195150 Quercus breviloba not accepted #> 9 195099 Quercus breweri not accepted #> 10 195168 Quercus buckleyi Texas oak accepted #> #> More than one TSN found for taxon 'Quercus b'! #> #> Enter rownumber of taxon (other inputs will return 'NA'): #> #> 1: ``` Instead, we can use the rows parameter to specify which records we want by number only (not by a name itself). Here, we want the first 3 records: ```{r eval=FALSE} get_tsn(searchterm = 'Quercus b', rows = 1:3) #> tsn target commonnames nameusage #> 1 19298 Quercus beebiana not accepted #> 2 19300 Quercus bicolor swamp white oak accepted #> 3 19303 Quercus borealis not accepted #> #> More than one TSN found for taxon 'Quercus b'! #> #> Enter rownumber of taxon (other inputs will return 'NA'): #> #> 1: ``` However, you still get a prompt as there is more than one result. Thus, for full programmatic usage, you can specify a single row, if you happen to know which one you want: ```{r} get_tsn(searchterm = 'Quercus b', rows = 3) ``` In reality it is unlikely you'll know which row you want, unless perhaps you just want one result from each query, regardless of what it is. ### underscore methods A better fit for programmatic use are underscore methods. Each `get_*()` function has a sister method with and trailing underscore, e.g., `get_tsn()` and `get_tsn_()`. ```{r} get_tsn_(searchterm = "Quercus b") ``` The result is a single data.frame for each taxon queried, which can be processed downstream with whatever logic is required in your workflow. You can also combine `rows` parameter with underscore functions, as a single number of a range of numbers: ```{r} get_tsn_(searchterm = "Quercus b", rows = 1) ``` ```{r} get_tsn_(searchterm = "Quercus b", rows = 1:2) ``` ## as.* methods All `get_*()` functions have associated `as.*()` functions (e.g., `get_tsn()` and `as.tsn()`). Many `taxize` functions use taxonomic identifier classes (S3 objects) that are the output of `get_*()` functions. `as.*()` methods make it easy to make the required S3 taxonomic identifier classes if you already know the identifier. For example: Already a tsn, returns the same ```{r} as.tsn(get_tsn("Quercus douglasii")) ``` numeric ```{r} as.tsn(c(19322, 129313, 506198)) ``` And you can do the same for character, or list inputs - depending on the data source. The above `as.tsn()` examples have the parameter `check = TRUE`, meaning we ping the data source web service to make sure the identifier exists. You can skip that check if you like by setting `check = FALSE`, and the result is returned much faster: ```{r} as.tsn(c("19322","129313","506198"), check = FALSE) ``` With the output of `as.*()` methods, you can then proceed with other `taxize` functions. ## gnr_resolve Some functions in `taxize` are meant specifically for name cleaning. One of those is `gnr_resolve()`. `gnr_resolve()` doesn't provide prompts as do `get_*()` functions, but instead return data.frame's. So we don't face the same problem, and can use `gnr_resolve()` in a programmatic workflow straight away. ```{r} spp <- names_list(rank = "species", size = 10) gnr_resolve(names = spp, preferred_data_sources = 11) ``` ## Other functions Some other functions in `taxize` use `get_*()` functions internally (e.g., `classification()`), but you can can generally pass on parameters to the `get_*()` functions internally. ## Feedback? Let us know if you have ideas for better ways to do programmatic name cleaning at or ! taxize/inst/vign/name_cleaning.md0000644000176200001440000002470213125502354016605 0ustar liggesusers Strategies for programmatic name cleaning ========================================= `taxize` offers interactive prompts when using `get_*()` functions (e.g., `get_tsn()`). These prompts make it easy in interactive use to select choices when there are more than one match found. However, to make your code reproducible you don't want interactive prompts. This vignette covers some options for programmatic name cleaning. ```r library("taxize") ``` ## get_* functions When using `get_*()` functions programatically, you have a few options. ### rows parameter Normally, if you get more than one result, you get a prompt asking you to select which taxon you want. ```r get_tsn(searchterm = "Quercus b") #> tsn target commonnames nameusage #> 1 19298 Quercus beebiana not accepted #> 2 507263 Quercus berberidifolia scrub oak accepted #> 3 19300 Quercus bicolor swamp white oak accepted #> 4 19303 Quercus borealis not accepted #> 5 195131 Quercus borealis var. maxima not accepted #> 6 195166 Quercus boyntonii Boynton's sand post oak accepted #> 7 506533 Quercus brantii Brant's oak accepted #> 8 195150 Quercus breviloba not accepted #> 9 195099 Quercus breweri not accepted #> 10 195168 Quercus buckleyi Texas oak accepted #> #> More than one TSN found for taxon 'Quercus b'! #> #> Enter rownumber of taxon (other inputs will return 'NA'): #> #> 1: ``` Instead, we can use the rows parameter to specify which records we want by number only (not by a name itself). Here, we want the first 3 records: ```r get_tsn(searchterm = 'Quercus b', rows = 1:3) #> tsn target commonnames nameusage #> 1 19298 Quercus beebiana not accepted #> 2 19300 Quercus bicolor swamp white oak accepted #> 3 19303 Quercus borealis not accepted #> #> More than one TSN found for taxon 'Quercus b'! #> #> Enter rownumber of taxon (other inputs will return 'NA'): #> #> 1: ``` However, you still get a prompt as there is more than one result. Thus, for full programmatic usage, you can specify a single row, if you happen to know which one you want: ```r get_tsn(searchterm = 'Quercus b', rows = 3) #> [1] "19303" #> attr(,"match") #> [1] "found" #> attr(,"multiple_matches") #> [1] TRUE #> attr(,"pattern_match") #> [1] FALSE #> attr(,"uri") #> [1] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=19303" #> attr(,"class") #> [1] "tsn" ``` In reality it is unlikely you'll know which row you want, unless perhaps you just want one result from each query, regardless of what it is. ### underscore methods A better fit for programmatic use are underscore methods. Each `get_*()` function has a sister method with and trailing underscore, e.g., `get_tsn()` and `get_tsn_()`. ```r get_tsn_(searchterm = "Quercus b") #> $`Quercus b` #> # A tibble: 5 x 4 #> tsn scientificName commonNames #> #> 1 19300 Quercus bicolor swamp white oak,chne bicolore #> 2 195166 Quercus boyntonii Boynton's sand post oak,Boynton's oak #> 3 195168 Quercus buckleyi Texas oak,Buckley's oak #> 4 506533 Quercus brantii Brant's oak #> 5 507263 Quercus berberidifolia scrub oak #> # ... with 1 more variables: nameUsage ``` The result is a single data.frame for each taxon queried, which can be processed downstream with whatever logic is required in your workflow. You can also combine `rows` parameter with underscore functions, as a single number of a range of numbers: ```r get_tsn_(searchterm = "Quercus b", rows = 1) #> $`Quercus b` #> # A tibble: 1 x 4 #> tsn scientificName commonNames nameUsage #> #> 1 19300 Quercus bicolor swamp white oak,chne bicolore accepted ``` ```r get_tsn_(searchterm = "Quercus b", rows = 1:2) #> $`Quercus b` #> # A tibble: 2 x 4 #> tsn scientificName commonNames nameUsage #> #> 1 19300 Quercus bicolor swamp white oak,chne bicolore accepted #> 2 195166 Quercus boyntonii Boynton's sand post oak,Boynton's oak accepted ``` ## as.* methods All `get_*()` functions have associated `as.*()` functions (e.g., `get_tsn()` and `as.tsn()`). Many `taxize` functions use taxonomic identifier classes (S3 objects) that are the output of `get_*()` functions. `as.*()` methods make it easy to make the required S3 taxonomic identifier classes if you already know the identifier. For example: Already a tsn, returns the same ```r as.tsn(get_tsn("Quercus douglasii")) #> [1] "19322" #> attr(,"match") #> [1] "found" #> attr(,"multiple_matches") #> [1] FALSE #> attr(,"pattern_match") #> [1] FALSE #> attr(,"uri") #> [1] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=19322" #> attr(,"class") #> [1] "tsn" ``` numeric ```r as.tsn(c(19322, 129313, 506198)) #> [1] "19322" "129313" "506198" #> attr(,"class") #> [1] "tsn" #> attr(,"match") #> [1] "found" "found" "found" #> attr(,"multiple_matches") #> [1] FALSE FALSE FALSE #> attr(,"pattern_match") #> [1] FALSE FALSE FALSE #> attr(,"uri") #> [1] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=19322" #> [2] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=129313" #> [3] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=506198" ``` And you can do the same for character, or list inputs - depending on the data source. The above `as.tsn()` examples have the parameter `check = TRUE`, meaning we ping the data source web service to make sure the identifier exists. You can skip that check if you like by setting `check = FALSE`, and the result is returned much faster: ```r as.tsn(c("19322","129313","506198"), check = FALSE) #> [1] "19322" "129313" "506198" #> attr(,"class") #> [1] "tsn" #> attr(,"match") #> [1] "found" "found" "found" #> attr(,"multiple_matches") #> [1] FALSE FALSE FALSE #> attr(,"pattern_match") #> [1] FALSE FALSE FALSE #> attr(,"uri") #> [1] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=19322" #> [2] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=129313" #> [3] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=506198" ``` With the output of `as.*()` methods, you can then proceed with other `taxize` functions. ## gnr_resolve Some functions in `taxize` are meant specifically for name cleaning. One of those is `gnr_resolve()`. `gnr_resolve()` doesn't provide prompts as do `get_*()` functions, but instead return data.frame's. So we don't face the same problem, and can use `gnr_resolve()` in a programmatic workflow straight away. ```r spp <- names_list(rank = "species", size = 10) gnr_resolve(names = spp, preferred_data_sources = 11) #> user_supplied_name submitted_name #> 1 Helichrysum candollei Helichrysum candollei #> 2 Haworthia retusa Haworthia retusa #> 3 Crypsinus bakeri Crypsinus bakeri #> 4 Mangifera philippinensis Mangifera philippinensis #> 5 Selaginella atirrensis Selaginella atirrensis #> 6 Hymenostomum sullivanii Hymenostomum sullivanii #> 7 Hymenostomum sullivanii Hymenostomum sullivanii #> 8 Cytisus urumoffii Cytisus urumoffii #> 9 Cytisus urumoffii Cytisus urumoffii #> 10 Cytisus urumoffii Cytisus urumoffii #> 11 Baptisia uniflora Baptisia uniflora #> 12 Baptisia uniflora Baptisia uniflora #> 13 Baptisia uniflora Baptisia uniflora #> 14 Baptisia uniflora Baptisia uniflora #> 15 Nephelium xerocarpum Nephelium xerocarpum #> 16 Baccharis gnaphalioides Baccharis gnaphalioides #> 17 Baccharis gnaphalioides Baccharis gnaphalioides #> matched_name #> 1 Helichrysum candollei (Bojer ex DC.) R.Vig. & Humbert #> 2 Haworthia retusa (L.) Duval #> 3 Crypsinus bakeri (Luerss.) Tag. #> 4 Mangifera philippinensis Mukherji #> 5 Selaginella atirrensis Hieron. #> 6 Hymenostomum sullivanii C. Müller ex Geheeb, 1897 #> 7 Hymenostomum sullivanii C. Müller #> 8 Cytisus urumoffii Davidov ex Stoj. #> 9 Cytisus urumoffii Davidoff ex Stoyanoff #> 10 Cytisus urumoffii Davidoff #> 11 Baptisia uniflora Hook. #> 12 Baptisia uniflora (Michx.) Nutt. #> 13 Baptisia uniflora (Michx.) Sm. #> 14 Baptisia uniflora Spreng. #> 15 Nephelium xerocarpum (Bl.) Cambess. #> 16 Baccharis gnaphalioides Spreng. #> 17 Baccharis gnaphalioides DC. #> data_source_title score #> 1 GBIF Backbone Taxonomy 0.988 #> 2 GBIF Backbone Taxonomy 0.988 #> 3 GBIF Backbone Taxonomy 0.988 #> 4 GBIF Backbone Taxonomy 0.988 #> 5 GBIF Backbone Taxonomy 0.988 #> 6 GBIF Backbone Taxonomy 0.988 #> 7 GBIF Backbone Taxonomy 0.988 #> 8 GBIF Backbone Taxonomy 0.988 #> 9 GBIF Backbone Taxonomy 0.988 #> 10 GBIF Backbone Taxonomy 0.988 #> 11 GBIF Backbone Taxonomy 0.988 #> 12 GBIF Backbone Taxonomy 0.988 #> 13 GBIF Backbone Taxonomy 0.988 #> 14 GBIF Backbone Taxonomy 0.988 #> 15 GBIF Backbone Taxonomy 0.988 #> 16 GBIF Backbone Taxonomy 0.988 #> 17 GBIF Backbone Taxonomy 0.988 ``` ## Other functions Some other functions in `taxize` use `get_*()` functions internally (e.g., `classification()`), but you can can generally pass on parameters to the `get_*()` functions internally. ## Feedback? Let us know if you have ideas for better ways to do programmatic name cleaning at or ! taxize/inst/vign/taxize_infotable.Rmd0000644000176200001440000000422513125505100017464 0ustar liggesusers Some key functions in taxize, what they do, and their data sources. ====== Function name | What it does | Source | ----------- | ----------- | ----------- | `children` | Get direct children | COL, NCBI, ITIS | `classification` | Upstream classification | COL, NCBI, ITIS, Tropicos, EOL, GBIF, NBN | `comm2sci` | Get scientific from common names | EOL, NCBI, ITIS, Tropicos | `downstream` | Downstream taxa to specified rank | COL, ITIS, GBIF | `get_ids` | Get taxonomic identifiers | COL, NCBI, ITIS, Tropicos, EOL, GBIF, NBN | `resolve` | Resolve names using many resolvers | GNR, TNRS, iPlant | `gnr_resolve` | Resolve names using Global Names Resolver | GNR | `tnrs` | Phylotastic Taxonomic Name Resolution Service | NCBI, iPlant, MSW3 | `tol_resolve` | Resolve names using any resolver | TOL | `iplant_resolve` | iPlant name resolution| iPlant | `sci2comm` | Get common from scientific names | EOL, NCBI, ITIS | `synonyms` | Retrieve synonyms given input names/identifiers | COL, NCBI, ITIS, Tropicos | `upstream` | Retrieve upstream taxa given names/identifiers | COL, ITIS | `lowest_common` | Retrieve the lowest common taxon and rank for a given taxon name or ID | COL, ITIS, GBIF, TOL, NCBI | `genbank2uid` | Get NCBI taxonomy UID from GenBankID | NCBI | `tax_name` | Get taxonomic names for a given rank | NCBI, ITIS | `tax_rank` | Get rank for a given taxonomic name | BOLD, COL, EOL, GBIF, NATSERV, NBN, TOL, TROPICOS, ITIS, NCBI, WORMS | `tpl_get` | Get The Plant List csv files | TPL | ### Acronyms * COL: Catalogue of Life * NCBI: National Center for Biotechnology Information * ITIS: Integrated Taxonomic Information Service * EOL: Encylopedia of Life * GBIF: Global Biodiversity Information Facility * NBN: National Biodiversity Network (UK) * iPlant: iPlant Name Resolution Service * GNR: Global Names Resolver * TNRS: Taxonomic Name Resolution Service * TOL: Open Tree of Life * MSW3: Mammal Species of the World, 3rd Edition * TPL: The Plant List * BOLD: Barcode of Life * NATSERV: Natureserve * TROPICOS: Tropicos plant database * WORMS: World Register of Marine Species taxize/tests/0000755000176200001440000000000013162233432012717 5ustar liggesuserstaxize/tests/testthat/0000755000176200001440000000000013162233432014557 5ustar liggesuserstaxize/tests/testthat/test-col_children.R0000644000176200001440000000170112730575561020317 0ustar liggesusers# tests for col_children fxn in taxize context("col_children") test_that("col_children returns the correct classes and dimensions", { skip_on_cran() temp4 <- col_children(name="Animalia") temp5 <- col_children(name="Plantae") temp11 <- col_children(name="Accipiter striatus") temp13 <- col_children(id=c(2346405,2344165,2346405), checklist = '2012') expect_is(temp4, "list") expect_is(temp5, "list") expect_is(temp11, "list") expect_is(temp4$Animalia, "data.frame") expect_is(temp5$Plantae, "data.frame") expect_is(temp11$`Accipiter striatus`, "data.frame") expect_is(temp13$`2346405`, "data.frame") expect_equal(NCOL(temp4[[1]]), 3) expect_equal(NCOL(temp5[[1]]), 3) expect_equal(length(temp11), 1) }) test_that("missing/wrong data given returns result", { skip_on_cran() expect_equal(nrow(col_children(name="")[[1]]), 0) expect_equal(nrow(col_children(name="asdfasdfdf")[[1]]), 0) expect_is(col_children(), "list") }) taxize/tests/testthat/test-iucn_summary.R0000755000176200001440000000361313136166222020403 0ustar liggesuserscontext("iucn_summary") test_that("iucn_summary returns the correct value", { skip_on_cran() temp <- iucn_summary(c("Panthera uncia", "Lynx lynx")) temp2 <- suppressWarnings(iucn_summary_id(c(22732, 12519))) expect_that(length(temp[[1]]), equals(4)) expect_is(temp, "iucn_summary") #expect_equal(temp, temp2) expect_equal(length(iucn_status(temp)), 2) }) test_that("iucn_summary gives expected result for lots of names", { skip_on_cran() aa <- iucn_summary("Abies koreana") expect_equal(aa$`Abies koreana`$status, "EN") bb <- iucn_summary("Xylopia collina") expect_equal(bb$`Xylopia collina`$status, "EN") cc <- iucn_summary("Brugmansia versicolor") expect_equal(cc$`Brugmansia versicolor`$status, "EW") dd <- iucn_summary("Achatinella buddii") expect_equal(dd$`Achatinella buddii`$status, "EX") ee <- iucn_summary("Annona hystricoides") expect_equal(ee$`Annona hystricoides`$status, "CR") ff <- iucn_summary("Chamaecrista onusta") expect_equal(ff$`Chamaecrista onusta`$status, "VU") gg <- iucn_summary("Cyornis lemprieri") expect_equal(gg$`Cyornis lemprieri`$status, "NT") hh <- iucn_summary("Frailea pumila") expect_equal(hh$`Frailea pumila`$status, "LC") }) test_that("iucn_summary_id with distr_detail produces correct output", { skip_on_cran() ii <- suppressWarnings(iucn_summary_id(22685566, distr_detail = TRUE)) expect_equal(names(ii$`22685566`$distr), c("Native", "Introduced")) expect_equal(vapply(ii$`22685566`$distr, length, 0), c(Native = 12, Introduced = 1)) }) test_that("iucn_summary and iucn_summary_id fail well", { skip_on_cran() expect_error(iucn_summary(""), "Not Found") #expect_equal(suppressWarnings(iucn_summary(""))[[1]]$status, NA) expect_warning(iucn_summary("Abies"), "not found") expect_warning(iucn_summary_id(0), "not found") expect_equal(suppressWarnings(iucn_summary_id(0))[[1]]$status, NA) }) taxize/tests/testthat/Rplots.pdf0000644000176200001440000001117413160776212016547 0ustar liggesusers%PDF-1.4 %âãÏÓ\r 1 0 obj << /CreationDate (D:20170921104759) /ModDate (D:20170921104759) /Title (R Graphics Output) /Producer (R 3.4.1) /Creator (R) >> endobj 2 0 obj << /Type /Catalog /Pages 3 0 R >> endobj 7 0 obj << /Type /Page /Parent 3 0 R /Contents 8 0 R /Resources 4 0 R >> endobj 8 0 obj << /Length 786 /Filter /FlateDecode >> stream xœTMSÛ0½ûWì19TÕ‡mÙG`Z::´ñL Åb°Å´é¯ï&’c ˜IãCœyÖúíjßÛep áWôÝþ É A dz˜HB2’pXiø môÑü8?…³YD ¥üçì쾕 üŽnnÂ]ÄàÛÀU$cSÈ$áXè'H‰ˆ=‹½€,#Y2Xè' ÛÎR"‡+8è'HHœ{{qF¨,ô`GÓÀa/ K õ*°Ð;1I…G`ñ °í¨zOà Ÿ¥ÞªÈSìNÚãm@ÿ½äëì°!(·!ö92hí°ÏÁ©½Hˆƒ,Y ·Ã~„àž{ÍÈcK@ï<Ím™=¡Å~ŠDŠ;ìGd<Ôá!IÌ2[e½sš’:ìâðÐæ¡Á;4W‡ÆæÐT2ý!O²ì_;ö­_éüF‚×2‡¢¾#R É{Ž?ìçнۈÓÂíçÒ¼³ŸM‰ëûsŒ¿¸Ɖ;°‹÷ÖáD$P4p3ùZ«õºRp_«)`­“üK`¢¦·P\DŸŠ]Öÿ£å)É3K[Lñ ÙV˺®:¦šW«)|`H]•9ž]$1I¨e?A*†ìª\TžU:µO¢[SIC“}oúK¨V•zÝ5ðÒÕj¥gåh4ÎŽõ\·ØðVÁÆ6\=ufQ5#ëåX¯tõδQmk°9í_ÌÔ¿9žœeè_iɯ«Z+pîЫ¾Ï]¹4#¼Âp’2×¢š/»m± Ìz¯ßó¢]–ªÞüA.Ü’_NQR˜lÊ [r§ÌƬu3¾#‚çûºOu_ìÓB[-{IAïîSê1­Á`œ´w«e¹iæÛâ_ªº^,ŠÇã,"s’8‹|Ñ5:b½À‘TmïŒ1ãÈ“”p¶«òJÝáѵ~P­9º:!q˺Ž^vÏU_XÏ«Ruõ˜±ÀÅܯ¢k²VÍ|§.çÉn ÷ÔߣÕk‚endstream endobj 3 0 obj << /Type /Pages /Kids [ 7 0 R ] /Count 1 /MediaBox [0 0 504 504] >> endobj 4 0 obj << /ProcSet [/PDF /Text] /Font <> /ExtGState << >> /ColorSpace << /sRGB 5 0 R >> >> endobj 5 0 obj [/ICCBased 6 0 R] endobj 6 0 obj << /Alternate /DeviceRGB /N 3 /Length 2596 /Filter /FlateDecode >> stream xœ–wTSهϽ7½P’Š”ÐkhRH ½H‘.*1 JÀ"6DTpDQ‘¦2(à€£C‘±"Š…Q±ëDÔqp–Id­ß¼yïÍ›ß÷~kŸ½ÏÝgï}ÖºüƒÂLX € ¡Xáçň‹g` ðlàp³³BøF™|ØŒl™ø½º ùû*Ó?ŒÁÿŸ”¹Y"1P˜ŒçòøÙ\É8=Wœ%·Oɘ¶4MÎ0JÎ"Y‚2V“sò,[|ö™e9ó2„<ËsÎâeðäÜ'ã9¾Œ‘`çø¹2¾&cƒtI†@Æoä±|N6(’Ü.æsSdl-c’(2‚-ãyàHÉ_ðÒ/XÌÏËÅÎÌZ.$§ˆ&\S†“‹áÏÏMç‹ÅÌ07#â1Ø™YárfÏüYym²";Ø8980m-m¾(Ô]ü›’÷v–^„îDøÃöW~™ °¦eµÙú‡mi]ëP»ý‡Í`/в¾u}qº|^RÄâ,g+«ÜÜ\KŸk)/èïúŸC_|ÏR¾Ýïåaxó“8’t1C^7nfz¦DÄÈÎâpù 柇øþuü$¾ˆ/”ED˦L L–µ[Ȉ™B†@øŸšøÃþ¤Ù¹–‰ÚøЖX¥!@~(* {d+Ðï} ÆGù͋љ˜ûÏ‚þ}W¸LþÈ$ŽcGD2¸QÎìšüZ4 E@ê@èÀ¶À¸àA(ˆq`1à‚D €µ ”‚­`'¨u 4ƒ6ptcà48.Ë`ÜR0ž€)ð Ì@„…ÈR‡t CȲ…XäCP”%CBH@ë R¨ª†ê¡fè[è(tº C· Qhúz#0 ¦ÁZ°l³`O8Ž„ÁÉð28.‚·À•p|î„O×àX ?§€:¢‹0ÂFB‘x$ !«¤i@Ú¤¹ŠH‘§È[EE1PL” Ê…⢖¡V¡6£ªQP¨>ÔUÔ(j õMFk¢ÍÑÎèt,:‹.FW ›Ðè³èô8úƒ¡cŒ1ŽL&³³³ÓŽ9…ÆŒa¦±X¬:ÖëŠ År°bl1¶ {{{;Ž}ƒ#âtp¶8_\¡8áú"ãEy‹.,ÖXœ¾øøÅ%œ%Gщ1‰-‰ï9¡œÎôÒ€¥µK§¸lî.îžoo’ïÊ/çO$¹&•'=JvMÞž<™âžR‘òTÀT ž§ú§Ö¥¾N MÛŸö)=&½=—‘˜qTH¦ û2µ3ó2‡³Ì³Š³¤Ëœ—í\6% 5eCÙ‹²»Å4ÙÏÔ€ÄD²^2šã–S“ó&7:÷Hžrž0o`¹ÙòMË'ò}ó¿^ZÁ]Ñ[ [°¶`t¥çÊúUЪ¥«zWë¯.Z=¾Æo͵„µik(´.,/|¹.f]O‘VÑš¢±õ~ë[‹ŠEÅ76¸l¨ÛˆÚ(Ø8¸iMKx%K­K+Jßoæn¾ø•ÍW•_}Ú’´e°Ì¡lÏVÌVáÖëÛÜ·(W.Ï/Û²½scGÉŽ—;—ì¼PaWQ·‹°K²KZ\Ù]ePµµê}uJõHWM{­fí¦Ú×»y»¯ìñØÓV§UWZ÷n¯`ïÍz¿úΣ†Š}˜}9û6F7öÍúº¹I£©´éÃ~á~éˆ}ÍŽÍÍ-š-e­p«¤uò`ÂÁËßxÓÝÆl«o§·—‡$‡›øíõÃA‡{°Ž´}gø]mµ£¤ê\Þ9Õ•Ò%íŽë>x´·Ç¥§ã{Ëï÷Ó=Vs\åx٠‰¢ŸN柜>•uêééäÓc½Kz=s­/¼oðlÐÙóç|Ïé÷ì?yÞõü± ÎŽ^d]ìºäp©sÀ~ ãû:;‡‡º/;]îž7|âŠû•ÓW½¯ž»píÒÈü‘áëQ×oÞH¸!½É»ùèVú­ç·snÏÜYs}·äžÒ½Šûš÷~4ý±]ê =>ê=:ð`Áƒ;cܱ'?eÿô~¼è!ùaÅ„ÎDó#ÛGÇ&}'/?^øxüIÖ“™§Å?+ÿ\ûÌäÙw¿xü20;5þ\ôüÓ¯›_¨¿ØÿÒîeïtØôýW¯f^—¼Qsà-ëmÿ»˜w3¹ï±ï+?˜~èùôñî§ŒOŸ~÷„óûendstream endobj 9 0 obj << /Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences [ 45/minus 96/quoteleft 144/dotlessi /grave /acute /circumflex /tilde /macron /breve /dotaccent /dieresis /.notdef /ring /cedilla /.notdef /hungarumlaut /ogonek /caron /space] >> endobj 10 0 obj << /Type /Font /Subtype /Type1 /Name /F4 /BaseFont /Helvetica-Oblique /Encoding 9 0 R >> endobj xref 0 11 0000000000 65535 f 0000000021 00000 n 0000000163 00000 n 0000001149 00000 n 0000001232 00000 n 0000001344 00000 n 0000001377 00000 n 0000000212 00000 n 0000000292 00000 n 0000004072 00000 n 0000004329 00000 n trailer << /Size 11 /Info 1 0 R /Root 2 0 R >> startxref 4434 %%EOF taxize/tests/testthat/test-gbif_downstream.R0000644000176200001440000000250612730576021021040 0ustar liggesusers# tests for gbif_downstream fxn in taxize context("gbif_downstream") test_that("gbif_downstream works", { skip_on_cran() aa <- gbif_downstream(key = 198, downto = "Genus") expect_is(aa, "data.frame") expect_is(aa$canonicalname, "character") expect_is(aa$rank, "character") expect_is(aa$key, "integer") expect_equal(unique(aa$rank), "genus") }) test_that("gbif_downstream works, more egs", { skip_on_cran() bb <- gbif_downstream(key = 1227, "Family") expect_is(bb, "data.frame") expect_is(bb$canonicalname, "character") expect_is(bb$rank, "character") expect_is(bb$key, "integer") expect_equal(unique(bb$rank), "family") }) test_that("gbif_downstream intermediate param works", { skip_on_cran() cc <- gbif_downstream(key = 198, downto = "genus", intermediate = TRUE) expect_is(cc, "list") expect_is(cc$target, "data.frame") expect_is(cc$intermediate, "list") expect_is(cc$target$canonicalname, "character") expect_is(cc$target$rank, "character") expect_is(cc$target$key, "integer") expect_equal(unique(cc$target$rank), "genus") }) test_that("gbif_downstream fails well", { skip_on_cran() expect_error(gbif_downstream(198, "adfadf"), "'arg' should be one of") expect_error(gbif_downstream(198, "Genus", intermediate = "adf"), "'intermediate' should be of class 'logical'") }) taxize/tests/testthat/helper-taxize.R0000644000176200001440000000004613160776615017500 0ustar liggesuserssw <- function(x) suppressWarnings(x) taxize/tests/testthat/test-tp_synonyms.R0000644000176200001440000000061313037743300020262 0ustar liggesusers# tests for tp_synonyms fxn in taxize context("tp_synonyms") test_that("tp_synonyms returns the correct value", { skip_on_cran() dat <- suppressMessages(tp_synonyms(id = 25509881)) expect_match(names(dat)[[1]], "accepted") expect_that(dat, is_a("list")) expect_that(dat[[1]], is_a("data.frame")) expect_that(dat[[2]], is_a("data.frame")) expect_that(ncol(dat[[2]]), equals(4)) }) taxize/tests/testthat/test-get_natservid.R0000644000176200001440000000241513160570217020522 0ustar liggesuserscontext("get_natservid") test_that("get_natservid returns the correct value", { skip_on_cran() expect_true(is.na(get_natservid(c('Gadus morhua', "howdy"), verbose=FALSE)[2])) }) test_that("get_natservid returns the correct class", { skip_on_cran() expect_is(get_natservid(c("Helianthus annuus", 'Gadus morhua'), verbose=FALSE), "natservid") }) test_that("get_natservid accepts ask-argument", { skip_on_cran() expect_true(is.na(get_natservid('asdasf', ask = FALSE, verbose=FALSE))) }) test_that("get_natservid fails well", { skip_on_cran() expect_true(is.na(get_natservid("asdfadsf", verbose = FALSE))) expect_error(get_natservid(), "argument \"query\" is missing") expect_error(get_natservid("clam", 5), "searchtype must be of class character") expect_error(get_natservid("clam", "stuff", verbose = FALSE), "'searchtype' must be one of") expect_error(get_natservid("clam", ask = 4), "ask must be of class logical") # rows param expect_error(get_natservid('Ruby*', 'common', rows = "foobar", verbose = FALSE), "'rows' must be numeric or NA") expect_error(get_natservid('Ruby*', 'common', rows = 0, verbose = FALSE), "'rows' value must be an integer 1 or greater") }) taxize/tests/testthat/test-tp_summary.R0000644000176200001440000000043413130760356020065 0ustar liggesusers# tests for tp_summary fxn in taxize context("tp_summary") test_that("tp_summary returns the correct value", { skip_on_cran() dat <- suppressMessages(tp_summary(id = 25509881)) expect_match(names(dat)[[1]], ".id") expect_is(dat, "data.frame") expect_gt(NCOL(dat), 10) }) taxize/tests/testthat/test-gni_parse.R0000644000176200001440000000046413037743457017650 0ustar liggesusers# tests for gni_parse fxn in taxize context("gni_parse") test_that("gni_parse returns the correct value", { skip_on_cran() tt <- gni_parse("Cyanistes caeruleus") expect_match(as.character(tt[,2]), "caeruleus") expect_that(tt[,"position_genus"], equals(9)) expect_that(tt, is_a("data.frame")) }) taxize/tests/testthat/test-itis_ping.R0000644000176200001440000000047012730576555017665 0ustar liggesusers# tests for itis_ping fxn in taxize context("itis_ping") test_that("itis_ping returns the correct class", { skip_on_cran() one <- itis_ping() expect_is(one, "logical") }) test_that("itis_ping returns correct things", { skip_on_cran() expect_false(itis_ping(503)) expect_true(itis_ping(200)) }) taxize/tests/testthat/test-ion.R0000644000176200001440000000124112744506001016442 0ustar liggesusers# tests for ion fxn in taxize context("ion") # test_that("ion returns the correct value", { # skip_on_cran() # # aa <- ion(155166) # bb <- ion(298678) # cc <- ion(4796748) # ursus americanus # dd <- ion(1280626) # puma concolor # # expect_is(aa, 'data.frame') # expect_is(bb, 'data.frame') # expect_is(cc, 'data.frame') # expect_is(dd, 'data.frame') # # expect_named(aa, c('identifier', 'title', 'namecomplete')) # }) # # test_that("ion fails well", { # skip_on_cran() # # expect_error(ion(), "argument \"x\" is missing") # expect_error(ion(2343434434434), "Internal Server Error") # expect_error(ion("asdfasfs"), "Internal Server Error") # }) taxize/tests/testthat/test-downstream.R0000644000176200001440000000463013133243163020045 0ustar liggesusers# tests for downstream fxn in taxize context("downstream") test_that("downstream basic usage works", { skip_on_cran() aa <- downstream("015be25f6b061ba517f495394b80f108", db = "col", downto = "Species") cc <- downstream("Ursus", db = 'gbif', downto = 'Species', verbose = FALSE) expect_is(aa, "downstream") expect_is(cc, "downstream") expect_named(aa, "015be25f6b061ba517f495394b80f108") expect_named(cc, "Ursus") expect_is(aa$`015be25f6b061ba517f495394b80f108`$childtaxa_id, "character") expect_is(cc$Ursus$rank, "character") }) test_that("downstream - many names input", { skip_on_cran() aa <- downstream(c("015be25f6b061ba517f495394b80f108", "6df38b73c53ce9e2982f3e1883305fc4"), db = "col", downto = 'Species', verbose = FALSE) expect_is(aa, "downstream") expect_named(aa, c("015be25f6b061ba517f495394b80f108", "6df38b73c53ce9e2982f3e1883305fc4")) }) test_that("downstream - taxonomic id input", { skip_on_cran() aa <- downstream(get_gbifid("Ursus", verbose = FALSE), db = 'gbif', downto = 'Species') expect_is(aa, "downstream") expect_is(aa[[1]], "data.frame") expect_is(aa[[1]]$canonicalname, "character") }) test_that("downstream - multiple data sources", { skip_on_cran() ids <- get_ids("Ursus", db = c('gbif', 'itis'), verbose = FALSE) aa <- downstream(ids, downto = 'Species') expect_is(aa, "downstream_ids") expect_is(aa[[1]], "downstream") expect_is(aa[[1]]$Ursus, "data.frame") }) test_that("downstream - Use the rows parameter", { skip_on_cran() aa <- downstream("Carya", db = 'col', downto = "Species", rows = 1, verbose = FALSE) expect_is(aa, "downstream") expect_is(aa[[1]], "data.frame") expect_is(aa[[1]]$childtaxa_id, "character") }) test_that("downstream - Works with COL which previously failed due to lack of infraspecies value in rank_ref dataset", { skip_on_cran() x <- as.colid("d324f3777e98688584cf8b68d0f06e5f", FALSE) aa <- downstream(x, db = 'col', downto = "suborder", verbose = FALSE) expect_is(aa, "downstream") expect_is(aa[[1]], "data.frame") expect_equal(NROW(aa[[1]]), 0) }) test_that("downstream fails well", { skip_on_cran() expect_error(downstream("adfaf"), "Must specify downto") expect_error(downstream("Ursus", downto = "adfasdf"), "Must specify db") expect_error(downstream("Ursus", downto = "Species", db = "asdfdsf"), "the provided db value was not recognised") }) taxize/tests/testthat/test-get_tpsid.R0000644000176200001440000000446313160557023017653 0ustar liggesusers# tests for get_tpsid fxn in taxize context("get_tpsid") test_that("get_tpsid returns the correct value", { skip_on_cran() expect_equal(get_tpsid(sciname='Helianthus excubitor', verbose=FALSE)[[1]], "50230899") expect_that(is.na(get_tpsid(sciname='adsf asdf asdf', verbose=FALSE)[[1]]), is_true()) }) test_that("get_tpsid returns the correct class", { skip_on_cran() expect_that(get_tpsid(c("Helianthus excubitor", "adsf asdf asdf"), verbose=FALSE), is_a("tpsid")) }) test_that("get_tpsid accepts ask-argument", { skip_on_cran() expect_that(is.na(get_tpsid(sciname='adsf asdf asdf', ask=FALSE, verbose=FALSE)[[1]]), is_true()) }) test_that("get_tpsid behaves correctly on dot inputs", { skip_on_cran() expect_that(get_tpsid('Pinus contorta var. yukonensis'), gives_warning("detected, being URL encoded")) expect_warning(get_tpsid('Pinus contorta yukonensis'), NA) }) test_that("get_tpsid behaves correctly on subspecific inputs", { skip_on_cran() expect_that(get_tpsid('Poa annua var annua'), gives_warning("Tropicos doesn't like")) expect_that(get_tpsid('Poa annua var. annua'), gives_warning("Tropicos doesn't like")) expect_that(get_tpsid('Poa annua sp. annua'), gives_warning("Tropicos doesn't like")) expect_that(get_tpsid('Poa annua ssp. annua'), gives_warning("Tropicos doesn't like")) expect_that(get_tpsid('Poa annua subspecies annua'), gives_warning("Tropicos doesn't like")) expect_warning(get_tpsid('Poa annua foo bar annua'), NA) }) test_that("get_tpsid fails as expected", { skip_on_cran() expect_error(get_tpsid(), "argument \"sciname\" is missing") expect_error(get_tpsid('Poa annua', ask = 4, verbose = FALSE), "ask must be of class logical") expect_error( get_tpsid("Poa annua", family = TRUE, verbose = FALSE), "family must be of class character") expect_error( get_tpsid("Poa annua", rank = TRUE, verbose = FALSE), "rank must be of class character") # rows param expect_error(get_tpsid("Poa annua", rows = "foobar", verbose = FALSE), "'rows' must be numeric or NA") expect_error(get_tpsid("Poa annua", rows = 0, verbose = FALSE), "'rows' value must be an integer 1 or greater") }) taxize/tests/testthat/test-tax_agg.R0000644000176200001440000000241212730577404017302 0ustar liggesusers# tests for tax_agg fxn in taxize context("tax_agg") test_that("tax_agg returns the correct class", { skip_on_cran() suppressPackageStartupMessages(library("vegan")) data(dune, package='vegan') take <- dune[ ,1:5] species <- c("Bellis perennis", "Empetrum nigrum", "Juncus bufonius", "Juncus articulatus", "Aira praecox") colnames(take) <- species out_ncbi <- tax_agg(take, rank = 'family', db = 'ncbi', verbose = FALSE) take2 <- take colnames(take2) <- NULL expect_that(out_ncbi, is_a("tax_agg")) expect_that(length(out_ncbi), equals(4)) expect_equal(class(out_ncbi), "tax_agg") expect_is(out_ncbi$x, "data.frame") expect_that(nrow(out_ncbi$x), equals(nrow(take))) expect_that(nrow(out_ncbi$by), equals(length(unique(colnames(take))))) expect_that(out_ncbi$n_pre, equals(length(unique(colnames(take))))) expect_error(tax_agg(as.matrix(take2), rank = 'family', db = 'ncbi', verbose = FALSE)) }) ## Moving this test to the long running tests branch since it takes a long time # take2 <- take # colnames(take2)[4] <- 'xxxxx' # out_itis <- tax_agg(take2, rank = 'family', db = 'itis', verbose = FALSE) # # # test_that("Handles NAs", { # expect_true(is.na(out_itis$by$agg[4])) # expect_that(ncol(out_itis$x), equals(ncol(take2))) # }) taxize/tests/testthat/test-tnrs.R0000644000176200001440000000142213124534404016645 0ustar liggesusers# tests for itis fxn in taxize context("tnrs") test_that("tnrs works", { skip_on_cran() mynames <- c("Panthera tigris", "Eutamias minimus") out <- tnrs(query = mynames, verbose = FALSE) expect_that(ncol(out), equals(7)) expect_that(out, is_a("data.frame")) }) test_that("tnrs returns user supplied order and row.names NULLed", { skip_on_cran() xxx <- c("Abies concolor", "Abies lasiocarpa", "Acer sp.", "Acer campestre", "Artemisia borealis", "Artemisia cana", "Brassica napus", "Brassica oleracea") out <- tnrs(xxx, source = "iPlant_TNRS", verbose = FALSE) expect_equal(NCOL(out), 7) expect_equal(NROW(out), 8) expect_is(out, "data.frame") # row.names are sequential expect_equal(as.numeric(row.names(out)), 1:8) }) taxize/tests/testthat/test-rankagg.R0000644000176200001440000000100312730577440017275 0ustar liggesusers# tests for rankagg fxn in taxize context("rankagg") test_that("rankagg throws error", { skip_on_cran() data(dune.taxon, package = 'vegan') dat <- dune.taxon set.seed(1234) dat$abundance <- round(rlnorm(n = nrow(dat), meanlog = 5, sdlog = 2), 0) out <- rankagg(data = dat, datacol = "abundance", rank = "Genus") expect_error(rankagg(datacol = "abundance", rank = "Genus")) expect_error(rankagg(data = dat, datacol = "abundance")) expect_is(out, "data.frame") expect_equal(out[1, 2], 13) }) taxize/tests/testthat/test-tp_accnames.R0000644000176200001440000000074512730577265020161 0ustar liggesusers# tests for tp_accnames fxn in taxize context("tp_accnames") test_that("tp_accnames returns the correct class", { skip_on_cran() out <- suppressMessages(tp_accnames(id = 25503923)) expect_that(out, is_a("list")) expect_that(out$synonyms, is_a("data.frame")) expect_that(out$acceptednames, is_a("data.frame")) expect_that(out$reference, is_a("data.frame")) expect_is(out$reference$referenceid, "integer") expect_that(out$reference$abbreviatedtitle, is_a("character")) }) taxize/tests/testthat/test-itis_kingdomnames.R0000644000176200001440000000144413037743415021376 0ustar liggesusers# tests for itis_kingdomnames fxn in taxize context("itis_kingdomnames") test_that("itis_kingdomnames - all", { skip_on_cran() aa <- itis_kingdomnames() expect_is(aa, "tbl_df") expect_named(aa, c('kingdomid', 'kingdomname', 'tsn')) expect_true(any(grepl("Animalia", aa$kingdomname))) expect_is(aa$kingdomname, "character") }) test_that("itis_kingdomnames - with TSN's", { skip_on_cran() one <- itis_kingdomnames(202385) two <- itis_kingdomnames(tsn = c(202385, 183833, 180543)) expect_match(one, "Animalia") expect_match(two[[1]], "Animalia") expect_that(one, is_a("character")) expect_that(two, is_a("character")) }) test_that("itis_kingdomnames returns error when not found", { skip_on_cran() expect_error(length(itis_kingdomnames("stuff")[[1]]), "Not Found") }) taxize/tests/testthat/test-fungorum.R0000644000176200001440000000452212761575301017534 0ustar liggesusers# tests for fungorum fxns in taxize context("fungorum") test_that("fungorum - fg_name_search", { skip_on_cran() aa <- fg_name_search(q = "Gymnopus", limit = 2) bb <- fg_name_search(q = "Gymnopus") expect_is(aa, "data.frame") expect_is(bb, "data.frame") expect_true(any(grepl("authors", names(aa)))) expect_equal(NROW(aa), 2) expect_equal(unique(aa$infraspecific_epithet), "Gymnopus") expect_true(any(grepl("authors", names(bb)))) expect_equal(NROW(bb), 10) expect_equal(unique(bb$infraspecific_epithet)[1], "Gymnopus") }) test_that("fungorum - fg_epithet_search", { skip_on_cran() aa <- fg_epithet_search(q = "phalloides", limit = 2) expect_is(aa, "data.frame") expect_true(any(grepl("authors", names(aa)))) expect_equal(NROW(aa), 2) expect_equal(unique(aa$infraspecific_rank), "sp.") }) test_that("fungorum - fg_name_by_key", { skip_on_cran() aa <- fg_name_by_key(17703) expect_is(aa, "data.frame") expect_true(any(grepl("pubplaceofpublication", names(aa)))) expect_true(any(grepl("uuid", names(aa)))) expect_equal(NROW(aa), 1) }) test_that("fungorum - fg_name_full_by_lsid", { skip_on_cran() aa <- fg_name_full_by_lsid("urn:lsid:indexfungorum.org:names:81085") expect_is(aa, "character") expect_equal(length(aa), 1) expect_true(grepl("Omphalotaceae", aa)) expect_true(grepl("1985", aa)) }) #test_that("fungorum - fg_all_updated_names", { # skip_on_cran() # # date <- as.numeric(gsub("-", "", as.character(Sys.Date()))) - 200 # aa <- fg_all_updated_names(date = date) # # expect_is(aa, "data.frame") # expect_gt(NROW(aa), 1) # expect_match(aa[1,], "indexfungorum") # # date <- as.numeric(gsub("-", "", as.character(Sys.Date() + 1))) # expect_equal(NROW(fg_all_updated_names(date = date)), 0) #}) test_that("fungorum - fg_deprecated_names", { skip_on_cran() date <- as.numeric(gsub("-", "", as.character(Sys.Date() - 30))) aa <- fg_deprecated_names(date = date) expect_is(aa, "data.frame") expect_gt(NROW(aa), 1) expect_match(aa[1,1], "indexfungorum") date <- as.numeric(gsub("-", "", as.character(Sys.Date() + 1))) expect_equal(NROW(fg_deprecated_names(date = date)), 0) }) test_that("fungorum - fg_author_search", { skip_on_cran() aa <- fg_author_search(q = "Fayod", limit = 2) expect_is(aa, "data.frame") expect_equal(NROW(aa), 2) expect_match(aa$authors, "Fayod") }) taxize/tests/testthat/test-comm2sci.R0000644000176200001440000000336613134434641017407 0ustar liggesuserscontext("comm2sci") test_that("comm2sci returns the correct values and classes", { skip_on_cran() tt <- suppressMessages(comm2sci(commnames='black bear')) uu <- suppressMessages(comm2sci(commnames='annual blue grass', db='tropicos')) zz <- suppressMessages(comm2sci(c('blue whale', 'dwarf surfclam'), db = "worms")) temp1 <- suppressMessages(comm2sci(commnames=c('black bear','roe deer'), db='eol')) temp2 <- suppressMessages(comm2sci(commnames='black bear', db='tropicos')) temp3 <- suppressMessages(comm2sci(commnames=c('black bear','roe deer'), db='eol')) expect_equal(names(tt), 'black bear') expect_equal(names(uu), 'annual blue grass') expect_equal(names(zz), c('blue whale', 'dwarf surfclam')) expect_identical(suppressMessages(comm2sci(commnames='bear', db='itis', itisby = "asfasdf"))[[1]], character(0)) expect_named(temp2) expect_named(temp3) expect_that(tt, is_a("list")) expect_that(tt[[1]], is_a("character")) expect_that(uu, is_a("list")) expect_that(uu[[1]], is_a("character")) expect_is(suppressMessages(comm2sci(commnames='black bear', db='itis', simplify = FALSE))[[1]], "data.frame") }) test_that("comm2sci fails well", { expect_error(comm2sci(5), "commnames must be of class character") expect_error(comm2sci(list()), "commnames must be of class character") expect_error(comm2sci(mtcars), "commnames must be of class character") expect_error(comm2sci("bear", db = "adsf"), "'db' must be one of 'eol', 'itis', 'tropicos', 'ncbi', 'worms'") expect_error(comm2sci("bear", simplify = "Asdf"), "simplify must be of class logical") # no results if itisby is not a valid value, doesn't error though expect_equal(length(comm2sci('bear', db='itis', itisby = "asdff")[[1]]), 0) }) taxize/tests/testthat/test-vascan_search.r0000644000176200001440000000106512730577200020525 0ustar liggesusers# tests for vascan_search fxn in taxize context("vascan_search") test_that("vascan_search returns the correct class", { skip_on_cran() aa <- vascan_search(q = "Helianthus annuus") bb <- vascan_search(q = c("Helianthus annuus", "Crataegus dodgei"), raw=TRUE) splist <- names_list(rank='species', size=50) cc <- vascan_search(q = splist) expect_is(aa, "list") expect_is(bb, "character") expect_is(cc, "list") expect_is(aa[[1]]$matches[[1]]$taxonomicassertions, "data.frame") expect_equal(NCOL(aa[[1]]$matches[[1]]$taxonomicassertions), 7) }) taxize/tests/testthat/test-genbank2uid.R0000644000176200001440000000562213076225734020067 0ustar liggesuserscontext("genbank2uid") test_that("genbank2uid - with accession numbers", { skip_on_cran() aa <- genbank2uid(id = 'AJ748748') bb <- genbank2uid(c('X78312','KM495596')) expect_is(aa, "uid") expect_is(unclass(aa), "character") expect_is(attr(aa, "match"), "character") expect_false(attr(aa, "multiple_matches")) expect_false(attr(aa, "pattern_match")) expect_is(attr(aa, "uri"), "character") expect_match(attr(aa, "uri"), "http") expect_is(bb, "uid") expect_is(unclass(bb), "character") expect_is(attr(bb, "match"), "character") expect_equal(attr(bb, "multiple_matches"), c(FALSE, FALSE)) expect_equal(attr(bb, "pattern_match"), c(FALSE, FALSE)) expect_is(attr(bb, "uri"), "character") expect_match(attr(bb, "uri"), "http") }) test_that("genbank2uid - with gi numbers", { skip_on_cran() aa <- genbank2uid(id = 62689767) bb <- genbank2uid(c(62689767,156446673)) expect_is(aa, "uid") expect_is(unclass(aa), "character") expect_is(attr(aa, "match"), "character") expect_false(attr(aa, "multiple_matches")) expect_false(attr(aa, "pattern_match")) expect_is(attr(aa, "uri"), "character") expect_match(attr(aa, "uri"), "http") expect_is(bb, "uid") expect_is(unclass(bb), "character") expect_is(attr(bb, "match"), "character") expect_equal(attr(bb, "multiple_matches"), c(FALSE, FALSE)) expect_equal(attr(bb, "pattern_match"), c(FALSE, FALSE)) expect_is(attr(bb, "uri"), "character") expect_match(attr(bb, "uri"), "http") }) test_that("genbank2uid - where ID has more than one taxon associated", { skip_on_cran() aa <- genbank2uid(id = "AM420293") expect_is(aa, "list") expect_is(aa[[1]], "uid") expect_is(aa[[2]], "uid") expect_is(aa[[3]], "uid") expect_match(attr(aa[[1]], "name"), "Saccharopolyspora") expect_match(attr(aa[[2]], "name"), "Saccharopolyspora") expect_match(attr(aa[[3]], "name"), "Saccharopolyspora") }) test_that("genbank2uid - fails well", { skip_on_cran() # one Id not found expect_warning(genbank2uid(id = "gwa2_scaffold_1731_16S_1"), "An error occurred looking up taxon ID\\(s\\)\\.") aa <- suppressWarnings(genbank2uid(id = "gwa2_scaffold_1731_16S_1")) expect_is(aa, "uid") expect_true(is.na(unclass(aa))) # many Ids not found expect_warning(genbank2uid(id = c("gwa2_scaffold_1731_16S_1", "asdfadfs")), "An error occurred looking up taxon ID\\(s\\)\\.") expect_warning(genbank2uid(id = c("gwa2_scaffold_1731_16S_1", "asdfadfs")), "set the 'batch_size' option to 1") aa <- suppressWarnings(genbank2uid(id = c("gwa2_scaffold_1731_16S_1", "asdfadfs"))) expect_is(aa, "uid") expect_true(all(is.na(unclass(aa)))) # id not given expect_error(genbank2uid(), "argument \"id\" is missing") # id not given expect_error(genbank2uid("Asdfdf", batch_size = "Asdf"), "batch_size must be of class integer, numeric") }) taxize/tests/testthat/test-itis_downstream.R0000644000176200001440000000061013037743401021072 0ustar liggesusers# tests for itis_downstream fxn in taxize context("itis_downstream") test_that("itis_downstream returns the correct value", { skip_on_cran() data(rank_ref, package = "taxize") dat_ <- itis_downstream(tsns=183264, "Species", verbose=FALSE) expect_match(as.character(dat_[1,"rankname"]), "species") expect_that(dat_, is_a("data.frame")) expect_that(dim(dat_)[2], equals(6)) }) taxize/tests/testthat/test-eol_search.R0000644000176200001440000000060412730575776020007 0ustar liggesusers# tests for eol_search fxn in taxize context("eol_search") test_that("eol_search returns the correct value", { skip_on_cran() expect_that(eol_search(terms='Ursus americanus luteolus')[[1]], equals(1273844)) }) test_that("eol_search returns the correct class", { skip_on_cran() expect_is(eol_search(terms='Salix')[[1]], "integer") expect_is(eol_search('Homo'), "data.frame") }) taxize/tests/testthat/test-get_ids.R0000644000176200001440000000363612730576300017311 0ustar liggesusers# tests for get_ids fxn in taxize context("get_ids") test_that("get_ids returns the correct values and classses", { skip_on_cran() tt <- get_ids(names="Chironomus riparius", db = 'ncbi', verbose=FALSE) expect_equal(tt[[1]][[1]], "315576") expect_that(tt, is_a("ids")) expect_that(tt[[1]], is_a("uid")) expect_that(tt[[1]][[1]], is_a("character")) }) test_that("get_ids accepts ask and verbose arguments", { skip_on_cran() expect_message(get_ids(names="Pinus contorta", db = 'ncbi')) expect_message(get_ids(names="Pinus contorta", db = 'ncbi', verbose=FALSE), NA) }) nn <- c('Imperata brasiliensis','Hylebates cordatus','Apocopis intermedius', 'Paspalum subciliatum','Bromus nottowayanus','Chimonobambusa marmorea', 'Panicum adenophorum','Otatea glauca','Himalayacalamus falconeri', 'Briza lamarckiana','Trisetum turcicum','Brachiaria subulifolia', 'Boissiera squarrosa','Arthrostylidium pubescens','Neyraudia reynaudiana' ,'Bromus gunckelii','Poa sudicola','Pentameris thuarii', 'Calamagrostis inexpansa','Willkommia texana','Helictotrichon cantabricum', 'Muhlenbergia tenuifolia','Sporobolus ioclados','Bambusa cerosissima', 'Axonopus flabelliformis','Glyceria lithuanica','Pentaschistis malouinensis', 'Perrierbambus madagascariensis','Hierochloe alpina','Hemarthria compressa', 'Zizania latifolia','Festuca altaica','Gigantochloa wrayi','Festuca alpina', 'Aegilops caudata','Elymus cognatus','Agrostis gracililaxa','Gymnopogon foliosus') test_that("works on a variety of names", { skip_on_cran() expect_that(get_ids(nn[13], db = c('ncbi','itis','col','tropicos'), ask=FALSE, verbose=FALSE), is_a("ids")) expect_that(get_ids(nn[14], db = c('ncbi','itis','col','tropicos'), ask=FALSE, verbose=FALSE), is_a("ids")) expect_that(get_ids(nn[15], db = c('ncbi','itis','col','tropicos'), ask=FALSE, verbose=FALSE), is_a("ids")) }) taxize/tests/testthat/test-eol_pages.R0000644000176200001440000000124512730575761017635 0ustar liggesusers# tests for eol_pages fxn in taxize context("eol_pages") test_that("eol_pages returns the correct value and classes", { skip_on_cran() pageid <- suppressMessages(eol_search('Pomatomus'))$pageid[1] pageid2 <- suppressMessages(eol_search('Helianthus'))$pageid[1] aa <- suppressMessages(eol_pages(taxonconceptID = pageid)) expect_is(aa, "list") expect_is(aa$scinames, "data.frame") expect_is(aa$syns, "character") bb <- suppressMessages(eol_pages(taxonconceptID = pageid2)) expect_is(bb, "list") expect_is(bb$scinames, "data.frame") expect_is(bb$syns, "character") expect_is(suppressMessages(eol_pages(taxonconceptID=pageid))$scinames, "data.frame") }) taxize/tests/testthat/test-col_downstream.R0000644000176200001440000000141112730575601020703 0ustar liggesusers# tests for col_downstream fxn in taxize context("col_downstream") test_that("col_downstream returns the correct class", { skip_on_cran() temp4 <- col_downstream(name="Animalia", downto = "Phylum", verbose = FALSE) temp5 <- col_downstream(name="Plantae", downto = "Phylum", verbose = FALSE) temp6 <- col_downstream(name="Salicaceae", downto = "Genus", verbose = FALSE) expect_is(temp4, "list") expect_is(temp5, "list") expect_is(temp6, "list") expect_is(temp4$Animalia, "data.frame") expect_is(temp5[[1]], "data.frame") expect_equal(as.character(temp4[[1]][,3][[1]]), "phylum") }) test_that("gives what's expected on input errors", { library("plyr") expect_message(col_downstream(name="Pinus contorta", downto = "Species")[[1]], "Try adjusting") }) taxize/tests/testthat/test-itis_getrecord.R0000644000176200001440000000071613125014541020666 0ustar liggesusers# tests for itis_getrecord fxn in taxize context("itis_getrecord") test_that("itis_getrecord returns the correct class", { skip_on_cran() one <- itis_getrecord(202385, verbose=FALSE) two <- itis_getrecord(c(202385,70340), verbose=FALSE) three <- itis_getrecord("urn:lsid:itis.gov:itis_tsn:202385", "lsid", verbose=FALSE) expect_that(one, is_a("list")) expect_that(two, is_a("list")) expect_that(three, is_a("list")) }) taxize/tests/testthat/test-tnrs_sources.R0000644000176200001440000000036212730577274020430 0ustar liggesusers# tests for tnrs_sources fxn in taxize context("tnrs_sources") test_that("tnrs_sources returns the correct value", { skip_on_cran() out <- tnrs_sources() expect_that(length(out), equals(3)) expect_that(out, is_a("character")) }) taxize/tests/testthat/test-iucn_getname.R0000644000176200001440000000044213024633340020314 0ustar liggesuserscontext("iucn_getname") # test_that("iucn_getname returns the correct value", { # skip_on_cran() # temp <- iucn_getname(name = "Cyanistes caeruleus", verbose = FALSE) # expect_equal(temp, "Parus caeruleus") # expect_is(temp, "character") # expect_equal(length(temp), 1) # }) taxize/tests/testthat/test-eol_ping.R0000644000176200001440000000032712730575770017473 0ustar liggesusers# tests for eol_ping fxn in taxize context("eol_ping") test_that("eol_ping returns the correct value", { skip_on_cran() expect_true(eol_ping()) expect_false(eol_ping(503)) expect_true(eol_ping("content")) }) taxize/tests/testthat/test-plantminer.R0000644000176200001440000000114013022643273020027 0ustar liggesuserscontext("plantminer") # test_that("plantminer returns the correct value", { # skip_on_cran() # # plants <- c("Myrcia lingua", "Myrcia bella", "Ocotea pulchella", # "Miconia", "Coffea arabica var. amarella", "Bleh") # df <- plantminer(plants, verbose = FALSE) # # expect_is(df, "data.frame") # expect_is(df$id, "character") # # expect_equal(df$original.search[1], plants[1]) # }) # # test_that("plantminer fails well", { # skip_on_cran() # # expect_error(plantminer(), "argument \"plants\" is missing") # expect_equal(plantminer("foo bar", verbose=FALSE)$note, "not found") # }) taxize/tests/testthat/test-gnr_resolve.R0000644000176200001440000000466312750426237020226 0ustar liggesuserscontext("gnr_resolve") test_that("gnr_resolve returns the correct value", { skip_on_cran() tmp <- gnr_resolve(names = c("Helianthus annuus", "Homo sapiens")) expect_equal(NCOL(tmp), 5) expect_is(tmp, "data.frame") expect_is(tmp$matched_name, "character") }) test_that("best_match_only works correctly", { skip_on_cran() x <- 'Aconitum degeni subsp. paniculatum' a <- gnr_resolve(names = x, best_match_only = TRUE) b <- gnr_resolve(x, best_match_only = FALSE) expect_is(a, "data.frame") expect_is(b, "data.frame") expect_equal(NROW(a), 0) expect_equal(attributes(a)$not_known, x) expect_named(attributes(a), c("names", "row.names", "class", "not_known")) expect_is(b$data_source_title, "character") ## same order as user supplied cc <- gnr_resolve(names = c("Homo sapiens", "Helianthus annuus"), best_match_only = TRUE) expect_identical(cc$user_supplied_name, c("Homo sapiens", "Helianthus annuus")) }) test_that("canonical works correctly", { skip_on_cran() # x = a canse where no canonical names is found x <- gnr_resolve("Metzgeria", data_source_ids = c(12), canonical = TRUE) y <- "Helianthus annuus" w <- gnr_resolve(y, canonical = TRUE) z <- gnr_resolve(y, canonical = FALSE) expect_is(w, "data.frame") expect_is(z, "data.frame") expect_named(w, c("user_supplied_name", "submitted_name", "data_source_title", "score", "matched_name2")) expect_named(z, c("user_supplied_name", "submitted_name", "matched_name", "data_source_title", "score")) expect_equal(NROW(x), 2) expect_true(is.na(x$matched_name2[2])) }) test_that("fields parameter works correctly", { skip_on_cran() tmp1 <- gnr_resolve(names = c("Asteraceae", "Plantae"), fields = 'all') tmp2 <- gnr_resolve(names = c("Asteraceae", "Plantae"), fields = 'minimal') expect_is(tmp1, "data.frame") expect_is(tmp1$matched_name, "character") expect_true(any(grepl("Asteraceae", tmp1$matched_name))) expect_is(tmp2, "data.frame") expect_is(tmp2$matched_name, "character") expect_true(any(grepl("Asteraceae", tmp2$matched_name))) expect_true(identical(tmp1$matched_name, tmp2$matched_name)) expect_lt(NCOL(tmp2), NCOL(tmp1)) }) test_that("works correctly when no data found for preferred data source", { skip_on_cran() aa <- gnr_resolve("Scabiosa triandra", preferred_data_sources = c(3,12), best_match_only = TRUE) expect_is(aa, "data.frame") expect_equal(NROW(aa), 1) expect_equal(length(attributes(aa)$not_known), 0) }) taxize/tests/testthat/test-bold_search.R0000644000176200001440000000161313160557672020142 0ustar liggesusers# tests for bold_search fxn in taxize context("bold_search") test_that("col_search returns the correct value, dimensions, and classes", { skip_on_cran() a <- bold_search(name="Apis") b <- bold_search(name="Aga", fuzzy=TRUE) c <- bold_search(name=c("Apis","Puma concolor")) d <- bold_search(id=88899) expect_equal(names(a)[1], "taxid") expect_that(a$taxon, equals("Apis")) expect_equal(NROW(a), 1) expect_gt(NROW(b), 10) expect_gt(NROW(c), 1) expect_equal(NROW(d), 1) expect_is(a, "data.frame") expect_is(b, "data.frame") expect_that(a$tax_rank, is_a("character")) expect_that(d$parentname, is_a("character")) }) test_that("bold_search is robust to user error", { skip_on_cran() expect_is(bold_search(name = "asdfsdf"), "data.frame") expect_is(bold_search(name = ""), "data.frame") expect_is(bold_search(id = "asdfsdf"), "data.frame") expect_error(bold_search()) }) taxize/tests/testthat/test-eubon.R0000644000176200001440000000217613022636006016774 0ustar liggesusers# tests for eubon fxn in taxize context("eubon_search") test_that("eubon_search works", { skip_on_cran() aa <- eubon_search("Prionus") bb <- eubon_search("Salmo", providers = 'worms') cc <- eubon_search("Salmo", providers = c('pesi', 'worms')) expect_is(aa, "data.frame") expect_is(bb, "data.frame") expect_is(cc, "data.frame") expect_is(aa$otherNames, "list") expect_match(aa$taxon.taxonName.scientificName, "Prionus") expect_equal(NROW(aa), 1) expect_is(bb$checklistId, "character") expect_match(bb$taxon.taxonName.scientificName, "Salmo") expect_equal(NROW(bb), 1) expect_is(cc$taxon.accordingTo, "character") expect_match(cc$taxon.taxonName.scientificName, "Salmo") expect_equal(NROW(cc), 2) }) test_that("eubon_search fails well", { skip_on_cran() expect_error(eubon_search("Salmo", 'asdfdf'), "Error 400 invalid value for request parameter 'providers'") expect_error(eubon_search("Salmo", searchMode = "adfdf"), "Error 400 Bad Request") }) test_that("eubon and eubon_search are aliases of each other", { skip_on_cran() expect_identical(eubon, eubon_search) }) taxize/tests/testthat/test-class2tree.R0000644000176200001440000000151513057575611017743 0ustar liggesusers# tests for class2tree fxn in taxize context("class2tree") spnames <- c('Klattia flava', 'Trollius sibiricus', 'Arachis paraguariensis', 'Tanacetum boreale', 'Gentiana yakushimensis','Sesamum schinzianum', 'Pilea verrucosa','Tibouchina striphnocalyx','Lycium dasystemum', 'Berkheya echinacea','Androcymbium villosum', 'Helianthus annuus','Madia elegans','Lupinus albicaulis', 'Pinus lambertiana') test_that("class2tree returns the correct value and class", { skip_on_cran() out <- classification(spnames, db = 'ncbi', verbose = FALSE) out <- out[!is.na(out)] tr <- class2tree(out) expect_identical(tr$names, names(out)) expect_is(plot(tr), "list") expect_is(tr, "classtree") expect_is(tr$phylo, "phylo") expect_is(tr$classification, "data.frame") expect_is(tr$distmat, "dist") expect_is(tr$names, "character") }) taxize/tests/testthat/test-tp_search.R0000644000176200001440000000247412730577246017654 0ustar liggesusers# tests for tp_search fxn in taxize context("tp_search") test_that("tp_search returns the correct class", { skip_on_cran() ttt <- suppressMessages(tp_search(name = 'Poa annua')) uuu <- suppressMessages(tp_search(name = 'stuff things')) expect_that(ttt, is_a("data.frame")) expect_that(uuu, is_a("data.frame")) expect_that(names(uuu), equals("error")) expect_that(as.character(uuu[1,1]), equals("No names were found")) }) test_that("tp_search behaves correctly on dot inputs", { skip_on_cran() expect_that(tp_search('Poa annua .annua'), gives_warning("detected, being URL encoded")) expect_warning(tp_search('Poa annua annua'), NA) }) test_that("tp_search behaves correctly on subspecific inputs", { skip_on_cran() expect_that(tp_search('Poa annua var annua'), gives_warning("Tropicos doesn't like")) expect_that(tp_search('Poa annua var. annua'), gives_warning("Tropicos doesn't like")) expect_that(tp_search('Poa annua sp. annua'), gives_warning("Tropicos doesn't like")) expect_that(tp_search('Poa annua ssp. annua'), gives_warning("Tropicos doesn't like")) expect_that(tp_search('Poa annua subspecies annua'), gives_warning("Tropicos doesn't like")) expect_warning(tp_search('Poa annua foo bar annua'), NA) }) taxize/tests/testthat/test-itis_taxrank.R0000644000176200001440000000042113037743341020362 0ustar liggesusers# tests for itis_taxrank fxn in taxize context("itis_taxrank") test_that("itis_taxrank returns the correct value", { skip_on_cran() temp <- itis_taxrank(query=202385, verbose=FALSE) expect_match(as.character(temp), "Subspecies") expect_is(temp, "character") }) taxize/tests/testthat/test-itis_native.R0000644000176200001440000000104212771323351020177 0ustar liggesusers# tests for itis_native fxn in taxize context("itis_native") test_that("itis_native returns the correct class", { skip_on_cran() one <- itis_native(what="values") two <- itis_native(what="originvalues") three <- itis_native(tsn=180543) four <- itis_native(tsn=c(180543,41074,36616)) expect_is(one, "character") expect_is(two, "data.frame") expect_is(two, "tbl_df") expect_is(three, "data.frame") expect_is(three, "tbl_df") expect_is(four, "list") expect_is(four[[1]], "data.frame") expect_is(four[[1]], "tbl_df") }) taxize/tests/testthat/test-get_tsn.R0000644000176200001440000000306213160776463017341 0ustar liggesusers# tests for get_tsn fxn in taxize context("get_tsn") test_that("get_tsn returns the correct value", { skip_on_cran() expect_that(is.na(get_tsn("asdfasdf", verbose=FALSE)[[1]]), is_true()) }) test_that("get_tsn returns the correct class", { skip_on_cran() expect_is(get_tsn("Chironomus riparius", verbose=FALSE), "tsn") }) test_that("get_tsn accepts ask and verbose arguments", { skip_on_cran() expect_message(get_tsn('Dugesia', verbose=TRUE)) #expect_message(get_tsn('Dugesia', verbose=FALSE), NA) expect_that(all(is.na(suppressWarnings(get_tsn('black bear', searchtype="common", ask=FALSE, verbose=FALSE)))), is_true()) }) test_that("get_tsn fails as expected", { skip_on_cran() expect_error(get_tsn(), "argument \"searchterm\" is missing") expect_error(get_tsn("Arni", ask = 4, verbose = FALSE), "ask must be of class logical") expect_error( get_tsn(searchterm="black bear", searchtype=5, verbose = FALSE), "searchtype must be of class character") expect_error( get_tsn("Arni", accepted = 34, verbose = FALSE), "accepted must be of class logical") # searchtype values expect_error( get_tsn(searchterm="black bear", searchtype="asdfadf", verbose = FALSE), "'arg' should be one of") # rows param expect_error(get_tsn("Achlya", rows = "foobar", verbose = FALSE), "'rows' must be numeric or NA") expect_error(get_tsn("Achlya", rows = 0, verbose = FALSE), "'rows' value must be an integer 1 or greater") }) taxize/tests/testthat/test-eol_dataobjects.R0000644000176200001440000000150412730575731021014 0ustar liggesusers# tests for eol_dataobjects fxn in taxize context("eol_dataobjects") test_that("eol_dataobjects with taxonomy TRUE", { skip_on_cran() temp <- suppressMessages(eol_dataobjects(id = "d72801627bf4adf1a38d9c5f10cc767f", verbose = FALSE)) expect_is(temp, "list") expect_is(temp$scientificname, "character") expect_is(temp$identifier, "integer") expect_is(temp$taxonconcepts, "data.frame") }) test_that("eol_dataobjects with taxonomy FALSE", { skip_on_cran() # taxonomy=FALSE - gives no taxonconcepts data.frame temp2 <- suppressMessages(eol_dataobjects(id = "d72801627bf4adf1a38d9c5f10cc767f", taxonomy = FALSE, verbose = FALSE)) expect_is(temp2, "list") expect_is(temp2$scientificname, "character") expect_is(temp2$identifier, "integer") expect_null(temp2$taxonconcepts) }) taxize/tests/testthat/test-itis_terms.R0000644000176200001440000000066312730576606020063 0ustar liggesusers# tests for itis_terms fxn in taxize context("itis_terms") test_that("itis_terms returns the correct class", { skip_on_cran() one <- itis_terms(query='bear', verbose=FALSE) two <- itis_terms(query='tarweed', "common", verbose=FALSE) three <- itis_terms(query='Poa annua', "scientific", verbose=FALSE) expect_that(one, is_a("data.frame")) expect_that(two, is_a("data.frame")) expect_that(three, is_a("data.frame")) }) taxize/tests/testthat/test-tol_resolve.R0000644000176200001440000000325512771333241020225 0ustar liggesuserscontext("tol_resolve") test_that("tol_resolve basic usage works", { skip_on_cran() xx <- c("echinodermata", "xenacoelomorpha", "chordata", "hemichordata") tmp <- tol_resolve(names = xx) expect_is(tmp, "data.frame") expect_is(tmp$search_string, "character") expect_is(tmp$number_matches, "character") expect_equal(NROW(tmp), 4) # query gives back expected output expect_equal( xx, tolower(tmp$unique_name) ) }) test_that("context_name works correctly", { skip_on_cran() aa <- tol_resolve(c("Hyla", "Salmo", "Diadema", "Nautilus"), context_name = "Animals") expect_is(aa, "data.frame") expect_is(aa$search_string, "character") expect_is(aa$number_matches, "character") # errors when not in accepted set expect_error( tol_resolve(c("Hyla", "Salmo", "Diadema", "Nautilus"), context_name = "stuff"), "is not valid. Check possible values using tnrs_contexts" ) }) test_that("do_approximate_matching works correctly", { skip_on_cran() aa <- tol_resolve("Nautilas", do_approximate_matching = TRUE) expect_is(aa, "data.frame") expect_equal(aa$unique_name, "Nautilus") expect_error( tol_resolve("Nautilas", do_approximate_matching = FALSE), "No matches for any of the provided taxa" ) }) test_that("fails well", { expect_error(tol_resolve(), "You must supply") expect_error(tol_resolve(ids = 5), "You must supply a") expect_error(tol_resolve(context_name = "stuff"), "is not valid") expect_error(tol_resolve(names = 5), "must be of class") }) test_that("fails well - HTTP needed", { skip_on_cran() expect_error(tol_resolve(c("Hyla", "Salmo", "Diadema", 5)), "HTTP failure") }) taxize/tests/testthat/test-gni_details.R0000644000176200001440000000052513037743452020154 0ustar liggesusers# tests for gni_details fxn in taxize context("gni_details") test_that("gni_details returns the correct value", { skip_on_cran() expect_match(as.character(gni_details(id = 17802847)[,3]), "none") }) test_that("gni_details returns the correct class", { skip_on_cran() expect_that(gni_details(id = 17802847), is_a("data.frame")) }) taxize/tests/testthat/test-gnr_datasources.R0000644000176200001440000000052612672032226021050 0ustar liggesusers# tests for gnr_datasources fxn in taxize context("gnr_datasources") # tmp <- gnr_datasources() # # test_that("gnr_datasources returns the correct class", { # expect_that(tmp, is_a("data.frame")) # }) # # test_that("gnr_resolve returns the correct value", { # expect_that(ncol(tmp), equals(2)) # expect_equal(tmp$title[12], 'EOL') # }) taxize/tests/testthat/test-tax_name.R0000644000176200001440000000441213161006466017460 0ustar liggesusers# tests for tax_name fxn in taxize context("tax_name") test_that("tax_name returns the correct class", { skip_on_cran() tmp_ncbi <- tax_name(query = "Baetis", get = c("family", "order"), db = "ncbi", verbose=FALSE) tmp_ncbi2 <- tax_name(query = c("Helianthus annuus", 'Baetis rhodani'), get = c("genus", "kingdom"), db = "ncbi", verbose=FALSE) tmp_na2 <- tax_name(query=c("Helianthus annuus", 'xxxx'), get=c("family", "order"), db="ncbi", verbose=FALSE) tmp_na3 <- sw(tax_name(query = c("Helianthus annuus", 'xxxx'), get = c("family", "order"), db="itis",verbose=FALSE)) expect_is(tmp_ncbi, "data.frame") expect_is(tmp_na2, "data.frame") expect_is(tmp_na3, "data.frame") expect_equal(ncol(tmp_ncbi), 4) expect_equal(ncol(tmp_na2), 4) expect_equal(ncol(tmp_na3), 4) expect_equal(tmp_ncbi$family, "Baetidae") expect_equal(tmp_ncbi$order, "Ephemeroptera") expect_true(any(is.na(tmp_na2[2, ]))) expect_true(any(is.na(tmp_na3[2, ]))) expect_that(nrow(tmp_ncbi2), equals(2)) }) test_that("tax_name accepts ask-argument", { skip_on_cran() expect_that(is.na(sw(tax_name(query = "Dugesia", get = "family", db = "ncbi", ask = FALSE, verbose = FALSE))$family), is_true()) }) test_that("taxon with no data returned from classification() works", { skip_on_cran() aa <- sw(tax_name("Galagoides demidovii", get = "species", rows = 1, verbose = FALSE)) expect_is(aa, "data.frame") expect_true(is.na(aa$species)) expect_warning( tax_name("Galagoides demidovii", get = "species", rows = 1, verbose = FALSE), "no hierarchy data found in ITIS" ) bb <- sw(tax_name("Asterias helianthus", get = "species", verbose = FALSE)) expect_is(bb, "data.frame") expect_true(is.na(bb$species)) expect_warning(tax_name("Asterias helianthus", get = "species", verbose = FALSE), "no hierarchy data found in ITIS") cc <- sw(tax_name("Stellonia helianthus", get = "species", verbose = FALSE)) expect_is(cc, "data.frame") expect_true(is.na(cc$species)) expect_warning(tax_name("Stellonia helianthus", get = "species", verbose = FALSE), "no hierarchy data found in ITIS") }) taxize/tests/testthat/test-itis_refs.R0000644000176200001440000000057312730576563017672 0ustar liggesusers# tests for itis_refs fxn in taxize context("itis_refs") test_that("itis_refs returns the correct class", { skip_on_cran() one <- itis_refs(202385, verbose=FALSE) two <- itis_refs(c(202385,70340), verbose=FALSE) expect_that(one, is_a("list")) expect_that(one[[1]], is_a("data.frame")) expect_that(two, is_a("list")) expect_that(two[[1]], is_a("data.frame")) }) taxize/tests/testthat/test-gbif_parse.R0000644000176200001440000000072512777170055020000 0ustar liggesuserscontext("gbif_parse") test_that("gbif_parse returns the correct values and dimensions classes", { skip_on_cran() tt <- gbif_parse(scientificname = 'x Agropogon littoralis') expect_that(as.character(tt[1,1]), matches('x Agropogon littoralis')) expect_that(as.character(tt[1,2]), matches('SCIENTIFIC')) expect_that(dim(tt), equals(c(1,11))) expect_is(tt, "data.frame") expect_is(tt$specificepithet, "character") expect_is(tt$authorsparsed, "logical") }) taxize/tests/testthat/test-get_uid.R0000644000176200001440000000565113160543254017312 0ustar liggesusers# tests for get_uid fxn in taxize context("get_uid") test_that("get_uid returns the correct value", { skip_on_cran() expect_that(is.na(get_uid(c("Chironomus riparius", "aaa"), verbose=FALSE)[2]), is_true()) }) test_that("get_uid returns the correct class", { skip_on_cran() expect_that(get_uid(c("Chironomus riparius", "Chaetopteryx"), verbose=FALSE), is_a("uid")) }) test_that("get_uid accepts ask-argument", { skip_on_cran() expect_that(is.na( suppressWarnings(get_uid('Dugesia', ask = FALSE, verbose=FALSE))), is_true()) }) test_that("get_uid query modifiers work", { skip_on_cran() ### w/ modifiers to the name mod1 <- get_uid(sciname = "Aratinga", verbose=FALSE) mod2 <- get_uid(sciname = "Aratinga", modifier = "Organism", rows = 1, verbose=FALSE) expect_is(mod1, "uid") expect_is(mod2, "uid") expect_equal(mod1[[1]], "12945") expect_equal(mod2[[1]], "1230190") ### w/ rank query rq1 <- get_uid(sciname = "Pinus", rank_query = "genus", verbose=FALSE) rq2 <- get_uid(sciname = "Pinus", rank_query = "subgenus", verbose=FALSE) expect_is(rq1, "uid") expect_is(rq2, "uid") expect_equal(rq1[[1]], "3337") expect_equal(rq2[[1]], "139271") }) test_that("get_uid filtering works", { skip_on_cran() ### w/ division df1 <- get_uid(sciname = "Echinacea", division_filter = "eudicots", verbose=FALSE) df2 <- get_uid(sciname = "Echinacea", division_filter = "sea urchins", verbose=FALSE) expect_is(df1, "uid") expect_is(df2, "uid") expect_equal(df1[[1]], "53747") expect_equal(df2[[1]], "7674") ## Rank example rf1 <- get_uid(sciname = "Pinus", rank_filter = "genus", rows = 2, verbose=FALSE) rf2 <- get_uid(sciname = "Pinus", rank_filter = "subgenus", verbose=FALSE) expect_is(rf1, "uid") expect_is(rf2, "uid") expect_equal(rf1[[1]], "3337") expect_equal(rf2[[1]], "139271") }) test_that("get_uid fails as expected", { skip_on_cran() expect_error(get_uid(), "argument \"sciname\" is missing") expect_error(get_uid("Satyrium", ask = 4, verbose = FALSE), "ask must be of class logical") expect_error( get_uid(sciname = "Aratinga acuticauda", modifier = 5, verbose = FALSE), "modifier must be of class character") expect_error( get_uid(sciname = "Pinus", rank_query = TRUE, verbose = FALSE), "rank_query must be of class character") expect_error( get_uid(sciname = "Echinacea", division_filter = 4, verbose = FALSE), "division_filter must be of class character") expect_error( get_uid(sciname = "Pinus", rank_filter = 34, verbose = FALSE), "rank_filter must be of class character") # rows param expect_error(get_uid("Achlya", rows = "foobar", verbose = FALSE), "'rows' must be numeric or NA") expect_error(get_uid("Achlya", rows = 0, verbose = FALSE), "'rows' value must be an integer 1 or greater") }) taxize/tests/testthat/test-lowest_common.R0000644000176200001440000000306212730577527020565 0ustar liggesuserscontext("lowest_common") test_that("lowest_common works with ncbi, passing in classifications and doing internally", { skip_on_cran() id <- c("9031", "9823", "9606", "9470") idc <- classification(id, db = 'ncbi') aa <- lowest_common(id[2:4], db = "ncbi") bb <- lowest_common(id[2:4], db = "ncbi", low_rank = 'class') cc <- lowest_common(id[2:4], db = "ncbi", class_list = idc, low_rank = 'class') expect_is(aa, "data.frame") expect_is(bb, "data.frame") expect_is(cc, "data.frame") expect_named(aa, c('name', 'rank', 'id')) expect_named(cc, c('name', 'rank', 'id')) expect_identical(aa, bb) expect_identical(bb, cc) expect_equal(NROW(aa), 1) # passing in classification list obs. takes less time expect_lt( system.time(lowest_common(id[2:4], db = "ncbi", class_list = idc, low_rank = 'class'))[3], system.time(lowest_common(id[2:4], db = "ncbi", low_rank = 'class'))[3] ) }) test_that("lowest_common works with itis", { skip_on_cran() #lowest_common(spp, db = "itis") #spp <- c("Sus scrofa", "Homo sapiens", "Nycticebus coucang") ids <- c("180722","180092","572890") idc <- classification(ids, db = 'itis') expect_identical( lowest_common(ids, db = "itis"), lowest_common(ids, db = "itis", class_list = idc) ) bb <- lowest_common(ids, db = "itis", low_rank = 'class') cc <- lowest_common(ids, db = "itis", class_list = idc, low_rank = 'class') expect_is(bb, "data.frame") expect_is(cc, "data.frame") expect_named(cc, c('name', 'rank', 'id')) expect_identical(bb, cc) expect_equal(NROW(bb), 1) }) taxize/tests/testthat/test-ipni_search.R0000644000176200001440000000261512744505744020164 0ustar liggesuserscontext("ipni_search") # test_that("ipni_search works", { # skip_on_cran() # # aa <- ipni_search(genus = 'Brintonia', isapnirecord = TRUE, # isgcirecord = TRUE, isikrecord = TRUE) # cc <- ipni_search(genus = 'Pinus', species = 'contorta') # # expect_is(aa, "data.frame") # expect_is(cc, "data.frame") # expect_is(aa$id, "character") # expect_is(aa$family, "character") # # expect_named(aa, c('id','version','family','full_name_without_family_and_authors','authors')) # expect_is(aa$family, "character") # }) # # test_that("ipni_search works with different output formats", { # skip_on_cran() # # aa <- ipni_search(genus = 'Brintonia') # bb <- ipni_search(genus = 'Brintonia', output = 'short') # cc <- ipni_search(genus = 'Brintonia', output = 'classic') # dd <- ipni_search(genus = 'Brintonia', output = 'extended') # # expect_is(aa, "data.frame") # expect_is(bb, "data.frame") # expect_is(cc, "data.frame") # expect_is(dd, "data.frame") # # expect_lt(NCOL(aa), NCOL(bb)) # expect_lt(NCOL(bb), NCOL(cc)) # expect_lt(NCOL(aa), NCOL(cc)) # expect_lt(NCOL(aa), NCOL(dd)) # expect_lt(NCOL(cc), NCOL(dd)) # }) # # test_that("ipni_search fails correctly", { # skip_on_cran() # # expect_error(ipni_search(), "No results") # expect_error(ipni_search(family = 5), "No results") # expect_warning(ipni_search(genus = "adfasdfasffd"), "No data found") # }) taxize/tests/testthat/test-ncbi_get_taxon_summary.R0000644000176200001440000000167212730572320022427 0ustar liggesusers# tests for ncbi_get_taxon_summary context("ncbi_get_taxon_summary") test_that("ncbi_get_taxon_summary returns correct class and result", { skip_on_cran() tt <- ncbi_get_taxon_summary(c(4751)) tt2 <- ncbi_get_taxon_summary(NA) tt3 <- ncbi_get_taxon_summary(id = NULL) expect_is(tt, "data.frame") expect_equal(ncol(tt), 3) expect_equal(tt[1, 3], 'kingdom') expect_equal(tt2, NA) expect_equal(tt3, NULL) }) test_that("ncbi_get_taxon_summary behaves correctly when very large ID vector", { skip_on_cran() # short UID's are okay at larger quantities ids <- rep(4751, 1200) expect_is(ncbi_get_taxon_summary(id = ids), "data.frame") # but longer IDs add up of course ids <- rep(1430660, 1100) expect_error(suppressMessages(ncbi_get_taxon_summary(id = ids)), "Request-URI Too Long") expect_message(tryCatch(ncbi_get_taxon_summary(id = ids), error = function(e) e), "You may want to split your ids") }) taxize/tests/testthat/test-itis_lsid.R0000644000176200001440000000113513125014660017641 0ustar liggesusers# tests for itis_lsid fxn in taxize context("itis_lsid") test_that("itis_lsid returns the correct value", { skip_on_cran() one <- itis_lsid("urn:lsid:itis.gov:itis_tsn:180543") two <- itis_lsid("urn:lsid:itis.gov:itis_tsn:180543", "record") three <- itis_lsid("urn:lsid:itis.gov:itis_tsn:202385", "fullrecord") four <- itis_lsid(202385) expect_equal(one, "180543") expect_match(as.character(two[1, "genuspart"]), "Ursus") expect_match(three$acceptedNameList$tsn, "202385") expect_null(four) expect_is(one, "character") expect_is(two, "data.frame") expect_is(three, "list") }) taxize/tests/testthat/test-get_eolid.R0000644000176200001440000000207113160554506017620 0ustar liggesusers# tests for get_eolid fxn in taxize context("get_eolid") test_that("get_eolid returns the correct value", { skip_on_cran() expect_that(is.na(get_eolid(sciname='adsf asdf asdf', verbose=FALSE)[[1]]), is_true()) }) test_that("get_eolid returns the correct class", { skip_on_cran() expect_that(get_eolid("adsf asdf asdf", verbose=FALSE), is_a("eolid")) }) test_that("get_eolid accepts ask-argument", { skip_on_cran() expect_that(is.na(get_eolid(sciname='adsf asdf asdf', ask=FALSE, verbose=FALSE)[[1]]), is_true()) }) test_that("get_eolid fails as expected", { skip_on_cran() expect_error(get_eolid(), "argument \"sciname\" is missing") expect_error(get_eolid("Poa annua", ask = 4, verbose = FALSE), "ask must be of class logical") # rows param expect_error(get_eolid("Poa annua", rows = "foobar", verbose = FALSE), "'rows' must be numeric or NA") expect_error(get_eolid("Poa annua", rows = 0, verbose = FALSE), "'rows' value must be an integer 1 or greater") }) taxize/tests/testthat/test-itis_hierarchy.R0000644000176200001440000000110412730576503020672 0ustar liggesusers# tests for itis_hierarchy fxn in taxize context("itis_hierarchy") test_that("itis_hierarchy returns the correct class", { skip_on_cran() one <- itis_hierarchy(tsn=180543, verbose=FALSE) two <- itis_hierarchy(tsn=180543, "up", verbose=FALSE) three <- itis_hierarchy(tsn=180543, "down", verbose=FALSE) four <-itis_hierarchy(tsn=c(180543,41074,36616), verbose=FALSE) expect_that(one, is_a("data.frame")) expect_that(two, is_a("data.frame")) expect_that(three, is_a("data.frame")) expect_that(four, is_a("list")) expect_that(four[[1]], is_a("data.frame")) }) taxize/tests/testthat/test-tp_refs.R0000644000176200001440000000032612730577253017336 0ustar liggesusers# tests for tp_refs fxn in taxize context("tp_refs") test_that("tp_refs returns the correct class", { skip_on_cran() ttt <- suppressMessages(tp_refs(id = 25509881)) expect_that(ttt, is_a("data.frame")) }) taxize/tests/testthat/test-get_gbifid.R0000644000176200001440000000612613160556221017751 0ustar liggesuserscontext("get_gbifid") test_that("get_gbifid returns the correct value", { skip_on_cran() expect_true(is.na(get_gbifid(c("Chironomus riparius", "aaasdfadsfasdf"), verbose = FALSE)[2])) }) test_that("get_gbifid returns the correct class", { skip_on_cran() expect_is(get_gbifid(c("Chironomus riparius", "Chaetopteryx"), verbose = FALSE), "gbifid") }) test_that("get_gbifid accepts ask-argument", { skip_on_cran() expect_true(is.na(get_gbifid('Dugesia', ask = FALSE, verbose = FALSE))) }) test_that("get_gbifid method parameter works", { skip_on_cran() ### w/ method = backbone mod1 <- get_gbifid_(sciname = "Z*", method = "backbone", verbose = FALSE, rows = 1:100) mod2 <- get_gbifid_("Z*", method = "lookup", verbose = FALSE, rows = 1:100) expect_is(mod1, "list") expect_is(mod2, "list") expect_gt(NROW(mod2[[1]]), NROW(mod1[[1]])) }) test_that("get_gbifid phylum/class/order/family parameters work", { aa <- get_gbifid("Satyrium", phylum = "Tracheophyta", rows = 1, verbose = FALSE) bb <- get_gbifid("Satyrium", phylum = "Arthropoda", rows = 1, verbose = FALSE) expect_is(aa, "gbifid") expect_is(bb, "gbifid") expect_equal(aa[[1]], "5307264") expect_equal(bb[[1]], "1927718") }) test_that("get_gbifid rank parameter works", { skip_on_cran() ## Rank example rf1 <- get_gbifid(sciname = "bison bison", rank = "genus", rows = 1, verbose = FALSE) rf2 <- get_gbifid(sciname = "bison bison", rank = "species", rows = 1, verbose = FALSE) expect_is(rf1, "gbifid") expect_is(rf2, "gbifid") expect_false(is.na(rf1[[1]])) expect_equal(rf2[[1]], "2441176") }) test_that("works regardless of character or numeric GGBIF ID given back", { skip_on_cran() aa <- get_gbifid("Chironomus riparius", verbose = FALSE) expect_is(aa, "gbifid") expect_is(aa[[1]], "character") bb <- get_gbifid("Pinus contorta", verbose = FALSE, rows = 1) expect_is(bb, "gbifid") expect_is(bb[[1]], "character") }) test_that("get_gbifid fails as expected", { skip_on_cran() expect_error(get_gbifid(), "argument \"sciname\" is missing") expect_error(get_gbifid('Poa annua', ask = 4, verbose = FALSE), "ask must be of class logical") expect_error( get_gbifid("Satyrium", phylum = TRUE, verbose = FALSE), "phylum must be of class character") expect_error( get_gbifid("Satyrium", class = TRUE, verbose = FALSE), "class must be of class character") expect_error( get_gbifid("Satyrium", order = TRUE, verbose = FALSE), "order must be of class character") expect_error( get_gbifid("Satyrium", family = TRUE, verbose = FALSE), "family must be of class character") expect_error( get_gbifid("Satyrium", rank = TRUE, verbose = FALSE), "rank must be of class character") expect_error( get_gbifid("Satyrium", method = 55, verbose = FALSE), "method must be of class character") # rows param expect_error(get_gbifid("Satyrium", rows = "foobar", verbose = FALSE), "'rows' must be numeric or NA") expect_error(get_gbifid("Satyrium", rows = 0, verbose = FALSE), "'rows' value must be an integer 1 or greater") }) taxize/tests/testthat/test-get_colid.R0000644000176200001440000000337613160554116017624 0ustar liggesusers# tests for get_colid fxn in taxize context("get_colid") test_that("get_colid returns the correct value", { skip_on_cran() expect_that(is.na(get_colid(sciname='adsf asdf asdf', verbose=FALSE)[[1]]), is_true()) }) test_that("get_colid returns the correct class", { skip_on_cran() expect_that(get_colid(c("Helianthus excubitor", "adsf asdf asdf"), verbose=FALSE), is_a("colid")) }) test_that("get_colid accepts ask-argument", { skip_on_cran() expect_that(is.na(get_colid(sciname='adsf asdf asdf', ask=FALSE, verbose=FALSE)[[1]]), is_true()) }) test_that("get_colid fails as expected", { skip_on_cran() expect_error(get_colid(), "argument \"sciname\" is missing") expect_error(get_colid('Poa annua', ask = 4, verbose = FALSE), "ask must be of class logical") expect_error( get_colid("Satyrium", kingdom = 234, verbose = FALSE), "kingdom must be of class character") expect_error( get_colid("Satyrium", phylum = 234, verbose = FALSE), "phylum must be of class character") expect_error( get_colid("Satyrium", class = 234, verbose = FALSE), "class must be of class character") expect_error( get_colid("Satyrium", order = 234, verbose = FALSE), "order must be of class character") expect_error( get_colid("Satyrium", family = 234, verbose = FALSE), "family must be of class character") expect_error( get_colid("Satyrium", rank = 234, verbose = FALSE), "rank must be of class character") # rows param expect_error(get_colid("Satyrium", rows = "foobar", verbose = FALSE), "'rows' must be numeric or NA") expect_error(get_colid("Satyrium", rows = 0, verbose = FALSE), "'rows' value must be an integer 1 or greater") }) taxize/tests/testthat/test-itis_acceptname.R0000644000176200001440000000140012771322224021005 0ustar liggesuserscontext("itis_acceptname") test_that("itis_acceptname works with accepted tsn", { skip_on_cran() temp <- itis_acceptname(208527) expect_is(temp, "data.frame") expect_named(temp, c('submittedtsn', 'acceptedname', 'acceptedtsn', 'author')) expect_equal(temp$submittedtsn, 208527) expect_true(is.na(temp$acceptedname)) }) test_that("itis_acceptname works with non-accepted tsn", { skip_on_cran() temp <- itis_acceptname(504239) expect_is(temp, "data.frame") expect_named(temp, c('submittedtsn', 'acceptedname', 'acceptedtsn', 'author')) expect_equal(temp$submittedtsn, 504239) expect_that(is.na(temp$acceptedname), is_false()) }) test_that("itis_acceptname fails as expected", { expect_error(itis_acceptname(), "\"searchtsn\" is missing") }) taxize/tests/testthat/test-children.R0000644000176200001440000000203113037517445017455 0ustar liggesuserscontext("children") test_that("children returns the correct values and classes", { skip_on_cran() ch_ncbi <- children("Salmo", db = 'ncbi') expect_is(ch_ncbi, "children") expect_equal(attr(ch_ncbi, "db"), "ncbi") expect_named(ch_ncbi, "Salmo") expect_is(ch_ncbi$Salmo, "data.frame") expect_named(ch_ncbi$Salmo, c('childtaxa_id', 'childtaxa_name', 'childtaxa_rank')) }) test_that("passing in an id works", { skip_on_cran() ch_ncbi <- children(8028, db = 'ncbi') expect_is(ch_ncbi, "children") expect_equal(attr(ch_ncbi, "db"), "ncbi") expect_named(ch_ncbi, '8028') expect_is(ch_ncbi$`8028`, "data.frame") expect_named(ch_ncbi$`8028`, c('childtaxa_id', 'childtaxa_name', 'childtaxa_rank')) }) test_that("queries with no results fail well", { skip_on_cran() aa <- children(x = "Saurauia", db = "itis", verbose = FALSE) expect_equal(NROW(aa[[1]]), 0) }) test_that("rows parameter, when used, works", { skip_on_cran() expect_is(children("Asdfafsfd", db = 'ncbi', rows = 1, verbose = FALSE), "children") }) taxize/tests/testthat/test-sci2comm.R0000644000176200001440000000145113161006300017363 0ustar liggesusers# tests for sci2comm fxn in taxize context("sci2comm") test_that("sci2comm returns the correct value", { skip_on_cran() tt <- sci2comm(scinames = 'Helianthus annuus', db = 'ncbi', verbose = FALSE) uu <- sw(sci2comm(scinames = 'Helianthus annuus', db = 'itis', rows = 1, verbose = FALSE)) zz <- sci2comm(scinames = 'Pomatomus saltatrix', db = 'worms', verbose = FALSE) expect_that(names(tt), equals('Helianthus annuus')) expect_that(names(uu), equals('Helianthus annuus')) expect_that(names(zz), equals('Pomatomus saltatrix')) expect_that(tt, is_a("list")) expect_that(tt[[1]], is_a("character")) expect_that(uu, is_a("list")) expect_that(uu[[1]], is_a("character")) expect_that(zz, is_a("list")) expect_that(zz[[1]], is_a("character")) }) taxize/tests/testthat/test-classification.R0000644000176200001440000001522013125006607020653 0ustar liggesusers# tests for classification fxn in taxize context("classification") # is_up <- function(seconds=3, which="itis"){ # itisfxn <- function(x) tryCatch(itis_ping(config=timeout(x)), error=function(e) e) # eolfxn <- function(x) tryCatch(eol_ping(config=timeout(x)), error=function(e) e) # switch(which, # itis = !is(itisfxn(seconds), "OPERATION_TIMEDOUT"), # eol = !is(eolfxn(seconds), "OPERATION_TIMEDOUT") # ) # } # # is_up() # is_up(which = "eol") # is_up(which = "col") # is_up(which = "ncbi") # # skip_if <- function(x){ # if(!res) skip("API down") # # expect_is(classification(c("Chironomus riparius", "aaa vva"), db = 'itis', verbose=FALSE), "classification") # } # eolids <- get_tsn(c("Chironomus riparius", "aaa vva"), verbose=FALSE) # colids <- get_colid(c("Chironomus riparius", "aaa vva"), verbose=FALSE) # tpsids <- get_tpsid(sciname=c("Helianthus excubitor", "aaa vva"), verbose=FALSE) # clas_eolids <- classification(eolids, verbose=FALSE) # clas_colids <- classification(colids) # clas_tpids <- classification(tpsids, verbose=FALSE) # clas_eol <- classification(c("Helianthus petiolaris Nutt.", "aaa vva"), db = 'eol') # names(clas_eol) <- NULL # clas_col <- suppressMessages(classification(c("Puma concolor", "aaa vva"), db = 'col')) # names(clas_col) <- NULL # colids <- get_colid(c("Puma concolor", "aaa vva"), verbose=FALSE) # clas_colids <- classification(colids) # names(clas_colids) <- NULL # clas_tp <- suppressMessages(classification(c("Helianthus excubitor", "aaa vva"), db = 'tropicos')) # names(clas_tp) <- NULL test_that("classification returns the correct values and classes", { skip_on_cran() clas_ncbi <- classification(c("Chironomus riparius", "aaa vva"), db = 'ncbi', verbose=FALSE) names(clas_ncbi) <- NULL clas_itis <- classification(c("Chironomus riparius", "aaa vva"), db = 'itis', verbose=FALSE) names(clas_itis) <- NULL expect_that(clas_ncbi[[2]], equals(NA)) expect_that(clas_itis[[2]], equals(NA)) # expect_that(clas_eol[[2]], equals(NA)) # expect_that(clas_col[[2]], equals(NA)) # expect_that(clas_tp[[2]], equals(NA)) expect_is(clas_ncbi, "classification") expect_is(clas_ncbi[[1]], "data.frame") expect_equal(length(clas_ncbi), 2) expect_is(clas_itis, "classification") expect_is(clas_itis[[1]], "data.frame") expect_equal(length(clas_itis), 2) # expect_that(clas_eol, is_a("list")) # expect_that(clas_eol[[1]], is_a("data.frame")) # expect_that(length(clas_eol), equals(2)) # expect_that(clas_col, is_a("list")) # expect_that(clas_col[[1]], is_a("data.frame")) # expect_that(length(clas_col), equals(2)) # expect_that(clas_tp, is_a("classification")) # expect_that(clas_tp[[1]], is_a("data.frame")) # expect_that(length(clas_tp), equals(2)) uids <- get_uid(c("Chironomus riparius", "aaa vva"), verbose=FALSE) tsns <- get_tsn(c("Chironomus riparius", "aaa vva"), verbose=FALSE) clas_uids <- classification(uids, verbose=FALSE) names(clas_uids) <- NULL clas_tsns <- classification(tsns, verbose=FALSE) names(clas_tsns) <- NULL expect_identical(clas_uids, clas_ncbi) expect_equal(clas_tsns, clas_itis) # expect_identical(clas_eolids, clas_ncbi) #### FIX THESE TWO, SHOULD BE MATCHING # expect_identical(clas_colids, clas_col) # expect_identical(clas_tpids, clas_tp) }) test_that("passing in an id works", { skip_on_cran() fromid_ncbi <- classification(9606, db = 'ncbi') fromid_itis <- classification(129313, db = 'itis') fromid_gbif <- classification(c(2704179, 2441176), db = 'gbif') #fromid_nbn <- classification("NBNSYS0000004786", db = 'nbn') expect_is(fromid_ncbi, "classification") expect_equal(attr(fromid_ncbi, "db"), "ncbi") expect_is(fromid_itis, "classification") expect_equal(attr(fromid_itis, "db"), "itis") expect_is(fromid_gbif, "classification") expect_equal(attr(fromid_gbif, "db"), "gbif") #expect_is(fromid_nbn, "classification") #expect_equal(attr(fromid_nbn, "db"), "nbn") }) test_that("rbind and cbind work correctly", { skip_on_cran() out <- get_ids(names = c("Puma concolor","Accipiter striatus"), db = 'ncbi', verbose=FALSE) cl <- classification(out) # rbind clr <- rbind(cl) expect_is(clr, "data.frame") expect_named(clr, c("name", "rank", "id", "query", "db")) # cbind clc <- cbind(cl) expect_is(clc, "data.frame") expect_gt(length(names(clc)), 50) }) df <- theplantlist[sample(1:nrow(theplantlist), 50), ] nn <- apply(df, 1, function(x) paste(x["genus"], x["sp"], collapse = " ")) test_that("works on a variety of names", { skip_on_cran() expect_that(classification(nn[1], db = "ncbi", verbose=FALSE), is_a("classification")) expect_that(classification(nn[2], db = "ncbi", verbose=FALSE), is_a("classification")) }) test_that("queries with no results fail well", { skip_on_cran() aa <- classification(x = "Saurauia", db = "itis", verbose = FALSE) bb <- classification(get_tsn("Saurauia", verbose = FALSE), verbose = FALSE) expect_true(is.na(unclass(aa)[[1]])) expect_identical(unname(aa), unname(bb)) }) test_that("all rank character strings are lower case (all letters)", { skip_on_cran() aa <- classification(9606, db = 'ncbi', verbose = FALSE) bb <- classification(129313, db = 'itis', verbose = FALSE) #cc <- classification(57361017, db = 'eol', verbose = FALSE) dd <- classification(2441176, db = 'gbif', verbose = FALSE) #ee <- classification(25509881, db = 'tropicos', verbose = FALSE) #ff <- classification("NBNSYS0000004786", db = 'nbn', verbose = FALSE) gg <- classification("Chironomus riparius", db = 'col', verbose = FALSE) expect_false(all(grepl("[A-Z]", aa[[1]]$rank))) expect_false(all(grepl("[A-Z]", bb[[1]]$rank))) #expect_false(all(grepl("[A-Z]", cc[[1]]$rank))) expect_false(all(grepl("[A-Z]", dd[[1]]$rank))) #expect_false(all(grepl("[A-Z]", ee[[1]]$rank))) #expect_false(all(grepl("[A-Z]", ff[[1]]$rank))) expect_false(all(grepl("[A-Z]", gg[[1]]$rank))) }) test_that("rows parameter, when used, works", { skip_on_cran() expect_is(classification("Asdfafsfd", db = 'ncbi', rows = 1, verbose = FALSE), "classification") expect_is(classification("Asdfafsfd", db = 'itis', rows = 1, verbose = FALSE), "classification") expect_is(classification("Asdfafsfd", db = 'gbif', rows = 1, verbose = FALSE), "classification") expect_is(classification("Asdfafsfd", db = 'eol', rows = 1, verbose = FALSE), "classification") expect_is(classification("Asdfafsfd", db = 'col', rows = 1, verbose = FALSE), "classification") expect_is(classification("Asdfafsfd", db = 'tropicos', rows = 1, verbose = FALSE), "classification") expect_is(classification("Asdfafsfd", db = 'nbn', rows = 1, verbose = FALSE), "classification") }) taxize/tests/testthat/test-gni_search.R0000644000176200001440000000054612730576363020003 0ustar liggesusers# tests for gni_search fxn in taxize context("gni_search") test_that("gni_search returns the correct value", { skip_on_cran() expect_equal(gni_search(search_term = "ama*", per_page = 1)[,2], "22693003") }) test_that("gni_search returns the correct class", { skip_on_cran() expect_is(gni_search(search_term = "ama*", per_page = 1), "data.frame") }) taxize/tests/testthat/test-tax_rank.R0000644000176200001440000000235613114317346017500 0ustar liggesuserscontext("tax_rank") test_that("tax_rank returns the correct class", { skip_on_cran() A <- suppressMessages(tax_rank(c("Helianthus annuus", "Baetis"), db = "ncbi", verbose=FALSE)) B <- suppressMessages(tax_rank("Helianthus", db = "itis", verbose=FALSE)) C <- suppressMessages(tax_rank(c("Helianthus annuus", "xxxxxx"), db = "ncbi", verbose=FALSE)) expect_is(A, "list") expect_is(B, "list") expect_is(C, "list") expect_equal(names(C), c("Helianthus annuus", "xxxxxx")) expect_equal(A$`Helianthus annuus`, "species") expect_true(is.na(C$xxxxxx)) expect_equal(length(A), 2) expect_equal(length(C), 2) }) test_that("works with get_*() input", { aa <- suppressMessages(tax_rank(get_boldid("Helianthus annuus"))) expect_is(aa, "list") expect_equal(names(aa), "421377") expect_equal(aa$`421377`, "genus") }) test_that("tax_rank fails well", { skip_on_cran() expect_error(tax_rank(), "argument \"x\" is missing") expect_error(tax_rank("aadfd"), "Must specify db!") expect_error(tax_rank("Asdfadsf", db = "asdfd"), "the provided db value was not recognised") expect_error(tax_rank(NA, db = "itis"), "'db' not recognized") }) taxize/tests/testthat/test-synonyms.R0000644000176200001440000000150613161006335017557 0ustar liggesusers# tests for synonyms fxn in taxize context("synonyms") test_that("synonyms returns the correct value", { skip_on_cran() tt <- sw(synonyms("Poa annua", db = "itis", rows = 1, verbose = FALSE)) expect_match(names(tt), "Poa annua") expect_match(tt[[1]][1, "syn_name"], "Poa annua var. aquatica") expect_is(tt, "synonyms") expect_equal(attr(tt, "db"), "itis") expect_is(tt[[1]], "data.frame") expect_gt(NROW(tt[[1]]), 1) }) test_that("synonyms works with worms data", { skip_on_cran() tt <- synonyms('Pomatomus saltatrix', db = "worms", verbose = FALSE) expect_match(names(tt), 'Pomatomus saltatrix') expect_match(tt$`Pomatomus saltatrix`$valid_name[1], 'Pomatomus saltatrix') expect_is(tt, "synonyms") expect_equal(attr(tt, "db"), "worms") expect_is(tt[[1]], "data.frame") expect_is(tt[[1]], "tbl_df") }) taxize/tests/testthat/test-col_search.R0000644000176200001440000000221412730575646020000 0ustar liggesusers# tests for col_search fxn in taxize context("col_search") test_that("col_search returns the correct values, dimensions, and classes", { skip_on_cran() temp <- col_search(name = "Apis") two <- col_search(name = c("Apis","Puma concolor")) byid <- col_search(id = 11935941) expect_equal(names(temp), "Apis") expect_equal(temp[[1]]$name[1], "Apis") expect_equal(names(temp), "Apis") expect_equal(temp[[1]]$name[1], "Apis") expect_that(is.null(dim(temp)), is_true()) expect_equal(NCOL(temp[[1]]), 10) expect_that(length(two), equals(2)) expect_equal(NCOL(two[[1]]), 10) expect_equal(NCOL(do.call(rbind, lapply(two, data.frame))), 10) expect_that(dim(byid[[1]]), equals(c(0,0))) expect_that(temp, is_a("list")) expect_that(temp[[1]], is_a("data.frame")) expect_that(two, is_a("list")) expect_that(two[[1]], is_a("data.frame")) }) test_that("col_search is robust to user error", { expect_is(col_search(name = "asdfsdf")[[1]], "data.frame") expect_is(col_search(name = "")[[1]], "data.frame") expect_is(col_search(id = "asdfsdf")[[1]], "data.frame") expect_is(col_search(), "list") expect_equal(length(col_search()), 0) }) taxize/tests/testthat/test-get_wormsid.R0000644000176200001440000000267213161006220020201 0ustar liggesuserscontext("get_wormsid") test_that("get_wormsid returns the correct value", { skip_on_cran() expect_true(is.na(sw(get_wormsid(c('Gadus morhua', "howdy"), verbose=FALSE))[2])) }) test_that("get_wormsid returns the correct class", { skip_on_cran() expect_is( sw(get_wormsid(c("Platanista gangetica", "Lichenopora neapolitana"), verbose=FALSE)), "wormsid") }) test_that("get_wormsid accepts ask-argument", { skip_on_cran() expect_is(sw(get_wormsid('Platanista gangetica', ask = FALSE, verbose=FALSE)), "wormsid") expect_true(is.na(get_wormsid('asdasf', ask = FALSE, verbose=FALSE))) }) test_that("get_wormsid query modifiers work", { skip_on_cran() ### w/ modifiers to the name mod2 <- sw(get_wormsid('asiatic clam', "common", verbose=FALSE)) expect_is(mod2, "wormsid") expect_equal(mod2[1], "181580") }) test_that("get_wormsid fails well", { skip_on_cran() expect_true(is.na(get_wormsid("asdfadsf", verbose = FALSE))) expect_error(get_wormsid(), "argument \"query\" is missing") expect_error(get_wormsid("clam", 5), "searchtype must be of class character") expect_error(get_wormsid("clam", "stuff", verbose = FALSE), "'searchtype' must be one of") expect_error(get_wormsid("clam", accepted = 4), "accepted must be of class logical") expect_error(get_wormsid("clam", ask = 4), "ask must be of class logical") }) taxize/tests/testthat/test-names_list.R0000644000176200001440000000060012730577517020030 0ustar liggesusers# tests for names_list fxn in taxize context("names_list") test_that("names_list returns the correct dimensions", { expect_equal(length(names_list('species')), 10) expect_equal(length(names_list('species', size=20)), 20) expect_equal(length(names_list('order', size=2)), 2) }) test_that("names_list returns the correct class", { expect_is(names_list('species'), "character") }) taxize/tests/testthat/test-iucn_id.R0000644000176200001440000000102112730576640017276 0ustar liggesuserscontext("iucn_id") test_that("iucn_id returns the correct class", { skip_on_cran() aa <- iucn_id("Branta canadensis") bb <- iucn_id("Panthera uncia") cc <- iucn_id("Lynx lynx") expect_is(aa, "integer") expect_is(bb, "integer") expect_is(cc, "integer") expect_equal(aa, 22679935) expect_equal(bb, 22732) expect_equal(cc, 12519) }) test_that("iucn_id fails well", { skip_on_cran() expect_error(iucn_id(), "argument \"sciname\" is missing") expect_equal(suppressWarnings(iucn_id("foo bar")), NA) }) taxize/tests/testthat/test-apgscraping.R0000644000176200001440000000074512730573151020170 0ustar liggesuserscontext("apg* functions") test_that("apgOrders works", { skip_on_cran() orders <- apgOrders() expect_is(orders, "data.frame") expect_is(orders$order, "character") expect_is(orders$accepted, "logical") expect_equal(NCOL(orders), 4) }) test_that("apgFamilies works", { skip_on_cran() families <- apgFamilies() expect_is(families, "data.frame") expect_is(families$family, "character") expect_is(families$accepted, "logical") expect_equal(NCOL(families), 5) }) taxize/tests/testthat/test-ncbi_children.R0000644000176200001440000000075312730577474020470 0ustar liggesusers# tests for ncbi_get_taxon_summary context("ncbi_children") test_that("ncbi_children returns correct class and result", { skip_on_cran() tt <- ncbi_children(id = 4751) tt2 <- ncbi_children(id = 4751, out_type = 'uid') expect_is(tt, "list") expect_is(tt[[1]], "data.frame") expect_equal(ncol(tt[[1]]), 3) expect_is(tt2, "list") expect_is(tt2[[1]], "character") expect_error(ncbi_children(name = 'Ilex', id = 4751)) expect_equal(ncbi_children(name = NA)[[1]], NA) }) taxize/tests/testthat/test-tp_dist.R0000644000176200001440000000057412730577260017345 0ustar liggesusers# tests for tp_dist fxn in taxize context("tp_dist") test_that("tp_dist returns the correct class", { skip_on_cran() tt <- suppressMessages(tp_dist(id = 25509881)) expect_that(tt, is_a("list")) expect_that(tt[['location']], is_a("data.frame")) expect_that(tt[['reference']], is_a("data.frame")) expect_true(any(grepl("abbreviatedtitle", names(tt[['reference']])))) }) taxize/tests/testthat/test-get_boldid.R0000644000176200001440000000351213160545503017757 0ustar liggesusers# tests for get_boldid fxn in taxize context("get_boldid") test_that("get_boldid returns the correct value", { skip_on_cran() expect_equal(get_boldid(searchterm = 'Helianthus', verbose = FALSE)[[1]], '125295') expect_that(is.na(get_boldid(searchterm='adsf asdf asdf', verbose=FALSE)[[1]]), is_true()) }) test_that("get_boldid returns the correct class", { skip_on_cran() expect_that(get_boldid(c("Helianthus excubitor", "adsf asdf asdf"), verbose=FALSE), is_a("boldid")) }) test_that("get_boldid accepts ask-argument", { skip_on_cran() expect_that(is.na(get_boldid('adsf asdf asdf', ask=FALSE, verbose=FALSE)[[1]]), is_true()) }) test_that("get_boldid fails as expected", { skip_on_cran() expect_error(get_boldid(), "argument \"searchterm\" is missing") expect_error(get_boldid("Satyrium", ask = 4, verbose = FALSE), "ask must be of class logical") expect_error( get_boldid("Osmi", fuzzy=4, verbose = FALSE), "fuzzy must be of class logical") expect_error( get_boldid("Osmi", dataTypes = 4, verbose = FALSE), "dataTypes must be of class character") expect_error( get_boldid("Osmi", includeTree = 4, verbose = FALSE), "includeTree must be of class logical") expect_error( get_boldid("Osmi", rank = 4, verbose = FALSE), "rank must be of class character") expect_error( get_boldid("Osmi", division = 4, verbose = FALSE), "division must be of class character") expect_error( get_boldid("Osmi", parent = 4, verbose = FALSE), "parent must be of class character") # rows param expect_error(get_boldid("Achlya", rows = "foobar", verbose = FALSE), "'rows' must be numeric or NA") expect_error(get_boldid("Achlya", rows = 0, verbose = FALSE), "'rows' value must be an integer 1 or greater") }) taxize/tests/testthat/test-ping.R0000644000176200001440000000234412744505764016636 0ustar liggesusers# tests for eol_ping fxn in taxize context("ping") test_that("ncbi_ping returns the correct value", { skip_on_cran() expect_true(ncbi_ping()) expect_false(ncbi_ping(503)) expect_true(ncbi_ping("content")) }) test_that("trpicos_ping returns the correct value", { skip_on_cran() expect_true(tropicos_ping()) expect_false(tropicos_ping(503)) expect_true(tropicos_ping("content")) }) test_that("nbn_ping returns the correct value", { skip_on_cran() expect_true(nbn_ping()) expect_false(nbn_ping(503)) expect_true(nbn_ping("content")) }) test_that("gbif_ping returns the correct value", { skip_on_cran() expect_true(gbif_ping()) expect_false(gbif_ping(503)) expect_true(gbif_ping("content")) }) test_that("bold_ping returns the correct value", { skip_on_cran() expect_true(bold_ping()) expect_false(bold_ping(503)) expect_true(bold_ping("content")) }) # test_that("ipni_ping returns the correct value", { # skip_on_cran() # # expect_true(ipni_ping()) # expect_false(ipni_ping(503)) # expect_true(ipni_ping("content")) # }) test_that("vascan_ping returns the correct value", { skip_on_cran() expect_true(vascan_ping()) expect_false(vascan_ping(503)) expect_true(vascan_ping("content")) }) taxize/tests/test-all.R0000644000176200001440000000007112672106003014563 0ustar liggesuserslibrary(testthat) library("taxize") test_check("taxize") taxize/NAMESPACE0000644000176200001440000002173313136164425013010 0ustar liggesusers# Generated by roxygen2: do not edit by hand S3method(as.boldid,boldid) S3method(as.boldid,character) S3method(as.boldid,data.frame) S3method(as.boldid,list) S3method(as.boldid,numeric) S3method(as.colid,character) S3method(as.colid,colid) S3method(as.colid,data.frame) S3method(as.colid,list) S3method(as.data.frame,boldid) S3method(as.data.frame,colid) S3method(as.data.frame,eolid) S3method(as.data.frame,gbifid) S3method(as.data.frame,iucn) S3method(as.data.frame,natservid) S3method(as.data.frame,nbnid) S3method(as.data.frame,tolid) S3method(as.data.frame,tpsid) S3method(as.data.frame,tsn) S3method(as.data.frame,ubioid) S3method(as.data.frame,uid) S3method(as.data.frame,wiki) S3method(as.data.frame,wormsid) S3method(as.eolid,character) S3method(as.eolid,data.frame) S3method(as.eolid,eolid) S3method(as.eolid,list) S3method(as.eolid,numeric) S3method(as.gbifid,character) S3method(as.gbifid,data.frame) S3method(as.gbifid,gbifid) S3method(as.gbifid,list) S3method(as.gbifid,numeric) S3method(as.iucn,character) S3method(as.iucn,data.frame) S3method(as.iucn,iucn) S3method(as.iucn,list) S3method(as.iucn,numeric) S3method(as.natservid,character) S3method(as.natservid,data.frame) S3method(as.natservid,list) S3method(as.natservid,natservid) S3method(as.natservid,numeric) S3method(as.nbnid,character) S3method(as.nbnid,data.frame) S3method(as.nbnid,list) S3method(as.nbnid,nbnid) S3method(as.tolid,character) S3method(as.tolid,data.frame) S3method(as.tolid,list) S3method(as.tolid,numeric) S3method(as.tolid,tolid) S3method(as.tpsid,character) S3method(as.tpsid,data.frame) S3method(as.tpsid,list) S3method(as.tpsid,numeric) S3method(as.tpsid,tpsid) S3method(as.tsn,character) S3method(as.tsn,data.frame) S3method(as.tsn,list) S3method(as.tsn,numeric) S3method(as.tsn,tsn) S3method(as.ubioid,character) S3method(as.ubioid,data.frame) S3method(as.ubioid,list) S3method(as.ubioid,numeric) S3method(as.ubioid,ubioid) S3method(as.uid,character) S3method(as.uid,data.frame) S3method(as.uid,list) S3method(as.uid,numeric) S3method(as.uid,uid) S3method(as.wiki,character) S3method(as.wiki,data.frame) S3method(as.wiki,list) S3method(as.wiki,numeric) S3method(as.wiki,wiki) S3method(as.wormsid,character) S3method(as.wormsid,data.frame) S3method(as.wormsid,list) S3method(as.wormsid,numeric) S3method(as.wormsid,wormsid) S3method(cbind,classification) S3method(cbind,classification_ids) S3method(children,colid) S3method(children,default) S3method(children,ids) S3method(children,tsn) S3method(children,uid) S3method(children,wormsid) S3method(classification,boldid) S3method(classification,colid) S3method(classification,default) S3method(classification,eolid) S3method(classification,gbifid) S3method(classification,ids) S3method(classification,natservid) S3method(classification,nbnid) S3method(classification,tolid) S3method(classification,tpsid) S3method(classification,tsn) S3method(classification,uid) S3method(classification,wiki) S3method(classification,wormsid) S3method(comm2sci,default) S3method(comm2sci,tsn) S3method(comm2sci,uid) S3method(downstream,colid) S3method(downstream,default) S3method(downstream,gbifid) S3method(downstream,ids) S3method(downstream,tsn) S3method(downstream,uid) S3method(iucn_status,default) S3method(iucn_status,iucn_summary) S3method(iucn_summary,character) S3method(iucn_summary,default) S3method(iucn_summary,iucn) S3method(lowest_common,colid) S3method(lowest_common,default) S3method(lowest_common,gbifid) S3method(lowest_common,tolid) S3method(lowest_common,tsn) S3method(lowest_common,uid) S3method(plot,classtree) S3method(print,classtree) S3method(print,tax_agg) S3method(rbind,classification) S3method(rbind,classification_ids) S3method(sci2comm,default) S3method(sci2comm,iucn) S3method(sci2comm,tsn) S3method(sci2comm,uid) S3method(sci2comm,wormsid) S3method(synonyms,colid) S3method(synonyms,default) S3method(synonyms,ids) S3method(synonyms,iucn) S3method(synonyms,nbnid) S3method(synonyms,tpsid) S3method(synonyms,tsn) S3method(synonyms,wormsid) S3method(synonyms_df,default) S3method(synonyms_df,synonyms) S3method(tax_rank,character) S3method(tax_rank,default) S3method(tax_rank,numeric) S3method(upstream,colid) S3method(upstream,default) S3method(upstream,ids) S3method(upstream,tsn) export(apgFamilies) export(apgOrders) export(apg_lookup) export(as.boldid) export(as.colid) export(as.eolid) export(as.gbifid) export(as.iucn) export(as.natservid) export(as.nbnid) export(as.tolid) export(as.tpsid) export(as.tsn) export(as.ubioid) export(as.uid) export(as.wiki) export(as.wormsid) export(bold_ping) export(bold_search) export(children) export(class2tree) export(classification) export(col_children) export(col_classification) export(col_downstream) export(col_ping) export(col_search) export(comm2sci) export(downstream) export(eol_dataobjects) export(eol_hierarchy) export(eol_invasive) export(eol_pages) export(eol_ping) export(eol_search) export(eubon) export(eubon_capabilities) export(eubon_children) export(eubon_hierarchy) export(eubon_search) export(fg_all_updated_names) export(fg_author_search) export(fg_deprecated_names) export(fg_epithet_search) export(fg_name_by_key) export(fg_name_full_by_lsid) export(fg_name_search) export(fg_ping) export(gbif_downstream) export(gbif_name_usage) export(gbif_parse) export(gbif_ping) export(genbank2uid) export(get_boldid) export(get_boldid_) export(get_colid) export(get_colid_) export(get_eolid) export(get_eolid_) export(get_gbifid) export(get_gbifid_) export(get_genes) export(get_genes_avail) export(get_ids) export(get_ids_) export(get_iucn) export(get_natservid) export(get_natservid_) export(get_nbnid) export(get_nbnid_) export(get_seqs) export(get_tolid) export(get_tolid_) export(get_tpsid) export(get_tpsid_) export(get_tsn) export(get_tsn_) export(get_ubioid) export(get_ubioid_) export(get_uid) export(get_uid_) export(get_wiki) export(get_wiki_) export(get_wormsid) export(get_wormsid_) export(getkey) export(gisd_isinvasive) export(gni_details) export(gni_parse) export(gni_search) export(gnr_datasources) export(gnr_resolve) export(ion) export(iplant_resolve) export(ipni_ping) export(ipni_search) export(itis_acceptname) export(itis_downstream) export(itis_getrecord) export(itis_hierarchy) export(itis_kingdomnames) export(itis_lsid) export(itis_name) export(itis_native) export(itis_ping) export(itis_refs) export(itis_taxrank) export(itis_terms) export(iucn_getname) export(iucn_id) export(iucn_status) export(iucn_summary) export(iucn_summary_id) export(lowest_common) export(names_list) export(nbn_classification) export(nbn_ping) export(nbn_search) export(nbn_synonyms) export(ncbi_children) export(ncbi_downstream) export(ncbi_get_taxon_summary) export(ncbi_getbyid) export(ncbi_getbyname) export(ncbi_ping) export(ncbi_search) export(phylomatic_format) export(phylomatic_tree) export(plantminer) export(rankagg) export(resolve) export(sci2comm) export(scrapenames) export(status_codes) export(synonyms) export(synonyms_df) export(tax_agg) export(tax_name) export(tax_rank) export(taxize_capwords) export(taxize_cite) export(taxize_ldfast) export(tnrs) export(tnrs_sources) export(tol_resolve) export(tp_acceptednames) export(tp_accnames) export(tp_classification) export(tp_dist) export(tp_namedistributions) export(tp_namereferences) export(tp_refs) export(tp_search) export(tp_summary) export(tp_synonyms) export(tpl_families) export(tpl_get) export(tpl_search) export(tropicos_ping) export(ubio_classification) export(ubio_classification_search) export(ubio_id) export(ubio_ping) export(ubio_search) export(ubio_synonyms) export(upstream) export(vascan_ping) export(vascan_search) importFrom(ape,as.phylo.hclust) importFrom(ape,plot.phylo) importFrom(ape,read.tree) importFrom(bold,bold_tax_id) importFrom(bold,bold_tax_name) importFrom(data.table,rbindlist) importFrom(data.table,setDF) importFrom(foreach,"%do%") importFrom(foreach,foreach) importFrom(graphics,plot) importFrom(httr,GET) importFrom(httr,POST) importFrom(httr,add_headers) importFrom(httr,config) importFrom(httr,content) importFrom(httr,stop_for_status) importFrom(httr,timeout) importFrom(httr,upload_file) importFrom(httr,warn_for_status) importFrom(jsonlite,fromJSON) importFrom(jsonlite,toJSON) importFrom(methods,as) importFrom(methods,is) importFrom(plyr,.) importFrom(plyr,colwise) importFrom(plyr,ddply) importFrom(plyr,failwith) importFrom(plyr,l_ply) importFrom(plyr,ldply) importFrom(plyr,llply) importFrom(plyr,rbind.fill) importFrom(plyr,summarise) importFrom(reshape2,dcast) importFrom(reshape2,melt) importFrom(stats,aggregate) importFrom(stats,as.dist) importFrom(stats,hclust) importFrom(stats,na.omit) importFrom(stats,setNames) importFrom(stringr,str_extract) importFrom(stringr,str_replace) importFrom(stringr,str_replace_all) importFrom(stringr,str_split) importFrom(utils,URLencode) importFrom(utils,citation) importFrom(utils,download.file) importFrom(utils,read.delim) importFrom(utils,tail) importFrom(utils,write.table) importFrom(xml2,as_list) importFrom(xml2,read_xml) importFrom(xml2,xml_children) importFrom(xml2,xml_find_all) importFrom(xml2,xml_find_first) importFrom(xml2,xml_name) importFrom(xml2,xml_ns) importFrom(xml2,xml_text) taxize/NEWS.md0000644000176200001440000014120213161034557012661 0ustar liggesuserstaxize 0.9.0 ============ ### Changes to `get_*()` functions * Added separate documentation file for all get* functions describing attributes and various exception behaviors * Some `get*()` functions had `NaN` as default `rows` parameter value. Those all changed to `NA` * Better failure behavior now when non-acceptable `rows` parameter value given * Added in all type checks for parameters across `get_*()` functions * Changed behavior across all `get_*()` functions to behave the same when `ask = FALSE, rows = 1` and `ask = TRUE, rows = 1` as these should result in the same outcome. (#627) thanks @zachary-foster ! * Fixed direct match behavior so that when there's multiple results from the data provider, but no direct match, that the functions don't give back just `NA` with no inication that there were multiple matches. * Please let me know if any of these changes cause problems for your code or package. ### NEW FEATURES * Change `comm2sci()` to S3 setup with methods for `character`, `uid`, and `tsn` (#621) * `iucn_status()` now has S3 setup with a single method that only handles output from the `iucn_summary()` function. ### MINOR IMPROVEMENTS * Add required `key` parameter to fxn `iucn_id()` (#633) * imrove docs for `sci2comm()`: to indicate how to get non-simplified output (which includes what language the common name is from) vs. getting simplified output (#623) thanks @glaroc ! * Fix to `sci2comm()` to not be case sensitive when looking for matches (#625) thanks @glaroc ! * Two additional columns now returned with `eol_search()`: `link` and `content` * Improve docs in `eol_search()` to describe returned `data.frame` * Fix `bold_bing()` to use new base URL for their API * Improved description of the dataset `rank_ref`, see `?rank_ref` ### BUG FIXES * Fix to `downstream()` via fix to `rank_ref` dataset to include "infraspecies" and make "unspecified" and "no rank" requivalent. Fix to `col_downstream()` to remove properly ranks lower than allowed. (#620) thanks @cdeterman ! * `iucn_summary`: changed to using `rredlist` package internally. `sciname` param changed to `x`. `iucn_summary_id()` now is deprecated in favor of `iucn_summary()`. `iucn_summary()` now has a S3 setup, with methods for `character` and `iucn` (#622) * Added "cohort" to `rank_ref` dataset as that rank sometimes used at NCBI (from bug reported in `ncbi_downstream()`) (#626) * Fix to `sci2comm()`, add `tryCatch()` to internals to catch failed requests for specific pageid's (#624) thanks @glaroc ! * Fix URL for taxa for NBN taxonomic ids retrieved via `get_nbnid()` (#632) taxize 0.8.9 ============ ### BUG FIXES * Remove `ape::neworder_phylo` object, which is not used anymore in `taxize` (#618) (#619) thanks @ashiklom taxize 0.8.8 ============ ### NEW FEATURES * New function `ncbi_downstream()` and now NCBI is an option in the function `downstream()` (#583) thanks for the push @andzandz11 * New data source: Wiki*, which includes Wikipedia, Wikispecies, and Wikidata - you can choose which you'd like to search. Uses new package `wikitaxa`, with contributions from @ezwelty (#317) * `scrapenames()` gains a parameter `return_content`, a boolean, to optionally return the OCR content as a text string with the results. (#614) thanks @fgabriel1891 * New function `get_iucn()` - to get IUCN Red List ids for taxa. In addition, new S3 methods `synonyms.iucn` and `sci2comm.iucn` - no other methods could be made to work with IUCN Red List ids as they do no share their taxonomic classification data (#578) thanks @diogoprov ### MINOR IMPROVEMENTS * `bold` now an option in `classification()` function (#588) * fix to NBN to use new base URL (#582) ($597) * `genbank2uid()` can give back more than 1 taxon matched to a given Genbank accession number. Now the function can return more than one match for each query, e.g., try `genbank2uid(id = "AM420293")` (#602) thanks @sariya * had to modify `cbind()` usage to incclude `...` for method consistency (#612) * `tax_rank()` used to be able to do only ncbi and itis. Can now do a lot more data sources: ncbi, itis, eol, col, tropicos, gbif, nbn, worms, natserv, bold (#587) * Added to `classification()` docs in a section `Lots of results` a note about how to deal with results when there are A LOT of them. (#596) thanks @ahhurlbert for raising the issue * `tnrs()` now returns the resulting data.frame in the oder of the names passed in by the user (#613) thanks @wpetry * Changes to `gnr_resolve()` to now strip out taxonomic names submitted by user that are NA, or zero length strings, or are not of class character (#606) * Added description of the columns of the data.frame output in `gnr_resolve()` (#610) thanks @kamapu * Added noted in `tnrs()` docs that the service doesn't provide any information about homonyms. (#610) thanks @kamapu * Added `parvorder` to the `taxize` `rank_ref` dataset - used by NCBI - if tax returned with that rank, some functions in `taxize` were failing due to that rank missing in our reference dataset `rank_ref` (#615) ### BUG FIXES * Fix to `get_colid()` via problem in parsing within `col_search()` (#585) * Fix to `gbif_downstream` (and thus fix in `downstream()`): there was two rows with form in our `rank_ref` reference dataset of rank names, causing > 1 result in some cases, then causing `vapply` to fail as it's expecting length 1 result (#599) thanks @andzandz11 * Fix `genbank2uid()`: was failing when getting more than 1 result back, works now (#603) and fails better now, giving back warnings/error messages that are more informative (see also #602) thanks @sariya * Fix to `synonyms.tsn()`: in some cases a TSN has > 1 accepted name. We get accepted names first from the TSN, then look for synonyms, and hadn't accounted for > 1 accepted name. Fixed now (#607) thanks @tdjames * Fixed bug in `sci2comm()` - was not dealing internally with passing the `simplify` parameter (#616) taxize 0.8.4 ============ ### NEW FEATURES * Added WoRMS integration via the new `worrms` package on CRAN. Adds functions `as.wormsid()`, `get_wormsid()`, `get_wormsid_()`, `children.wormsid()`, `classification.wormsid()`, `sci2comm.wormsid()`, `comm2sci.wormsid()`, and `synonyms.wormsid()` (#574) (#579) * New functions for NatureServe data, including `as.natservid`, `get_natservid`, `get_natservid_`, and `classification.natservid` (#126) ### BUG FIXES * EOL API keys were not passed on to internal functions. fixed now. thanks @dschlaep ! (#576) * Fix in `rankagg()` with respect to `vegan` package to work with older and new version of `vegan` - thank @jarioksa (#580) (#581) taxize 0.8.0 ============ ### NEW FEATURES * New data source added: Open Tree of Life. New functions for the data source added: `get_tolid()`, `get_tolid_()`, and `as.tolid()` (#517) * related to above `classification()` gains new method for TOL data * related to above `lowest_common()` gains new method for TOL data * Now using `ritis` package, an external dependency for ITIS taxonomy data. Note that a large number of ITIS functions were removed, and are now available via the package `ritis`. However, there are still many high level functions for working with ITIS data (see functions prefixed with `itis_`), and `get_tsn()`, `classification.tsn()`, and similar high level functions remain unchanged. (#525) * EUBON has a new API (v1.2). We now interact with that new API version. In addition, `eubon()` fxn is now `eubon_search()`, although either still work - though `eubon()` will be made defunct in the next version of this package. Additional new functions were added: `eubon_capabilities()`, `eubon_children()`, and `eubon_hierarchy()` (#567) * `lowest_common()` function gains two new data source options: COL (Catalogue of Life) and TOL (Tree of Life) (#505) * Addded new function `synonyms_df()` as a slim wrapper around `data.table::rbindlist()` to make it easy to combine many outputs from `synonyms()` for a single data source - there is a lot of heterogeneity among data sources in how they report synonyms data, so we don't attempt to combine data across sources (#533) ### MINOR IMPROVEMENTS * Change NCBI URLs to `https` from `http` (#571) ### BUG FIXES * Fixed bug in `tax_name()` in which when an invalid taxon was searched for then `classification()` returned no data and caused an error. Fixed now. (#560) thanks @ljvillanueva for reporting it! * Fixed bug in `gnr_resolve()` in which order of input names to the function was not retained. fixed now. (#561) thanks @bomeara for reporting it! * Fixed bug in `gbif_parse()` - data format changed coming back from GBIF - needed to replace `NULL` with `NA` (#568) thanks @ChrKoenig for reporting it! taxize 0.7.9 ============ ### NEW FEATURES * New vignette: "Strategies for programmatic name cleaning" (#549) ### MINOR IMPROVEMENTS * `get_*()` functions now have new attributes to further help the user: `multiple_matches` (logical) indicating whether there were multiple matches or not, and `pattern_match` (logical) indicating whether a pattern match was made, or not. (#550) from (#547) discussion, thanks @ahhurlbert ! see also (#551) * Change all `xml2::xml_find_one()` to `xml2::xml_find_first()` for new `xml2` version (#546) * `gnr_resolve()` now retains user supplied taxa that had no matches - this could affect your code, make sure to check your existing code (#558) * `gnr_resolve()` - stop sorting output data.frame, so order of rows in output data.frame now same as user input vector/list (#559) ### BUG FIXES * Fixed internal fxn `sub_rows()` inside of most `get_*()` functions to not fail when the data.frame rows were less than that requested by the user in `rows` parameter (#556) * Fixed `get_gbifid()`, as sometimes calls failed because we now return numberic IDs but used to return character IDs (#555) * Fix to all `get_()` functions to call the internal `sub_rows()` function later in the function flow so as not to interfere with taxonomic based filtering (e.g., user filtering by a taxonomic rank) (#555) * Fix to `gnr_resolve()`, to not fail on parsing when no data returned when a preferred data source specified (#557) taxize 0.7.8 ============ ### MINOR IMPROVEMENTS * Fix to `iucn_summary()` (#543) thanks @mcsiple * Added message for when too many Ids passed in to `ncbi_get_taxon_summary()` suggesting to break up the ids into chunks (#541) thanks @daattali * Fix to `itis_acceptname()` to accept multiple names (#534) and now gives back same output regardless of whether match found or not (#531) ### BUG FIXES * Fix to `tax_name()` for some queries that return no classification data via internal call to `classification()` (#542) thanks @daattali * Another fix for `tax_name()` (#530) thanks @ibartomeus * Fixed docs for `rankagg()` function, use `requireNamespace()` in examples to make sure user has `vegan` installed (#529) taxize 0.7.6 ============ ### MINOR IMPROVEMENTS * Changed defunct messages in `eol_invasive()` and `gisd_invasive()` to point to new location in the [originr](https://github.com/ropenscilabs/originr) package. Also, cleaned out code in those functions as not avail. anymore (#494) * Access to IUCN taxonomy information is now provided through the newish [rredlist](https://github.com/ropenscilabs/rredlist) package. (Two issues dealing with IUCN problems (#475) (#492)) ### BUG FIXES * Fix to `get_gbifid()` to use new internal code to provide two ways to search GBIF taxonomy API, either via `/species/match` or via `/species/search`, instead of `/species/suggest`, which we used previously. The suggest route was too coarse. `get_gbifid()` also gains a parameter `method` to toggle whether you search for names using `/species/match` or `/species/search`. (#528) * Fix for `col_search()` to handle when COL can return a value of `missapplied name`, which a `switch()` statement didn't handle yet (#511) thanks @JoStaerk ! * Fixes for `get_colid()` and `col_search()` (#523) thanks @zachary-foster ! taxize 0.7.5 ============ ### BUG FIXES * Fixed bug in the package dependency `bold`, which fixes `taxize::bold_search()`, so no actual changes in `taxize` for this, but take note (#521) * Fixed problem in `gnr_resolve()` where we indexed to data incorrectly. And added tests to account for this problem. Thanks @raredd ! (#519) (#520) * Fixed bug in `iucn_summary()` introduced in last version. `iucn_summary()` now uses the package `rredlist`, which requires an API key, and I didn't document how to use the key. Function now allows user to pass the key in as a parameter, and documents how to get a key and save it in either `.Renviron` or in `.Rprofile` (#522) taxize 0.7.4 =============== ### NEW FEATURES * New function `lowest_common()` for obtaining the lowest common taxon and rank for a given taxon name or ID. Methods so far for ITIS, NCBI, and GBIF (#505) * New contributor James O'Donnell (@jimmyodonnell) (via #505) * Now importing `rredlist` [rredlist](https://github.com/ropenscilabs/rredlist) * New function `iucn_summary_id()` - same as `iucn_summary()`, except takes IUCN IDs as input instead of taxonomic names (#493) * All taxonomic rank columns in data.frame's now given back as lower case. This provides consistency, which is important, and many functions use ranks to determine what to do next, so using a consistent case is good. ### MINOR IMPROVEMENTS * `iucn_summary()` fixes, long story short: a number of bug fixes, and uses the new IUCN API via the newish package `rredlist` when IDs are given as input, but uses the old IUCN API when taxonomic names given. Also: gains new parameter `distr_details` (#174) (#472) (#487) (#488) * Replaced `XML` with `xml2` for XML parsing (#499) * Fixes to internal use of `httr::content` to explicitly state `encoding="UTF-8"` (#498) * `gnr_resolve()` now outputs a column (`user_supplied_name`) for the exact input taxon name - facilitates merging data back to original data inputs (#486) thanks @Alectoria * `eol_dataobjects()` gains new parameter `taxonomy` to toggle whether to return any taxonomy details from different data providers (#497) * Catalogue of Life URLs changed - updated all appropriate COL functions to use the new URLs (#501) * `classification()` was giving back rank values in mixed case from different data providers (e.g., `class` vs. `Class`). All rank values are now all lowercase (#504) * Changed number of results returned from internal GBIF search in `get_gbfid` to 50 from 20. Gives back more results, so more likely to get the thing searched for (#513) * Fix to `gni_search()` to make all output columns `character` class * `iucn_id()`, `tpl_families()`, and `tpl_get()` all gain a new parameter `...` to pass on curl options to `httr::GET()` ### BUG FIXES * Fixes to `get_eolid()`: URI returned now always has the pageid, and goes to the right place; API key if passed in now actually used, woopsy (#484) * Fixes to `get_uid()`: when a taxon not found, the "match" attribute was saying found sometimes anyway - that is now fixed; additionally, fixed docs to correctly state that we give back `'NA due to ask=FALSE'` when `ask = FALSE` (#489) Additionally, made this doc fix in other `get_*()` function docs * Fix to `apgOrders()` function (#490) * Fixes to `tp_search()` which fixes `get_tpsid()`: Tropicos doesn't allow periods (`.`) in query strings, so those are URL encoded now; Tropicos doesn't like sub-specific rank names in name query strings, so we warn when those are found, but don't alter user inputs; and improved docs to be more clear about how the function fails (#491) thanks @scelmendorf ! * Fix to `classification(db = "itis")` to fail better when no taxa found (#495) thanks @ashenkin ! * `eol_pages()` fixes: the EOL API route for this method gained a new parameter `taxonomy`, this function gains that parameter. That change caused this fxn to fail. Now fixed. Also, parameter `subject` changed to `subjects` (#500) * Fix to `col_search()` due to when `misapplied name` come back as a data slot. There was previously no parser for that type. Now there is, and it works (#512) taxize 0.7.0 =============== ### NEW FEATURES * Now requires `R >= 3.2.1`. Good idea to update your R installation anyway (#476) * New function `ion()` for obtaining data from Index of Organism Names (#345) * New function `eubon()` for obtaining data from EU (European Union) BON taxonomy (#466) Note that you may onloy get partial results for some requests as paging isn't implemented yet in the EU BON API (#481) * New suite of functions, with prefix `fg_*()` for obtaining data from Index Fungorum. More work has to be done yet on this data source, but these initial functions allow some Index Fungorum data access (#471) * New function `gbif_downstream()` for obtaining downstream names from GBIF's backbone taxonomy. Also available in `downstream()`, where you can request downstream names from GBIF, along with other data sources (#414) ### MINOR IMPROVEMENTS * Note added in docs for all `db` parameters to warn users that if they provide the wrong `db` value for the given taxon ID, they can get data back, but it would be wrong. That is, all taxonomic data sources available in `taxize` use their own unique IDs, so a single ID value can be in multiple data sources, even though the ID refers to different taxa in each data source. There is no way we can think of to prevent this from happening, so be cautious. (#465) * A note added to all IUCN functions to warn users that sometimes incorrect data is returned. This is beyond our control, as sometimes IUCN itself gives back incorrect data, and sometimes EOL/Global Names (which we use in some of the IUCN functions) give back incorrect data. (#468) (#473) (#174) (472) (#475) ### BUG FIXES * Fix to `gnr_resolve()` to by default capitalize first name of a name string passed to the function. GNR is case sensitive, so case matters (#469) ### DEFUNCT * `phylomatic_tree()` and `phylomatic_format()` are defunct. They were deprecated in recent versions, but are now gone. See the new package `brranching` for Phylomatic data (#479) taxize 0.6.6 =============== ### MINOR IMPROVEMENTS * `stripauthority` argument in `gnr_resolve()` has been renamed to `canonical` to better match what it actually does (#451) * `gnr_resolve()` now returns a single data.frame in output, or `NULL` when no data found. The input taxa that have no match at all are returned in an attribute with name `not_known` (#448) * updated some functions to work with to R >3.2.x * In `vascan_search()` changed `callopts` parameter to `...` to pass in curl options to the request. * In `ipni_search()` changed `callopts` parameter to `...` to pass in curl options to the request. In addition, better http error handling, and added a test suite for this function. (#458) * `stringsAsFactors=FALSE` now used for `gibf_parse()` (https://github.com/ropensci/taxize/commit/c0c4175d3a0b24d403f18c057258b67d3fbf17f0) * Made nearly all column headers and list names lowercase to simplify indexing to elements, as well as combining outputs. (#462) * Plantminer API updated to use a new API. Option to search ThePlantList or the Brazilian Flora Checklist (#464) * Added more details to the documentation for `get_uid()` to make more clear how to use the varoious parameters to get the desired result, and how to avoid certain pitfalls (#436) * Removed the parameter `asdf` from the function `eol_dataobjects()` - now returning data.frame's only. * Added some error catching to `get_eolid()` via `tryCatch()` to fail better when names not found. * Dropped `openssl` as a package dependency. Not needed anymore because uBio dropped. ### BUG FIXES * `gnr_resolve()` failed when no canonical form was found. * Fixed `gnr_resolve()` when no results found when `best_match_only=TRUE` (#432) * Fixed bug in internal function `itisdf()` to give back an empty data.frame when no results found, often with subspecific taxa. Helps solve errors reported in use of `downstream()`, `itis_downstream()`, and `gethierarchydownfromtsn()` (#459) ### NEW FEATURES * `gnr_resolve()` gains new parameter `with_canonical_ranks` (logical) to choose whether infraspecific ranks are returned or not. * New function `iucn_id()` to get the IUCN ID for a taxon from it's name. (#431) ### DEFUNCT * All functions that interacted with the taxonomy service uBio are now defunct. Of course we would deprecate first, then make defunct later, to make transition easier, but that is out of our hands. The functions that are defunct are: `ubio_classification()`, `ubio_classification_search()`, `ubio_id()`, `ubio_search()`, `ubio_synonyms()`, `get_ubioid()`, `ubio_ping()`. In addition, ubio has been removed as an option in the `synonyms()` function, and references for uBio have been removed from the `taxize_cite()` utility function. (#449) taxize 0.6.2 =============== ### MINOR IMPROVEMENTS * `rankagg()` doesn't depend on `data.table` anymore (fixes issue with CRAN checks) * Replaced `RCurl::base64Decode()` with `openssl::base64_decode()`, needed for `ubio_*()` functions (#447) * Importing only functions (via `importFrom`) used across all imports now (#446). In addition, `importFrom` for all non-base R pkgs, including `graphics`, `methods`, `stats` and `utils` packages (#441) * Fixes to prevent problems with httr v1, where you can't pass a zero length list to the `query` parameter in `GET()`, but can pass `NULL` (#445) * Fixes to all of the `gni_*()` functions, including code tidying, some DRYing out, and ability to pass in curl options (#444) ### BUG FIXES * Fixed typo in `taxize_cite()` * Fixed a bug in `classification()` where numeric IDs as input got converted to itis ids just because they were numeric. Fixed now. (#434) * Catalogue of Life (COL) changed from using short numeric codes for taxa to long alphanumeric UUID type ids. This required fixing functions using COL web services (#435) taxize 0.6.0 =============== ### NEW FEATURES * Added a method for Catalogue of Life for the `synonyms` function to get name synonyms. (#430) * Added datasets `apgFamilies` and `apgOrders`. (#418) * `col_search()` gains parameters `response` to get a terse or full response, and `...` to pass in curl options. * `eol_dataobjects()` gains parameter `...` to pass in curl options, and parameter `returntype` renamed to `asdf` (for "as data.frame"). * `ncb_get_taxon_summary()` gains parameter `...` to pass in curl options. * The `children()` function gains the `rows` parameter passed on to `get_*()` functions, supported for data sources ITIS and Catalogue of Life, but not for NCBI. * The `upstream()` function gains the `rows` parameter passed on to `get_*()` functions, supported for both data sources ITIS and Catalogue of Life. * The `classification()` function gains the `rows` parameter passed on to `get_*()` functions, for all sources used in the function. * The `downstream()` function gains the `rows` parameter passed on to `get_*()` functions, for all sources used in the function. * Nearly all taxonomic ID retrieveal functions (i.e., `get_*()`) gain new parameters to help filter results (e.g., `division`, `phylum`, `class`, `family`, `parent`, `rank`, etc.). These parameters allow direct matching or regex filters (e.g., `.a` to match any character followed by an `a`). (#410) (#385) * Nearly all taxonomic ID retrieveal functions (i.e., `get_*()`) now give back more information (mostly higher taxonomic data) to help in the interactive decision process. (#327) * New data source added to `synonyms()` function: Catalogue of Life. (#430) ### MINOR IMPROVEMENTS * `vegan` package, used in `class2tree()` function, moved from Imports to Suggests. (#392) * Improved `taxize_cite()` a lot - get URLs and sometimes citation information for data sources available in taxize. (#270) * Fixed typo in `apg_lookup()` function. (#422) * Fixed documentation in `apg_families()` function. (#418) * Across many functions, fixed support for passing in curl options, and added examples of curl option use. * `callopts` parameter in `eol_pages()`, `eol_search()`, `gnr_resolve()`, `tp_accnames()`, `tp_dist()`, `tp_search()`, `tp_summary()`, `tp_synonyms()`, `ubio_search()` changed to `...` * `accepted` parameter in `get_tsn()` changed to `FALSE` by default. (#425) * Default value of `db` parameter in `resolve()` changed to `gnr` as `tnrs` is often quite slow. * General code tidying across the package to make code easier to read. ### BUG FIXES * Fixed encoding issues in `tpl_families()` and `tpl_get()`. (#424) ### DEPRECATED AND DEFUNCT * The following functions that were deprecated are now defunct (no longer available): `ncbi_getbyname()`, `ncbi_getbyid()`, `ncbi_search()`, `eol_invasive()`, `gisd_isinvasive()`. These functions are available in the `traits` package. (#382) * `phylomatic_tree()` is deprecated, but will be defunct in a upcoming version. taxize 0.5.2 =============== ### NEW FEATURES * New set of functions to ping each of the APIs used in `taxize`. E.g., `itis_ping()` pings ITIS and returns a logical, indicating if the ITIS API is working or not. You can also do a very basic test to see whether content returned matches what's expected. (#394) * New function `status_codes()` to get vector of HTTP status codes. (#394) ### MINOR IMPROVEMENTS * Removed startup message. * Now can pass in curl options to `itis_ping()`, and all `*_ping()` functions. ### BUG FIXES * Moved examples that were in `\donttest` into `\dontrun`. taxize 0.5.0 =============== ### NEW FEATURES * New function `genbank2uid()` to get a NCBI taxonomic id (i.e., a _uid_) from a either a GenBank accession number of GI number. (#375) * New function `get_nbnid()` to get a UK National Biodiversity Network taxonomic id (i.e., a _nbnid_). (#332) * New function `nbn_classification()` to get a taxonomic classification for a UK National Biodiversity Network taxonomic id. Using this new function, generic method `classification()` gains method for `nbnid`. (#332) * New function `nbn_synonyms()` to get taxonomic synonyms for a UK National Biodiversity Network taxonomic id. Using this new function, generic method `synonyms()` gains method for `nbnid`. (#332) * New function `nbn_search()` to search for taxa in the UK National Biodiversity Network. (#332) * New function `ncbi_children()` to get direct taxonomic children for a NCBI taxonomic id. Using this new function, generic method `children()` gains method for `ncbi`. (#348) (#351) (#354) * New function `upstream()` to get taxa upstream of a taxon. E.g., getting families upstream from a genus gets all families within the one level higher up taxonomic class than family. (#343) * New suite of functions `as.*()` to coerce numeric/alphanumeric codes to taxonomic identifiers for various databases. There are methods on this function for each of itis, ncbi, tropicos, gbif, nbn, bold, col, eol, and ubio. By default `as.*()` funtions make a quick check that the identifier is a real one by making a GET request against the identifier URI - this can be toggle off by setting `check=FALSE`. There are methods for returning itself, character, numeric, list, and data.frame. In addition, if the `as.*.data.frame()` function is used, a generic method exists to coerce the `data.frame` back to a identifier object. (#362) * New suite of functions named, for example, `get_tsn_()` (the underscore is the only different from the previous function name). These functions don't do the normal interactive process of prompts that e.g., `get_tsn()` do, but instead returned a list of all ids, or a subset via the `rows` parameter. (#237) * New function `ncbi_get_taxon_summary()` to get taxonomic name and rank for 1 or more NCBI uid's. (#348) ### MINOR IMPROVEMENTS * `assertthat` removed from package imports, replaced with `stopifnot()`, to reduce dependency load. (#387) * `eol_hierarchy()` now defunct (no longer available) (#228) (#381) * `tp_classifcation()` now defunct (no longer available) (#228) (#381) * `col_classification()` now defunct (no longer available) (#228) (#381) * New manual page listing all the low level ITIS functions for which their manual pages are not shown in the package index, but are available if you to `?fxn-name`. * All `get_*()` functions gain a new parameter `rows` to allow selection of particular rows. For example, `rows=1` to select the first row, or `rows=1:3` to select rows 1 through 3. (#347) * `classification()` now by default returns taxonomic identifiers for each of the names. This can be toggled off by the `return_id=FALSE`. (#359) (#360) * Simplification of many higher level functions to use `switch()` on the `db` parameter, which helps give better error message when a `db` value is not possible or spelled incorrectly. (#379) ### BUG FIXES * Lots of reduction of redundancy in internal functions. (#378) taxize 0.4.0 =============== ### NEW FEATURES * New data sources added to taxize: BOLD (Biodiversity of Life Database). Three more data sources were added (World Register of Marine Species (WoRMS), Pan-European Species directories Infrastructure (PESI), and Mycobank), but are not available on CRAN. Those three data sources provide data via SOAP web services protocol, which is hard to support in R. Thus, those sources are available on Github. See https://github.com/ropensci/taxize#version-with-soap-data-sources * New function `children()`, which is a single interface to various data sources to get immediate children from a given taxonomic name. (#304) * New functions added to search BOLD data" `bold_search()` that searches for taxa in the BOLD database of barcode data; `get_boldid()` to search for a BOLD taxon identifier. (#301) * New function `get_ubioid()` to get a uBio taxon identifier. (#318) * New function started (not complete yet) to get suggested citations for the various data sources available in `taxize`: `taxize_cite()`. (#270) ### MINOR IMPROVEMENTS * Using `jsonlite` instead of `RJSONIO` throughout the `taxize`. * `get_ids()` gains new option to search for a uBio ID, in addition to the others, itis, ncbi, eol, col, tropicos, and gbif. * Fixed documentation for `stripauthority` parameter `gnr_resolve()`. (#325) * `iplant_resolve()` now outputs data.frame structure instead of a list. (#306) * Clarified parameter `seqrange` in `ncbi_getbyname()` and `ncbi_search()` (#328) * `synonyms()` gains new data source, can now get synonyms from uBio data source (#319) * `vascan_search()` giving back more useful results now. ### BUG FIXES * Added error catching for when URI is too long, i.e., when too many names provided (#329) (#330) * Various fixes to `tnrs()` function, including more meaningful error messages on failures (#323) (#331) * Fixed bug in `getpublicationsfromtsn()` that caused function to fail on data.frame's with no data on name assignment (#297) * Fixed bug in `sci2comm()` that caused fxn to fail when using `db=itis` sometimes (#293) * Fixes to `scrapenames()`. Sending a text blob via the `text` parameter now works. * Fixes to `resolve()` so that function now works for all 3 data sources. (#337) taxize 0.3.0 =============== ### NEW FEATURES * New function `iplant_resolve()` to do name resolution using the iPlant name resolution service. Note, this is different from http://taxosaurus.org/ that is wrapped in the `tnrs()` function. * New function `ipni_search()` to search for names in the International Plant Names Index (IPNI). * New function `resolve()` that unifies name resolution services from iPlant's name resolution service (via `iplant_resolve()`), Taxosaurus' TNRS (via `tnrs()`), and GNR's name resolution service (via `gnr_resolve()`). * All `get_*()` functions how returning a new _uri_ attribute that is a link to the taxon on on the web. If NA is given back (e.g. nothing found), the uri attribute is blank. You can go directly to the uri in your default browser by doing, for example: `browseURL(attr(result, "uri"))`. * `get_eolid()` now returns an attribute _provider_ because EOL collates taxonomic data form a lot of sources, then gives back IDs that are internal EOL ids, not those matching the id of the source they pull from. This should help with provenance, and should help if there is confusion about why the id givenb back by this function does not match that from the original source. * Within the `get_tsn()` function, now using the function `itis_terms()`, which gives back the accepted status of the taxa. This allows a new parameter in the function (`accepted`, logical) that allows user to say give back only accepted status names (`accepted=TRUE`), or to give back all names (`accepted=FALSE`). * `gnr_resolve()` gains two new parameters `best_match_only` (logical, to return best match only) and `preferred_data_sources` (to return preferred data sources) and `callopts` to pass in curl options. * `tnrs()`, `tp_accnames()`, `tp_refs()`, `tp_summary()`, and `tp_synonyms()` gain new parameter `callopts` to pass in curl options. ### MINOR IMPROVEMENTS * `class2tree()` can now handle NA in classification objects. * `classification.eolid()` and `classification.colid()` now return the submitted name along with the classification. * Changed from CC0 to MIT license. * Updated citation to have both the taxize paper in F1000 Research and the package citation. * Sped up some functions by removing internal use of `plyr` functions, see #275. * Removed dependency on rgbif - copied into this package a few functions needed internally. This avoids users having to install GDAL binary. * Added in `verbose` parameter to many more functions to allow suppression of help messages. * In most functions when using `httr`, now manually parsing JSON to a list then to another data format instead of allowing internal `httr` parsing - in addition added checks on content type and encoding in many functions. * Added `match.arg` iternally to `get_ids()` for the `db` parameter so that a) unique short abbreviations of possible values are possible, and b) gives a meaningful warning if unsupported values are given. * Most long-named ITIS functions (e.g., `getexpertsfromtsn`, `getgeographicdivisionsfromtsn`) gain parameter `curlopts` to pass in curl options. * Added `stringsAsFactors=FALSE` to all `data.frame` creations to eliminate factor variables. ### BUG FIXES * `classification.gbifid()` did not return the correct result when taxon not found. * Fixed bugs in many functions, see #245, #248, #254, #277. * `classification()` used to fail when it was passed a subset of a vector of ids, in which case the class information was stripped off. Now works (#284) taxize 0.2.2 =============== ### NEW FEATURES * itis_downstream() and col_downstream() functions accessible now from a single function downstream() (https://github.com/ropensci/taxize/issues/238) ### MINOR IMPROVEMENTS * Added a extension function classification() for the gbif id class, classification.gbifid() (https://github.com/ropensci/taxize/issues/241) ### BUG FIXES * Added some error catching to class2tree function. (https://github.com/ropensci/taxize/issues/240) * Fixed problems in cbind.classification() and rbind.classification() where the first column of the ouput was a useless column name, and all column names now lower case for consistency. (https://github.com/ropensci/taxize/issues/243) * classification() was giving back IDS instead of taxon names on the list element names, fixed this so hopefully all are giving back names. (https://github.com/ropensci/taxize/issues/243) * Fixed bugs in col_*() functions so they give back data.frame's now with character class columns instead of factors, damned stringsAsFactors! (https://github.com/ropensci/taxize/issues/246) taxize 0.2.0 =============== ### MINOR IMPROVEMENTS * New dataset: Lookup-table for family, genus, and species names for ThePlantList under dataset name "theplantlist". * get_ids() now accepts "gbif" as an option via use of get_gbifid(). * Changed function itis_phymat_format() to phylomatic_format() - this function gets the typical Phylomatic format name string "family/genus/genus_epithet" ### BUG FIXES * Updated gbif_parse() base url to the new one (http://api.gbif.org/v1/parser/name). * Fixes to phylomatic_tree(). ### NEW FEATURES * New function class2tree() to convert list of classifications to a tree. For example, go from a list of classifications from the function classification() to this function to get a taxonomy tree in ape phylo format. * New function get_gbfid() to get a Global Biodiversity Information Facility identifier. This is the ID GBIF uses in their backbone taxonomy. * classification() outputs gain rbind() and cbind() generic methods that act on the various outputs of classification() to bind data width-wise, or column-wise, respectively. taxize 0.1.9 =============== ### MINOR IMPROVEMENTS * Updated ncbi_search() to retrieve more than a max of 500, slightly changed column headers in output data files, and if didn't before, now accepts a vector/list of taxonomic names instead of just one name. taxize 0.1.8 =============== ### NEW FEATURES * We attempted to make all ouput column names lowercase, and to increase consistency across column names in outputs from similar functions. * New function scrapenames() uses the Global Names Recognition and Discovery service to extract taxonomic names from a web page, pdf, or other document. * New function vascan_search() to search the CANADENSYS Vascan names database. ### BUG FIXES * Fixed bugs in get_tpsid(), get_eolid() and eol_pages(). * phylomatic_tree() bugs fixed. ### MINOR IMPROVEMENTS * classification() methods were simplified. Now classification() is the workhorse for every data-source. col_classification(), eol_hierarchy(), and tp_classification() are now deprecated and will be removed in the next taxize version. * classification() gains four new arguments: start, checklist, key, and callopts. * comm2sci() gains argument simplify to optionally simplify output to a vector of names (TRUE by default). * get_eolid() and get_tpsid() both gain new arguments key to specify an API key, and ... to pass on arguments to eol_search(). * Added ncbi as a data source (db="ncbi") in sci2comm(). * tax_agg() now accepts a matrix in addition to a data.frame. Thanks to @tpoi * tnrs() changes: Using httr instead of RCurl; now forcing splitting up name vector when long. Still issues when using POST requests (getpost="POST") wherein a request sent with 100 names only returns 30 for example. Investigating this now. ### NOTES * Function name change: tp_acceptednames() now tp_accnames(). * Function name change: tp_namedistributions() now tp_dist(). * Function name change: tp_namereferences() now tp_refs(). * Internal ldfast() function changed name to taxize_ldfast() to avoid namespace conflicts with similar function in another package. * Three functions now with ncbi_* prefix: get_seqs() is now ncbi_getbyname(); get_genes() is now ncbi_getbyid(); and get_genes_avail() is now ncbi_search(). taxize 0.1.5 =============== ### NEW FEATURES * classification() gains extension method classification.ids() to accept output from get_ids() - which attempts to get a taxonomic hierarchy from each of the taxon identifiers with the output from get_ids(). * synonyms() gains extension method synonyms.ids() to accept output from get_ids() - which attempts to get synonyms from each of the taxon identifiers with the output from get_ids(). taxize 0.1.4 =============== ### NEW FEATURES * Reworked functions that interact with the ITIS API so that lower level functions were grouped together into higher level functions. All the approximately 50 lower level functions are still exported but are not included in the index help file (due to @keywords internal for each fxn) - but can still be used normally, and man files are avaialable at ?functionName. * New function itis_ping() to check if the ITIS API service is up, similar to eol_ping() for the EOL API. * New function itis_getrecord() to get a partial or full record, using a TSN or lsid. * New function itis_refs() to get references associated with a TSN. * New function itis_kingdomnames() to get all kingdom names, or kingdom name for a TSN. * New function itis_lsid() to get a TSN from an lsid, get a partial or full record from an lsid. * New function itis_native() to get status as native, exotic, etc. in various geographic regions. * New function itis_hierarchy() to get full hierarchy, or immediate up or downstream hierarchy. * New function itis_terms() to get tsn's, authors, common names, and scientific names from a given query. * New function sci2comm() to get common (vernacular) names from input scientific names from various data sources. * New function comm2sci() to get scientific names from input common (vernacular) names from various data sources. * New function get_ids() to get taxonomic identifiers across all sources. ### MINOR IMPROVEMENTS * itis_taxrank() now outputs a character, not a factor; loses parameter verbose, and gains ..., which passes on further arguments to gettaxonomicranknamefromtsn. * tp_synonyms(), tp_summary(), plantminer(), itis_downstream(), gisd_isinvasive(), get_genes_avail(), get_genes(), eol_invasive(), eol_dataobjects(), andn tnrs() gain parameter verbose to optionally suppress messages. * phylomatic_tree() format changed so that names are passed in normall (e.g., Poa annua) instead of the slashpath format (family/genus/genus_species). Also, taxaformat parameter dropped. * itis_acceptname() gains ... to pass in further arguments to getacceptednamesfromtsn() * tp_namedistributions() loses parameter format. * get_tsn() and get_uid() return infomation about match as attribute. * clarified iucn-documentation ### BUG FIXES * Fixed bug in synonyms() so that further arguments can be passed on to get_tsn() to suppress messages. * Removed test for ubio_classification_search(), a function that isn't operational yet. taxize 0.1.1 =============== ### NEW FEATURES * New functions added just like get_uid()/get_tsn() but for EOL, Catalogue of Life, and Tropicos, see get_eolid(), get_colid(), and get_tpsid(), respectively. * classification() methods added for EOL, Catalogue of Life, and Tropicos, see functions classification.eolid(), classification.colid(), and classification.tpsid() respectively. * New function col_search() to search for names in the Catalogue of Life. * User can turn off interactive mode in get_* functions. All get_* functions gain an ask argument, if TRUE (default) a user prompt is used for user to select which row they want, if FALSE, NA is returned when many results available; and added tests for the new argument. Affects downstream functions too. * New function eol_invasive() to search EOL collections of invasive species lists. * New function tp_search() to search for a taxonomic IDs from Tropicos. * New function tp_classification() to get a taxonomic hierarchy from Tropicos. * New function gbif_parse() to parse scientific names into their components, using the GBIF name parser API. * New function itis_searchcommon() to search for common names across both searchbycommonnamebeginswith, and searchbycommonnameendswith. ### BUG FIXES * tax_name() and other function broke, because get_tsn() and get_uid() returned wrong value when a taxon was not found. Fixed. ### MINOR IMPROVEMENTS * Added tests for new classification() methods for EOL, COL, and Tropicos. * Added tests for new functions tp_search() and tp_classification(). ### NOTES * Moved tests from inst/tests to tests/testthat according to new preferred location of tests. * Updated CITATION in inst/ with our F1000Research paper info. * Package repo name on Github changed from taxize_ to taxize - remember to use "taxize" in install_github() calls now instead of "taxize_" taxize 0.1.0 =============== ### NEW FEATURES * New function tpl_families() to get data.frame of families from The Plantlist.org site. * New function names_list() to get a random vector of species names using the * Added two new data sets, plantGenusNames.RData and plantNames.RData, to be used in names_list(). * New function ldfast(), a replacement function for plyr::ldply that should be faster in all cases. * Changed API key names to be more consistent, now tropicosApiKey, eolApiKey, ubioApiKey, and pmApiKey - do change these in your .Rprofile if you store them there. * Added a startup message. ### MINOR IMPROVEMENTS * Across most functions, removed dependencies on plyr, using ldfast() instead, for increased speed. * Across most functions, changed from using RCurl to using httr. * Across most functions, stop_for_status() now used directly after Curl call to check the http status code, stoping the function if appropriate code found. * Many functions changed parameter ... to callopts, which passes on additional Curl options, with default an empty list (list()), which makes function testing easier. * eol_search() gains parameters page, exact, filter_tid, filter_heid, filter_by_string, matching, cache_ttl, and callopts. * eol_hierarchy() gains parameter callopts, and loses parameter usekey (always using API key now). * eol_pages() gains parameters images, videos, sounds, maps, text, subject, licenses, details, common_names, synonyms, references, vetted, cache_ttl, and callopts. * gni_search(): parameter url lost, is defined inside the function now, and .Rd file gains url references. * phylomatic_tree() now checks to make sure family names were found for input taxa. If not, the function stops with message informing this. * tpl_get() updated with fixes/improvements by John Baumgartner - now gets taxa from all groups, whereas only retrieved from Angiosperms before. In addition, csv files from The Plantlist.org are downloaded directly rather than read into R and written out again. * tpl_search() now checks for missing data or errors, and stops function with error message. ### BUG FIXES * capwords() fxn changed to taxize_capwords() to avoid namespace conflicts with other packages with a similar function. * ubio_namebank() was giving back base64 encoded data, now decoded appropriately. ### NOTES * Added John Baumgartner as an author. taxize 0.0.6 =============== ### NEW FEATURES * tax_name() accepts multiple ranks to query. * tax_name() accepts vectors as input. * tax_name() has an option to query both, NCBI and ITIS, in one call and return the union of both. * new extractor function for iucn_summary(): iucn_status(), to extract status from iucn-objects. * tax_agg(): A function to aggregate species data to given taxonomic rank. * tax_rank(): Get taxonomic rank for a given taxon name. * classification() accepts taxon names as input and returns a named list. * new function apg_lookup() looks up APGIII taxonomy and replaces family names * new function gni_parse() parses scientific names using EOl's name parser API * new function iucn_getname() is a utility to find IUCN names using the EOL API * new function rank_agg() aggregates data by a given taxonomic rank * new data table apg_families * new data table apg_orders * gnr_resolve() gains new arguments gnr_resolvee_once, with_context, stripauthority, highestscore, and http, and loses returndf (that is, a data.frame is returned by default) * gni_search() gains parameter parse_names ### MINOR IMPROVEMENTS * tnrs() parameter getpost changed from default of 'GET' to 'POST' * Across all functions, the url parameter specifying an API endpoint was moved inside of functions (i.e., not available as a parameter in the function call) * gnr_datasources() parameter todf=TRUE by default now, returning a data.frame * col_classification() minor formatting improvements ### BUG FIXES * iucn_summary() returns no information about population estimates. * get_tsn() raised a warning in specific situations. * tax_name() did not work for multiple ranks with ITIS. * fixed errors in getfullhierarchyfromtsn() * fixed errors in gethierarchydownfromtsn() * fixed errors in getsynonymnamesfromtsn() * fixed errors in searchforanymatch() * fixed errors in searchforanymatchedpage() ### NOTES * Removed dependency to NCBI2R * Improvements of documentation * Citation added taxize 0.0.5 =============== ### BUG FIXES * removed tests for now until longer term fix is made so that web APIs that are temporarily down don't cause tests to fail. taxize 0.0.4 =============== ### BUG FIXES * added R (>= 2.15.0) so that package tests don't fail on some systems due to paste0() * remove test for ubio_namebank() function as it sometimes fails taxize 0.0.3 =============== ### BUG FIXES * iucn_summary() does not break when API returns no information. * tax_name() returns NA when taxon is not found on API. * get_uid() asks for user input when more then one UID is found for a taxon. * changed base URL for phylomatic_tree(), and associated parameter changes ### NEW FEATURES * added check for invasive species status for a set of species from GISD database via gisd_isinvasive(). * Further development with the EOL-API: eol_dataobjects(). * added Catalogue of Life: col_classification(), col_children(), and col_downstream(). * new fxn get_genes(), retrieve gene sequences from NCBI by accession number. * new functions to interact with the Phylotastic name resolution service: tnrs_sources() and tnrs() * Added unit tests ### DEPRECATED AND DEFUNCT * itis_name() fxn deprecated - use tax_name() instead taxize 0.0.2 =============== ### BUG FIXES * changed paste0 to paste to avoid problems on certain platforms. * removed all tests until the next version so that tests will not fail on any platforms. * plyr was missing as import for iucn_summary fxn. ### NEW FEATURES * added NEWS file. taxize 0.0.1 =============== ### NEW FEATURES * released to CRAN taxize/data/0000755000176200001440000000000013162233432012466 5ustar liggesuserstaxize/data/rank_ref.RData0000644000176200001440000000072613142661556015211 0ustar liggesusers‹]”±nÛ0†Ù®cµFZ:fè(69éÞ'È”- -Ê!b‰)¹È–ͳÔ9Q$Ô é¿ïŽÿ(BŸhú”B2™^dršÀí‚LÉž—ŠÕ¯ÏŠ—„L®M]B¾Ãó·Í'«Ü©õÊ)ŠÊg7žÝ¡òÙܳ­W÷^=xõÇ©Éz…r’2÷rƒôeŽr‹òåJlL±1]Òw£8Å(Î@qškqºEŠ“m`}‡oºk¸zõ¡•eó8Lu·‹É/Q—ŠY–‡æåíØ¹üÕe…8 -dmñO0²P£äÒxŽ`j¼÷G¦µ%³0¸›0NGH~© ®²½|‘ªu>†>a<ø„dÑ0u ÁWc\²Jß,úE ðŒÀ¬UbǃŽa<;ðº _+ŒçšïÛhSv1Yê†ï×7%»Æ¯ ûÐæbfœ"2?1%xëf¾‚K2ØX?­n…r}ÒRª*«$GØŽ+Å‚çýf@™ ¯»Ú´-/²ZÞôÿŠÑÿcV³ ¦kâv¸/…+é#=Z·Pòß­[»ì×¾Ãí|>Œ Çdhà`Z°–ÝÂ>U¢ÿýõ { @ëtaxize/data/plantGenusNames.RData0000644000176200001440000001223212672032225016511 0ustar liggesusers‹m[ÛvÛ¸’Ít·u—“ÎÛüÆü$+RNK¶Ær§{õDÁ"Æ$ÁÉÄôÇÏš] Œ*0ç!Aê²wUéñîïÿšü=ùðáÃ/~ÅŸ_~ÅûýLJß>ŒñïÇ2SE½ÑESÝ«\Wúôáïÿyýz¶(l®LI›ê:6ÝÛÂÖ©NL“¿ïòäL’ÚJIªßŒº…©l­ßWÎW¶Ê m¦ó°vø¨ÞL¥ß×ÌVm’õŸ¸U®´Ij²04[è$ÍýVî}éø¨œ?Xø»Í¢éÎg•¼hÇg|T?*[„ϳ;]œ­ê63ïß©ªÍt¦§Š³9~øtÛž ›à áŒ7{ÕïßÿþG“f8paìÙ?¡¸~q»vm≥v,•ù!U ^å…xé$Uuüé^¹ª)q–°v¶±ú¤3{rm›ìtÚÄfAÐãM›^€ï’8سü¤m"6Zᚪ¶x—Úð%Îp¯\bª*äö˲u“Ô…w/ò“uÑûšGöÆÛkñê•…õóE™ªÂ–ºVkꢼêaPû¥v „¼Ëû¬])ŒT³“haU‰¥±0‰ÔªT…z êHò®É[Amõ™ÍÞ¨yQMÐÎÈ-&Y{&…`1ìuï)[]ëxÕléTU)# a¸²Î¾Sq[¦mƲíTiô™Ì¾qÐ5é¯&ÛV%FšäðÎÀ“¬MÅš=úó{“‰›-……†+,`ïÁ_ŽPÍ ÎéN7‰Mœa[˜®T^Öd[á “%NWH+€ª\ég“™ !˜Œz~.„ÞßÜ Kñ¾§„ÙÔ·6ÃI“š}Úì@Â2‘s=)§VÑéÚéÜB£ŒP°ÊߎzØZœ”ÉtËAŸlÃÊ:Ø“óz²h¥µÍW®…rÕbGñÅä''ÍÊ?YHfWx1ˆlªb'÷5/Umt¢O§Ø¬£ƒ¥†%†“@‹ZŒ“¼J‰d…xa8Š üŒ öEÆ_M—@çgëά_¤î?”™ âS†øËz0:–†böûœÛcíš:5½;\úUQ0è†døš¯R¼}oépGž”/ãÎZq¢c­{SéõVi¶…ÛÝÛ’Ÿ¹$‰ð³ã%uq;p‰¶AXÓ#hÀÉCP#õkºoaµ|¥éNUÆïÄZ¸J) a«€6™ÍI1M(#ý ¡„]Vê­MuqÒîÂú¸qÚðÇ Ì:…ݵr‹ñ  |ž{ W~ÞþHi8Ô„½Çð›3š±Úà/à Ç6 ¬rzIÚ Q<Ú ÷"§Ý>8„ì³íÁ¸C9q¼(U&E=£Èû?`|€ sèOn“¢}æKXÈI9„ñœ´l`À c>ƒàÏö]6¯'Õð‚ Íh+ƒ?ïájísf]•¤® –í‰ñäð¡lŠš7‚èOºªØ÷Ü<8>|^Aé`ÿ8NFn@³îÝ!$*©a&'ó=RƒðƬ³5iE¼hô‡S¦°Ý@0¥åÃ[ËØw¼H !Д¯ò#›Ø[ çƒ²V¸°ÉFå6Úå Œw¾Óeã:`îq¶†}÷ÀóôΟE‹˜9ÝšdÁ©:èépß^ø¿ïcòìË9; E§ø$ÂVí<}²Î) ¢ŠãØÈ…Ù ^Œ†Åë–Ne¸#×ÉÒßW‹‡Âº¶‚ºÂ5‡=æëWLé ‘ I Ù6E@šrÚ"Ãì›EÝÏî m¦Î”Ãýeµ•´0¹©EȬ2Íༀ/Ë„EÍ톛=r ìe@K{‰¦ü¥3yÙ˜Þ8aÔ›µ3ÄU±Mfƒ†pëààé,c8¯n{Äk¶»íŒýÅ–x$€P™²±ßõ™•nñììwó=Šäû¾ qM¦ð,LcׇX‡kéþEŽ^@ïúlØ7ÍA?6b:+zûL=*;”ïì/Ú‚cŸÙ×-^éRøf Sõ÷GÄØJ,3´oä³2û£zaдѠ –5fc²ì¤×a“s’5ì¢àN*À&Fl“¿´)ryOãàc!^b¼n¼™ 7«Æ ÊDIé’ˆ:fMqŽ.ßù€k`é–#î?‚ «$&Ýc¼/ÌŸ ¢©‚¶Iµ®¿[O~ùŸ¯š¬Ö¸©ZÂh—5ghP€Þ³åòާ‰1aôm-ÀÝíª%[)Óˆ—îT&áêlE†‡ÉñNW/šÂ°¸«,âs³àQ/õó1¨&;÷ªƒMl½4™Pw„ˆW‡m狯à€ã{}Qˆ6àŽŠÉ¡[<¡îØ\ä0='‰·›Š4ųÎXIn‰QxÄ.#Õ¼#^9$` ×ŽÑÈí 6d¯dUÆdZ*ÏsL2,ÏóqðÑY¢T,@{ êñ ͧlq¦–W9=´„b"Þ±./gŽ0Z»*ZÒ£*Ó{˜Boh]¦”˜tå:Ýò1Dzšî!‚>Z÷&¾XwÑ•ð…Gülcž¹‰Å‘⤙ðOÖUBæ Bç7xF$,S«ü†Ísá6zc‹Ç>—®Q'2"˜Ä^Ç Ç#ø–½pJôóV#€Ã¿Ðó½Ëþ $¸ˆ–ôÏÿéQƒ)^.–µ×UK†ÐæXcOŒ–®‘ád´±6Â+à]í +’3Ÿ0³5‡?"¶=ÂTdF¸Ë>ÕF@ØÈ.$bï¼BÒ™¤jלNâcSZÈ†Ô VÉɦu6BwóU[RpަÝn×’Ôyø¦¾A‚üòûÖ™žÍØ]SA%|ìþ!f;ÕÀd#Z:ÞB!º0#"žH¥íâÞ,³6¤W§ß(U2W4¢”ˆaÇ4X_duë­À„¯ÇOL+v6ǺL;‡%F©FÞ^í‚pYð‰»´>`F!€"\ a:vuóGløÌh°ËYıôSXŽ8+̬‹sÙ$™ûѽžïU⺲0‚ë¤ÝŒ¯cœøújbŒ=]µ$d¹êv‘®êaf,µEœ²çöõ†ŠQk—®‹ÇÆWôÀ7s >~¤êñ¹øJ¤3ºyxm“4³:¼láÅrü«)Ø;Oÿ òˆ“÷ F˜˜D•)‡[âiSO>¤´šõ$—~ëó#å1:CŒ7›]1Ž›nÛ²á[9¶À¨‰€Ÿž·Qêøÿr€'`Éx}(nRÙ`4,ŠR½“ƒ).|öW;¸Æàu‘‰RܤpÂcÏ6*yé*Œ&ºY2÷v-’÷ŽT3['‚Øï"'ò±Â_±žhíf!>LÖØ±œ·Þ5•pá7wö-ÄJWõN=󅀓vñžSãÑ%{Š#^ vÄ'½VïdêŸöBD@T“@_‚¸ºú”´³Û{„^r/‰uL)‡»Ì¶"{os‚Í"›Ju!"؜ə~:$¿(Hç^CŦ¿Â+P^éAãSŸaÍ#(å|9J;gël“ˆzë´¶Ð:vŠ[M–Áý2‘¾„õŠ>¸ë“u…¨9‚f!ÜN¶ÊÕ™ô3º‹^à˜/`pc$> ‰p¿³x+¥÷Ç»‹|ëàü*SûŠÔ~ê’‹W€.9—²ÒO2`( —)©^Ìåý‚ôÑúÈ%Ê®ãü‰<>Pmñ£å=GHUS‹hVÈÚÞŒ|êuOf%x&b¨pTI:Ë4xö³Õ…03ÊýGÕ€9!¨DlK£ÊJáM[mÄ·wˆ2%{´ÁªàkÎ#®?=dTB–Nu¼R” ¸n¢‚ÎðPSމ/,…‘ ºJ‡0¸Ã~*ŠªY‚†*.½¢ÃÄ/Š’Ò-1b-2ª]±ï,÷‡çèï5Û+Ò èÍ>wn.ÿùrYg3ýOºª:aE™#ì?zÕ¯‰ôúw>õNpm†ÒrD¿£æ *Ò¹ÞΫŽM„læüĈÂ:%5ƒöÝk MEÇfa…åRýI^ßteÎòèTfVió5eÛjÞ„zî¿`‰Ö¥æ-<|ÏÅeÃÙ±4ýNб'ôb€G:pN¼×EYËø›÷¡•P{S*×ó5Ÿðâ©û9ï1#4Ùkr™Ü ±æž1¤¢ñk+HŠ(R± k°v- ûcGs]¿I¸;[”?Í»4—ÝŽxß›5Ü[g8G<ÞSUB ÕAéØ@ê8yúmÏǬaw5;3m"¶9ÝS[KS‹˜ê!NÞ:û‰h^±Q‡B^Á§î-ŸA Hà¡f„ZÛq"f?ԲИ0ãÖwÅ$®gxF¯g¸o™-yЄ۔Ѓ1ôCKµšv#ÞîqCÂZ‡Ä&QVýfˆ”‹„PãZ• øY!ŠŠûòZö‡?(|ßR94hÞàþX½ÿá£-EÍå·‡,´0be*á³ümrY-Ø›âÄhÆ`++ æžò¢ ÕÁ¦R&˜<"zP%Êê60háH MF½¤ž€RùEF÷ñºá>E*£O””–?¥ o±©.ƒ‡ùá n@&à¥È%2´Û(¡‰ïÛ†=Á‘/ýåz©‡)ÊXú 9eÁäºâ©ÇŸ²Ë©h-BY-k2SêU‹so“;ÐN06Øéa%¦®Ÿ¾ˆ²¥lÞ ¤c®²Zôˆ<¼*Ñ·ì'³ÿ&ý³rÎhd„¨ÀHÃÖÑ„ÉJ!£áµÔpP;Jþœ«[p3ÍÚ6:(ê¿a^f¼QIª«™^qKÙ•ØÃkËV°õ+®Íu"b”K) du4 8öBt0¾Uë•X4þÒPoƒ• 3çŒHÅŠVˆø1¦ì’<âô@8$z‘+ã¾È†«µ×.1R›(uËõM<¥6²†EX/iÛÑ«£ž³š]›C¥aTT®Ûés¿¥áÑ|7‘ÑjÓ÷ËK¨eæh ¹ˆ6žÉ¾k®éÀ!½Ñ²q•’¨—Ûfñãf âIµ/9 4C1ö¤ ;PŠ>ÚÞ2g¡RTõG$D@j„æyQ‡Kj« 'Ûo&Ý¥VŠ‹Ìë¬Í©Lƒýƒz€fZ™Äõ]¦TÛŠ›môwEiËÈÖÎgœd•fÇêÌk”F{Dä2‡K•]¸sarÔ ‚䙳†óÎ7Ä@j‚ˆT¤2tÏ>ë\·,ûùÂ÷Ç…Ë+öšT² 8UŠóÙ„/‰$x†×&¿£)¨ùI0[«ôŒ8AíDæÒ)£ad惚±jáˆé:™[¾Ù+î@„Œ:œ$Iö{5OX@ 9#]qhOVÖWqùvK+\ë-¥[¨jI“Xž|œ‰¯äl%ñý&Qšy‹ó¾¨‚ètéõJdMF¡ÖI·Æ™ó‘wy?¡Š×â`/'zKž|vÔ4ß7šüNÂ(áþf.QôZg‡Ð1ØbdžÁ ãdÐ|óïã\™RYSfA†ÝÏDÐú´·~~¨[¸Â»~Ž¿@Y²(;Zájdñ)O½¤£}yQ¤ !jÍêtƒ‹”X«ËR£ç*_m´nøõUJH•GN=ͬ&VvDŸÈ Ø]lá5릯} kœ,‡äEüK€EAm ,êÓM’¾É@E±«ªý ‚®vùˆÄ—zÅò'įÌ<[ÁM>ùTíÏ[üîAþÍŸäó¨3ôý°[ט¯û£¼»ÚÌo5éТ=Ë´Qv–…–nF¯Ê~Дpú @­IÈà‚zA–M¢®¤Áå 3•»ŸmXaêãwë ¥ÑC›ª´½Î9Ì£ð(˜¯þŠf„½¥‡<ÁV•™˜q}¿˜òŽîùŸE­ËÙ{äÍYî2\DádiS¡[T·¹]Ž!ÜÅŸN‚ýÙôjc{›éÙÔ† BQµyâÓKQò‹ªƒ6ã2èdcÉBÄãæ_pÒ¥×½¼R ò¨ñó)Ê«êÔ8yÿƒ¯¯ÚØòÔ‹™Ç'|&›Ï»n™üxð}œU-j&4«ˆŠ_#‘¿øCš–)ê_*•Ã4ôʼnkKºúžè+º „ƒõ Z3ß”?¥ê(ÈÕÌ}÷•é•@I¿3õC¶^Œ¿ÀíÄ\ š">žä¯fO©w´²cN¿lÒD"2&C7ð9,‹§¸KxüdŸñ̳Dª¾:¸Y†+0aÞº „qMÞçg gó|%9þmÎ>Qc°lqüÓ‰_]=8p×Fþ¾…¯pD#ÔÇâËbŠPÂÕœ¬N£Ÿ¾|°’©Búå4[ ùb΋’oöh ët¯“fq}š7ß½B0ÀÃ5;Û'÷Ò†£¯6êJ.¢¬çxOeëV–^„‡¸,ê‹Ä{ÃÏþ2š Ù¡ìÛWߺžì>z4@¿™ˆ*7ÿÃÉê÷Ž«xÕd£{² Ÿ±dº®UÜï4YÐÏÌ¢øŸ—f1g¢‚xçN>|ø¿ÿ¾çGV8taxize/data/theplantlist.RData0000644000176200001440000025050512672106003016123 0ustar liggesusers‹ìý[wÛÈ’.ŠÎ³»DÜHÙ³×ã<œ—ý¶žêåüŠ’åª’,¶¨Y5×|K‚)"-‰ÂE2ôëwD‚DF$)Y²å[F÷èv|E‘¸dFÆõ‹ËãÿÿÇÿøÇ?þ¯ü×ÿÿ÷¿àŸ?Á?þñÿùÇOÿàÿëD©ÈëTUõ?þñ_ÿ 0üÐëüã¿Þ|&šÆðDÄRÈ    ú[C‰(Õ½B¨Ö±( O¦q©—:]~2X«\­Ôv`0]é_P÷z`à€pz#r¦·ÆÓTU™¨?†½ž¦U]j™I~¼|oødš‰Ò=®pp‚‡¶iªV: : ŸŽ¾šfË´­j¹VaøŸÓ\Ä"+*YjfOÌ(Ý8Áàß,ë„ûd¸mÐY+Ð_è?Œ§ùªñcX8Íe¦¾Ò”?’ë|@d@äéÈ«)ø’:vÍ oûÓB ò ò ò ò_[ަ…ŽÛ|€h€h€h€h€èï½(×kYóøÜdúg£®uªð¹ 7-qqñ/&† rm? OdH;­rãi';}]¥Œ`à‡§åz·Jìõ´TU­S ûü{ÆÇÓª¥XØ€ Ø€ Ø÷‡¥Òí¤°{yì¿§u"K]²tz²#ø/­K2@èpڀ᪳ü…ÑhÚÖú£Ð«#‘ŠÌg]>®•.ª'À€+‘©|_ ,ëRð^”¿ ‰Jr/:’kwÐý¥ É‘,—²ä-¸øƒ‚ᑬ›ôë ã#µÎÕ4`ÿø‡¤>ð'—ŠÊÙ†©Œ“üÛBã#ç²vṉµr?7`6`6`6`ö—Ä^•"NÚ:‘±ðï^U*°°°°û‚˜ÎdêÚ 6`6`),:*§ŒøiР\¦é'‚þQÙò ÿ(òä¨)3‘»õ=``%ËúÔ|xL†öa)·HhÌD\À À À À<x5i,uêÎTýúð!À»ý¬_mwfᎠʭ·}ر¬øîAs—…^Kå|4+DΫ)ppŸF3‘»í*åbù|(0ÿL}ªßÝY”;”j: º‹þs†ã³tQ»!Ïÿ`5–í®Å6À<À<À<À<ÀüϪ¥CñÀñL¦8‘uÀìï„Îd‘ˆTß«ýg:q©ÃY’êÒ õïG_Ï’²­ôé~þx0SU=Ÿ„³TêìÇB"@ê¤|>_Õp.‰ùÈx¦Ó8q^Ë–¥¬ìËbÀ°À9ÀC ]©z@d@d@d@d@d@d@d@d@d@d@d@d@d@d@d@d@d@d@d@d@d@d@d@d@d@d@d@d@d@d@d@d@d@äh¦óÜ¥ ÿa C€nuzÛ¤: : : jÑ`¦Ëüc@åPÇ•¢ªø× Ø€ Øßk‹DÈa“Y7åRÕ8€ß!Íš\;ƒçh>iíZ—OÇnEš~uìõ±ÌW%K¥®ŸŠçU-äªÞùžŸ+Qȼú8øêXÅ ÀµH¿ ×ßTΊD0—™æ3º,ÅýèÐøX­”,¥ƒ¥©tÕÒËb°¨tkþÃ=ðõ±ÂãAÇ¢,üÇÅa ×%ªÌOÀ¢ãRWÜùdèÕ1ŽÈÜ™>À<À<À<À<Àü…ààd)ó¿09‰•ëwWOR!Åš}ð±¯`@_ ­áŸ'y,Ò¶¨ŸÖz¥óŒNŠD®J¾Êä°?U9h÷`ÁIÉGÿÀ À À À_˜–¯5À¯F'eáx{ W'e['¥þЦß'|xRµ:ùà/…NNš"ÑårppppÐÇoIJt+g?ó߈õ 9ùðª*µ’<öý×@'ot޹‹ô£àë7ºªt¶³úž‹OÞ”"¿q+*?ŒÞ4¹(¿14>•i%3ƒ'éT­Ø€ Øß›œbú8mY¨3:• ÓÔ Ð ÐgB vª\î˜&6`6`6`? vxšJ'Ž·ÿùhpš;•‡§Z¯ÜÎÏ¿–*ËþBЫÓRºò/G§Mž;Í“»Ð«Ó6Ëu†šO€'o…Dú¨ò£àø­HY¿öê­(ÒÝ ¿•«;µv.R¦*vÃû@øër)ËÚù`™‹|åþõ.8~«õ«mì›aÑÛ&SîzmWàȬå÷¾FPÇ ìÖúÅ3™ë"iÓtÀüKãã·ÈTÄ‹8ìÛa`ù ÀìpËèõÙg`Ñ/°ûxàׇ‚_Ü~×€ø¶@øK¥y¸é)ˆÿK-“'¿|йËþÚ,y7Ç÷†ŒmÖ)x蟂¿6yü¬¹î} àZ–™È:¨ÿ¦øø·RdN"8Ù À À À À¼Д00ð—&g2në„Ƕ¾Éu“©\W4@4@4@4@4@4@4@4@4@4@4@4@4@4@4@4@4@4@4@4@4@4@4@4@4@ô‚ÐøL¾—MÎØklÀ쯅½:“ÙraèÎAZîð^o8\~¡V:2<éà{5€_ Ïdu#¿rx&›X¯´3\q/œ©T Àg§Á;ã´k?º<y%K‡ÿ›‚cÁ|û+bÁ™Õ߈ÎôÚ!öã@¯Ït‡¶.*Î ð~xÖˆŽu*ÿzèøL—.ûç€ Ø_›œµ±.´3öåû£³ví@áY['å€|id|.Ö¹ævä÷„MÎEZ¨u2€ø 0ðv````~$ :èÐúE¥¨k×WÚÁ‹×¥¸ÝEøÊ' ø­•r‚g_›œËƒêÓÀWVµÎD=À<À<À<À<À<À<ÀLà`5ߘÀ©Z8<—¹ª O: ß% ¯-ow PÎe-u©¬t×x}¿–/ úçù7•'ç:Mg¨óg‚ѹΟŽ÷cC!@õwøçºäAþZ2l’Råkþ‘†]ž·z¥cQ|é¶¥âcå©ê| ¬```à»ÀÖiJõ\dòN”u"c“ñ,èÓ¡ñ;YH7ÒñDì5`I©SìËþ|òN׉¾Ìp~ Àm*œÏ¶q-\{98~×fEâtÀ~çXp'ùü€×q­—°ÏÁLj_¤"þú€Á«ñþêrx‘‹u9 7$ºÈuÌ—ÂèÕE‘(½NuU}c8¼(†è¢Œn Ð Ð Ð Ð Ð Ð Ð Ð Ð Ð Ð Ð Ð Ð Ð Ð Ð Ð Ð Ðý(Ðä¢ÔK‘ÇÉàà~MðÕEY'º.Õð÷GUÖäŽýðA¤®I1@kèõ\¤©¸U±rg>€Gs‹* ïÏE!nfíûË`¯æØ[¶õp8U¥®SN,5 ú#£Ñ\®„Óêù©P8—9gx)ä5 µ(s"þ;ãþÜU_‰LSÎ0Γ²Í¾r8‡‹Nwˆut@ô»Ek І“:ÎU\ŠŒ;"¯Ô+™¯Ê'À‡s•îúÈ?êϹzýÒr8WWò2 2 2 /…ÀYW׺*\ñÇB_ÍS±V:NT:ÀŸ¿îàþ·ðÃ9Ú.©á€è€è€è€~h“-t@¿êÍõ â â â â â â âß\œÌ÷L™}&XÕ2ûþÁTfÚÞ=€OǶk‘Ø€}¦ó°°}>m¡W;'Òààààˇîi¼ù‹ y-W²tÚdu)ÓÔy2eÝ8øÉàë¹®E¦×²æöí·ÂCÀk5 2 2 _‰æ¥Êšt€h€h€¾*ÎK]Ë­š¨eé`Ð Ð}ú§Öm.©ÿÃÿƒ^–í7_Ïë6Nt¦jñ}?œ7u)ò÷ê–¢ãKë‚“2ìÃÂK±j>‚L.Åõu*+å€y“Ç;ŸÀÀÀÀÀùv)×™¨õJçõSððRVrõ82¤VNEæˆ^&`™º-)! Y> òÖº×k§çåË¢EÂyÃKs^»—B¢KµvjžüK] ò ò ò ò ò ò ò ò ò ò!—ÍR À À À À À À À Àß ð/›zyÿr°ŽFx>ðj!âX§:¼šx!RÈ€|ÿÈ[±â¥µ{ÁhC*Ó Ú*_ Ð Ð}Gœù…víÓù"‡ Q‚»"dî¢hè9=WÏ@Á\ü ®K±Àüàx‹B8¶ö`‡‹8Q•Ë0óÚ µ†ÿ›:ߨ{!ùÏlj–ŵãæÇ ¼¡BÕ­óY]Š7 •ºHšT”>à>àþÄ_-d*Ö*wÆB|x°ZK÷²%ò\IË?<àþ5ñÉBe¢ÔÍòÁñB¢l˜-24î^ à#å2 2 2 ò= Ñ¢HÄú‡€Æ‹ŒŠä£Øë ¶ÃU¼¨n›ÒÑÀ’Ç‹ºMÀÔ÷ŽE€•®m¶mV¤úŰðJ¤Š¿¦+&§S$q%ʵrXÉÆW2®¯pÀì!lr%ëRd’ûM°TOÕ\!åž«ü«D~Iù5Èi[ì°ºø€ø€ÿ(xt•4®yñã@“«¤ÅcBà†W*ËÔãÈäJ_+™ò7þêJ—`rÊ4u`O­cÍ­ûçÁc€gL®J]©Ó‚þ¿ÒìkÊá¿ÊÚ)Yï ÿÊJß«OÁ¢ße¹ä5hô—…‚ß?R`þ¢€ÿ»ªy¿”<þ]Ý*·öw'mõCaÑZ¯8ôúß"¯pƒ-|ÀÿªxøïÖqÆ¿üGðàÃ&ÿQùZ-e9€ømÁÃÿ´ëÝĵñüï×ÛÓ£iªähš‰ªpʰضÓ|Uêu)ð?lõ´Hdjšb> ¦U[Õ¢ROü#Q¦X™ü…dï(•qÒdÛß±HDÙßúÇÉ ¾Qß•jÔý×Î?ƒ[fý·¿š%©ÈZаì-x³R,—²n³RW{’Ç*N&)r6küÜö»ð¯><Ö)†t+S Ò¿öã¶3ÆòYPxÛ%Ê^ˆ/á'ú[tåðÄ}þ)üu¹êUxªÓÕuSU Ñ[™)¾&÷@“·ŸÀJ¦ö_ö¶]cù½J? Þ¶…–ð(ª§¿Tz’wôqÀûU¬šÜ®Ö_›ªVñ o•Ó™,À@Y‹Ú¾õ¯ç2_éÜ^Èà]©¶/n<7ûíº}X0]D×L47…¸ö¶›îÕ¼’ÍjW™ì‡'óº…«ª®íÎØz—IýHâè²3ûùR´€ÇŠ#KÓöÃv‹/jÑÀI׿ò³hQ˵µUz“¼À%è|5Õ>|M@]Tj߇íÁ¹hó\fb¿õ…Qö4ºJšŽ0»0^ ñÿ°‹­‚˜ б^öWfB¡á&â~cOf°{k¥+·Úžkí*7³u›G ð7µ^KÓQ¶ýЙ!m¸!¶ÍÁ¹hóþ’1l~º—ÆÓ8µó½Ó³N— ÑU›ªÌ±+ ¸{ûÕþ6‰h~d9[6±½¿É¿«eSæÖÆùˆ» ¥þ§y­2•=$`µuÊÞw3´DÓÎüï¿;‚U‹ Íþä™%RgO7T0ƒã*ÖÄ꿪¶Wùiȱ‹¦@;ñH&.\¶h`×l·Ç±.5¨vÏãc0Ž#o攲°7çŠT’ãùm›IØRmœÚe}&²‚?à/ ygÊ(¹ýâësYÉ Ë7ù øãxðNäì1¿¾(’öIæl”‡ð`.ІªÖ±±É*j«ý¹NÛLÕ½¹1/ÉúâR4¯TÊ×6˜5à[Q+ç“Å`ËTÖöÛ¢EœÜÁ#!ÇÓR®Ä']õxf+{ˆ><<*e –Kµ"þ!œƒ+òÃáB¬U]Ó§;MÑÞ•™|Ì;Ò™(åÓă©,oûÛš¦à?šÅcoàÛ‚pP®4ž‚Àá!–Âêú]¹.U‘Ê߉<:ÄÙÿéHÖûþ¥M- QÚ]4ÃcľùGÅA8ª`Õ’£rÏж‰5 ¶ÇÖñ&‚ã¶‚ý“? ŒO`‡æxÞÚ=ž” dê N5Ø *lØŽó8§Ú ‘-Ñ¿”°zïÃ?ëRÞ[;â\(XÞùCrÚÑœ×ö".2¹fѦ¹„ \ÑãÒ(0×›E¬FE`Íœy˜=àæM!ˆ/·)hÑ//‚ÂKÁ24U½Þµ”ªÚ>)t ëvÙmF¯©œ: .2š¦é }L P'Á¡Ú«œÑ výð#’ÒÄ4¾ŠrIöqpªà{% ª¢»±_ÚÚŠ‚ÜÍç``Ÿ”1˜̓Àèªùiü d]ź\Ùë}"ÎE£ÿimfì—,‰aQ”ò†xuÑ¿ÊXjörÆÿ¤-™ ÎðvÁ]éU ø¾YaÚõìÙ@Ï¢\­ÎeS¬|Phq*VÔ]^—:i »¦¢y*ê–Aã…(áÝÔ ƒs2†_­@yØIŽN;¬f«Èp…æDÝï"põðFo‰&™éÌ\'u¸Ä›év‚ Ó—*k™>:yÞ[/\òÏôRGìÊÁ¹€3ìšœk.0:7ؾîsÌÞ`éE¯XG÷à“Y»žŸ¨ ±ê?7]hö8úˆ\&ZÒuñÓ¥5c>çß`$g4 °ØžÇ6v$EIŒ.Âq‘Iù$$XÜ©¼&á–XY'ö)ÐÅ{©ò,lyP2àÐûó1'…]Ž<š‚™¡ž$kr½“‹27~*¶ÌTäšR|¦\ª8¦©¡—üéR–2Óä's¿¬NËZ,Áê­£pZÕ›Ðüv³YKúŠgpaðBy$d¿Hk¢Vž€xsð0îˆÔpŠ’CÕ¤qš[rðú—Pb~›|E]ÖÁÞÀÁ¿ˆ À¢}.ð_ÿêÝÞÑ¿èªäýœ”â+ˆa'ÆÖB §˜,ˆÉ¡ý$šV…*u¦¬¿¾Ñ©âf 'Šø'YWö¦+M2þ4Åt"QÃ\ö@Öăšæk‰óž(ƒu’Ã&.‘…ôaÈÜ LÀµÞÒ5x!sj?s°”gÅž´2W¢¶—2žK0Ž}4—M,WâÛ ÁÞ6-7 ç*ãš÷ûG¼9²ëþtDŽ/î¹Ã6Ιvñ.qG”VÔI¦{{Ü_€×7$”‹|¥>ì}ðãšÔ.7oÁÞ¶#ŽWÓ$XFÖ‘\€°©"0:ÖþÌñ6¢^™Óèï_˜(ýýf¥5U»ºnâlN3 û’Ú”M]&œFÄ®È*âGbXÎ ú ÕúÕÓ^YÓ*Fû£?¥_˜ !µêêØˆÙðTpܹ¤Îù”ÝYx„Aê“xGðtI(åH7•ZÓ¬EB¿æs0ŒFaÝ" ð”m€çh9H’Gø(0Ó Nv2üe[Ô_Bõ,(˜µ Si¹ëß 8V˜8%;ñù€w¬jAê5¹½AÃC–d!†à¯™‡ÂrÉ;þ îíÌz¢§mFŒGű©ƒ5_Ðc?½ÕíKüÛ{‹)õ€œ‰8ƒmjÍ®3ÐÞšÕãž5ñM¢¯¯íwœÁ¹_ÙÍ~"o9’> K¥¬VÄ4~ À;Ç:'ù‰Á¹LõŠDŽÃs Ë’©ÐdrŽ7¨Z'4ÙâÊÑhêZÐG²:¸(I9ûŇ–Ç.ü¹ˆ5 4cÁ…Ą̈­ œƒîL`÷j²ºö‚`–p0’Ó£Ò-¡H¹f»ÈxžÀ–1éL«Aç œò&Ö?9^Á¼”‹ïº€ÙÈ„–²oF‰ Ò‰™"âž•Oý…Œ¨ ùÕäZ¬ØïÙ2zf¶ðaQ—²¨yÌ«+±ÄjÔ5Ig_%ò–¼Úñ†±†þip…¢DÛ¸òóñï*%7¦öaþï;.Öýý¡VkVûóï¶BënIÏ](;-g^ÓO¿Øòˆïùߣy©rC;–¨È‡ÓL—Ú7h(UŸ€N¦¹!/MY´ã]MIÓÑð·üi©*A#´Ë?Mmäˆþ{rÞ<®6ÖÂz ÞfÀgIªáˆ,DˆgbÁLóý0îlv8àìéðTlr¬äõµÌ—‚~&ƒ' ˜hªÄ;ÉXÅÌI¡ŠRfÄ ?•‚ë;ã”ìÖð­Fu˜Ñ8œ‹øç:¯Ha²9¬iªoŒçµ“°ý˜±m4F&mYÃ1~ÛŠXá ÑÞ38Cáv¬ù´‘+¹¤qÆ]äàœŒ½ó¦‚ÍÔ§ßiœë±½ŠMÙãšÄ1_]Ü«R÷ÚZðF…]{ ÃÎ ‡¯¡AÇI‡f솂K©rßXÓÉl}ÉB䕼U$º9ZÄôù,0ŒkO T pbÙ‡ù«ma¥¦#®[¶§Sšc€ï¿“à©ñò_c‚-ÆHü+QÒXÂÇäàX—-uáHÁvMÒ¼;ˆ?­“–Å~¾­™Þöp,Ò÷ä‘þ¸@tÖ€òawü ;I±ãÜ„Êzmò"pðFeK–twèÃs,ÖðjCÐäôÀGX§YŰÂì×ÿRiìi³¯ê—¬µ’ùtÀ‘(‘BÃ>ÿ'%Vû¤Ïü3©4NBØîò>4U½0âOóR’æd0àhÍÈ ⧉þ’–“žÅA~TN •IÚv}.½äò#EÓÔ8ŒŽdMꌓ.ªº$‘ ”hŒu<]uš­õ§Æ¦ü3ÂäèÞ(œn²¦w.t0Ó64÷°ÎJYÅ2§=<‚¸o Àª¯“¿Å4”f}þ£s0ÙûO`àÕ2W"2&ÁùžŠŽ36:Já""’vÜÈ–“: xÇ£×z›‡‹ºlêDq£q?êé<' ~ošÞˆ<š€}hZ5íÇú¯ê# Šs×ì Áø‹%­øø(àÛfED3Í IF3M²V?¦š $ÞÖ—G¢Y›;5/Ÿ M:b¾ö‚‚Œ#ù‘×»‘˜ä$%]È®ˆ-á<có§Aþ 9cìSìJæë„Y_ üçIS&mŽÁ$Cþkcšý°G<:ýì¯w‘ÉҶtÿðõ¥0ò¾¦–Ú!Åm\ö ¡“\g©f\áT¢!EJÀw0•Zr~Žˆ… KÒûÿu%dð^’fKW°Ñ•6rÀšéõæ–Sxß`ó}zd&ŠŠß3Pü"³<+_€_ÅFû^Y`†»á»<2Äœ¥m†* KVHÈÄŸ¥m!-Rhì|IUÕÌÊ&¦ì$*©}\Ñ18*M)H3êHñf=³cx?ß©€­¬•"Çé–ÁŽªK²ë¸ŠLW² ICv΋îŒÂÙÈ]Ä+ÑL°›Â‘ƒ_DžÈÕÚÏ¿P×zôK%ê¤à—êF°CÌb“˜÷3åà\Ô¨Œhg¢sðslÞè¯wlºø6}un8È0%ŚΛr)㪔£wHdì¼>œðNDZM_EÈÊ­æI[Q†ÈãŽîŒS a=‚°Š‰9ñ+§kñR—ª(ƒ…Ójæ-T.ì„ UµÙ’Òò ¬Š¬ú9 [~Àã®JŸ“±îÁ|Ó/g}uÓ{‡Ïý+ð¬a,ŸÊ8ÉwÂ÷(†Ó 3Ø Ub|[=(Ï_–ý=.ŽÛØÖ¡<&E'hA¤Šf¬N›ûŒU}LöÞÂÝÕ‰Ñ[8®S€DÔôÞ‰ÛÏÂwR—rMžXøN­LûŽ]ÞsUÇB‘Æ OC‚¹‰æÔ?Í›vß¿ƒÿid•Ó×z‰u Vã„W¨¹òiUúK ÞïH$$¿„x aÒábx…'k­-ûXÈ)³ÆÇpšëL/Ë–Ó.²éÎXü30°GÛ\O±üˆ>¤è {¸ÐkµL×aèfáÏRØ$‰¾&Fä~4Ú8âä‡FsO–6Õƒì ÷aà£W [Ø0mw΋}"6úC.IØ‹HÁQƒ›¤0€u…Ô=ß‘H+a¥àHsÖ¾¤¢¹P&"9a¦X9ƈÇ".[m¶Þ¼¤¥H>Q«’*·|­„뇑ƒ£æƒ­·¤–K$¢²…Šÿeú:Õ%€’Ï‚*kAbë"®I~à%¤Éf:@,KI>òò’‡³®¡;zLœÌR‰e®1½ÔñL—ðšÍL9Ï|"4ž5¼Ã¢! ·§b‡³6U˜ycèäX­U Vɲ!¦ÂÉ2‡c½ 4¿×ï£osƒ!/¡­•îÙ¬C §5Ç7uŸmÜ@N*œ‡Bü©“ª@ÝÛïµ7XÄÖ°Ñk˜œ¥Ñ¹/zoẴ]´Š>ˆ%IÞ¼B÷\løåȾ8ÓKe­Øè\€vJÙÌ– ‘u€½®§ Á¹ãé‚uŸí|ù—B#@ ]RêÈ=÷N¤ÇYù]xL|'bh’!l ÎEIÊ%Ÿ%"½¯â_çÏAªHĹN¥²3-Ú†œòŽòyalÓ¤X(çô.¹â¾LTQ ÂÑý|©@÷-»1=ÛGØUCП~4^4iì/ã+8ÐùTÌ»jrRÊ=¹jÊ¥Êëù§±1—¢1…˜äbÂ?$A‚æf"%c ÿ‡dJª‘ü&Z»=×!“-±^? ÁŸmùüÌ`›‡d«ÞÁÁÈÇoà_enŒg “3ÙÄÈe@™Ö¢¦p iFýDÈüd¡×¶>?4•NÔ<ŽÐ@sL>"v‘7é_ˆô³d½3/ …`î–HaB1+NÅûRÈhÖ ’ŽT°2ü»œ;q€è GÝ^kMÎ!0uHäëˉÁY ^.éœ,Ðá‹Í¨k6>ÿ!’Ô­ýø ØáLå¹Èœ¦|œ˜,ë%xZ)IÔ0é`FJßÀ÷[‘¬×L¡ñ9ÄB)C¬Òß¹ec½`Ì=±Š"ø†R]³Q¿ÇòoÇF<½ßrA°ÇE3wÕm8Ã@9å£:éu47õyòÙ+ݶ‹%¸.â;‘½EǪ‘ó¨H»º€~_ü. ÍhþÝã-@ÙÁÀXˇÄp¦°œúÕYÇ÷7†¾¤äB]ƒ,÷JÃéÚ¡ÆÛ‡ ±š”¶Tt4MÉÐ%.ùSŒnZî2Ûõ©›û•åàH;cRškJQ†cG+Êúû€¬xð;“ƒ0ÕŸð N…X[Z³ð´-*žvÿ$$2Éz6Òi«áù³i@å×¢óZY3…¶Ôç*o¨þ @ˆN^ÞÒ<ÊÈP+—‰ f6£¢mLrê»P¸…ÍÌÇ‘Wó ’Üzý}M÷¤ëލ@Øò™ ޹b€‡s¯hÑ›ìŠuª&38¯+g Êø$Ò±§ý“Ô˜¥¥qåèäe6gü™gœïÞ¤× MBŸ ™‰8xM>Mδ¬`…•Týù碭¥­-z®u5U´(jΑ‡De$RòäpcHó7ÕQ°X‹ÿåD¤QHXG4ú*£Ü¬áTŽŒvöN—ÚÇ‘kÖ¶ì’dd,¤™·d½X¿Ü‰ºjlØsx…ìºÉÎN 5®®:’³GACúÔͱ³•ÅýÅÑÒnܼ•«VWt"¶ˆë6e¤¼þ[UÒªXWF’ Z÷ór¢?7Â2kÌTE³–/!gñtæ‚ïö¹š¯Œùo›¥róÏ`Rž…«fÉùå]ÀÿwgÖ÷Ï,•º/³ûÚÒøÉÕWŒÈуOÔ‰­(xTìë˜i“>üFc¸/!ù§8l3ÿjrpñOpô.)I’eXg¤ÊѿҷšŒwed åAø\À? AÁ/`¬)ùM™YŠnø‚lYÊš~ãsñ™X7yÜð¤!ø4Kdh ±¹nHÑ{x~’b¼=? âOs aöR2ö Ôlf–¶È”^_0äRÙq ãíá<Õw¦ž“•þ^•pºT¨^I‚j‹¦K°/X´ÇŸbS¥Í®~m9¹Å³Öš©{ oj&ˆý"|§n(/¼#7¹6¶c*ÿÄIjŒ»“…5y%ü°ûÍrg.˜?…½I£¦ŽÒlšÍtœÿp¢šé¡­¥Œ¦¹ \V±í|CÝ–©—’Ãi‘ò_8œ–ðr—"fS‰÷£ 4b…"¥ ™–k\öŒƒ¯)õ{±â#ƒ)˜M™¢OóG<µ“>$˜™¥ßRˆŒ *R˜36N›Ö˜&¡ë™í ªÃiƒcrãRQR´×*›‚oÂhÚ "M 䜵ó—p¼ÒM"ˆ•„HŽºÜ>b@à5ØZ­#¬%e] G¾E¶âyræŸÌ¹ž©•åâRt”ʼóžíÇqü†ýFS[Í©£7£()ÿ|»g\ÛQ©°ÅëO@¢£¦HpÀ-éøš‰˜˜Ž΄LeEøÁLPVç  ùŠ%µ?t#Ùé(($ì%ÊË+VMóI¢1VÂþëÏdJÕŽ+˜'M)à›ª$’உÉf2Å»F -©J󱙸rÒvÂ'J±Oì:ÿÏñ’Ÿ†÷Ñ6É¿šÁÆÄÂ3žÌ…66 Ë­ûûV¹3Êͼ™*+Rú#ˆÑLc hJ[—p¼4æ8^n…£o(ÇÂÀ¶Ÿü©–aKNN¼ ÄŠX4%obü}“Ö¬ÂÚŸáà?â~ÿ`òá Yÿ·k6{˜qñ˜Ñ&/ëy öå²ÞÙ½àÈ€ÕW“ü7ÔüYƒnÓƒòèX¾œ‹Ü:žÖ.K•3·öؘ†d.<:´¢D¨ÇªR„|ýå+PŽÄ¸<Ö8 „kŽ›%­„ñÛŒN·ô·ÅöÈÞIŒœ£b¿¨{± h5ÿø$m1æO=©ÑIF|§KáIi:Bmý *lª kIó2ßVÍl:<ÇŒÄföÑ (Ó÷½¹œ¸ºÕ&[€EDOꤡÏÊõ=^ ñNCk÷€ø[ëìñÆÅÑE¦r?&MÞ`óNœ°Þ³ðM &½¤øN…©ÅY=‚x§âžf N ÷Ÿýü&A¿œ‚Ÿ òj] 2ã89ùiI£\ˆ÷ŠÖ)ž–HD´ÔiS;5€£Ó– tˆÞ 7¸ñ4É!pè'¹Â`/Õé~‡=Y¶9 º¾ÅØo 1õ01ZkVsþ8PÐQoÐiU²#x¶Kj?ÊÔ=Üc†^±Y¼d‹Î¢·éV܈üÖ À À À À ÀÆoUVkÒ_-z‹³_xçÿÛ†MMŸ¼5±5ËŒ¾E¢l¼`4ëoÛÂÌã´A•O†à*ÃÎÆG{ÿ'uÒbˆ¦ìóÿ¿¬”ƆsüBº¿ à¡ E_vð‹ŽenùJ~wÛ¶ê9"0©jeéç?ü×/·½ÿùËò°~v" BféI|õÒõï‘åš¶Ïÿ*h­Ûè׆´rÉûµOY~qô[*ª$ï·TÒÉ~Ÿ)æ÷6´ö››Â;÷30ï Û¸-M7£3±vzz€XLrðÏ0bégÂ’Â7VÆ·owŒ Û“ŠSÀ0›«ÄC\é-ÿïXØ~µ%ÿUv¿@,’%Ô^.0؇…†£&â™H­hÕÒ.rx&±Ô}ÍߨÎèk¶ÍmúÇÛZp„4nΔXöáTÓe¡V†5Ó>rµfÕ{/€Šo óè™^“1Ég¸viZp™œaµóJ–T¥bc¾°œµ ùÐi )‡gÝœæ‰Ú}hJG’„çb%Ö‚Öªbuâ¹È[ªäÎEi üqí\ vseli¾$Ô5‹ñÂR%³xçê†Æ`¿‘+|T¬jâ\ç2Çé‚ýAxŽ1XÂb”¥x¢œ7éš¾]ÿ¼ÉsRöï75­”ââOïäûþr‘WF™%ÙÿÚ;YÕdtðNáœbJG«k¸E}ä],SÂ!4îzÐÞ²‰› 6Òê‚‘ˆ")[SdKR÷`ÞE•‘ÔÔø¶³Ê¿À²[pyQ;ñuœÉ s¬0bý×ÞçeØ0‡K½Ö¶"Íãë•ý@†÷Cú$á7õRÛÂø•R¬Û\èËãÇ:mW„Ã1lŠ•~Í%ykIáËDØf|!ÄCäþ!©…FWUÖ-ù¶’ó*óD¬sA¬§yÒf‚¿©`®b6J=0$A´·çK>·&É®±‘LÎ\µfÜ2Oƒ‚²,4€©€ìŸ]*ì`Wœ …ìeÔÃH4ÓÊ]å;P€Mm›†_ÁŒ•Ñœ²ÀJ×9œƒ•N^|0¯Ì2!¿âἂÍÏ×åuZ»¹¼çâÞt<}O¾IL÷}â€Qê5­†ž×¢ÌlgådÌ>«‡ä±‘ùŽ æMÊ ˆ§m‰-6äI>(éb_n2µ´öý2ä#“K$W”ܨŠ,ðÍÛ²†=Pp™èëÂwƒK0Ä{ççR§+Kñ,1¸l¸};Zˆ”С"ó'ð¼hªŠÖË}'Òƒ¤¤4™Ç:JM¢%|ÉKZ]CË{Û3êÓás°¼[»ƒ8ˆƒøˆ‰ÝÜ Òø'ØÞ“Н ø4¹´‡ôB¥ŒI`¡2Rà³Pyœ Bœ-ÐÏçVè")'¢ñ `W¶žè¥åÊ}|Ó[h3îñSÄpQ¨ÎŸî8@J'Ü´¨¥BÒ–Ê[HÊÀK¨;rGÆ!ØA¤Ù¬ChnÈ-9»¨¿ o'gå$“nG7íо0¨á¾$áNèÆ„q[t/8^´94¢NèïbÁÈíyWŒ%ësáÒX² Á³_ò2@)>ˆx`¾[ êèi©²Ûš1BkAü͉A3 €Y´ô¯ÀÎm‘«6+¥4¿ÂogTŸ„lf#²fâ!ª°G­Ä‡þ)•]åøöz_’?3ÄŠvÀâç Jºh:@¿×úõþï2gñ߱ζ"^΄¿ãDìJÊeD6³•Kö1Æèwˆú»Ê“­ÌêWŒ‡Á•ÃßU]‹Mtþ! ß¹¢¤å΋ÑÚÌp#þ¡õŠñÂ{4)™“ý{§¡Þÿ·dÓ<¼ÿ£ijyüøuÃçɵeåt%íBþ Âå“å‡9œïíR—K!†DJ }7q©}ÓŽnÙ›]9<2šÆf!¼#QÃÿôv×Q)ïÜ( v}æ-˜§„´I¯YäÙPG³ðö.Á#¸ÕémCÖÈ›58\T|×b`h8ПŠ4û-bÖ'§_У™.ó‡%b'zSI[kž%Ó®™ÄêÚiZ “;îÓã)8±"+*Ll°ÃY"2!Klß$SSgÓc¤$æßtš’8Ð ËÞq³J-Dp'ò–œÇ/üªoÕ‡@oßr T ü’@h²ÀôBvžÈ•"„“]ª’6µ=2#âÅ^é`A>ø²B´8âVÝ>_%–+³°ƒ+XT1)Îò 7)–™™‘\òA¹£K²'Ð4E…SÛ¢Í)\ÁÇ­¶[3_7Ä´››T™“'Ô{E+OŽJZ³ÌD‹)*r:ŽÕÃr8Ã8çÑhÀµµš År©B;…9Ѧ}WZ¾ãÉ)ÆcË3!ΚëëþRqæx-GE¹²IÆãwR Ó½iMƒ}˜ùìµmŽý˜ò…¡ƒ™(å‡Aø{pž,éˆŠÐØš|ÎUK• R1FªÈ§ƒY[Ö°ƒ©ÎÁ*ûb»,^#c˜Æ4{ä¦fÀ€ ÈÓ‘ÉI*`™²D[±3€O=l©¶ö[‰Q'²2‚](<;c]ŠŒ˜¨\©:wè\®EÊ[ w¡ð)£&ïw†øéµ,‰§ìȯ¶m{\µþ÷§—›ˆ/B6×2F#Œí-ìµ2#Oû73ßùÎúlÈ»l2†CŸáøÂ“+°#j§i/h CœíYýpÀ<4Ò¡ŠIõ’šŽÜk p^sA\`<+UîNéC¶^2ë&2“üxÖw y‹T“IêŽw†Ö¯zð5™Žx‚Õô­åêÝ^ÍÚTáÃÂo±OþÀÞ £ßø˜X$Ò&3J¹ üÙ¨Šó»€?]cLÔÇ=.8Ço߯t‡D‡ÚèÌàÍrå«Ó›–˦&KãdE¦÷¤ûe¤h†Ü)+U‘¼3£[°RçhÜUެÀ˜èÙ«\,¸¨˜ˆû€i!“Ác4.kž¼Þ†àÂb!ÉlìCÌtËE´9Éo8 ¬$“>\„u¤Ö-)¹90ÜÓß§ )óšÈÃSѤø-ò›H3f œÑ *lø^huúC‚3U±éÙ£3ZG៵8óÕª}Ã¥Bîtð.JJ1^|hͶ#qNYæ²¶ ÁGQ44ºàÐh:gÄFs8Ý,‡„©)ã»}Àì[bá¢(e¾¦L⋺Eòƒ‡Ã+Ó!Rë˜v…W8­Y=ü.Lqiùaï?2×¶læ°«¥qGÁÚйΠ€ÏG eàÏ…,ï~ý®°E›¯7­3ÏÅü“’SO-tšUtîñø¤lái`½®Í }#ÌGOÛIËŸ-O…žü¨r4ÕJãÐï~õަ¬WK-I`Z`DÇoÒJ4„™¶Íh3­š}5¤Ø5Íóƒû±™bŽ ÝnªY*XÉ÷Çh–c{Li”^ÒqŒÜ6 ΰ¿úVª¾úx4cÏv^TÚdñ©®í‡îàB߂ޱ¢üF`{wÓ{Ä À‹áɇXKÊ¿äŸÊ”µƒü ÑÄ¿ Ã,õT&Q [qõ½Þ9ÜW¢·½9ãó¼\ ÿCFZ]¸ôvis#sI™Áê™™[JB¶‚$5£…\Šª¦ý!ra¤Š´}švp€éL;lܶ~à“%¬GÇ&tÖ!… G–î¢ã„߈%ãøräCì’ÂKÕ˲%ÅQªNœ0ãW‡¼ÿi°aë¯+b#§[OóFU6û­€w"g+Â4oÊ´µ1±7¸ÎrA HuUéŒ-¯}ØdŽ6–›x[ù†23?ÀndÕ¥¡í}ØdŠB]–‰\“ð~ŽAË„†‹ß49-%ââdž´`†ñ÷çcå´-¿9’)ëuÜü™È±@ÇÊh…ÒÖžRÜ]7„µÑ?–¨iHÛx6j5:¡¼ÞÌÚš7¢ÔöŽÓvÂÃä:μX;æý;—£LIn¿:4Þ@4`ºóÞŠ”,߃·ÄÝcâºÆX'åßÅ¢wr‰-­¤­É»Èå5¥Þeao!–¢~H q‚ÃLIp7¹_òw’p~º}¶Ô;Ñ€lô»n)½¶Äú¶¶ ‘y–\<“xÑX¡aßÁ6ˆtÜòV§O•'GM|¶öŠfÌö‚Þ)¬.B»ó¨u,àÌüT(Xĺqz »×¯mHïàR-ûj«¯%x§MNØÈ1ÄÝh «ëv)0dh'•Ûe96»ØÅQ)¦ãSëÇœŽN¬“_àvÖöÆ_/ РuÝ ì¦·‰£ xhŒ(KSÞG5œàâ\æg‚ži©¦îâ#¢ÿö2=¿±<ÞȬ*{Ã4ÂîÒÿ™ûH è±l(-â£bð¶]a`„Hõ±’iAÓ÷OÃF'ØÛ«üj~*¼ïÅ^Á»¨k¹àbô;öÚV”e4ž•¦Ï7vzá¤ñèTIÿ=@8äJ<¿í¾ÃB‚®Ößþå&ãÁÿrÞ~`T*“…L%VMW$¸¡H‰óϺ#™¾„¯yÓ*nI)ß[$q S@þÞÀx¶ {*•`ËÒ£ùÕy%Wë;E†nv£³²LS =è]àð$ƤSûýuÑÉ©á°çÚ Ì3&`£¥ðTmÃô)©LWIKµÄ±Ã®—Ûy}ƒvu9$Œƒ®Îº¥§Ö¼M)Œ˜ ?¶VF°À³#ì_xÕld@t%>(¾œ÷@þx¬k8~—l=ʰãŸðɉ25| ¹‚ÇÄK¥¸÷»ƒüBº|'¨õ»:Dªö÷€cœÍ”óaZ`w#¥ t=5í}\O±>K>$‰%ÉÛ<.úGz)h‡>òþ®hÓ÷ 59ž,"Ÿ”²˜1ñ·ì1:•ªUÆ×gCÁ)rÓ‘’®ˆÞJ< èò8ì »À–¤ýô‹µùþ·MHÿ‰gš4$/u®iÎóÉ’÷NÑÀÞ¥Îë=Ž ÇÂæ1™$.Y+v|…CºyGÈ>Ì¿Rk:VÇG:}yÿ,™ÒØàº‡HØAËš.Ù°ÏÓî8úïð—]õ¬íKzS6ì$û^ï×f rµ_ .@ d%®Å1Þd·¿ŒtÖÜ[îX.á Î\;âä­h2áÌ}Ø oe¦ÖDYGhõ¬uVØD4]ÉÌØ§K (­q÷˜„Tä©qÉÑ#édÑO”:V­X—ýsëºüGïdaGs)z'ïp*3ͱ\”`eÂ&ÓáŸ` ¯ßsX(·™¯îÞœý#†F¤!pÀmŠãIɆ}X0Wu[ŠÜp“ë mØsLv–N›È§cþV cÆirDßÎÛ8wøxÄœEŽs;é$´Aú¸ä/DÝ”vf¹+G‹¸1Ö à÷}BÁ¶@I™Œ^ˆE²‰¨õC1\µ~#Ñ̤[é€ÐŒó¯Í6-]É&¦þÿ3åÑUBfÉ~ Iå6¦Î¥ƒßUmÙuŸ&ÿQ÷ ‰57Lƒ k”ÿ,š¦•|!è`šÛn¢É‘Ti'™’V¡5pŒ¤bðØh­C8ƒ·!hª´C2M”Ÿ„D8Àä˜[ñu àùÁi¹‡ D¤&­žul©Kì»´±¢·Íµ4Y^낯ÈÞþèL4$ïÍ$ïŒÍûþ¨ˆ„Ö›Ru%4É?娑íGäðx¡en§Í¼29—HÙËšœëV1ƒwàÑ›ø8€®^‚ `²ŸÊ4ºˆµ#|u ŒÕê“$z“ùf‚!=ïÿÙ F‰wwè%R¡Tv”O°—Y\—}ò22,;ŒŽd|$JŒ$1fâPnw ãH‰È-k5:8…Ýc ءĤ:“q['Ö\Ÿ.9a¦KÊ# ;zr¾G)˜‚ÕŶ¦1x_v&ËÁ4n„Üž3Æeò¦&Gû€8Þ”ª‚ãIl‰§aþôúZçvŸyÓ5¶8ôÆë4]ª{r§éÊÆ¦©ü@þS"Öª¿‡´­/[œf°®sãÁÑÐp)Ĝ FL)C«-ÒÖ–Òý&Lºçßhڤ⥓ ARúêÉÀÁ”ÔAF]{-o<˜Š BÒVõ4q<5-‡œáãéöÓ3Îî§bá´*ÌDn’‘z$Bª+žúúPh 5eñ/ŒxS˜E ¤ºM ¡ß«iƒ\ˆU-Á8 ì·Ó[]æÒ&µŽM#0É©¦{$šøú²®àjäSåèùxá@&ÍG¥‰ç±(ýœõkøÚ‡¹Ã*ðD楖Äq?8jèX!+‘äš÷@˜óRàÎé>ºÙeÁh`ãÓ±Ax€>ì&H“_ f"ß™ÔmÆl`µ¡¤9Îm±&¹ ø3+2H†«)36BR3£™¨ª¤p&s\±ÖmÛE6šH2Y?†M6X ë×î! žñ%²ÊíTWÌrÓRŠŒù3±`†-ø÷„‰ñ£@43#j«Øº¾3˲¿O4 KþêüYªjM‚ô3-S^Xè¶žÙu<Þˆ, 9Óù½¨iõ‘.„"Ö¯fº”x1Ü|~öq¬/ ‹Ýn]mIÃÂfÅ$$eÉ_1DŽ"AÓ?"wLèG³&M¥]Ym̆~3ã¡Ö´Sî³h†Û‰×ìBÞŒmº/'Ç"]Ê’¤V¿ ppL˜s>[ˆŽE³-GC8«‡ŽvûLytŒÜ6½<–UÆ‹Bá“]þ€w¬h]'ˆ1–mõ)ò»”n!€mÖÇMAÔ„yÝ}­Û¾¥ÉÁ±.Û˜²g~—²9FìKü¥Ò™ˆü*â6ìࣀÿ›®1ñðTytªjÝg(Φôì ð98“z©K[ë 야¨ØAðÎTÁSàTŸiœéÊ{Ø÷`ÁŽÂ“é·Úqð¿½à5àíâSÄ „$©æ§ ãsÜPE­ˆ C`vöǹ ¶‚.W*kýr²Zj’?<‡“1…¥IjBƒ FîW¦Ž&8G…ºÕFç*ÓÕ_WòÏUIÍ W7q“?Eš¼“Z€¹ÁX¨z'-ÏH7-ŒÖ\$wÖ ¿0ô$‘øý#£ ª¿„ä]”‰4¿ âà½"µÛáEíX˜Á¾Mà¡Ë¿0Gz²>'f„¬“ HÈVæ¢I ™¯×²{@Œ@¬¤fó¹w¡`5P©È2KÐÑ»ÓÉ{RÛëRqM®+œ«¢æµŠû³AûÃv®ìƇ…ù!;•)[+ûÑ`k.%„Šþ,|Quäp^^§ÙPØNâ:“£ùÎPábæÏ6Æ9˜#+enS_/EÜu¶È—DüK»…ê.Åuþ$)¼LZ4Œ«ÏD¼KXm¤)®ãPaKð`AÊ,?[ðH”CØ—dµ$]Ž®<^€÷gÃÞBå+[+î-2ØÒöŽ £H’t¡ia¹#úHÌCX½EA§Ÿ#F‹Ú}’HÓ¤ó5^¶« ™»ð’*°\{] ÄT.kL˜¹BN``/x°hlº*XÜÁù~¤½å;¸eÒ[û™rp…eVk‘n‹ÖFWØåÖ‡w®ŒE=ð¯d™ ›rå9áR¥ú:öý^kâ‡}# ì&ЦÚOBp¢@‘ªŠY8Ï*‘4¬é¿«ø³{ðßÖù3ÿwU®½¦FØ>Û›ÆX’:øOKrZT8ì /Sù^6¶±gb*#wÀ¦”î'_™lBéâ¯Lí…z"|ØÍÏt¿{–è|Uî|3Öß †½ÄM¹_úï®ËeÝî<ßWÇ*NÅjç†qR§¨vŸÚ6ä¼.¾î‚ízçmøg?¶|xf(”œ»Â.eN„81ˆûDL´È}—ç8Áý Úý ¸G 3“¦~œ‚À~w/в‰¥C—!>¸›êéü‚p&Â]5÷jéü–÷ÔÈ6'ë>»ó¯ºtø¾>4>Å7@2{›b?8Ž–Y“bë§b¨]rFè‰û{ÁêÌž%ÝÒ»Q`|n.œMÙ‡½Þôâtãܨ!†tà„ëp@~Ô†2Âpó$iÜýhJ±W£R läÁTÄ Ý» eve¬[)—Š4ío¦Rª¬7Ø%Ì[’Ÿœ Kçð²Z"q[F…«&Uý¹û©’ÿGSftàęʤµûgL°Ô}`oåRò¹}ÞÛfMRHŽ8þý(E¶œñŒ|ãË þ¹¬è0èW¼2Ñ¢%ÃŒ±1’î¶¿ ¸}öÀÇï¨Héè–£ ØV‘ª¼pël²Ó÷NMÏ=P€ZM‚íŸý4µ±óñ¼}™/Ñ¢êo~&s{δèÿ"@6Ž{JYþ|à§wöûžòïɼ”UŠÕZÚè½ w¦ÙLîsU—ð=q_Ìê#")Ÿs¡œ½Ïm½Í—"IÃùh÷@8Z3u8ƒ~D,œ®whö\d4ÍZZÈ‹¦-5†6“" Ê¡³’:Ñò,2åX,:‡…rÈJö@Hæ Öãÿw„gúƒÓ¼ˆsÈ€§ X€œè„¤6h7ÚpФ*²+U×OßÿÙg‚þ¬Œ’ù—1.ÖÔ‰3óhó œ>]~Û²$¡«ÈáYsV¨Éð)ÈØ0>¯‘;ÕžˆÓŒU£f hû—•‡¾"Ûî­ÒN[ìä Ì™Ò1¹÷‚°Á"#º™‰£w’xIQ×cN¤àŒÄÒx·)Þ+ùçb ž¯úV2ú8¥™Uª< –ð1Šà-Âè]ÚËlkÀG»?„µ# tÔ´ý·žŠ´Hs·šöhÒòM…ûÃ}Øè­¢Î“‚sìyY#\™X¬IcŒñ¬á¾m¯òhüNÉ•Ìï:jî²­*~)“¸I™0l³4¶þD°#)`߈œ“¢"ÀéÒL[É?Q>˜¦1éOA·'CÚÃrÛ²}ÛlS$±èOÖ–äG¹ äÅ_Ñêï# ŽD?4¦ëëL߃ÁâªkJ ¿€Ïv 7MÉogJæ×\ëDZûO8-ÚO3kÃ=åßðXŬdnf:€HÙ1ܺmæy–xpÜÀ†Ü'XÕÌæh¾id‰³3òÊ‚SÐô-™Ž;:-¥-,ù’wÚˆû†ó6f°‹&S}Ÿ…fÀÒ<÷¦"î` ‡<ó{|Jñ˜¬–ªŠ‰•ðmåè78Š›UI‡Ûü†{#•õýM¿'¿‚Ò·*¾!žŸ{°¶Gyp&îà‹lZ!2Áϼ%Þ f užΩ¢yP@ó°‘An齘I6Ûó\°Òs™&ôeìÈdõ€"é*Æ{SoŽ®.©m·4âñ’¢Lk¢³çà‹XîÇ]„˜© ¬†¡µN㮤ÍhŠØ`î §aÁÜÐFV´©@.åsˆT0Úç8ÑMM–çO µú’ÿŽºÙ‚˜ÁfœFöt \ªd/ÀpÙÇlÎ×ç£+,ÇêÿóU"5=Ëý+¾a_úÁÍÐ}‚0ÙNõbs'®°:öZÖöÝ1$øC¤5¥Róÿ€'rC*9øCá¼âÿÍLñšüR²›a|œínù¥2Áäì{aÎ16n;k¸œãH>aÇbÃæ-iðòcr4Í×ÊØ¨d<¬EbY¢Œ×%!±2ú¼öÙÎK$ɧʻ¬yÖÏ”ÇÿA%òÊž,»7˜]e¸éeΣ%þµ€+ƒ»ƒÄ‹wÎ_3sI3]Æ„½ò4/S2ÊÐG.ÆmÅåh#ÓHÄ‘Œ } ‹±¥‚dlž,y U„¡c`“d‘`‰íÔ•Ø FØÃ/—RÒÞån%¡|Ãd9qm8Vk$$Ãnö‰B%\_ñÎuSªRí'¦c‹Ø­qQ-%Q/Ÿ+.*ÌeRpá(DÿâCK󕮢«¤+NÀÎphì1@'Ö‚pzîüyJ~G »ŠzÒ–;ºL¤§Ã%o!Ö$„šB†’rù,”é’§ÚÿI¿Ð:K¿”.jôÙV´#š÷¤ª/¼RKÌõÛ3èË!£+cè÷JÞ•.´u7q†qãÐÇ‚Ræ°:åƒÀhºN…z’„”E}Ñ…7“«ÒRcÇm…c„ˆácÀèÜi{Hã·RenþáħøŸFÝ’àI¸X°Ag.0/«+ÒîW±n3ëL›ú”„8¼«¦¤“¢dY ’ƒÐqLêï_+]ź”άÃÐŒ]\‚Q(D|@*i'ÃtE{1ÿ½`tŽ< Ntcܨ'¢ËD8­FÑÂÐîÁ`;²X|QßIJÞýøLe;ã8¦ Ü–eËÒF.³<ŠZê’MWÞ@ìï65Iž š£¨2³ÁIõ\¼ëÓÉ;iKþåx ÷kš¦x>€L÷1{fçùk¿Þ߸™Ê8Zµ^šáÄ”ÄåªËº´•­ëö޲yóöQ߆<žWØ„gºHúG5C…¸V8¦±§6ŒŒ»ÛF¿©¥eò~L ñTNF<‰`•¯³ò Wð Ešc·…¯»±ó¯JIÃÂþ¿p*áÓ0!ô˜†ËU„2äÜÖäDç­vªFç-h¾~Åáð 8öœðÄ^4z KæZÉ”ìÃ'A¿å„¹‰ ^ ªù¯ `” Þ©|H§Mª³¶$¾Ô‘͵& $ц “TM0úUlfT߈펺O”M7ãÛ.R$À[¶!£›ƒY"ۜΗ¥šÎÙ<åõwŽe,œLÃI›+¶9¿yñN:»oEs W„¿Ñ‘â¿5ù½uŸLb›¯ÍŸÎ¢£D™*iý­§°]¯õA «OCÞÁSÔÓd¤Å÷$ÍS²³½yÅè_¹ž@ì>G—*'½&à‰æ¬ óEtBæ6‡KsYÝ”SëÞò£òČԼu íöbv€èw¤Ü—›œî»Ðøßøúø_n0>×tœ4YÛÇÏ;gbtLI8Û~bšÊÚúÕÞ[8­HÀáQñ°Ýä6뙨MU¼{†u"«Øß…À ̱՜º³.2žo‰‹©ˆ:«Aþ•óWFf~c€³NÙ€êN#õ|„Å5‰¾ë†"8 *íɧ½é’f*ƒ#-Ë„¤°±­ å8\ ÎáßKE&À<øé%ô|èßÞ\U¬t‡‰¦Ç»c_±£eü#QšµÎð»{˜·ÿõÎl$í=/-ÿ®bÊØ«–Kœä©œ=uÊ&?.‚7ޤÿ•=-.È·Šà]4%aaøjb7áÖñræè²Á~#9‘Äþõçü™N.±\¹‘É…hnÅššÒp¸5 VÒX¬¬ùïM.à .»Îw»}§à‘é”p›M‹šåSÁÿdœªXÒ—¦¬ˆî§‹´/à=DÂ4’رàý[e´ x–lÊüí±ð$r%8]t vêàçʿ¢£]€Ï”ƒ3µnh®Ô/1'õŒ £$Éy¦¹^Ó &ã‰Ê:Á9”üéKÞ›&NHÙש°…á[\4àÿÚðA® î·º¾&ñ-]P¿í¬YÝ©õƒrpõ½4…òXSIZ˜'›>(¹ÈÛ6C3â#¦õŠ;ˆoÄ»Åè´âìâE N £µµÄoÛþþÿ5ÝýW8WOOA>jÒ¥³lÀìy˜7+ZƆ5Ç”§òS·LÊ”?&›à5Ozàp'G÷aí¥)=$a_€ªÏàZê:¥ƒ’^Vþg—DëŽDÞ3oh Ø]g Ø ¦i2• 𺦟ÛÁF&AÞkGÓˆÆý Ãè,gØVˆ’²6ÃO•øþè@…°–…þ=D–â1˜a¾pýîTƒÆü¿0žuQuÏM<‚E³FÕ©hîÉ 6¼°/6àã`¢ò†Ì»z\ŽfX%ãl“¶(U!iÔóû…Êó• pÖ‚íXÒñ¹Ç"FNJºx÷aÁ±T¥$!ìøè0‹ùFȆKƒ½êÀRE©ù•ÀJ&zny]ݼØ/Â_¬Ú [>Ø |¬Ì±&¬Œ§qùéXY^òoø¦„è÷<*ŽUC¢ÒÇ`d[ÿÀÃãRVUJ+‰ŽAy¯H$xtB„'iʉ؞‚LNR,QÀ¹î“þMÀ×äo>Õ±æçØB@µÙ§!¦Š¦c²B™Àn‹´ P{‰m~€`ËžSj4×eÑu&(%-Ž©¨2K¤¤K—6óéìc7µóD,Â_X=”‚¢=P7 ˜œÕAíš‹F—‰aƒ ÃU.õªTë†8†‡ Çõ }ÝûÑh!ÊØ9¿°yHlîcòÄ0?9éìlùꊺZ®\ÚwíxKþB/K¢->W…Œohó^D9öË !ÁV§F¿|´/o¾´D_re¾3ì:»M™KMçÏ.š•«Mઅ±õM® ë\ÁѪ%1ºdåá¼U Óÿ*Á¢L«µQn3eÉož‚Ò±•& ÆW÷àíþ•†[ãe²È4†D®ù‡gƒÈ¶2¢>Ÿ}…ƒ-YÏȤƒIú{CãwAù[£ßËv%Ö÷-óèÃ{y§àÿ~á?C‡ÞdóÁŽ+{\ŒþZÜ™°05A¥þåt󨧹ƒxG¢¬«'ŠþQ'¤ñ¥åp†FÒT¾ÿ<$˜™^Ë˸`þ{Õr–à¤çƒ]}ÀÌ6'”fT´Sއ­>YÑ’À¼)†ç¡è‹R/Ù=~¯8"«Í¬j€~)œjìÄ_È–†-pže³´¡àE &äVz5Ã;ÛštÛÒc‚’x€PJˆï S»˜¡–àÝ3/Ž‹ IéÑ?;ø}ÌÏ;ýèë‰UÖØ#6œÆí#ÒÜô‘àÈõ²Œ.>bþ­¤Ð¸s”½Ö;J[t}µÀ¢ÖL¤nà›Rb6˜”*~2äÏÑ#­wyZ®± Òù%ȵCi3¬×[‘÷øÝþ©Ã ð¶Å,xl}dž‰µµt碷²üÚb´’ÔÿiTΆ…Li®œKу,1ýxx¤±ªHªwS¼ˆ¿bSÈÈ~‚aµ½®s½BÖýbdH_n8U¥®SË3 #þ•ˆi¯ÖøªìøÍÈkÙ‡!'qjž%vS×üè Å0XB;æ²ÄYþWÓb¯Í F1=º`)Ó¶ÈUO@¼Y*I=ÉÁIc{|Pæ÷”ÓõJè\,{Î( íÎØ|aì§9q:çfX²u«OšœèÕƒsqOTFç·†ÀÎÇž(K ñ€7ÅÆ\ËVu$@4$ÔòQ` ¯ÔøÆlDë.žšÈ•² å›"¾¡Ü @Î¥Ê)Kh—=â-¦ô¹Ð?;¶©bç?ø C´ìZ:_q†p Æ"Ö¤”ô¾S”3*ðÛâÐSHI¹›75ÆñßEOÍLo*Âø0oZ²œ'ãæFÁ•¡ !76&Ûƒè ¿Qý¸ò‘èÉs‘Ör ƒÝýçx‹û¥èÜ´“Ð%<é²-ãÉ«”è~ð†c79o’Ôñ«÷aþ;Ó{ž>$OÞI¼œâš¶Ä¾SE±s°M.Rµv5èÁEÚÚtöEÙöF‰7G*+Zoò#Š%¯ÁÅh.ªB0ºF¿ƒ~94Ž”n?R :Fm2—e©p¸.þ«±_‘$&ç ,"Ò:OàÀÈ”èLºîDg3<DÞh¥—lôñÍ{ôþy8×2V»×…˜ãxòjX<ýéÙe‰~ÛE6™â*ƘLÏk•:‡o4oâØ81V ]Š•5ƒË¤­Ùñ|©%k™¾lÁQêfp<†دÆH±? ü´°wåã¿©®ÁÞ³{W­x fy:b°HÔRÔt¶§±÷DeY©º\'äûýE¡ru-û^—…,5é¤ÜApú™Ê±;ÎNUZÔªø2ÂØü•? cÃÇu‰µÈûcÝÒ«–Cï(¯tYÊ–›H´ÏúŸ@®„Õ—øÆ2 r­â§Ëÿâ }Gþ?MÅÆ*‹¸l©4w'mí"þ^¶ '¤#{³Ë ûcA…´QÊ3Œ;g"g¤18}»Rì¸ê¦]Ù‘*.àƒƒ—Òü.šË”ŒÂüÞnçƒSõ‚BðKÁá™Èש¦!ö3§[á`ïâƒ}°©d!­=È É–˜òÀ ¾ŽþiŸkx’ù'‰þySŠ”8ƒ–]‹ôï*ƒÞ…E½ýnÚ ïrü`8Á\Í` ú' XŒ‡y>ò‘ùµŽ¤º²wÐCS~_BÖØ§!+Ž Y4¯^ÝÓ¢Ÿ‡ßjR2ü=XúCŸ¼ÁòUÒ»NJÊÅÊZú®l¬x8¸L$š¬?ù_V/›¢”qBx¦`NÑ6s†R»yðþu ¦‰­¥0xÌeYSg`ãxJ;2ÖŸ¦"¯2õ<™V1ŽÕÈÀ §AOÌÏ›Ùó$ñŽôöj¸ÌÊ›efÛVnõÙ\¶Œ$î™òäÔ:Á'& .{ÁàÔy߈ÎLa5›o|†é:zôù@dJ}9È.žéÝš#`ç¬Y‚ÿ)È«.Â+‡E´€»jÊŠÔé|2>×¥p–Ô^ììrN䉽z‡Ô,…a°Á€ÍöGÞaCu&È€´³‘>ôæ2NíìCô~‘ù€]ô^û tLƒ/Œ;®¾æ;on@¾$@zQPë¸-zP>¼+µ³ƒj¤µMV}/@´eÁ´¢+€* +—}ü߸aùA³ }X'Øþ#ŃH° ëP«â#À?7QðùV2%¾ö+û¨Ã7éa%‹zÐ&œv!œ§ñÆ­;gV‘>±*é8àO…6\µKAøñºIE,¾3À_¥ «è¨‰cæUIH t-2½–5iGøDhüŒÄ ËyS¶hq4Ü2Ã2)0+]€/¯qn”5צà/ÙŒÒ, úÿû¨lµÄqF¥KÇÕÄfyéð[°jÒËt´ñÏOöþÜ©,aO­Å'ò/kö`ö@ái[ê;I" ‘)ò\ÓÆ¸#fø9˜ÿ¶e%Ÿ®<ÞÈŒ ÎØnHpI®ë30ï\–±Ýu"kCß…FçšÆš™äÍA±Ù°ÞhNéEC,ØcÄÌŸ†W N*šÚº‚ÍN¹€®ºÍÿ#‰ã õ[6_û³‘5=öaÞ°Hæük‰Á«Q*Ë'Þ´\‘}ûWR±"U°Gšåv¼Y*n!pÂÁŸ+RûÎÚ¥Ó;¸‹à ZV½ïdtxéçˆÑ)¾TÎ3|*óÚ«[òõð¬­T&¨øÎƒsa§ |¶à·eEúªŸ#†¹éÊ$çÙÜä$$ ÞÌKì¨ß—u"`¿_ÄÚ²£…È„í~‰¥æj•l$ìçÑy^.0¹…T9Olîý?pz/Y’~ëf¨oî%‡~&x0òF÷ˆÞF¹º£ûCYt¼Æsåð¤Ô|2‰Ò©°³¼Foh;—‚ÓRÞ*2á»ÞŠ›/$€¥ÔÄ‚O©ß‡ygH–kß\–•¦«ñ«á\âœ!°å #£y©íXìo+y—º)lÂ+2,¡,»M Û>s—§¦‹žiwÝ_Y>œb8M9á;SýN£á47/ÃÖEì"ãi¹n1MNºòÆG°ŽK7¾žH•òá_š¨›}eä†ßYñ%!“Lc¡oãç™ÏˆAüy½E꼟_E&ÙAóQ :ƒ—¼,éð3ªa¿¾1l•)™ƒÔôt*úœ^Ø÷+MLPñVÕµÓ²Ån×ÿÀ•ÏVr¦|«š_‚S]ÐsîpnpšYOòUWrJÃ=huÅ.žŠRߊ5á­6œàËÒòUL¦dr0&óº…mÉA<¨ iÃ{Á%vÈ’¹;–qYc‰Kðáëë”–;c’]QÅó×’½iN)Ûƒ)x©´¥=/t(FÑYS{`M*{R‰&Aõ7•ÐË•Nm×Õc<œŽQúþÿ—ŠUe„ó&­õþ‰È%¸ yLˆ®d@~Ä[4å¿‚cZÅ$©õWEF¿+]ÚD “ÂK¹æé]ÄŸ œd-ºKY‘ò[d¹4 =[ÜL ½¤ˆ'Â,ŠŽS°zë넞Uá[“®bBHfJ0ãT‘®•Þ+MඳܹŽèÐ^ó¸³Wr™ˆ˜[gàÌ0“lD$œ¢B­©µ<“"×”?þ €N›%Ê‹H5 }|âê†T{Øq`»vž%†8=g…-Õ3ÿR¶9IÇ{—øèí>{TzáŒ Ï ~ÇÇÔ¶˜ðÿ£îÉS®šd-w‹°è AÛٚܗXÿÏ’l{ Ð@…L­Ï6CºÑBÓ(Ö¥Šcõ¹’©ØpŸÑ” ëdR0]—Š–ÜÂ*#£çû_‰¦™Lq&²DO»Ðxšµë•`ÙÊ`ƒ5?M‰oˆlð8ãÿHæ1©›÷fHh`wÆgˆá,U×ךLüü4$šiÐsÇÏ” (˜•Øn³&zx¾ Äp×R×–*8z£µ 'AÿM)Ö4ºòù§S[ý”ãœå’ù Ï„£<üs±¢Þþ¹¬ :Ùì#rxkQƒ¶éÃ&sbôøóDS>pWFÖj§-¨6‡qÌ䯆Œæec¤¿‚äýD6ÒˆMõ£ ?]ZÂíáßÿô\6¶~aáÇ¢…È× ¶DÙÖÖ…Z.™#à ÈÆÑ>mí–‘<3¶—°:|ºˆ%®+§XÜûWšQ‚³?àþ*äu ñw¶äÁ”Ì<¦X˜Æ]‹iV$j%ªÖ~GO’2¨ø8†¤´ƒ§?&‡ÓrÍGä|[ÄŸb‘q1?W>’eMÃ#ÝÜ"‡ø#@ƒÌÓvZ æeÛØy¿Á „—vìQG.J‹ƒY‚ur„+á)€Ò±¶ã£üY‚þªzª<1äq[T’´ÚïG3}}m÷Ü“%¦‹’Ô…3Ô²!±Ì™nà®Hà—1†[ +žÌÊ&¾ArZ%9knÉ¢è…8ÄÇ2NNõíŸd×&‡ûÇJ¯(Á'Êj¿49Ö)Ö̧š4Ž›RÛ·w’™n–‡dï (…L~’8:„øë{’uŽEqN%o]9-›LÑbÍFbÏê%ÿ­\µ„W=z+sÓº`ù‚ƒ·°ähž Ûxr>lÓŠëTÚð—– ú £_5ÉóD¿a³7;aüßt"N>»êÈ[ÇŠùŸ€ŒÏ{E±’ÿ®)mìét.rI:v@Æ4˃rtŽÓËy&–´ñ=èëR‘à/'FçMŠS½rR…{ŽZGÚÏ|À;oc2qóq1|'Ae4±Ý1Ÿ†ï°‘4¥Ñ5–]6åÃHt)Ü”ÒǾ,„ãK¤ìîï~.ÖDÏ…sL¨ÓìÝ—CÆs˵›¥E.çU˧ˆ#C‰×ï³¹,@Û°ÞkÝÄ }Õó”ü-±+'óR™ÈŒõïWŠÇkk®0 Kdlª]WLwó‹ÝI£Ì%Ý„\Š.áì®jUÐòQ™³¶²É¥Äĉcc]êŒ'ºœ¿â-ÄRÅòÑ_fÃþ·á„½ˆÌž/–‰·ŸE 8c— ˆe° M çŠðæ™ÑBe–¹>\˜!0ÍåG& ¬BŒkçNг]©ØÎÿíZ!xk±jú‘\&$9=Ô€YÁ›ô®ÀXÏ­)û¢ÕÍ<¨ž(‡Ø¬*^H<A¿YÅ ÌŒl?õ/·-|ò¼bvh=÷ôg֘ćž×Ÿ^—B®S[мuÂ'} M32ÕÄ;ÒlŽì£âh™¨<"ù†zžù€©ÔdxJ4ÓYQk6a¦ ]‚#+EnIÁIcåm«ÀÉ-õ¸ôsÒý{x“â¡’¬ƒÄCg¥ Þ†*kÕîã®Ãƒ/Š·k²È³ôϤ¢äõY¿ Lñ60ßÐ<ëB~#9<ÇÆ­•¶ïÂ;oÊR´ˆsIÚè‚y"—Ô ü[Bì7F—`KñÞâ{ùûß\ Ýí%^Ô`À9j nÞÞ«¥W+ý. ÒËó³i?´öE? ýG*..™@–÷såð—:i÷‡?C[:ßÁ‘ßêŒ9ä/,ȨL§`{s]ÐZßçˆ øê»“[ 0–G¡ž*{ÿ†C™Ì£~TD†Ï[±²±„`<-cÙÀ2&Á+ÏŒ±ÍJݸ"©É@¬§ƒÁqs '­î5‰ +&%ôÔ¿éü¬”ÒÌw• lκ¤u¢>ô…È“‹ªE/  =8žãO;]¸ß9†å«¦#œ /p  L_a_>íx7À-Ž~W”ôå¥W|Ññ½o Ÿ¦q_‰HÿL±µ”´á…Ø@‹K’1_ ñ¦e[Û˜7…×kO×è(Uë„r²kÖlºÕûþ•ãºD8Uh ‹êÞ꘹ÉÏ¿½PS~°Ž˜8ëùwú=IBe¤õÁ[ŒÞOðãŽÊÀ„š¤ë:2Ô“¬ x|žlÎÛ¼sQ‹¶O-Žq¼EÂ+ôöaþ¹«Ï&o\9x' ´ì6{>à_Ô|R #OU#wþh/Ì>/Ú´ÿ5€ 2ž»×^ŠUz£ ,úÒ`AÛgëÈ]KA­%#aŠ“ ìÞôÄ_Èò=é¤xiù§+Bþ¯’±A¸2ìÑ5£‹—iђÖá*±cw‚søpzcÝŽÀ?WYSÙyy“ ÓsÑ­RòÞSñg£>ÍEk½²ñÜÔÙ3/læÏuSSõ+ËÁ¼sÚU™EÄU¢.¾ò¡µv/(Š6ˆ;²U’M2A?\ÛøGˆÇë˜á·KSî–' ÈŸ§Ò¥Ü/bžzM>}Ø w« ¤ˆé¯m?::I3²ýÞJ Û'…\LBZþÏ¥3›€[Vë¥noèî¿Ô«5õ‚Á ü ®± {öÞ<-U†9!yLtQPô ü!øçÜ8û£æs´;b J’C T¤–Å5ñfc&{¡j;àæm».uÒt7{ÓÛ¦ûõP)2ÞÊü£fµJeÏ ö19êælcÐЪHU±™&áI)3>¦ú‹!Á[™)š94tËRÕ5ÝtÏ@AÃç 9¸èŸ·šÎƒwåñF½ãÐx«wmºË¾cìS|2^ v†ïÃF Iºöž.¯d)— '8’ m©¤ÌåCrð;z"ú|Àø?pÞ+‘W7½×±‹Ì à´±_BªfE)ì7C ±S™lš©!§œ… ÐZÆÐ‚“Q+$ÐiéOžKåлÎÛT {¢áYÞ~ð¿/¥x˜‡n±O±ÿü«í1NúW' iøÚù0•/FWpâÕÌúÿdh²¥•©|Ä,L•Á W6™7úC½¿y’L¼·Ò”mlÏ%ïA(B1'z÷Ñ_¨B”mÑ]dðuž-àÛ©)Ú$õS$Þêuw7£™ŒžÛE9[-µ¬f ÊíóLÙ›I6!ê‰Á¬uI§ªÃÓ'^áÛ¬ –LöÁ¹®ö}º²÷KÅúóÏÚX±(ÂS"ÖÞ~é\”7¬Ôç®æ_½GƆ ,f/`æc—£°ÑgËÿÓ¨œ ¤ŽL²W§t'sR… Ö N+DÔo+¡SFµ`d»¶qÿ6¢ÿ±Ä·ŒP[)_?ù °jÖä[¾±<1‡]k¨ílúòJ´)™@1Y)elá¢ôI¦‚ú‚8Ì»@Ë+ô¿`@IŒ *‹6+°Ü¦útÀ»}L–ÒÒ ÷yÇpÖbÅ?<­Ø ÏAvä#x`õÛS©ã\ÚÒƒ]Ä[ñó¯d̨*_X.âš1€Ï^—Ýøå¾þt2+ ÷ ZÍàS”Bú¹ò©.W´ˆÏ{¶.‘—’r{z³„ê¨p–à5²™3ذÁ‰Vw¡Ð@Œöö;C¢ndc‡Ý…‚s¬¯$¦c4OäÚù³'A8l«Rf Ÿv2qgà×—B£yiRHÄ9G€™]oˆÎ{õ>^€ûëÐÚ"¦\^â+ð8ÛúâжN’3ÃY*x(sŽÝ¨e¸¨Ô1#âî û'‘£Ž¸¶!ýt,ú¯£ÿƒÑsÁ>*椥ó1É?“`š‘™DsaòT¤bJe¤ÖíÅÃÅfƒ­è¥ƒ9U6u¢´ «ï ÁXj’’G_Ñj;.aø—¶IŒÏ‘ã« 1õ_ˆ%‘hûõZ½‹a7Õ#P€y–¸ÂˆŠÔ¤ür9øWj£Ÿ-xÿ‘é¾ío}º"ÕåÁ‘– -QògC”O–7½Ž…­Ûèê§b¬ÝÞ!V_˜fZñ] Ñ]VÕ ïÉÌÁªÙbÑ[Qê”Ô p‚®Úù €£-Ù­ÏÁÎ‘ÌØARsÅÇpà`®haê·çZݨԩØÁ4x©íÀNlÿ¹×)éHüÀèRS–K!8xҒܶ$Ñê]äà_¥MHþUÖ–Óò1é'Á™$:Óì¿Ã«Ôör]³›´Š†~q)iõí>,:ÅXˆ= òmø¥3¬ÈËŸ&ŽÎTa÷ù—0­ø€Pª^cvî3l¢"‘õã(º‹Ú&ò<Ì ‘ê‚ÇÅišJ2†}šVz%I1X»d‘À]Ç-ot L {kCæÞE‰GW?ZåRå´ ý3ăÑp¿“ãq¾‘0žf…Lu¬*ÂÀÙaTÌD[’ù:®<šÑ¿ÿÚø³E¹1^úéL’³GÀæÀ¦uzÞ¼’+‘ÐMßà‰’ËD+öG‘‰)TµZÛïÏ’~g‚$Ò%™ 7úŸFØ-Ï%ÿw<êkÉÞZ¯¬øœ}òûw4­`ub¥§u>¶ÕúÓª.‘9£¿ñ£^ŠÐÁÅp#Ò¶'2Êhë„H¼Ø•ƒ·âh¥ò~öXm«¸þMºó>[ˆˆ¸Ö÷ÂzbÇÊöl„ç\ úŸw‘ƒÿ<$ؘѱÀSdf ¶GSúÙ§KÞ¬)ck?.'©dC~&[€‘GŸÔ°àÖÄdpðT:µì£SX€ý äR×óg&„Û+AJZòq z«Ë4õŠô2ÿ&dV\Ó¢Õäpn(rµÇ.l)Ròº> ø—JÒ¢ë V,â¼€TdýsðÿƒáÙeß.á½kâZiŠÛ•»Gg¢¤&”–)Y—~I:¼¢ÿ´k·öäùÐ?þñúÿøß¯·¿‹f%È̃k¸#ì¿U[`)[3x „&ä ¦¾µ{ÁgHe»ý€¯²¢”dð¡^Â÷÷/©KX 9iFLf úG«‹BWpÎ\§6nÁvY7êš:X×¢IopÆV»ýWb)µÓuÙÄýUú˜Ê©I!*\d­ÁA&—âß‚n­mt)ZÂy¬RüÌöGÆ+u‹õ¿pɶ  ú³÷h *ýº)oÀ›é›Ê+YðøÙ DØU™ZщöeS`!"+Xôï‚8Õª‚Ÿ}à^ —H^G!²Š¢¢þ[â,¾|mÿÂ_bñ;y xæi¿Õé ~`û‹ÿ ¶—X·³Ûþö¨Ú±áß®m$ÖÃv‹þšáÆ—öxHd”°‹1ÈbX*D6,Ñézi–ßö©àt¶œ)„Rªúž¬µ¶êa\jõN‰_©.ÙÔ–8µÖ„ýM¬¬){¯Þ]ࣴ¹·•h£ g«÷ÿ­Ea÷ZúÁn„°†«}i×¶‡Š¬Õ ñ^'M~#û/ˆuÆÕ¡¿--I9RŠœüÄ ·Ï´ßD¯Š- W’•Àiµ½ Wø=æHäŒaÉ ¹*íi†*”v”&X2ÏÂÉpåø¢ìµ†CÑïe„]ÛÛ°#òÊŠúµ[€ SÛô3.@;¬t!ÈœöŸc…;p» î6Cqnéï¯ðIÒ¥áÝÀµïk\è´Å¤Œ²Ûn\4%ü¯ ßTÍ2¸ˆP™£œ%c׸Îkºoa]ä [p¨2 ‰xO—ŒU¸×XóNp-RÐvä^kY«Žo·¬°¸•]q7 Raæd­ƒò'‡U¶!ïêí⬵4UA.Ö‚.ÇQÙ¬íê‰*ì/b4S!X™RÓš»®{Kèµöˆ_É78.‰H`'`ɧE–ª@½AƸök¾À¨‚K*…±Oükpª-ˆ½ÛÉž— ûÉÈ1x®äD· Û¤™=r'Ó;UWÄ.«¼–ë’­þ[CQÜ€Z*b`©¨ÛE´.Ñúb[(E2­ü‘OŒo°^¡aJ4ÈÕÚ(rò4;ÕdCò¬›¸IÅkbQÕû,bkÚ˜°¨Èv'Ò0ÑChr·²iÃÓ›M»U¬)f7è¹3†F+6•Kk–ªFÓí_Ef’(k šl‰ZÌ®†;Œ¯X…ТpMµÝ©ð,©Vñº÷ß?\,+báøªËÆ¦ð‚;쉡5hŽéd°ÀtJÔ h14{¬RÊÜt,RµÛ¾PÊŠü°W› sÿµ°ïJÌ YÃ¥Ycr‡}u´ÆÉø ìõ½‡S´DŸIr•m°±‹­¡š‹Â|moçRÖIjêSúçRˆ5} £ÄÐUn/_ n+zq2s+ oä­@ÖXÞwý™è-[S¾¸f6‹Þ·´‹i„³Ö­9cÄÎʰqa£®nlÐŽy»uŒ mÌ~ûGr=u½Øý~Ê0`h­KÐwpÐ’ ñ—γ¦¯1"û,Rý›äV~°‡†ÄúvX\dBëu“¦v XŒô¬ÛË84ú~çôÉ¥ÆKuпÓ úN}Cyeƒg 1ûy8#Kï#krX…[‹Ø.´]ÙKÇØ·i,k|-Õ{kMNà1Ë|©o˜¶ù쳄¬´R‚ò"§3œŽv¥\+{¢ŽÖ2#ú÷ý688zí_,–èé÷›¬s=­¥.õo‚•|/ÖÄ îo7“­}p}h~Úå…êþ‹kY‚nÅPACÈ~¶´·.Óîÿ,°}C¬õÏ\O’ìœD?¥‰i98ìö‚º ^&…Í5‚¢²Gµã L¶3$øA–î à ْäµh0òZ'W5™\Å`WUìèÆÄ­"­(!–Æ4à°9Ûda7(vöbikhw~BÿðÛgC:HðŒá9³ª«¦§×ã™ÏàÚ¯y\]ói¤¦rmwÌ!Ü‹QsLÉý¯Î¾EoL8wæ¨"ûqà DÈ&¨ˆé2Æ'u“×9ºÓéµ=G‘T¬SÐù)'в6ó¼íyzrR}¥’höÎ ·œðl·a ¤D#æÛ8ÇŠ°ocëë`åsÛ |ðèaãǦ®ÑþhQê˜Ä3Lü ûÝú_zÕ½6lFg+ }•’6~Äp<*ª ô†Ì@ÏþÀÁ’_lu'_î¼§ì—„ù};ï¼£|­©æÝÀ×ØÃ ÊD\òBïÚ ë7Xÿ¶­#4çII<ã ÔKÔ_ŠÕó ý£󬑳—¨IæÊ{aÙïãu›å° Í øþá–0 [YcÁ˜•%Y c$ìtº­À¸_ÂÆ¹QÄñ-ÛlIÎNŽ[z šŒ<¿qŒ'EfhJú2Mp3àÄü\K»•zÕB¾ÅÝoâ¯Wñø-öS’U1B DNµ&WKrÁº-*º¨ýDßÑÈa‚>ÿÏà‹šÄMoðP¨ˆ5I‘rωՎ3™Á;ÉÙèeªþ´V®Ç÷BS´lPÏXGi[Ц°}pb约KXãµ¢†í¯³íFLÚ/G³d.вj 6 ùTÙqLL¸ÀB!¡]û±9…zÅš·t¿¥«ÊFq"ÅA¯ËF9Xw§ñÉ k(¡‘9ñ˜Je›aela“´öS—}’JäÉë²PýJÁô‡åÜ›°XìÁ ¸ä̓ú~¯Sò×x4Û“lï-Æ\: ?` ¾IiÐ}úìVˆ,c~!ñ%¡>ÁÃø=u5Và¤+²Íd ¿%ýç°Z±©¿HÉ•B¸Æ+¤ñ…1:Uð' á†Û˜«ýeQÆ5¹Ü0E"º+CØH¸ÇIs…Oе%ÜÝKl\¶ê×8dÔñ1Dçö§ èÞ8¡VY–²¾# Oña24T©ÃëáQ±Íó’\ å-w¾{Ä®%ßY×$jÏ‚TEV5–õÿõ^æ7ÄjاI¥w1»¹1‚µLÜá¯Úô–š‚£›£|[ NcE½Åù±¢Žq¤¯¯ŠÉ‹XDÂX{­¨Þ’ØèAÙ¬ºýãn¦ãŠ®Þ °WÙ]$m¡]¶:CšÄgÊæ9ˆIÄ´.Á»!ﱆÇÃÞÑÿÙÈ®1øg–«­…Ý€‹¶ÖÌ$)p?ð\ ~¤Ôt„£\LúWëéö¨‘aDt>YÊ;á`Øl1±R}l3¡NòÊ8Î>Âæ  $(¤(éöôô’jª ”ksEÝÚÔx–ÛçÚkVúƒõ$™4ï% ü_k;`PÊ>ò.âN”Æ$îÆŽp÷>¥KÑØÄISa/öV*³Z–ð~It?6‡‹ ¬Õü 0ÂQ®ÙW„hûã‘e‘림FÝhIëá?§ÝÐl‹MãÏ-e8‘74|^cÐeMέðº„GË,Ú™‰m*2¬8jhè …?q¢è4Á‘ƒËFû–M¨IdÇRÿÉ"lñuÙ'eãŽ1I¢eU8¬aj‘Â6Ñ#š{4F­}@“ Å'2)0a˜«5oìOPÒrE´ Ò ´BìC84+ªÅ§é–ŠÓ¦â{ÛË–µ²ƒÎæ[s´lªÊf\PËKú¥>²m’|êøCÇž‘Ð<‚‚/\Ûžë‚26ð6eMr@ ŽL‰­Ùá^‘ 4°HþØKZŒ0öwm.9¥×ìÝhMÃ¥9ÜL)¢%Q²a¥+žƒÓŽœ,Ò DíhÆÑ ,{˜Ä:O½5>ÊYØl7H>™&÷Õ'‹í¶\¡ªeì# µ)¶¨D§Ä ŠLÌÃÄâú«¯LÈœkhý¡¿ß[à{¾„t•¶þe¿–Yf޳‡‘¨O[¯³¿ëî$ïã6›UmxöÚ#>ÑšØ$ZACp:Û¨4lÞ’›m\§Œš¤"0–þ&ŠÌœVeSØ5vklø~¯šÓ\ý»4±Š>'"±1Ü#ì1¶É·²„OT6êþg°ºíFÀÌx„ÝÄÜ8ûýB¾ÖX)N£ª…É7 ¬Rê?E©Z dæ§Ö)®dƒî-F°Ï`Ë“H*Ò:Öª¶îx‰óϬÃ'L|¾ÿ•V!?àµSW’ž9‘ 3î¨êÛÓí÷JŸ4-ržÛ¨"8¿x˜’H±/ú[w³õëÜúƒ ‹{Üyý좼º)cS\ U®H\Z»")êŸòÆ–4è[ÚAÍSù‚ ‰ÅmaKµ¼.±iã˜ã)v¹GUµ¸KAÔQoˆ&¨jœ¿ÄÞòÖš´èÔHC^Ѥ*À&YSÈ^68YK²äðcÎb4÷‰J„îTðXÀ¾tbqAeÆ?Ùu¼Æ)7úžRÿP*°÷zŠ]Œ}âH‡ÞùÎ å‰èFXs“áo}º¥T)3[¶&]IC“>cL-ãÕÑXg&Ym£rHúATõÖ$†ß9ÎòÁ ¶Lð?¹¥'·ÇYÿ •\éÛí;e±d¯•0[«awåw t{—°CJКöáb¤X›%,2 ½E–¤‡ªŸlε öcd»FopsÜ Â4ŸÖyê$™*K< ­k ût§ò¢xüM˜Ò1/XàA‚÷M²³pHbò…S6A»‹±®€ÆýM:Î*§´³×i©Q*m݃¬aGÝ æÚþ… Ñ9#䚢!ò’Ü|;·‚ §„C•™Õ!þÆ·ìr™b¨«TTíã`¿ftÍe`kk×xG¶ ¡’¤––9éÄõŽ ©äuG…€×[1)Ø ±ð6±,ºlƘ”ÑHžk÷WX¡J§Aâ£ù×T7ùF+’ iÒOÖ³}<ÜW MQ¨{ö"]ñŠ­^fáR)š’:·ðHÔo\áxÞ™G\FM2nP¯4/£@½M„ÆV’~³Œ…Ý«fÉýðœÚÔÙ}%—L‰…%ÖÈ3¯X¯I‚Ü9uükvœÊÖ=3M÷V@À)AUÙŠ$ý^^R$¯*¦dÁp€=Ôën㪓z3¦1è/U ¶áФD`”‡¡uûî-‰$S<®Õ…8àüµ¦p žâÁ.$%;•™Oœ£iÛà·ð[¬Bv„‰-»`[æ4ÊßՌг5[Ê–n°Œ%Ï­À/³œ«Ÿ˜©1ý^¥º÷X€u¢$Ã"a=2‹§ +@Z5sýÛ׌I•²féX¬+¹nJjŽw¦Ôÿ€¥ö2Ó•EÙÐjÀ1&Ì´IpöOöùŠhö2ǘ213‘`›•zvÛÒ’»rÓ$©Y4›„>‘YZr^³T [¤êªÉ™þ|…A)ØúX¾M/}%HÿÇN™¿ìšêle©èæ¡Ûx¸(Ñ„µùüTƺ¿.É5稫þèÔ6½eýêZós¸VkÌ~›SË*í[žÍ™ü É1å’ßäuIÂn'³¾FtÙKR¸‡¹m•ÓRbØÚ`8#Žý0F LÇ«–j¬2rd¹m&hÃêFÙ4ÍN%²×ÙZöóh¹Xï#„õŸd4çHVÀáX2 ê § ´C÷ú}}µVýdÍZ¯*cÕÏW¹Û º ¡fKµ¶iâ³&É/cÓºâ[H‹º+“[–:ÿÀJ '4ŽÿíÍ”•X‰’n1áX8»™"|ß §jÕL ”ëS,æÉÉè\‰úíõLYuMö"¼‚’µ$RÞ“Â×ûm÷“]&tf+_Ák'‹65+VwHô‚‡Þ€N´ÁÜp…Ñsòmþ­ÌBKë,¢ ÚèõMz–6BbôU0û|ö2*Í x×H!`Sûà†ÝÃN:)•Öý/DIS#.M½‰û7 3Möïo4(§^•›t)¯ »˜0 «rîÚUx=lÞ0Y¦`3öW¶¯b HdMY²¿WVÖ?eoCZ…hÑé Ïæ ´nF¢/C|¨RaÑš¦¶JÊ_ÚÀ¸k¶9°¦%µ½†ùt£†Z®¸2¸ºQÓ7Ûå¯ìå`P\ðºÞpÐ5°°B¦T #Dj§ÉmzkS$NKŠp eÂwOÔqÒMÁ3µfØwGKØç7¼okëNÊÍ;­| ±‘²Ið‡3UIÁígUÓdÛæ H×ÔŸ¢3ÜpÛWò^È5=mT—*·Ïo·Ño§ îF¤,óçElªIgS‚ÖÄ"Ú-o;ܸ‘).Qr¦PÓ]^«†c·ß}«;r¨†èiÃo‘šÑµ¨nH±Þ쀾BïfM.~f„¶AÆ®ŽlÛ=g:/31÷ä7+Ó[h33|í‡-˜¹1݇ÑVÖ-VØYË žP.©ãUã:ÑÙFƒôÆòMsŸKpÒlu¿‚Ñ *Jc«H=pöQD×Mz _T’zwðÁRf€ªkDe­ãÈ”€KcË2LеfrˆzŸyoÞR¯i…t·èNÞ§ºéc8 eQ({uö5šî Cu‘>Ü$ÊQ°§Ö´x1Àf jv‚Ë«–pš[ÏT¤wŠk0@D –;ókÀ®¿¥÷º{U}¬ßB·z|a¬fq„Sìû×YžýÙl&›Z;6 SΑU¤ýŸÀiíïM3ÍšP€`7sF]#SÁ}¬÷M¾Nš$§öª¾¥uä°׊ÿÕnb:*@çðMº~‡;Y^Û"^§C:(ZÞˆÇCw¶ùÐéÆûgb4V.Á™‘Œ «NÀù±Û³pvÕvõvýfÁ~º9ÇXæ~½ÕI¡±SÅÚ\h ÷×vØFßË%­Ðޝyñº0&ðØ_!/¼Þ”Pp£À8!´r¬1@Ž-òÕ1>X2Åäúy?L*ïítòMM“B^¬Ð|¨ƒÈCCý,1=@B>ÕN3õX²ôÁ®$ ŠF4ä÷A¯„Û!ÜZ3ds`tµ$Y»Ý•©µ$96ú¨{n$J•ÆŠ®ÀI÷øyÝ`tƒµÔÍŠèÚ°ª3 0ƒ¢]ÛÊ=yŠeKŽ*  «­)‘j­÷UÒôn ¼L1ýñ^Ü’¥]ª[V å™òK«‚°HÕ¼(ÍkJZ·l^Ù˜D¢^º”†w‹¤jÇ,[¯Ù~HõÑž ‘‰wÅV ï:„ýqAR0¦¯€×4`“uªI\´NEzÏýM\”:QèY¥6ë=ÚkèšIÝ!/q]'´Ö{ûyeS€ ˜*«QNÙúÔÍúMZZ_KlªÒ`+vTø7¢ªˆž °†B’0éC%e6’õ/vt+§¼ñwg¾¢ž×&©aíKS allc¥ihаïYÈ+CõŒ1,^ý¸M¸Z¿l¡-¨Õeƪ‰yEâž4‹§bLÍ4K“õ%|uÃý™`“å¡_ƒÁ–YÄ|úµE®µ7’`h}‘››ƒ!±ìÃL$=Ijæã)B¼ÊÔŒXí¤Ë j…Inh%®1æ\^#÷UÉœ?o-“Ò®™ÃÊãI²ûzË£¡ªpG¼Šq^zî–2ò€ñO°ñmÜ EK†IB¬4ið3Å4š—5ëÄ’ùyk+…`ÏÖuC:'üÆäͬ7 ‡€ÌMçÍÉl©Éýžv|€¢KÂDàÓtJVn»­#¶Î'¦]¡ÎÜM(Œ—øÚxkÝÔ$< Æ ™JN)·66«MX…†û‹^ët¢#°mL},³¥®ïN”›Ãy¦Ô ¶¹9ΰ7?û]o/¾A¢`I£Í<ëç߉𙋻ÝKQm,c­j3 ƒdÊïé\ÇGg¤äFN¿ÑX¶Ö?•Ÿ°\¿Wȸÿ¬«22 »7Fw£!àüÑçý­£‚Õfˆ.úFæÃ®sa&×Ó‚êšAìèËxûÒ)âsÌíæ¬pð¨®6š$õÜ©=Òµ%Ó2“ò²B€yD–=E³cÌ69%aAÑ`›r)õ´ïì±TXÄG]C,Ó©xï>EH”A*vI1v‰±BC9B¹s'²lk°æ‘›°/„ßÇíøS!ší%þ³ûï“Ô ³Hc‰XqcQÐÓkšÉZ¥_écm5‰ŽºÉ¹ý"Ò¼FU†”ž{#Xy†‡4$åÝ÷ØWúC§ ÈâeË ƒ4nyˆm¹¯SÔËai2—Ö±m‹Š¥ %8{ðZYè_®ŸJd&"&UG)ѯn8–8‹GŒŽ·‹îT!&ÕTx–‘lOÇ“Ò+Í.zFu°é(¢}°›[ ÷Ó·¹²X·Ó””§#Ø.Mb§§iÓ1z•JZVY-5öÒ3ßö9ˆkÌ«UBÓümRöF𼱉 ëÀ"Ñ$lÀ]=¨R£M–ck7l|Fß±<í¸mòu•°L¯#ïµ£ºÑy®h?®{›°Ëã[blÃ7° Áê$.·‡ÛÀú7Ø\ßð4·˜´îgóLù¹îZÃyXÑœÃ-o%‹–æ°Eƒ(@¶ncªŠêÆ&K»pòö;_÷cdFÎ6ËŠW­j¸M˜öÑ/§VõdÛgɺ7îENc‡&Ãlm'†¥©hÈÓJúq"3¸\Ññ…z z‚V)˜nBÒû´ÓÕß…èðÌ´‹G‰ºäµ½M@ºIcÜ…Ì]bUÆ4~®¤cÍ{]U²-ŸÜ(OJïß-ijÀÞc¨·71‘L ‰Ž¥¤[Ñ"ôrUëø†tÀ­5Rέ©=` n¼ »Ýô‡­^lÒ[zs¨3X4)êsa÷Ì+$—JüŒA‹÷}Ø}zCÇà:•¬ãIñjYÑŠRǞ䪛+È9r_ÑÄdkÇÓ,øë®“Oÿ V‡i-Ýþu…¡†‚øÎF¯Š¸&æª0Íò”qÖEC hyƒ'>ÑH„‹a.¢Ú™ý਄`C²fµ)†¤}µ}¸‰S÷ 1¯ºkvlÚ71ÍhÊ)±MD³&ìØÒ³ÝKGKˆ¨¨iã!Í U±ŸIØ_ EŠ6ó2J™3A+gOÐLB >m{àœÓ–#ãOØ ^#c7¹äë&¥³9ºŠxöD‘û³I±^‹<Ã;A$U¶X•k»Â{üy<ÍðNñ°[º[Æ‚Vmär™òPçn%$XºåŠtƒ„±!&‡†¿kVÙvÝTŒLÔé—õq‚Õ‹ñÆ¿!C³…}†r‘Ä.0·æ´¤ïk•œ -R·)ZæfÂìôz1ùÀ  vÎEì‘0 ñ¨ ÍpÆäöa!Èo𢯯ñq`?b¡}fc¤íꌉÇf'9…WêÞ)!Ú?™½yìþV$)è­pþvﻎáóµC3ì­KI:tw8оkkoB+*&fê‘h©>Fªm  léÐpž©’¸Ñu]±÷!¸ÈƨEŽ!â˜÷¯¼ß‚72o-yFª2âÒx©6nvû²6½ñHR'²îÖ”úKÉÈÕƒËR3Çc‰çÞà?Æ8˘4†¥ a»äc!Ü^ͨˆØj0x¹+02±bΖ€#d-¢ÿ•É {YU÷õ̇AýB_' ,7Ö QUø«Øëã&)Mô”&/6#ȼ0oÒ{Ð$RžÖÏÙ©(=d梱]åƒmN­ãâ`ÀDÞÿœÉ÷H³Û\ÿmXûÅÏ+ù3îqXµýû€)jS]´}Ø`s`Y–³È0×dúÒÉÓ8Àö™Áø”:  w¢×竵-Ê»aããèOÚ'Ó—·3S'"§ž-ÝQ"~Ð`a‘b$Í_Êöz0¾–°mµÖ•ÓEh^Õ:á{ />GÛ¬ã•nØËˆ œºÅ2†#4ð­ì’FY£—h‘DWL²Æ®–ñÚT—›Ê«À"ÈÿlÔ{ÖûwˆbpCNû“ŽAÓÙ߯l-îï]~ÿL±¾FÿŒ‘Øœä”7!C&g²áHiª±M75‰f˜Øá””*‡³Ô–eІè†ïáâ9þ ëéùÖ K$Œdç^å%ò o“Ìîꊒ¨Qá!yÙP™ªkšñîÒûÿ|#ššFóÖl”‘Céf¡m±Š“[R¢I×àNRa_ç+cütÅS$>Þͦ’œäF»)ÖÞá-Ù8¸ñÆ!¨õ ß&%VÈpè’µm±Fô9gtE˜uÕù¬,çIÙˆ€„{дâç@`RÉÚ:îìì&ÁFäÁ8“]¶|nåN8ewî]´Ô¹kv•!é^›Á»v¹MÆÌaûXãý[…öǺ0mÿßvîsËa1°ñ—ÝäNHÄß\Ž=’`Û¶$R\—œ*ØGâc5&}¥ >pdÓoV¯`Ь“—¦7…3ýuÕ"¿&i<ÿ–·zai ±½Â5¤pÔ –[c§#Ü#N©è+ðîk8ùßgþmcª!ìÁ¼ãˤaUuÁ<¤.Xkì»&'ÖÅõ!N×SqíŒ'DÕžj»i ž" ªúç÷:¡¥çÌX;H…$±EP\‰¤¤+Í’U}f_¾¶lDö­çÍ’¦J4™d1!“3lجm☵DÜãЧ©|²©Fà#b–ÆîÈØˆ(SŒ¾"ö´ÉfTØãг-rúy·2Ú©ßU<;1cÂy×'„{ð‘Bƒu)ï8¡+ŸF ~­è¶9çtž —ÇäÁ¶®!+ß}]ò.åSK•ÑbÏ=Dr"5…©ýZ¸ÆÈâS›Qßz·`eRRœŽ½‡z«©æ£Á&à¯]®¢I†&Îê¾¹¡F1¾VZ÷ã‰y÷fVœÍ¶ §¦éŠê¿V‚:^$>Ùô=°«rNL·çÉE¨"ú¿·Ó:`ýþ,Ê[z/:]Û<ÀX®¬‚S·ª°WQWK¹ÇdsØ–FæLØC?çÌ‚CÞŠDs´@UN+ ¶í²<¶F³ê!;¿ó$Ú±tþºtÊ baʹzy37ˆ˜7+8èVº4ܪý÷¸¥è+MXÜž xeHªJº€i/º²7´vÑXÖ¼a|»é “ù½¢]ÇîA€ó¼—š•P²wP#È¢E¬2Ó˜Ö•ì³lš ˜ô¶Z±¹+A ³"§Ì8Æ@ô=Öü‘ Ùn;ºIõ›àiü™­¦Ä |Ù$, ¶˜_FñÚhvJÜP_c´„O>VA>¡ÞÂI‘$.£6… ý¿G[Œ¸¯oÄûLÜÔ÷xœüÇBÚšI]*憎1ŒQ˜l¡­¨ÑSVÄ †=¯·/NˆK4 ®£6Œo8eH‹•ÜWsøg#нå ü)gl3íØg+*L ˜ŒÑõH1íIšÙw& ú&B¶cíïà öw!SZÈ€ºŒ-ÁÍÀ{à¸[:Z‹ ‹p©£îÔ¡„÷Æ(£L¸qSPã®Í­°Ž°QçÖ¸1-?œ~†ÎøË²e×]âœ.bçŽû©¶D‘·¦Óæo„°õò^Ì,ޱQ%RÞØCdeBE||ÁhHEøM.îùk§ÉÝ;Và-¬Ál•¤|ÉÔ‹÷ ÷XÙRZ01WUÒ8h§;`%×’æ¸9gE$»!«dV®³Q½.nÐ/¨Ät’ì<¸Á)|†(G3Þ‚P=ø©¬–¤žÍ)ƒw10A MvÚÔüþ¼ŒõõNLù–➨¯9±ÁuŽ+6iâ©Òª<,f`ä1º…i€‰„,‘Ç3z¡çøUÄ4Š`G½—˜à'¬î÷‡‡PØÅÞ;dó±Lm},5_ŠG "BœEÅ 1±H(¾6¾4Z²Ñ )&ŸWí4rl¦kµ$Stv‡tŽ;s˜Gœ»½ÈŸê¡)Y¿<%á›ÊBëPBŽ~3½×+¢8ŽP GW@Ò1›®¡~StÁ›û™Jœ„w+éHw4¨ù“ÆìÉ /D ö—ªêÆVö7„1°*˜úyÂYa=ÞŸèãkH>xO5ØRelÚü ¬áË)!›3ÈÔÖ»sö €Ð$Ün?ãê›QQå~•ð×dxxp]‚)Kjuµ2¾ágù¸ÐŶ„¢$†¤”Ô›Q^$Xì×»™.‡ÿ×° %ª&W³QS$Æ&¥å_ƒ3rÙZKï Óäo] Í3ã{ìR@:w>ƒ«#fÊööâŒQ`zÜvaóuK¾‚M$ Á›G„ÅÆ©X6¥EÆ4ïaï€uŸ›vm„ä€×SÂâc®T¸†Ä–O”H—7ÁÃÝ!©Ê’Öñƒæ­;“ÒFVÔZ=»[†i–dAÎVWA„Ø3®)‰²oJyùlV-nÞÙ#¦ßÄLM±{Dâ!žx”JÃONY¤u±ªNí"w"C`@È%ë¾e}ÃÆ±% '.7 êÀíÔmßR³¥É°¬0¦Ñʪ=­ÔÛK'AeV}Øñ}wËÚžÃݶâ ×Õò[ªàZbX™Ñ§tD‚üF, ~”¼±cgT±Šë^«¾Ä=U|Y² EïZPª9殮E|Á&¯AZœ?pUx¶k ^Pã“OŸ›sÆ‚g¼ 6á.[Ú4üÿ­ÊíPÒmY)éFBIZ@·ËØ{Ø•i›¼:á>r'1F+=ÞAW8ažè¼lž¦qjñÝ¡G?5öNóÂJZ³ÚÏ—!æV!Xm¾R’4­í–Më#GÛ§Ùד¶± m(^êÑîx[YA¢’Π@ý›)nÈ9•¾;Ô] É¹YÂÛ Ãò^®ô]EÚ °¥Íyª±ÖI ²"["ïtªŒ*6iIœvf­ÞÎe£³}…ó݈Xâ©@Î’.~O|ú}õ‚;i“ß!”Oœ2=U’[ߢ%‰ùb#šÖÿ‰dÕS @)dÁÞwr¦Ñ’›ÁÖà6%”Äpæï€Ò¡… Ò3)u5ý[¹ÆŠ%s'ùȺMÆêìroìNâUðY1M^’8n HÚt¹HS⋆˜f—mNp2‹ù<2P„ý‹0¥,ŽéIièï¶«º¡.à *ê«aØ;±È祖täÒkËçÈK<âT´µå&óת¤ãÙÉ@«~¡`œXß°FŸŽk™›Ìl[┼¢Í|_p©˜›·3¨#À¦¤oÙ–Sÿ#å銰À¶jåû·ðHÈ‹òÿƒ’¤Ý ¡©ˆAƧ¥‰#‰…¹ÜW½NÅ’ÓFošïùÛ“IÅHªÖ:ç=»Ö~KKБBþmÇÔkÝí¬]¯X*ÂMüú™tž„Ûû8ŠõŠöøáÄoÊEŽ¥®L \Ë|ýžëUÐ ËËñ¼¢=ÀÁþðIª•;lRã`X§?Â2ÏX 0—pT1ž=TȤ4›×˜ó‘´‘åÒ럜’ô‹´ØE§Å¡öp®©kiàZ–Ö›vnÃe@¼é‚-@®“ £VwêP¡Þe5Éà!aòÏ& ÀC*IoÖžqð“ŒÊc1- é qF>“`‘n̦ uj4ç;ž?:8ç=ÇvX F§a_°-‡Í™ÈÄ^ÍíŒ{Gg‘¾5\Ä +ùˆààJ—œ%[VëFòe7>¯Í²jŒÐû&•NœÛ^7\•6Ìh…ÕÖÛëÞaÝyÕ5¸|èhå“qÜQ×£Äù×jžÿ[ÛµÐùy,ùÞšjvsµâ% !Nêä*b3†Ý¸#8»J,gÿ™é¶Æ ²– ÆúȾ(shªÊi“|´aê&Ù¸`;ªoWÙ˜{ýã0ÏÞäÖöV ?¹½ã> ŒÄDSºƒvÊžð,ÂŽ~›ü_mªezõ3Òi§~š±±2Nø¸\IÆ*zf ks 3 »ä–ÑZ"_¨ŽcÊZ5XÐ)?‚ÍÄ6úv÷MRÛ‰\ºsu&˜èD-@Çí–\d²¢Íέò¹C·[ÜýÅDj8KÎØVWÐF¨Ü­2ÊÅA…ž%7$·ý¨’›¨ú³¯{„&¿o]G éÙ`MGº$­1°§pΫZÊ=šeN=“ÝÒG§Lu×ÈéàV”ù ¹µ¤ Ó#3I‚œ¤™u\ÅmíØ$ASq׃’ДìaÄÚW¦äÕàÛYÛ 6p.ð9S› ?0gm£¡.qkˆf/™r©ƒG(¶GÌvüo»`„¬Hò–—ôࣱ&Ž±Ê¯1»&!{xÙ àãc•hN‡ 6UVšÍÚxµÂXS]mæ¨Û„¯Ÿ™¬QËÌéÓÙò*ÈæCSRÒ$rí‡5äRoˆ¬2*ªÙíßo{¿û/4)Ôùs˜Â¥(Ñå¢EðXèeš»û"÷ 6·¼ÿ»{IyFØÓ–ÙÐl±bŽÅa_ÅÈ’Áù/ÑÄ!™ØÍsUR§;Óì :ž”áR2–:X.¬\ÒŽyJÝu–‹¿’¼«ÉX@#Õ¬UÐÓÌÏÞ%xrŸô!ö9¢gÉ%]ÉëL>ÛˆÚÆèn’QèØNXádÙUQY2!伂wŽALhOwj73뇶Gíqv&¿íÉYgíÚ˜[4+yWñ–ÚŒz¸ÎL°ˆ+,e$ve¸­ #-wŽ¢§½êÚ°è*Ÿí½*«;Ðê³…L‚̶PzËôAë{H‹±]ߨ¼.n½¨'Ú²º)8~”û­×”ámÙ$•ddNŽêo ½kXN5·-Y¯@_ü OÙ™¾>éx8óÒØNV"lLèÿÜ‘"¼•›;áYÑà gÿ~ÿ®Të„𧂭ƹ{\7~—T{‚]ð`ŠÔŠÎaÁQC]Ÿ`-€š$™‰X½ÇBÀšvt™ÉŠõXHKı©[¿fœŒ`vJ»Žbþ7²¾æyG¸ÁÔT þˆj8Q`ÿ;bT`™ Ü'ùírÝ8zöiJdÅÀe}Ë<‚µZÉÆ'.Á4Ú¸ü´nûÚ¹VL]å¹tZZCZÝ·ò¿2XåZ“¾ { è¼6lO¢ƒiû¦a86e 'íÍ@6‚\ x|`»’PÅÓÙ™Zò*Ö +0LÌàÃz††BX=L‡Sxq‹dCv ¬­„ô@a°Õ~È%*’ŹB&v¢TVú¶Üö‹Á’”÷qÕ`>:ìÛXáxðÖn©Hb1sÅvØ©uæ¼ _6F‰¶õø¥ý™­ëÔôÉpòUt³¼OG§*5¼ÆðsLT׫k8çצdˆ­.,OÃ9†Äª:ÂdRo²}Ô?X—`_˜€4éCÆ.¥„]¯±QYŸ)–ú‘Š•^¾æ»Öï ûí­`POÒʯcÓ+Æ>thÂE±‰$kD™VÓ‘s]v¸á†3ŒòýÇþiâ[%²–˜Q˜Võ½oŒÿGt6¶±é´(¨+Øÿ›&sXê&¦ì‚‡)è<Øeû©¸c©÷TR<ê‰ëDÛßëfÕr]â™ÎûÔÌSöCU•™‹NÎÜô?Àp“eT5õDàDSOvíÔ²Ô5!ÓO¡ÅÅôüÄtàu%köíg Ót¯ú‘Cìo}´õ©K¥1 æp4÷Ù~4ö½ƒ¢ÉYêhÜñóJ]ð0³e|/iµˆf6Ô÷®òάˆÉ†»?E3Ö!êîéËYg_G$Á³ìø&$Ó7–8(N³Äफ½ãÇÓ>~òê3šCx§BÓm ÝP3÷ž'ã®Ææ3¸@G›ÄÔ·–)+¸Hhýž›nû§ñìM@‡‘ 労&”¶X´Ñïlª9æId’›>á%mÓ4†3{"LÄÍb]•ïm(Ü2 8îWæˆ ±@\Ñw`A^7%å†yÍ{‹á®1Ãëô.Âeaa ag8 TlÎÀ‚<õ……(”á §˜Þ¯+~µ¯B-—$3‡$œf+’bl¤Ny¨ acBÒéYfàcÛ}e”mYÃ|u¿²–MIëÜ@§'8‹ðÆ3&{aw¸†@Ë‚VCx¨”lÝÙ«k¹ªò½¡Cÿ‚MO- `ÏBgMôwoêûÍ *›e~w•ƒ¿K onY' ›…ÏÂ…pJ­ù8Uð–âalgpëÉbU“Ƕéë¥ÃµÓ%›ö·vN†vÙL(Ü4<БÔòf·ž=®ÿc”ãÂ"ÇoVlMRqãM«‹'qO ÑκA«·‰K‹4—sÚÉÝ<¸X4n5·8¸oûÀ°c“WJ›xÑ·ø§ptr06œ*ZÑ¸Ö eg/0–!yðsY><ÕöZIR¡5éÆoåëš8—X“ƒÆ11‘º~oq®±ßVÅðfn‡˜u´¤Oø0îJjÜöÇÆD i¬<Þ×>ðRbô=Ø8i’˜Ô¸8iêv<%#)¯59¼Å"ö*vNÔ;%çFDH –+«:4 E}&ç­Ø%ùj“7Åצh«ËúÙÓø¡coëõT8fÄA/Íûyö>Ç]r¨5ß7tnæÎ›YšîL»IÀ;­»¡âÌ–|éÆñþ8p8p¬sƒvÉ3ÂZ;ã®vÆ ×¯ngfÂ8ÆÝ$Xm¡Séå×]ÂÚÆš×]M:;èYÔŒä˃ƒ:¦M¦0µbF´ïD?¼MZ—›>uû¥&g/MÁú^ÛW?±$úÄ4C…CÙ€b‡êß«ï¤$j÷Rm³DC®ËŸøµ@ÎojLhмuܯ%kòsûaC&½"¤bí*x©ŠÍ*~ÝíLÙ°e„£Ó*¤‰´/¥Ð­`–ITaž˜Ÿv+â‘] S;= F ¦•l ³ "Jš²ª°h€DTEa¼)»V[FïÒõh85V;lÛÈFx oÝúC.°ë¦'ì>xbn˜¤)‡qç|šLAÿ…±á¤&ì9á)ae°¦0[“Š5P€ÄHôÁ2X‘J}_à„;D3z+’µìß‹Žo\0yq~.ïèi0-y¼Æï,Tâ­€÷Åë÷ð”£uKæ†X»;š¬w§ 9T¨ýˆÃßõPSÞ ãu†Þ¢s¦h‡Mz‹nM=¶Ù±œ©¬bbІœ±·^*Ö¤„{L4Ÿ½w×w3Ó‰å¤yù+'­ò­ÉÑ'cdâ©;¤jfÓ³ißʶ Œì:Ñi„îèbû]Ë[^‰V”Àª |éÛO¡’d>äÄ8{?ã¸â«” òK³ù<×H÷O4Ò(ÊÆêh+æ¤ëœpvX¢–l *//8`«·£Ç¥†ÊØ4¸ñ·õ:FnJcH^µ-*1“ÍmZ^ C!d+œ\"FçµE)x÷XTEÚ8;›âçy½½hÚO7®Öa1µùªcŠïEõ¯µqoDygÒ#4mîfïJ|l9sº‰MÛñV'Mµ”7гxŒH²§"±l«JQ^”ËŽ¹}ã!ï9|ùüép»c¢T:Š'‚ amK¨]öÍ ·4h¶R¹àS3€Ö.£Ò&Ä;[gûWh7mè6YŠ+B-c&|²O`m- « {¼Èè Öâ5–HÒ33›ŽëÞûèè¬i?ÿuiUÉÙÑ-Ê`¬uºªD|Ó_Ê+õiÅ£Ÿ`8™¬vƒ:†¾Æ.ËÆlð—•vú£¿1ê\Ø\ô%„ºnø‘B”¼»ªcï&E0X\ò¾Y÷È?»¹2¢Þ m%Òè ƒ×HlµM˜f§ü{ëëR¯c[Óßf‰m‰&:ß¿¸’2¹†•®9ÉwX5â¶ãGÛ.!3דּR ÿ6IVñD^uQÜKno¿ÖwàPÐ&6$ê#/ìÐ̤۶dôK°tŽ×ätVϾfã­‹fWB. îgî9*%0ÁBÒ«èݘ!töäméX“í‹´®Œ4E€4*Ð o·\gk°@ï™M—À1_KkŒ‘!úÕƒ§Â¦mš¹ü›LlK(£.ôE Æ¢u€]¬½Æà ·oÐ"¡«qÄ MÈtåÃŽýÙ¥rjöƲ¼7`ª Sœ/ψ‘n¯ RÉG—°ÛQòþ18x$ìÙ¹”ŒØÈúo’óÝFûÈmÜjÆ—˜0}—QFfÉpÊ1×2ìéÄ­£Ò¦ ƒ;¤ù1Ú]º-8&j»ëpcÀˆM¯Ø‡órC6ÈÕ™§96¶œÕÏiÛ6éÏŸ7ñ$Rôƒ4¿ÄDrˆÌáì4UžlÇ¦ÞøÈ²NÀñg9´‘YÉVÊiòî%!é3ÌŠq¥#±Ëú–R<¿& Plkl:§i)Wïð3†%MËZŒ#„)Òíòôæ¬rÑ$ :Á.õŸ %V‘*!_bY”}Ê“kQš4öG׆ԈØEh漄 ³•H=Ô«©Žm\ôž±©&6¼Çýî50ËI-Ͷ҅@•gÅK‘•Õè¥ÈO<ÞC ón»“ì=ãX2ijœë®h¤zw¸‚&û1¯R4éŠ íÅJ*XßÒ¯®‚¤%’³.E%²Œ_ʦ aS\ÇÓÿ]à­ÔÈEMÊæzG1ãä¨5+š‹pv¦‰¾‘¼s‘â)IÊœ¶ÜÄ$³m©Î’ð¯±Ô‡.GôôMpWšà¡]Jø²â1Í÷i­×⦩Z86n½é¨¡õaP·6äîôí¸#Aªèi\;ý BÐÕ¦p‡>S\àŠÖ;] n“]a¸šœaÔñÝl? XRþS,c@²]‘v¹ÐÂÞ… ÇJƒÓÅÕ$’4¬Õ Y´éq…z0ºbY°*S#Þ Œ'²>ØÚ1ú³ÎÔ €(:°øø°=)ÃCxé8íË@m#ÁYÛ+¢ó®`ÓÆ¢Sän‰°ROûMl*ÞI~g"]ÔQ 1'ßœÂÖƒðÎͤüW†¨Rõ-é,Ä—È”fžåÙÝiG ;eÃÒÙð÷Æ!¦àúV š¸,69—¤ßË÷ü•ìŽV÷ô«{Ú| MÉ%µ¦\Çþ7‘ƒfÍçtí!ªãäȆÌEìa‡'+£ ìK›ôëG¦7ìôwF –np7½+cb|Tc²Ìû ¬@å–6ûn)YŸ¾SíŽû™øŽ{#ª{}·cæbJX7kŒ·l¤$´õTÛ©o½Ý‘‰|¾Š>|Œ2€’Ø;Õ&í “ÍµÐ¢!¸+k–À"£,¥]¢LýnOZwaåýŠõ:ùaß9´ÜœÁ«Îƒ;PÑ ž!='‰ÕªeÛzÜA4¼µ)HÄjõ“ÆŒqʪá\ë|·“|ŒEƒªfÎCdf¼5+Jïí&8Ù…˜Ì²¾'<5]n¥ÿZc³s ¨°G½¤ZÐñ_ƒòD›Ó°|Ñ UW£Dþ·ZL°:©ºÉ%´¨b:,vO-ˆ×Å'û»¨±¢Ÿo¥¨i1p _pÃ#ÿqk8ôb²(8ׂ-X¬¤R„ãàŸÆbìü±XÜØÆå-fª½x°~—¤'WÓ)HK‰VŸh·45ÕýúÅhíüoJ6ã&@ÊçŠ @ ßÖ'oeâým^£ ŽçÞAm{£»~7åšÐ¦ ÎȨ%`))~ì#„óØlݯ.øQ–zÙòô4Úz÷`Ÿ‘²‡D•î@Š ÉËéß¹%“ŽÛé°¿•XsCAWÛÂúmM&7Ðgw×%ˆ`_ÜÚ«Ú™ƒ"ÓŸØsÓ”vVåO<½hóP !4CÛ°öÖšHVÆJ3ŒÌhtx™ÖVåôkƒçêý.ÿHªa¹²cdÑØ¶ÜÆj8_›C–l ë/iË2>•Š%ùƒ•Tøºˆy†çvʧÌ{ØÄOæ÷­S“I+IìÈpû¬V¦¹Šæ6¶]64ïƒTvñ¦Ú@¬MçéªÅv3’ìõ;mÆp¡ÔênmÕ‹'?T„çlû,ÛÉ…¢rw‡ôî“¶ƒQlLngzî¬õï»ëm±6.gÕ0¥ •Ä^œð–X§ÒKͦ ‹ˆTM°I=;ôZØùŸóýä$üºùɤ€=ŒSäæF¿W ذÍíÜëg¼=6^¡Qȸ*p”ЭeHÛ—ðÞtWS+¥\ f¸„H#‡OžT~c©¥ %œ•Ž$ò þ4~Þ”˜í•û,Ž&Ýn=ÌãÚï/Áê÷Ã]š>^[l&¦±z‚Ib›;fcÉ¢½ÝÝî0窭lŒN³”*†›h7ÖÎlÂãtulÂIJS!Þî°Ž¦ µ•Ç×Zî1Ê[dX¡·à”´Y5CÂù›Øéƒ!Zw4Šß…ym ËýPt'Ó;> ÇhÎÁƒÁ_“ìæ©Ør6©ûZ{ïp|D=íhŸEo²Ì>Z‰kg¨£‡í“ÄvÙÓ…½™¡C«YǤԺÿØ®#ÀWÝÒ¥3ñl/QaPhÅú ‘ϵîÆY³rã^35µ·”Y(XDÂ(ˆx¾?7©:mÑKg õš¥g é¿€û‡¦ Rÿ£_F²Úäû2¡8uξ“ õ¸o‚.ͪ‰Ù¶'…ùßfYDïUg²×2þæ\¶µ;;f„JÒvLa¼f?ßbè4&‡Ý«ã¾1º¡lÊÖè.¾ŠbÙnúOÿ‘%¶„q†¹¥6螺K3§ŠØ.øy[ƒÓäÎEÔJc}ݧÎLàC5œ8q£Í­e€ªçt†èÃpÝvhx–µS1Zbwÿö1óÜ©c«2º½£I!ž©,M†©oj~¨&uH»>T*&æÏá5rÞÁ‰xïð‘ð ðÚmHð×ÈQ­-ƒNjäŵxíWt^ŠCeHµ´‡ÕB¢kŸp–ÅL°ÀÕû‡î«ð2…üßÖËtØÄàëo¬oR‘hÆÄ盎ø/w)«(Õ ŽÉfëTIbéù•i´[½Â”7F½·1×›ŒìŽ:ðÄ4‡-@ü“ì¡]@à¡CȹÕ5•V•,H Uä7BÝsW`‚$L«n| ©I4ó‹ì·Âv`Zq•üízÒHÕJÝøŸ”Ýù7§öÚÈEw†‚³ÐÓ§jÍþ|œé5Ú¡ìåZ’€÷+sBö„ÃöàDUÂX\—tŽ2ªœÛ7wp¬°ãiw òžíŒRs¦ó¦Ø3Ew¡ %$(Þª“º¾¤ ÃÆ-I'v‘b‡`Ѩ!IÞ~±3û}Ïœ@+RÂÆˆ] ‘pÍ`¥q0" 9fœ0Ö8Ïu¿GÚ): Û„«¨m¼É¬fyjxßA› jÃŒ±£ßT˜ŠÈ[A‚~‚WÆXSF’ï OInîõR7kX¡Æ®¦okûþ,z^4E¿CmŠÞ ÆNH¬Å©Aúûz·ìÆ•e[Ì×w‰$@Rªu|î°?Oê¶Ç¿I"!‚’¨/7ÓÍp lÇÌ2f$XkŒ½÷ØbI$dFÆc>ìµ<é–¾©í‚áË”ÈJË‹¬¶“°†|»Q¥ž]GIâäP‚Äï²ï.“žf³ùÖM<“Ø¡—(t`âQ*üö?&!”ÔË|"v×èm;`¨ÈÞHAÉ9ÁoT7c`6œ‡®þ2$! pÈ眂¥á]ÒŸ©Ða¿¿³µê)#­ò @ä¥.¡¨£•Üî$¿AEýÎß|jÚâ8·•æQÒ•¢KšðÌDš‘Ýà!e߯ "< É»²Kƒ±8:Þ‘ž¢ëDiîöÔ±s‚5T·Š¬©èðMêtýUãjϹìÔ{SÌþz×Ìr{wŸÌ®ñ¶êܸyRCÁÖæ<ÎOrB˜ û®¬¾ªOU»ËÚG(W(yëú{méÙéXèØÊCª~÷RË*žïÕ0£ˆ‰ìaµ›q;Zo@°Þ›¤ô|¾LRFzª€û•÷Õ)‹Ï:÷ÕíÆ$_y×ÖzÏïo¹½­ðÒ²€„G×¾O”}¹ÎÌúWhÑ=36&ÕÓ †R'š"KÒ ™šø]* £ÂÇÖ©q¬è°H„Åk æK÷åjžzûÎPOçéBm Y“òƒì­nî#B³Ð ¡$ãI¶ÔyÒ¿Îk‹ìd› ô“É«7A5fy‹û¬¼}êð æ`ižªgË â|@çÑH19”@U¯2ÆY`Æ™Tg÷î ¹&Π"7õüšs¹ì 8“‘Qd?AŒ„žëÆt¬aF\&]Ÿ¤¸Û:‰u-mþªðPz-Î!(Ë|j²NÜßÝ%i\àÉÞW4ñ$YÛËzw6|>¹Ô4ÈQP—lDùáîVÄL²îj”ׄ3„ œ•<ÜiQ…Q1`oÉJ%ú­t¾>p•)hŸäæ3åÿ·‰þèt$ÊŸÏâpvíà¤{£‚Œ¶”©ÎöÑžŒŸ³ ^ñãV ƒ=C¨Ðcå¯7ñJ·Òã;amBáýÛH”Ë!.O’æ3…džK 䱄.·²Øy¹ÈuÅg$…2‹ðœ'Y‡ß¶×q©7¤v˜_ ^R:ñú!'L—ºËF»Íÿe[yÀ¿õ²Û\ºÂ2¯h·e8£/à*¼ytY÷{†ÔÅ‚â*AÙCûÂŒÞ"®¬pP õºÚ­Gp“Ð…ÏP:ërM‘²¾ZjÀÜó2:ØZÇì?½öWÒˆ 0ZnJû=ÜjÒ!È œ`¶}bu©-kG‚Lä²³÷`«úN¤ÕìÝ[±’üP„¸êÚo*Óì” m?=ÛÃ}-ëRÊ*Ò°‚(zkþCª‘¾@:©™¨I'$Éq9nîI°)'©)ãÛ.£Ñå/.Ó,"JÓÊi9Àÿð˜ÖsÔì§z˜z#Yβ~z·å£|'ÇêÛÏ âçù„Rœ!a~ù§‚‘ÛSÅ8Œ:oFͪﻵj(s5ª™Þÿ€žýnöOŠ )žOI×QÝê¥E«8™±S¾Ò|ªäwéÎõ_Îï‚CbŠ~6§‚ibÅûw¥' |!\ñ¨Õ'¯x0Ë †ï—ør¿öf¦¼§ŽÙ/˜òù³‡I4’ü• üod%•$Ýœœ½ÐŸ V8hg™iwÍãÔ ÉJÀo*FÅc5ZR应ñ –`/«@ͼ9ó-' ÿdÕt×Î!v@óSFñ´ýûZ,×}´ð«þ™:2ñ”èÚÛù"pß«¸û‰-÷Sf~(èì. :˜³…ѤMá Š¨Mü®ºÃƒ› g;¦ôÕ¿‘†]™œ¢=<(ü›©û®“/Ãíîî>pœ\ùaúÙnþ  ÊÙálj@§r–£J—€mØÚÓý­„å÷¥ b"šjžÑWâ9„¬{ðä÷±n,W>,>MÉSôðah«Ñó i³Ž—ÇÍÞ»T}DN%®ñ÷ò–_à@Ð÷ÞH2ðÛÔ®’ñKˆ° ‚íU¸Œ+”ɸ©i*•‡_ÇÔgžzrù{¾{ëöÇœïõWe3)¸Ö˜AãË_–—䱤}:«±¢à¡ùWšÍ­#+ÝØÉê¥ð¬ LwÒ2¡ô¸ Dõu–Ʊoôê÷ÔRQÅH=Üë>ÈÛkÒ–hN³CÚJM,8Åï<ùzŽzž¥¦®dôDbèoò)Q„ÝrP•+&‰½ù‡ºé G9e%ÁSPÀÜ‹ø·%›ß>ºÊÛ‹ïHXpär3ã7ÍE=í“פ7%O¢0ú"Iàg|Ö¡…—Ò›%T…Á]—ÍWcø#u]ÐÔÓÌÏ¡I\<w²ž{9Ùv î å>ÝbäÞ|:š!®ôuqz17yZo=Ã^×F#reÆ¥ûqóþ‡Äívï¦BÚKDlU}ߥw7ó/9è„æ(äÁIèí™Ï~KRqñžŸJÕ÷Ë`øîGY÷ÿLÑÔ•Ö(Î?Z+âõk®¬$r™™ÞAïrvÊ æS QÔ+µ)öæXÓ«“Š·ÈlF–Ù6(uŠû¨®ý+y©}€@ Õûák»¦á+x¢¯õ†µ«VÞÍ€a9R ©…Þr#eOo@E #µfœ»^ÊcÉ:• ,a,‘ÜI´©ÂÞ "øƒ…ÓÌÚ%"ÑtB7$Žó±ú˜¬tÊø3©ÇÏg½ÅäitæQÀûeHçgíÀ1’‚*žìЈu„³Éd©þ0]P’ATwÜ#®`ꨒ’¶àp„þöK w3éú­ûCQ²†– ·‘PMÂ$Åt7÷ð‰"oS=¬k3ªE(è#–-Ï„9$Þltµ8ù0jí“~ÀìS³1´ YM’©iümqÈ›+س‹|¶qöTÝÀC1U²Ö®{ø±Ûöà T;bcÄ9î*ÛW™nº½WF`¥HO­`ßrx™16q1Œ–OsXÚ­l!B‚Þ†wˆJÒ?šz*{þz#ë(/’o꫺…­…?àâ0GÒEmçíw>9íž |M«.1Œ[» –uŸœ©¬“¬€hª¶6ðÞݺ‹¡-ÈÓ‘ Z_ã ð?àjAJšQ®ÕÑÃñ4YMH©ÔÐàOܨç"‚ . v,‹“ƒßEE1épénuhè÷Ö`˜ ¹@};ñ›¡_kß—µU=– Á¬§›|—²&«Õh&¹Ïã»øPžp^ïãC"`“Ðxgº“ö˜Ö •ŠÂn..uä¯éh¹%ù5o JšE<2ŒrLª½’úÜÁ+‚nŽƒN+y?xò(rE¯k®HQ0äµ+X·W“¶nl#~×KÊöIµÀSRk\`cÐ>ZXR¸p€‘šo¾)’âØ–Á6nù¼Y"F†ÈòÖ£¢öºª±ô“òVBÇS‚b —eÝ•òÞ¤_q€ EéΦxê •€Ü'cÈp÷ƒ*ÚÛ½«=—TïÍß ïy%€.þyùµ=çÅs#®é”ñtí@ÐW ­”+jmG£ÙÐBIÔÝV'ŸÅ,?§sEOq>w$Ó8žÃx³S³óæn‰kmÊ-¬sû©žõµZAÑ$ø´Ÿ°º›/†ñï‚fnˇûL¤0’àp”-wZÄ/½5ëô×ÝEOz˜Û7RªzsøÒg—4¡6'6¡ ªž 7ÊZ?«Ð)ãn\µ·8‡ëj ¾»DÕM’ðíïæÇ£&i¤^M¬›6@48k}¶ˆÐ}Ÿ ÕSáÜ`†”lögî»Ùcª¾Íì½ww6Z€ñBJFnFWï–¨F{û—šçxy[Ÿ/1B«¸þ¡<%˜í{†§ÅgÛ6Z1¹fo¼—/µ­k†üB³í¢ª•š©œ|Ö“kA9ì%6bÒè-'às¢íîTé4÷£ÖµØuÕZNéÏ/½£üØ™¹Ò"Ø/Zï寧õñ¾œÜj›EÚŒdì ´¸›#Œ‘̪oO¢TÁni¶ yµÜör–V7ö¥¯ÔÔç©AGw2Hág£ülÎkhƘwowŒ¨ /þ T‡kLE¶@äâžpÇ+ê賆ڶIV½”'N²2 ˶=âÈ)S’×3œÂ É·Åv¯R Ãõ[%®õ BM¶¦Ø æÐŒkñœÔ¹Y ̾¤²­‰<¹­øF4úcr1ÚÉý¸Óx{^>yuî+–]]±V:·º)% &ÃÐÏ6äÐdâÊzÉ ˜}¸ 6ßñì²ÚdfßÁƒz¨¢Þz«ºê[¯¬H5c!ž‰> žÔ©—‡r¶E ÀBÏa=¶wO\Y¼Vö5Û`Óß ­ºê4ѳÞJžÛhò}ør—Ú}™¶b È¿W¬]6OåmÇG̳¹*›’®!Ň¥€àÇ!¾/ñ;x%éRrß0\Ð8&˹(Ì$èÆ£CÍŠ 1ûp.4”}äqÖ­‹OÊÆÑxÄ rÀ:KÙó¤ á|ý…wí´…ŠÖTPÙÍû+i;o7ÈYAS¬-DtÔd!1d’ºU7b\çRË=âdft^óœ²ZÍ{¦nu#š”•nxJ°GPê3„>#žý}fToP÷UÌÄ2hvi«Ð¶Á¬;׳#õGkÔ›üix‚$q¶Ð'ˆÍÒŸŒTdæFd“|5öîûñC«ÉñÖŸ°PŸ4(¶³Áò&^,“2“»¥è£µ<Ð1ˆ¡ŒæÚ·YmZº\_K™‘ÜÌôôRÐ ”“ ­·Ú;yóHö!õèÈÚiY1ûôT÷4ÚÝ>NçüIܲ‘4‹]N-Eö5¤es/Ó k<  ÿ¸‰EZèVTdˆÅDÄâh(ð+ˆÃ0ôbQåóšP9÷h •~ÇvÊÞ<™À¾òJUÓ˜ô§ ‰þÎîšt>ëjFüýé³³åZc¢‡¸Ú F€j:Y,wîðy{=N²ÓTX ëÚëFS±È{鸵±¸H¤8Ä*ªýý±kÛ,O”ú幎—‡A‹ |÷{Q¡ ÷)Õ»1^òf"N—mîq ü1èÎÖQWvg´ì[àȬhÙ"âLm›þ§úr -lTŠÁ‰ ’72 ù0^ª!éAd@£Ã>ÞcÓ1ËWÆÕ3ÒV–©Öô$ìÆüZ÷c}%Ÿ‚Ý xdý«¿ç¶ÉŠð¼…·ºàRÖV>¢éùìí 42 '¶7q…ß $ü!æ,wo,¼p¿”Ôš¹ýº }dQaø{¹+‘ÃÓ$åè0n/,Á{e-•ªÁ0ŒvÈŒ‰`”T¡¾ùmØ3ßžašEüû £Âý’…Ø×ù ¡N²‰TŽýÐwå9p(1ñçS! ˆ†¥¨íÄ\lü¹½·#Šï‰@¨Sp ”ÃFÝá | fZ8CÕ|=hûÀîÑÎ|POÍ6PÆßiѰ³çÕ'-Öò¡¨“GAŸþ 5(©ãxm;UnÙä#:>ܧåÚ¡5¦7ܵ}wbŠô!ÓåP4Eê{­çƬêF—vDà1yFàI*iû+ AåÞ’CˆÙ[PYŽ% A(ÃVã,e+Ú©$¾¶v¥õº0Œæ8ÜA´Â‘¯³äáI‡¶Ew¶Ú™‰¸ÖVbýE]‘½#\A{G–&«—.Á&+ï-@l `Uþáx@/÷㜌®$(pïÝ—âò¡Ôm•-!iô”,R”¤‡àµ“h{Í«ÚL 1 5ØÙaœŸ ˆª[u#X•÷IÅ- ~eÐQX Ý¢üYª>Ö|ô€óD6þ¬£%7.ääìŒÿé3úÄ0úqâ .:[»‰"¡¤·5¹…å’}\ª+—0+YîÐ4#2cê5žÃÏ×Ä¿'-õÕûg”“M-çÞe| ’ž„ žú«ÇR ö̈ؽOÅ“ N²“²­œ?¥Þ’CåẠ^}C’–vØß£»º«ÔY¿Ýgá ën‹Ôv‘•.äZ±þÁ¨ºì†DczqtŸõ'Ù°$*I’ÀY…'‰«r² ÒÊ‹ñÏÕ:Qžÿ$–kïCß2_éÊ1÷s÷÷àó´¶@‚œ·ùÁž3‰#k–ʸc0tªÌô<èNkJH €«Z&M6ÿІ^í'Ç*3„•D¦Ïˆ‚¸Å‘B€¦ën4ÜOú›¹'û0—$‡À£Ÿ=Ü™€«Q&p½’“â‚R¸$("Fáåpv~šSÒ‹gcr…ÍU4–àvõØ´ábý(`œziSqƒùItä°ëÚ6ôâǧ&œ¿îáãÓ·9‹°º{—#÷rúLUc4_r0wÉdÍ~LgÚOlk”½OWyº”{uý£€QñTV§8˜-—ÉíNéó„ü2¥"°k(ª—šŽä0ae,|¶c=Ò*ó¶„tŠC"Y®ëîHDijPn­J2ņ#èb5œHc•÷š]í‘Z‘®gtögV™/ #j‘ÒIIiçà1½?T1¯µÖó¡Zt“µiéuYiœ”ªkÖÇÄ£ø„¡•}xò+Ýš+ ’Üø1‘6ü"‰ÿpö%$ÀŽ–ªÁ’|n„¬ä]óDzI9­Ò:É+Ñ0òÏOæ¸<òžDÚín–ƒ¾$1èã\U$©NÞ_`/çÄý¿Šn\²²Q¿¹ì¸NíÀõÖî6YW”{p"[.®Ž€±pr1 Å? ¢ý-)ÊœæKÉÆïkçfC¬[¸p¾Y·¸ÝhK£*Ñ,WC] Då°Ü}ÒEàhiÓ)qU+ éXÀ?#kh¯´¤ÀsF‹ÎöîËÈ]}L½åóyP§ß—b Ï˃¹¦v^øµÕNÅ3ÑÔ£ ÇSµº,<ƒÌI¿û>0†Œº¾o‡?l¹l)Ûjá­ƒK#c¢£±gt™vçf‡`ëžQN-¿GjΖÁ—¬—š–’¨}M’:ïeÿ²¬¥Ò³øC²ÉCŒ¹v§)^KÂC““ÿb›‹y é µ†K8õ{Ÿ Z n£Îrô³Û[w3rþhÛxÎ7ïãDŠqȾ¦ÎNS•ÑìíýH–ü°%ÌQQ+êÒ°Öv ¥tþù혦ߒÉu'šÂ¼yÌJ*l7KfÅŸƒp®¶½OüáóŽ)Í™aì’¼0S{MTöV•‘$9h;H#É UꮤO^ñV †yµÆ}l¯TÀîP<Üx±Ðq%¡‚í.n:“;Þv¬>(9Þ}65šŒ7ƒîßÞúpªÜ$© ¯9ü0åäF[HûP°Çì5ï (#‘ bGÐбùL˜~ßEdñ_ìHØË÷Þß•aM*}qqL^ à4CìþöCYÒ^lªjúªŒœ¸g2Ç¿—cì‡ÉþõCo„„YpkcP D¡úRžÅ! ilwÊÁ°SÿHjOYX.Ë+«„ —}~èR:»[mo¸Õ£kíß%ê…Œ uƒUx=j—<JN”«–¢êwÓƒv¿íSû¦ËrÃŒõžî+Ã?äbd'gß µ†¼¸vzÜótª˜¬ÁX j’Þ½·Ku®`>õUՌ֖0<gŠ ,ôŠš›«ìt5ɽH‘)ª%”Ë·«ˆyþ·C¯ ðÞŒE}ÚÉ? #-¡ðÂZâGb½ç¬Waæ{ãûXó4w¾kA¤ìT½ì 8wÅ-}%ÛoÁÎ%p«TS£aÁ—>—?i{Eÿ.þÉk7½ÔV%zõIS¥‘ìabsð­„lŒþâ}h[›3!»¨O¦•놻_ó„°j”Ž'|zÝògíOîê9¥Nî·Tí-¿ö™r–ƒ§¤º•”â_Z¹®å@Ä]ا6á€Ë›è…õPǜ •& òË€{Ðañè{zÿ|£·}xDP\GÇÒ/¾cK7bcBo&g/¦2ˆ®ågýõ·ÒÃÕÎPnàŒ²‚âßàìöÁ9oïU9zÆkgz€ˆH&9ÚžoU£áRÛwÃp©Ø¿¸ìá2qŸx#8ŠêE„c]?šñÖðmg‰Ã '?~`=’VQj_ŸÔîÇ"€¯NV?߈k-Ëö‚êH³ɉ¯wZí’ʼnŠÈÇ蕬;¡­í½tŠhl»;cÆ2' ¼Ë0«ÓßuŸ³ÎwaÆ·ëhÕCï5z²ï'ëõ¼‚dÍîÖ®ôwEhIャ¶qxÚK0¹&(K¿Ä¸a,Ù šI¸)ûÀµÕ1š¤…Ô¡ƒ2…,v7ë€RÙ~í#(…ºÉ˜¸³kìX"›E™.Ùë7eÍ6ÜN8 @P&‡M`¸>xÒ,Kƒ˜ãß`ðäuÝ·Fûôà5>-ê,û®áC3¸ÇtµœýÏJf”°Æ?˻̶|Êh;5<^\õ=_ ¸ÚôIªý'|ênJ(‹kM‚¯X‘Û³‹,j1Í´y.{ÚŸ²©]bâàûòüZÚ.·®!®WÚÌ}=ɺ/.þФZà4êl=È,þ–µ(hé…͈qsL,h ThvÔÙ|š/»*ç T<žzjt|Ý”Ô(uÿE]ø×¢*%kª,rìµàæ2=L"¾ `«ø Ѱ™ŒýÂGÒ…Ä8ʬ¯þ-=ô Îüµ^¥†•Õ‚ ‹5ê“ôZÅ&ÎóQãI*ñš½¾¥ö/^¥BC¡ì«¿Û[×쌺”ÇžÈõ¥0ð}3]Ý»õ+½ËC1úYòÜX¤åÀ¹¶M?v ñeRcÆ +‚ÃWõä.ìÎ»ç‚Æwx½ /ì’Êc2²ÍažtyÜ¡k®‰/ÕŽ„À{·¾pWÉŠJÏá|±?Ö?‘¸ÆKdÉJÒï—ÛÔü4$ï¹!›Ó:eÖŤÃâÖÙ/çPvÂõ!5ñeºzåÞ8”lÄ¡„qÌ´¸½) JíBÆüË®GþÄg¦Z:ƒ¹uŒØée+±Z’£ù0¡ƒfÛÖ^ÓÕÒxä:&¢ÇîPËÒX`Û¤tÒ Hÿg]‹zY '¶YzD„…ônf1ÆàøëÖAw1¶!ŸŸéü-tå{šŠ\‡æ 3ÌS—þÝùžö¹—É!ƒåÆÇ­þÚíûÄÒƒÐCei‰WþÔm"» þ#:ØO[Ç+yñ-n íô®! ¢¾?®ÙxÂȃ¨˜f[3% ¬ÞWVBÆÁ°ÕÛ^iœZ9‘%ããmÐ’ÑJ•J:¬ÀY˜ QÓXGUj锪¹gƒ\këRÔÃÉÉm7¯³ ;‘À‰O^°V£‰G‘*qNrXb¬în“aÁµ°˜@t|©´Èåƒ7M8Ù‘ E…sócÍV¶(éL´ÅöWPg-ÿ‰¾‰¸AØV?i噞{63< ë5¼ øL]!R@¶%­p?/2¡Pê)²¼Î†ΰ¶ÍÃr5ÁJ/ÍIÊT‹Ý 6¤ª­‚2¼øÒ$ëë³Å ¥œòÝœS9ÛÙÚ,ÖßL~<Îd\«Ö_4`¥Ýïiäbiޏ¿IG6Ÿ›ç|%~$óœ{ð§i\9íh­>6Õ;eYºc7ü„Ï&ÊR^»¯dt}BÆyÐ ¬,ûF‹ì[¼ÃÕÑQ±¹aäø<ÓÚA®‰šó3ãßV[¨³ Ìb)¶‰&ZR¬ln¼hN7ÂxK/ýÔõ'’þ%J2Z( Û$:@ÝÞò ª}±Þ êüD–÷˜T &tßH˜x…¢ËÇú„L†Â tÔð>m$Ï“‹Ö_é!µÎœ›¢ïM›®p7Cï(@{àd~üàrèÈ×F\.(’Çèøán•ש¡võxÕ»•† ÓèU€E’Óâέà»$Ý¥E1iBª}_\®mÇñÌåg>Ht>W”š˜ÌÝéôϼq<}Ï6U&ïÛ{uyë;ÐOei´ÃhSêQ÷’šÖŠ®éºë®žw…fP øE´ä7~õiò'Ûï¬ÉÌ Ñ5f)î´ŒåÙâþ m/Z-0 ‰Ï¥Õ&Íïrn|ÊšÛ ’irHÖz"rìO¾9 럶îÞWìJjcE޳œPèI.x‘­±nH „¡ß›Ú‘ù{M8º“ÈBî¡­|³–Â7´¨ÒƒÉrÃ7=ÿ‚À+`ï¿Ð,8¹‰Fdž>ýD2ýuñÝ4…ÜÌæ½3,—¸i O û›Ç+ôÌt>uõ§ÎŒ ö‰i&¡ƒb›&‘?J‹ŠS0¹Àý—o¼\r,múNf¶ñú2Â%ÌêQºZ“y”Z‹GÑìw†ÃñS\i)KòÏUÃê|ðÂzº¾œ~’ùJTi¹®{’ú®´Ã-ò¾ÄÂ"N³Y{†³Ó Îf¨0Ákêh &{o n‹ðt»ªË{,|ÁøtÆD¥÷æ¥7h²Ž‘”„ŸJ&lƒu¼ ¸TØ’k#¾CP‰?'¿7U)MÚöîäg%Ü畤øÝ+GÇú“è·Ú™ª`íœ`‰2¸uqÛiœr?%Óõpû„XÎ >+‹U ›樫ó\Ÿ˜“‡žq óªñ&³k 7ï µÂ˜ø½b,_œýÔ³Jd¢fZý¬… «ÛéÇÍš:={¼yLè½²PKÒÞ{ÿAŠŒên¹œÇðj{iMÓX°íxìP ]J˘[pœqìÑT²®PGdqT4~Kë)ùqÙáÎÔ2ÊÏTI±+ïæ“ÑŠ!ÖÓ®€}XŽ[2®\‰fmÇ*Ù]c™Á[lé¡åRð™VÔLÞXHÙðhÌþØCc$@qgËPÚTr®œ¸JZ­“—vRyžW 5†aó¸Þu u Ž^ÁS>ÅWSÒ÷¦ºÝ ýæÎ‘Vö]‘ÜÚ.þ\#) l¡‘£†é›»#‘®7[ŸR«Þ0fE§ÒK;ôÈ#´»8ÛHL6+‹§ó…N¡±íÓÜK݉€Š‡°Ž­kÕiº Ì\´Æ'9¦l–Ć;l¹×ä÷¡n:¶yøÓγÂYœäÔ½ ¼®U/˜nº.SIܲ`6@5Á¯ UØ›ùSA'1Á„8‘qÓØi¬ÝIê×O=õ‚““Ý{…JP©¾ƒj¡›ý…VØJ o㌰ªé& nK„ i¼^ã«qÁ þ«€Ìj¬òëQî”_;|-*fa ËSŠÕ O&£<…U¥H,X»ŠRƒ§ä×¶%z6ïÌo £Ý?õ-¶®_7Î+ó0Ðv’%WC÷ýð]s=eËwæo6eMülNÆ%ýÔX,¨’è}¬fáÙ͇U x²'Ö¯hDÙÇõ46z 0Ì*ùp†¥«¼/Sퟪù˜®T{öƒ"›TN`nÓFwíá)ÐW< Jcú’IŠî°î:ϸȇá.‹Ä²ò`¿„"bù>ï˜w6 W©¾ùfC|puKÚ|ù‡ÄŽÑ6Fî_“‚RÃh†€Æ™wäÊ­¬¯áø?ψánǯª*5ßê³åäÊvùÇ·RÍ``ô®/q¹½H>¡Dä‹+(qP<®Óêë Þ¶‡šoX@ÉÓ!TöUÕ犒惔|ÿLµio/’ý¢÷f>êÄÙÒQs—¦½¯‹Ú¡X?ÏZ­êL ÁFlÞa+¡ö+…¥}÷tËX©î}Áf˜‰)Y=“óÐË—ÞÊê½*ÆùÓA"á¤ãCC$°Ä¢· L™þuÚYNY3"O$)ϼØ;;_„?ô•u(‹ˆZÎíÃ1E®§.·¤ ·ÿ#q ?CAvÇAMTÕDÅs_LhD™ŒÈ5Ÿ b=R/à˜ËùR6Û húž­„/,  VRÜi"Y1Ÿí)÷ ùFlDZb¿°¨+—ù >L­u²–ä…y_¹[®¢pÃäû8•~½¾săÊäd¿ÝŒ¯ººéÎ=ÝEhêrì/RÈJ}HJê{M’mdå]­hø/èãkIˆçÎâü&,9´¨ú& ñÖG½7êïƒ0ˆq=ÍJšË= ÉyJ/îÎÛ}ØûF±™§Þ ÙRpãxGZJWu€‚y˜ŸQ¾:?îLT>Î*Ѳ"Fíê@b#«²T=µ‹Gô˜©Ì¶¯-$™{3Ñ9š…;D£# û¤ïèËBÇÙòµ«.-÷·‚šœjNë’‰·Ç$d;ÏÏT¨úʶΨÑÛ“=ØH™äjZ¼¾÷îÓ Ý<“» D¸JMâª/‹ˆZÍ”1¯´õzwrLÛÏ'I¤lÏœ¸Ä†™X>Áˬä­RUœ}Ð!M¡õI}ïUkúž "ç¯Â*6¬*Ö‘IØ-ÙÏãlZùŸþ—q)„8s8¸»œqõr#Aòü1á[>¿ƒlheý€•?-í.÷ͤÙí™ëcùÔy¬8TI¥mNvde|œíÕ5,Þ¹¿4¿“m.w-òÁNÝ)Þ`ô‰ã=81&›œƒå3ð aŠ' ) ÿÔ?ûÅnÊ©¹ÙGä¡Ïªâ+«sþ ²Ü2Å~þ(‹æpr(Í‘K7ÕÛš¦y(ánb/ À‰ßâ%ÉÓÐCéV«AÛ…ûÂNªO¿wr¡-»L|"i-j£‹rJä÷WI׬ñ;DBeÐ<±ú²dŒ(”5†–¾oêyÚÊÙ$z;6qóF/F§f@ñiOÀÀîžQ£ƒ·Dn"!_;¾È¿0´Ž_æ]IuÐ!8Û6+àÇM!‚;ùHIÄ4Mñ+C˜jÔõnÑŠßVߌ”YÁŸ2P­ù\~õÚ¿•Ô»=—¾¾k+m3ÍÍj# xƺä_mä;z£Ôd¸æS¿‹$*ßΦ ¦.¾à›ƒDuñã~b/fV )¢³)tÝ¿ËLí]Ę.\ |tV8"tÔtºW ;maÁÞow¨UÔÜ;’0õå–heãÛsjy6»ŸŽÞïå]>^[)®ÖÔvÆBB7ñ(®;A8쇟ª¸XšæÔÛ`{üq—æÔOÅ• ½‚¯Ìj8Çkwlf–ÅŸ¿BW@QÖsw3Æzfˆq@ 7ŽÉ£27_EÕWF¨Èp6r™m^UÔý­csìƒïËJšf_W©Ï õR3ÕGV6‰,L­[q"tƒZ àS oȤ\&gÉnî¦Å}€Œª[tl«³§‘˜¿ê»Óƒ’—þ¡(ÄgÄØ<`p±çš³ÓüɰA‘Öhc˜ ô©QqU~ÏÛÐHõúE+•ÉhÄäð-j¢_o¼2úéf]LTn/ž(‘—½™*Íkf§uÝàÈ¡°G~Iþ28±9×>ŒíWÅ{vm~˜ù¨Ç·òo•¡/€„ÅŒ*TÁÈZvùPø ®àÅ9wA¾X‹§[uÃñÃtP¥î‡®€_lղȑ¯†àÐ !ÑúPÄ>˜Wa-Þyªfõч©á2tí7z0·él¿Wò}?¶Š¬KÂÍmk9THRbF„iŠä†")ûV'Õ‚-zͺµß¤)Rؤ‰Ë+1Úk~ðˈÇÈuêµ{ñ¤]©-ìÎÝT”þˆlûžy§ßõ7ËzˆþÝkš+­ìŸR>ÒÁ—ÅÉÀ:ÉåP¦43v ‹¦Ú÷…ùpøtMZt%û=µ·xr{ÖÀɱDh !#¢iÎY…TnÎ\p]õíîM”©ª‘5ðS—âÜkÖ™_þR ê!²5&æ¸ïG(7ƒÊB1µHH‰€ü¦œê’ÑÆ!Lø6N‚Õ>pñ^z…2à¹ì, g3¸o‚{.ö°zÙ]{MìºfÊõmÃp;$>H “ NÞ£ªÊÙyܱ>ÉhµyiÈô(Ý< d,42U{FZiûæ"ñ~Î|ÕØX<¹«œä?•‘š:×QÍÖclŽd>®KµèPRíö½ê¤F{w}ø ¾y;™Çð '?QHGJÝ0XÁÜ0eB¼&RD?y‘áæíþôßû„Ùü3Mÿgk4 kïä•Àî4õA¬[¿wôœ÷³/tEþÆxi‡ª Cã½;R^¢qP¹÷în]Ww9CGÛT¿$T{új­Ûw“e.þ@âǶûì¼´%íZ/Õ­¡J@ƒñµö]8|{EÒ<`+Ùú»Ü´°®‹´Ó²èŸSF¼Î¼RjÂj• “ßÕßÚùýÑŽL™´ YÍKƒÑ1aHÅmT‰:EGV ÙüIóíi²ã•òØûE}–'9•¶@/Ù À-3øð¶xŒM“žÐŒ< Áò‚Ð|\ŸÆ×r¤ôt߈…Šoö¨úñZÙ ãxjÚ=­›SðÕZ#G6[é唩üÌe·•º&Ì&pTdIÊÃ&Rvö‘Áx‚Œkiõ£„½RŽsKOv Iîï%º& ÷DýR¹KñL½*鯵{žOPk§Žyî»2¼:_ÐÜŠ?0ñÛÓŽo4Ô|Bzäž&ÈôèÖ4 M2öÂÚ{Ÿ•º97%ùò•r’õJwSa{?ÔÕ»WVºk›L;jíARÜÊð_$0bÀ‘‡Žã;N®ý”3äžøÚ'¼8[‹möº´ñÖ²/å¼â݇ÝúX`Ú5{7L>#ÑûúËi×p‡ãÝ£¡lÐÌ ~CvÛC_¨Y ªó¬È;ÌKÏÜo;c¾|/X“ií‰Æ8ì)œFõQ óËé(8Lôì¸xêGn‘¤á¯vj—ª4ûºÔãMZ ̃ÆãÐܹ{¼ý øòšÙø&kqô|&ËÜ[»«¾¢b­ï÷„ºP c òÅD’}³šúg'w±·ï%aˆ¦ý?ó~Fºz35ÕGG¹µ\ÿh›&ZRÝÜZ9kÈ«ÿjÎ˦,7!´ãOý$‰"Â]‚f(˜p˜Ž«ñÙÏúÅ^€X¦Ú§Zõ[ ™×0l7¡Glß»j4˜;•w™;Ë™Á{âÔ§ÎÒÔ«H ¯DÏœdðÌŸNj’‘{„‡k×5ÉrØÃà³·­ØÒíŸ +kÓÝG²¸ÁÉKdkȱªÒa¬î´OšNTÚj”òs¤cõt‹ÄœäÁÐ mdCööjZÜ3·È÷9ÕvBw3gFÇ“×6¤šÚÑn«.õ'Þ{² ¾Ÿ2$}ì*øÞiLÂÃŒ€…<ÛL2 šI’ ý‡7tâÑ'Ù>Áæ_¿}$ý~¤À²GÁe‰“;øMrUS-ÝZÉ©ˆ‰×?4¯Ý 3^„ŸµQ×a–‹03™Äó3O¹v»HÚBu’1.ðñÝœssMíˆGþðÄú_‹dî:’ïÉ$Íw Ù¹­˜ü*û¤fGÙMÀºqNfÊ*Ú ®wŽ»Þ‰r—p0q%(y@†P&:‚³–Œööª7pפ3¤˜Ýx9`4Õx9±ðrè QÝ´“ßÿ”twáo¼\Ì ½óxE-#“ª‘¤ Tb§ < LKÕNe™4$"»½‡VhÜŠ>2ÿ«{ÏpsF¢Böž1zØ}Ç8½Ý§ƒÔsßT»QøùÂÑJÑù­¦Ã7±MΫ´Ãx@YÞ—Æ~/ið§œRœÊ¢xžÀ}›•GÂ)8òÀ3‡hZsÅ'˜Ø`czb3…s7y@¾÷8‡3—÷G$'ØlÕl{ì’y#Ž;cK, €›øß ÎÄÀ@JTKÈa ág)n÷Ñ8§d‹¤t쌬Ïþü:U³Xþž!„7(ù˜zв¥™D3B+m o{Si¾ÄÄ -I+¦ Òuº(¦×t½ò}h“~"Ñâ9Æ0s[t¤ãÐõ½L’—×Ð{¼È~hb›· =ó`OP¾í­ùTí~ p¡OïåĉÜÅ¥Š¿m7ù‰aÜéŒ9C2höDÿâ¥gãr’·øg2kžÑ®/™èûqê§ÏÞ7x‰q µLŠs8ë}ºJ‡wžÂ~ØxµÆ|%}øp~>-¨9fe„3 ËðÛU=çÊÍ';%=ÁJg°`±‹jÌÿJ]CZPî|«ä dâÉ1¸Ô„¥ú‡=¼+-ÙšÍ9Ñ50¶Äs-Èš’NRÖ»†ë§Ãa)í=@‚^”D­Ðnš{p*½¿ã§;;ƒ¶ÎO²£MIµŸçúô†o˜þIÅÙYéã¼ð,¥Ç ëíc“Ñ#ó;ƒ*ÒºÁœ€%ÿýX!n‚²þ¸£­ÿöQI™@R²âç{(²D7^làg±ÖøasvExÄ ˆhÑXµÌÙ‹Œþ+«úÚYnj㜂ئé.Á;O«óÿ0ú½›[Eªæµ6ËpÄ¿ûëöP‰°‹Ô< NT¢iÝZV´»zï2WÏ]è.äÐW~ƒ{WJ= ^5Úf^Êäs$¥£U8ú.„}쿦Kóû G;«=ùlR’yJ© àø >¡È^©îäÞ⚎oZû6ñ ¢kj$¦jm‹ì0/gîv¾¶Pª‰¼WÅlˆN¹?CÍz™[nõ¡—xrvSèuŒÿÍük .–7±¨ètí<¿Tµë)ðÑ9ŸP£rífp”jÙ±8‡ÄÅ)ŸçÞš'å~c;\«ât˜Ù…F["÷—˜øãJÂéO¥AJ މÞ;¡àêê0[ØŠù D4ZÑRºvì­–Év³t´¦º$eÎë|“,–qÆÎúÜ?À‚¹˜à¡gÄqÁ)‘Ïa{»­¤¥#¹§),ÆÃHZçgw»Õ•oãØuû|q„¡ £bE ˜@Ф0ÞÒB·›ª3ÝÅEX^38xP]KïÉW~bËâµ´úTÕTÁH…ù«÷©!-0ã½*Â7¶¹Øñr6æ/{уqÂÇÒtckøœ5v`DÆÑWоßJ'4úKìÁ•{,¤åÀ{Ÿ¸à­ ëÔMÉ¢[5z·î£«t4ºs±¡²¬dî3ÊRú|g è46ŸgõF¾ëíHÄbûýP(÷YëåqêsùäàÚ²çÍ žyDT‘ë|™ë:¦Ý':ûzTïÞ匤ðæ Ø…,I-S ŒÀ²å}¼.v]Æ/HMBçf¾LZMOô£%Þ´“3GþÞ}uýx‰õÕ÷ß~ÄjJõòa0;I­XCç€Þr.‹W“ïØÚUžBãwr’ß:š-C¦Åh1$ ð ´óbŽï¤úPo'÷EW9“Dc‚³2»I"I„è0¤&ÜÚEpƒóW…ÒN B|{õD'~³3¦Kj^º›ÕÍ5­î¤øë&²þEŒ/¸m³­Î<¼óŠ®F~$¿Èm2í¨,LˆÖb>Ö( ¦PÝ}xHÔ DϚƔ8sýyš»KÊÄqTæÐ‹†”FÎ·Ž²tÜ5„ ùàn$ž¬D烆)¯ŸRú¾ÝYŸì3ÉŸ5S"Iª²mîAb°^ušHÂo{®Mì_ %5<mAS˜ë‡×ØZáùÚ¯ˆÿæ÷ÈFtnA>ùGγÄB<×Sºc˜´XæËJñV29ÄIÂÊUc{fÄ…BÙŒ$€`3÷|ô]Ÿò1Òüh’Œå*eªJ¢ç?.)5߼Ʃ<) eßͶ”Æø&;¥:×êf)[Gz݇»wæø¿z¥QYf¦¨Úy¥U‘ØzßšŒwíhE¶Ý ÷ðX„’ù_­³VR2ÂÙ]Íqõ è<ÏOY‘¯%ÏÂË…­&*4úÀkbÁþîYJ ù¾d²°àXWvñ¾yèão9øéqM}Q³¬_E5¸^¢LƒøÊ¼''7 Ñz8ç¡åï°“­ÑÁÆœV߈mf–p2s|ÚùÝ«¯Náúw/õóƒ"h×;È`Ó;ÐUCìYËÂìú?äJÛi}víð7;º‚º›÷‰N§=4 åf²³¤Á¤þ=Jýå€I=D1€ž]êâk!{¬þUÂôµü vM¨cÇFa"óÞë{ µxO¢X,MÖ†Ö¢SAP‡ãP»ÿîŒæ€n9¾Fà1íØ²,ŠŸòÆ0ªŒ[Ož£Æ9Þ”êôÃrHÛ+ŸÀ.]8ýU*ÖOmÎ{—ó¨džpß•}}Vs ÷‘M³îpõ2¸'w¾T¬°¸ÍÚæÿC®sjŸäÉ{Àwòêê³'×0ß­¼Q.‘bWSô;B‹Q•g‰OHX½c†d¢¾÷¬AÃ(Ûk‰Ì©[Ö£†Í'.©¾rOž{ÁçÏ>`NÙ>c5¨¾éÛ›ÿÛDƒÝ?7×^=ŒºN˜«›“òdTþ £‘‰VÁ/=ñ?*„˜%ÆuèÍ(Äì`–Î`€+£Øèã¿ tMЦ«>F@aø½Ý¬jPvRôÅl+Àã’ŒrjPûdõû.÷4ž ºÈE3n{jJNŒSÎÓ.ªôh9á3øh‹…ȳùT|–§š¦˜ÐNsc_)Ï/_ôµÆ þÁ<‡ýOœÐaŸ_zi(2í.ÕWͬpWÒÌ¦OüÓ_ÈÕåAWgÛÑÍ4UL˜NõÀú›/G` ‰5,o’þWƒ”–b¹ñ :+ ¡nÚní¡j‹Ga ý²ê¹W$GÝñÁVq+éŒÓü3ë¸Ç“/5½1LÒ¦ßÞóvÌ€õðQ¹V’4ƒ2[è½=CO•-Û·8@ }ç€94Ð~ëºó(GêW 1°¤AÄa‰Â¶ˆ‚‹°Þ¨ÐøTƒhÏNDçƒ%ò‹Š}¿†^·ë©ÈÚ9Ÿýih S;"Î@«;™a–$4½‘„ËgcßPXÐ|釣:ý©-°Çê¹m½® *‘À%Œ¦F;œd%ƒ–‘ 2GÐ-Sm:Š+IŽ^4¬îMØØÈ-¾Çª!X"%IÓô~·2ÆÙ‹ÚÛÊá0Jù­f21ÚÍËñ‹Y¬‹qí”›K¸ò ÈxwpÔ–h {„^ ía×L¦U¶’HÜ£š•_–u$÷7–[›adïË4Û–þsðlÎs‡Â®ï>kÂíÀ¤Æó±‰ÂP3G\ºº—üJª¢ÛäÉš“@_Ük¾G+â¶¾Zž `ì<ÞÉ/îëj€AyœX,¯H½-Ùį»W÷›î†¶ÿró%A¤Gú†1“ìý“+¬FËʼ›²'O Iȼq Çg¯ ¤ÙcâD¿«¬¡ì·3³;6wïOuÀ½“"sy‘Ãêê8ìa•ɺ H"šZOá ã ¸Õþï÷*¹÷‰’áücú˜L^›°Ë…²p¾løIRü‘ný±è÷qƇÅ;q1£9¨žßI1b®úUlî/Iðâ#Â×rf–_@"ó%¬©s‹ÎÜ­í»ûƒey‡Tæà¹ºÝW]üP²Šl–+‡;B¾Žþå ÖÓs—´uö( -²ú ÝÃ!<\SÞ$Η{y#2(¢²#ùŒ6ÿ‰^†«’Ý …œ¾©÷×È*l‡¼éL‡í Æá¿‹ÇèQañ×þ7&  |êá÷`tKò¶û²zÒߎŸ€–+wÎ1² iýSm8cÁ'éi´W¾REr7³Œ¬œŠ¦#͈W9ö¤²#'Yx7ž+JÀãn©%.]Õ'ðƒ¼ÁÇd«©½GbØ~f tÿR}™¼Û¦«JêÎb k ­@Ú#l@+ZZ}÷ ÿšÁkRH6ÕÊÝ„Žìr?å$·…ÝÍ•æ\ Û:)„Ž‹"¹ Qà:D,k¶+‚}{ÜQ¨4öQ.€­¨,Ùµ®ù—À‘8’e‘¿\~㾻߫ùZYKËX‚¹q­c'{‡û£hÀuNë‘sã¤)´˜çwIûÎ ƒN…ý ªæÉ(¢¦À¬ÎgLúâ]¬Ø.]ÒùGwi¦¦ 9VuÀ¦ã|VÜå8±…Èköé†öƉÙUJßø$>~’w-o\1{L…œ9Ju7zÙØYs°|5çÌÐ ä)ëáì[/¦ŠÚ`gÓ±&ËÙ¬üc™ƒD±vÍÙÀÀG!G+LRã¾x|•’Ñ2×ܾ} º:fìÚ.à¯CNyQóµý½«î÷Ú(BÆf^ CO´"¶‡Ÿª’4,™Ðc•ªÒ<¸±¶õkBƺÇÍRa×'jçY. ‰4§Žj3è1Uƒ"x±–Ë@Û™”óoŸLzÙbBî—5 `ú(7Xßê¯ú«Z:`Ùµ¾¡­ñ¤6õ„¾öR?4æ%¿³Œ"àÛl×ßí.m»³#gEƒ 0‰xC?3L†ô# è•z|Ö6 9çššEõ3à:Y|ïüìÙŒZ%Õ«†ßÍ£3€ár³Â{’kýtd}¼ `Ê¿*jaxó4súìɃQg¢å®Iˆ–SÈþác¿œ ƒA_*ÅÙAiҀ؟‰óF¨æØø¤“¡Mìy“£âyŸ…줆¯ÙñYRp8¿Q?à[+§h›W×îSò?æq]ÜõÚ ›§FV·újÌøöMXžå˜.˜¡O`̱IUó‹Ä7[j»öÜw£^}qI:7¼bé“xâžꆓüD…:î-Zöu°IÚÕ År¸ðŠ5¿s¼y¾¹ú…{sŸNš9{Ô×ð{>Žb)Cäê¼…“Ö‰àí¤‰ÈX×Ü‚b˜Å·ÌžPR7ë×½'ÛéÎQ’%øáPKy®l¬àRï Ç¥-R´Ÿ x\ûÊ5OBÇœÐDCèÅÓb÷Þ3ú8 nÕ%ù™u¾›úlºçPd“WU¨!ÌA:ŽËŠÔ8ëâ©;“+_NÕ[M»S狜"£2¾Ûß8‚rFrÎÍêo|beKò =ŸZ¿m^}~§†»Å£÷­ Zð 5F׋^N»©!Õ–ÃN Wyý2Ðól^0DBM@Ÿíû½º=!f|=¡«ÀÅé>ÚÉ9’T‰ºðaÚ1•ð‹gªG6eõY©¼pb»xØ»²·†À#MO È $#¼•J•‡ÍÏŒIŸù“´W‹‹¤¸Ø%ºÍ«1Úw³Nè¿43þ]П߇á'ôÃg³©¶^Ž„1´x§Ž|Þfú…ÚEñ—{*}ða*"k\J“©§ƒñ'Åö.ñbÝ•6;„^æ@Z÷¡i[”)ö°}3BÆh,7ÿ²nàm¡Dª<…ƒ!S¯Ä¥×P~”IIîÎanªAô~JÓØuwpäIV¸×ÞËW76žÂõ[>Af2ŠçÂ…ÞôU$ñå{†i‡¤ß1 žêÛ&QëNÁ$Bï oÊÅ—½|¶Âòªæ–ÒÊnõƒ°´[à|)ù¹î$ú\,IJ$DV3’¥Eåí«ü(ÕÐÍvá6Õ•x;;4˜Ø¼N">ð”z¡×|«J°ñ»OM±û¨â/šiärÈ©{aK8Y?ð¾>³1 mú$IjÛš‚=yÌr4,Uºkǽ€<ÜãðFlmwfÛî°’Yî­m†73k3hꓜ·ü¹’›}™˜¡ZÀq ç# .¦æc5ü3úªM®!›§Z;IýØš.¸±3b&ßÊ´¬·@zè¸ü8Rß}%Ó½YUŸÆa?ÝJ$'ó¾ûœÌªØ†®j Ñ!²þƒ‰úsÂ÷ÇW®“ÛîÄ´l©ÜPßX;.È2ø/Ÿèñ‚²0ŠK¶&sx¦§•ÁêÙ¸|ß»Ñtj—þo؇º`•Êj3ÂÛJWfU\’cˆ±º£.®ö2Aj/_R„Ù—ÕÝMÆÅ's^yžUD«Vù”VÃÜ`nÓÉŒéÛ'S¯aÅ™‰d=G(lXíJ¬Ô›wrt[eÇ6?Œ»:ÀƒK.‚O¿îk_j›y.©V…Îd!;I+L›ú^à/?EÃÛXŽG`ñ,G"A\\ÿÞQÕ±¯½Ô·î½n[L‚º­q9¼öÖ™1ý¼%ÐÏ;WDºNdÉòYB–:Ñ0¯KüÙõU}e#šv :¥TíÀÛŠé ªvI$¤‚è|aòÓ„¼ecܬ&_þÞLR˜P;\ºâ"U#…v—&åz=X—4m¾GÞ N=ìlÁ è!!5ŸfÜG7èAø%— ×ÁÃÁ‚‡Í¥£ãlmuú¤ ØËi&×ÖIjý/Ï7Ôm€c%&qð…µ~à€òߌù:ôɾ*£¦™_Ü8xbˆB‡cûƒ€.£ñÿ“zª±&#Úñ\áøáõÆg"e†„ó6n\ݘà¦WXÿDb•è¾jWüÎfiθ°›NRÊ‹ÍÔöú»N ëkàÖ]™êýæ?ÂiŃI’'3o×B“¬zãÍKuþÐÕ=µÛ_Cc&ù &‚GŽýjýôÞ%Zr®y|aß`t &9QBWª;û‡KÝj3Y.-3;žÙ 1§ƒú¯¥½gU ÷±µJzÉù2£¦^¾íÙš£•OŒþ0lEƒA¾€Å@y5F3kjJù¼Š|f´f¼ý¡ä¤ò¯>?t}Z<É뜀ýpÙ ¤íN¾Ã0iÛpîUhí›úÐB§Ù…•·Êdã|ÛD7q‡<”)°5Nö?2½ÜÂ`Œp8^rÕœEo^IÖ7æMñ >ôó õgçßk;ÉØo·)ÂSƒ,òq´`–Wd>ýrˆS¹›šS{,±}ÈÝ)$el‡+å/R<*nJ”þž=Õ+¾ÙbÓƒÈP@$Ø\²x^oÜ+{'f~/Éûc0xû͹«>’«búñƒéJRúÝ­3®{»„²;õƒŸðbREOUÁìÔ<–x°Ř(+˜¤¼[sä€I}8Mm‰ßº‹d‹&²Èʇ{8eËÖlïÛ0–ýáØiÅÙÛAçÙAåÂJæ¥ÃX©†BŸýÚlu›î•£W+ÛÇNW_ÊŽæöîôæ)î]3vö¸Ë½µ¡iôž¥¼YQù:K·5ÂE©Á3‰.tÄl¯Kkí›ËÔþ˜tð<0Î#²J”Þƒn–ôm¶àP~,%Ö‡i,CrŠ(ƺ[²Ý¶¢o‹6ü˜8Óï >Cñpý5©D?ßÔ= ¢+¿|LzÚÉ—rüŽ[h÷Ð]N½¸·Îh—ì¡Gun ³D']¿ÿáÞssJ›#ç?NÎV_Ý]™¨+Tyq0‚èÞ]™àïUÃCb¯AhKä¨å¦èI1å·èPŒâVºG‚ÜØ&6Ø”®þìiƒZ§š›ÔÀƒ‹Ë— N¨OÒC÷&þ˜K?VWÊ;¿¡Œjn×JbCp ¨æ¢ñbù?.ùªVÚ›J­}x @ûS5玑"PºþSÒk¿êíÖ¥ÒËÊaЃ'xÑÏmÇá5îœ~CÅ£gñ@mRöØW÷KUL†1F‰{Iö$ƒýž39p9–{ì& ¹O‰.œÃè µuYd 3ÍAëxºµõ¤îv`ý1:$ÒŸd²< ÞùçÄè©âVÅ¡­ÇE,®V9-‡ŠNävªQýR%`üþæÆb*l:ØypN G÷ÝYoïÍ£#F«xýÉ4 ñJí ¼¾<¬sáÆ+U:kÿdÅí¾íòåƒcî–Öô*|•;œu½çLQЀzi"â¨[o¿ä‘šT ^Å¿¿º/w%ììáÚ5Õ‰ ‘/]«l÷˜¨ÇµØMÜE¾¡)FHçY 7Þß±{t`âÚ‘²‘è5^$µ»²•óë3Y;ʦèŒYE5;w’":ºJF×jnÇæF†ž1ªÛÖ'u5#Ec’_Sx;Í܉İï4ÄPwRÆáªØÛŽÓÃѽºƒ†C‚Ž(j»;Õˇ<ÀV"I ñÕ6^˜¥'PhSÕ™c®/FÖ=«\' ”| +zôRÃ¥;g!Л5Q>›n})•¼€ªyªò³gÄÆº?€ÝoŸjd¯OfÈ[·’sèÔè™ç1° R#Çz,Xɹ¼™:·4,EêÑxUÂ(ΡÃÎä B–NëÑÏôÛ†–ƒf¿o ‚Ú%¿jý0ÎxBaŽÃ™Sþ„>µÍpqìU•XÔaû뻑tÝ/÷†s`üc7°´ï'‰Á`ÐU³eí³Ð*ÿªÙR4Õú‘”ö!ÜæïÛP r:ÿé]g<& ­ÕVAdÓ]§¡´0@CšAR Ðæ¤~ÏÁ½÷ÝognÐ!8qâ£"&y{—ÍG.h8 âB“V†Nï‡{wMæ—K³‘1šPÙ§FŒœîJs¹grwÅ2µo£FÒ-i ƒ o[chlUF-Þ;véÒ[ižÏCqT¨]Ϻ±dSÄhTÝvvf³þX°j¬²©+Æ…}Gmy9Uä²Ì y-&É´š„ü>“j~³ãìJäc´µ5[aM-Ù ÂQNo¢“šFâkÉ&-Q /Ï¢"©»Ûî<ÙóuwkòÈbʽ¼â¬½¤C)Ë‹­œV2Ü~ÂíñöñíÚ®Lf^t‹óÃÍ©ú"µñƒ>˜¾SŸ½»4ï†Éáú¨uV}ôêžÊ“÷Imël„¯‰«ÊüîBÈÓö‘¥}kJrdÕ%o¾]ÙÏ cz^Áq)­¯$BöîÜ=løÙ­AÓ³—Á)R?k{ÐOë5=éärqgŽíÌ~¬¹×26öç¾» <‘¥•rÊå]ÝkénÒttg$,èš´ld)?w–‹[Q“ r½4 ’¯£6_w‡a+ pýò]ÅßÃ÷.z]wˆÓ«tñëâÁ`nö¸ à섚,–:ËOq?Ũ x;ÑÒ„J2W8)§ ó/GLqëX½­o’ꨴÖIÐaBz©-Œæ f-“þZQ¡ïj={ú1ñÔ–kò<>ë륻^úÇ…Ì+ ^˜Î‘JˆéàÅ—޼à=Ò©V•‡Š¡9êëˬ–§ì29°, 6÷m+N>þcnduqè¿—,~ޔ𷗬°B«‚í°’ºó#öôŸIÈKò:¸TgñÒ+ôŽl‹unþrÿùÜUŒÈÍûêæÓl‹'[óww¥°î¦[Úy—Üqä°°õê9ú™ÑBL#±¦2Éã"nºî_gžuJ ܳ÷¦ Ò-øK¾»6üëBV®>A¤þFð{F3ï"ÿï‚>‰BcPM褯òzìvÞ±^šXF›’IIfpÔùj­ÉûL6Ô®f2¯Ýä~äã;Ûyó¨[êN=JÁ° "l–!6õ1€Ïéj­°¤‰êêK[jÝa ›íÐu¬×,é÷Í ætÿr£Í,  Z“¶Å¡šÎ+]©úÏ=óVK›iEÖŠùìoÕ ð:…öª•@­šŠñßÇehŽó…0do¨¾"I‚®?'g| ¹Ç{f§ã¿†Ë ™÷ã2ŒÖéÔÔÚæÆÈýFuÀŠKäï³41åbŽyÑT e ޲oj+8k«“9%ve%'KP»sÔŽ÷çTÏ*CïšlŒÐÔ±x´ÃÔ¼ 6eU¢Ù¡|¥ågïÈà1ÚC™`äï|€ÓDb[·Ö¼Úž|‰=·âq¦QöƒÃÍÊÂd6Xä¶ 4h™´öuØ‘OİM³µ­û‹£{„5,fÈ»e+.7SÆ5Jž3±Î% Û&H]àwA®M›jkùá!ž¡'ú-6¸@|çð6p=55£ÎCò9›;„&‘“ÛÍX&ý9æÇiú8ñ·f’%píøSññ¨@ ö€D:7%"˜.àMŒª †“Ô.¦ÓUeSùžfvÌÄÛú/LÙÿã[vÌ«?Õ¦JKeGlus3<®D>xæ“•Ó`,0-è1ijÃÐÑ&QŒèÜqaðÓý“‡ŒÌÛ̽MÓ ‚EET{MN°¿?ä>Ê<§§WvÕÈ€ͬ„ÑÕ'«¿³(Á‰Ör/)*¡ß”ˆjN›ºï«³åˆ¬;Æ;×EÆ Þ¸ÒÿX“nwî±d5õ­¡Åìùg‰÷QieÆ^ÊI¹ª›ët1ˆ°a=s™ÍÂe+Á>¹zàßÈЖ& Ú¡šxGVâit'·  €¹ìfmnL}ò~ {AM©ÝOÑ(¼!ÍÉŽó™•`/° (MµˆÐ"’ëÒ¿x]ÜŒÌN͈4ÕU ó_¾!«Rˆ+3ëî“OMœbŒ„ÉÏ®œŒÐL?­o'jÎx5 9¿äJ!´) ÎoXÂÅÕö>•8`` ÖÀ¢íÛt0úIÌXФ¡{§p¸BH¸3PËÜ'­<áß Ýƒ… ¶£CsAietLÁÒ&~W`; Lgshìý Õ¶¾¡¹cqbÕÐyUW2 ‘ïd"Üþ:õ}BÉÓƒJ2 9k}ÊIO”üv dÿ(Â5ÝÌÛó$Y‹ÌÅY—&ØYùzý‚Úz7}™Õ(õ¦’”ä?‰È™Ÿá Ó\ÝÞ$Ï…ÞZc³Ð4%Ÿ0í«¡ªL‹ýÅ(| }Ô8HiaH%kG³+¦¾FìäÀpu¬nújÆß°²£yƒWè.ØÄô×"OÖý6jQ3dfëÚ€4€^¨“ÈÛ 4–¼Äú´G?¼˜k<¦¶5› nõ=1§$£4ÚGš×¨kAž³­*ïùd¹F~ù©OŸD£Û­Ÿ(Ù[äüН¶i\÷¸CÐ4?“Ø|:%ƒNkÿ9…®@»Ð4È~°œ¨9¯ôÙ|~QHYƵñ›é{bm'h|„d¦¿+o·D[D1èV‘F95ýk˜*Ç}öTÔâ¥RQ¡|i&¬k5V{ñÓÞøPP{k­»^ÙkpŒHÈŽ61a,ëOg 4èJá}+™Íà¡q«¿õϽêUüitE›®©˜%8‘È,Ê\1}½uWœ¨©>$Ǥ¬. ¶çn"ÝUî“qQS‡z÷ѹ˜÷-XãâçsDîô¼ëвáãI~`Y-‘¸Òiê.ˆÞêAß‚@õ[ž¯ÇÐW½¸ÊAlÊ îåæò;>‰ –MÏQ|[±ƒDicÊ  Ëä4IÁ¼H Í›òÀ̦„nƒÃø'¿QZÝždž§:Ñ䨾OÍÙôôª/¯ë³‰kœðœä êìáÈº¼ìÈ48ÿš,Ü7J`š@ÁïZã_mñ’%žÆ²MUÒ‡%…wP 3*Ÿ+q˜7`¾ÑÜ:[˜{ /Ìxo!Q7¸«–wi'ê HRŠ'<”€—ˆ-*^Ù6h˜ÅÚ ôBp0['Žgé ¤m¹P -W«ò|}4FÏÖUì5Ñ®.ì~2¸ïŽåЛù²Åà º”œµRT†é©èÆ2uìåÄ"ê]Mzjz §*Ô™Òcî]ëÆ]™Étã…6ÝeºWÖ¶n߉¼ Þ„Ú#qBõÒÈñ¬€a4uÊz묓^&õ€­BûÊk¨†ÄL`è¼”ƒêeIZ ¯»ãžÿm>|’5ÉyëÚ!Z·1†{Ukë¦äÀÍg+øùTÚx)¹Ñ´UwžB~_®)“Õ ¬ì&_}ëüò¸ñŽ?… ©'®ßÑ>³±Y5x+×dºµé%ÅÓƒÞtõS.wŸ’âé/ˆßÇ+’ u äM`@áhñ·3)cï½ 4ÊÃrü—ÖZ>›-S0Áv@1P%k[ËkošÌ8šïäR—Jæ;Qî0;jp´oá GwÖª5ç5´jM¬S4 d»1“Ì&»›`»<ÆÅk¸zi2óQî«–»(OD-¾dZ`à0®‹Ï94ܘ ±éð¼ô» G¹d(‡Ú" ðK#ÿÆÕƒQ»£Ã&¸±š íÇ{ò¥§1P&u÷Íþ뤼91Œ²˜Dɹÿ™ª y%üeK§âÔ‹IǶègCf|¿«š’ÃÙöò@/?þsо»Ê¶2R‰ÕSÐí^’ÆÑ6åÌaƒ8³©‡‡÷z[Þaªï){Òs½ 1¤5Ou3M›žúZófüß%›öïø_ÿç }¦ƒ/ç¡Ó(Tç„à˜Ë½Ò©›ßžæhZæzïäMzëºØjR»¥“ƒÔÕ¤Gèõ †D:h{¹yžeÄ´V—D ýV%—?Îî² äw÷YÓž>~¹¯•ˆ‘TLÒ·'n$‡cö˜Zûí ­~&Ýñ[ù ,6tCbR˜`3xþ´}ĵ«.-£”ÓaH楉&°¨ÞY]x<†›8Ál·0×ó€ƒ%Ðq¬É«j;HLuÓ ²¥ „~ÎUåŽ*x Þy´T|¿ÎíF€dÞ +ä‹™¬ÛÌC¥?5¤¼Ï_ú~XZLÆ9{­ó/×[ ³t{2>°k•‡gEFDȇ;ñ4.ó.±  –Æ``ö G—­Øý.^+H‹Þ÷R6ÖÆ’Má|çU:—Ú+WMÞ51þÚ,.ÃD-ÔÚôsoˆÝá¶,·HÊÎ’ŽF•T&‚@"´¶-zOÚ_þè§[„–E¬[ÈSú¬Ñ¥¢vÜ'fɃO¥Õ­’ÓMÏÄ­›”r"㳂n»ªeî“$.ýý‘ ®Ž<÷Ö%•`Æ÷'ê©iÕÌ]¡ÓIÐÜ•skyòÇë8rÄL )ׯÙ;ä_´ë2ø²ò ³ˆG¯µË @ñƒög¶Š²…½7ƒA=LLºµŽi2¸K µîÍÜÝ;p$ˆ™ÒÈf±`¹¹À“±uÍÁÛb¸éÆWAE»¤í¹3CãÜC©nÝ­²bˆË±Œ M±dëߨO7KÂÑ&Μlƒ‰%jÌ[ŒÉ’®I¨ƒì+»Ð5î;yP|·†`ÙÉý˜Yÿi ñ+â»;/° o6˦è5'š/@îǽI…•Lܵµ‡–Nä{Ârœ{9£J«´Š„»rªn~ù¡Æ`}C@Ì¥‚M9ïÓé´{>¦ö|æšÂÊs U¶ ÔjíºÊïÛþ+¼åd9Û½˜]:+•½ó¾¶{ý‘MT#ƒþ˜±3:¹‚fðÏjó Úc)§ÿ‰úÈÏòÕ½¿&KBÖ£ºp@î Åõý?9ÃÞd˜¡ &\å} 's~¼‘E¡ZÑ»ÂÕ=ÑZ!û E0;é«zìù{÷íY_ ¼’5 ˜e¯@Cˆ$C‹dAh:bHî€6ìHînÁ¹ÿ›ºäÎ ŠRüÈvß:ÀeÍÀÅSªæ#å?/Ä3©x,ü×7l‰¥#RÔA;òvÖfïQ Ë3!þhJþÙ&òÄ’?}ÔDž]¥`‡/Ø6é£îÌW÷¯Æ fëî÷‰e< om6øÒ¤”Â8|«=sô‰uo-Ö6V¤›=‚?œo lA‰kö>ÉðÉyéš?çIÙ/‰§Îܨö€hAk¦Üöís)õ&£´“RôÌ,t¯Œ¡©ï©p ©™jöun-}-9yÄ¡"¥cÙ”‹´…Ó+2*Ï$3¶XÄZŸ@‘^.*MâF‘Ú–Sã qÐÓ)Ÿþ‰”8rð±dWÒHr Ý IB=wϸ«ÏÊÂ{"‡ÿ$ ‘Ý6Tvrùû… [YaOéËš8%k¿«Ì£y}[8¤Â$Ã}ïz¹Û½‘æ~ÁÓ“uí±à£¡fbÓPØæm¾bõo0¦ÔݺV½É½Ž¿ §“©|ùÉUr^±ÂRݾ“ï èáG3Üí 50Õ„(n}4[ÎÍFÆÞEÑÃlåF¿BÉ4îK`AyÕÆa‘Á³-þŒïÀ‹Ï€M–ÅÒ;þE?ÕLσ˜YkÃh`†$<Ε˜óV~è©["ÑÖ4uÿ85z.†:üT[ ]„ä(„äEÝt' }´²¯0b‘{Ú©ñVÎþwÂBoñLâæPÒÐsk»6»O8J_0ŽÖÛoQÁÇ¡ëQÿ­ÒÙ/Ð#6„/_—œIV´*ªMe½ùºH9¯ô4™y±,Ç/á[à҉МÆ!½òヲ}ï;ú Ï8üOd%Žý ì—ߌ:¹ŒÏúÛsŽN¿r÷9\¥Ä¼ƒPJ¶oF)\r¬aHˆJwÈr[öགྷ™ˆ.ÓôF.k™äΟŽêŠƒ?Ô¬©Öß~Ÿ?±>h-ª€/*æT€3°R0åÛN,@’{­.& ˜ÃÐR ÉAz‰H¹Ñ)T†ô0d£¦ç!ÈÚƒ6í’Gk‘¶, ÚœbOÒ§^+Zý¡ÿ8‰ýêG1ê¢,$ùõü{îœê­÷œ#‹AOc48ýã|<™?}‹S›#ᩘ„_Žù±¸¬¤ž·Ýgu32m)ŠmÆ5Dß/jÚVƒÇËE,wàÆc|ᦕŒl©²m­+9ÊÀí!þÅzQ=a•'´•ƒÜè±&½–Y#•H1tpãh4á“T®ìÔY3¨¿ñÂù£ˆÉŠ·xðÇ—åâoÚýù›`­Ò&¡Ä‰¤Û4¸‹{·¯¥ªf¹‹AQwf†³oÖ³ô¤(‹9•²˜7Iˆ0³Y= Jhå‡QI8ºÛã Œ¹“ÁðeÕZ@=:i.óiªk¨X²Ýáá‰aÏ>\¦áx=«U­ŸÙÆ£¨óæuã7=WÖ)P‚Iý¸÷*³ÓdóÜ´W™Š!Å럘ò/Ùm&=OtÃf«˜R×7ê£eÃ˦4g,ZSÜ»KÕð¾ºÎ02üt’Ýñˆ|öåPTûw¢‚¿ÀCã÷º¤‚$¿0؃`!a…6I þ²d>‘×¶Ú._ ö’7…—r3õ]MéôZsöôöÒÅ*õ¡0ù'Fº| nÜCZÃv¶Žþ„êD·t÷hÓ̳#®.ÏõéÄ¢iÕä…„töÜ ßš¢¡˜sóD¬i~Å â[¤È—D«-Úý¤·ÀNØtú쎆Èi÷qªF´äØ‚“ËEºÌGa›,²[‰åï K‘$DN”ŽOw/­ÅM[¸·E×Ñ®››GÆ 6Œ©œ¶î2©».l©äý„ÀŠ¢Î£1©ÞKXð êì/$‰üíô~¾J¦W ¿%"p­¿ÅÃ8+ÈÇSº4ûe‰)%¿mÛüýÏûØjÕ |E³ôÔb¬.šcé‹ÀZ~%ölȤ*ßúg-kŒ´Å—Œ¼¥ˆ$Cåp“… + «Ÿyê‚j9ôsH ªÜÐu׫¨Œïè>2èéœ}D_=(Ôð"%yùn©ïjgJËì¬USSxÊÊÝíˆÒLüä[àF /äŒIõoëµ´"”ʦ· ³@5¿ê®C‡^76¹ÎT£,ÄÏûu|w;5rô}•Ë(®_Éö”•êÐÃЯ[BsV3…©O2l) 6«KÈ¡±L¹¢ÀvÚ)öÇX¹ |6Ö| P„ÚÖ$ùbºÁ u¢½¼‚~ìp`›o@¾?BeR·òÛ¥c.„‰}_%O-€š1x“‹ÔP¶ZÜK¼¿XRöÆxOk4´z`Gl×Ë“3QZ›‚ ÕEa¶ .m¯Î@ å¬ëÒ]û¿“X¡5Dέ0Æ6„eMRÓóªq´0å5¤Q)¤ËJEÕ²Y¹’l6÷;(ÃAGï Rå-?UŸäŒqïÀ£æaýÜââçjUóП¨• qÁ–´G9ê4&X©CìA²ý¡;1©oó}¯Ôuô¯ä¹o‡¦#8Ð+ŒF0œ6'OVV`P ¤÷“`£ÀÄ Øó±Ì4ãæá6)ܾáRíPyæÜpgçÔÖ’‰Å˜4¤M¯Å1ú;¡³³ö£B÷Þtô «r/Ѿ­nŒ,ØùAÏ eÃÃxŠtNôµ‚³„õ!òrÊô\½_5M–@²dþJjö =ݦ{ë ÜDc9yÛ‚eçæõ?GéÕnÁ*õøƒ6h*ÜbÝÉöWÉÇ<œ(A_>®–ë"2']ÿL®‡*9Õq¾Z2>ƒ»ûã|£I;›b¼£uGã€WHŠ7)m!OF7eYˆHü­¬–ƒâ‰ª^m!àF,_™`g ›¾›¨‰D¹âÝQT›n0ïN ïâº\M‚oÌÐ)Y°­Á` È\ Á‰[懀°5|‹ ÛÊ ‡BO äÈ*f(±Œ"Œu\ðL2;{ á’\uŸ²0cÁêªÿéÈLÄR}^‘ (¤ùt•S«ï9é^Y—f„™#wΞ—«CFÿ­sÞL…£%íºáGâÖÄcѭűÉõ€¸FI¢&®ë‡Àd´ó•º„”ÏRÁpˆŸ\âM/<‚ÙãM­AjîΓ5(Hªá$me-‘˜¯x¯emêËwÿ¼R¯ƒÿH™3Z¬À®ÀŸJåo.x…ß+å†G¾÷i»§¶-ÿndÌ?¦ÒѪ÷.ý¶{ì—õ¾ßFó€öó~bBô{ïÛšT•¥ót‰H°eåÚ•u×Úõ+÷–Ú¬ž–ȱö݇Õí\(ñ…åÀÈøÁWr¥„” `\‘¡ÓƒL‘7Ž¥àæÑUV Õª, ˆl’á68&&˜dS‰ÐêþËÉ—·½” ´ùiɇ”„@Ü;Ûids ¨…©*Úye0ýnjÆfR(ïþ¥kü:µ£m:À¥k´Î¢öb¼®FRÔÊ1Lþö—ަú{Ц!HGÂOFÝO˜F(¶I˜,Љbt>K){­e:13ÉuMK0ëKh)&:‰‰.E£©Ï›%;9˰νîoKÙ;/>¥y[&Ó2±aï+_cct˜%†LAdä&²îdë,Y`MzE1Ý›f«™sï§DF'_øwœ«·WB;O· "j„‘ȧ&ë®dìsÊå¼Jzûiù»7'·Jåí÷Ã8]ó ÌòFžþ•TÐ~&:ûà3&Ÿ,¬ø HŒÕí®K¬ô<1ÖŒ‘Pv5bqe÷e…ì`ù‡n¨æ8ó\@Sïwdid²ü^•áÊ®l±úlÓ D\ªî]CJºlz䌄óü½õ§Å€5ÕGEÉV’?¶˜‡OŸ¶EíÜ5›ÏïU’wçóÉZßAžKÛ€µ Åñy¶£dàK!GYÃ(È î+ÙM'ïÞ¦÷ì³n òaTtЯ[N­í鵞VVY[ËIþd­’qö.ºd^ÒBm'þy_Ý XBÑð³RPæÊÄÖ¯l  0(:•çPHê(_Ú³ ™³gƒÙÞ<ÚMš-âðï‘›K†!‡%gPí¦f2UÙ «¥uì ”YÑOWPDzÆd킳V¯â»þq†¡š¥B†Ð­ýáC4!La­PÖ7àçI³¢K&C ¶ˆ «(Ê´W»¡ú!¡Ïrî°Fô®L†l•÷¾E˜Ð(Q.ð±d5,?üŒ€™5ɉ´:6V8ª¬»ß§3gnýôžx˜$Œ¼­¯W’êQN>n¬nऻ³"*;•]YÊaË}éà;°üè!†ÚhòÌf1†ÇÆqñ®'Ï‚Œ·Ÿä-Y¡¤L±Çá´ {M‰2k°]£ÏîL#Ö­Ç9hÊílÅ}›ŽTÞ“œ²¾ÓÇ´‚Y O¬Áñ¾Y!®—§Øc÷·úkºg5®á""÷êPÀ!ËÄl[É Msf9çZŽÙr¬%øó<Ùi1ïO\oˆª@öÔ#ÑAó¢µw¿ˆOÆ8á×{i”ùç·;ÈoH¬ÔUs‹Ê÷ïCG\Ã[d{zæ\ÙZË”›£ÄzøXiðу@–>dé9ø™àÆÒÆúË'µÝ7§ A¡v÷¤i¼w"1ëm7qU%¼)á &·×»œÿ¶–vº÷ñÁñO1Í)» Äµýo"Þ°ãé6hÆGö_uæ6­DvÜ'‹a²L²EᇣãŒU‹ Ûc—êÎ<¨Õ%ç‘Ó£G§K÷÷ Õ®À6(gÅ \™¼ÕpìÀŽÀPÃ!ýPÍÇdùÐ!òL"R°_×rüxϺ‚¿ M.–ƧŸXý/ý¯òÒ[–T‹Á¢üŸ_òßÿ¾\ú»“¼ð±üŠ< !~”‰¿0o#uö×ÿ\Þê(ÿý_ÿ/ùŸÿïÿû¿ÿŸôó¤x–ÏûoñæËÕýÏw ðä§ÿÿýÿ—¾g­+taxize/data/apg_families.RData0000644000176200001440000006434212672032225016036 0ustar liggesusers‹í½Ù–ÛH– ]]S)ß] …öÕm™Ý3/sæ¡N..º$Òéd(¢ã¥šH 0—COóoóUó2=÷‚„v͘KЬÌ:þ!‡ñÂ`ëÝ—³î¯ÿÇú¯ëß}÷Ý?}÷_á¿ú¯ðç?ÿüï¿|÷Ïß­Á¿›N0ûŸœ÷8‹¾ûî¿~ðßîwßýË¿®`n´\:.sØ¿fy¹üåq+ä‘“ÿ–ÿëñháÄ%°gm/½XþxœNCáÎÇUÐ;ŽçLyS§ÌkzÚžp¨±·ƒN˜±€é¥~ãtºÎ‰„ÏU€ª!t¡#áÇCx~ä‰)³^¦çGþÜñ¬Á_;žæÜþ—Ç,f¡ˆâtõÎÛÄw÷«_€N¹gÿ…Ÿ2˜‹ÅªÏ¡ˆE¹Á°í}‹Ý|Øg‹Æm<èÃb0Ë©õùÂ7Φâ…'áG°|›~âüîLíïÆihs”ö‡°Ñp˜üiã yÔÜáCØ™yЫQ:1±ý¡ãŽò µ9”ãÏàJÏó½jÚ¹ŸÞšà‘ÏBû<þEx>4.ÊŸs|Ÿ»s°?¿-7æ~¾F­€@÷Z‹¯…xØògÌãn-ÐŒÝã9*‹0än1Xv¿-â0%gÆ ú°KÂÚoO\'Ïׂ=êؘâ›ëÑÅÎê âžÕ¯Ùý×,L¼úe=fSÖ4ÿ½å1VB>y³ »X„ »Ùwf‚¹õ@Žû‘ûž“Ö‚½0ÏñÕ§9&®ßøGCœ×úù"à>óÖoäÀhZä‘ ;Þpvïàxû ÜcõçÁh‘†~Ãâÿ¼˜àâ|€¾ªWµ›xB°!.®ðÅbúï ÿ <åê½).gþkì}ÄN¾h'œríWGå¿ ág„Ió!Y½ö¨åÖ㞹¥¿JPm`ò¢¨ ù/gÑô¸ÄEqO*ÀžvæÐ›J6³ú£pïšF†8% æ POz,ÛÁ¦Õxü.o³°=ØD>^3L›><N,ŒySwÉ‘¨£rº2¿ êþI4€Ü:Þ¢v)†sÁ|î6ôs×#fƒ-ð›V÷p±d ØÊ¦cÀ.§é,Ý9³¦½¥>sqtM‡äEkæ%¸l¯Wд(ágVîàÏÕ+ Z>nêõ°å‰åo¿âXÃrU¿l5Q.ÆŒ™»dû+_xÑòŒ œ3ßjäÏZ0@3®ô‹Ö’kXØ @ä<þi¬^异¦9ð,žõê<‡&àˆ¢8´Í~›ÍåÕª}Ù?:ç3Û]Ýï°Àôyg(CÌäá¯Ê«ðŸÙ&YŸxãåéÐn² .KâÜ4øÇ`––?¾ «Á^vRÇw䯨Œ^ I3ü³NÑdS«£½‡ñ%nþË./Æâ$¢^À±¼s?¹nÈùçÿÍæ¤…\DÀ~.¬¾px”¸bAçWµ”G l ì®ôþëÄÿhw®ž÷ï‹þÁ/xóáúKqÊÈ-9f±XÂ}`".»­=½=ÏËcmú‹÷Pçf‹-öz¨^óP^;€Ïíñ/ÇlÁðŠ@kóÞâˆÚ;:pxÌÂY¢—ž\eL ¯ì ÉØ6Þcàи-=:x¡,Ù‚GolÎâ«·bîêC›«Üw\¤ÎžÝê=ë; TMXB3¸ù¿[–ƒ>_ɧףP€…¦ü÷zØÃ>°â… á, ¸'eÌFÚyâ„.—âL#U>a"Ž­HÄá K>qKz²" y¶e:B&1vðû¦VË ]ÃÞÙㆧ =Ãñ´å<^ ßE% mÿCòA ³½/@ —¸9C᥸Žv¨aï,‰,ÙÚ‘ãGìœÛb´ý‘+5ã]Ça²(8±Æ+9ž3[Âýbœxg6·–<ÆI`Ï,¿5ŸdÃ9ü0»\»fÞmï$®ÝƼú Ø’ô2gü 5 Ëê²3‘D‘ êðK¼l r¿ü›ìik}JÚ^ ¸—ÉR¥Ý«¹¨¤Ü©ƒ ÝXÄv1|Üjœ°œ¾cÙ"È¿Ýq¼Ô­‚ÜGI’Áž@Ý3¯è:bþTâüêÏ?F=XÒöÀJè¸nàXÜ|4ö:Ì$dͧ£ÃÝy¡®|Ô)t"uS 8´°‹‚˜œ±ˆM«€÷[ŸùjAFŽwîH™X}ÙY¹sŸñ¸üÑÉ·ÈÐw'LÜ•=²aÌ{]˜ŸÕìŽOçCn€}qœ«M_wTËŸUöý&rbÛU>½H£Œö®ÐŽÇÄ¢ øéÐ r{7°b5³;Czé[à%Ï"€kçY½ðlÄ£8zn7ÁQìøx ­veó•kœ·¥8r?:Ï=' ìFñ´ÍÂÏ’V!«­üYZ.‹>`]yÑ^²(Üè Ž ¤o'Åeäî¸ó´tA«à($ĵpûÝ/ÒüÐüÂ}‰„:K½{yœ±ó»¼`µÀZîx²2 ¦+†·„yŠ •e¦×ðÊO- %b:‹E~…fè^æP¿:æ%í¤ Bý ˜Y沉¾§5ï-°õí…vš˜ù>_µ7–%ζ¢$ý¸ÔBygs¬À±k”ZŽŸ$tYžhz‡û Èž—ÙÀÙ~ÉcZ,ïÁ‰Ï•œIéÔÕoÂi³Ù%Æþg´…q© 2wTÒ#4ßÿ‡,æç—:䯆ó•òÛöz¿òè2\à 7Pëþÿ‚óÌX7v©Å·|fOU~Š0çåwù”—(ŸiãϘ“,iãp…üRñ?—<¸Í~<;Ky>r&‰w)žìåȸ_µßK„—¡[ðJ”Sk xSèæþD6«ôç‘ë1s¯ua³„_êvŒXThÝêqÚKô\¾ÜÂ4K.ÃÔ¼¸wö;ñäÖXž' rñÓ(f%—1»‰Œ3ÇÐ˼ò|ÌâЙ Käðg@¹XÜ$Fì·C–ûl³\¸Ÿå¥ýÑQÄv°/;sd'a¹ó0¤¦ÎÀù +ØÇ<ZÙ™Ý`ú,H²º£á…gCDó2*§i8CÎIæyn þþL^®¦¥á°-×}ă¹ðÅTäŽÇMƒ3ï~œ‹Är²/Ù4Q¾Qè•YºUò±DkàØÅiM> ±X‘ ò©üL ¬ Cw®ÂåÆðÆ‹.÷ÐŒ` ÿãQ0G—¯ÒÈ›õS XVa‰Q^çÕŸ‡Î”E®S°JMŸyù³Ï£b­,¾ñKæ³ÍõgÿüW8#Òð×þ¨å9R2áÒ/ýU@=î0tŸ]õ…Áusùé“42C=î(Λ:;8¦„ùåà9)3Â>ÇAÈš±hžëZkÁP pÑ4ÐäcWèÌ´ZÞ^˜L&Üö #á¸x¹Oiíø~zsÁ•Úƒ£I– Hבˆ„x÷ã©;/y¸øH XÝ+ÏÚ@2¤V4q“p’+yäSù⦮W¾"o¼<™c š-ì^øKÎæŠH¸0KªÆ*ßzö›ãÛOãq[|’ÂþoNnbƒÉ9ÓòÞw¹h‚98ò]t!n‚Ýp7nÖÚúìÅv×ôم˼Èv¯Ðaä¥5:æ¬cn}0Œ±°ƒ=l³œ ÀšEÀ3òTº§}t„ÊÙá“ÌäêòJðWÀùbQ¸5~`ì,,AÆ’{i„Ű\w.¤ìÖ<Ñ.p×ç¼`΂°$×åà•ò"®Zì€ûÜ÷ ‰°øY®†[(ãê¡2;˜ì“‘³˜H¸¨ÁÈu&•:•©h½j’°?r’ÐIrÝ^ŒRj¿FèXÌ%B¯œÔ«1 }tübù½âU/‡¶Ñ³Øt4•7Óž÷Žër¿i/[~Iƒvaà[AõäciÔG!ÐEåmñÆK”¥êÊâ…ÀDNòÐj øû-Wêé^çNiøGY™°y9GS g!µPÛN2—+[ô¤ƒ(Ï šàîw }gÕ¨Ð9¢ B•ÂDeG"E LT×ñJ¦Þ ¨{]ÉõU@<èÂ} ë{yÖå.²ÌŠzÏK•(-|Eýà0ÝN*ÈU½ñK„°jš}6K€(ƒU s·Ÿã ªÍðE.‡U€<&¬q• €{Ò[¸jnù1Qö2¹‰Œ¾%… Fº}rÂøsÃA^š"s߯ª‘Ë`Õñ{Ïnüá2H¯dã©Y³ýNK,R‰&ÅŸ¯ÕP[ ÌɹŠ6“¾Ö*ÔÃâhŸ¿D˜ m•=a¾­¹NsÑÛdæ9Å"*p™Ãz‘ ¦ôþ_ºµã{ÜJÜdµ¸KoêÒŸŠè[’ëÄL:õ*àËêÓ§-ŒË]-ÞY2©|ÖŠ\<—à[ps’£CïµæçëW×/†U!¹µhÌ")ÖõzØY*¥Ä\?N¤7ví;s ºœ•ýrßKèº!<銴˜×^qNhÑã3„IŽž†z€ÑX0X›5@X´9.&Í£ÀT^ºäÓ¬öâqOF:Õ®ù"<£ö$ d‘ò¯þ6¼€&.¢¸ÈUâ0‹a?¦Íãxzìj‘ÚÓ˜Ù¥oíÜŽ™òO¤„V߯ÙÝê4>ËDç2Û[;³>¤g~ípûéLLy$S›Öözâ$®g¸‚‘|VK{x:…“BÕ8< †ùëlnÛa§_d7«¿@C lÒ¨‘,¬P^–ÎËýaš†€~ývC8ÀT–žÝ¢ £P^l³f/‡˜¬ÄÏý[y‘½ Hò MdGgäL€õn|>B‰¬`mšNÄhé,lú>|Æ 3p9@ d·Y¿£8D×L+ô4F¡Wú‚Õ®Ù{ U6ßþ G_¼ùD&­«n›…Qng(Ѥ=Ôh—¥Æ§G¡t _ýhÜï…,åV}bøpÕå$¯µ]¿<›§H´‹Èµ>›–ΨöÂýñ|eüìùy@öWy’Ådô ó>qŒãFÐÿó“ùn®¾öA`¤ßÈ 'β ú7ŒÚr’”Ìȹ·zýÿ*~QûÇÀƒæª´1ˆ-QÎÔ¯~(†z³å– h-í:ši`f«wOѬ-¹ ûa‹lÔ}iL%pZ¿'³ÌGÇÃPf"×Q¸®è½ú’ÙAžB)ÒèTÏ|¯ÍJº‘+eÖ!£Â³¼òQ0Ôy.ŸæD‘®y»p¹H¾K´‹Àî·ŒA -¶çY;™N=ö»]Çϳ¸ŒcžÛ¬ë34.ʾGÝt&¬¶ö :`‘M2.Z'd‘Ëäµù¬ðЛº˜nšåGµvÝö—Iãr­lÝþt¹‹ÄR‚Êvù4](©ºãg]>C‡Ž"„¬vͺI(³t¾G‘È ÷ò³hsE¯ïøHJ˜µKvp”dªT+¬ñZ„éÆnÅÃסs!¿^ô¸ç1WºCUc—ž'&¥ãY?ëƒ^–Ýn…ŽñÚäsÅÜ›á^3ØÌ·g{Ó³Ül%¯&øCô(MB»óè­-¤>µjuŸ¾¹£HP;ï÷osâº-xÒÇñøgôQŸÏé¼Y5²çS¸7âŸ>¬ƒÝæCÏþT ЩG²}—#™N¦õ^H+vý=Aþ(–ÒdåÂî ÐuÒ·Ø¥‡ÙˆWá³)³ —€ÏæÁRHópÃ.==)BX|ûá rŽ­òÓû',3fƒ¾gQ-òkU‡nÿôƒíå=@k¥LÊÑpâ†lÊ—âêÔf°Cç>Y5÷è`$7•15µ]¾r–)ßûHV'5× dÅ¢\Bíäžž9 ‘kMkIé›—òÖŽ÷Ñ“úñj”{p†Üd±«µ— m§ŸÕùO¦‰hz‰À>E‡zID€Hñ…ðÙ›©’Z¹~û˜èf–ßÕÚ<Ä0NÖ°°¨ÞD¸RkÒž;—[Á=²!ªAl`ŸÂ4&¦‹K?›1ºId©-é|‘‘Ù„´žÅ"ˆ„ÅŽB8…­¥r{¯C8~elUypÌ2ÑÜfœû}'p Çr IÎlôAŸ7~úy?ùŒß¡Å‡eJÒÏZàç€üÈ'Rƒ×òý\'1pf¾Zeåž²wVR¿?ÈBÖB‹®Ÿ!ñdmE8‘{ÇÔ®øV¦­ü}Î$ tð^ ®Ð?/ËJdÔtu=0`C™¥öÒ¨š›²¢PÚP­axåy ˜þ$²?hEn.eI«¤ç€¶Í“"å˜ãÕÀ¶Y(=C›–ùe›Ãé¸õ¨;Îb"¤o¾'ÃMk˜¹&Bf=Ë’WIÏYã+sãPŠh8%¿9Ó²wPÅ•;¿4ÎøY'²ÈY#ô~V\qì9±L¢ƒ¾ZQ€rÖ—ú3|p””SèžJ3‰iد½Ì [ƒf÷­vi/KdÂ-ư×K@4_&w«ïsè»pl—ùÕ1ã"Þór ¬—S=–ýcèÞ³ZŒ§ÇɬD—«ûüé8]°Ìckj}öÞˆÂë³ =Çg3VªSR8^öÙÌ/ÙÕ¯ÎÓ>“³¬ÈË>,–<k½—…v…6§´Ÿ\¦J 5RôËA––"?GØa€s&Ò̯æ•gƒ"¶ùÏPá¹ô$œb Ò¢üø@ø³ÜžØ0[´ÏÃŽç~©M—âGŒ+Ì<­©ÖóäîâÍ‹ó—æÆŽ`¿BbÒ5ÀtY‡?w˜¤tÍÃÚ›Ðpì_`™ ²Þß—Y½PWæajܳ—Cžù Äö_@3žc,€ «Ã7¯†B7oD"ûCô>Z!³³ªcEo«ÿô¯ ç6'ôðŒË f”—ã<šÞØ9‹ÔjGNrâLdƒEGn^ªy¥_Œ\L»] /¬ÉO£„PÒÑYÔÎÚ‹A9¯…5b8‡N>|`öÉçÑø‘®¦Ëô|œ„Ò.kŒƬaö ò¿'¼ —cX"& - 0smI¦7w/Í~2=j tl€zÚÅ'ߟxà“v—tD•p;ðMÑô =53‡cõ2›¡÷;sOàÊbVŠGº×îÜ+s¥íi'®L\ ø2dæîö°Ò0|1ÉÕ@•c|Üá¡+m ¾3«øp7q&NnªàQ,vÎ5T÷÷è(™I#zõà^'îxç4Îù°ºy%R³f¹ûΧÂ! Ë6Çeº^½ä ¿KŸûšãyöXž÷£z6¶`nZR?×\‚b‹]«‡= ›yh|Ïe½EÝÕÁ@î°ˆ¸¬œÙÓSæ‹Bp«9ê§^‘ï’ɸoºCCäëâÐVC>FpÅ ¡»j€†‰4rVŸŒý³¹L Ø´ä+ÿa7³6Œò`4gN‰ÚÖb«‘ðQ2hÆc8Á¼(Y×ëC´87uøüh±Èùvñç7n‘zB)ëQhðV8£ òE–L³Ð5”á}ü+Ø8Ð¥Moü¸Œ?ùLnXÓ+‡mxÅËãYNÐ ß¾ü¡´ÖG ¾lûbUÃ<©ƒì8‘GQú>é2÷úmèûe åLQ„Á{Qâ¢N/œ•§w~¤[ç Ë%*?›AŸ¶¤ÈcV¸Çj€m´œÍì`3Ga7÷¹¬…Ýïø¥¢¸Òš‚fYõ l_?†£Ä KåÅê`_Œ'™"ŽÔÂg)#Š(‚¦ýx>F‡“"‰CøK/”D Ð{t=ÏÉÒ£L• ®¶“åÉ“*íZè½N(DN[Í]H¿k­ß×!KÝ’·ÿ ¢ºYfJ iB^ò6¥ÐÏ3)'*}¾v(‡gâuås›qÿôׄûqAuðL•NCé¹x翃4Â|)ýZ¼÷Ó['h¿•þp:D$³”¥+=ੈæö/ÜoM¸ÔÂJe™’Ár¯å.€©“á×åÈòqkKX¥ˆç¨`û­ÐeI‘x£“!‹"èa+DEx\$©~¼¬áÔôù§«pƒÆþîuX~µ*–æÉ2b¸ñ“ç, ׺)Šð¹?›i «ºxnJûQ³;Oºû…O§jîÀºÚ’I]–0ãȬHW1ÿ×XÑHž–¢8uO$òôWBígÁ!…yGÎÌÜáq"ÓSWoâCÌ^!ËÖW­h? š»º;h8¤, xÌ +‚«†ƒúJyt«–êñ¸,?nº^¬a ï äþ\Þ¦ Ç;ó‹Óú»òd„G…G"œÔhÔñ`eĬýÚX„ ›%úÙ[4òG¿ñÏ<—ª÷å[™s÷•þ*ò_0'YëX ú¬•Eðˆc„áëžòw©ãL&…‘Ó€aPôÙÊÜ%&ܪãðwi·‹ª:ÞkóE¬ÚN±ö¤,®T º ÑïÒù¦f^4UçŠùVPJ\¥¯`øs¬·Ù ÷% úÄW ë»ßö³ôU×qÑ-YªïÚè½$Ê•DÈÀ}gj×yœ{>ôËUõ¹yi\®»Ó‰ø1I²Õî]”-üu§®çð²›Pý(ö{¨Ï5ƵCxqŒ%ã\m\¾ÃãÌ/6çæë7XyXtTëÀi£hË}ÀŠV{Ì/Uã+ÏWâwQ>ªþèb”2«±í)ÚKá¯ìÿ/ÓáÖßû“$e‚Ú°wŽÚNŸ qh¥£U\†cǵ½ËúÌ—XÀW#°vYA2‚õ\LDTu5žÜt"=Ýšw(3­)™öš¾ðt<·ÃtOÞËz¸–¬ 1r™{õwi[,’òD-äa‹—àˆ]y–x øI‹ÇeÿQ^wÐR”0«ÀãÖ¢8pgI\ùé,Á o‚Û_–UʱRFdÁJ'¦%¤,PbÅ®¶|§p¬µ- Òê1`¹€qVÒUãê¥ÿîtY Éâ`a¾4iâlŪŽ%ð[lqb^µCÌÈã:ÓpÁ?„yÎ)ù¤ŠrEò0t꫃þi™Ú" ŠÇ_xÑÀl±i.ûu€ûŠ´ñ•´²w‘¢¼rLG“ÄýèBIó;?¾ÎBRfRÃÑüÊËe^ É&c©…i‰Ý3¼ QYÑÝ´¸˜¦!±õ$^™‹©öcÛx†ÊwÅsùM̪¡Q3%sž4íÚËeŒ'³ý‹3>‘\u ®—²zà÷Fy•ÌÆ4b‹ËIŸÛÁfÖafü¸U¹ )µü³¬Ì Å'G*,k w˜LR\¶ß)¼ë:Â?Þ¹%=è$ 5ÄV°»Žts©ù:–„›‹RRm§‡]¸¬ìçYÓõÁQ˜º|b×ñQù×à'=ÁâϬynÇÉ¢T뽡׽ãTDnšç0­›Ø;JK™qD)Ò€Â>ê§nóQÙ;á®(ª“Ôªú›ùPeYU¬æýl”%“ð°˜Ä´yM3o¥|P ô_z»¿¹Z«qˆ™'Kç§ÜPÂâ-ßç.„mÄ­9Ë’øÎcú$³Ôòé“79±h'Ù.õH^(­ÞyÕ’àY¿!Ù»7þ‚‡—žÍË#éKk÷ÂGó"×¼í+Yy€KMÿ(‰óºEvoü7Ìø•¾Ô‡þ÷cÜ‹hû½¼"–w©‰å‹K½qêKÙÚr½GÎLä(v¯üyÄ€üÆìRgô/h¶KžÓ¶sQˆ¨]'JK>Ïù[±@~ÁçÓ)tŒô•¥ lßû 6.ùΓÖ"È|‚ÕUzŸ{]á¹בe + îö«x’9@”Ü ¸g­R™ÚßpJ2¿·|*k깫t#ì³Nº‰-ôË,¦äã~KgåP<–^È4°ù¤,^È '@%üÍ–ôìèrÜ0…;c±¸ ¾7ËÀ‡ìN‹Î‡œ0Õ>q«õ±p8A†P©Î|§ÈM"üAù=b \á\sy •ÎHSê_ˆ‹Cl`Bo¶¼ÏNl(ЩºœÛ0¿{ƒ‰÷s‘9 õ 1)£OeM.J¸‹ b¡Œ¬2}ëNƒ$|³Æ7¾ár\«Ré[>–­9Ÿ¸I8QnÔ­ÚTº[Á …áÆ°î÷È“ñ@(³ˆH¨›¿ÛÊÉþQ´ß®¯‘v¯…öÜb×ôá÷1Ë6+l¨ÚÁ»]o»‡^œE |* ¾o…U}߀Ÿ<ãÌ~€_·pTBàµ<ü9û«|.BåªÓ[r¯1ôçN~l+ÎðmìRŽYûùf«ð⣘5Àià5§î~+^FÓ•*Û“äì{Ë։å+ÒRºó+ÃU~>µÌm÷-[·–6™mP­)c¿YR7¡ï3’Ëòõ¢HŽñå›mÉNé³Íf¥@1ílßkôê;PQy-v¿QY¶ùA›c™ Ø[ª|.çºú_׫²²Ýo£þéCÁÂëçíy[Ì’ØËúZËÂ|ÿöoæ2|wÛ˜ì#ç» â±÷uÀâù'.saêÛó€¤Uþ“ÃW¼ü}µ3=¼š õeõ›–Áà&þ.G•øêqOÊù·ÐÜä RŽ{U~s–HÇf»ídµøGyDéDRE²÷·ëSuÜé8n-~Öe¢²ÚÆ}¬·PNA¯ïøíúÊ·²Ÿ«P¼¼àbU Û;øsê—*ž¨< tî—€¯2ßW{ÿÝÊ~ªb/aTA·è‡ë.,Ñ,áÃÂïS.‚¸Àºv ŒWž`˜zˆ~Å¥¿—í§›Ò°1J;^}~è8QRTZWQÓN–T(W°­Ê …ꑲg PÌ~¼R*N-ý¿Lo`¾ŽO:è£L£ÔPž- ÑŸ¿hà•d¡—%–F>–ȬM¦ì‡6>÷7*CÞêx,GúÞß„_eÎ#B1o×çcÿ¡®ôÄø1Y¸¢·ê22ÝËÔÕÊåOåIÕeÀ¹Ó Ë»Û€„Âjz|äÇC_¹è"¬ª‚a3åäÅ&¼#òm2 ƒ›QhÞ ss·I1ÿ¤Ì×0èwÒÞ=ìÄ d‘U”ªdÆäܪgZ—èfM´ü¬H #XÕõ¿Ù‹BÙŸå™aº„"™f»¹ÛIèY•mÖ¨â=T(.DæzUä Œ+”Æ4r¾ï¤åJ®Ø,=n&yj«Æ¹Óu ÞÜí²+'¦Bà­.w&ãÉ<XθßÄÈr?3£œ•oÍ}…TþãN uLÏò¡Äóä»”æžd—ª˜'g° ’ɹQ­¸óݦü³0´6ç^@ªß{YJy †.&t k&ñ!§zãHÖ-$ÛuëÈ2.\Q Â- ¾&BânSê­; eKî-&^¡Á1£ ðµ&õ¿oI^…Ìè&<‹Â¶¯®6:×>°(Cðà(ÂÜ3qåuM\¸y¹å–¤Î»×˜=ƒ(¡_Óò%Xè$®¼§PrÑÙÝ×93Š(í3÷uëµçÌÊ啵½ýZ$ÀT–ü˜Õƒ†üYâT³´÷²îB3y¨Ÿ ¬j’ójË)Þ?æ DŠZ!¶ÒA;NªPþq²(ÒèpÖq:uŠrKº~àðen ¢Ê¼•Å0û3f<+2ËcVã¥Òèõ IÆñg¿–˵‘OÜmª–vÄEµÁànS¢×Þ„uo‡çÅΚ„­:O¥ûo.x–XQªÆuvãÍE¹J¨é o÷ϹgæÞ&3Tð™hÇî[ >†wîfíRA§oÙïxX¨!ú«ûïª* ôc¸ÜïB§°!™LeúÚOX9<÷Êr­·ûN‘«H_ÒÒ7*Ë–Þê37-’F’z§ÏÊ! :9jªtû`ç3qNWu•ÊÊ“wú|QÇÂß…ßK§É Q­+‰v++ Vh›nô…ïèí¾˜•(4%ಊbeùÛ4ôˈ¦RRwƒž±>¦çV_¦7`éï«“Hßi¨|yOŽ¥ò°VV$¸3Ȭž•ú ¿»³P:““÷ü§[ï&EÄ›v¯0S´|?p>ç?Pލ¶Âè† ã7k¼–ï V%S*®Îýæ$ ·DÞT¾éÁã}ž{^™°ýý,5f\{‰<zÜ™Ej ÈÂó‰aͬuMáæ»™O^ÍË·jöv+¢ÿoC», ®ã†[ƒÄbw®Ä|Y ‡øÖ UBãT–ô:»&u‰â‚¼k&þ‹èl×¼Q™>ÿÞ šïYî¾hÐ5Ü>a^²˜È $$ËÑý†ªˆ:…›5%‚n×;åÿpóÌb߃“Ô-Õ47ÛmҮߪ-¤vçÔÅGŸ-*ÎøÍÓÂA’þv½ªœü÷ÕE~¨ "¾}ºój&ìÖ)Ú¥}wnüè­Úñw†+åk,Ú­¡äžL±6_øÝ¦ 1¬pßo®¥v “ħ 2psȦÒ‚nIu…‡à'¿ðÒWïì£,»ù”^!–è(ãÁ²ÒÕÂiQó*ZÁ·[f%ïm` ÕKs¯1ÞáöÃjòEÐwðç²I—š,Ò›ßγæø¡®Bû]ü1V Âßçaº0nîýæºzKáK“³.œÞˆÕ¡š‡Y- Ø?·ó,ß/³¥åOå•l®_¹[‘£ùfMÝ[CcqYš\upâ È”¬á˜‰Ê© ÷†žp©#òúÃ!’T½m̸÷C}Öê¦rŒ·† U9›¨J~MgŽô6™(gu#?fÓ"1£AA3aæÎRÇJ 1k‚£Î¢b2gQï=vsr™H›fu–ÂûÃócüÎÏ+×ðî0uKòR‰ åýÿ5AëÑï¦e¼wæ|øPÜknjL¼uã HHl’ìo±(,28·T§×}|6w&S%™¹QuY™óæÖÙœ—¬Z_Ýo.¬ ^Òƒ«¼Íg˜ø¸b?w+²õÀKIåBŠ_Ï’I¥ôyë, ‚Êó÷}uÈâ÷E z²n×ב½;BNP*7 œvm†[µ1—0¬ ÷” bG–ÓbâÔ©Lo×W ÄŸ³ˆ— it‚JR†ï5Æù=¹s–¸óϯè;ò|KáŒn‰·Ìc3VÁöÜiÈi¯sØ¡Rf~·ÝaÚ¹yµçáˆÅ.Òü:eˆ@â‡ð; p™ýÕìœ3âÀ'’x)‚â#Ï™VmÖÍÑ‚KôLnñÍš¨§{e-ï,K͸UZ݇£L¡›³ p²¬èé(f *Ø,×ÖÓ¹·ü5ÉÃë8OŒ{ c€­ÅÚ=94ö>fýõxœg+5Êw›RºÀÚÝŠdá»?{F’•‰H¾wæù‚U:>ß®¯nvó=º›…•[ïeÜ»IvªÙºýžŸójúïaÕdrpªÿm›q$ƒ¨ûîKÿGÍýöÁ2›ó«¼Ã÷~EŸ7VÒhúŸ_KgE×FUULùþ·¢´ñH»×^vû7QŠÂÐå–Úx0ØŠï¾û—]Á®µÜ+¸jØÀGiZk{é…Óqd¥ Š•¶:…’"æ‡`YÌEŸG¸ xZ”0 ©k^5®yyÚ7ÙâÏõÓKëëßPa•± Jûf˹¯Ž`­•{EI &ëvÈ6Œ£ROÜnÍ”úRl¶“«–Û¶;l•xªü¼•yô’×׺N¢|{ãëL=„¯Y˜(Gfýõú!r9o;o0ˆ u7ûÎL俀|ÐÇýÈý¼¢j>íÌVºÞùd†˜ÍÝw”±où"(ryåaQ‘„´auIuÕ×GÒZ¶TÑÅh‘†ê½Ýüy1ÁÇÄ]²­›x‚¬âÚºËX>ÆQǵ‹Tô¨LÕ—7Z®äwò& íYyçãEDµP¾Ñ)e‘’§#Ë©=Uázµk*ÚaNŒóUï±L}©^î7è(+ˆ`GV°Pvsk€NB1g¤3"‘k6ÞL]èk'«È«ç:ÀÈQ ®ùê _G])Ë2ÿùÊo #–`‚yí•õ‘ôUÈ?;ZIÑùÔF©Ï²-uiZ3¬Ñ£6®Aã¹Ú@pĵÖ*«ìÏF*½ØÁBPnæX .T'°Ó E´„ еGÅ|[@ß‘GS4¢?VG›ÍÕíØÆp…蜫õZ‡ä°y˜aÙ!GpéhCp†$8…ƒ¥¤µ¡z-¡A(sÞê¤À¶‘ob#AÛ4€ûÅTÔ ¯ŸEl³Ëµ×7‘D;dŽ\7d Õn£na?Ï_Ïœb R>B~›©×lýuâT‘LÏѶtÛ.°ë=†Y;³äêáâF<$£ì±x^DxKPÌ¡NÞßì!$(ßQê ®cÈú²8¥Ò-0$ ^²e¶û˜éXÖDÏAûÎEa”Ê—¿Ï`;W1:/)‹¶À! ¿Ù/å®Î÷|À=B£NœÐå*†ß8a"V9Ÿ­–|âäH¯ŸBËv°8W© ä¹YÇ4ïð4(¹öÈ׳äô"ö]Yl^2mY¢ví¼ba•ùÙέ*t–D*N ±sNÎÉúÈ%¬,2}EÕ™ü»ã9½Ÿ[ãÄ›8¹Q¾Þã$ hoã=Ð&‚~cIF²ö?Wñop¥Sm·[“PçeÖ[@ý”]Ùl-"묦8™¢uÒÆÐE¬5Æð6íÆçªŒ…ÈE\Oå̽âO cˆ¡–‰ÊE8!9ŠðfÙQo2':I¨°›L)FÉ%Ù±€U‰£D^BV—øñ‘b~ǧ›´ÞI}‡ðFÒm DHæ…Á0ÿB2‘ê€ßYäÑ­’ °!”wŸ¼Õó Ç$!úªÇÌ#üÒÖqÙÉ+xæA•Êš¾ñÕ}üÓ…mÙx g„ À”qBZLõá01!C]a8ÿ84p€ILë 2¼É9Å@e=U”¼„G„Sæx~õ+hWÏÉõe=¤’š[bXMŠWQ’`ç„2ްˆdÁ 1LIpü8[."¤&ó¯r›˜7”ÜÀ_ ïÀ|)eÒa ã±u께ËRôÞu%‹ñΙF Õ8Â6´²l+ä쯵>så£7Ú!C]•Ï8‘×;aâ*òÒ0Vå³ …Fj»™÷¹Î5n¼‰‚ë¶O/Òeòvå³è"¤ˆ#gx»”]ÚE“×çRй{„B=ÓÈ<¡Í7¾®ü탸°àÀ=–î09à>•‹¹9@&D¬r0>OÍ;SOív¦í™õýæè0"äª/C‰–e\Êš˜/é{¢Ü]zi6‹Ý¢T±H‰ùÕýAˬdšF2T:\$Q§DŠÎ´±Ô‘`ý¯ U9§•¸‰ªClùô´m´‡°@L]L˜è "U‚ésÜVÄ ˆÃe E¹ìd©hÕ•¶X3«pýc)ÍýðXFðàÛD2!€€%òxÍ|Θà C”õú¾Ë/]â5êÇÐ#6¸=á”Ú°ºKíöJ”ÂÔ ºÌb˜€ª9v(²•‰n±fKöCþï %hÇ øÑ-ß•4Þ4 êà>Ó,à\#ó©À=S"tÖ ™O=:†š‹#ÜaUª‡Êd ždÎc HQoÞ8ñ¸º‰?ŸkÇlã=êTuÿ¯Ìà_· 'ÀÜyBÔd;¸†ˆŠAfYRÛ€íòˆ3±„f~„“O€Ú–=Œ2½nUÔÀØ2ÇE}ëjg©rÁ2ÞÍXðŽÏ@æ¡7µ±Ôä*¬÷UXôAÒ&¡YÓúɈ„ ì­Af…'Jíê¹ç,Ͼ,ùÍ‚ˆÉòò,}ù\–õgªâZAÆ…ù©Ú)4ez7ºL™ª ¾~‚%ü̶c¹ Cm èÆ7‹s‰óÉÖgjõXQÅsÔ{«'p(LîfC 1ÉÇ0šD³Çü5ᄬŸqb±ØÉZtÁ{ä,Tò RvrHœDä\5Úbwä¢_ªfÛ-ì¥Æma¤=å>¶ÆVc¡îÅúë‘ö‰h— äT,9NB"Ö­ÿŒÞ:Ê›˜€^DhªÖo£ÕÖQén(>ùž #i§±ÆH¬wàU…¶~ú·L¿©›@P$‘» 垎¾Ö³úʶv9›úìÂðUoAùˆ¦w½G1ÈVOø)äDeÅ'‚ôB®ªúwr`â­”ùS“Âq9ñ–Ä||‰/>†…êwu$Aèëú€Zx¶–ùLj2œ;Tgpï/blm·3ßM„_V§;­r`šº%sò¤à×FŒ€‡7Ý™L¥§¢€1 mT™•gRÝçÚ˜u×Òn­hc¯/Û` „°n¶ú>µæ~T5ìmÏùHt`žCbGÖÛ‰KT«§(!žJ«ú:åqtgâ¨¢ÃæQhW¥,GɌʯ¯#Æ¡cæGô/iJ‰hóϼ‰|JyQ1]*C\{Ghçõ>2Â{ÜfßùDeeŒaŒõëŽôW³¤2 6' ¶`.1æŠìå u¾êé߯L›EÁ#ù•4SÕM2°!”F­Ÿz n YÍÖ0Œ`»ˆz}˜P9ílN\È®¯ÔŸnVkL¹2@îõ;;YªÐ˜Þ™  Ê™Ê× ‹\{#¡Æ”x”Øï1,škaH+[o©¶s¾mø„ÃáÅ”µ„õCƒó¨s’€| òeËò”š¡ uÎ0 ƒz„ ä6F>Ϩq5m.ñÁêøºcuæë¥å8JJ)0å‚@™N'–.†TÅ TžiÑkß/ÕÒH 5Ö F:.E 1b²ÔÕ4Ù’çøÔ¯c7£$¥¼¿’ˆ d„Õ)n/V$é-æÞ×z;o,£ê‘[¹9ੈ‰kM8¡f-w‹„Ô.°ŽNì\¨­¡Ë’˜¨v[Xèa©§|–˜…ô±¹Ò†+7¨ÃHT€¬év¡6gÙ)¨Õh·“uñgsâh' ÎŽò„õ/Tà׎çÂ]§6¡Í×<þ UD=6g@å¾Ì0™öùD¸tbXûˆ飯L2Ç» Éýp}éŽç¸4Þqé§·ÌzSÞÚ Ênž°eLjjÁeèží` Ú…zJ—Å_1‡—òÉe&Pª=]ãÚõ!÷˜¹ XÓ¾î Ãdáë.G#çøQ*‰`ááCþ‰Š›cç‚꺖IœˆKöÚxžü®‚Aƒ…‡ÉŒT&øú/|:59ª­µˆßÅQg3`*1Z˜¦Õ˜o¢Ò‰M´‰y$ì®5ý§>{ÅÜ„ sÔãh´Û-,‡†‚lx¡if[!&‰'ÁýË6jGÈ<HãPÕc±Ž’j,ÖZUq¿XÌf–OŽpG`šHªSE_êgN‚DŠmeAT!v4çÄ/výÈ#âéΗú6l¼²F˜ª^V½T=%=ô‰õK ÇÂSIÖ±>râѼ~,BÕпù˜u"b¯ÇH"â-T›ÖúÕmôÓÕR 0=µõ°¤µ‘ ÖNˆgíÔ#n•èJ@†s¦ŸU–Î!, +®¨g#FÈ‘ÞQ±Küf‡NPEMæýLbõ‡„‚⮕ùR ‹ë’÷0Ì›,^ƒšQ4ÃóÊo3à„1ÑxŒØ_Utc ŸT„)1^'Ñ¡&^掔ˆ.¤æ?ý¦Šh¿‰”(çdÚu¾-”ÔKÔrc‡xø”‘YªUÈeÃ$1Ôþž”ÃÚîðwùÕc`«ƒUpÉEÝDo®)9]`1}iô*Âlw—µÁ_¬»GÈ wxªüò$ úßêe2,Q¤>eõÐoge•4܃Ѧ.ñÜEWiU¶d›7NŠä7N8u·Þ]†ë,f›Ös #"E\ÆËÂætóÌñ?“S¿ BÏlYËQaPnŒ¸/>`iº9u ÁTYÜ%&s –ZÝvËsQ}OFÑZ¤3z&€·Õ¹½Ã¯D:ÐÄ«m,(¬;R,s-‘’Ð_™h©7:©æÞXç`å.H|j”Äkb¥|ޱÿ`?òµÑ Ù‡íÌ !KEHR”,H´úÈâõ~¨P×Q/°(PÝU6Nµ®m óIÉ©~L#:°•ÐÚažþ6Âx:dЏ8¥îMhÖ„Û³6" +I´ü*°‹ ÃÐ0$1þÆ?sÕB‡JIN<¢wɪèA­Ì>NOM–uƒ’†•äF4]ë­ðw9ÛæèAÁè;OƒmÑïÔ7%oM ÏÑç^¥×á$¾IUØÑóÌ쀇ªd³Öe{;çÄü쥱ùùŸuÆ%ξÐohÏáºFh³‡Š’úê#ÞbÕß Q«áqÑ£¹yœÅ`«Ât^„1t$cߊÎj!<ËÂWy¥Ãz¢t¨é¼Ïk¾¢I>à4J k´ƒ™pôEÙ‚;šƒßv¦±ÒF5rá¸êÌÂæÈM'D©v=“Ø þiëã9µ)½' ÿµqÐßh±ˆ¦ÓkqÝ߹ŵ(™–ç =ÀiA×g³•9©ÛÛv¼ÈY¨âq;Ëíjyæ07µ¤¢ºjÙ@E‰Ú´Ö!Ê”õŽÏ¿ÐAy&E‡v’»¦ Ô“„Ó­w):BæÇÓ,›]¹ˆoÔk—rËÖÌ—òË ÝÌï^%?ˆÈ´Ûü]– ˃x‹FÂG¼1ÜGYí>ãºçNV€˜–y¤Ó(ïcQª´^’­õ!›9Ô¢kÐ ³T‰¤/XQ•äÅŽžq}(K%ä‡ä¯ d¹vFt·#š;t³Í+¤ms„eëÕã‹òIL#†PAtGbF?qF•ÝìRO—ñ-åcªBß—Qä"oÿ–µ’%Øic‚îÔ%™)73þkJ O˜F" h.¸#€kØ”£®®ß=º˜$îG¢ø×™UcFèþÊÒ4,]f`„Ax  'a.V¥ ñïÃe²\Ê‹o"7C3n,Mª´²qÆ'‘^‘¾Ã\¨ç\ͬ”ÉŽ*7Ø¢Ay[hä¦ÑÜëFs4¢3ñËIU«‚c×!Ú‹-,Y/(-ê®0ƒ û(L]®í£sák¬/‹?Jž,´€æ­ãTDnª:;n½òEuký”D­pWÄD9yïHKæÅ¡œÚQ–®˜Â-\ÏÔ †X‘¥Â°!„ 6©Ê·Ív’uLoMQäbJý¥„æ<˜úBëmíˆXÙ7ŽæÔÇzcé5®t”ÄjÄHæÅªwú8Ë©›Çvd Š1Éû*:<õiâUÜÇàÂÄ$9 òæÐ8¥”ÿ‚Òt¬D¯!2Éw4rõ™n#P±C¹®õ™*vdµžÂ°¥Å9®µªºî\è&ª¶•%Dš’YÁIU•:Y´¦z‘ÖZDbßj±‹X\½a‹V÷ õ‘ê½òÄéåUlyKD¤ªÎw¡5³SrÞòb-ÓPËûL2lµŽ!ñ!4ê©F[ÀwP÷õfu^ ‰óHö¹$؈3NºÀ’Æ¡f`Ùmùðg*Ê[fÓËheížV/ÜÌÒen’¿Ò7.Í£¶ö†ÚcÞ„çt¹®½!Þ\ðÌe–ìó› =Nwû­0dVÞ|›Ì<’ zím¢æ÷ØÊh¼ô;ª7eç@1ŠïÍwËÊ‘ hßAee½×úÄÿ³ Ðî>^îÏ´bÐZV¶<è>sSêè ºñn73™èYVË ÖS?EÆúœ°$Ý€k}B{²$wîZ_8ª6¹/¨7ÕÎ2פ`³´£jq}Á†¯0¦~J¸ãÍÐT"¹lÉš‹å¾²º›åšQcšÜYH,Kì§šÇ^BÐÁúÃHËg"dËH^þA&åh‘@*L5€Íõ¨YhÕxÑND´Ò™‡³z_·Y¢#ªöðÌP¬¡ëÀ´:D ^%ÙHZ^—¬…è-¤c–Tõ3`JlŠsê¼¶©Á¾> IÉ0r&‹L$/‡BËx¼–ÕÜ,¿{’U’ ¶æab•®cn Êcž`i>õœàjq#T"·ÌÂAÖ|óó80§Sš*éÔÅG’˜{픈Í×N‰ôÔwf$Ž( èeã4t);E-É0¶qz¡e·:4ºymHÐýƪkyÂXµáœºÏ£«²lQÿôÁ#MËâMrΦD[º>d4A>´øÔTx# <™òÀ£LÁòLÂCM'»«_´âWØNt–׆D]„Ù¾¦Dzƒc:ÚlÓ5fÛ˜yEDß ³j•4Å §)P³¶”ßœ‡jNðí¡©äܲ5«¨¬ü<ˆÙ'‹ßò5,| +³ÀíTñ(6êhëÚ0C?²=Äd=I‘ƒa¾vÇ6Ð3“Ø ‡ž0&ÝÆ¼kÚ߆ª24 ©¬1ã;ÔFi ²tÕDüÎSX+cT‹18ér•_mŒ4ß]Ì·Ð-è§Müׇ=&è'ö»jÞÞ¦®žŸæ¯ *8Ô4:g·ZÕº3Çv˜–Ï!¨ß^?c‘jlßk­ø*º|ºã" Õ¦„ƪlbÖ+’)smLÍúØ¡”p™.×%mPaõ2ŽID嘹ËJܪˆ¾tÑꧬÚ5ß›­¬èQwW´ ðµ1 ëÃõ ýñ<󦾃š™ok<ϸ*jsWG›[cñ3èK0º»ÔF±1çZM“Së)¶-hÑ6h£‰wǨ1 ž$aÕÚ˜ämºö³¯ºþsÓÄdΜYÞc®Ku‚iÎT”·öž8‹]{O48ïù9õ©Ü|/°–—ºŽ¿ † ˧©Ÿü…ûÄà´JÐŒñäê¦a*,Ý ø«¶Àë¿R÷۵߈êcë7”ÄH޻߄fãÿ-U\ `tß}÷/ÿºúõ»œ9Rýª”]ìR&gËÏ^¶Ý¨ªì¤‚êŸñ_1ůYÙ?tyè·*V‹:Ü4=W %Ýaæ²_öYÿâסbrôTšžÍÂŸÑ©Ò ¡ò͇éªáÛ7˜]öLþ_fÈ*ÂTÁ$™:¶m3h¥ª¾nÛ¥yNökr‰Yš;ÕŒ0=V4–ärÛdé×.ê×-¾¶"UÃÑ/³™–/ÿ­–ÂÔ¦ Ñze¾n gÊÐôµ·éË¿b‰¾±ýýÝŒ¯ƒ4,ÑWc/ƒrKw þ[¶˜<1Ž_Ôûßtºf‡m£[©þ²ÌØhÒºX~äï­å‹‡ý‡Î÷vnä0Ü‚ovâ¿UK®¨Vëê­&GsÝ`T{âbÌ^ëVm»µqlš °î^ý5Ã0µmûÌ u³ˆitšç½ÙϘzÕ7=tU†¦|ÿQCF¯³ÅÍlC4¸x­êë†ó×Í£·o4Zú >ãÛƒ×âìÇSå¿ XÓÊ›^7ÍR‹fÓŒÃØ¿îR1`óªZ Ó†i n>+UÛÕ8鯋)ºÅÔ[E³ÙÜl4Û·Æ4F#äeŽžÑÝ`º1Ô4¥Ë-Šý…ºÔá2ۇˌõRÔöܦ)Æç?s›9”È”Såmh4½^áòq Pëïk@š¨V÷]ƒ0z;õ¾èçM>馞*MÐF#¸1`Ⱦ±*ÀجÙÙ¾Eƒ)ÞÆ¶Ícv€4B~]£9DñjÕë¿ ÌòeÝŸ&ç >V†&-ö§¹ÁЋÑ]+2AéÐ[¨G‚ѧÍ89bMÿ¢0ûÚ›Ûè8µï»28žT8:Þ®ÏÀ ÊÐм|_´¢¶'ÈìY¯uWåÈò…[ûm®„ÁÑ­å¢Û:ÑY ÊÝ×fõÍ‘x_ßj²û‡z6ùÀþ#ŒÁà”öG CyÐSKиJÂejÓzÒ‚) ¡Bšs«!OÊÁؼd ØlîHk0Æ}~É-&¡¯ Í¢þÝ6Xí€a-¿ð”|é0Eû~«ÉvÔ0ð/»9¦¤C¦X2C”²5œ)`Q I®ð\üŽükr§•º`SD‘©5˜ƒ9*B<ô2ꦰlS ›ªr7΢ Ø<ÊËAk bJd•išzo ŠÅÕcÍ€ÆÁé¢Óç¯: ºÛzÕÂ_nCè ‡N2Ö×ÎöÀ]b/ªÐf0UÓ°y×êŒ|ƒu2ì†ùZW„m›?eºIÆnõƒù…¨Qk ke‰Q*÷L§´ìñòC5œ ìYKÿuXÕœéK‹ù7ƒ“Lâ¨/ñ¶öeSê(S›–;À¹nõ¦eW†Síͪì“ i`ÆÏ~áh¿üƒÆF=Ť)­eL¸“sJZ¼IE|l]€®Æ‡‚ MÃ2w¨'73‡RV$šªÎ8D I• 5Úµhy}rúˆõ—4ãªÒÇéߤ)9Ìk©m¸a‚æÕÕÞ¬š6U­¡"Ö}o†5Æ>ëi L+ZyÂM_¯HwUчi-+R †oÕ7ºâ’hpƒ´[%c£þ }k-W±ÙÆ·íhn´_ìŠï›bµT1Hƒ90š¦m55ÌØÝä iJ´D–ÈU%ñ³›Ü—n@Mµ ü æõ‡9=;’–±¦"×!¯’!s¨Ö›!+ŒÖ‘cÑME&O›X|NcóÂYô[±¶—kþÒu×Ôè- Qu<´¾Lô;D:Ô6»ø³žhÎ{î‹›L‰‘Lm†ÌÏ&°Š´†´Fz2YÛ&-ï÷e­¹ÕÊn oד>˜Ò3ÂóMoêMIœ*s;™Ò™[i6 cúš»¡"°ÖfóÀ—~Ë8ð¿ à×´U§;²jüº¤òígò­×ð[ǪZUízö,=GÉpuõ¨l‚!ûÔ7ìÞXó„ÀèyÅ¿þ_Ùç7|üCGbH‹ÓøùÆiYh¾ê|ªj\ný´ômÆTkD£)Ÿã×½]‘…×Ü©©>‹±Ñô¥¯»õ„ªjKØÞ~åMo›óÍZ¿^±—Ù&š+¯ñ™$”ÕS:ʦ\ú# ½ìïzÞA½ÅTQÀb*ß`¶úX¾z½þàg}ÄZrD­ÁÑôV2f4çTlîßTñËð¢%XE-,SîmS›Ýˆí^¬Ša"Uõ*Ì=T4ÛÁ¾Ë©Z¾Yñ]sÞÃKÛÉãÓÐdLm©å*7¼H³“ÒgCù.cU?úžÝ€š¾nõ©Ë>É*X®¸Õøm;³}ٮɔÄÜj¸_´ö27_ÿâ×Î1£»årëS5äÂ5•@1*i™k¥\¦Õœ‚ܺ,‹q¤´|ˆýÈ+JÔ˜:°mÓ“ìÚ´˜‹§™[mßþúŠ©J÷\›7«²ºšjR^µ}û6sí¸Ë´Òl·—}6晵o¤ég/ßJ½Ô¯þ½ú÷êß«¯þ½ú÷êß«¯þ½ú÷ü׊õ?zHWÿ^ýû÷ù¯Z]äZË‘ÖcQ~•òúWMWM—jú–²¸zü[?nÊÚ ß¦íZVÐâêù[=oäÉß¯š®š®š®š®šþšÖ–)÷¯®®þ‘®eþÀ|úfõ¼ÛJ0QÆÄáKKpUíy퇫¦/mZ[–ʨiøÁ°}\ï8>fJ¯kÙ.e]¿j½j½j½j½j½j½\ëF^¤â?qÓVQt£hÜ”•0þqÚ®e•.þ~Ÿw:è€+"¡ªÍ+š7eå‹?®m­“ºÎô7lä2.Û´)‹[ümÛÖ»<ˆ÷¼åZ–ÿêùêùêùïáy«('ñÍÿ„ ®ÿÁg“ǵe-‰…Ísë_5]5]5ýƒ4­¯êG|û–kYʼnêç­"j°¡qý8aa\f¡¯eɾ¯ž¯ž¯ž¯ž¯žÿ€ç$ü}æªàÕóW=oä% .Û´9p¼€ÏæWmWmWmWmWmömײœðWÏWÏ«gÌ)õ|õümž·N˜R-¯¹ÑÿªÆ<¯ÿ7hZ_eþÿoY%ðÿiÙ.¥öojÝ*2û74þi¨xO\=^=~“ǵeüË4üËP\=]=]=ýOkËÔõEæL ~ÕvÕöǶý SŽ_=^=âãµ,™|õóú*ýöUËUËß]K–‡úªåªåªå?¦eSfE¿jû#ÛÖ–yƯ¾aÃN9S{Ñ|#ñL§=}² Uòæê—ÿ,¿äj|ú¿üé½·u©ÇM™òýòm[E¶÷/iÔ£”®ç…ÏD)öŠøKCz=ñœžò¸Û˜ðµ®T @O ³ÙZLDh“m@'^ªJÆü–)PÏä d˜SE(!Igð:6~S_h#6%³H ¨jŒiÆ4=§Ua ó‚Sg·ªD &Ÿ}Ehù›D$¶>ýÆÈNƒÂ¥òž‘¨ýˆj®‡ÄªmXg£“¸iµªÑ¥ñ¢ë{¬C©7J·Üi™FŒ Ú*˜Î°š„„®“ÁöYyÜ®*äHZd¹!(OψBŽœ ÝÖWGáÆ+¯¿h3ÍŠ»¡QCȺºéÆ{©„L5Ö±­š#âM^F†›§ÝÃÒa>ê~jç˜Ò/SD¼á:P–Ô„P´@vJNMHÈpœ äžhió3­¿a úœ)µ!³ÓØu¼˜f¢K-@” SÕ %W`s´*nŠÞ ñùìŠ ŸêBdòpýeÒtÐY«A¾¥Ó"™®-  ªýªáð>c óÕB9m=Ml¢ÉS¢ZŠõ¸2ó–hs¨¸æ_׃¶ÞãþÇY3¿­mkí5­<ÍÉl8ìÒ¬÷ßo¢Ê&d_q=mU@¦$+&)Ñ”1š¬˜áZ^:‡ÒXºŒ&y9úŽñÛ¾Öä[g’M×Ó°Æ–¯ìUw;Í2åeõóc”Ö+ÑEÃ*™ ?ÔˆE´é\eCì…&‹‰iÇJGBÌJ*4]%ÊáX†ûh|„©kÊ{hÛ¨‚öµ4ÐDÆnÐÜk[l:(r5Þ¹JõÊÉÞôpV0ŠD(Ëb`,v†jBˆ¬cÀœ=Ð8c¦yûT,±¾d€wNÇÛv×°…šúA;hä JÒXú˜H iÈš,`:ÅfW\+´Ó0]ªº3äVÕ4T°œª ÎÄe©ˆÀèZܬ5¥o³P˜¸Ë ›Cî†ÎÂoúN“K+Ù:tíöQóèáWÇ`ý%ïu þû§ÿþ÷¿þ×ÿûÿÐO» qçŸÎ×§0ö¿ÀZ0xúÿð¿ÿ4üj êNtaxize/data/apg_orders.RData0000644000176200001440000001534112672032225015536 0ustar liggesusers‹í][w7’ö$Ù±®‰-‘ÔÕŸyÚËdvϾïEÉ’³¢ÄMN^ö€M˜Ä¤ÙèAw+ê<í/ÞŸ0³ª«pi€N6ÎN’ñƒ…; Uô÷!7§_þûÆ—Ož<ùàɇðçƒáŸ}ýêÉGOÖá¿,Ÿý—TS®Š'O>Ü…ådøŸ&ÇÑë„%"c)/^þÇgWœ©—çL©Z'`–~.39ã¥l²õSQ,XieÙí«˜¨wR•r“ ꅜʄG‹Ÿ¥r•_ÔS%“9S¢Œ6ñy•%l&¢ï^òETØ»bbÓ˜tïZɬÑÂ#QÄ¥#Yˆ©Ì¢ŽG²d‹Õ3ß»©ò<^Ã8™ó*™ËU¼·òàé4šá莥˜­¨cï+Y”<ªÏû‹–}ìl#ØÑz”t–’iPÖ;W¢à©ÈÂu^ð)uÅ‘tG<˘Y/·Ò‘(KYä2XtïV*%ž†{û›SS!s˜ÊòçJ¼‘©ëð‚§ßˆl&¢9z¯S‘D¥»™È¢+žØCëÏØ}#)r¦ØÌšn·„‡ýS5d˜ÆrÀþ/JVD«8€¤9ìÒ4–a¯ÚïÂÁ¹€öy¼ý‹:—ñv_«¸°óú!^ñS‰(ŠhǯU2W}tË™ÏEÊx,Ëñ— psPž¹ŒæÙ璘dA{÷jE1Q²ˆH÷úÐ_˜^ºâyLØ;QUf,_ó~dÓ*qÐVk^ä,‹îèSÅ* LY¤WA±H£½3X®Læé¹-¶{)'–’z£ò¬Ö+ƒe)Y>‡um,_ õÑ\›,Òú¬Š‚GŠŽÆïelÆem™J¿k¯¡Ñ…UQ*9a"嶇ÿÜ„(X6U+³½¸Ubaæ/œéw'`AÉÛâpðü³/²<…M_.û(¦/_7eþy1Šø>%þI/ô÷)ð/gsÅËïUä_—ÁE>ãø}Šõú_3œ£ÅŠB؆ºs‚úÑ–Á–ÉsTí¶ö›BïЖ×J;áÆ í,—b‘%t`».›E;pà >Ö>fé=›ÊhÿÁ‡Þ3™ƒ[˜lÆQËÛö2­ÆkÛå¸×S^¼pŒ‰,’£s*¦õýÔIõ`î"£fÀ2þ¸êd¢Å·eª6ZA.0-Pçƒ޵›5sÌó²Ÿ3‚M•¤rFê*•È)Ræy1˜s0„·U0Ó§§Bf‰­âÁl‡§ YfjB=zcûšLC8"žðɪz~; g·4µ|±"çÑÏùêé<¾ª“Ò˜¢ðЮóŠÂðDŽÄø5™›pS#°-÷ ‡›Í낯êÌ ÈQ‚þ'+v›`ò–adZÏäJ…IU‚w^ÕÖñ gÕ¢Z9¬Ooæl2Õ~uºjeoĽX©/ÆIÊß¶EÆànVÎáX,ÀN‹•K1.Y¹rûKmVŽüè–-ŒEŽdá)ÏWªÎ¿ XR†ä/ŒC`šÓ¬½bÛ^(ŽíLØ {ž@k3m@cŽ` ’¯çtD³^0®縬r±àMü‚­\°lV±,žaÁq=׊ VwjvN;K§Ÿ2:3A àÈÎU5™„e½ Ppž1©îV6ãAéÎ¥dEXrUaɾ+ƒSP>Ê_žs8iÈTR„8³ZÈBº‡åcIÖ)_™©Ÿ‰âQW0_•Tj"ìLû'|FÁ}@~0ÐA¶Šg8† u&¦òx#§°•Šd…\$_¦5ËnOËxäìq(2/ð¤ÒÊ·) kî|yoÈKöPG¤‡£L¦œÕ*Öð…(JÝ/Æ-°  (¦¤+ÞýŠ-"¢Ã“J-X†c‡ŠD*§_p…~$ñ½[òiWÛ ˜°ÓŸÊ”æs¢-ˆ5]02ì]šÑé®%îÙbR%éþü€ Ëb¥ïĤRQi?)Áêaèr¦Ü0²ÏgËŽ•Aq§G‰"\´wÂÒV+ JN˜ÒáoIÊêeè‘քŸ~»Ð- £üvOË)ò«ÕK—×*(Ü9›ðpw;g‹œ—áRݳœ%t'âOà+Yý¹¤Ð~Ùs8ŒÅ¦ s¡Df÷’'u9µzYbÁ(ŽòÅC¦’™b÷añÁPÀPíãßøPf²Txô÷»=¬UYöÄJºÚÈ€Gpæ­ÂËÚ¹™÷èÏâ ØÖi¤à.lå2¬Ù{cÐO8rÆz:.A‡’ðôÝr•é“_„ ?¿óð8îÀüˆH“pd¸ïÉ£Ä_™ÞY•HºÅ÷¥{ý\&u3òs®OTvèsØ/ ¶ÏžjÛ9ös¡h†ä"Kæ2ÚB÷œ¾#´…àÊf,^÷Ñ%•ÀgÐw¦@õ7Õ$Þ·q©à|íÛì­TÌVtþöôÑ:‘(VÌÙ`ÝsÅkî_ò©¼µåC}ßI®–üèTØ_4ÎS.’9w² ™q—¡ /artÔ&óÕuÎò9ǃÂyƯ‹·pâ•AÑþõ'•² ·âÉ`ÁNaøï¼Ê2çzTæìxÖØ© Ø<¥F%f’.›`ÖK©9îzO¬¿‹ÎdPÔ=3sõî ;'õ„¾Èx²ýþW‚aw ä š ;ýºA¡"ýížsë;Ÿ?ÖóTN*s(öĽ ‘畊ôú`y™ZÀ¡s^‡»õ9+‘n\êm±¢íUC~ÍC8U˰ìù5šB°×ún;#½òëé‹ÐÈ< ˆ¬D‚¤%soÝKùÓx£•)¦oãD_I¯˜‰1O£uïŽK‘NÂZó…Ö¨õÞq5axÎógC y¤Í;AW-žè¨GP 0 t®»d•ÿ ªv¶Ÿ#îéKocá|éD=àZEPÚÕFf\…'Å"\Pßõ.C)³Q„óv_úª3nåÊ»™‚b%AáÎ¥ˆT '\­9ó°twÄÌÞsEñBÐEŸ/»Õ§–p•zYm*¯3ý,C6d`ÉéÁ)ŸqcHΪ\»…h†£ 8,À6¡[Å@::*H¹à¸ÇèkàPß¥ÍæÎƒÁ\¾*ËhŽƒ¹ª °)Ë¢™öÏRI\~|¦à\¤äF€¡®À„Ì¥šˆhŽ£W°†²Re<ËÁ¹þœÅ3ì_h(Ί .jí§“x¯Õ=}! õ’éOFõyÀX¯˜«¡þfaÅL@Ðz9Wñ©òiU°Yo§wM[H:¢ˆ±¢4wË~«Cpõ Ùn¯ÕkžIÆ„[½ÎØ,"AÀžƒ[ÅòpWî$ÄÏExˆÇ§¬¨sIÍåÜ{8±ýð)kBð«z‘Ï™}Öxk¢·DL|V镌‰uÏJžF3<â5sž–ª´ó]ÃqW߉?f _ZŸèìÄ*œñëÖœ”(úâú ^;µä½Ì@Z€¨–ô<=·öh»ñ[¥^ÓxçêÄr K7ãÜÜȇI¥fäµ2è­Nw -éDsæÖßÁÚÈocuÿ¡YIñ”,QuîÚ—ã\ §|‡CQË‚†Á!`.šË]ÔòþDà>9_üö—÷ÿò^wáT]%dì]á^_‡Z%#¸ '&íx6 ËŸA€3§o:®¼3¨rÅñ  WöKÍG¯é¡HT|T==…ˆt¬«££x^Ñ1{à3Yâ®×î8l*sQÖ!ñ³Ûp‹»NðWtØ×ŽA¦’ŽÇ#‘;×*»ý·˜/ê‚ ÈdD¸ñc)ûe!QU¤ì³þ=žAGÒîˉ’ Bö9"І ÖCßMNâçƒ:G;ã:gJÀjà ß‘õ NŸÙàGúl‰F45£ìÜ€/(yh\7N?24äg·5~…v[ù²VÁ‘joJn^ߨ#tˆöd9¯Õ ùIÊ)¢È_œò,ƒˆ‰OËx%ǧa]9òÀéaZ0oéŠÏ”x[-°Ù¾æ+Æs<‚3]ý­ Bc­nä…¾ø­ßÒ“OÇ šØ­å¸>ƒÝ‹b¹¶¨©W\ã~hµ1+™è.‹Oôõ uâ†e ƒ•‹{ŒÈ ˆ?IŸÙͧƒ@†ýWÕ‚´> ?>ÌL‡Èbyz'•*âð©â±ÎÁqµŒ•ì2.£ÂS[É<á‘þ\û» ³Ý÷çúHÓþ%ÖE»ßC zZ²åw1ëV³Ýö•t´îîÈx‚–p÷¦*c} p¿2ä¹Ôö1UÐ@>–fû¾Zòm誵¡‡OÂBà,Þ¸lœß ¸ÒNʲÜ\O¯âu&RÅz±¼ zK;ǯ–· 3±*ϹÆ:6©Ýß ¦ï+gÑ Gl¡áMf¶²t_—<^þñÎ•Ž¾,û#8ŽtbYŸvÆ<Þ½£1_€G¿÷Ñ,§¯„c™z™ÝËôžÖÔ“wX°2,\ÂI%íOÚ¹’f§ùÍ>¨“XÙˆ%E„^i2˜!œtïØ7úã?­«’g—¼©øÎe‚ÅEVîWz;L|jW–Å¥—tËjÿÉðcz@Þâ]a@øè‘ÌûU=kc·ÿS1óåÍÍáR›7 µ¹IùØe27©¿îÛ=X'¾r“°eS”1±’›„O<"2–µ¹ÇMÚÒ±.bc¿ ©³ëµ©ÃØ-Œe‰ Œù1“Åó¤$Cî$»FŒN\‡¿‰%-¶&M¶áf-WNíkȬÄÖ qµÅåEÒžÿÚE==q&`íÅrvÜÇ.…§Ùf-be†¨Hf¹‰X̦#b1Ã@$«g‘q6ž!n\ˆ3j1 ±C$$CÑiª,H[Å"¢éòÉ€”×"ÿQm²õØ%÷a÷ ™k´É{˜f“õš´69ŒŒ!ãa6ùŽ ‘íÈ”Ûä:có ™‹òµÉr”h“ãhë2œñŸ†ü†i6Ù çÐ#·ÑÎÞ™Û!¯á:YrÙä4¬ÌÑHu-òífC6£$C.CMC23H£[¼0Üv.Œ\¤Åþ"÷cø^Æ®ËÁæt‘#¦î5i1¶(ÍâiQÕ°³ð7r²p@. ×Òã_™É6t+Ì걫È{ŸŠÜ‹aPaã.gŠv±¤°]›Õ¤uB\(2ƒÿ‰Ì qžhèÏ MqÃm²†L„&œÃ¯\lÞ–M]¢=m‘•°Ü­»Ÿ6„$2} ‰,•M;ÂY´¨F´)ˆ^„Û”"ÌehDd-ê,6aˆô‘hB4b‹„ŠàQ‚L4âû‡ Cÿ1 lH?Æ]Õ‡üíı†ÖCñ‰!óà Z”w&Ø0tR#‹¤ƒµ9ÔLt98 ‡"!‹|CºI”ct цì:ÑkȶÎ}«cQiȲ"Æ$4´2µ6YƘZ¤Èà€Yoß[®Ã  Оv ÂëÉ"XˆzL³Aô87O=µ ò´ :žœ†…‡ÇIóðdbóŽ-»(w«„k§èÅF²Óž5ØuŠ^­Ž™,|:f2ˆt2ò·Ü¥Û[gŽõ[Èr2‰6–5áÚuk#׋n;qJ´1á&(2(pÚ½îÛxX ém¢ïÎ’ÐÜ& ²ðÛÆ8ˆmlÖÆh“®*Ûx='òÚ²‘×8× ÞšÌ;¡¬±­ÆŠQMÑJí*Ø:¡§-Çdc¦±9ƒ”6#3øhãÑ *»p+¼ëcmtÂ=S F¨fcBËL!A0sfpË8TB+“º:eRWƒLÆÚl<2ÖF(d2Rˆ=¦7ˆc2ígŒcvÐÅÆ†œ˜¦Äd*4LC¶pÂŽß5Ð`…Æîü—ì–ù¥~Ì—Rü›æmÎKŠaAx© ¶K;҆꒵÷ÏF›$×8N‚áb6ôµÏ‡ÚÒªh-¹ ÄÒ’«s!´´Y-ä,ª– ˜%§èàdɸðXRtƒŠÅœ–ôØÁÀsiA_mËè­Í¶tÅ:]|+Ú [§¶ ƒf¥)rA¬¸¹JNˆàªØ1£JëNÀTªçž»[Å Pi6]ô©1|.°uËF›â ]”)6ŠèR¬ŠP¥ØOƒ&Å~Y(R²µss¶N¨Q,c¡E±bƒ%«OˆP²×.‡â¢>± ç‰å=d'æ´°œX¥‹ÞÄü¢ŸxMœ¶eƒ/©2B\’S³`–´Ä.°’Ü@埖7 xë³á’ÆY€$n i‚ i—{$I@G3£m¤-jƒI |ÑX˜²å XÑ8 Ä(’sGh"M‘A$â–~å°þs ÝøèÆ;Ê~ì‚ ió¶ëi …X! ã%!%Ø Y0 )Hóc±W. S] Qü£­"ýOk×î™cíν}ÞøÒÿ6¸Ö÷n` `R-;`€yè´|0éðHt‡]@ Bב’x“þ‰¢Ã~YÀ92ÚXÛºöxÛÅa]ŽÂ'oï>moØ– r£4 ؆í9`6Ltl4Ñ´†íÃÔÈ`š‰^ l± >#·âÀÍ0Õ˜aK¤ŒL‘ "ÃÙyí8œm(FÖ” a´y,0Ö4æîáÆ|‘Òp÷öeÛÁu‘ò˜‹Fc\XÕ•‡ÅÚv°ZMâ¯/lÀÁ:±°Ï ‹¶ÙÂA­!Ò _º' ƒ¦"ç;6-Ä&Y©'.&ê“0#s³ýfÿû¤œôÔýŸü¿ýÜ ü¿¾kÚšGÝl?Wÿwš´î¿¬þ>á'<‹<"ÿ}Ó?ýnO³ÿ”³m¶<ÿy'­û¯¯·žº/°o´^]ÿ8øbòûÔ÷©?µÔ߬~»wIû‘íï–´xû‡¤­yoSÿØ¿? ¿bIÞ <#ý®Ó6Z@¿«”uÿè·'loþ!i­'•¼”5ïMØ÷¿ÿ¾~o‡Þý}ñ]û}ê>ºûÎ~?×ý!¶6Û¼þ¼“6Z¯ÆþßR¶CÂ~÷Ä5ïÝ×·ýÞh=»Ñz÷uÍ{®òýïŸýo÷ Ý;ÿí¢þÖ¿7Û/b¾Ë¤­À3|ïÓÞ§ýд5ïŸÛïÍö#‰/¾Ë«ˆkÞs~?·ßÛ¡÷7Ûïû½Ë¤íÐ뀭W÷~Ä”Ö#zï*åãà³záÔíÐûzOÝ7Û~y?×ýàÞE¯gÑ~º¿¶O‰ýRÒº«B[÷_7k%lÚú%§=u·úüôñW›íG¶I­©þæ)ÞÛCïSþV)[Ç€Þ§…ÓÖý'ˆ~”„è{F­GŒžºomz×iÛ¡·‡¼Ä'}‰¿j„ÿ±oð6O>DK&•X2*šß•sQ˜³Ò«d]Éo~mßþþúë_ÿ²ã·–¤¬ÀÖ0qcÊJöû7ý¿þ¢ÿü/ WÛ$†taxize/data/plantNames.RData0000644000176200001440000002533212672032225015514 0ustar liggesusers‹µ}érÜH’fmÏüÙž’È•ËuÝé´ü¼a[ ‰(þ[ì€0\=ò{ÃhÄnȈÍîUµñ@Šà dº¢3°J`’õ6ÐßÔj@»²<¡†4IÕ«½ÂË &YúØ­ìH#x1y…ŽƒSd„ñÚVÊÁ îœÆËÃö{>b•/;Á?NF¤©×iq—We \BW”6}^©´'©3U5ª×-]á Ñ (n®ö†Ïãø*; \.\›:goa²Bú•l])`b©ësÊ:/®€ƒÂºepSÕÖfl½Ï?š¦Ñ š¾7ÎL¶xùIû ȃëk “"ÑbÜwº†[жÀ«v¥Ú§Vg¼Wh]ë_=ÛþÕµóu»7(Ub¿fÃdäLŽß³$Â[8[Úw-0x³íҶͿ•íì֔Ͻù¬\gIUi{ 4ï‚\B[^m¬CZ?®½Ý¦·¼&©’G}Þ":÷ØQÜi<°§ø9þ¦ÿ Ë„©5Pk:ãßÒ0°þtŠN¯‚Ô{ö/KÇ`ÁžÃ~½<Ò¥X&(-¤‡˜B©Jˆ[넵~£àðôuBw†HØÅUS9n4œ'<%%¼q<’ÎüÓ­êà“;SY¨­/5#Ñéq §»^áA‰º×®øA^°–Àf€¥Xsê>6Þ¨Vh:ãkÂY2ʵ =e¨ú£Œ6ˆ”êÔÀõÊéÅßÜÃл]‰Òµò(%ëÆ Š6g¿°{”Gˆº.1}¤+:Ü·-]8Þù K§91 ùIIRÚ9ƒž ÓéµÐ+{S[ö-(&°<ª²|²ë/N[Ü£çÀöãy#y…Ùé¤|åheW ®lÕ°­³p+5ˆ´tŒ]žµ˜¦ã¬nlÂP@Ýuií/xÃÌ<ÿ*õ†È6ÿÁ@î±N—‹á0ãŽ1ËÇj·Ç¦ÔÑ®Ýx=FnrN›%^丬cÁýÈA3ë‚Ôº Õ¾ ”ÑõÕªž*Gò ²(H{L'ZÝ*.j]ƒlBòÇ û „<]—Ȥ€Œ“èrõ5‹êœê ëžöQ=Y8¤ø®¨ªÑ»õ-ì¡6ê´yÑuawt;/€Éd=èÉp]Zí·v|夆½‡“‚‚JeE-a®ÀWq©p-6ðþŽqĬœÀ÷à6ÐF® Às½…úåèAXm5üQ%‡åæ¬?µ/íÎr.,º†µ™IA¬!Òm)Ø¢ÉÂ9iMÍÎ%õé70/oªMÍeB6 Ö{2,¯ðáÆ;j#?–k†9àÛÀà™^´bè©ÿ8x ò~A4.{q±ES\Îݶ?Ò´ÊšB;ç%èbÄý .èé¦Ô=! Ó[&ý†vAD™2fÕÊ-%Ô-ì0ÈS‚ö Æ¥k³þYo¬Gî —Î´À3µ#óÎŒwˆ¶“##áy±%iNs‚JØr&' Þ6š†ŽuÚ©$šÈêoŠí°@—%œ|xs=ž;…þ· ,C›W r¾f“¶‡÷iÚ‹^ùˆS òœ°Xìy~cX ò®}Ñ´ Ä‹náš«òØ¢,.@ÐHÐÔk GHһ̂Eo´¸ÖPâË·ÐÁ4¿Ón°y¼Ö>]ŒÓ¡ÑVˆ NS  %[:¯â,äÃYúq¡k~ŠhÜGõ¤U•ftû™ÚUæÃtà÷U ŽiÕ¯ñ¼ï‚|p™y~ë¼`.8^[¡/q¨ñpê’dsÆ!R‰iuJ £AGŽ9i<ãóF×µzWq£èú^•ÀóŠ#\F¸:“É MƒÉl£èàœßêíh;} æ"9ëyPÐÆŽ …Ç@\…ÔµêV³¦óO¨‹UgÚ23í,5%µžDÀ(-èè#òú&®—~FFLd¡U!X[+” ˜ ù½3á!3P(os¢þoCoUÿœætÛ[X à‚ ç—%à…§`á…å+aõ‰¾ýJÈó p  — vZò+1“9sÉ,'ÃLPÀ¾ÓQ©Ý·j´SŒGç+Š)õ¶Efd@Þù•m‡Aþܨw-Ì;‰¶h*Ê”quTŠ€@ÃÅ&³„CkÒlƒ¯ÑW‰wþâŒnõ œ‚Î}¢®lDTKY~á'éu_é ð7fé`Í`ŠÌÏ3Mu>Ž |6ïg¢÷h–Gµ8Oµ‡ t›tÿk×9r8si¥_G 1P»´óø4Ø;Ú·á÷aØÀ_½îȨqQÁ6¦æ’è-ÊàÕ¨€£th Ôiîólá0 ÷ÖJvgê¬Ý-œÉÍZÅßÖÕÐ™Ï n¿û@8J…Š@˜ö°¼{ ©9'×¾³PÃ¥µ'Z8<öÕfb·þÑÀ k³`‚á&w-†gŸÉ׳kÿ¼Q¾"ý}|ÖfkA{ËY‡ç ¬|†·JÜ©ÿËɬô¨Ú¢2\€æèΗû‰ØùÛݾºî7èþȽ.’~~:<,'§ñÇÎÂj¨é'þ¬“á¹ú+·ñqnrŬ½c/;S …â$˜«ûL_Öª!žqqšz‹bæh|€{•jK‡áö5}``¾aræò½/{ Ôf0” þuÄP5VEbg˜VUÑf†ŠVºQ›ÛùG¥rm3ÔâTT)Ū(ØSESÓ3æ7±Y†üF5Ìë1ãc:ý˜vçäÚÂ,[d¿Ê“IMÈ é@ê /b“¨Jrn2"™Šn¦ÝÚ¹6lxëÙÖ.†F60—¦«Õ‚ÕECÁp™@ízôô±‰Œo«à™…†š âӊ ü3/±ÉaøìAiéb:~«k-Œzñq2üNº)á {Þ (ÎWdŸw^»ì±Ð† n±îºeÎå¡£d˜¼ÔF1qtùŸ¦¶OF?™Cígy«z^‚«MzlMOQ]GSÍe²Ù× q)ô_ê–FùjaËÐVØzôs:Ã迳mcƒù Îi °\™´$(ƒëÛÑkÒ´l¼–·(éÁ¤Em †².×B·8…¬nËvøûˆÀ0u-> Va}]ß ­À6° Ñæ3CWï46;ØåWñ9H¡° DÐÂÃL÷%WІé”J“ôþHdòog¸šYhO>×m/JF3=xC*zz¼ N»(ÜÐù²^7¸ÅÚÕÜô8ÿ„а‹@©ø²Ÿ\u¾ŽÒܦ—¤ä4ôƒ’g!õ\Z’í{·=Ó1ó5H£eäîÜ«Ë΂* [ cËå5á­$&À€Æ·†¼E¼³ çl[Ôí=’N³îJ}Ð5z¤] ܤèÉdvr¯|7xµ‹š¥Ç“)“©PZ­‘ ¢¯jä# ü¡Ù± ^˜|´³’xFí¢4‹ó •’@혔¿¢^cX‡ð`Þc°oh6yUråUeÀRö¾ æ,2ºÔÚ .\¹WܰûÃhpfˆ‚Ùf—¬@oá(¯œÞzPˆë:Ø-é—ëxíLCƒê°p©ç¿ ´õS0g`Ƕ5ÌÑ+~•‰Nïàƒl13ÜÍâóx3¹×ä$SCߨO‡z&N-~œ2ø!u%Ü‹d`¨¬;¯*UOÄ­¦ûä9•ç<ØÛËó´Rû`ßWè•ÚääÓüêæÞ•ýf¬eQÖD Î~D›vm›>Gý¤Žüeâ™Ônã|]£ØÏ†\p8Ä®PÎ}0Þ‰,ª’Úv ýŽVÒ5…ýìzppJà#ÙÈsÇ;…3ËLÇg×[U–ÁÇÔ­¾UDlç7}~=0| ’B$ Ú ÙD¨C´Á‘7Ú?“[NÀö¹/‘›¡Ï ®k®ZæTz5BbB®ááÝiwR79Úœ¶×Ãã6Ü*5y*ÅùÓ÷u®:*™)iùIk̰‹>0梤6ÁʃA¹AàÞ—9»EKB‚x-^›0:uzþæ®GK ÈìPpÌ`ù»“™±nAzªÿ˜¿o vC4,_:oƒæœæ¢aIJ½ðùg8Pã/·ž‰.àDêg“{RBüzJÁbÐ~sbKѬC+ yñùŒŽÏyè7Ü}8í~žþƒè}Œ™%cëÒîµHß@7"ÉÞô¼Ôhz"¥êŒaP;Ð`£™Ÿ†`»'L b@Ozûo=çAQ¦ÓŒ±1 …>²¾ò)‚`‡ÁÄ2ƒ½‚£G‡ ¨Z…ê¬/…Aðâ“éŠ1Œ;­¬,Nýä¡‘k1Ð 2O%ÆsÞ.b´Sg»Ó5p4¥·Š]F¤ÝŸZzïÇv …¦{Þ Ü4œ#󿈹DwbÉM®cŸ@^¸Êþæ' R20Ç(vX\ÆYW˜—t£‘wÇw`ª“½w¬ý”\ˆöOU ìE³8­;Œ‚J,ÆÞ‘äz.ZãQ·Ïü°ŸËÆ£9Ÿi¦ r©ñ&B+ºE§iGw`ö˜Ç *?`öMš €k2Ž{8å,Vœ \²Á-™îÅ0î_V©¼6;ÚÖs‚`OÑQ'­—k†ƒ¨ ÛQâÙO<{”¨Ž ¸ñ0G>òö£®ò °ôÅPÔ¦75?×ëOÈÊÚ Ô<Ü0hË„ ó:DA 0›è’M·÷ÈÎrNtŸÁ:‰ í›ãLº!!ÂÔ;¸\ᥛ ' ZŒës2Å1$‡œqr a3;“m§÷«¦~Ìí冻›Ÿ44µÂ&%¡åªjLˆÏDíOÊü¬J\åuöÈBNf©ÕÄö¼HM`J*{äæŠÁ¹ ™dtL¨ˆ¢"βbIdTGjÛ_ó0BB†›õúœA4â]³[SK{,C'‘Ug Ò²¦¯í Ý;— ‘[zÅÀIæÄŒ·Ý'q,Þ!hÁ`‰\F[ÁU£îNFÀYï“åeMÛT"ïïÿ7tþMîHX]B*ÕªÚqôÙ¤Á¹‹éÐĬj.¶*7BÀM½ahÑñ¹=jÃNéë4k£^˜ hxºNöŠâCÆç ƒ2ÚÔ“)1˜/½Òù‡Þ F•‘Û KÚáá|õ‡^›ÐVƒìTrS‚0¼\¸ E»Ä$28žß ‹JYhA0ߊÀ>¡JØ3æ|LÝ4̆Î-J™yÏœE „£ÂÞ&Ò·uâ– ÝhdÃäˆûá6%}a ‚K—cV©0Öbt¯Æ`1•¡¤uÂÂz75O\TxXsÓ†Šá$Žy[Y»µ¸-í–1…2£óJ̹ÁÌWXºUyî@ düò(Ò^Û5a Wk+Ã0XK‡a45kyJXäÒ‡m6@Ir¥¶ ôšôßÖS„9—ŸÇ¥«>ߟ_í; ñ?‹ÏÇ…rû«ˆKû¬î ²É åÐäoŒp[²?¯~ – zÈ‹BQ˜¥7¾ò¡/a]ƾڬxÒ xÇnØì“©0\­©¿Ø(÷ .œÊþüfØ8Œ’ ŸÄFUÔ—‰ê}éºÏ5†²¤q‹ž¯äÔS ži’?=zzÕV—Q>‚ÅsŽÝñ?þÅòDc 0¸‰ §YrÊ‚c@ØÆ\|ìKh@¡ŠY_@z€Ù3ö,^E_Ñè#ØèŠŒíƒè šKÎ:Ÿ ³F™ÞçÌÝt1}ÑcF±µÏftﵘ”çØ”– Dñ[±5ÃCnAÎi¿Ó’OÞ>Wµm=&êNÚœV_²"$ê"…Å$Z†þ&ð(šÉQ) ñó\é-ƒj½ñ5…½¹ÃÓ:â“ .T"‹üjŒn ý«èL™æU_\aDa—ÒëC8>Fê£ÓLÑú©ƒï?ù—l˜%pxvÛ¿øw 9ÁÄdÊPŸa†±¡M¡ž”ÞËÙШ0•ÌWœºÄdRÑ8NˆO¯6m„‚rŒÙMÖ…®W’ü‡‰•Á.2ðoç Õ kÄïA@B0‰¤½|ñ¦rXô"§êƒWn+3N?£¡58Kå.ï{Ò]xdüúÊX¯Ñ@Ôf,Œüõ:€wBò?¿AÎYÙ*ä&Ä-–¼”†Ú ÃXÓ}È(÷,æ}½ÅÉéLj]Æ\2oîLû°—¾‹Ö^)®¬þžQT&‹pM– Ó3yŸ£1› ,Lݱ4Ù°q>ãê›òVoBTSÇxÓ¨Å&ˆ5œÄ ŠÉüêu™Û[E¿V %ÏJµGI6©­ŒnH F$”Ř¡Ô¯âImHƒámÈÞ¹hŠÜxkKÈ#WÑ'ÄìVg¢9š",_¦ ÞºM\o&Ñ|¿ûÖ¢ó&s›ÙÚ‚dŒ£Q™#‚GXë7Ážƒþª‚øý u| D!U¶œXªÜ< Žœmˆq+½Åg?Yצ·A-Þp»ÔÙÈÂVcÊ»ºw(GáLÇ$m#®îrì!†qÜñI˜Î8ÿ¹˜Î*+¢[ôŠJ£4û$a(<Ç’}B‡´9ŠšÇ§ eØýгߟ¿÷™‘ 3¿Õm_›(‘<ò Ðw6:eh9æú;‰Ï1¨I9òä ?ouùàYÐ×,>×—/£D"€qFòè®o\ C†a}ùb'eëÞ è†P(äe¯ÐV»ÁØ Ô‹l` qSÉ2þVöí( ÚÎ×ÒÈqúÕº`ƒ-äáåSQkkO•þÁùØÅUÕÆ–c]”àŭà!:‡uÉõØä0trUõ-´j’?AztX³ßCzЧ¸X 1êkg™ ¹}»i@43†û5„ÑÇ6y ŠÜ.Ånœßµ¦ëT–^¢5ñOj‹ÕE‚œS5H‹Èõ7™êAÛÙ €ÞÆT¤Ãı5‡÷Fw5w´-8º³šéæ¢áaHG[µQ…÷8‚N0÷r¸T–²9‡@¸ôÄÎE£é*¬8 ä«ëXüõêÆ7ÐG8÷ dc¸8;z¯¿bvÀ4”t>4A1~‘¬ÇÌRÇ.Öl531ÄU5„ˆižï–žN¢QÞ€ˆ]DÓB²N®BÞ¸8‚`iß‚àÀ|?Ãж^›G²Í̯0'`Èç>b—; 'Å=ÄótšÏy‹Xú,fpú#Æœ{=þR¬]aŸ(–7 $ }?ô#"¯`/ïs9)i›!pÍ„.˱J=ø6#åÙ- 4ùà»É|H51ÌÎÆaÐ$AÎL5˜þGŒ¬©øO†H!‘.w;Xž€o6ÒõÔÓŒ‘mnùrÛØV£U0Íö v#´cMáL~}ÌyHn™àh4– kÈÙ§v;XO£·¨íú–úz| Ľç7% dÑ>«y–üÙW³±˜hV£±m t°œû£…ë` s΄i}R¦²Äìª ŠG;†”Ò€ª¢ôÅÜØy|^3F;»Á÷© Æ’²Øpì±ëPô…á2¼Æ4è‰jHhÌIca-Wßá"ÛL(ëÏúvóRg!†€Ô/Z·™$ÞŠ¦ÏƒÅ„섆¢†4•³Oè;£Ê‡M§‚µ,}wR²»­÷hi¡-«[]÷ƒHÑ {’ÆþËgØé¡u4µe¡ Ò»m¨ÃÞ²LŠä¥å¼ñí¹~£Ž…6ÝêΆ‰±\éHTéæ1XoYNè‚µÏø=>è%q+¤´IŒi@ß‘ȃ`ǙݜÚÛ ÏoŸ† Èë2 l8#â`¨Oìài§‡Ð=)P¯¹·F­‹É_9 b>0’æ[½µXÍGŲA ¦ ƒœ•Ùˆ`ÐSÎÔOS“RK:êáEëÝןVñmÜCžƒÜÏÖµøN²”õgmé\z)ŠžÜâ~oÐÒÂíâ¯Ãc,hÃ[¿Oð‚Äþ;^0 ‹¯Â“Fk^/v8-A:á÷§áa©žL'¹ü0ÒDôŠ}tú¹c}€žklÕ‡ªWµ­hWïëm4Ÿe„(Ü7x–PÇW—½¯')üó¿Å¦ÁÇ¿áu?Oÿ#ä¼ì¼ƒÿðc|c«¦g©KJ9 E*£8UÊÆcV~1Ýõ°MZä«­y—ª¶R Zu;ªÑÁÞ‡úMóítLå~õ…H…ÀHu=+LÊä¦cî° c9=Õ½wÑs Më/:Š!·-?[ø<6¶PÀ-ê:Vˇ·Ä@?´Í4z: \£¦ÔÏLíX®;Dƃx8 CkyºÜëÔŠÇA_ðÉaà¯^ï¸Z¼øŒ†›¡¥“…zàãÒîâNç!¶8ÜEÅ ÙgôÒEãŸebÕIZƒÒŽÓïC¶pü/¾b¾¾ã %“7Æi@2bqG'ãÜ Œ\M¿_Òðpyœ}bÕÔØœÍ†÷µûÂXf»e•^}Ñ^¹XÄIýÞÃÙð0²'žÔ;ž ³¯Ûø†zb–áH€ªÔ‹eÆókåFªÃQç©ÍÔCt:ÌHé¦gªÇÛ° ¡xðö7BiÏï3‹–ÈÑÍ?%‘Wpó-ÚÂPGÅÐÈPªÓ~xÜÖgõòo_Jõ|‰U"šôÓð(F¡NR®áТËâPé~Út…õʱ —Ô£S'*B‹J+}J˜ùó*fVœ©†äzGìì'ÊQF¼˜¤U¬†Ò†M49‹%™¿o0Âk·ßyò…Î߇Œ"F²XÆjϨ ‘¥C;΢Ò/‰ÌhÒJ,Á*½©BÆJ¬$¬)ˆ¤{Êáîó`‹¥RdÐþ’"Cq4Ç9ùZ€°z"…@¢Xû”WwÀº~¡$·ÁÕÑÅùœ• XˆÆ ð¦âMv¦Úw·œñPDs\»W‡11×h ¹d®Í˜©T€ô¯W_žqûc¤Šš<ÄÜJmº›„=p@¶1™³VÖv-<£¾Ë¡M³Í•,G³0yP°…em6@-ÐR£vtÊË;¸v*–ä È ö“ÓHS4F.N2V›È\ >¨ÜR-×E˜­Îx«˜óΗPÀ‡^¬5‡ƒ\Þu0¬ŸV»~Ã6¥G[PL&Íݺ~U2›5!eÄTV;!ý±Gº<îiQ‰ÎÐw¤\(dE©n©Yˆ g%ÌÖÂjE ¥‹^sv¨a ¦á sz§g2”·É=˜ñ¹Å k^ðå ´×êTÞ{†Ì8^è)F! Þ§=Æ­X pçŒÝßÁ“Nn¥€€Úès<* -Gœ…L(†u¨Z‚Db[™egÎ0 ÇÜ¥‹Bè#yÄg÷:÷&–«•4U/ Ÿt*­wSÏ'3†^1Ì™½¬­Á¶ÈVx)†a9þ†'?cOfZaæôÚ»VqZ,§ôcn±ðºl<ìŽ0 ¯±H:)“â9kÞÅ×ÐGåžÍWt¦EÓÎodÝ€ Ž<µq¼yªÇt´ù>”5ŸÔ» æâ[T³9»‡–X?pRLèÍù­/Ê´á[Ð4$ÕX¼‡3ÜUX׿âöd 7O*Ö¸¢ŒWu´!,3Që3¡I@¿Ãz‚É“ùú¨b¢‚Ç÷W&¼ÿŒ……¢OÏ£!PMX"$XdV•C±í–ù°8y`AÇ*F±â\·K† ô†Õ#š]«¸êºÜ1íw•†9RJ-T?´(c)!¸¯ï1Y Ëlh&‚ÿihbÑŒË4Z›•°vÏ=U·<»vp¡+¬R¬J-ûï0KËæ“°w®gá{÷JÑ1µFÌ®x£¸uìkÌ Õ¡š?é†?4)zh1,[å<ã8ÈjaŠcÆ¥á0a?uüVt ÔCê¤çqÍ2Ö®¢Èƒ;jL_>©ímÉ(>™ŸÖAøëT¡×)D‹g|1õÛ˧`ç«øqì7ƒ?ñ²Ö{µ•œ%ý‡)õ[] ˆFô:o'‘UËڣܤ´ã—: 1­N©±–>)ãc³§œ]°µDU+ïëH%Ç‘N$ìÊŸD‚K•φïg¤è]ÿÄýèsá« õ‡½OðX‡þ›'÷Ãg^õoîãâV¡ý©LItÓìž³˜0rža›ñƒ<2t_9Pöò2¤\=ñwŽ&ÀQ£ E–ô;Þ´äÇn¨>=,]!C”E¿ÅМë‡T©¡yɇŽ}ÓžmcÜkYÍàº~3™[Å{ÍîwFC`*©¦TˆqXj–¾BõÇ®>ÀtŠ4hã¥tbÁ@±{ë`óh ,ð€o+S1[½ö9f»ËÚê˜öµµUmB%éy†wé1°)€;U†¢™üM Íú¼¡S¬’yÕD×–›`RoÓt„3ˆÃ*‹qiéVÙPâ² t…¨9:‰„–êÙ 5x“X>)ýÈàñ+%)¸ç.^‡±x )Vñù°â6k‰›Ä\WMÚ 4F$§÷&(Ä݉Hß›àüÐ*bzõ$¹û‡;ô4þ\t¡‚è0qw Ûj0Œ9†² Á™Â&D{jFp†¡‘åÛüvÚ±Ãï æ";ߨ²-a¹’@vð <Ëã-CäÎäËAç²5îL`Kv‰{ÐL1 ñ2Ó®ö<3ªª‡¥EÛvÆk´¾ë|C¦xéèÕ–ø gáðãsg¬S<ÑÒÂÈáIñ³9Ís‚¬ñã>+^«ôü{)½ UçBQX4a–G‹MÿåðWØGc¸ñíWüŒÌpcðüåêåE¢á·1¨‹\±ÒÙ«¶ëÚ¬HÑ<ôÈøMâÄiÑEç<ÔãDX­i6~å†÷ÂGe4-Míú¹Ð'ÇÑAhÉU¨áš¶M ¡€6•кץ\¤ Ž‚ee¤O¯1ôÇÄzÌvq¤‘LÓ—è}ã1&ËÊlìÒÙPÒWÀa òr„:Jò—~•¦˜QÖÒŒ†— †½l35^]Ük‡EÚÆªƒ½ë&ŸM›üS†s¦_­ïÖ± ¯/ÄÁ[%”B­Ž€¹ ¶G[0…*!1˜1ƒŠÂ~iF vÅ]I ¥¾õ±&!náX“X¸òÈ ÿpªÒ¼Q°÷`i}-B·±@sŒŒui@$“U¤©åá‡o8&±®ZNý YÙÞ({ñⲪ'Áqª/c¤™ß$ÃùizjªJ;ªT‘žG—H>=g¥©éË'#øh§ÿ¶­Lí_Æ[,æµ.uj|ð‡„<¨ìW¯ƒk?IÙ%*l,¤4ûÐ1¾`htŒ“Õ™A‡l€°à’d›CHHR,"ÿŒ1DO¨ ¼mdg¾äÓÑùøM! Ýþ¥4=©ŽGª_”SM¬Hâm(ÙGiÏë]~±F%Ö ÌÕßÝ•‡_£ÃvüjQ ŸWmË?RÅúe›JèηҹÅÁ ØŒü-3[‰š È1/—"³óP‡r[Çfƒö{y6ïÑÁ‰ŸÌЃ‹˜U½ýíCår<ËÄæ¯êQ…o(ih亭oz,7Ô4Ø[¡J-¾¢2âúÚnRÜìfÈ t±:½ª9óýw¢zòŸ µ`@+ú¬[6zÈÓLÙó¢|è8–wòã+ô1¦ Füì OÀncŒ3­Ø`¹ÕÝ ÷{•š0ÇöúK¨x‡¾Åè±ïž4«cè`Vظ«Ó¬ £ VŠœ*´«5.ØE쪡ö~©žbq=8(™õXGTø¬ob$Ö`ÂØauázËì„!–#~²#xY Ý“¯ñ«u¥ÆL8b©ÁÄ÷3þ^᧨XÊðñǧ?aœå80…üÿa÷ÅP©xì'ý^~æï·ž/¿"À¬‚ð czÒj–Ù:Á?i«8z&úðBÀ!®Ým‰õü YRGg2ÓùƒaW_‰áëGÒGO¿Ú1ÐÉ>úMªX?£çE¿aÕ«Aî ñ-e(þß½Jš°ÆÞᢋbf‹{‡A=ÅUfIJyJ€ˆZû½w\cÂ`{¯>L~²Z¦CQÈÎTúV :>ªÍ•8ýÝŠ ýT<ìŒØw·OU"RÙZ¸ÍÎבּå‹Á*{m§‹¹ÜY_…ŠŠ“H˜«2ÔS _Ò”¡8¿`°-ÖúÅ2‡§o>”V§¬p FÖÉýfL×¡š˜”‚ý3Æÿ•ß9£– Qj%´bdü¼ ø±Ï¨ƒñÒV]á¾Û¥è-~k'-õ?ŒÆ ñÓi@¹™±–%wŠõ±û¾¾ÂâQfZBc|šÙP±kR5d–`ÌTfæ÷³k«Ûä7LQíjÚ.c™ëj熼ëÆyñQÕÔFû¡¤_j´XPN®¡È›“÷¥îº˜óXƒ0 þ÷ÿþÚn¶ã€taxize/R/0000755000176200001440000000000013162233432011756 5ustar liggesuserstaxize/R/eol_utiils.R0000644000176200001440000000007712672032225014257 0ustar liggesuserseol_url <- function(x) sprintf('http://eol.org/api/%s/1.0', x) taxize/R/taxize-package.R0000644000176200001440000002322013133001457014773 0ustar liggesusers#' @title Taxonomic Information from Around the Web #' #' @description This package interacts with a suite of web 'APIs' #' for taxonomic tasks, such as verifying species names, getting #' taxonomic hierarchies, and verifying name spelling. #' #' @section About: #' Allows users to search over many websites for species names (scientific and #' common) and download up- and downstream taxonomic hierarchical information - #' and many other things. #' #' The functions in the package that hit a specific API have a prefix and suffix #' separated by an underscore. They follow the format of \code{service_whatitdoes}. #' For example, \code{gnr_resolve} uses the Global Names Resolver API to resolve #' species names. #' #' General functions in the package that don't hit a specific API don't have #' two words separated by an underscore, e.g., \code{classification} #' #' You need API keys for Encyclopedia of Life (EOL), and Tropicos. #' #' @section Currently supported APIs: #' #' \tabular{llc}{ #' API \tab prefix \tab SOAP? \cr #' Encyclopedia of Life (EOL) \tab eol \tab FALSE \cr #' Taxonomic Name Resolution Service \tab tnrs \tab FALSE \cr #' Integrated Taxonomic Information Service (ITIS) \tab itis \tab FALSE \cr #' Global Names Resolver (from EOL/GBIF) \tab gnr \tab FALSE \cr #' Global Names Index (from EOL/GBIF) \tab gni \tab FALSE \cr #' IUCN Red List \tab iucn \tab FALSE \cr #' Tropicos (from Missouri Botanical Garden) \tab tp \tab FALSE \cr #' Theplantlist.org \tab tpl \tab FALSE \cr #' Catalogue of Life \tab col \tab FALSE \cr #' National Center for Biotechnology Information \tab ncbi \tab FALSE \cr #' CANADENSYS Vascan name search API \tab vascan \tab FALSE \cr #' International Plant Names Index (IPNI) \tab ipni \tab FALSE \cr #' World Register of Marine Species (WoRMS) \tab worms \tab TRUE \cr #' Barcode of Life Data Systems (BOLD) \tab bold \tab FALSE \cr #' Pan-European Species directories Infrastructure (PESI) \tab pesi \tab TRUE \cr #' Mycobank \tab myco \tab TRUE \cr #' National Biodiversity Network (UK) \tab nbn \tab FALSE \cr #' Index Fungorum \tab fg \tab FALSE \cr #' EU BON \tab eubon \tab FALSE \cr #' Index of Names (ION) \tab ion \tab FALSE \cr #' Open Tree of Life (TOL) \tab tol \tab FALSE \cr #' World Register of Marine Species (WoRMS) \tab worms \tab FALSE \cr #' NatureServe \tab natserv \tab FALSE \cr #' } #' #' If the source above has a \code{TRUE} in the \code{SOAP?} column, it is not available #' in this package. They are available from a different package called \strong{taxizesoap}. #' See the GitHub repo for how to install \url{https://github.com/ropensci/taxizesoap} #' #' @importFrom graphics plot #' @importFrom methods as is #' @importFrom stats as.dist hclust na.omit setNames aggregate #' @importFrom utils URLencode citation download.file read.delim write.table tail #' @importFrom ape read.tree as.phylo.hclust plot.phylo #' @importFrom jsonlite fromJSON toJSON #' @importFrom httr GET POST content stop_for_status upload_file warn_for_status #' add_headers timeout config #' @importFrom data.table rbindlist setDF #' @importFrom foreach foreach %do% #' @importFrom stringr str_extract str_split str_replace str_replace_all #' @importFrom plyr failwith rbind.fill llply ldply ddply l_ply summarise colwise . #' @importFrom reshape2 melt dcast #' @importFrom xml2 xml_text xml_find_first xml_find_all xml_children read_xml #' xml_name xml_ns as_list #' @name taxize-package #' @aliases taxize #' @docType package #' @author Scott Chamberlain \email{myrmecocystus@@gmail.com} #' @author Eduard Szoecs \email{eduardszoecs@@gmail.com} #' @author Zachary Foster \email{zacharyfoster1989@@gmail.com} #' @author Carl Boettiger \email{cboettig@@gmail.com} #' @author Karthik Ram \email{karthik@@ropensci.org} #' @author Ignasi Bartomeus \email{nacho.bartomeus@@gmail.com} #' @author John Baumgartner \email{johnbb@@student.unimelb.edu.au} #' @author James O'Donnell \email{jodonnellbio@@gmail.com} #' @keywords package NULL #' Lookup-table for IDs of taxonomic ranks #' #' data.frame of 36 rows, with 2 columns: #' \itemize{ #' \item rankid - a numeric rank id, consecutive #' \item ranks - a comma separated vector of names that are considered #' equal to one another within the row #' } #' #' We use this data.frame to do data sorting/filtering based on the ordering #' of ranks. #' #' Please let us know if there is a rank that occurs from one of the data #' sources \pkg{taxize} that we don't have in \code{rank_ref} dataset. #' #' Also let us know if you disagree with the ordering of ranks. #' #' @name rank_ref #' @docType data #' @keywords data NULL #' Lookup-table for family, genus, and species names for ThePlantList #' #' These names are from http://www.theplantlist.org, and are from #' version 1.1 of their data. This data is used in the function #' \code{\link{names_list}}. This is a randomly selected subset of the ~350K #' accepted species names in Theplantlist. #' #' @format A data frame with 10,000 rows and 3 variables: #' \describe{ #' \item{family}{family name} #' \item{genus}{genus name} #' \item{species}{specific epithet name} #' } #' @source http://www.theplantlist.org #' @name theplantlist #' @docType data #' @keywords data NULL #' MOBOT family names #' #' Family names and their replacements from the Angiosperm Phylogeny #' Website system of flowering plant classification. #' #' This dataset is from Version 13, incorporated on 2015-04-29. #' #' @format A data frame with 1597 rows and 4 variables: #' \describe{ #' \item{original}{original data record from APG website} #' \item{this}{Order name} #' \item{that}{Replacement order name} #' \item{order}{Order name} #' } #' @source \url{http://www.mobot.org/MOBOT/research/APweb/} #' @name apg_families #' @docType data #' @keywords data NULL #' MOBOT order names #' #' Order names and their replacements from the Angiosperm Phylogeny #' Website system of flowering plant classification. #' #' This dataset is from Version 13, incorporated on 2015-04-29. #' #' @format A data frame with 494 rows and 3 variables: #' \describe{ #' \item{original}{original data record from APG website} #' \item{this}{Order name} #' \item{that}{Replacement order name} #' } #' @source \url{http://www.mobot.org/MOBOT/research/APweb/} #' @name apg_orders #' @docType data #' @keywords data NULL #' Vector of plant species (genus - specific epithet) names from ThePlantList #' #' These names are from http://www.theplantlist.org, and are a #' randomly chosen subset of names of the form genus/specific epithet #' for the purpose of having some names to play with for examples in #' this package. #' #' @format A vector of length 1182 #' @source http://www.theplantlist.org #' @name plantNames #' @docType data #' @keywords data NULL #' Vector of plant genus names from ThePlantList #' #' These names are from http://www.theplantlist.org, and are a #' randomly chosen subset of genera names for the purpose of having some #' names to play with for examples in this package. #' #' @format A vector of length 793 #' @source http://www.theplantlist.org #' @name plantGenusNames #' @docType data #' @keywords data NULL #' Defunct functions in taxize #' #' The following functions are now defunct (no longer available): #' #' \itemize{ #' \item \code{\link{col_classification}}: See \code{\link{classification}} #' \item \code{\link{eol_hierarchy}}: See \code{\link{classification}} #' \item \code{\link{tp_classification}}: See \code{\link{classification}} #' \item \code{\link{tpl_search}}: Use the \pkg{Taxonstand} functions #' \code{TPL} or \code{TPLck} directly. #' \item \code{\link{get_seqs}}: This function changed name to \code{\link{ncbi_getbyname}}. #' \item \code{\link{get_genes}}: This function changed name to \code{\link{ncbi_getbyid}}. #' \item \code{\link{get_genes_avail}}: This function changed name to \code{\link{ncbi_search}}. #' \item \code{\link{ncbi_getbyname}}: See \code{ncbi_byname} in the \pkg{traits} package. #' \item \code{\link{ncbi_getbyid}}: See \code{ncbi_byid} in the \pkg{traits} package. #' \item \code{\link{ncbi_search}}: See \code{ncbi_searcher} in the \pkg{traits} package. #' \item \code{\link{eol_invasive}}: See \code{eol} in the \pkg{originr} package. #' \item \code{\link{gisd_isinvasive}}: See \code{gisd} in the \pkg{originr} package. #' \item \code{\link{ubio_classification}}: The uBio web services was down for quite a while, is #' now (as of 2016-05-09) back up, but we don't trust that it will stay up and available. #' \item \code{\link{ubio_classification_search}}: The uBio web services was down for quite #' a while, is now (as of 2016-05-09) back up, but we don't trust that it will stay up #' and available. #' \item \code{\link{ubio_id}}: The uBio web services was down for quite a while, is #' now (as of 2016-05-09) back up, but we don't trust that it will stay up and available. #' \item \code{\link{ubio_ping}}: The uBio web services was down for quite a while, is #' now (as of 2016-05-09) back up, but we don't trust that it will stay up and available. #' \item \code{\link{ubio_search}}: The uBio web services was down for quite a while, is #' now (as of 2016-05-09) back up, but we don't trust that it will stay up and available. #' \item \code{\link{ubio_synonyms}}: The uBio web services was down for quite a while, is #' now (as of 2016-05-09) back up, but we don't trust that it will stay up and available. #' \item \code{\link{get_ubioid}}: The uBio web services are apparently down indefinitely. #' \item \code{\link{phylomatic_tree}}: This function is defunct. See #' \code{phylomatic} in the package \pkg{brranching} #' \item \code{\link{phylomatic_format}}: This function is defunct. See #' \code{phylomatic_names} in the package \pkg{brranching} #' } #' #' @name taxize-defunct #' @aliases defunct NULL taxize/R/gisd_isinvasive.R0000644000176200001440000000045012672106003015264 0ustar liggesusers#' Check invasive species status for a set of species from GISD database #' #' THIS FUNCTION IS DEFUNCT. #' #' @export #' @rdname gisd_invasive-defunct #' @keywords internal gisd_isinvasive <- function(...) { .Defunct("gisd", "originr", msg = "This function is defunct. See originr::gisd()") } taxize/R/upstream.R0000644000176200001440000001073713160565666013770 0ustar liggesusers#' @title Retrieve the upstream taxa for a given taxon name or ID. #' #' @description This function uses a while loop to continually collect taxa up to the #' taxonomic rank that you specify in the \code{upto} parameter. You can get data #' from ITIS (itis) or Catalogue of Life (col). There is no method exposed by itis #' or col for getting taxa at a specific taxonomic rank, so we do it ourselves inside #' the function. #' #' @export #' @param x Vector of taxa names (character) or IDs (character or numeric) to #' query. #' @param db character; database to query. One or both of \code{itis}, #' \code{col}. Note that each taxonomic data source has their own identifiers, #' so that if you provide the wrong \code{db} value for the identifier you #' could get a result, but it will likely be wrong (not what you were #' expecting). #' @param upto What taxonomic rank to go down to. One of: 'superkingdom', #' 'kingdom', 'subkingdom','infrakingdom','phylum','division','subphylum', #' 'subdivision','infradivision', 'superclass','class','subclass','infraclass', #' 'superorder','order','suborder','infraorder','superfamily','family', #' 'subfamily','tribe','subtribe','genus','subgenus', 'section','subsection', #' 'species','subspecies','variety','form','subvariety','race', 'stirp', #' 'morph','aberration','subform', or 'unspecified' #' @param rows (numeric) Any number from 1 to infinity. If the default NA, all #' rows are considered. Note that this parameter is ignored if you pass in a #' taxonomic id of any of the acceptable classes: tsn, colid. #' @param ... Further args passed on to \code{\link{itis_downstream}} or #' \code{\link{col_downstream}} #' #' @return A named list of data.frames with the upstream names of every #' supplied taxa. You get an NA if there was no match in the database. #' #' @examples \dontrun{ #' ## col #' ### get all genera at one level up #' upstream("Pinus contorta", db = 'col', upto = 'genus') #' ### goes to same level, Abies is a genus #' upstream("Abies", db = 'col', upto = 'genus') #' upstream('Pinus contorta', db = 'col', upto = 'family') #' upstream('Poa annua', db = 'col', upto = 'family') #' upstream('Poa annua', db = 'col', upto = 'order') #' #' ## itis #' upstream(x='Pinus contorta', db = 'itis', upto = 'genus') #' #' ## both #' upstream(get_ids('Pinus contorta', db = c('col','itis')), upto = 'genus') #' #' # Use rows parameter to select certain #' upstream('Poa annua', db = 'col', upto = 'genus') #' upstream('Poa annua', db = 'col', upto = 'genus', rows=1) #' #' # use curl options #' res <- upstream('Poa annua', db = 'col', upto = 'genus', config=verbose()) #' } upstream <- function(...) { UseMethod("upstream") } #' @export #' @rdname upstream upstream.default <- function(x, db = NULL, upto = NULL, rows = NA, ...){ nstop(upto, "upto") nstop(db) switch( db, itis = { id <- process_stream_ids(x, db, get_tsn, rows = rows, ...) setNames(upstream(id, upto = tolower(upto), ...), x) }, col = { id <- process_stream_ids(x, db, get_colid, rows = rows, ...) setNames(upstream(id, upto = tolower(upto), ...), x) }, stop("the provided db value was not recognised", call. = FALSE) ) } #' @export #' @rdname upstream upstream.tsn <- function(x, db = NULL, upto = NULL, ...) { fun <- function(y, ...){ # return NA if NA is supplied if (is.na(y)) { NA } else { class <- classification(y, ...) toget <- class[[1]][ grep(upto, class[[1]]$rank) - 1, c("name", "id") ] setNames(downstream(x = as.tsn(toget$id), downto = upto, ...), toget$name) } } out <- if (length(x) > 1) lapply(x, fun, ...) else fun(x, ...) structure(out, class = 'upstream', db = 'itis') } #' @export #' @rdname upstream upstream.colid <- function(x, db = NULL, upto = NULL, ...) { fun <- function(y, ...){ # return NA if NA is supplied if (is.na(y)) { NA } else { class <- classification(y, ...) toget <- class[[1]][ grep(upto, class[[1]]$rank) - 1, "name" ] col_downstream(name = toget, downto = upto, ...) } } out <- if (length(x) > 1) lapply(x, fun, ...) else fun(x, ...) structure(out, class = 'upstream', db = 'col') } #' @export #' @rdname upstream upstream.ids <- function(x, db = NULL, upto = NULL, ...) { fun <- function(y, ...){ # return NA if NA is supplied if (is.na(y)) { out <- NA } else { out <- upstream(y, upto = tolower(upto), ...) } return(out) } structure(if (length(x) > 1) lapply(x, fun, ...) else fun(x, ...), class = 'downstream_ids') } taxize/R/eubon_capabilities.R0000644000176200001440000000072613060060133015720 0ustar liggesusers#' EUBON capabilities #' #' @export #' @param ... Curl options passed on to \code{\link[httr]{GET}} #' @references \url{http://cybertaxonomy.eu/eu-bon/utis/1.2/doc.html} #' @family eubon-methods #' @examples \dontrun{ #' eubon_capabilities() #' } eubon_capabilities <- function(...) { res <- httr::GET(file.path(eubon_base(), "capabilities"), ...) httr::stop_for_status(res) tibble::as_data_frame( jsonlite::fromJSON(con_utf8(res), TRUE, flatten = TRUE) ) } taxize/R/gbif_name_usage.R0000644000176200001440000000740412672106003015177 0ustar liggesusers#' Lookup details for specific names in all taxonomies in GBIF. #' #' #' This is a taxize version of the same function in the \code{rgbif} package so as to not have to #' import rgbif and thus require GDAL binary installation. #' #' @export #' @param rank (character) Taxonomic rank. Filters by taxonomic rank as one of: #' CLASS, CULTIVAR, CULTIVAR_GROUP, DOMAIN, FAMILY, FORM, GENUS, INFORMAL, #' INFRAGENERIC_NAME, INFRAORDER, INFRASPECIFIC_NAME, INFRASUBSPECIFIC_NAME, #' KINGDOM, ORDER, PHYLUM, SECTION, SERIES, SPECIES, STRAIN, SUBCLASS, SUBFAMILY, #' SUBFORM, SUBGENUS, SUBKINGDOM, SUBORDER, SUBPHYLUM, SUBSECTION, SUBSERIES, #' SUBSPECIES, SUBTRIBE, SUBVARIETY, SUPERCLASS, SUPERFAMILY, SUPERORDER, #' SUPERPHYLUM, SUPRAGENERIC_NAME, TRIBE, UNRANKED, VARIETY #' @param datasetKey (character) Filters by the dataset's key (a uuid) #' @param uuid (character) A uuid for a dataset. Should give exact same results as datasetKey. #' @param key (numeric) A GBIF key for a taxon #' @param name (character) Filters by a case insensitive, canonical namestring, #' e.g. 'Puma concolor' #' @param data (character) Specify an option to select what data is returned. See Description #' below. #' @param language (character) Language, default is english #' @param sourceId (numeric) Filters by the source identifier. Not used right now. #' @param shortname (character) A short name..need more info on this? #' @param ... Curl options passed on to \code{\link[httr]{GET}} #' @param limit Number of records to return #' @param start Record number to start at #' @references \url{http://www.gbif.org/developer/summary} #' @return A list of length two. The first element is metadata. The second is #' either a data.frame (verbose=FALSE, default) or a list (verbose=TRUE) gbif_name_usage <- function(key=NULL, name=NULL, data='all', language=NULL, datasetKey=NULL, uuid=NULL, sourceId=NULL, rank=NULL, shortname=NULL, start=NULL, limit=20, ...) { calls <- names(sapply(match.call(), deparse))[-1] calls_vec <- c("sourceId") %in% calls if(any(calls_vec)) stop("Parameters not currently accepted: \n sourceId") args <- tc(list(language=language, name=name, datasetKey=datasetKey, rank=rank, offset=start, limit=limit, sourceId=sourceId)) data <- match.arg(data, choices=c('all', 'verbatim', 'name', 'parents', 'children', 'related', 'synonyms', 'descriptions', 'distributions', 'images', 'references', 'species_profiles', 'vernacular_names', 'type_specimens', 'root'), several.ok=TRUE) # Define function to get data getdata <- function(x){ if (!x == 'all' && is.null(key)) { stop('You must specify a key if data does not equal "all"', call. = FALSE) } if (x == 'all' && is.null(key)) { url <- 'http://api.gbif.org/v1/species' } else { if (x == 'all' && !is.null(key)) { url <- sprintf('http://api.gbif.org/v1/species/%s', key) } else if (x %in% c('verbatim', 'name', 'parents', 'children', 'related', 'synonyms', 'descriptions', 'distributions', 'images', 'references', 'species_profiles', 'vernacular_names', 'type_specimens')) { url <- sprintf('http://api.gbif.org/v1/species/%s/%s', key, x) } else if (x == 'root') { url <- sprintf('http://api.gbif.org/v1/species/root/%s/%s', uuid, shortname) } } tt <- GET(url, query = args, ...) stop_for_status(tt) stopifnot(tt$headers$`content-type` == 'application/json') jsonlite::fromJSON(con_utf8(tt), FALSE) } # Get data if (length(data) == 1) { getdata(data) } else { lapply(data, getdata) } } taxize/R/itis_refs.R0000644000176200001440000000056112771125015014074 0ustar liggesusers#' Get references related to a ITIS TSN. #' #' @export #' @param tsn One or more TSN's (taxonomic serial number) for a taxonomic group (numeric) #' @param ... Further arguments passed on to getpublicationsfromtsn #' @examples \dontrun{ #' itis_refs(202385) #' itis_refs(c(202385, 70340)) #' } itis_refs <- function(tsn, ...) { lapply(tsn, ritis::publications, ...) } taxize/R/col_search.R0000644000176200001440000002035713042122270014204 0ustar liggesusers#' Search Catalogue of Life for taxonomic IDs #' #' @export #' @param name The string to search for. Only exact matches found the name given #' will be returned, unless one or wildcards are included in the search #' string. An * (asterisk) character denotes a wildcard; a % (percentage) #' character may also be used. The name must be at least 3 characters long, #' not counting wildcard characters. #' @param id The record ID of the specific record to return (only for scientific #' names of species or infraspecific taxa) #' @param start The first record to return. If omitted, the results are returned #' from the first record (start=0). This is useful if the total number of #' results is larger than the maximum number of results returned by a single #' Web service query (currently the maximum number of results returned by a #' single query is 500 for terse queries and 50 for full queries). #' @param checklist The year of the checklist to query, if you want a specific #' year's checklist instead of the lastest as default (numeric). #' @param response (character) one of "terse" or "full" #' @param ... Curl options passed on to \code{\link[httr]{GET}} #' @details You must provide one of name or id. The other parameters (format #' and start) are optional. #' @references \url{http://webservice.catalogueoflife.org/} #' @return A list of data.frame's. #' @examples \dontrun{ #' # A basic example #' col_search(name="Apis") #' col_search(name="Agapostemon") #' col_search(name="Poa") #' #' # Get full response, i.e., more data #' col_search(name="Apis", response="full") #' col_search(name="Poa", response="full") #' #' # Many names #' col_search(name=c("Apis","Puma concolor")) #' col_search(name=c("Apis","Puma concolor"), response = "full") #' #' # An example where there is no data #' col_search(id = "36c623ad9e3da39c2e978fa3576ad415") #' col_search(id = "36c623ad9e3da39c2e978fa3576ad415", response = "full") #' col_search(id = "787ce23969f5188c2467126d9a545be1") #' col_search(id = "787ce23969f5188c2467126d9a545be1", response = "full") #' col_search(id = c("36c623ad9e3da39c2e978fa3576ad415", "787ce23969f5188c2467126d9a545be1")) #' ## a synonym #' col_search(id = "f726bdaa5924cabf8581f99889de51fc") #' col_search(id = "f726bdaa5924cabf8581f99889de51fc", response = "full") #' } col_search <- function(name=NULL, id=NULL, start=NULL, checklist=NULL, response="terse", ...) { response <- match.arg(response, c("terse", "full")) func <- function(x, y, ...) { url <- make_url(checklist) args <- tc(list(name = x, id = y, start = start, response = response, format = "json")) temp <- GET(url, query = argsnull(args), ...) if (temp$status_code >= 300) { warning("COL taxon not found", call. = FALSE) } else { tt <- jsonlite::fromJSON(con_utf8(temp), FALSE) switch(response, terse = parse_terse(tt), full = parse_full(tt)) } } safe_func <- plyr::failwith(NULL, func) if (is.null(id)) { setNames(lapply(name, safe_func, y = NULL, ...), name) } else { setNames(lapply(id, safe_func, x = NULL, ...), id) } } make_url <- function(checklist) { if (is.null(checklist)) { col_base() } else { cc <- match.arg(as.character(checklist), choices = 2015:2007) sprintf("http://catalogueoflife.org/annual-checklist/%s/webservice", cc) } } col_base <- function() "http://www.catalogueoflife.org/col/webservice" parse_terse <- function(x) { nodes <- x$results ldply(nodes, parsecoldata) } parsecoldata <- function(x){ vals <- x[c('id', 'name', 'rank', 'name_status', 'source_database')] vals[sapply(vals, is.null)] <- NA names(vals) <- c('id', 'name', 'rank', 'name_status', 'source_database') bb <- data.frame(vals, stringsAsFactors = FALSE) names(bb)[4:5] <- c('status', 'source') bb$rank <- tolower(bb$rank) acc <- x$accepted_name if (is.null(acc)) { accdf <- data.frame(acc_id=NA, acc_name=NA, acc_rank=NA, acc_status=NA, acc_source=NA, stringsAsFactors = FALSE) } else { accdf <- data.frame(acc[c('id','name','rank','name_status','source_database')], stringsAsFactors=FALSE) names(accdf) <- c('acc_id','acc_name','acc_rank','acc_status','acc_source') accdf$acc_rank <- tolower(accdf$acc_rank) } cbind(bb, accdf) } parse_full <- function(x) { tmp <- Filter(length, x$results) taxize_ldfast( lapply(tmp, function(z) { switch(z$name_status, `accepted name` = { if (length(z$classification) == 0) { h <- parse_one(z) rank <- z$rank id <- z$id } else { h <- parse_one(z) h_vals <- pluck(z$classification, "name", "") h_nms <- pluck(z$classification, "rank", "") class <- setNames(rbind.data.frame(h_vals), tolower(h_nms)) h <- cbind(h, class) rank <- z$rank id <- z$id } }, `provisionally accepted name` = { if (length(z$classification) == 0) { h <- parse_one(z) rank <- z$rank id <- z$id } else { h <- parse_one(z) h_vals <- pluck(z$classification, "name", "") h_nms <- pluck(z$classification, "rank", "") class <- setNames(rbind.data.frame(h_vals), tolower(h_nms)) h <- cbind(h, class) rank <- z$rank id <- z$id } }, `common name` = { h_vals <- pluck(z$accepted_name$classification, "name", "") h_nms <- pluck(z$accepted_name$classification, "rank", "") h <- setNames(rbind.data.frame(h_vals), tolower(h_nms)) rank <- z$accepted_name$rank id <- z$accepted_name$id }, `synonym` = { h <- parse_one(z) name <- z$accepted_name$name rank <- z$accepted_name$rank id <- z$accepted_name$id name_status <- z$accepted_name$name_status h <- cbind(h, setNames(data.frame(id, name, rank, name_status, stringsAsFactors = FALSE), c('acc_id','acc_name','acc_rank','acc_status'))) }, `ambiguous synonym` = { h <- parse_one(z) name <- z$accepted_name$name rank <- z$accepted_name$rank id <- z$accepted_name$id name_status <- z$accepted_name$name_status h <- cbind(h, setNames(data.frame(id, name, rank, name_status, stringsAsFactors = FALSE), c('acc_id','acc_name','acc_rank','acc_status'))) }, `misapplied name` = { h <- parse_one(z) name <- z$accepted_name$name rank <- z$accepted_name$rank id <- z$accepted_name$id name_status <- z$accepted_name$name_status h <- cbind(h, setNames(data.frame(id, name, rank, name_status, stringsAsFactors = FALSE), c('acc_id','acc_name','acc_rank','acc_status'))) } ) target <- setNames(rbind.data.frame( c(z$name, rank, id, z$name_status)), c("name", "rank", "id", "name_status")) target$rank <- tolower(target$rank) tempdf <- cbind(target, h) tempdf[] <- lapply(tempdf, as.character) tempdf }) ) } parse_one <- function(z) { scrut <- z$record_scrutiny_date scrutie <- if (is.null(scrut[[1]]) || scrut[[1]] == FALSE) FALSE else TRUE if (scrutie) scrut <- data.frame(record_scrutiny_date = scrut$scrutiny, stringsAsFactors = FALSE) refs <- z$references refsie <- if (is.null(refs) || length(refs) == 0) FALSE else TRUE if (refsie) refs <- data.frame(tc(refs[[1]]), stringsAsFactors = FALSE) lst <- pop(z, c("distribution", "classification", "synonyms", "common_names", "record_scrutiny_date", "references", "accepted_name", "child_taxa", "name_html")) df <- data.frame(lst, stringsAsFactors = FALSE) if (is(scrut, "data.frame")) df <- cbind(df, scrut) if (is(refs, "data.frame")) df <- cbind(df, refs) df } taxize/R/ubio_synonyms.R0000644000176200001440000000045012672106003015013 0ustar liggesusers#' Search uBio for taxonomic synonyms by hierarchiesID. #' #' THIS FUNCTION IS DEFUNCT. #' #' @rdname ubio_synonyms-defunct #' @export #' @param ... Parameters, ignored ubio_synonyms <- function(...) { .Defunct(msg = "the uBio API is down, for good as far as we know, see `?taxize-defunct`") } taxize/R/iucn_id.R0000644000176200001440000000273413161014771013523 0ustar liggesusers#' Get an ID for a IUCN listed taxon #' #' @export #' @param sciname character; Scientific name. Should be cleand and in the #' format \emph{ }. One or more. #' @param key (character) required. you IUCN Redlist API key. See #' \code{\link[rredlist]{rredlist-package}} for help on authenticating with #' IUCN Redlist #' @param ... Curl options passed on to \code{crul::HttpClient} #' @return A named list (names are input taxa names) of one or more IUCN IDs. #' Taxa that aren't found are silently dropped. #' @author Scott Chamberlain, \email{myrmecocystus@@gmail.com} #' @examples \dontrun{ #' iucn_id("Branta canadensis") #' iucn_id("Branta bernicla") #' iucn_id("Panthera uncia") #' iucn_id("Lynx lynx") #' #' # many names #' iucn_id(c("Panthera uncia", "Lynx lynx")) #' #' # many names, some not found #' iucn_id(c("Panthera uncia", "Lynx lynx", "foo bar", "hello world")) #' #' # a name not found #' iucn_id("Foo bar") #' } iucn_id <- function(sciname, key = NULL, ...) { out <- list() for (i in seq_along(sciname)) { out[[i]] <- get_iucn_id(sciname[[i]], key = key, ...) } unlist(out) } get_iucn_id <- function(z, key = NULL, ...) { tmp <- rredlist::rl_search(z, key = key, ...) if (NROW(tmp$result) == 0) { NA } else if (NROW(tmp$result) > 1) { iduniq <- unique(tmp$result$taxonid) if (length(iduniq) == 1) { iduniq } else { stop("> 1 result found, alter your query", call. = FALSE) } } else { tmp$result$taxonid } } taxize/R/gni_parse.R0000644000176200001440000000345512672106003014055 0ustar liggesusers#' Parse scientific names using EOL's name parser. #' #' @param names A vector of length 1 or more of taxonomic names #' @param ... Curl options passed on to \code{\link[httr]{GET}} #' @return A data.frame with results, the submitted names, and the parsed names #' with additional information. #' @seealso \code{\link{gbif_parse}} #' @references \url{http://gni.globalnames.org/} #' @export #' @examples \dontrun{ #' gni_parse("Cyanistes caeruleus") #' gni_parse("Plantago minor") #' gni_parse("Plantago minor minor") #' gni_parse(c("Plantago minor minor","Helianthus annuus texanus")) #' #' # pass on curl options to httr #' library("httr") #' gni_parse("Cyanistes caeruleus", config = verbose()) #' } gni_parse <- function(names, ...) { names <- paste0(names, collapse = "|") tt <- GET(paste0(gni_base(), "parsers.json"), query = list(names = names), ...) stop_for_status(tt) out <- jsonlite::fromJSON(con_utf8(tt), FALSE) rbind.fill(lapply(out, gni_parser)) } gni_parser <- function(x) { positions_names <- vapply(x$scientificName$positions, function(y) paste("position_", y[[1]], sep = ""), "", USE.NAMES = FALSE) nums <- vapply(x$scientificName$positions, function(y) y[[2]], 1, USE.NAMES = FALSE) pv <- data.frame(as.list(setNames(nums, positions_names)), stringsAsFactors = FALSE) singles <- data.frame(x$scientificName[c("verbatim","canonical","normalized","hybrid","parsed")], stringsAsFactors = FALSE) details_ <- x$scientificName$details[[1]] details_ <- details_[!names(details_) %in% 'status'] details <- rbind.fill(Map(function(x, y) data.frame(y, x, stringsAsFactors = FALSE), details_, names(details_)))[,-3] details2 <- as.data.frame(t(data.frame(details[,2]))) names(details2) <- details[,1] row.names(details2) <- NULL data.frame(details2, singles, pv, stringsAsFactors = FALSE) } taxize/R/get_ubioid.R0000644000176200001440000002337412735302306014226 0ustar liggesusers#' Get the uBio id for a search term #' #' THIS FUNCTION IS DEFUNCT. #' #' @rdname get_ubioid-defunct #' @export #' @param searchterm character; A vector of common or scientific names. #' @param searchtype character; One of 'scientific' or 'common', or any unique abbreviation #' @param ask logical; should get_tsn be run in interactive mode? #' If TRUE and more than one TSN is found for teh species, the user is asked for #' input. If FALSE NA is returned for multiple matches. #' @param verbose logical; should progress be printed? #' @param rows numeric; Any number from 1 to infinity. If the default NA, all rows are considered. #' Note that this function still only gives back a ubioid class object with one to many identifiers. #' See \code{\link[taxize]{get_ubioid_}} to get back all, or a subset, of the raw data that you are #' presented during the ask process. #' @param family (character) A family name. Optional. See \code{Filtering} below. #' @param rank (character) A taxonomic rank name. See \code{\link{rank_ref}} for possible #' options. Though note that some data sources use atypical ranks, so inspect the #' data itself for options. Optional. See \code{Filtering} below. #' @param x Input to \code{\link{as.ubioid}} #' @param ... Ignored #' @param check logical; Check if ID matches any existing on the DB, only used in #' \code{\link{as.ubioid}} #' #' @return A vector of uBio ids. If a taxon is not found NA is given. If more than one uBio #' id is found the function asks for user input (if ask = TRUE), otherwise returns NA. #' Comes with an attribute \emph{match} to investigate the reason for NA (either 'not found', #' 'found' or if ask = FALSE 'NA due to ask=FALSE') #' #' @section Filtering: #' The parameters \code{family} and \code{rank} are not used in the search to the data #' provider, but are used in filtering the data down to a subset that is closer to the #' target you want. For all these parameters, #' you can use regex strings since we use \code{\link{grep}} internally to match. #' Filtering narrows down to the set that matches your query, and removes the rest. #' #' @seealso \code{\link[taxize]{get_uid}}, \code{\link[taxize]{ubio_search}} get_ubioid <- function(searchterm, searchtype = "scientific", ask = TRUE, verbose = TRUE, rows = NA, family = NULL, rank = NULL, ...) { .Defunct(msg = "the uBio API is down, for good as far as we know") fun <- function(x, searchtype, ask, verbose, rows, ...) { mssg(verbose, "\nRetrieving data for taxon '", x, "'\n") searchtype <- match.arg(searchtype, c("scientific","common")) if (searchtype == 'scientific') { sci <- 1; vern <- 0 } else { sci <- 0; vern <- 1; searchtype = 'vernacular' } ubio_df <- tryCatch(ubio_search(searchName = x, sci = sci, vern = vern, ...)[[searchtype]], error = function(e) e) ubio_df <- sub_rows(ubio_df, rows) if (is(ubio_df, "simpleError")) { ubioid <- NA att <- "not found" } else { ubio_df <- switch(searchtype, scientific = ubio_df[,c("namebankid","namestring","packagename","rankname")], vernacular = ubio_df[,c("namebankid","namestring","packagename")]) if (searchtype == "scientific") { ubio_df <- rename(ubio_df, c('packagename' = 'family', 'rankname' = 'rank', 'namebankid' = 'ubioid')) } else { ubio_df <- rename(ubio_df, c('packagename' = 'family', 'namebankid' = 'ubioid')) } if (searchtype == "scientific") ubio_df <- fix_ranks(ubio_df) direct <- NA # should return NA if spec not found if (nrow(ubio_df) == 0) { mssg(verbose, "Not found. Consider checking the spelling or alternate classification") ubioid <- NA att <- 'not found' } # take the one ubio id from data.frame if (nrow(ubio_df) == 1) { ubioid <- ubio_df$ubioid att <- 'found' } # check for direct match if (nrow(ubio_df) > 1) { names(ubio_df)[grep('namestring', names(ubio_df))] <- "target" direct <- match(tolower(ubio_df$target), tolower(x)) if (length(na.omit(direct)) == 1) { if (!all(is.na(direct))) { ubioid <- ubio_df$ubioid[!is.na(direct)] att <- 'found' } else { ubioid <- NA direct <- NA att <- 'not found' } } else { ubioid <- ubio_df$ubioid att <- 'found' } } # multiple matches if (any( nrow(ubio_df) > 1 & is.na(ubioid) | nrow(ubio_df) > 1 & att == "found" & length(ubioid) > 1 )) { if (ask) { names(ubio_df)[names(ubio_df) %in% "namestring"] <- "target" # user prompt ubio_df <- ubio_df[order(ubio_df$target), ] id <- ubio_df$ubioid if (!is.null(family) || !is.null(rank)) { ubio_df <- filt(ubio_df, "family", family) if (searchtype == "scientific") ubio_df <- filt(ubio_df, "rank", rank) if (NROW(ubio_df) > 1) rownames(ubio_df) <- 1:nrow(ubio_df) ubioid <- id <- ubio_df$ubioid if (length(id) == 1) { att <- "found" } } if (length(id) > 1) { # prompt message("\n\n") rownames(ubio_df) <- 1:nrow(ubio_df) print(ubio_df) message("\nMore than one uBio ID found for taxon '", x, "'!\n Enter rownumber of taxon (other inputs will return 'NA'):\n") # prompt take <- scan(n = 1, quiet = TRUE, what = 'raw') if (length(take) == 0) { take <- 'notake' att <- 'nothing chosen' } if (take %in% seq_len(nrow(ubio_df))) { take <- as.numeric(take) message("Input accepted, took taxon '", as.character(ubio_df$target[take]), "'.\n") ubioid <- ubio_df$ubioid[take] att <- 'found' } else { ubioid <- NA mssg(verbose, "\nReturned 'NA'!\n\n") att <- 'not found' } } } else { ubioid <- NA att <- 'NA due to ask=FALSE' } } } return(data.frame(ubioid = as.character(ubioid), att = att, stringsAsFactors=FALSE)) } searchterm <- as.character(searchterm) outd <- ldply(searchterm, fun, searchtype, ask, verbose, rows, ...) out <- structure(outd$ubioid, class="ubioid", match=outd$att) add_uri(out, 'http://www.ubio.org/browser/details.php?namebankID=%s') } #' @export #' @rdname get_ubioid-defunct as.ubioid <- function(x, check=TRUE) UseMethod("as.ubioid") #' @export #' @rdname get_ubioid-defunct as.ubioid.ubioid <- function(x, check=TRUE) { .Defunct(msg = "the uBio API is down, for good as far as we know") x } #' @export #' @rdname get_ubioid-defunct as.ubioid.character <- function(x, check=TRUE) { .Defunct(msg = "the uBio API is down, for good as far as we know") if(length(x) == 1) make_ubioid(x, check) else collapse(x, make_ubioid, "ubioid", check=check) } #' @export #' @rdname get_ubioid-defunct as.ubioid.list <- function(x, check=TRUE) { .Defunct(msg = "the uBio API is down, for good as far as we know") if(length(x) == 1) make_ubioid(x, check) else collapse(x, make_ubioid, "ubioid", check=check) } #' @export #' @rdname get_ubioid-defunct as.ubioid.numeric <- function(x, check=TRUE) { .Defunct(msg = "the uBio API is down, for good as far as we know") as.ubioid(as.character(x), check) } #' @export #' @rdname get_ubioid-defunct as.ubioid.data.frame <- function(x, check=TRUE) { .Defunct(msg = "the uBio API is down, for good as far as we know") structure(x$ids, class="ubioid", match=x$match, uri=x$uri) } #' @export #' @rdname get_ubioid-defunct as.data.frame.ubioid <- function(x, ...){ .Defunct(msg = "the uBio API is down, for good as far as we know") data.frame(ids = as.character(unclass(x)), class = "ubioid", match = attr(x, "match"), uri = attr(x, "uri"), stringsAsFactors = FALSE) } make_ubioid <- function(x, check=TRUE) make_generic(x, 'http://www.ubio.org/browser/details.php?namebankID=%s', "ubioid", check) check_ubioid <- function(x){ res <- ubio_id(x) is(res$data, "data.frame") } #' @export #' @rdname get_ubioid-defunct get_ubioid_ <- function(searchterm, verbose = TRUE, searchtype = "scientific", rows = NA){ .Defunct(msg = "the uBio API is down, for good as far as we know") setNames(lapply(searchterm, get_ubioid_help, verbose = verbose, searchtype=searchtype, rows=rows), searchterm) } get_ubioid_help <- function(searchterm, verbose, searchtype, rows){ mssg(verbose, "\nRetrieving data for taxon '", searchterm, "'\n") searchtype <- match.arg(searchtype, c("scientific","common")) if(searchtype=='scientific'){ sci <- 1; vern <- 0 } else { sci <- 0; vern <- 1; searchtype='vernacular' } ubio_df <- tryCatch(ubio_search(searchName = searchterm, sci = sci, vern = vern)[[searchtype]], error=function(e) e) if(is(ubio_df, "simpleError")){ NULL } else { ubio_df <- switch(searchtype, scientific=ubio_df[,c("namebankid","namestring","packagename","rankname")], vernacular=ubio_df[,c("namebankid","namestring","packagename")]) ubio_df <- rename(ubio_df, c('packagename' = 'family')) sub_rows(ubio_df, rows) } } fix_ranks <- function(x) { rr <- x$rank # repl <- c('SP','genus','species','gen','trinomial','sub-species','var','subspecies','ssp.','subsp') rr <- gsub("^SP$", "species", rr) rr <- gsub("^gen$", "genus", rr) rr <- gsub("^subsp$", "subspecies", rr) rr <- gsub("^sub-species$", "subspecies", rr) rr <- gsub("^ssp\\.$", "subspecies", rr) x$rank <- rr x } taxize/R/nbn_search.R0000644000176200001440000000360113067671301014210 0ustar liggesusers#' Search UK National Biodiversity Network #' #' @export #' @param q (character) The query terms(s) #' @param fq (character) Filters to be applied to the original query. These #' are additional params of the form fq=INDEXEDFIELD:VALUE e.g. #' fq=rank:kingdom. See for all #' the fields that are queryable. #' @param rows (integer) Number of records to return #' @param start (integer) Record offset, to enable paging #' @param sort (character) The indexed field to sort by #' @param order (character) Supports "asc" or "desc" #' @param facets (list) Comma separated list of the fields to create facets #' on e.g. facets=basis_of_record. #' @param ... Further args passed on to \code{\link[httr]{GET}}. #' @family nbn #' @return a list with slots for metadata (`meta`) with list of response #' attributes, and data (`data``) with a data.frame of results #' @author Scott Chamberlain, \email{myrmecocystus@@gmail.com} #' @references #' #' @examples \dontrun{ #' x <- nbn_search(q = "Vulpes") #' x$meta$totalRecords #' x$meta$pageSize #' x$meta$urlParameters #' x$meta$queryTitle #' head(x$data) #' #' nbn_search(q = "blackbird", start = 4) #' #' # debug curl stuff #' library('httr') #' nbn_search(q = "blackbird", config = verbose()) #' } nbn_search <- function(q, fq = NULL, order = NULL, sort = NULL, start = 0, rows = 25, facets = NULL, ...) { args <- tc(list( q = q, fq = fq, pageSize = rows, startIndex = start, sort = sort, dir = order, facets = facets )) nbn_GET(file.path(nbn_base(), "search"), args, ...) } nbn_GET <- function(url, args, ...){ res <- GET(url, query = argsnull(args), ...) stop_for_status(res) tt <- con_utf8(res) json <- jsonlite::fromJSON(tt)$searchResults list(meta = pop(json, "results"), data = json$results) } nbn_base <- function() "https://species-ws.nbnatlas.org" taxize/R/itis_getrecord.R0000644000176200001440000000167113125014533015112 0ustar liggesusers#' Get full ITIS record for one or more ITIS TSN's or lsid's. #' #' @export #' @param values (character) One or more TSN's (taxonomic serial number) or lsid's for a #' taxonomic group #' @param by (character) By "tsn" (default) or "lsid" #' @param ... Further arguments passed on to \code{\link[ritis]{full_record}} #' @details You can only enter values in tsn parameter or lsid, not both. #' @examples \dontrun{ #' # by TSN #' itis_getrecord(202385) #' itis_getrecord(c(202385,70340)) #' #' # by lsid #' itis_getrecord("urn:lsid:itis.gov:itis_tsn:202385", "lsid") #' } itis_getrecord <- function(values, by="tsn", ...) { if (!by %in% c("tsn","lsid")) stop("by must be one of 'tsn' or 'lsid'", call. = FALSE) temp <- switch( by, tsn = lapply(values, ritis::full_record, ...), lsid = lapply(values, function(x) ritis::full_record(lsid = x, ...)) ) if (length(values) == 1) { temp[[1]] } else { setNames(temp, values) } } taxize/R/apg_lookup.R0000644000176200001440000000330612672032225014245 0ustar liggesusers#' Lookup in the APGIII taxonomy and replace family names #' #' @export #' @param taxa (character) Taxonomic name to lookup a synonym for in APGIII taxonomy. #' @param rank (character) Taxonomic rank to lookup a synonym for. One of family or order. #' @return A APGIII family or order name, or the original name if no match. #' @details Internally in this function, we use the datasets \code{\link{apg_families}} #' and \code{\link{apg_orders}} - see their descriptions for the data in them. #' The functions \code{\link{apgOrders}} \code{\link{apgFamilies}} are for scraping #' current content from the \url{http://www.mobot.org/MOBOT/research/APweb/} website. #' #' BEWARE: The datasets used in this function are (I think) from Version 12 of the data #' on \url{http://www.mobot.org/MOBOT/research/APweb/} - I'll update data asap. #' @examples #' # New name found #' apg_lookup(taxa = "Hyacinthaceae", rank = "family") #' apg_lookup(taxa = "Poaceae", rank = "family") #' #' # Name not found #' apg_lookup(taxa = "Asteraceae", rank = "family") apg_lookup <- function(taxa, rank = "family") { if (!rank %in% c('family', 'order')) { stop("rank must be one of family or order") } if (rank == "family") { temp <- as.character(apg_families[apg_families$this %in% taxa, "that"]) if (nchar(temp) == 0) { message("no match found...") out <- taxa } else { message("new name...") out <- temp } } else { if (rank == "order") { temp <- as.character(apg_orders[apg_orders$this %in% taxa, "that"]) if (nchar(temp) == 0) { message("no match found...") out <- taxa } else { message("new name...") out <- temp } } } return(out) } taxize/R/gni_helpers.R0000644000176200001440000000020612672106003014374 0ustar liggesuserschecknull <- function(x) { if (is.null(x)) { "none" } else{ x } } gni_base <- function() "http://gni.globalnames.org/" taxize/R/get_ids.R0000644000176200001440000001161613037517445013536 0ustar liggesusers#' Retrieve taxonomic identifiers for a given taxon name. #' #' This is a convenience function to get identifiers across all data sources. You can #' use other \code{get_*} functions to get identifiers from specific sources if #' you like. #' #' @export #' @param names character; Taxonomic name to query. #' @param db character; database to query. One or more of \code{ncbi}, \code{itis}, #' \code{eol}, \code{col}, \code{tropicos}, \code{gbif}, or \code{nbn}. By #' default db is set to search all data sources. Note that each taxonomic data #' source has their own identifiers, so that if you vide the wrong \code{db} value #' for the identifier you could get a result, it will likely be wrong (not what #' you were expecting). #' @param rows numeric; Any number from 1 to infinity. If the default NA, all rows are returned. #' When used in \code{get_ids} this function still only gives back a ids class object with one to #' many identifiers. See \code{get_ids_} to get back all, or a subset, of the raw data that you are #' presented during the ask process. #' @param ... Other arguments passed to \code{\link[taxize]{get_tsn}}, #' \code{\link[taxize]{get_uid}}, \code{\link[taxize]{get_eolid}}, #' \code{\link[taxize]{get_colid}}, \code{\link[taxize]{get_tpsid}}, #' \code{\link[taxize]{get_gbifid}}, \code{\link[taxize]{get_nbnid}}. #' @return A vector of taxonomic identifiers, each retaining their respective S3 #' classes so that each element can be passed on to another function (see e.g.'s). #' @note There is a timeout of 1/3 seconds between queries to NCBI. #' #' @family taxonomic-ids #' @seealso \code{\link[taxize]{classification}} #' #' @examples \dontrun{ #' # Plug in taxon names directly #' ## By default you get ids for all data sources #' get_ids(names="Chironomus riparius") #' #' # specify rows to limit choices available #' get_ids(names="Poa annua", db=c("col","eol"), rows=1) #' get_ids(names="Poa annua", db=c("col","eol"), rows=1:2) #' #' ## Or you can specify which source you want via the db parameter #' get_ids(names="Chironomus riparius", db = 'ncbi') #' #' get_ids(names="Salvelinus fontinalis", db = 'nbn') #' #' get_ids(names=c("Chironomus riparius", "Pinus contorta"), db = 'ncbi') #' get_ids(names=c("Chironomus riparius", "Pinus contorta"), db = c('ncbi','itis')) #' get_ids(names=c("Chironomus riparius", "Pinus contorta"), db = c('ncbi','itis','col')) #' get_ids(names="Pinus contorta", db = c('ncbi','itis','col','eol','tropicos')) #' get_ids(names="ava avvva", db = c('ncbi','itis','col','eol','tropicos')) #' get_ids(names="ava avvva", db = c('ncbi','itis','col','eol','tropicos'), verbose=FALSE) #' #' # Pass on to other functions #' out <- get_ids(names="Pinus contorta", db = c('ncbi','itis','col','eol','tropicos')) #' classification(out$itis) #' synonyms(out$tropicos) #' #' # Get all data back #' get_ids_(c("Chironomus riparius", "Pinus contorta"), db = 'nbn', rows=1:10) #' get_ids_(c("Chironomus riparius", "Pinus contorta"), db = c('nbn','gbif'), rows=1:10) #' #' # use curl options #' library("httr") #' get_ids("Agapostemon", db = "ncbi", config=verbose()) #' bb <- get_ids("Pinus contorta", db = c('nbn','gbif'), config=progress()) #' } get_ids <- function(names, db = c('itis','ncbi','eol','col','tropicos','gbif','nbn'), ...) { if (is.null(db)) { stop("Must specify on or more values for db!") } db <- match.arg(db, choices = c('itis','ncbi','eol','col','tropicos','gbif','nbn'), several.ok = TRUE) foo <- function(x, names, ...){ ids <- switch(x, itis = get_tsn(names, ...), ncbi = get_uid(names, ...), eol = get_eolid(names, ...), col = get_colid(names, ...), tropicos = get_tpsid(names, ...), gbif = get_gbifid(names, ...), nbn = get_nbnid(names, ...)) names(ids) <- names return( ids ) } tmp <- lapply(db, function(x) foo(x, names=names, ...)) names(tmp) <- db class(tmp) <- "ids" return( tmp ) } #' @export #' @rdname get_ids get_ids_ <- function(names, db = c('itis','ncbi','eol','col','tropicos','gbif','nbn'), rows=NA, ...) { if(is.null(db)) stop("Must specify on or more values for db!") db <- match.arg(db, choices = c('itis','ncbi','eol','col','tropicos','gbif','nbn'), several.ok = TRUE) foo <- function(x, names, rows, ...){ ids <- switch(x, itis = get_tsn_(names, rows=rows, ...), ncbi = get_uid_(names, rows=rows, ...), eol = get_eolid_(names, rows=rows, ...), col = get_colid_(names, rows=rows, ...), tropicos = get_tpsid_(names, rows=rows, ...), gbif = get_gbifid_(names, rows=rows, ...), nbn = get_nbnid_(names, rows=rows, ...)) setNames(ids, names) } structure(setNames(lapply(db, function(x) foo(x, names=names, rows=rows, ...)), db), class="ids") } taxize/R/gnr_datasources.R0000644000176200001440000000205412672106003015263 0ustar liggesusers#' Get data sources for the Global Names Resolver. #' #' Retrieve data sources used in Global Names Index, see #' \url{http://gni.globalnames.org/} for information. #' #' @param todf logical; Should a data.frame be returned? #' @author Scott Chamberlain {myrmecocystus@@gmail.com} #' @return json or a data.frame #' @seealso \code{\link[taxize]{gnr_resolve}} #' @keywords resolve names taxonomy #' @export #' @examples \dontrun{ #' # all data sources #' gnr_datasources() #' #' # give me the id for EOL #' out <- gnr_datasources() #' out[out$title == "EOL", "id"] #' #' # Fuzzy search for sources with the word zoo #' out <- gnr_datasources() #' out[agrep("zoo", out$title, ignore.case = TRUE), ] #' #' # Output as a list #' gnr_datasources(FALSE) #' } gnr_datasources <- function(todf = TRUE) { url <- "http://resolver.globalnames.org/data_sources.json" if (todf == FALSE) { out <- jsonlite::fromJSON(url, FALSE) } else { out <- ldply(jsonlite::fromJSON(url, FALSE), function(x) data.frame(x["id"], x["title"], stringsAsFactors = FALSE)) } return(out) } taxize/R/class2tree.R0000644000176200001440000001276413057577770014205 0ustar liggesusers#' Convert list of classifications to a tree. #' #' This function converts a list of hierarchies for individual species into #' a single species by taxonomic level matrix, then calculates a distance #' matrix based on taxonomy alone, and outputs either a phylo or dist object. #' See details for more information. #' #' @export #' @param input List of classification data.frame's from the function #' \code{\link{classification}} #' @param varstep Vary step lengths between successive levels relative to #' proportional loss of the number of distinct classes. #' @param check If TRUE, remove all redundant levels which are different for #' all rows or constant for all rows and regard each row as a different basal #' taxon (species). If FALSE all levels are retained and basal taxa (species) #' also must be coded as variables (columns). You will get a warning if #' species are not coded, but you can ignore this if that was your intention. #' @param ... Further arguments passed on to hclust. #' @param x Input object to print or plot - output from class2tree function. #' @return An object of class "classtree" with slots: #' \itemize{ #' \item phylo - The resulting object, a phylo object #' \item classification - The classification data.frame, with taxa as rows, #' and different classification levels as columns #' \item distmat - Distance matrix #' \item names - The names of the tips of the phylogeny #' } #' #' Note that when you execute the resulting object, you only get the phylo #' object. You can get to the other 3 slots by calling them directly, like #' output$names, etc. #' @details See \code{\link[vegan]{taxa2dist}}. Thanks to Jari Oksanen for #' making the taxa2dist function and pointing it out, and Clarke & Warwick #' (1998, 2001), which taxa2dist was based on. #' @examples \dontrun{ #' spnames <- c('Quercus robur', 'Iris oratoria', 'Arachis paraguariensis', #' 'Helianthus annuus','Madia elegans','Lupinus albicaulis', #' 'Pinus lambertiana') #' out <- classification(spnames, db='itis') #' tr <- class2tree(out) #' plot(tr) #' #' spnames <- c('Klattia flava', 'Trollius sibiricus', 'Arachis paraguariensis', #' 'Tanacetum boreale', 'Gentiana yakushimensis','Sesamum schinzianum', #' 'Pilea verrucosa','Tibouchina striphnocalyx','Lycium dasystemum', #' 'Berkheya echinacea','Androcymbium villosum', #' 'Helianthus annuus','Madia elegans','Lupinus albicaulis', #' 'Pinus lambertiana') #' out <- classification(spnames, db='ncbi') #' tr <- class2tree(out) #' plot(tr) #' } class2tree <- function(input, varstep = TRUE, check = TRUE, ...) { if (any(is.na(input))) { message('Removed species without classification.') input <- input[!is.na(input)] } # Check that there is more than 2 taxon if (length(input) < 3) stop("Your input list of classifications must be 3 or longer.") dat <- rbind.fill(lapply(input, class2tree_helper)) df <- dat[ , !apply(dat, 2, function(x) any(is.na(x))) ] if (!inherits(df, "data.frame")) { stop("no taxon ranks in common - try different inputs") } row.names(df) <- df[,1] df <- df[,-1] taxdis <- tryCatch(taxa2dist(df, varstep = varstep, check = check), error = function(e) e) # check for incorrect dimensions error if (is(taxdis, 'simpleError')) stop("Try check=FALSE, but see docs for taxa2dist function in the vegan package for details.") out <- as.phylo.hclust(hclust(taxdis, ...)) res <- list(phylo = out, classification = dat, distmat = taxdis, names = names(input)) class(res) <- 'classtree' return( res ) } class2tree_helper <- function(x){ x <- x[!x$rank == "no rank", ] df <- x[-nrow(x), 'name'] names(df) <- x[-nrow(x), 'rank'] df <- data.frame(t(data.frame(df)), stringsAsFactors = FALSE) data.frame(tip = x[nrow(x), "name"], df, stringsAsFactors = FALSE) } #' @method plot classtree #' @export #' @rdname class2tree plot.classtree <- function(x, ...) { if (!is(x$phylo, "phylo")) stop("Input object must have a slot in 'phylo' of class 'phylo'") plot(x$phylo, ...) } #' @method print classtree #' @export #' @rdname class2tree print.classtree <- function(x, ...) { if (!is(x$phylo, "phylo")) stop("Input object must have a slot in 'phylo' of class 'phylo'") print(x$phylo) } # Function from the vegan package # CRAN: http://cran.rstudio.com/web/packages/vegan/ # License: GPL-2 # Maintainer: Jari Oksanen taxa2dist <- function(x, varstep = FALSE, check = TRUE, labels) { rich <- apply(x, 2, function(taxa) length(unique(taxa))) S <- nrow(x) if (check) { keep <- rich < S & rich > 1 rich <- rich[keep] x <- x[, keep] } i <- rev(order(rich)) x <- x[, i] rich <- rich[i] if (varstep) { add <- -diff(c(nrow(x), rich, 1)) add <- add/c(S, rich) add <- add/sum(add) * 100 } else { add <- rep(100/(ncol(x) + check), ncol(x) + check) } if (!is.null(names(add))) names(add) <- c("Base", names(add)[-length(add)]) if (!check) add <- c(0, add) out <- matrix(add[1], nrow(x), nrow(x)) for (i in 1:ncol(x)) { out <- out + add[i + 1] * outer(x[, i], x[, i], "!=") } out <- as.dist(out) attr(out, "method") <- "taxa2dist" attr(out, "steps") <- add if (missing(labels)) { attr(out, "Labels") <- rownames(x) } else { if (length(labels) != nrow(x)) warning("Labels are wrong: needed ", nrow(x), " got ", length(labels)) attr(out, "Labels") <- as.character(labels) } if (!check && any(out <= 0)) warning("you used 'check=FALSE' and some distances are zero -- was this intended?") out } taxize/R/nbn_classification.R0000644000176200001440000000162513125220166015734 0ustar liggesusers#' Search UK National Biodiversity Network database for #' taxonomic classification #' #' @export #' @param id (character) An NBN identifier. #' @param ... Further args passed on to \code{\link[httr]{GET}}. #' @return A data.frame #' @family nbn #' @author Scott Chamberlain, \email{myrmecocystus@@gmail.com} #' @references #' @examples \dontrun{ #' nbn_classification(id="NHMSYS0000376773") #' #' # get id first, then pass to this fxn #' id <- get_nbnid("Zootoca vivipara", rec_only = TRUE, rank = "Species") #' nbn_classification(id) #' #' library('httr') #' nbn_classification(id="NHMSYS0000502940", config=verbose()) #' } nbn_classification <- function(id, ...) { url <- file.path(nbn_base(), "classification", id) nbn_GET_2(url, ...) } nbn_GET_2 <- function(url, ...) { res <- GET(url, ...) stop_for_status(res) tt <- con_utf8(res) nmslwr(jsonlite::fromJSON(tt, TRUE)) } taxize/R/children.R0000644000176200001440000001373013160563531013701 0ustar liggesusers#' Retrieve immediate children taxa for a given taxon name or ID. #' #' This function is different from \code{\link{downstream}} in that it only #' collects immediate taxonomic children, while \code{\link{downstream}} #' collects taxonomic names down to a specified taxonomic rank, e.g., #' getting all species in a family. #' #' @export #' @param x Vector of taxa names (character) or IDs (character or numeric) #' to query. #' @param db character; database to query. One or more of \code{itis}, #' \code{col}, \code{ncbi}, or \code{worms}. Note that each taxonomic data #' source has their own identifiers, so that if you provide the wrong #' \code{db} value for the identifier you could get a result, but it will #' likely be wrong (not what you were expecting). #' @param rows (numeric) Any number from 1 to infinity. If the default NA, all #' rows are considered. Note that this parameter is ignored if you pass in a #' taxonomic id of any of the acceptable classes: tsn, colid. NCBI has a #' method for this function but rows doesn't work. #' @param ... Further args passed on to \code{\link{col_children}}, #' \code{\link[ritis]{hierarchy_down}}, \code{\link{ncbi_children}}, #' or \code{\link[worrms]{wm_children}} #' See those functions for what parameters can be passed on. #' #' @return A named list of data.frames with the children names of every #' supplied taxa. You get an NA if there was no match in the database. #' #' @examples \dontrun{ #' # Plug in taxonomic IDs #' children(161994, db = "itis") #' children(8028, db = "ncbi") #' children("578cbfd2674a9b589f19af71a33b89b6", db = "col") #' ## works with numeric if as character as well #' children("161994", db = "itis") #' #' # Plug in taxon names #' children("Salmo", db = 'col') #' children("Salmo", db = 'itis') #' children("Salmo", db = 'ncbi') #' children("Salmo", db = 'worms') #' #' # Plug in IDs #' (id <- get_colid("Apis")) #' children(id) #' #' (id <- get_wormsid("Platanista")) #' children(id) #' #' ## Equivalently, plug in the call to get the id via e.g., get_colid #' ## into children #' (id <- get_colid("Apis")) #' children(id) #' children(get_colid("Apis")) #' #' # Many taxa #' sp <- c("Tragia", "Schistocarpha", "Encalypta") #' children(sp, db = 'col') #' children(sp, db = 'itis') #' #' # Two data sources #' (ids <- get_ids("Apis", db = c('col','itis'))) #' children(ids) #' ## same result #' children(get_ids("Apis", db = c('col','itis'))) #' #' # Use the rows parameter #' children("Poa", db = 'col') #' children("Poa", db = 'col', rows=1) #' #' # use curl options #' library("httr") #' res <- children("Poa", db = 'col', rows=1, config=verbose()) #' } children <- function(...){ UseMethod("children") } #' @export #' @rdname children children.default <- function(x, db = NULL, rows = NA, ...) { nstop(db) switch( db, itis = { id <- process_children_ids(x, db, get_tsn, rows = rows, ...) stats::setNames(children(id, ...), x) }, col = { id <- process_children_ids(x, db, get_colid, rows = rows, ...) stats::setNames(children(id, ...), x) }, ncbi = { if (all(grepl("^[[:digit:]]*$", x))) { id <- x class(id) <- "uid" stats::setNames(children(id, ...), x) } else { out <- ncbi_children(name = x, ...) structure(out, class = 'children', db = 'ncbi', .Names = x) } }, worms = { id <- process_children_ids(x, db, get_wormsid, rows = rows, ...) stats::setNames(children(id, ...), x) }, stop("the provided db value was not recognised", call. = FALSE) ) } process_children_ids <- function(input, db, fxn, ...){ g <- tryCatch(as.numeric(as.character(input)), warning = function(e) e) if (is(g, "numeric") || is.character(input) && grepl("[[:digit:]]", input)) { as_fxn <- switch(db, itis = as.tsn, col = as.colid) as_fxn(input, check = FALSE) } else { eval(fxn)(input, ...) } } #' @export #' @rdname children children.tsn <- function(x, db = NULL, ...) { fun <- function(y){ # return NA if NA is supplied if (is.na(y)) { out <- NA } else { out <- ritis::hierarchy_down(y, ...) } } out <- lapply(x, fun) names(out) <- x class(out) <- 'children' attr(out, 'db') <- 'itis' return(out) } #' @export #' @rdname children children.colid <- function(x, db = NULL, ...) { fun <- function(y){ # return NA if NA is supplied if (is.na(y)) { out <- NA } else { out <- col_children(id = y, ...) } return(out) } out <- lapply(x, fun) if (length(out) == 1) { out = out[[1]] } class(out) <- 'children' attr(out, 'db') <- 'col' return(out) } df2dt2tbl <- function(x) { tibble::as_tibble( data.table::setDF( data.table::rbindlist( x, use.names = TRUE, fill = TRUE) ) ) } #' @export #' @rdname children children.wormsid <- function(x, db = NULL, ...) { fun <- function(y){ # return NA if NA is supplied if (is.na(y)) { out <- NA } else { out <- worrms::wm_children(as.numeric(y)) out <- list(out) i <- 1 while (NROW(out[[length(out)]]) == 50) { i <- i + 1 out[[i]] <- worrms::wm_children( as.numeric(y), offset = sum(unlist(sapply(out, NROW)))) } out <- df2dt2tbl(out) stats::setNames( out[names(out) %in% c('AphiaID', 'scientificname', 'rank')], c('childtaxa_id', 'childtaxa_name', 'childtaxa_rank') ) } } out <- lapply(x, fun) names(out) <- x class(out) <- 'children' attr(out, 'db') <- 'worms' return(out) } #' @export #' @rdname children children.ids <- function(x, db = NULL, ...) { fun <- function(y, ...){ # return NA if NA is supplied if (is.na(y)) { out <- NA } else { out <- children(y, ...) } return(out) } out <- lapply(x, fun) class(out) <- 'children_ids' return(out) } #' @export #' @rdname children children.uid <- function(x, db = NULL, ...) { out <- ncbi_children(id = x, ...) class(out) <- 'children' attr(out, 'db') <- 'ncbi' return(out) } taxize/R/phylomatic_tree.R0000644000176200001440000000041212672106003015264 0ustar liggesusers#' Query Phylomatic for a phylogenetic tree. #' #' THIS FUNCTION IS DEFUNCT. #' #' @export #' @rdname phylomatic_tree-defunct #' @param ... Parameters, ignored phylomatic_tree <- function(...) { .Defunct(msg = "This function is defunct - See ?`taxize-defunct`") } taxize/R/tnrs.R0000644000176200001440000001731013125002146013064 0ustar liggesusers#' @title Phylotastic Taxonomic Name Resolution Service. #' #' @description Match taxonomic names using the Taxonomic Name Resolution #' Service (TNRS). Returns score of the matched name, and whether it was #' accepted or not. #' #' @export #' @param query Vector of quoted taxonomic names to search (character). #' @param source Specify the source you want to match names against. Defaults #' to just retrieve data from all sources. Options: NCBI, iPlant_TNRS, #' or MSW3. Only available when using getpost="POST". #' @param code Nomenclatural code. One of: ICZN (zoological), ICN (algae, fungi, #' and plants), ICNB (bacteria), ICBN (botanical), ICNCP (cultivated plants), #' ICTV (viruses). Only available when using getpost="POST". #' @param getpost Use GET or POST method to send the query. If you have more #' than say 50 species or so in your query, you should probably use POST. #' IMPORTANT!!!!! -> #' POST is the only option for this parameter if you want to #' use source or code parameters. #' @param sleep Number of seconds by which to pause between calls. Defaults to 0 #' seconds. Use when doing many calls in a for loop ar lapply type call. #' @param splitby Number by which to split species list for querying the TNRS. #' @param verbose Verbosity or not (default \code{TRUE}) #' @param ... Curl options to pass in \code{\link[httr]{GET}} or #' \code{\link[httr]{POST}} #' #' @return data.frame of results from TNRS plus the name submitted, with #' rows in order of user supplied names, though those with no matches are #' dropped #' @details If there is no match in the Taxosaurus database, nothing is #' returned, so you will not get anything back for non-matches. #' #' TNRS doesn't provide any advice about the occurrence of homonyms when #' queries have no indication of a taxonomic name's authority. So if there #' is any chance of a homonym, you probably want to send the authority as #' well, or use \code{\link{gnr_resolve}}. For example, #' \code{tnrs(query="Jussiaea linearis", source="iPlant_TNRS")} gives result of #' \emph{Jussiaea linearis (Willd.) Oliv. ex Kuntze}, but there is a #' homonym. If you do #' \code{tnrs(query="Jussiaea linearis Hochst.", source="iPlant_TNRS")} you #' get a direct match for that name. So, beware that there's no indication #' of homonyms. #' @references \url{http://taxosaurus.org/} #' @seealso \code{\link{gnr_resolve}} #' @examples \dontrun{ #' mynames <- c("Helianthus annuus", "Poa annua", "Mimulus bicolor") #' tnrs(query = mynames, source = "iPlant_TNRS") #' #' # Specifying the nomenclatural code to match against #' mynames <- c("Helianthus annuus", "Poa annua") #' tnrs(query = mynames, code = "ICBN") #' #' # You can specify multiple sources, by comma-separating them #' mynames <- c("Panthera tigris", "Eutamias minimus", "Magnifera indica", #' "Humbert humbert") #' tnrs(query = mynames, source = "NCBI,MSW3") #' #' mynames <- c("Panthera tigris", "Eutamias minimus", "Magnifera indica", #' "Humbert humbert", "Helianthus annuus", "Pinus contorta", "Poa annua", #' "Abies magnifica", "Rosa california", "Festuca arundinace", #' "Mimulus bicolor", "Sorbus occidentalis","Madia sativa", "Thymopsis thymodes", #' "Bartlettia scaposa") #' tnrs(mynames, source = "NCBI") #' #' # Pass on curl options #' library("httr") #' mynames <- c("Helianthus annuus", "Poa annua", "Mimulus bicolor") #' tnrs(query = mynames, source = "iPlant_TNRS", config = verbose()) #' } tnrs <- function(query = NA, source = NULL, code = NULL, getpost = "POST", sleep = 0, splitby = 30, verbose = TRUE, ...) { getpost <- tolower(getpost) getpost <- match.arg(getpost, c('get', 'post')) mainfunc <- function(x, ...) { url = "http://taxosaurus.org/submit" Sys.sleep(time = sleep) # set amount of sleep to pause by if (getpost == "get") { if (!any(is.na(x))) { query2 <- paste(str_replace_all(x, ' ', '+'), collapse = '%0A') args <- tc(list(query = query2, source = source, code = code)) out <- GET(url, query = args, ...) error_handle(out) retrieve <- out$url } else { stop("some problems...", call. = FALSE) } } else { loc <- tempfile(fileext = ".txt") write.table(data.frame(x), file = loc, col.names = FALSE, row.names = FALSE) args <- tc(list(source = source, code = code)) body <- tc(list(file = upload_file(loc))) out <- POST(url, query = args, body = body, config(followlocation = 0), ...) error_handle(out) tt <- con_utf8(out) message <- jsonlite::fromJSON(tt, FALSE)[["message"]] retrieve <- jsonlite::fromJSON(tt, FALSE)[["uri"]] } mssg(verbose, sprintf("Calling %s", retrieve)) iter <- 0 output <- list() timeout <- "wait" while (timeout == "wait") { iter <- iter + 1 ss <- GET(retrieve) error_handle(ss, TRUE) temp <- jsonlite::fromJSON(con_utf8(ss), FALSE) if (grepl("is still being processed", temp["message"]) == TRUE) { timeout <- "wait" } else { output[[iter]] <- temp timeout <- "done" } } out <- tc(output)[[1]] # Parse results into data.frame df <- data.frame(rbindlist(lapply(out$names, parseres))) f <- function(x) str_replace_all(x, pattern = "\\+", replacement = " ") df2 <- colwise(f)(df) # replace quotes data.frame(apply(df2, c(1,2), function(x){ if (grepl('\"', x)) gsub('\"', "", x) else x }), stringsAsFactors = FALSE) } if (length(query) < 1 || is.na(query)) stop("Please supply at least one name", call. = FALSE) if (getpost == "get" && length(query) > 75 | length(query) > 30 && getpost == "post") { species_split <- slice(query, by = splitby) out <- lapply(species_split, function(x) mainfunc(x, ...)) tmp <- data.frame(rbindlist(out), stringsAsFactors = FALSE) } else { tmp <- mainfunc(query, ...) } tmp <- tmp[match(query, tmp$submittedName), ] tmp <- na.omit(tmp) row.names(tmp) <- NULL stats::setNames(tmp, tolower(names(tmp))) } # Function to parse results parseres <- function(w){ matches <- w$matches foome <- function(z) { z[sapply(z, length) == 0] <- "none" data.frame(z) } matches2 <- data.frame(rbindlist(lapply(matches, foome))) df <- data.frame(submittedName = w$submittedName, matches2) df$score <- round(as.numeric(as.character(df$score)), 2) df } # Function to split up the species list into more manageable chunks slice <- function(input, by = 2) { starts <- seq(1, length(input), by) tt <- lapply(starts, function(y) input[y:(y + (by - 1))]) lapply(tt, function(x) x[!is.na(x)]) } error_handle <- function(x, checkcontent=FALSE){ tocheck <- x$status_code if (checkcontent) { if ( "metadata" %in% names(jsonlite::fromJSON(con_utf8(x), FALSE)) ) { codes <- sapply(jsonlite::fromJSON(con_utf8(x), FALSE)$metadata$sources, "[[", "status") codes <- as.numeric(str_extract(codes, "[0-9]+")) tocheck <- c(tocheck, codes) } } if (any(tocheck >= 400)) { it <- tocheck[ tocheck >= 400 ] mssg <- switch(as.character(it), '400' = "Bad Request. The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repeat the request without modifications.", '401' = 'Unauthorized', '403' = 'Forbidden', '404' = 'Not Found', '500' = 'Internal Server Error. The server encountered an unexpected condition which prevented it from fulfilling the request.', '501' = 'Not Implemented', '502' = 'Bad Gateway', '503' = 'Service Unavailable', '504' = 'Gateway Timeout' ) stop(sprintf("HTTP status %s - %s", it, mssg), call. = FALSE) } } taxize/R/tp_dist.R0000644000176200001440000000366712672106003013561 0ustar liggesusers#' Return all distribution records for for a taxon name with a given id. #' #' @export #' @param id the taxon identifier code #' @param key Your Tropicos API key; loads from .Rprofile. Or you can passin your #' key in this arg. #' @param ... Curl options passed on to \code{\link[httr]{GET}} #' @return List of two data.frame's, one named "location", and one "reference". #' @references \url{http://services.tropicos.org/help?method=GetNameDistributionsXml} #' #' @examples \dontrun{ #' # Query using a taxon name Id #' out <- tp_dist(id = 25509881) #' ## just location data #' head(out[['location']]) #' ## just reference data #' head(out[['reference']]) #' } tp_dist <- function(id, key=NULL, ...) { id <- as.numeric(as.character(id)) if (!inherits(id, "numeric")) { stop("You must supply a numeric taxon name id") } url = sprintf('http://services.tropicos.org/Name/%s/Distributions', id) key <- getkey(key, "tropicosApiKey") args <- tc(list(format = 'json', apikey = key)) tt <- GET(url, query = args, ...) stop_for_status(tt) out <- jsonlite::fromJSON(con_utf8(tt), FALSE) getdata <- function(x, which) data.frame(x[[which]]) locs <- do.call(rbind.fill, lapply(out, getdata, which = "Location")) names(locs) <- tolower(names(locs)) refs <- do.call(rbind.fill, lapply(out, getdata, which = "Reference")) names(refs) <- tolower(names(refs)) list(location = locs, reference = refs) } #' Return all distribution records for for a taxon name with a given id. #' #' Function name changed to tp_dist. #' #' @param id the taxon identifier code #' @param key Your Tropicos API key; loads from .Rprofile. Or you can passin your #' key in this arg. #' @param callopts Further args passed on to httr::GET #' @export #' @keywords internal #' @rdname tp_namedistributions-deprecated tp_namedistributions <- function(id, key=NULL, callopts=list()) { .Deprecated("tp_dist", "taxize", "Function name changed. See tp_dist", "tp_namedistributions") } taxize/R/downstream-utils.R0000644000176200001440000000123113132770733015426 0ustar liggesusersprune_too_low <- function(x, rank, ignore_no_rank = FALSE) { rank_target_no <- as.numeric(rank_ref[which_rank(rank), "rankid"]) rank_nos <- as.numeric(rank_ref[vapply(x$rank, function(z) which_rank(z), 1), "rankid"]) if (ignore_no_rank) rank_nos[rank_nos %in% c(300, 400)] <- 0 x[!rank_nos > rank_target_no, ] } prune_too_low_col <- function(x, rank, ignore_no_rank = FALSE) { rank_target_no <- as.numeric(rank_ref[which_rank(rank), "rankid"]) rank_nos <- as.numeric(rank_ref[unlist(sapply(x$childtaxa_rank, function(z) which_rank(z))), "rankid"]) x[!rank_nos > rank_target_no, ] } taxize/R/ubio_search.R0000644000176200001440000000043412672106003014363 0ustar liggesusers#' This function will return NameBankIDs that match given search terms #' #' THIS FUNCTION IS DEFUNCT. #' #' @rdname ubio_search-defunct #' @export #' @param ... Parameters, ignored ubio_search <- function(...) { .Defunct(msg = "the uBio API is down, for good as far as we know") } taxize/R/taxize_ldfast.R0000644000176200001440000000075112672106003014743 0ustar liggesusers#' Replacement function for ldply that should be faster in all cases. #' #' @param x A list. #' @param convertvec Convert a vector to a data.frame before rbind is called. #' @export #' @keywords internal taxize_ldfast <- function(x, convertvec=FALSE){ convert2df <- function(x){ if (!inherits(x, "data.frame")) { data.frame(rbind(x)) } else { x } } if (convertvec) { do.call(rbind.fill, lapply(x, convert2df)) } else { do.call(rbind.fill, x) } } taxize/R/eubon.R0000644000176200001440000001044613060060133013207 0ustar liggesusers#' EUBON taxonomy search #' #' @export #' @param query (character) The scientific name to search for. For example: #' "Bellis perennis", "Prionus" or "Bolinus brandaris". This is an exact search #' so wildcard characters are not supported #' @param providers (character) A list of provider id strings concatenated by #' comma characters. The default : "pesi,bgbm-cdm-server[col]" will be used if #' this parameter is not set. A list of all available provider ids can be #' obtained from the '/capabilities' service end point. Providers can be #' nested, that is a parent provider can have sub providers. If the id of the #' parent provider is supplied all subproviders will be queried. The query #' can also be restricted to one or more subproviders by using the following #' syntax: parent-id[sub-id-1,sub-id2,...] #' @param searchMode (character) Specifies the searchMode. Possible search #' modes are: scientificNameExact, scientificNameLike (begins with), #' vernacularNameExact, vernacularNameLike #' (contains), findByIdentifier. If the a provider does not support the #' chosen searchMode it will be skipped and the status message in the #' tnrClientStatus will be set to 'unsupported search mode' in this case. #' @param addSynonymy (logical) Indicates whether the synonymy of the accepted #' taxon should be included into the response. Turning this option on may #' cause an increased response time. Default: \code{FALSE} #' @param addParentTaxon (logical) Indicates whether the the parent taxon of #' the accepted taxon should be included into the response. Turning this option #' on may cause a slightly increased response time. Default: \code{FALSE} #' @param timeout (numeric) The maximum of milliseconds to wait for responses #' from any of the providers. If the timeout is exceeded the service will just #' return the responses that have been received so far. The default timeout is #' 0 ms (wait for ever) #' @param dedup (character) Allows to deduplicate the results by making use of #' a deduplication strategy. The deduplication is done by comparing #' specific properties of the taxon: #' \itemize{ #' \item id: compares 'taxon.identifier' #' \item id_name: compares 'taxon.identifier' AND #' 'taxon.taxonName.scientificName' #' \item name: compares 'taxon.taxonName.scientificName' Using the pure #' 'name' strategy is not recommended. #' } #' #' @param ... Curl options passed on to \code{\link[httr]{GET}} #' @references \url{http://cybertaxonomy.eu/eu-bon/utis/1.2/doc.html} #' @details Note that paging is not yet implemented, so you only get the first #' chunk of up to 50 results for methods that require paging. We will #' implement paging here when it is available in the EU BON API. #' @family eubon-methods #' @examples \dontrun{ #' eubon_search("Prionus") #' eubon_search("Salmo", 'pesi') #' eubon_search("Salmo", c('pesi', 'worms')) #' eubon_search("Salmo", 'worms', 'scientificNameLike') #' eubon_search("Salmo", 'worms', addSynonymy = TRUE) #' eubon_search("Salmo", 'worms', addParentTaxon = TRUE) #' } eubon <- function(query, providers = 'pesi', searchMode = 'scientificNameExact', addSynonymy = FALSE, addParentTaxon = FALSE, timeout = 0, dedup = NULL, ...) { args <- tc(list(query = query, providers = paste0(providers, collapse = ","), searchMode = searchMode, addSynonymy = as_l(addSynonymy), addParentTaxon = as_l(addParentTaxon), timeout = timeout)) res <- httr::GET(file.path(eubon_base(), "search"), query = args, ...) eubon_error(res) tmp <- jsonlite::fromJSON(con_utf8(res), TRUE, flatten = TRUE) tmp$query$response[[1]] } #' @export #' @rdname eubon eubon_search <- eubon # helpers eubon_base <- function() "http://cybertaxonomy.eu/eu-bon/utis/1.2" eubon_error <- function(x) { if (grepl("json", x$headers$`content-type`)) { cs <- jsonlite::fromJSON(con_utf8(x), FALSE)$query[[1]]$clientStatus[[1]] if (x$status_code > 201 || cs$statusMessage != "ok") { stop(cs$statusMessage, call. = FALSE) } } else if (grepl("html", x$headers$`content-type`)) { if (x$status_code > 201) { mssg <- xml2::xml_text(xml2::xml_find_first(xml2::read_html(con_utf8(x)), "//title")) stop(mssg, call. = FALSE) } } else { stop(httr::http_status(x)$message, call. = FALSE) } } taxize/R/synonyms.R0000644000176200001440000002431013160565676014020 0ustar liggesusers#' Retrieve synonyms from various sources given input taxonomic #' names or identifiers #' #' @param x Vector of taxa names (character) or IDs (character or numeric) to #' query. #' @param db character; database to query. either \code{itis}, \code{tropicos}, #' \code{col}, \code{nbn}, or \code{worms}. Note that each taxonomic data #' source has their own identifiers, so that if you provide the wrong #' \code{db} value for the identifier you could get a result, but it will #' likely be wrong (not what you were expecting). #' @param id character; identifiers, returned by \code{\link[taxize]{get_tsn}}, #' \code{\link[taxize]{get_tpsid}}, \code{\link[taxize]{get_nbnid}}, #' \code{\link[taxize]{get_colid}}, \code{\link[taxize]{get_wormsid}} #' @param rows (numeric) Any number from 1 to infinity. If the default NA, all #' rows are considered. Note that this parameter is ignored if you pass in a #' taxonomic id of any of the acceptable classes: tsn, tpsid, nbnid, ids. #' @param ... Other passed arguments to internal functions \code{get_*()} and #' functions to gather synonyms. #' #' @return A named list of data.frames with the synonyms of every supplied taxa. #' @details If IDs are supplied directly (not from the \code{get_*} functions) #' you must specify the type of ID. #' #' For \code{db = "itis"} you can pass in a parameter \code{accepted} to #' toggle whether only accepted names are used \code{accepted = TRUE}, or if #' all are used \code{accepted = FALSE}. The default is \code{accepted = FALSE} #' #' Note that IUCN requires an API key. See #' \code{\link[rredlist]{rredlist-package}} for help on authentiating with #' IUCN Redlist #' #' @seealso \code{\link[taxize]{get_tsn}}, \code{\link[taxize]{get_tpsid}}, #' \code{\link[taxize]{get_nbnid}}, \code{\link[taxize]{get_colid}}, #' \code{\link[taxize]{get_wormsid}}, \code{\link[taxize]{get_iucn}} #' #' @export #' @examples \dontrun{ #' # Plug in taxon IDs #' synonyms(183327, db="itis") #' synonyms("25509881", db="tropicos") #' synonyms("NBNSYS0000004629", db='nbn') #' # synonyms("87e986b0873f648711900866fa8abde7", db='col') # FIXME #' synonyms(105706, db='worms') #' synonyms(12392, db='iucn') #' #' # Plug in taxon names directly #' synonyms("Pinus contorta", db="itis") #' synonyms("Puma concolor", db="itis") #' synonyms(c("Poa annua",'Pinus contorta','Puma concolor'), db="itis") #' synonyms("Poa annua", db="tropicos") #' synonyms("Pinus contorta", db="tropicos") #' synonyms(c("Poa annua",'Pinus contorta'), db="tropicos") #' synonyms("Pinus sylvestris", db='nbn') #' synonyms("Puma concolor", db='col') #' synonyms("Ursus americanus", db='col') #' synonyms("Amblyomma rotundatum", db='col') #' synonyms('Pomatomus', db='worms') #' synonyms('Pomatomus saltatrix', db='worms') #' #' # not accepted names, with ITIS #' ## looks for whether the name given is an accepted name, #' ## and if not, uses the accepted name to look for synonyms #' synonyms("Acer drummondii", db="itis") #' synonyms("Spinus pinus", db="itis") #' #' # Use get_* methods #' synonyms(get_tsn("Poa annua")) #' synonyms(get_tpsid("Poa annua")) #' synonyms(get_nbnid("Carcharodon carcharias")) #' synonyms(get_colid("Ornithodoros lagophilus")) #' synonyms(get_iucn('Loxodonta africana')) #' #' # Pass many ids from class "ids" #' out <- get_ids(names="Poa annua", db = c('itis','tropicos')) #' synonyms(out) #' #' # Use the rows parameter to select certain rows #' synonyms("Poa annua", db='tropicos', rows=1) #' synonyms("Poa annua", db='tropicos', rows=1:3) #' synonyms("Pinus sylvestris", db='nbn', rows=1:3) #' synonyms("Amblyomma rotundatum", db='col', rows=2) #' synonyms("Amblyomma rotundatum", db='col', rows=2:3) #' #' # Use curl options #' synonyms("Poa annua", db='tropicos', rows=1, config=verbose()) #' synonyms("Poa annua", db='itis', rows=1, config=verbose()) #' synonyms("Poa annua", db='col', rows=1, config=verbose()) #' #' #' # combine many outputs together #' x <- synonyms(c("Osmia bicornis", "Osmia rufa", "Osmia"), db = "itis") #' synonyms_df(x) #' #' ## note here how Pinus contorta is dropped due to no synonyms found #' x <- synonyms(c("Poa annua",'Pinus contorta','Puma concolor'), db="col") #' synonyms_df(x) #' #' ## note here that ids are taxon identifiers b/c you start with them #' x <- synonyms(c(25509881, 13100094), db="tropicos") #' synonyms_df(x) #' #' ## xxx #' x <- synonyms(c('Aglais io', 'Usnea hirta', 'Arctostaphylos uva-ursi'), #' db="nbn") #' synonyms_df(x) #' } synonyms <- function(...) { UseMethod("synonyms") } #' @export #' @rdname synonyms synonyms.default <- function(x, db = NULL, rows = NA, ...) { nstop(db) switch( db, itis = { id <- process_syn_ids(x, db, get_tsn, rows = rows, ...) structure(stats::setNames(synonyms(id, ...), x), class = "synonyms", db = "itis") }, tropicos = { id <- process_syn_ids(x, db, get_tpsid, rows = rows, ...) structure(stats::setNames(synonyms(id, ...), x), class = "synonyms", db = "tropicos") }, nbn = { id <- process_syn_ids(x, db, get_nbnid, rows = rows, ...) structure(stats::setNames(synonyms(id, ...), x), class = "synonyms", db = "nbn") }, col = { id <- process_syn_ids(x, db, get_colid, rows = rows, ...) structure(stats::setNames(synonyms(id, ...), x), class = "synonyms", db = "col") }, worms = { id <- process_syn_ids(x, db, get_wormsid, rows = rows, ...) structure(stats::setNames(synonyms(id, ...), x), class = "synonyms", db = "worms") }, iucn = { id <- process_syn_ids(x, db, get_iucn, ...) structure(stats::setNames(synonyms(id, ...), x), class = "synonyms", db = "iucn") }, stop("the provided db value was not recognised", call. = FALSE) ) } process_syn_ids <- function(input, db, fxn, ...){ g <- tryCatch(as.numeric(as.character(input)), warning = function(e) e) if (inherits(g,"numeric") || is.character(input) && grepl("N[HB]", input) || is.character(input) && grepl("[[:digit:]]", input)) { as_fxn <- switch(db, itis = as.tsn, tropicos = as.tpsid, nbn = as.nbnid, col = as.colid, worms = as.wormsid, iucn = as.iucn) if (db == "iucn") return(as_fxn(input, check = TRUE)) return(as_fxn(input, check = FALSE)) } else { eval(fxn)(input, ...) } } #' @export #' @rdname synonyms synonyms.tsn <- function(id, ...) { fun <- function(x){ if (is.na(x)) { NA } else { is_acc <- rit_acc_name(x, ...) if (all(!is.na(is_acc$acceptedName))) { accdf <- stats::setNames( data.frame(x[1], is_acc, stringsAsFactors = FALSE), c("sub_tsn", "acc_name", "acc_tsn", "acc_author") ) x <- is_acc$acceptedTsn message("Accepted name(s) is/are '", paste0(is_acc$acceptedName, collapse = "/"), "'") message("Using tsn(s) ", paste0(is_acc$acceptedTsn, collapse = "/"), "\n") } else { accdf <- data.frame(sub_tsn = x[1], acc_tsn = x[1], stringsAsFactors = FALSE) } out <- do.call("rbind", lapply(x, ritis::synonym_names, ...)) if (NROW(out) == 0) { out <- data.frame(syn_name = "nomatch", syn_tsn = x[1], stringsAsFactors = FALSE) } else { out <- stats::setNames(out, c('syn_author', 'syn_name', 'syn_tsn')) } if (as.character(out[1,1]) == 'nomatch') { out <- data.frame(message = "no syns found", stringsAsFactors = FALSE) } cbind(accdf, out) } } stats::setNames(lapply(id, fun), id) } rit_acc_name <- function(x, ...) { tmp <- ritis::accepted_names(x, ...) if (NROW(tmp) == 0) { data.frame(submittedtsn = x[1], acceptedName = NA, acceptedTsn = x[1], stringsAsFactors = FALSE) } else { tmp } } #' @export #' @rdname synonyms synonyms.colid <- function(id, ...) { fun <- function(x) { if (is.na(x)) { NA } else { col_synonyms(x, ...) } } stats::setNames(lapply(id, fun), id) } col_synonyms <- function(x, ...) { base <- "http://www.catalogueoflife.org/col/webservice" args <- list(id = x[1], response = "full", format = "json") res <- httr::GET(base, query = args, ...) httr::stop_for_status(res) out <- jsonlite::fromJSON(con_utf8(res), FALSE) tmp <- out$results[[1]] if ("synonyms" %in% names(tmp)) { df <- taxize_ldfast(lapply(tmp$synonyms, function(w) { w[sapply(w, length) == 0] <- NA w$references <- NULL data.frame(w, stringsAsFactors = FALSE) })) df$rank <- tolower(df$rank) df } else { NULL } } #' @export #' @rdname synonyms synonyms.tpsid <- function(id, ...) { fun <- function(x) { if (is.na(x)) { NA } else { tp_synonyms(x, ...)$synonyms } } stats::setNames(lapply(id, fun), id) } #' @export #' @rdname synonyms synonyms.nbnid <- function(id, ...) { fun <- function(x){ if (is.na(x)) { NA } else { nbn_synonyms(x, ...) } } stats::setNames(lapply(id, fun), id) } #' @export #' @rdname synonyms synonyms.wormsid <- function(id, ...) { fun <- function(x) { if (is.na(x)) { NA } else { worrms::wm_synonyms(as.numeric(x), ...) } } stats::setNames(lapply(id, fun), id) } #' @export #' @rdname synonyms synonyms.iucn <- function(id, ...) { out <- vector(mode = "list", length = length(id)) for (i in seq_along(id)) { if (is.na(id[[i]])) { out[[i]] <- NA } else { out[[i]] <- rredlist::rl_synonyms(attr(id, "name")[i], ...)$result } } stats::setNames(out, id) } #' @export #' @rdname synonyms synonyms.ids <- function(id, ...) { fun <- function(x){ if (is.na(x)) { out <- NA } else { out <- synonyms(x, ...) } return( out ) } lapply(id, fun) } ### Combine synonyms output into single data.frame ----------- #' @export #' @rdname synonyms synonyms_df <- function(x) { UseMethod("synonyms_df") } #' @export synonyms_df.default <- function(x) { stop("no 'synonyms_df' method for ", class(x), call. = FALSE) } #' @export synonyms_df.synonyms <- function(x) { (data.table::setDF( data.table::rbindlist(x, use.names = TRUE, fill = TRUE, idcol = TRUE) )) } taxize/R/itis_native.R0000644000176200001440000000174012771331036014425 0ustar liggesusers#' Get jurisdiction data, i.e., native or not native in a region. #' #' @export #' @param tsn One or more TSN's (taxonomic serial number) #' @param what One of bytsn, values, or originvalues #' @param ... Further arguments passed on to #' \code{\link[ritis]{jurisdictional_origin}}, #' \code{\link[ritis]{jurisdiction_values}}, or #' \code{\link[ritis]{jurisdiction_origin_values}} #' @examples \dontrun{ #' # Get values #' itis_native(what="values") #' #' # Get origin values #' itis_native(what="originvalues") #' #' # Get values by tsn #' itis_native(tsn=180543) #' itis_native(tsn=c(180543,41074,36616)) #' } itis_native <- function(tsn=NULL, what="bytsn", ...) { switch( what, bytsn = { temp <- lapply(tsn, function(x) ritis::jurisdictional_origin(x, ...)) if (length(tsn) == 1) { temp[[1]] } else { setNames(temp, tsn) } }, values = ritis::jurisdiction_values(...), originvalues = ritis::jurisdiction_origin_values(...)) } taxize/R/phylomatic_format.R0000644000176200001440000000055312672106003015623 0ustar liggesusers#' Get family names to make Phylomatic input object, and output input string #' to Phylomatic for use in the function phylomatic_tree. #' #' THIS FUNCTION IS DEFUNCT. #' #' @export #' @rdname phylomatic_format-defunct #' @param ... Parameters, ignored phylomatic_format <- function(...) { .Defunct(msg = "This function is defunct - See ?`taxize-defunct`") } taxize/R/resolve.R0000644000176200001440000000561012672106003013560 0ustar liggesusers#' @title Resolve names from different data sources #' #' @description Resolve names from iPlant's name resolver, the Taxonomic Name #' Resolution Service (TNRS), and the Global Names Resolver (GNR) #' #' @export #' @param query Vector of one or more taxonomic names (common names not supported) #' @param db Source to check names against. One of iplant, tnrs, or gnr. Default: gnr #' Note that each taxonomic data source has their own identifiers, so that if you #' provide the wrong \code{db} value for the identifier you could get a result, #' but it will likely be wrong (not what you were expecting). #' @param ... Curl options passed on to \code{\link[httr]{GET}} or \code{\link[httr]{POST}}. #' In addition, further named args passed on to each respective function. See examples #' @return A list with length equal to length of the db parameter (number of #' sources requested), with each element being a data.frame or list with results #' from that source. #' @examples \dontrun{ #' resolve(query=c("Helianthus annuus", "Homo sapiens")) #' resolve(query="Quercus keloggii", db='gnr') #' resolve(query=c("Helianthus annuus", "Homo sapiens"), db='tnrs') #' resolve(query=c("Helianthus annuus", "Homo sapiens"), db=c('iplant', 'gnr')) #' resolve(query="Quercus keloggii", db=c('iplant', 'gnr')) #' resolve(query="Quercus keloggii", db=c('iplant', 'gnr', 'tnrs')) #' #' # pass in options specific to each source #' resolve("Helianthus annuus", db = 'gnr', preferred_data_sources = c(3, 4)) #' resolve("Helianthus annuus", db = 'iplant', retrieve = 'best') #' identical( #' resolve("Helianthus annuus", db = 'iplant', retrieve = 'best')$iplant, #' iplant_resolve("Helianthus annuus", retrieve = 'best') #' ) #' mynames <- c("Helianthus annuus", "Pinus contorta", "Poa annua", #' "Abies magnifica", "Rosa california") #' resolve(mynames, db = 'tnrs', source = "NCBI") #' resolve(mynames, db = 'tnrs', source = "iPlant_TNRS") #' identical( #' resolve(mynames, db = 'tnrs', source = "iPlant_TNRS")$tnrs, #' tnrs(mynames, source = "iPlant_TNRS") #' ) #' #' # pass in curl options #' library("httr") #' resolve(query="Qercuss", db = "iplant", config=verbose()) #' res <- resolve(query=c("Helianthus annuus", "Homo sapiens"), config=progress()) #' } resolve <- function(query, db = 'gnr', ...) { db <- match.arg(db, choices = c('iplant', 'gnr', 'tnrs'), several.ok = TRUE) foo <- function(x, y, ...){ res <- switch(x, gnr = tryDefault(gnr_resolve(names = y, ...)), tnrs = tryDefault(tnrs(query = y, ...)), iplant = tryDefault(iplant_resolve(query = y, ...))) if (is.null(res)) "Error: no data found" else res } setNames(lapply(db, function(z) foo(z, query, ...)), db) } tryDefault <- function(expr, default = NULL, quiet = TRUE) { result <- default if (quiet) { tryCatch(result <- expr, error = function(e) { }) } else { try(result <- expr) } result } taxize/R/eol_search.R0000644000176200001440000000535213143100601014200 0ustar liggesusers#' Search for terms in EOL database. #' #' @export #' @param terms search terms (character) #' @param page A maximum of 30 results are returned per page. This parameter #' allows you to fetch more pages of results if there are more than #' 30 matches (Default 1) #' @param exact Will find taxon pages if the preferred name or any synonym #' or common name exactly matches the search term. #' @param filter_tid Given an EOL page ID, search results will be limited #' to members of that taxonomic group #' @param filter_heid Given a Hierarchy Entry ID, search results will be #' limited to members of that taxonomic group #' @param filter_by_string Given a search term, an exact search will be made #' and that matching page will be used as the taxonomic group against which #' to filter search results #' @param cache_ttl The number of seconds you wish to have the response cached. #' @param key Your EOL API key; loads from .Rprofile. #' @param ... Curl options passed on to \code{\link[httr]{GET}} #' @details It's possible to return JSON or XML with the EOL API. However, #' this function only returns JSON for now. #' @return A data frame with four columns: #' \itemize{ #' \item pageid: pageid, this is the same as the eolid you can get from #' \code{\link{get_eolid}} #' \item name: taxonomic name, may or may not contain the taxonomic #' authority #' \item link: URL for the taxon in question #' \item content: a string of semi-colon separated names. it's not clear #' to us what these represent exactly, but figured why not give it to users #' in case some may find it useful #' } #' @examples \dontrun{ #' eol_search(terms='Homo') #' eol_search(terms='Salix') #' eol_search(terms='Ursus americanus luteolus') #' } eol_search <- function(terms, page=1, exact=NULL, filter_tid=NULL, filter_heid=NULL, filter_by_string=NULL, cache_ttl=NULL, key = NULL, ...) { key <- getkey(key, "eolApiKey") query <- gsub("\\s", "+", terms) args <- tc(list(q = query, page = page, exact = exact, filter_by_taxon_concept_id = filter_tid, filter_by_hierarchy_entry_id = filter_heid, filter_by_string = filter_by_string, cache_ttl = cache_ttl, key = key)) tt <- GET(paste0(eol_url("search"), ".json"), query = argsnull(args), ...) warn_for_status(tt) stopifnot(tt$headers$`content-type`[1] == 'application/json; charset=utf-8') res <- jsonlite::fromJSON(con_utf8(tt), FALSE, encoding = "utf-8") if (res$totalResults == 0 | length(res$results) == 0) { data.frame(pageid = NA, name = NA, stringsAsFactors = FALSE) } else { tmp <- do.call( "rbind.fill", lapply(res$results, data.frame, stringsAsFactors = FALSE) ) stats::setNames(tmp, c("pageid", "name", "link", "content")) } } taxize/R/eol_dataobjects.R0000644000176200001440000000316712672106003015230 0ustar liggesusers#' Given the identifier for a data object, return all metadata about the object #' #' @export #' @param id (character) The EOL data object identifier #' @param taxonomy (logical) Whether to return any taxonomy details from different #' taxon hierarchy providers, in an array named \code{taxonconcepts} #' @param usekey (logical) use your API key or not (\code{TRUE} or \code{FALSE}) #' @param key (character) Your EOL API key; can load from .Rprofile if not passed as a parameter #' @param verbose (logical); If TRUE the actual taxon queried is printed on the #' console. #' @param ... Curl options passed on to \code{\link[httr]{GET}} #' @details It's possible to return JSON or XML with the EOL API. However, #' this function only returns JSON for now. #' @return A list, optionally with a data.frame if \code{taxonomy=TRUE} #' @examples \dontrun{ #' eol_dataobjects(id = "d72801627bf4adf1a38d9c5f10cc767f") #' eol_dataobjects(id = "21929584") #' #' # curl options #' library("httr") #' eol_dataobjects(id = "21929584", config = verbose()) #' } eol_dataobjects <- function(id, taxonomy = TRUE, usekey = TRUE, key = NULL, verbose = TRUE, ...) { if (usekey) key <- getkey(key, "eolApiKey") tt <- GET(file.path(eol_url("data_objects"), paste0(id, ".json")), query = argsnull(tc(list(key = key, taxonomy = as_l(taxonomy)))), ...) stop_for_status(tt) tmp <- jsonlite::fromJSON(con_utf8(tt)) tmp <- nmslwr(tmp) if (taxonomy) { tmp$taxonconcepts <- nmslwr(tmp$taxonconcepts) tmp$taxonconcepts$taxonrank <- tolower(tmp$taxonconcepts$taxonrank) } return(tmp) } nmslwr <- function(x) { setNames(x, tolower(names(x))) } taxize/R/tol_resolve.R0000644000176200001440000000461613023603670014446 0ustar liggesusers#' Resolve names using Open Tree of Life (OTL) resolver #' #' @export #' @param names (character vector) taxon names to be queried #' @param context_name name of the taxonomic context to be searched #' (length-one character vector). Must match (case sensitive) one #' of the values returned by \code{\link[rotl]{tnrs_contexts}}. #' @param do_approximate_matching (logical) A logical indicating whether or not #' to perform approximate string (a.k.a. \dQuote{fuzzy}) #' matching. Using \code{FALSE} will greatly improve #' speed. Default: \code{TRUE} #' @param ids An array of OTL ids to use for identifying names. These #' will be assigned to each name in the names array. If ids is #' provided, then ids and names must be identical in length. #' @param include_suppressed (logical) Ordinarily, some quasi-taxa, such as #' incertae sedis buckets and other non-OTUs, are suppressed from TNRS #' results. If this parameter is true, these quasi-taxa are allowed as #' possible TNRS results. Default: \code{FALSE} #' #' @return A data frame summarizing the results of the query. The #' original query output is appended as an attribute to the #' returned object (and can be obtained using \code{attr(object, #' "original_response")}). #' #' @param ... Curl options passed on to \code{\link[httr]{POST}} within #' \code{\link[rotl]{tnrs_match_names}} #' @author Francois Michonneau \email{francois.michonneau@@gmail.com} #' Scott Chamberlain \email{myrmecocystus@@gmail.com} #' @seealso \code{\link{gnr_resolve}}, \code{\link{tnrs}} #' @references #' \url{https://github.com/OpenTreeOfLife/germinator/wiki/TNRS-API-v3#match_names} #' @keywords resolve names taxonomy #' @examples \dontrun{ #' tol_resolve(names=c("echinodermata", "xenacoelomorpha", #' "chordata", "hemichordata")) #' tol_resolve(c("Hyla", "Salmo", "Diadema", "Nautilus")) #' tol_resolve(c("Hyla", "Salmo", "Diadema", "Nautilus"), #' context_name = "Animals") #' #' turducken_spp <- c("Meleagris gallopavo", "Anas platyrhynchos", #' "Gallus gallus") #' tol_resolve(turducken_spp, context_name="Animals") #' } tol_resolve <- function(names = NULL, context_name = NULL, do_approximate_matching = TRUE, ids = NULL, include_suppressed = FALSE, ...) { rotl::tnrs_match_names(names = names, context_name = context_name, do_approximate_matching = do_approximate_matching, ids = ids, include_suppressed = include_suppressed, ...) } taxize/R/ping.R0000644000176200001440000001363013160566064013051 0ustar liggesusers#' Ping an API used in taxize to see if it's working. #' #' @name ping #' @param what (character) One of status (default), content, or an HTTP status #' code. If status, we just check that the HTTP status code is 200, or similar #' signifying the service is up. If content, we do a simple, quick check to #' determine if returned content matches what's expected. If an HTTP status #' code, it must match an appropriate code. See \code{\link{status_codes}}. #' @param ... Curl options passed on to \code{\link[httr]{GET}} #' @return A logical, TRUE or FALSE #' @details For ITIS, see \code{\link[ritis]{description}}, which provides #' number of scientific and common names in a character string. #' @examples \dontrun{ #' col_ping() #' col_ping("content") #' col_ping(200) #' col_ping("200") #' col_ping(204) #' #' itis_ping() #' eol_ping() #' ncbi_ping() #' tropicos_ping() #' nbn_ping() #' #' gbif_ping() #' gbif_ping(200) #' #' bold_ping() #' bold_ping(200) #' bold_ping("content") #' #' ipni_ping() #' ipni_ping(200) #' ipni_ping("content") #' #' vascan_ping() #' vascan_ping(200) #' vascan_ping("content") #' #' # curl options #' library("httr") #' vascan_ping(config=verbose()) #' eol_ping(500, config=verbose()) #' } #' @export #' @rdname ping col_ping <- function(what = "status", ...) { res <- GET('http://www.catalogueoflife.org/col/webservice?name=Apis', ...) switch( matchwhat(what), status = match_status(res), code = match_code(res, what), content = { identical( "Apis", xml_text(xml_find_first(xml_children(xml2::read_xml(con_utf8(res)))[[1]], "name"))) } ) } #' @export #' @rdname ping eol_ping <- function(what = "status", ...) { res <- GET('http://eol.org/api/ping', ...) switch(matchwhat(what), status = match_status(res), code = match_code(res, what), content = grepl("success", xml2::xml_text(xml2::read_xml(con_utf8(res))), ignore.case = TRUE)) } #' @export #' @rdname ping itis_ping <- function(what = "status", ...) { res <- GET("http://www.itis.gov/ITISWebService/services/ITISService/getDescription", ...) switch(matchwhat(what), status = match_status(res), code = match_code(res, what), content = { tt <- xml_text(xml2::xml_children(xml2::read_xml(con_utf8(res)))[[1]]) grepl("this is the itis web service", tt, ignore.case = TRUE) }) } #' @export #' @rdname ping ncbi_ping <- function(what = "status", ...) { res <- GET(paste0(ncbi_base(), "/entrez/eutils/efetch.fcgi?db=taxonomy&ID=4232"), ...) switch(matchwhat(what), status = match_status(res), code = match_code(res, what), content = identical("4232", xml_text(xml_find_first(xml_children(read_xml(con_utf8(res)))[[1]], "TaxId"))) ) } #' @export #' @rdname ping tropicos_ping <- function(what = "status", ...) { res <- GET("http://services.tropicos.org/Name/25509881?apikey=f3e499d4-1519-42c9-afd1-685a16882f5a&format=json", ...) switch(matchwhat(what), status = match_status(res), code = match_code(res, what), content = grepl(25509881, jsonlite::fromJSON(con_utf8(res))$NameId)) } #' @export #' @rdname ping nbn_ping <- function(what = "status", ...) { res <- GET("https://species-ws.nbnatlas.org/species/NHMSYS0000502940", ...) switch( matchwhat(what), status = match_status(res), code = match_code(res, what), content = { jsonlite::fromJSON(con_utf8(res))$taxonConcept$guid == 'NHMSYS0000502940' } ) } #' @export #' @rdname ping gbif_ping <- function(what = "status", ...) { res <- GET("http://api.gbif.org/v1/species/1", ...) switch(matchwhat(what), status = match_status(res), code = match_code(res, what), content = grepl("1", jsonlite::fromJSON(con_utf8(res))$key, ignore.case = TRUE)) } #' @export #' @rdname ping bold_ping <- function(what = "status", ...) { res <- GET("http://v4.boldsystems.org/index.php/API_Tax/TaxonData?taxId=88899&dataTypes=basic&includeTree=FALSE", ...) switch( matchwhat(what), status = match_status(res), code = match_code(res, what), content = grepl("88899", jsonlite::fromJSON(con_utf8(res))$taxid, ignore.case = TRUE) ) } #' @export #' @rdname ping ipni_ping <- function(what = "status", ...) { res <- GET("http://www.ipni.org/ipni/advPlantNameSearch.do?find_genus=Brintonia&output_format=delimited-minimal", ...) switch(matchwhat(what), status = match_status(res), code = match_code(res, what), content = { txt <- con_utf8(res) dat <- read.delim(text = txt, sep = "%", stringsAsFactors = FALSE) grepl("Asteraceae", dat$Family[1], ignore.case = TRUE) }) } #' @export #' @rdname ping vascan_ping <- function(what = "status", ...) { res <- GET("http://data.canadensys.net/vascan/api/0.1/search.json?q=Crataegus", ...) switch(matchwhat(what), status = match_status(res), code = match_code(res, what), content = grepl("Crataegus", jsonlite::fromJSON(con_utf8(res))$results[[1]], ignore.case = TRUE) ) } #' @export #' @rdname ping fg_ping <- function(what = "status", ...) { res <- GET("http://www.indexfungorum.org/ixfwebservice/fungus.asmx/NameFullByKey?NameLsid=urn:lsid:indexfungorum.org:names:17703", ...) switch(matchwhat(what), status = match_status(res), code = match_code(res, what), content = grepl("Gymnopus", xml_text(read_xml(con_utf8(res))), ignore.case = TRUE) ) } matchwhat <- function(x){ x <- as.character(x) if ( x %in% c("status", "content") ) x else "code" } match_status <- function(x){ stopifnot(is(x, "response")) x$status_code == 200 } match_code <- function(x, y){ stopifnot(is(x, "response")) x$status_code == y } #' uBio ping #' #' @export #' @rdname ubio_ping-defunct ubio_ping <- function() { .Defunct(msg = "the uBio API is down, for good as far as we know") } taxize/R/tpl_families.r0000644000176200001440000000241612672106003014612 0ustar liggesusers#' Get The Plant List families. #' #' @export #' @param ... (list) Curl options passed on to \code{\link[httr]{GET}} #' @details Requires an internet connection in order to connect to www.theplantlist.org. #' @return Returns a \code{data.frame} including the names of all families indexed #' by The Plant List, and the major groups into which they fall (i.e. Angiosperms, #' Gymnosperms, Bryophytes and Pteridophytes). #' @author John Baumgartner (johnbb@@student.unimelb.edu.au) #' @seealso \code{\link{tpl_get}} #' @examples \dontrun{ #' # Get a data.frame of plant families, with the group name (Angiosperms, etc.) #' head( tpl_families() ) #' } tpl_families <- function(...) { temp <- GET('http://www.theplantlist.org/1.1/browse/-/', ...) stop_for_status(temp) temp <- xml2::read_html(con_utf8(temp), encoding = "UTF-8") families <- xml2::xml_text(xml2::xml_find_all(temp, "//ul[@id='nametree']//a")) groups <- as.character(factor(basename(dirname( xml2::xml_attr(xml2::xml_find_all(temp, "//ul[@id='nametree']//a"), "href"))), levels = c('A', 'B', 'G', 'P'), labels = c('Angiosperms', 'Bryophytes', 'Gymnosperms', 'Pteridophytes'))) data.frame(group = groups, family = families, stringsAsFactors = FALSE) } taxize/R/ncbi_getbyid.R0000644000176200001440000000114612672106003014523 0ustar liggesusers#' Retrieve gene sequences from NCBI by accession number. #' #' THIS FUNCTION IS DEFUNCT. #' #' @export #' @author Scott Chamberlain \email{myrmecocystus@@gmail.com} #' @rdname ncbi_getbyid-defunct #' @keywords internal ncbi_getbyid <- function(...) { .Defunct("ncbi_byid", "traits", msg = "This function is defunct. See traits::ncbi_byid()") } #' Retrieve gene sequences from NCBI by accession number. #' #' THIS FUNCTION IS DEFUNCT. #' #' @export #' @keywords internal #' @rdname get_genes-defunct get_genes <- function(...) { .Defunct("ncbi_getbyid", "taxize", "Function name changed. See ncbi_getbyid") } taxize/R/plantminer.R0000644000176200001440000000321013060060133014237 0ustar liggesusers#' Search for taxonomy data from Plantminer.com #' #' @export #' @param plants (character) Vector of plant species names. Required. #' @param from (character) One of tpl (for theplantlist.com data), or #' flora (for Brazilian Flora Checklist). Required. Default: \code{tpl} #' @param key (character) Your api key for the plantminer.com site. Go to #' http://www.plantminer.com/ to get your api key. Two options for #' inputting your key. 1) You can input it manually within the function as #' the second argument, or 2) you can put the key in your .Rprofile file, #' which will then be loaded when you start R. See #' http://bit.ly/135eG0b for help on how to put api keys in your .Rprofile file. #' @param verbose (logical) Verbose or not. Default: \code{TRUE} #' @return data.frame of results. #' @examples \dontrun{ #' # A single taxon #' plantminer("Ocotea pulchella") #' #' # Many taxa #' plants <- c("Myrcia lingua", "Myrcia bella", "Ocotea pulchella", #' "Miconia", "Coffea arabica var. amarella", "Bleh") #' plantminer(plants) #' #' # By deafult, tpl is used, for Theplantlist data, #' # toggle the from parameter here #' plantminer("Ocotea pulchella", from = "flora") #' } plantminer <- function(plants, from = "tpl", key = NULL, verbose = TRUE) { from <- match.arg(from, c("tpl", "flora")) key <- getkey(key, "pmApiKey") i <- NULL foreach(i = 1:length(plants), .combine = rbind) %do% { mssg(verbose, paste(plants[i], collapse = " ")) sp <- GET(paste0(pmbase(), from), query = list(key = key, taxon = plants[i])) stop_for_status(sp) jsonlite::fromJSON(con_utf8(sp)) } } pmbase <- function() "http://www.plantminer.com/" taxize/R/get_nbnid.R0000644000176200001440000002150013161005724014030 0ustar liggesusers#' Get the UK National Biodiversity Network ID from taxonomic names. #' #' @export #' @param name character; scientific name. #' @param ask logical; should get_nbnid be run in interactive mode? #' If TRUE and more than one ID is found for the species, the user is asked for #' input. If FALSE NA is returned for multiple matches. #' @param verbose logical; If TRUE the actual taxon queried is printed on the #' console. #' @param rec_only (logical) If \code{TRUE} ids of recommended names are #' returned (i.e. synonyms are removed). Defaults to \code{FALSE}. Remember, #' the id of a synonym is a taxa with 'recommended' name status. #' @param rank (character) If given, we attempt to limit the results to those #' taxa with the matching rank. #' @param rows numeric; Any number from 1 to infinity. If the default NA, all #' rows are considered. Note that this function still only gives back a nbnid #' class object with one to many identifiers. See #' \code{\link[taxize]{get_nbnid_}} to get back all, or a subset, of the raw #' data that you are presented during the ask process. #' @param ... Further args passed on to \code{nbn_search} #' @param x Input to \code{\link{as.nbnid}} #' @param check logical; Check if ID matches any existing on the DB, only #' used in \code{\link{as.nbnid}} #' @template getreturn #' #' @references #' @return an object of class nbnid, a light wrapper around a character #' string that is the taxonomic ID - includes attributes with relavant #' metadata #' @family taxonomic-ids #' @family nbn #' @seealso \code{\link[taxize]{classification}} #' #' @author Scott Chamberlain, \email{myrmecocystus@@gmail.com} #' #' @examples \dontrun{ #' get_nbnid(name='Poa annua') #' get_nbnid(name='Poa annua', rec_only=TRUE) #' get_nbnid(name='Poa annua', rank='Species') #' get_nbnid(name='Poa annua', rec_only=TRUE, rank='Species') #' get_nbnid(name='Pinus contorta') #' #' # The NBN service handles common names too #' get_nbnid(name='red-winged blackbird') #' #' # specify rows to limit choices available #' get_nbnid('Poa annua') #' get_nbnid('Poa annua', rows=1) #' get_nbnid('Poa annua', rows=25) #' get_nbnid('Poa annua', rows=1:2) #' #' # When not found #' get_nbnid(name="uaudnadndj") #' get_nbnid(c("Zootoca vivipara", "uaudnadndj")) #' get_nbnid(c("Zootoca vivipara","Chironomus riparius", "uaudnadndj")) #' #' # Convert an nbnid without class information to a nbnid class #' as.nbnid(get_nbnid("Zootoca vivipara")) # already a nbnid, returns the same #' as.nbnid(get_nbnid(c("Zootoca vivipara","Pinus contorta"))) # same #' as.nbnid('NHMSYS0001706186') # character #' # character vector, length > 1 #' as.nbnid(c("NHMSYS0001706186","NHMSYS0000494848","NBNSYS0000010867")) #' # list #' as.nbnid(list("NHMSYS0001706186","NHMSYS0000494848","NBNSYS0000010867")) #' ## dont check, much faster #' as.nbnid('NHMSYS0001706186', check=FALSE) #' as.nbnid(list("NHMSYS0001706186","NHMSYS0000494848","NBNSYS0000010867"), #' check=FALSE) #' #' (out <- as.nbnid(c("NHMSYS0001706186","NHMSYS0000494848", #' "NBNSYS0000010867"))) #' data.frame(out) #' as.nbnid( data.frame(out) ) #' #' # Get all data back #' get_nbnid_("Zootoca vivipara") #' get_nbnid_("Poa annua", rows=2) #' get_nbnid_("Poa annua", rows=1:2) #' get_nbnid_(c("asdfadfasd","Pinus contorta"), rows=1:5) #' #' # use curl options #' library("httr") #' get_nbnid("Quercus douglasii", config=verbose()) #' bb <- get_nbnid("Quercus douglasii", config=progress()) #' } get_nbnid <- function(name, ask = TRUE, verbose = TRUE, rec_only = FALSE, rank = NULL, rows = NA, ...){ assert(ask, "logical") assert(rec_only, "logical") assert(rank, "character") assert(verbose, "logical") fun <- function(name, ask, verbose, rows) { direct <- FALSE mssg(verbose, "\nRetrieving data for taxon '", name, "'\n") df <- nbn_search(q = name, rows = 500, ...)$data if (is.null(df) || length(df) == 0) df <- data.frame(NULL) mm <- NROW(df) > 1 rank_taken <- NA if (NROW(df) == 0) { mssg( verbose, "Not found. Consider checking the spelling or alternate classification") id <- NA_character_ att <- 'not found' } else { if (rec_only) df <- df[ df$taxonomicStatus == 'accepted', ] if (!is.null(rank)) df <- df[ tolower(df$rank) == tolower(rank), ] df <- sub_rows(df, rows) df <- df[,c('guid', 'scientificName', 'rank', 'taxonomicStatus')] names(df)[1] <- 'nbnid' id <- df$nbnid rank_taken <- as.character(df$rank) att <- 'found' } # not found on NBN if (length(id) == 0) { mssg( verbose, "Not found. Consider checking the spelling or alternate classification") id <- NA_character_ att <- 'not found' } # more than one found -> user input if (length(id) > 1) { if (ask) { rownames(df) <- seq_len(NROW(df)) # prompt message("\n\n") message("\nMore than one NBN ID found for taxon '", name, "'!\n Enter rownumber of taxon (other inputs will return 'NA'):\n") print(df) take <- scan(n = 1, quiet = TRUE, what = 'raw') if (length(take) == 0) { take <- 'notake' att <- 'nothing chosen' } if (take %in% seq_len(nrow(df))) { take <- as.numeric(take) message("Input accepted, took nbnid '", as.character(df$nbnid[take]), "'.\n") id <- as.character(df$nbnid[take]) rank_taken <- as.character(df$rank[take]) att <- 'found' } else { id <- NA_character_ att <- 'not found' mssg(verbose, "\nReturned 'NA'!\n\n") } } else{ if (length(id) != 1) { warning( sprintf("More than one NBN ID found for taxon '%s'; refine query or set ask=TRUE", name), call. = FALSE ) id <- NA_character_ att <- 'NA due to ask=FALSE & > 1 result' } } } list(id = id, rank = rank_taken, att = att, multiple = mm, direct = direct) } name <- as.character(name) out <- lapply(name, fun, ask = ask, verbose = verbose, rows = rows) ids <- pluck(out, "id", "") atts <- pluck(out, "att", "") ids <- structure(ids, class = "nbnid", match = atts, multiple_matches = pluck(out, "multiple", logical(1)), pattern_match = pluck(out, "direct", logical(1))) if ( !all(is.na(ids)) ) { urls <- sapply(out, function(z){ if (!is.na(z[['id']])) sprintf('https://species.nbnatlas.org/species/%s', z[['id']]) else NA }) attr(ids, 'uri') <- unlist(urls) } return(ids) } #' @export #' @rdname get_nbnid as.nbnid <- function(x, check=TRUE) UseMethod("as.nbnid") #' @export #' @rdname get_nbnid as.nbnid.nbnid <- function(x, check=TRUE) x #' @export #' @rdname get_nbnid as.nbnid.character <- function(x, check=TRUE) { if (length(x) == 1) { make_nbnid(x, check) } else { collapse(x, make_nbnid, "nbnid", check = check) } } #' @export #' @rdname get_nbnid as.nbnid.list <- function(x, check=TRUE) { if (length(x) == 1) { make_nbnid(x, check) } else { collapse(x, make_nbnid, "nbnid", check = check) } } #' @export #' @rdname get_nbnid as.nbnid.data.frame <- function(x, check=TRUE) { structure(x$ids, class = "nbnid", match = x$match, multiple_matches = x$multiple_matches, pattern_match = x$pattern_match, uri = x$uri) } #' @export #' @rdname get_nbnid as.data.frame.nbnid <- function(x, ...) { data.frame(ids = as.character(unclass(x)), class = "nbnid", match = attr(x, "match"), multiple_matches = attr(x, "multiple_matches"), pattern_match = attr(x, "pattern_match"), uri = attr(x, "uri"), stringsAsFactors = FALSE) } make_nbnid <- function(x, check=TRUE) { make_generic(x, 'https://species.nbnatlas.org/species/%s', "nbnid", check) } check_nbnid <- function(x){ url <- "https://species-ws.nbnatlas.org/species/" res <- GET(paste0(url, x)) if ( res$status_code == 200 ) TRUE else FALSE } #' @export #' @rdname get_nbnid get_nbnid_ <- function(name, verbose = TRUE, rec_only = FALSE, rank = NULL, rows = NA, ...) { stats::setNames(lapply(name, get_nbnid_help, verbose = verbose, rec_only = rec_only, rank = rank, rows = rows, ...), name) } get_nbnid_help <- function(name, verbose, rec_only, rank, rows, ...){ mssg(verbose, "\nRetrieving data for taxon '", name, "'\n") df <- nbn_search(q = name, all = TRUE, ...)$data if (is.null(df)) df <- data.frame(NULL) if (NROW(df) == 0) { NULL } else { if (rec_only) df <- df[ df$taxonomicStatus == 'accepted', ] if (!is.null(rank)) df <- df[ df$rank == rank, ] df <- df[,c('guid', 'scientificName', 'rank', 'taxonomicStatus')] if (NROW(df) == 0) NULL else sub_rows(df, rows) } } taxize/R/get_gbifid.R0000644000176200001440000002651013160767367014211 0ustar liggesusers#' Get the GBIF backbone taxon ID from taxonomic names. #' #' @export #' @param sciname character; scientific name. #' @param ask logical; should get_colid be run in interactive mode? #' If TRUE and more than one ID is found for the species, the user is asked for #' input. If FALSE NA is returned for multiple matches. #' @param verbose logical; If TRUE the actual taxon queried is printed on the console. #' @param rows numeric; Any number from 1 to infinity. If the default NA, all rows are considered. #' Note that this function still only gives back a gbifid class object with one to many identifiers. #' See \code{\link[taxize]{get_gbifid_}} to get back all, or a subset, of the raw data that you are #' presented during the ask process. #' @param phylum (character) A phylum (aka division) name. Optional. See \code{Filtering} #' below. #' @param class (character) A class name. Optional. See \code{Filtering} below. #' @param order (character) An order name. Optional. See \code{Filtering} below. #' @param family (character) A family name. Optional. See \code{Filtering} below. #' @param rank (character) A taxonomic rank name. See \code{\link{rank_ref}} for possible #' options. Though note that some data sources use atypical ranks, so inspect the #' data itself for options. Optional. See \code{Filtering} below. #' @param method (character) one of "backbone" or "lookup". See Details. #' @param x Input to \code{\link{as.gbifid}} #' @param check logical; Check if ID matches any existing on the DB, only used in #' \code{\link{as.gbifid}} #' @param ... Ignored #' @template getreturn #' #' @family taxonomic-ids #' @seealso \code{\link[taxize]{classification}} #' #' @author Scott Chamberlain, \email{myrmecocystus@@gmail.com} #' #' @details Internally in this function we use a function to search GBIF's taxonomy, #' and if we find an exact match we return the ID for that match. If there isn't an #' exact match we return the options to you to pick from. #' #' @section method parameter: #' "backbone" uses the \code{/species/match} GBIF API route, matching against their #' backbone taxonomy. We turn on fuzzy matching by default, as the search without #' fuzzy against backbone is quite narrow. "lookup" uses the \code{/species/search} #' GBIF API route, doing a full text search of name usages covering scientific #' and vernacular named, species descriptions, distributions and the entire #' classification. #' #' @section Filtering: #' The parameters \code{phylum}, \code{class}, \code{order}, \code{family}, and \code{rank} #' are not used in the search to the data provider, but are used in filtering the data down #' to a subset that is closer to the target you want. For all these parameters, #' you can use regex strings since we use \code{\link{grep}} internally to match. #' Filtering narrows down to the set that matches your query, and removes the rest. #' #' @examples \dontrun{ #' get_gbifid(sciname='Poa annua') #' get_gbifid(sciname='Pinus contorta') #' get_gbifid(sciname='Puma concolor') #' #' # multiple names #' get_gbifid(c("Poa annua", "Pinus contorta")) #' #' # specify rows to limit choices available #' get_gbifid(sciname='Pinus') #' get_gbifid(sciname='Pinus', rows=10) #' get_gbifid(sciname='Pinus', rows=1:3) #' #' # When not found, NA given #' get_gbifid(sciname="uaudnadndj") #' get_gbifid(c("Chironomus riparius", "uaudnadndj")) #' #' # Narrow down results to a division or rank, or both #' ## Satyrium example #' ### Results w/o narrowing #' get_gbifid("Satyrium") #' ### w/ phylum #' get_gbifid("Satyrium", phylum = "Tracheophyta") #' get_gbifid("Satyrium", phylum = "Arthropoda") #' ### w/ phylum & rank #' get_gbifid("Satyrium", phylum = "Arthropoda", rank = "genus") #' #' ## Rank example #' get_gbifid("Poa", method = "lookup") #' get_gbifid("Poa", method = "lookup", rank = "genus") #' get_gbifid("Poa", method = "lookup", family = "Thripidae") #' #' # Fuzzy filter on any filtering fields #' ## uses grep on the inside #' get_gbifid("Satyrium", phylum = "arthropoda") #' get_gbifid("A*", method = "lookup", order = "*tera") #' get_gbifid("A*", method = "lookup", order = "*ales") #' #' # Convert a uid without class information to a uid class #' as.gbifid(get_gbifid("Poa annua")) # already a uid, returns the same #' as.gbifid(get_gbifid(c("Poa annua","Puma concolor"))) # same #' as.gbifid(2704179) # numeric #' as.gbifid(c(2704179,2435099,3171445)) # numeric vector, length > 1 #' as.gbifid("2704179") # character #' as.gbifid(c("2704179","2435099","3171445")) # character vector, length > 1 #' as.gbifid(list("2704179","2435099","3171445")) # list, either numeric or character #' ## dont check, much faster #' as.gbifid("2704179", check=FALSE) #' as.gbifid(2704179, check=FALSE) #' as.gbifid(2704179, check=FALSE) #' as.gbifid(c("2704179","2435099","3171445"), check=FALSE) #' as.gbifid(list("2704179","2435099","3171445"), check=FALSE) #' #' (out <- as.gbifid(c(2704179,2435099,3171445))) #' data.frame(out) #' as.uid( data.frame(out) ) #' #' # Get all data back #' get_gbifid_("Puma concolor") #' get_gbifid_(c("Pinus", "uaudnadndj")) #' get_gbifid_(c("Pinus", "Puma"), rows=5) #' get_gbifid_(c("Pinus", "Puma"), rows=1:5) #' #' # use curl options #' library("httr") #' get_gbifid("Quercus douglasii", config=verbose()) #' bb <- get_gbifid("Quercus douglasii", config=progress()) #' } get_gbifid <- function(sciname, ask = TRUE, verbose = TRUE, rows = NA, phylum = NULL, class = NULL, order = NULL, family = NULL, rank = NULL, method = "backbone", ...) { assert(ask, "logical") assert(verbose, "logical") assert(phylum, "character") assert(class, "character") assert(order, "character") assert(family, "character") assert(rank, "character") assert(method, "character") fun <- function(sciname, ask, verbose, rows, ...) { direct <- FALSE mssg(verbose, "\nRetrieving data for taxon '", sciname, "'\n") df <- switch( method, backbone = gbif_name_backbone(sciname, ...), lookup = gbif_name_lookup(sciname, ...) ) mm <- NROW(df) > 1 if (is.null(df)) df <- data.frame(NULL) if (nrow(df) == 0) { mssg(verbose, "Not found. Consider checking the spelling or alternate classification") id <- NA_character_ att <- "not found" } else { names(df)[1] <- 'gbifid' id <- df$gbifid att <- "found" } # not found if (length(id) == 0) { mssg(verbose, "Not found. Consider checking the spelling or alternate classification") id <- NA_character_ att <- "not found" } # more than one found -> user input if (length(id) > 1) { # check for exact match matchtmp <- df[as.character(df$canonicalname) %in% sciname, "gbifid"] if (length(matchtmp) == 1) { id <- as.character(matchtmp) direct <- TRUE } else { if (!is.null(phylum) || !is.null(class) || !is.null(order) || !is.null(family) || !is.null(rank)) { df <- filt(df, "phylum", phylum) df <- filt(df, "class", class) df <- filt(df, "order", order) df <- filt(df, "family", family) df <- filt(df, "rank", rank) } df <- sub_rows(df, rows) if (NROW(df) == 0) { id <- NA_character_ att <- "not found" } else { id <- df$gbifid if (length(id) == 1) { rank_taken <- as.character(df$rank) att <- "found" } } if (length(id) > 1) { if (ask) { # limit to subset of columns for ease of use df <- df[, switch(method, backbone = gbif_cols_show_backbone, lookup = gbif_cols_show_lookup)] # prompt message("\n\n") message("\nMore than one GBIF ID found for taxon '", sciname, "'!\n Enter rownumber of taxon (other inputs will return 'NA'):\n") rownames(df) <- 1:nrow(df) print(df) take <- scan(n = 1, quiet = TRUE, what = 'raw') if (length(take) == 0) { take <- 'notake' att <- 'nothing chosen' } if (take %in% seq_len(nrow(df))) { take <- as.numeric(take) message("Input accepted, took gbifid '", as.character(df$gbifid[take]), "'.\n") id <- as.character(df$gbifid[take]) att <- "found" } else { id <- NA_character_ att <- "not found" mssg(verbose, "\nReturned 'NA'!\n\n") } } else { if (length(id) != 1) { warning( sprintf("More than one GBIF ID found for taxon '%s'; refine query or set ask=TRUE", sciname), call. = FALSE ) id <- NA_character_ att <- 'NA due to ask=FALSE & > 1 result' } } } } } list(id = id, att = att, multiple = mm, direct = direct) } out <- lapply(as.character(sciname), fun, ask, verbose, rows, ...) ids <- structure(as.character(unlist(pluck(out, "id"))), class = "gbifid", match = pluck(out, "att", ""), multiple_matches = pluck(out, "multiple", logical(1)), pattern_match = pluck(out, "direct", logical(1))) add_uri(ids, 'http://www.gbif.org/species/%s') } #' @export #' @rdname get_gbifid as.gbifid <- function(x, check=FALSE) UseMethod("as.gbifid") #' @export #' @rdname get_gbifid as.gbifid.gbifid <- function(x, check=FALSE) x #' @export #' @rdname get_gbifid as.gbifid.character <- function(x, check=TRUE) if(length(x) == 1) make_gbifid(x, check) else collapse(x, make_gbifid, "gbifid", check=check) #' @export #' @rdname get_gbifid as.gbifid.list <- function(x, check=TRUE) if(length(x) == 1) make_gbifid(x, check) else collapse(x, make_gbifid, "gbifid", check=check) #' @export #' @rdname get_gbifid as.gbifid.numeric <- function(x, check=TRUE) as.gbifid(as.character(x), check) #' @export #' @rdname get_gbifid as.gbifid.data.frame <- function(x, check = TRUE) { structure(x$ids, class = "gbifid", match = x$match, multiple_matches = x$multiple_matches, pattern_match = x$pattern_match, uri = x$uri) } #' @export #' @rdname get_gbifid as.data.frame.gbifid <- function(x, ...){ data.frame(ids = as.character(unclass(x)), class = "gbifid", match = attr(x, "match"), multiple_matches = attr(x, "multiple_matches"), pattern_match = attr(x, "pattern_match"), uri = attr(x, "uri"), stringsAsFactors = FALSE) } make_gbifid <- function(x, check=TRUE) make_generic(x, 'http://www.gbif.org/species/%s', "gbifid", check) check_gbifid <- function(x){ tryid <- tryCatch(gbif_name_usage(key = x), error = function(e) e) if ( "error" %in% class(tryid) && is.null(tryid$key) ) FALSE else TRUE } #' @export #' @rdname get_gbifid get_gbifid_ <- function(sciname, verbose = TRUE, rows = NA, method = "backbone"){ setNames(lapply(sciname, get_gbifd_help, verbose = verbose, rows = rows, method = method), sciname) } get_gbifd_help <- function(sciname, verbose, rows, method){ mssg(verbose, "\nRetrieving data for taxon '", sciname, "'\n") df <- switch( method, backbone = gbif_name_backbone(sciname), lookup = gbif_name_lookup(sciname) ) if (!is.null(df)) df <- nmslwr(df) sub_rows(df, rows) } taxize/R/tp_synonyms.R0000644000176200001440000000253312672106003014504 0ustar liggesusers#' Return all synonyms for a taxon name with a given id. #' #' @export #' @param id the taxon identifier code #' @param key Your Tropicos API key; loads from .Rprofile. #' @param ... Curl options passed on to \code{\link[httr]{GET}} #' @return List or dataframe. #' @examples \dontrun{ #' tp_synonyms(id = 25509881) #' } tp_synonyms <- function(id, key = NULL, ...) { url = sprintf('http://services.tropicos.org/Name/%s/Synonyms', id) key <- getkey(key, "tropicosApiKey") args <- tc(list(apikey = key, format = 'json')) tmp <- GET(url, query = args, ...) stop_for_status(tmp) tmp2 <- con_utf8(tmp) res <- jsonlite::fromJSON(tmp2, FALSE) if (names(res[[1]])[[1]] == "Error") { nonedf <- data.frame(nameid = "no syns found", scientificname = "no syns found", scientificnamewithauthors = "no syns found", family = "no syns found", stringsAsFactors = FALSE) list(accepted = nonedf, synonyms = nonedf) } else { dat <- lapply(res, function(x) lapply(x, data.frame, stringsAsFactors = FALSE)) accepted <- dat[[1]]$AcceptedName df <- do.call(rbind.fill, lapply(dat, "[[", "SynonymName")) synonyms <- df[!duplicated.data.frame(df), ] names(accepted) <- tolower(names(accepted)) names(synonyms) <- tolower(names(synonyms)) list(accepted = accepted, synonyms = synonyms) } } taxize/R/ubio_classification.R0000644000176200001440000000037412672106003016114 0ustar liggesusers#' uBio classification #' #' THIS FUNCTION IS DEFUNCT. #' #' @rdname ubio_classification-defunct #' @export #' @param ... Parameters, ignored ubio_classification <- function(...) { .Defunct(msg = "the uBio API is down, for good as far as we know") } taxize/R/ubio_classification_search.R0000644000176200001440000000053512672106003017440 0ustar liggesusers#' This function will return ClassificationBankIDs (hierarchiesIDs) that refer to the #' given NamebankID #' #' THIS FUNCTION IS DEFUNCT. #' #' @rdname ubio_classification_search-defunct #' @export #' @param ... Parameters, ignored ubio_classification_search <- function(...) { .Defunct(msg = "the uBio API is down, for good as far as we know") } taxize/R/itis_lsid.R0000644000176200001440000000205712771333143014075 0ustar liggesusers#' Get TSN from LSID #' #' @export #' @param lsid One or more lsid's #' @param what What to retrieve. One of tsn, record, or fullrecord #' @param ... Further arguments passed on to \code{\link[ritis]{lsid2tsn}}, #' \code{\link[ritis]{record}}, or \code{\link[ritis]{full_record}} #' @examples \dontrun{ #' # Get TSN #' itis_lsid("urn:lsid:itis.gov:itis_tsn:180543") #' itis_lsid(lsid=c("urn:lsid:itis.gov:itis_tsn:180543","urn:lsid:itis.gov:itis_tsn:28726")) #' #' # Get partial record #' itis_lsid("urn:lsid:itis.gov:itis_tsn:180543", "record") #' #' # Get full record #' itis_lsid("urn:lsid:itis.gov:itis_tsn:180543", "fullrecord") #' #' # An invalid lsid (a tsn actually) #' itis_lsid(202385) #' } itis_lsid <- function(lsid=NULL, what='tsn', ...) { temp <- switch( what, tsn = lapply(lsid, function(x) ritis::lsid2tsn(x, ...)), record = lapply(lsid, function(x) ritis::record(x, ...)), fullrecord = lapply(lsid, function(x) ritis::full_record(lsid = x, ...)) ) if (length(lsid) == 1) { temp[[1]] } else { setNames(temp, lsid) } } taxize/R/gbif_helpers.R0000644000176200001440000001057112714452560014545 0ustar liggesusers# name backbone gbif_name_backbone <- function(name, rank = NULL, kingdom = NULL, phylum = NULL, class = NULL, order = NULL, family = NULL, genus = NULL, strict = FALSE, start = NULL, limit = 500, ...) { url = 'http://api.gbif.org/v1/species/match' args <- tc(list(name = name, rank = rank, kingdom = kingdom, phylum = phylum, class = class, order = order, family = family, genus = genus, strict = strict, verbose = TRUE, offset = start, limit = limit)) temp <- GET(url, query = args, ...) stop_for_status(temp) tt <- jsonlite::fromJSON(con_utf8(temp), FALSE) if (all(names(tt) %in% c('confidence', 'synonym', 'matchType'))) { data.frame(NULL) } else { dd <- data.table::setDF( data.table::rbindlist( lapply(tt$alternatives, function(x) lapply(x, function(x) if (length(x) == 0) NA else x)), use.names = TRUE, fill = TRUE)) dat <- data.frame(tt[!names(tt) %in% c("alternatives", "note")], stringsAsFactors = FALSE) if (!all(names(dat) %in% c('confidence', 'synonym', 'matchType'))) { dd <- rbind.fill(dat, dd) } if (limit > 0) { dd <- cols_move(dd, back_cols_use) } if (!is.null(dd)) dd$rank <- tolower(dd$rank) names(dd) <- tolower(names(dd)) return(dd) } } # name lookup gbif_name_lookup <- function(query = NULL, rank = NULL, higherTaxonKey = NULL, status = NULL, nameType = NULL, datasetKey = 'd7dddbf4-2cf0-4f39-9b2a-bb099caae36c', limit = 500, start = NULL, ...) { url = 'http://api.gbif.org/v1/species/search' args <- tc(list(q = query, rank = rank, higherTaxonKey = higherTaxonKey, status = status, nameType = nameType, datasetKey = datasetKey, limit = limit, offset = start)) temp <- GET(url, query = args, ...) stop_for_status(temp) tt <- jsonlite::fromJSON(con_utf8(temp), FALSE) dd <- data.table::setDF( data.table::rbindlist(lapply( tt$results, nlkupcleaner), use.names = TRUE, fill = TRUE) ) if (limit > 0) { dd <- cols_move(dd, gbif_cols_use) } if (!is.null(dd)) dd$rank <- tolower(dd$rank) names(dd) <- tolower(names(dd)) return(dd) } cols_move <- function (x, cols) { other <- names(x)[!names(x) %in% cols] x[, c(cols, other)] } nlkupcleaner <- function (x) { tmp <- x[!names(x) %in% c("descriptions", "vernacularNames", "higherClassificationMap")] lapply(tmp, function(x) { if (length(x) == 0) { NA } else if (length(x) > 1 || is(x, "list")) { paste0(x, collapse = ", ") } else { x } }) } gbif_cols_use <- c("key", "canonicalName", "authorship", "rank", "taxonomicStatus", "synonym") back_cols_use <- c("usageKey", "scientificName", "rank", "status", "matchType") gbif_cols_show_backbone <- tolower(c("gbifid", "scientificName", "rank", "status", "matchtype")) gbif_cols_show_lookup <- tolower(c("gbifid", "canonicalName", "authorship", "rank", "taxonomicStatus", "synonym")) # gbif_name_suggest <- function(q=NULL, datasetKey=NULL, rank=NULL, fields=NULL, start=NULL, # limit=50, ...) { # # url = 'http://api.gbif.org/v1/species/suggest' # args <- tc(list(q = q, rank = rank, offset = start, limit = limit)) # temp <- GET(url, query = argsnull(args), ...) # stop_for_status(temp) # tt <- jsonlite::fromJSON(con_utf8(temp), FALSE) # if (is.null(fields)) { # toget <- c("key", "scientificName", "rank") # } else { # toget <- fields # } # matched <- sapply(toget, function(x) x %in% gbif_suggestfields()) # if (!any(matched)) { # stop(sprintf("the fields %s are not valid", paste0(names(matched[matched == FALSE]), collapse = ","))) # } # out <- lapply(tt, function(x) x[names(x) %in% toget]) # df <- do.call(rbind.fill, lapply(out, data.frame)) # if (!is.null(df)) df$rank <- tolower(df$rank) # df # } # # gbif_suggestfields <- function() { # c("key", "datasetTitle", "datasetKey", "nubKey", "parentKey", "parent", # "kingdom", "phylum", "clazz", "order", "family", "genus", "species", # "kingdomKey", "phylumKey", "classKey", "orderKey", "familyKey", "genusKey", # "speciesKey", "scientificName", "canonicalName", "authorship", # "accordingTo", "nameType", "taxonomicStatus", "rank", "numDescendants", # "numOccurrences", "sourceId", "nomenclaturalStatus", "threatStatuses", # "synonym") # } taxize/R/rankagg.R0000644000176200001440000000243113037714443013522 0ustar liggesusers#' Aggregate data by given taxonomic rank #' #' @export #' @param data A data.frame. Column headers must have capitalized ranks (e.g., #' Genus, Tribe, etc.) (data.frame) #' @param datacol The data column (character) #' @param rank Taxonomic rank to aggregate by (character) #' @param fxn Arithmetic function or vector or functions (character) #' @examples #' library("vegan") #' data(dune.taxon, package='vegan') #' dat <- dune.taxon #' set.seed(1234) #' dat$abundance <- round(rlnorm(n=nrow(dat),meanlog=5,sdlog=2),0) #' rankagg(data=dat, datacol="abundance", rank="Genus") #' rankagg(data=dat, "abundance", rank="Family") #' rankagg(data=dat, "abundance", rank="Genus", fxn="mean") #' rankagg(data=dat, "abundance", rank="Subclass") #' rankagg(data=dat, "abundance", rank="Subclass", fxn="sd") rankagg <- function(data=NULL, datacol=NULL, rank=NULL, fxn="sum") { if (is.null(data) | is.null(rank)) stop("You must specify your data.frame and taxonomic rank") rank <- match.arg(rank, choices = c('Species', 'Genus', 'Tribe', 'Family', 'Order', 'Subclass', 'Class', 'Phylum', 'Kingdom')) fn <- match.fun(fxn) out <- aggregate(data[ , datacol], list(data[ , rank]), fxn) names(out) = c(rank, fxn) return(out) } taxize/R/apg.R0000644000176200001440000000566612672106003012663 0ustar liggesusers#' Get APG names #' #' Generic names and their replacements from the Angiosperm Phylogeny #' Group III system of flowering plant classification. #' #' @param ... Curl args passed on to \code{\link[httr]{GET}} #' @references \url{http://www.mobot.org/MOBOT/research/APweb/} #' @name apg #' @examples \dontrun{ #' head(apgOrders()) #' head(apgFamilies()) #' } #' @export #' @rdname apg apgOrders <- function(...) { tt <- apg_GET("orders", ...) tmp <- strsplit(tt, "")[[1]] tmp3 <- gsub("(<[^>]*>)|\r|\n|\\.$", "", tmp2) # remove stuff not cleaned up tmp4 <- tmp3[-grep("Back to", tmp3)] tmp5 <- sub(".*>", "", tmp4) # parse to a data.frame accorig <- acc <- grep("[Aa]ccepted", tmp5, value = TRUE) acc <- gsub("\\s.+", "", strtrim(acc)) acc <- acc[nchar(acc) != 0] accorig <- accorig[nchar(accorig) != 0] accdf <- data.frame(order = acc, synonym = NA, accepted = TRUE, original = accorig, stringsAsFactors = FALSE) synorig <- syn <- grep("[Aa]ccepted", tmp5, invert = TRUE, value = TRUE) syn <- sapply(strsplit(syn, "=|\\s-"), strtrim) syn <- syn[vapply(syn, length, 1) != 0] synorig <- synorig[nchar(synorig) != 0] syndf <- rbind.fill(lapply(syn, function(x) { tmpdf <- rbind.data.frame(x) if (NCOL(tmpdf) == 2) { setNames(tmpdf, c("order", "synonym")) } else { setNames(tmpdf, c("order", "synonym", "comment")) } })) syndf$accepted <- FALSE syndf$original <- synorig rbind(accdf, syndf) } #' @export #' @rdname apg apgFamilies <- function(...) { tt <- apg_GET("families", ...) tmp <- strsplit(tt, "| tag, and split tmp2 <- unlist(lapply(tmp2, function(z) { if (grepl("\r", z)) { dd <- strsplit(z, "\r\n")[[1]] dd[nchar(dd) != 0] } else { z } })) # remove html tags tmp3 <- gsub("(<[^>]*>)|\r|\n|\\.$", "", tmp2) # remove stuff not cleaned up tmp4 <- tmp3[-grep("Back to", tmp3)] tmp5 <- sub(".*>", "", tmp4) # parse to a data.frame syn <- sapply(strsplit(tmp5, "=|\\s-"), strtrim) syn <- syn[vapply(syn, length, 1) != 0] synorig <- tmp5[nchar(tmp5) != 0] syndf <- rbind.fill(lapply(syn, function(x) { tmpdf <- rbind.data.frame(x) if (NCOL(tmpdf) == 2) { setNames(tmpdf, c("family", "order")) } else { setNames(tmpdf, c("family", "synonym", "order")) } })) syndf[] <- lapply(syndf, as.character) syndf$accepted <- syndf$synonym syndf$accepted[is.na(syndf$accepted)] <- TRUE syndf$accepted[ syndf$accepted != TRUE ] <- FALSE syndf$accepted <- as.logical(syndf$accepted) syndf$original <- synorig syndf } apg_GET <- function(x, ...) { res <- GET(paste0(apg_base(), sprintf("top/synonymy%s.html", x)), ...) stop_for_status(res) con_utf8(res) } apg_base <- function() "http://www.mobot.org/MOBOT/research/APweb/" taxize/R/eol_pages.R0000644000176200001440000001070713033776645014063 0ustar liggesusers#' Search for pages in EOL database using a taxonconceptID. #' #' @export #' @param taxonconceptID The taxonconceptID (numeric), which is also the page #' number. #' @param iucn Include the IUCN Red List status object (Default: \code{FALSE}) #' @param images Limits the number of returned image objects (values 0 - 75) #' @param videos Limits the number of returned video objects (values 0 - 75) #' @param sounds Limits the number of returned sound objects (values 0 - 75) #' @param maps Limits the number of returned map objects (values 0 - 75) #' @param text Limits the number of returned text objects (values 0 - 75) #' @param subjects 'overview' (default) to return the overview text #' (if exists), a pipe | delimited list of subject names from the list of EOL #' accepted subjects (e.g. TaxonBiology, FossilHistory), or 'all' to get text #' in any subject. Always returns an overview text as a first result (if one #' exists in the given context). #' @param licenses A pipe | delimited list of licenses or 'all' (default) to #' get objects under any license. Licenses abbreviated cc- are all Creative #' Commons licenses. Visit their site for more information on the various #' licenses they offer. #' @param details Include all metadata for data objects. (Default: \code{FALSE}) #' @param common_names Return all common names for the page's taxon #' (Default: \code{FALSE}) #' @param synonyms Return all synonyms for the page's taxon #' (Default: \code{FALSE}) #' @param references Return all references for the page's taxon #' (Default: \code{FALSE}) #' @param taxonomy (logical) Whether to return any taxonomy details from #' different taxon hierarchy providers, in an array named \code{taxonconcepts} #' (Default: \code{TRUE}) #' @param vetted If 'vetted' is given a value of '1', then only trusted #' content will be returned. If 'vetted' is '2', then only trusted and #' unreviewed content will be returned (untrusted content will not be returned). #' The default is to return all content. (Default: \code{FALSE}) #' @param cache_ttl The number of seconds you wish to have the response cached. #' @param key Your EOL API key; loads from .Rprofile, or you can specify the #' key manually the in the function call. #' @param ... Curl options passed on to \code{\link[httr]{GET}} #' @details It's possible to return JSON or XML with the EOL API. However, #' this function only returns JSON for now. #' @return JSON list object, or data.frame. #' @examples \dontrun{ #' (pageid <- eol_search('Pomatomus')$pageid[1]) #' eol_pages(taxonconceptID=pageid)$scinames #' } eol_pages <- function(taxonconceptID, iucn=FALSE, images=0, videos=0, sounds=0, maps=0, text=0, subjects='overview', licenses='all', details=FALSE, common_names=FALSE, synonyms=FALSE, references=FALSE, taxonomy=TRUE, vetted=0, cache_ttl=NULL, key = NULL, ...) { iucn <- tolower(iucn) details <- tolower(details) common_names <- tolower(common_names) synonyms <- tolower(synonyms) references <- tolower(references) key <- getkey(key, "eolApiKey") args <- tc(list(iucn=iucn,images=images,videos=videos,sounds=sounds, maps=maps,text=text,subjects=subjects,licenses=licenses, details=details,common_names=common_names,synonyms=synonyms, references=references,taxonomy=taxonomy, vetted=vetted,cache_ttl=cache_ttl, key=key)) tt <- GET(file.path(eol_url("pages"), paste0(taxonconceptID, ".json")), query=argsnull(args), ...) stop_for_status(tt) stopifnot(tt$headers$`content-type` == "application/json; charset=utf-8") res <- jsonlite::fromJSON(con_utf8(tt), FALSE) scinames <- do.call(rbind.fill, lapply(res$taxonConcepts, data.frame, stringsAsFactors=FALSE)) if (!is.null(scinames)) { names(scinames) <- tolower(names(scinames)) scinames$taxonrank <- tolower(scinames$taxonrank) } syns <- parseeoldata('synonyms', res) names(syns) <- tolower(names(syns)) vernac <- parseeoldata('vernacularNames', res) names(vernac) <- tolower(names(vernac)) refs <- parseeoldata('references', res) names(refs) <- "references" dataobj <- parseeoldata('dataObjects', res) names(dataobj) <- tolower(names(dataobj)) list(scinames=scinames, syns=syns, vernac=vernac, refs=refs, dataobj=dataobj) } parseeoldata <- function(x, y){ xx <- y[[x]] if (length(xx) == 0) { "no data" } else { tmp <- lapply(xx, data.frame) if (length(tmp) == 1) { tmp[[1]] } else { ldply(tmp) } } } taxize/R/ipni_search.R0000644000176200001440000001207612744703273014405 0ustar liggesusers#' Search for names in the International Plant Names Index (IPNI). #' #' Note: This data source is also provided in the Global Names Index (GNI) #' (http://gni.globalnames.org/data_sources). The interface to the data is different among the two #' services though. #' #' @export #' @param family Family name to search on (Optional) #' @param infrafamily Infrafamilial name to search on (Optional) #' @param genus Genus name to search on (Optional) #' @param infragenus Infrageneric name to search on (Optional) #' @param species Species name to search on (Optional) - Note, this is the epithet, not the full #' genus - epithet name combination. #' @param infraspecies Infraspecies name to search on (Optional) #' @param publicationtitle Publication name or abbreviation to search on. Again, replace any #' spaces with a '+' (e.g. 'J.+Bot.') (Optional) #' @param authorabbrev Author standard form to search on (publishing author, basionym author #' or both - see below) (Optional) #' @param includepublicationauthors TRUE (default) to include the taxon author in the search #' or FALSE to exclude it #' @param includebasionymauthors TRUE (default) to include the basionum author in the search #' or FALSE to exclude it #' @param geounit Country name or other geographical unit to search on (see the help pages #' for more information and warnings about the use of this option) (Optional) #' @param addedsince Date to search on in the format 'yyyy-mm-dd', e.g. 2005-08-01 for all #' records added since the first of August, 2005. (see the help pages for more information and #' warnings about the use of this option) (Optional. If supplied must be in format YYYY-MM-DD and #' must be greater than or equal to 1984-01-01.) #' @param modifiedsince Date to search on in the format 'yyyy-mm-dd', e.g. 2005-08-01 for #' all records edited since the first of August, 2005. (See the help pages for more information #' about the use of this option) (Optional. If supplied must be in format YYYY-MM-DD and must #' be greater than or equal to 1993-01-01.) #' @param isapnirecord FALSE (default) to exclude records from the Australian Plant Name Index #' @param isgcirecord FALSE (default) to exclude records from the Gray Cards Index #' @param isikrecord FALSE (default) to exclude records from the Index Kewensis #' @param ranktoreturn One of a few options to choose the ranks returned. See details. #' @param output One of minimal (default), classic, short, or extended #' @param ... Curl options passed on to \code{\link[httr]{GET}} #' (Optional). Default: returns all ranks. #' @references http://www.ipni.org/link_to_ipni.html #' @details #' \code{rankToReturn} options: #' \itemize{ #' \item #' \item "all" - all records #' \item "fam" - family records #' \item "infrafam" - infrafamilial records #' \item "gen" - generic records #' \item "infragen" - infrageneric records #' \item "spec" - species records #' \item "infraspec" - infraspecific records #' } #' @return A data frame #' @examples \dontrun{ #' ipni_search(genus='Brintonia', isapnirecord=TRUE, isgcirecord=TRUE, isikrecord=TRUE) #' head(ipni_search(genus='Ceanothus')) #' head(ipni_search(genus='Pinus', species='contorta')) #' #' # Different output formats #' head(ipni_search(genus='Ceanothus')) #' head(ipni_search(genus='Ceanothus', output='short')) #' head(ipni_search(genus='Ceanothus', output='extended')) #' } ipni_search <- function(family=NULL, infrafamily=NULL, genus=NULL, infragenus=NULL, species=NULL, infraspecies=NULL, publicationtitle=NULL, authorabbrev=NULL, includepublicationauthors=NULL, includebasionymauthors=NULL, geounit=NULL, addedsince=NULL, modifiedsince=NULL, isapnirecord=NULL, isgcirecord=NULL, isikrecord=NULL, ranktoreturn=NULL, output="minimal", ...) { output <- match.arg(output, c('minimal','classic','short','extended'), FALSE) output_format <- sprintf('delimited-%s', output) url <- "http://www.ipni.org/ipni/advPlantNameSearch.do" args <- tc(list(output_format=output_format, find_family=family, find_infrafamily=infrafamily, find_genus=genus, find_infragenus=infragenus, find_species=species, find_infraspecies=infraspecies, find_publicationTitle=publicationtitle, find_authorAbbrev=authorabbrev, find_includePublicationAuthors=l2(includepublicationauthors), find_includebasionymauthors=l2(includebasionymauthors), find_geounit=geounit, find_addedSince=addedsince, find_modifiedSince=modifiedsince, find_isAPNIRecord=l2(isapnirecord), find_isGCIRecord=l2(isgcirecord), find_isIKRecord=l2(isikrecord), rankToReturn=ranktoreturn)) tt <- GET(url, query = args, ...) if (tt$status_code > 200 || tt$headers$`content-type` != "text/plain;charset=UTF-8") { stop("No results", call. = FALSE) } res <- con_utf8(tt) if (nchar(res, keepNA = FALSE) == 0) { warning("No data found") df <- NA } else { df <- read.delim(text = res, sep = "%", stringsAsFactors = FALSE) names(df) <- gsub("\\.", "_", tolower(names(df))) } return( df ) } l2 <- function(x) { if (!is.null(x)) { if (x) { "on" } else { "off" } } else{ NULL } } taxize/R/sci2comm.R0000644000176200001440000001477713142670764013650 0ustar liggesusers#' Get common names from scientific names. #' #' @export #' @param scinames character; One or more scientific names or partial names. #' @param db character; Data source, one of \emph{"eol"} (default), #' \emph{"itis"} \emph{"ncbi"}, \emph{"worms"}, or \emph{"iucn"}. Note that #' each taxonomic data source has their own identifiers, so that if you #' provide the wrong \code{db} value for the identifier you could get a #' result, but it will likely be wrong (not what you were expecting). #' @param simplify (logical) If TRUE, simplify output to a vector of names. #' If FALSE, return variable formats from different sources, usually a #' data.frame. Only applies to eol and itis. Specify \code{FALSE} to obtain #' the language of each vernacular in the output for eol and itis. #' @param ... Further arguments passed on to functions #' \code{\link[taxize]{get_uid}}, \code{\link[taxize]{get_tsn}}. #' @param id character; identifiers, as returned by #' \code{\link[taxize]{get_tsn}}, \code{\link[taxize]{get_uid}}. #' #' @details Note that EOL requires an API key. You can pass in your EOL api #' key in the function call like #' \code{sci2comm('Helianthus annuus', key="")}. You can #' also store your EOL API key in your .Rprofile file as #' \code{options(eolApiKey = "")}, or just for the current #' session by running \code{options(eolApiKey = "")} in #' the console. #' #' Note that IUCN also requires an API key. See #' \code{\link[rredlist]{rredlist-package}} for help on authentiating with #' IUCN Redlist #' #' @return List of character vectors, named by input taxon name, or taxon ID #' #' @seealso \code{\link[taxize]{comm2sci}} #' #' @author Scott Chamberlain (myrmecocystus@@gmail.com) #' #' @examples \dontrun{ #' sci2comm(scinames='Helianthus annuus', db='eol') #' sci2comm(scinames='Helianthus annuus', db='itis') #' sci2comm(scinames=c('Helianthus annuus', 'Poa annua')) #' sci2comm(scinames='Puma concolor', db='ncbi') #' sci2comm('Gadus morhua', db='worms') #' sci2comm('Pomatomus saltatrix', db='worms') #' sci2comm('Loxodonta africana', db='iucn') #' #' # Passing id in, works for sources: itis and ncbi, not eol #' sci2comm(get_tsn('Helianthus annuus')) #' sci2comm(get_uid('Helianthus annuus')) #' sci2comm(get_wormsid('Gadus morhua')) #' sci2comm(get_iucn('Loxodonta africana')) #' #' # Don't simplify returned #' sci2comm(get_tsn('Helianthus annuus'), simplify=FALSE) #' sci2comm(get_iucn('Loxodonta africana'), simplify=FALSE) #' #' # Use curl options #' library("httr") #' sci2comm('Helianthus annuus', db="ncbi", config=verbose()) #' } #' @rdname sci2comm sci2comm <- function(...){ UseMethod("sci2comm") } #' @method sci2comm default #' @export #' @rdname sci2comm sci2comm.default <- function(scinames, db='eol', simplify=TRUE, ...) { temp <- lapply(scinames, getsci, db = db, simplify = simplify, ...) stats::setNames(temp, scinames) } #' @export #' @rdname sci2comm sci2comm.uid <- function(id, ...) { out <- lapply(id, function(x) ncbi_foo(x, ...)) names(out) <- id return(out) } #' @export #' @rdname sci2comm sci2comm.tsn <- function(id, simplify=TRUE, ...) { out <- lapply(id, function(x) itis_foo(x, simplify, ...)) names(out) <- id return(out) } #' @export #' @rdname sci2comm sci2comm.wormsid <- function(id, simplify=TRUE, ...) { out <- lapply(id, function(x) worms_foo(x, simplify, ...)) names(out) <- id return(out) } #' @export #' @rdname sci2comm sci2comm.iucn <- function(id, simplify=TRUE, ...) { #out <- lapply(id, function(x) iucn_foo(x, simplify, ...)) out <- vector("list", length(id)) for (i in seq_along(id)) { out[[i]] <- iucn_foo(attr(id, "name")[i], simplify, ...) } names(out) <- id return(out) } itis2comm <- function(x, simplify, ...){ tsn <- get_tsn(x, ...) itis_foo(tsn, simplify = simplify, ...) } eol2comm <- function(x, simplify, ...){ tmp <- eol_search(terms = x, ...) pageids <- tmp[grep(x, tmp$name, ignore.case = TRUE), "pageid"] dfs <- tc( lapply(pageids, function(x) { tmp <- tryCatch( eol_pages(taxonconceptID = x, common_names = TRUE, ...), error = function(e) e ) if (inherits(tmp, "error")) NULL else tmp$vernac }) ) tt <- ldply(dfs[sapply(dfs, class) == "data.frame"]) tt <- tt[!duplicated(tt), ] if (simplify) { ss <- as.character(tt$vernacularname) ss[ !is.na(ss) ] } else{ tt } } ncbi2comm <- function(x, ...){ uid <- get_uid(x, ...) ncbi_foo(uid, ...) } worms2comm <- function(x, simplify, ...){ id <- get_wormsid(x, ...) worms_foo(id, simplify = simplify, ...) } iucn2comm <- function(x, simplify, ...){ id <- get_iucn(x, ...) iucn_foo(attr(id, "name"), simplify = simplify, ...) } getsci <- function(nn, db, simplify, ...){ switch( db, eol = eol2comm(nn, simplify, ...), itis = itis2comm(nn, simplify, ...), ncbi = ncbi2comm(nn, ...), worms = worms2comm(nn, simplify, ...), iucn = iucn2comm(nn, simplify, ...) ) } itis_foo <- function(x, simplify=TRUE, ...){ # if tsn is not found if (is.na(x)) { out <- NA } else { out <- ritis::common_names(x) #if common name is not found if (nrow(out) == 0) { out <- NA } } if (simplify) { if (!inherits(out, "tbl_df")) out else as.character(out$commonName) } else{ out } } ncbi_foo <- function(x, ...){ baseurl <- paste0(ncbi_base(), "/entrez/eutils/efetch.fcgi?db=taxonomy") ID <- paste("ID=", x, sep = "") searchurl <- paste(baseurl, ID, sep = "&") tt <- GET(searchurl, ...) stop_for_status(tt) res <- con_utf8(tt) ttp <- xml2::read_xml(res) # common name out <- xml_text(xml_find_all(ttp, "//TaxaSet/Taxon/OtherNames/GenbankCommonName")) # NCBI limits requests to three per second Sys.sleep(0.33) return(out) } worms_foo <- function(x, simplify=TRUE, ...){ # if id is not found if (is.na(x)) { out <- NA } else { out <- worrms::wm_common_id(as.numeric(x)) #if common name is not found if (nrow(out) == 0) { out <- NA } } if (simplify) { if (!inherits(out, "tbl_df")) out else as.character(out$vernacular) } else{ out } } iucn_foo <- function(x, simplify=TRUE, ...){ # if id is not found if (is.na(x)) { out <- NA } else { out <- rredlist::rl_common_names(name = x, ...) # if common name is not found if (NROW(out$result) == 0) { out <- NA } } if (simplify) { if (!inherits(out$result, "data.frame")) { out$result } else { as.character(out$result$taxonname) } } else{ out$result } } taxize/R/gbif_parse.R0000644000176200001440000000261513002447752014213 0ustar liggesusers#' Parse taxon names using the GBIF name parser. #' #' @export #' @param scientificname (character) scientific names #' @param ... Further args passed on to \code{\link[httr]{POST}} #' @return A \code{data.frame} containing fields extracted from parsed #' taxon names. Fields returned are the union of fields extracted from #' all species names in \code{scientificname}. #' @author John Baumgartner (johnbb@@student.unimelb.edu.au) #' @references \url{http://tools.gbif.org/nameparser/api.do} #' @seealso \code{\link{gni_parse}} #' @examples \dontrun{ #' gbif_parse(scientificname='x Agropogon littoralis') #' gbif_parse(c('Arrhenatherum elatius var. elatius', #' 'Secale cereale subsp. cereale', 'Secale cereale ssp. cereale', #' 'Vanessa atalanta (Linnaeus, 1758)')) #' } gbif_parse <- function(scientificname, ...) { url <- "http://api.gbif.org/v1/parser/name" tt <- POST(url, config = c(add_headers('Content-Type' = 'application/json')), body = jsonlite::toJSON(scientificname), ...) stop_for_status(tt) stopifnot(tt$headers$`content-type` == 'application/json') res <- jsonlite::fromJSON(con_utf8(tt), FALSE) res <- lapply(res, function(x) Map(function(z) if (is.null(z)) NA else z, x)) (tmp <- data.table::setDF( data.table::rbindlist(res, fill = TRUE, use.names = TRUE))) setNames(tmp, tolower(names(tmp))) } taxize/R/ncbi_getbyname.R0000644000176200001440000000117112672106003015045 0ustar liggesusers#' Retrieve gene sequences from NCBI by taxon name and gene names. #' #' THIS FUNCTION IS DEFUNCT. #' #' @export #' @author Scott Chamberlain \email{myrmecocystus@@gmail.com} #' @rdname ncbi_getbyname-defunct #' @keywords internal ncbi_getbyname <- function(...) { .Defunct("ncbi_byname", "traits", msg = "This function is defunct. See traits::ncbi_byname()") } #' Retrieve gene sequences from NCBI by accession number. #' #' THIS FUNCTION IS DEFUNCT. #' #' @export #' @keywords internal #' @rdname get_seqs-defunct get_seqs <- function(...) { .Defunct("ncbi_getbyname", "taxize", "Function name changed. See ncbi_getbyname") } taxize/R/get-id-details.R0000644000176200001440000000621113160515651014701 0ustar liggesusers#' @title Details on \code{get_*()} functions #' @description Including outputs from \code{get_*()} functions, as well as #' their attributes, and all exception behaviors. #' #' @name get_id_details #' #' @details This document applies to the following functions: #' \itemize{ #' \item \code{\link{get_boldid}} #' \item \code{\link{get_colid}} #' \item \code{\link{get_eolid}} #' \item \code{\link{get_gbifid}} #' \item \code{\link{get_ids}} #' \item \code{\link{get_iucn}} #' \item \code{\link{get_natservid}} #' \item \code{\link{get_nbnid}} #' \item \code{\link{get_tolid}} #' \item \code{\link{get_tpsid}} #' \item \code{\link{get_tsn}} #' \item \code{\link{get_ubioid}} #' \item \code{\link{get_uid}} #' \item \code{\link{get_wiki}} #' \item \code{\link{get_wormsid}} #' } #' #' @section attributes: #' Each output from \code{get_*()} functions have the following attributes: #' #' \itemize{ #' \item \emph{match} (character) - the reason for NA, either 'not found', #' 'found' or if \code{ask = FALSE} then 'NA due to ask=FALSE') #' \item \emph{multiple_matches} (logical) - Whether multiple matches were #' returned by the data source. This can be \code{TRUE}, even if you get 1 #' name back because we try to pattern match the name to see if there's any #' direct matches. So sometimes this attribute is \code{TRUE}, as well as #' \code{pattern_match}, which then returns 1 resulting name without user #' prompt. #' \item \emph{pattern_match} (logical) - Whether a pattern match was made. #' If \code{TRUE} then \code{multiple_matches} must be \code{TRUE}, and we #' found a perfect match to your name, ignoring case. If \code{FALSE}, #' there wasn't a direct match, and likely you need to pick from many choices #' or further parameters can be used to limit results #' \item \emph{uri} (character) - The URI where more information can be #' read on the taxon - includes the taxonomic identifier in the URL somewhere. #' This may be missing if the value returned is \code{NA} #' } #' #' @section exceptions: #' The following are the various ways in which \code{get_*()} functions #' behave: #' #' \itemize{ #' \item success - the value returned is a character string or numeric #' \item no matches found - you'll get an NA, refine your search or #' possible the taxon searched for does not exist in the database you're #' using #' \item more than on match and ask = FALSE - if there's more than one #' matching result, and you have set \code{ask = FALSE}, then we can't #' determine the single match to return, so we give back \code{NA}. #' However, in this case we do set the \code{match} attribute to say #' \code{NA due to ask=FALSE & > 1 result} so it's very clear what #' happened - and you can even programatically check this as well #' \item NA due to some other reason - some \code{get_*()} functions #' have additional parameters for filtering taxa. It's possible that even #' though there's results (that is, \code{found} will say \code{TRUE}), #' you can get back an NA. This is most likely if the parameter filters #' taxa after they are returned from the data provider and the value passed #' to the parameter leads to no matches. #' } NULL taxize/R/globals.R0000644000176200001440000000016112672032225013524 0ustar liggesusersif(getRversion() >= "2.15.1") utils::globalVariables(c('apg_families','apg_orders','rank_ref','theplantlist')) taxize/R/get_eolid.R0000644000176200001440000002746613160764227014064 0ustar liggesusers#' Get the EOL ID from Encyclopedia of Life from taxonomic names. #' #' Note that EOL doesn't expose an API endpoint for directly querying for EOL #' taxon ID's, so we first use the function \code{\link[taxize]{eol_search}} #' to find pages that deal with the species of interest, then use #' \code{\link[taxize]{eol_pages}} to find the actual taxon IDs. #' #' @export #' @param sciname character; scientific name. #' @param ask logical; should get_eolid be run in interactive mode? #' If TRUE and more than one ID is found for the species, the user is asked for #' input. If FALSE NA is returned for multiple matches. #' @param key API key. passed on to \code{\link{eol_search}} and #' \code{\link{eol_pages}} internally #' @param ... Further args passed on to \code{\link{eol_search}} #' @param verbose logical; If \code{TRUE} the actual taxon queried is printed #' on the console. #' @param rows numeric; Any number from 1 to infinity. If the default NA, all #' rows are considered. Note that this function still only gives back a eolid #' class object with one to many identifiers. See #' \code{\link[taxize]{get_eolid_}} to get back all, or a subset, of the raw #' data that you are presented during the ask process. #' @param x Input to \code{\link{as.eolid}} #' @param check logical; Check if ID matches any existing on the DB, only #' used in \code{\link{as.eolid}} #' @template getreturn #' #' @family taxonomic-ids #' @seealso \code{\link[taxize]{classification}} #' #' @author Scott Chamberlain, \email{myrmecocystus@@gmail.com} #' #' @details EOL is a bit odd in that they have page IDs for each taxon, but #' then within that, they have taxon ids for various taxa within that page #' (e.g., GBIF and NCBI each have a taxon they refer to within the #' page [i.e., taxon]). And we need the taxon ids from a particular data #' provider (e.g, NCBI) to do other things, like get a higher classification #' tree. However, humans want the page id, not the taxon id. So, the #' id returned from this function is the taxon id, not the page id. You can #' get the page id for a taxon by using \code{\link{eol_search}} and #' \code{\link{eol_pages}}, and the URI returned in the attributes for a #' taxon will lead you to the taxon page, and the ID in the URL is the #' page id. #' #' @examples \dontrun{ #' get_eolid(sciname='Pinus contorta') #' get_eolid(sciname='Puma concolor') #' #' get_eolid(c("Puma concolor", "Pinus contorta")) #' #' # specify rows to limit choices available #' get_eolid('Poa annua') #' get_eolid('Poa annua', rows=1) #' get_eolid('Poa annua', rows=2) #' get_eolid('Poa annua', rows=1:2) #' #' # When not found #' get_eolid(sciname="uaudnadndj") #' get_eolid(c("Chironomus riparius", "uaudnadndj")) #' #' # Convert a eolid without class information to a eolid class #' # already a eolid, returns the same #' as.eolid(get_eolid("Chironomus riparius")) #' # same #' as.eolid(get_eolid(c("Chironomus riparius","Pinus contorta"))) #' # numeric #' as.eolid(24954444) #' # numeric vector, length > 1 #' as.eolid(c(24954444,51389511,57266265)) #' # character #' as.eolid("24954444") #' # character vector, length > 1 #' as.eolid(c("24954444","51389511","57266265")) #' # list, either numeric or character #' as.eolid(list("24954444","51389511","57266265")) #' ## dont check, much faster #' as.eolid("24954444", check=FALSE) #' as.eolid(24954444, check=FALSE) #' as.eolid(c("24954444","51389511","57266265"), check=FALSE) #' as.eolid(list("24954444","51389511","57266265"), check=FALSE) #' #' (out <- as.eolid(c(24954444,51389511,57266265))) #' data.frame(out) #' as.eolid( data.frame(out) ) #' #' # Get all data back #' get_eolid_("Poa annua") #' get_eolid_("Poa annua", rows=2) #' get_eolid_("Poa annua", rows=1:2) #' get_eolid_(c("asdfadfasd", "Pinus contorta")) #' } get_eolid <- function(sciname, ask = TRUE, verbose = TRUE, key = NULL, rows = NA, ...){ assert(ask, "logical") assert(verbose, "logical") fun <- function(sciname, ask, verbose, rows, ...) { direct <- FALSE mssg(verbose, "\nRetrieving data for taxon '", sciname, "'\n") tmp <- eol_search(terms = sciname, key = key, ...) ms <- "Not found. Consider checking the spelling or alternate classification" datasource <- NA_character_ if (all(is.na(tmp))) { mssg(verbose, ms) id <- NA_character_ page_id <- NA_character_ att <- "not found" mm <- FALSE } else { pageids <- tmp[grep(tolower(sciname), tolower(tmp$name)), "pageid"] if (length(pageids) == 0) { if (nrow(tmp) > 0) mssg(verbose, paste(ms, sprintf('\nDid find: %s', paste(tmp$name, collapse = "; ")))) id <- NA_character_ } else { dfs <- lapply(pageids, function(x) { y <- tryCatch(eol_pages(x, key = key), error = function(e) e) if (is(y, "error")) NULL else y$scinames }) names(dfs) <- pageids dfs <- tc(dfs) if (length(dfs) > 1) dfs <- dfs[!sapply(dfs, nrow) == 0] df <- ldply(dfs) df <- rename(df, c('.id' = 'pageid', 'identifier' = 'eolid', 'scientificname' = 'name', 'nameaccordingto' = 'source', 'taxonrank' = 'rank')) df <- getsourceshortnames(df) df$source <- as.character(df$source) mm <- NROW(df) > 1 df <- sub_rows(df, rows) if (nrow(df) == 0) { mssg(verbose, ms) id <- NA_character_ page_id <- NA_character_ } else{ id <- df$eolid } names(id) <- df$pageid } } # not found on eol if (length(id) == 0 || all(is.na(id))) { mssg(verbose, ms) id <- NA_character_ page_id <- NA_character_ att <- 'not found' } # only one found on eol if (length(id) == 1 & !all(is.na(id))) { id <- df$eolid page_id <- df$pageid datasource <- df$source direct <- TRUE att <- 'found' } # more than one found on eol -> user input if (length(id) > 1) { if (ask) { rownames(df) <- 1:nrow(df) # prompt message("\n\n") message("\nMore than one eolid found for taxon '", sciname, "'!\n Enter rownumber of taxon (other inputs will return 'NA'):\n") print(df) take <- scan(n = 1, quiet = TRUE, what = 'raw') if (length(take) == 0) { take <- 'notake' } if (take %in% seq_len(nrow(df))) { take <- as.numeric(take) message("Input accepted, took eolid '", as.character(df$eolid[take]), "'.\n") id <- as.character(df$eolid[take]) names(id) <- as.character(df$pageid[take]) page_id <- as.character(df$pageid[take]) datasource <- as.character(df$source[take]) att <- 'found' } else { id <- NA_character_ page_id <- NA_character_ att <- 'not found' mssg(verbose, "\nReturned 'NA'!\n\n") } } else { if (length(id) != 1) { warning( sprintf("More than one eolid found for taxon '%s'; refine query or set ask=TRUE", sciname), call. = FALSE ) id <- NA_character_ page_id <- NA_character_ att <- 'NA due to ask=FALSE & > 1 result' } } } list(id = as.character(id), page_id = page_id, source = datasource, att = att, multiple = mm, direct = direct) } sciname <- as.character(sciname) out <- lapply(sciname, fun, ask = ask, verbose = verbose, rows = rows, ...) ids <- unname(sapply(out, "[[", "id")) sources <- pluck(out, "source", "") ids <- structure(ids, class = "eolid", provider = sources, match = pluck(out, "att", ""), multiple_matches = pluck(out, "multiple", logical(1)), pattern_match = pluck(out, "direct", logical(1))) page_ids <- unlist(pluck(out, 'page_id')) add_uri(ids, 'http://eol.org/pages/%s/overview', page_ids) } getsourceshortnames <- function(input){ lookup <- data.frame( z = c('COL','ITIS','GBIF','NCBI','IUCN'), b = c('Species 2000 & ITIS Catalogue of Life: April 2013', 'Integrated Taxonomic Information System (ITIS)', 'GBIF Nub Taxonomy', 'NCBI Taxonomy', 'IUCN Red List (Species Assessed for Global Conservation)'), stringsAsFactors = FALSE) bb <- merge(input, lookup, by.x = "source", by.y = "b")[, -1] # names(bb)[4] <- "source" taxize_sort_df(rename(bb, c('z' = 'source')), "name") } taxize_sort_df <- function(data, vars = names(data)) { if (length(vars) == 0 || is.null(vars)) return(data) data[do.call("order", data[, vars, drop = FALSE]), , drop = FALSE] } #' @export #' @rdname get_eolid as.eolid <- function(x, check=TRUE) { UseMethod("as.eolid") } #' @export #' @rdname get_eolid as.eolid.eolid <- function(x, check=TRUE) { x } #' @export #' @rdname get_eolid as.eolid.character <- function(x, check=TRUE) { if (length(x) == 1) { make_eolid(x, check) } else { collapse(x, fxn = make_eolid, class = "eolid", check = check) } } #' @export #' @rdname get_eolid as.eolid.list <- function(x, check=TRUE) { if (length(x) == 1) { make_eolid(x, check) } else { collapse(x, make_eolid, "eolid", check = check) } } #' @export #' @rdname get_eolid as.eolid.numeric <- function(x, check=TRUE) { as.eolid(as.character(x), check) } #' @export #' @rdname get_eolid as.eolid.data.frame <- function(x, check=TRUE) { structure(x$ids, class = "eolid", match = x$match, multiple_matches = x$multiple_matches, pattern_match = x$pattern_match, uri = x$uri) } #' @export #' @rdname get_eolid as.data.frame.eolid <- function(x, ...){ data.frame(ids = as.character(unclass(x)), class = "eolid", match = attr(x, "match"), multiple_matches = attr(x, "multiple_matches"), pattern_match = attr(x, "pattern_match"), uri = attr(x, "uri"), stringsAsFactors = FALSE) } make_eolid <- function(x, check=TRUE) { tmp <- make_generic(x, 'http://eol.org/pages/%s/overview', "eolid", check) if (!check) { attr(tmp, "uri") <- NULL } else { z <- get_eol_pageid(x) if (!is.na(z)) { attr(tmp, "uri") <- sprintf('http://eol.org/pages/%s/overview', z) } else { attr(tmp, "uri") <- NULL } } tmp } check_eolid <- function(x){ url <- sprintf("http://eol.org/api/hierarchy_entries/1.0/%s.json", x) tryid <- GET(url) if (tryid$status_code == 200) TRUE else FALSE } get_eol_pageid <- function(x){ url <- sprintf("http://eol.org/api/hierarchy_entries/1.0/%s.json", x) tt <- GET(url) if (tt$status_code == 200) { jsonlite::fromJSON(con_utf8(tt), FALSE)$taxonConceptID } else { NA } } #' @export #' @rdname get_eolid get_eolid_ <- function(sciname, verbose = TRUE, key = NULL, rows = NA, ...){ stats::setNames(lapply(sciname, get_eolid_help, verbose = verbose, key = key, rows = rows, ...), sciname) } get_eolid_help <- function(sciname, verbose, key, rows, ...){ mssg(verbose, "\nRetrieving data for taxon '", sciname, "'\n") tmp <- eol_search(terms = sciname, key, ...) if (all(is.na(tmp))) { NULL } else { pageids <- tmp[grep(tolower(sciname), tolower(tmp$name)), "pageid"] if (length(pageids) == 0) { NULL } else { dfs <- lapply(pageids, function(x) { y <- tryCatch(eol_pages(x, key = key), error = function(e) e) if (inherits(y, "error")) NULL else y$scinames }) names(dfs) <- pageids dfs <- tc(dfs) if (length(dfs) > 1) dfs <- dfs[!sapply(dfs, nrow) == 0] dfs <- ldply(dfs) df <- dfs[,c('.id','identifier','scientificname','nameaccordingto')] names(df) <- c('pageid','eolid','name','source') df <- getsourceshortnames(df) df$source <- as.character(df$source) if (NROW(df) == 0) NULL else sub_rows(df, rows) } } } taxize/R/taxize_capwords.r0000644000176200001440000000164212672106003015350 0ustar liggesusers#' Capitalize the first letter of a character string. #' #' @export #' @param s A character string #' @param strict Should the algorithm be strict about capitalizing. #' Defaults to FALSE. #' @param onlyfirst Capitalize only first word, lowercase all others. Useful #' for taxonomic names. #' @examples #' taxize_capwords(c("using AIC for model selection")) #' taxize_capwords(c("using AIC for model selection"), strict=TRUE) taxize_capwords <- function(s, strict = FALSE, onlyfirst = FALSE) { cap <- function(s) { paste(toupper(substring(s,1,1)), { s <- substring(s,2); if (strict) tolower(s) else s }, sep = "", collapse = " " ) } if (!onlyfirst) { sapply(strsplit(s, split = " "), cap, USE.NAMES = !is.null(names(s))) } else { sapply(s, function(x) paste(toupper(substring(x,1,1)), tolower(substring(x,2)), sep = "", collapse = " "), USE.NAMES = FALSE) } } taxize/R/get_colid.R0000644000176200001440000002456013160645145014047 0ustar liggesusers#' Get the Catalogue of Life ID from taxonomic names. #' #' @export #' @param sciname character; scientific name. #' @param ask logical; should get_colid be run in interactive mode? #' If TRUE and more than one ID is found for the species, the user is asked for #' input. If FALSE NA is returned for multiple matches. #' @param verbose logical; If TRUE the actual taxon queried is printed on the #' console. #' @param rows numeric; Any number from 1 to infinity. If the default NA, all rows are considered. #' Note that this function still only gives back a colid class object with one to many identifiers. #' See \code{\link[taxize]{get_colid_}} to get back all, or a subset, of the raw data that you are #' presented during the ask process. #' @param kingdom (character) A kingdom name. Optional. See \code{Filtering} #' below. #' @param phylum (character) A phylum (aka division) name. Optional. See \code{Filtering} #' below. #' @param class (character) A class name. Optional. See \code{Filtering} below. #' @param order (character) An order name. Optional. See \code{Filtering} below. #' @param family (character) A family name. Optional. See \code{Filtering} below. #' @param rank (character) A taxonomic rank name. See \code{\link{rank_ref}} for possible #' options. Though note that some data sources use atypical ranks, so inspect the #' data itself for options. Optional. See \code{Filtering} below. #' @param x Input to as.colid #' @param ... Ignored #' @param check logical; Check if ID matches any existing on the DB, only used in #' \code{\link{as.colid}} #' @template getreturn #' #' @section Filtering: #' The parameters \code{kingdom}, \code{phylum}, \code{class}, \code{order}, \code{family}, #' and \code{rank} are not used in the search to the data provider, but are used in filtering #' the data down to a subset that is closer to the target you want. For all these parameters, #' you can use regex strings since we use \code{\link{grep}} internally to match. #' Filtering narrows down to the set that matches your query, and removes the rest. #' #' @family taxonomic-ids #' @seealso \code{\link[taxize]{classification}} #' #' @author Scott Chamberlain, \email{myrmecocystus@@gmail.com} #' #' @examples \dontrun{ #' get_colid(sciname='Poa annua') #' get_colid(sciname='Pinus contorta') #' get_colid(sciname='Puma concolor') #' # get_colid(sciname="Abudefduf saxatilis") #' #' get_colid(c("Poa annua", "Pinus contorta")) #' #' # specify rows to limit choices available #' get_colid(sciname='Poa annua') #' get_colid(sciname='Poa annua', rows=1) #' get_colid(sciname='Poa annua', rows=2) #' get_colid(sciname='Poa annua', rows=1:2) #' #' # When not found #' get_colid(sciname="uaudnadndj") #' get_colid(c("Chironomus riparius", "uaudnadndj")) #' #' # Narrow down results to a division or rank, or both #' ## Satyrium example #' ### Results w/o narrowing #' get_colid("Satyrium") #' ### w/ division #' get_colid("Satyrium", kingdom = "Plantae") #' get_colid("Satyrium", kingdom = "Animalia") #' #' ## Rank example #' get_colid("Poa") #' get_colid("Poa", kingdom = "Plantae") #' get_colid("Poa", kingdom = "Animalia") #' #' # Fuzzy filter on any filtering fields #' ## uses grep on the inside #' get_colid("Satyrium", kingdom = "p") #' #' # Convert a uid without class information to a uid class #' as.colid(get_colid("Chironomus riparius")) # already a uid, returns the same #' as.colid(get_colid(c("Chironomus riparius","Pinus contorta"))) # same #' as.colid("714831352ad94741e4321eccdeb29f58") # character #' # character vector, length > 1 #' as.colid(c("714831352ad94741e4321eccdeb29f58", "3b35900f74ff6e4b073ddb95c32b1f8d")) #' # list, either numeric or character #' as.colid(list("714831352ad94741e4321eccdeb29f58", "3b35900f74ff6e4b073ddb95c32b1f8d")) #' ## dont check, much faster #' as.colid("714831352ad94741e4321eccdeb29f58", check=FALSE) #' as.colid(c("714831352ad94741e4321eccdeb29f58", "3b35900f74ff6e4b073ddb95c32b1f8d"), #' check=FALSE) #' as.colid(list("714831352ad94741e4321eccdeb29f58", "3b35900f74ff6e4b073ddb95c32b1f8d"), #' check=FALSE) #' #' (out <- as.colid(c("714831352ad94741e4321eccdeb29f58", "3b35900f74ff6e4b073ddb95c32b1f8d"))) #' data.frame(out) #' as.colid( data.frame(out) ) #' #' # Get all data back #' get_colid_("Poa annua") #' get_colid_("Poa annua", rows=2) #' get_colid_("Poa annua", rows=1:2) #' get_colid_(c("asdfadfasd","Pinus contorta")) #' #' get_colid(sciname="Andropadus nigriceps fusciceps", rows=1) #' #' # use curl options #' library("httr") #' get_colid("Quercus douglasii", config=verbose()) #' bb <- get_colid("Quercus douglasii", config=progress()) #' } get_colid <- function(sciname, ask = TRUE, verbose = TRUE, rows = NA, kingdom = NULL, phylum = NULL, class = NULL, order = NULL, family = NULL, rank = NULL, ...){ assert(ask, "logical") assert(verbose, "logical") assert(kingdom, "character") assert(phylum, "character") assert(class, "character") assert(order, "character") assert(family, "character") assert(rank, "character") fun <- function(sciname, ask, verbose, rows, ...) { direct <- FALSE mssg(verbose, "\nRetrieving data for taxon '", sciname, "'\n") df <- col_search(name = sciname, response = "full", ...)[[1]] df <- df[, names(df) %in% c("name","rank","id","name_status","kingdom","family","acc_name")] mm <- NROW(df) > 1 rank_taken <- NA if (NROW(df) == 0) { id <- NA_character_ att <- "not found" } else { df <- stats::setNames(df, tolower(names(df))) df <- rename(df, c("id" = "colid")) colnames(df)[which(colnames(df) == 'id')] <- 'colid' id <- df$colid rank_taken <- as.character(df$rank) att <- "found" } # not found on col if (all(is.na(id))) { mssg(verbose, "Not found. Consider checking the spelling or alternate classification") id <- NA_character_ att <- "not found" } # more than one found -> user input if (length(id) > 1) { rownames(df) <- 1:nrow(df) if (!is.null(kingdom) || !is.null(phylum) || !is.null(class) || !is.null(order) || !is.null(family) || !is.null(rank)) { df <- filt(df, "kingdom", kingdom) df <- filt(df, "phylum", phylum) df <- filt(df, "class", class) df <- filt(df, "order", order) df <- filt(df, "family", family) df <- filt(df, "rank", rank) } df <- sub_rows(df, rows) id <- df$colid if (length(id) == 1) { rank_taken <- as.character(df$rank) direct <- TRUE att <- "found" } if (length(id) > 1) { if (ask) { # prompt rownames(df) <- 1:nrow(df) message("\n\n") message("\nMore than one colid found for taxon '", sciname, "'!\n Enter rownumber of taxon (other inputs will return 'NA'):\n") print(df) take <- scan(n = 1, quiet = TRUE, what = 'raw') if (length(take) == 0) { take <- 'notake' att <- 'nothing chosen' } if (take %in% seq_len(nrow(df))) { take <- as.numeric(take) message("Input accepted, took colid '", as.character(df$colid[take]), "'.\n") id <- as.character(df$colid[take]) rank_taken <- as.character(df$rank[take]) att <- "found" } else { id <- NA_character_ att <- "not found" mssg(verbose, "\nReturned 'NA'!\n\n") } } else { if (length(id) != 1) { warning( sprintf("More than one id found for taxon '%s'; refine query or set ask=TRUE", sciname), call. = FALSE ) id <- NA_character_ att <- 'NA due to ask=FALSE & > 1 result' } } } } list(id = id, rank = rank_taken, att = att, multiple = mm, direct = direct) } sciname <- as.character(sciname) out <- lapply(sciname, fun, ask = ask, verbose = verbose, rows = rows, ...) ids <- pluck(out, "id", "") atts <- pluck(out, "att", "") ids <- structure(ids, class = "colid", match = atts, multiple_matches = pluck(out, "multiple", logical(1)), pattern_match = pluck(out, "direct", logical(1))) if ( !all(is.na(ids)) ) { urls <- sapply(out, function(z){ if (!is.na(z[['id']])) { if (tolower(z['rank']) == "species") { sprintf('http://www.catalogueoflife.org/col/details/species/id/%s', z[['id']]) } else { sprintf('http://www.catalogueoflife.org/col/browse/tree/id/%s', z[['id']]) } } else { NA } }) attr(ids, 'uri') <- unlist(urls) } return(ids) } #' @export #' @rdname get_colid as.colid <- function(x, check=TRUE) UseMethod("as.colid") #' @export #' @rdname get_colid as.colid.colid <- function(x, check=TRUE) x #' @export #' @rdname get_colid as.colid.character <- function(x, check=TRUE) if (length(x) == 1) make_colid(x, check) else collapse(x, make_colid, "colid", check = check) #' @export #' @rdname get_colid as.colid.list <- function(x, check=TRUE) if (length(x) == 1) make_colid(x, check) else collapse(x, make_colid, "colid", check = check) #' @export #' @rdname get_colid as.colid.data.frame <- function(x, check=TRUE) { structure(x$ids, class = "colid", match = x$match, multiple_matches = x$multiple_matches, pattern_match = x$pattern_match, uri = x$uri) } #' @export #' @rdname get_colid as.data.frame.colid <- function(x, ...){ data.frame(ids = as.character(unclass(x)), class = "colid", match = attr(x, "match"), multiple_matches = attr(x, "multiple_matches"), pattern_match = attr(x, "pattern_match"), uri = attr(x, "uri"), stringsAsFactors = FALSE) } make_colid <- function(x, check=TRUE) make_generic(x, 'http://www.catalogueoflife.org/col/details/species/id/%s', "colid", check) check_colid <- function(x){ url <- "http://www.catalogueoflife.org/col/details/species/id/" res <- GET(paste0(url, x)) !grepl("Species not found", res) } #' @export #' @rdname get_colid get_colid_ <- function(sciname, verbose = TRUE, rows = NA){ setNames(lapply(sciname, get_colid_help, verbose = verbose, rows = rows), sciname) } get_colid_help <- function(sciname, verbose, rows){ mssg(verbose, "\nRetrieving data for taxon '", sciname, "'\n") df <- col_search(name = sciname)[[1]] if (NROW(df) == 0) NULL else sub_rows(df, rows) } taxize/R/col_children.R0000644000176200001440000000721313040206043014522 0ustar liggesusers#' Search Catalogue of Life for for direct children of a particular taxon. #' #' @export #' @param name The string to search for. Only exact matches found the name given #' will be returned, unless one or wildcards are included in the search #' string. An * (asterisk) character denotes a wildcard; a % (percentage) #' character may also be used. The name must be at least 3 characters long, #' not counting wildcard characters. #' @param id The record ID of the specific record to return (only for scientific #' names of species or infraspecific taxa) #' @param format format of the results returned. Valid values are format=xml and #' format=php; if the format parameter is omitted, the results are returned #' in the default XML format. If format=php then results are returned as a #' PHP array in serialized string format, which can be converted back to an #' array in PHP using the unserialize command #' @param start The first record to return. If omitted, the results are returned #' from the first record (start=0). This is useful if the total number of #' results is larger than the maximum number of results returned by a single #' Web service query (currently the maximum number of results returned by a #' single query is 500 for terse queries and 50 for full queries). #' @param checklist The year of the checklist to query, if you want a specific #' year's checklist instead of the lastest as default (numeric). #' @param ... Curl options passed on to \code{\link[httr]{GET}} #' @details You must provide one of name or id. The other parameters (format #' and start) are optional. #' @return A list of data.frame's. #' @examples \dontrun{ #' # A basic example #' col_children(name="Apis") #' #' # An example where there is no classification, results in data.frame with #' # no rows #' col_children(id='b2f88f382aa5568f93a97472c6be6516') #' #' # Use a specific year's checklist #' col_children(name="Apis", checklist=2012) #' col_children(name="Apis", checklist=2009) #' #' # Pass in many names or many id's #' out <- col_children(name=c("Buteo","Apis","Accipiter","asdf"), #' checklist = "2012") #' out$Apis # get just the output you want #' library("plyr") #' ldply(out) # or combine to one data.frame #' #' # or pass many id's #' ids <- c('abe977b1d27007a76dd12a5c93a637bf', #' 'b2f88f382aa5568f93a97472c6be6516') #' out <- col_children(id = ids, checklist=2012) #' library("plyr") #' ldply(out) # combine to one data.frame #' } col_children <- function(name = NULL, id = NULL, format = NULL, start = NULL, checklist = NULL, ...) { if (is.null(id)) { temp <- llply(name, search_col_safe, id = NULL, checklist = checklist, format = format, start = start, ...) setNames(temp, name) } else { temp <- llply(id, search_col_safe, name = NULL, checklist = checklist, format = format, start = start, ...) setNames(temp, id) } } search_col <- function(name, id, checklist, format, start, ...) { url <- make_url(checklist) args <- tc(list(name = name, id = id, format = format, response = "full", start = start)) out <- GET(col_base(), query = argsnull(args), ...) stop_for_status(out) tt <- xml2::read_xml(con_utf8(out)) search_col_child_df(tt) } search_col_safe <- plyr::failwith(NULL, search_col) search_col_child_df <- function(x) { childtaxa_id <- xml_text(xml_find_all(x, "//child_taxa//id")) childtaxa_name <- xml_text(xml_find_all(x, "//child_taxa//name")) childtaxa_rank <- xml_text(xml_find_all(x, "//child_taxa//rank")) data.frame(childtaxa_id, childtaxa_name, childtaxa_rank = tolower(childtaxa_rank), stringsAsFactors = FALSE) } taxize/R/tnrs_sources.r0000644000176200001440000000162712672106003014676 0ustar liggesusers#' @title TNRS sources #' #' @description Get sources for the Phylotastic Taxonomic Name Resolution Service #' #' @param source The source to get information on, one of "iPlant_TNRS", #' "NCBI", or "MSW3". #' @param ... Curl options to pass in \code{\link[httr]{GET}} #' @return Sources for the TNRS API in a vector or list #' @export #' @examples \dontrun{ #' # All #' tnrs_sources() #' #' # A specific source #' tnrs_sources(source="NCBI") #' } tnrs_sources <- function(source = NULL, ...) { url = "http://taxosaurus.org/sources" if (!is.null(source)) { url2 <- paste0(url, "/", source) tt <- GET(url2, ...) stop_for_status(tt) res <- con_utf8(tt) tmp <- nmslwr(jsonlite::fromJSON(res)) tmp$details <- nmslwr(tmp$details) tmp } else { url2 <- paste0(url, "/list") tt <- GET(url2, ...) stop_for_status(tt) res <- con_utf8(tt) jsonlite::fromJSON(res)$sources } } taxize/R/itis_downstream.R0000644000176200001440000000746612771304324015335 0ustar liggesusers#' Retrieve all taxa names or TSNs downstream in hierarchy from given TSN. #' #' @export #' @param tsns A taxonomic serial number. #' @param downto The taxonomic level you want to go down to. See examples below. #' The taxonomic level IS case sensitive, and you do have to spell it #' correctly. See \code{data(rank_ref)} for spelling. #' @param intermediate (logical) If TRUE, return a list of length two with target #' taxon rank names, with additional list of data.frame's of intermediate #' taxonomic groups. Default: FALSE #' @param ... Further args passed on to \code{\link[ritis]{rank_name}} and #' \code{\link[ritis]{hierarchy_down}} #' @return Data.frame of taxonomic information downstream to family from e.g., #' Order, Class, etc., or if \code{intermediated=TRUE}, list of length two, #' with target taxon rank names, and intermediate names. #' @author Scott Chamberlain \email{myrmecocystus@@gmail.com} #' @examples \dontrun{ #' ## the plant class Bangiophyceae, tsn 846509 #' itis_downstream(tsns = 846509, downto="genus") #' itis_downstream(tsns = 846509, downto="genus", intermediate=TRUE) #' #' # get families downstream from Acridoidea #' itis_downstream(tsns = 650497, "family") #' ## here, intermediate leads to the same result as the target #' itis_downstream(tsns = 650497, "family", intermediate=TRUE) #' #' # get species downstream from Ursus #' itis_downstream(tsns = 180541, "species") #' #' # get orders down from the Division Rhodophyta (red algae) #' itis_downstream(tsns = 660046, "order") #' itis_downstream(tsns = 660046, "order", intermediate=TRUE) #' #' # get tribes down from the family Apidae #' itis_downstream(tsns = 154394, downto="tribe") #' itis_downstream(tsns = 154394, downto="tribe", intermediate=TRUE) #' } itis_downstream <- function(tsns, downto, intermediate = FALSE, ...) { downto <- tolower(downto) downto2 <- rank_ref[which_rank(downto), "rankid"] torank_ids <- rank_ref[which_rank(downto):NROW(rank_ref), "rankid"] stop_ <- "not" notout <- data.frame(rankname = "") out <- list() if (intermediate) intermed <- list() iter <- 0 while (stop_ == "not") { iter <- iter + 1 if (!nchar(as.character(notout$rankname[[1]])) > 0) { temp <- ldply(as.character(tsns), ritis::rank_name) } else { temp <- notout } tt <- ldply(as.character(temp$tsn), ritis::hierarchy_down) ## FIXME - do we need this since rank is given above in `tt` names_ <- ldply(split(tt, row.names(tt)), function(x) { ritis::rank_name(as.character(x$tsn))[,c("rankid","rankname","tsn")] }) ## if (nrow(names_) == 0) { out[[iter]] <- data.frame(tsn = "No data", parentname = "No data", parenttsn = "No data", taxonname = "No data", rankid = "No data", rankname = "No data") stop_ <- "nodata" } else { tt <- merge(tt[,-3], names_[,-1], by = "tsn") if (intermediate) intermed[[iter]] <- tt if (nrow(tt[tt$rankid == downto2, ]) > 0) out[[iter]] <- tt[tt$rankid == downto2, ] if (nrow(tt[!tt$rankid == downto2, ]) > 0) { notout <- tt[!tt$rankid %in% torank_ids, ] } else { notout <- data.frame(rankname = downto) } if (all(notout$rankname == downto)) { stop_ <- "fam" } else { tsns <- notout$tsn stop_ <- "not" } } if (intermediate) { intermed[[iter]] <- stats::setNames(intermed[[iter]], tolower(names(intermed[[iter]]))) intermed[[iter]]$rankname <- tolower(intermed[[iter]]$rankname) } } tmp <- ldply(out) tmp$rankname <- tolower(tmp$rankname) if (intermediate) { list(target = stats::setNames(tmp, tolower(names(tmp))), intermediate = intermed) } else { stats::setNames(tmp, tolower(names(tmp))) } } which_rank <- function(x) { which(sapply(rank_ref$ranks, function(z) { any(unlist(strsplit(z, split = ",")) == x) }, USE.NAMES = FALSE) ) } taxize/R/ncbi_children.R0000644000176200001440000001520713012141315014661 0ustar liggesusers#' @title Search NCBI for children of a taxon #' #' @description Search the NCBI Taxonomy database for uids of children of taxa. Taxa can #' be referenced by name or uid. Referencing by name is faster. #' #' In a few cases, different taxa have the same name (e.g. Satyrium; see examples). If one of these #' are searched for then the children of both taxa will be returned. This can be avoided by #' using a uid instead of the name or specifying an ancestor. If an ancestor is provided, only #' children of both the taxon and its ancestor are returned. This will only fail if there are two #' taxa with the same name and the same specified ancestor. #' #' @export #' @param name (\code{character}) The string to search for. Only exact matches found the name given #' will be returned. Not compatible with \code{id}. #' @param id (\code{character}) The uid to search for. Not compatible with \code{name}. #' @param start The first record to return. If omitted, the results are returned from the first #' record (start=0). #' @param max_return (\code{numeric; length=1}) The maximum number of children to return. #' @param ancestor (\code{character}) The ancestor of the taxon being searched for. This is useful #' if there could be more than one taxon with the same name. Has no effect if \code{id} is used. #' @param out_type (character) Currently either \code{"summary"} or \code{"uid"}: #' \describe{ #' \item{summary}{The output is a list of \code{data.frame} with children uid, name, and rank.} #' \item{uid}{A list of character vectors of children uids} #' } #' @param ambiguous \code{logical; length 1} If \code{FALSE}, children taxa with words like #' "unclassified", "unknown", "uncultured", or "sp." are removed from the output. #' NOTE: This option only applies when \code{out_type = "summary"}. #' @param ... Curl options passed on to \code{\link[httr]{GET}} #' @return The output type depends on the value of the \code{out_type} parameter. Taxa that cannot #' be found will result in \code{NA}s and a lack of children results in an empty data structure. #' @seealso \code{\link{ncbi_get_taxon_summary}}, \code{\link[taxize]{children}} #' @author Zachary Foster \email{zacharyfoster1989@@gmail.com} #' @examples #' \dontrun{ #' ncbi_children(name="Satyrium") #Satyrium is the name of two different genera #' ncbi_children(name="Satyrium", ancestor="Eumaeini") # A genus of butterflies #' ncbi_children(name="Satyrium", ancestor="Orchidaceae") # A genus of orchids #' ncbi_children(id="266948") #"266948" is the uid for the butterfly genus #' ncbi_children(id="62858") #"62858" is the uid for the orchid genus #' #' # use curl options #' library("httr") #' ncbi_children(name="Satyrium", ancestor="Eumaeini", config=verbose()) #' } ncbi_children <- function(name = NULL, id = NULL, start = 0, max_return = 1000, ancestor = NULL, out_type = c("summary", "uid"), ambiguous = FALSE, ...) { # Constants -------------------------------------------------------------------------------------- ambiguous_regex <- paste(sep = "|", "unclassified", "environmental", "uncultured", "unknown", "unidentified", "candidate", "sp\\.", "s\\.l\\.", "sensu lato", "clone", "miscellaneous", "candidatus", "affinis", "aff\\.", "incertae sedis", "mixed", "samples", "libaries") base_url <- paste0(ncbi_base(), "/entrez/eutils/esearch.fcgi?db=taxonomy") # Argument validation ---------------------------------------------------------------------------- if (sum(c(is.null(name), is.null(id))) != 1) { stop("Either name or id must be specified, but not both") } out_type <- match.arg(out_type) # Get name from id ------------------------------------------------------------------------------- if (is.null(name)) { if (class(id) != 'uid') attr(id, 'class') <- 'uid' id_taxonomy <- classification(id, db = 'ncbi') name <- vapply(id_taxonomy, function(x) ifelse(nrow(x) > 0, x$name[nrow(x)], as.character(NA)), character(1)) ancestor <- vapply(id_taxonomy, function(x) ifelse(nrow(x) > 1, x$name[nrow(x) - 1], as.character(NA)), character(1)) } else if (is.null(ancestor)) { ancestor <- rep(NA, length(name)) } # Function to search for queries one at a time --------------------------------------------------- single_search <- function(name, ancestor, ...) { if (is.na(name)) return(NA) # Make eutils esearch query - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (is.na(ancestor)) { ancestor_query <- NULL } else { ancestor_query <- paste0("+AND+", ancestor, "[subtree]") } taxon_query <- paste0("term=", name, "[Next+Level]", ancestor_query) max_return_query <- paste0("RetMax=", max_return) start_query <- paste0("RetStart=", start) query <- paste(base_url, taxon_query, max_return_query, start_query, sep = "&") query <- gsub(" ", "+", query) #spaces must be replaced with '+' # Search ncbi for children - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - rr <- GET(query, ...) stop_for_status(rr) raw_results <- con_utf8(rr) # Parse results - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - results <- xml2::read_xml(raw_results) children_uid <- xml2::xml_text(xml2::xml_find_all(results, "//eSearchResult/IdList/Id")) if (length(children_uid) == 0) { if (out_type == "summary") { output <- data.frame(childtaxa_id = numeric(), childtaxa_name = character(), childtaxa_rank = character()) } else { output <- numeric() } } else { if (out_type == "summary") { output <- ncbi_get_taxon_summary(children_uid, ...) names(output) <- c("childtaxa_id", "childtaxa_name", "childtaxa_rank") # Remove ambiguous results - - - - - - - - - - - - - - - - - - - - - - if (!ambiguous) { output <- output[!grepl(ambiguous_regex, output$childtaxa_name, ignore.case = TRUE), ] } } else { output <- children_uid } rownames(output) <- NULL # numeric row names can be misleading after filtering } Sys.sleep(0.34) # NCBI limits requests to three per second return(output) } #Combine the result of multiple searches ---------------------------------------------------------- # output <- Map(single_search, name, ancestor) output <- list() for (i in seq_along(name)) { output[[i]] <- single_search(name[[i]], ancestor[[i]], ...) } if (is.null(id)) names(output) <- name else names(output) <- id return(output) } taxize/R/names_list.r0000644000176200001440000000230412672106003014274 0ustar liggesusers#' Get a random vector of species names. #' #' Family and order names come from the APG plant names list. Genus and species names #' come from Theplantlist.org. #' #' @export #' @param rank Taxonomic rank, one of species, genus (default), family, order. #' @param size Number of names to get. Maximum depends on the rank. #' @return Vector of taxonomic names. #' @author Scott Chamberlain \email{myrmecocystus@@gmail.com} #' @examples #' names_list() #' names_list('species') #' names_list('genus') #' names_list('family') #' names_list('order') #' names_list('order', '2') #' names_list('order', '15') #' #' # You can get a lot of genus or species names if you want #' nrow(theplantlist) #' names_list('genus', 500) names_list <- function(rank='genus', size=10) { getsp <- function(size){ tmp <- apply(theplantlist[sample(1:nrow(theplantlist), size), c('genus','species')], 1, function(y) paste(y, collapse = " ")) names(tmp) <- NULL tmp } switch(rank, family = as.character(sample(apg_families$this, size)), order = as.character(sample(apg_orders$this, size)), genus = sample(unique(theplantlist$genus), size), species = getsp(size) ) } taxize/R/downstream.R0000644000176200001440000002144013160565633014276 0ustar liggesusers#' Retrieve the downstream taxa for a given taxon name or ID. #' #' This function uses a while loop to continually collect children taxa down #' to the taxonomic rank that you specify in the \code{downto} parameter. You #' can get data from ITIS (itis), Catalogue of Life (col), GBIF (gbif), or #' NCBI (ncbi). There is no method exposed by these four services for #' getting taxa at a specific taxonomic rank, so we do it ourselves here. #' #' @export #' @param x Vector of taxa names (character) or IDs (character or numeric) #' to query. #' @param db character; database to query. One or more of \code{itis}, #' \code{col}, \code{gbif}, or \code{ncbi}. Note that each taxonomic data #' source has their own identifiers, so that if you provide the wrong \code{db} #' value for the identifier you could get a result, but it will likely be #' wrong (not what you were expecting). #' @param downto What taxonomic rank to go down to. One of: 'superkingdom', #' 'kingdom', 'subkingdom','infrakingdom','phylum','division','subphylum', #' 'subdivision','infradivision', 'superclass','class','subclass','infraclass', #' 'superorder','order','suborder','infraorder','superfamily','family', #' 'subfamily','tribe','subtribe','genus','subgenus','section','subsection', #' 'species group','species','subspecies','variety','form','subvariety','race', #' 'stirp', 'morph','aberration','subform', 'unspecified', 'no rank' #' @param intermediate (logical) If \code{TRUE}, return a list of length two #' with target taxon rank names, with additional list of data.frame's of #' intermediate taxonomic groups. Default: \code{FALSE} #' @param rows (numeric) Any number from 1 to infinity. If the default NA, all #' rows are considered. Note that this parameter is ignored if you pass in a #' taxonomic id of any of the acceptable classes: tsn, colid. #' @param ... Further args passed on to \code{itis_downstream}, #' \code{col_downstream}, \code{gbif_downstream}, or \code{ncbi_downstream} #' #' @return A named list of data.frames with the downstream names of every #' supplied taxa. You get an NA if there was no match in the database. #' #' @examples \dontrun{ #' # Plug in taxon IDs #' ## col Ids have to be character, as they are alphanumeric IDs #' downstream("015be25f6b061ba517f495394b80f108", db = "col", #' downto = "species") #' ## ITIS tsn ids can be numeric or character #' downstream("154395", db = "itis", downto = "species") #' downstream(154395, db = "itis", downto = "species") #' #' # Plug in taxon names #' downstream("Insecta", db = 'col', downto = 'order') #' downstream("Apis", db = 'col', downto = 'species') #' downstream("Apis", db = 'ncbi', downto = 'species') #' downstream("Apis", db = 'itis', downto = 'species') #' downstream(c("Apis","Epeoloides"), db = 'itis', downto = 'species') #' downstream(c("Apis","Epeoloides"), db = 'col', downto = 'species') #' downstream("Ursus", db = 'gbif', downto = 'species') #' downstream(get_gbifid("Ursus"), db = 'gbif', downto = 'species') #' #' # Plug in IDs #' id <- get_colid("Apis") #' downstream(id, downto = 'species') #' #' ## Equivalently, plug in the call to get the id via e.g., get_colid #' ## into downstream #' identical(downstream(id, downto = 'species'), #' downstream(get_colid("Apis"), downto = 'species')) #' #' id <- get_colid("Apis") #' downstream(id, downto = 'species') #' downstream(get_colid("Apis"), downto = 'species') #' #' # Many taxa #' sp <- names_list("genus", 3) #' downstream(sp, db = 'col', downto = 'species') #' downstream(sp, db = 'itis', downto = 'species') #' downstream(sp, db = 'gbif', downto = 'species') #' #' # Both data sources #' ids <- get_ids("Apis", db = c('col','itis')) #' downstream(ids, downto = 'species') #' ## same result #' downstream(get_ids("Apis", db = c('col','itis')), downto = 'species') #' #' # Collect intermediate names #' ## itis #' downstream('Bangiophyceae', db="itis", downto="genus") #' downstream('Bangiophyceae', db="itis", downto="genus", intermediate=TRUE) #' downstream(get_tsn('Bangiophyceae'), downto="genus") #' downstream(get_tsn('Bangiophyceae'), downto="genus", intermediate=TRUE) #' ## col #' downstream(get_colid("Animalia"), downto="class") #' downstream(get_colid("Animalia"), downto="class", intermediate=TRUE) #' #' # Use the rows parameter #' ## note how in the second function call you don't get the prompt #' downstream("Poa", db = 'col', downto="species") #' downstream("Poa", db = 'col', downto="species", rows=1) #' #' downstream("Poa", db = 'ncbi', downto="species") #' #' # use curl options #' res <- downstream("Apis", db = 'col', downto = 'species', config=verbose()) #' res <- downstream("Apis", db = 'itis', downto = 'species', config=verbose()) #' res <- downstream("Ursus", db = 'gbif', downto = 'species', config=verbose()) #' } downstream <- function(...){ UseMethod("downstream") } #' @export #' @rdname downstream downstream.default <- function(x, db = NULL, downto = NULL, intermediate = FALSE, rows=NA, ...) { nstop(downto, "downto") nstop(db) switch( db, itis = { id <- process_stream_ids(x, db, get_tsn, rows = rows, ...) stats::setNames(downstream(id, downto = tolower(downto), intermediate = intermediate, ...), x) }, col = { id <- process_stream_ids(x, db, get_colid, rows = rows, ...) stats::setNames(downstream(id, downto = tolower(downto), intermediate = intermediate, ...), x) }, gbif = { id <- process_stream_ids(x, db, get_gbifid, rows = rows, ...) stats::setNames(downstream(id, downto = tolower(downto), intermediate = intermediate, ...), x) }, ncbi = { id <- process_stream_ids(x, db, get_uid, rows = rows, ...) stats::setNames(downstream(id, downto = tolower(downto), intermediate = intermediate, ...), x) }, stop("the provided db value was not recognised/is not supported", call. = FALSE) ) } process_stream_ids <- function(input, db, fxn, ...){ g <- tryCatch(as.numeric(as.character(input)), warning = function(e) e) if (is(g, "numeric") || is.character(input) && grepl("[[:digit:]]", input)) { as_fxn <- switch(db, itis = as.tsn, col = as.colid, gbif = as.gbifid) as_fxn(input, check = FALSE) } else { eval(fxn)(input, ...) } } #' @export #' @rdname downstream downstream.tsn <- function(x, db = NULL, downto = NULL, intermediate = FALSE, ...) { fun <- function(y, downto, intermediate, ...){ # return NA if NA is supplied if (is.na(y)) { NA } else { itis_downstream(tsns = y, downto = downto, intermediate = intermediate, ...) } } out <- lapply(x, fun, downto = downto, intermediate = intermediate, ...) structure(out, class = 'downstream', db = 'itis', .Names = x) } #' @export #' @rdname downstream downstream.colid <- function(x, db = NULL, downto = NULL, intermediate = FALSE, ...) { fun <- function(y, downto, intermediate, ...){ # return NA if NA is supplied if (is.na(y)) { NA } else { col_downstream(id = y, downto = downto, intermediate = intermediate, ...) } } out <- lapply(x, fun, downto = downto, intermediate = intermediate, ...) structure(simp(out), class = 'downstream', db = 'col') } #' @export #' @rdname downstream downstream.gbifid <- function(x, db = NULL, downto = NULL, intermediate = FALSE, ...) { fun <- function(y, downto, intermediate, ...){ # return NA if NA is supplied if (is.na(y)) { NA } else { gbif_downstream(key = y, downto = downto, intermediate = intermediate, ...) } } out <- lapply(x, fun, downto = downto, intermediate = intermediate, ...) structure(out, class = 'downstream', db = 'gbif') } #' @export #' @rdname downstream downstream.uid <- function(x, db = NULL, downto = NULL, intermediate = FALSE, ...) { fun <- function(y, downto, intermediate, ...){ # return NA if NA is supplied if (is.na(y)) { NA } else { ncbi_downstream(id = y, downto = downto, intermediate = intermediate, ...) } } out <- lapply(x, fun, downto = downto, intermediate = intermediate, ...) structure(out, class = 'downstream', db = 'ncbi') } #' @export #' @rdname downstream downstream.ids <- function(x, db = NULL, downto = NULL, intermediate = FALSE, ...) { fun <- function(y, downto, intermediate, ...){ # return NA if NA is supplied if (is.na(y)) { NA } else { downstream(y, downto = downto, intermediate = intermediate, ...) } } structure(lapply(x, fun, downto = downto, intermediate = intermediate, ...), class = 'downstream_ids') } simp <- function(x) if (length(x) == 1) x[[1]] else x taxize/R/bold_search.R0000644000176200001440000000777513042704066014371 0ustar liggesusers#' Search Barcode of Life for taxonomic IDs #' #' @export #' @param name (character) One or more scientific names. #' @param id (integer) One or more BOLD taxonomic identifiers. #' @param fuzzy (logical) Whether to use fuzzy search or not (default: FALSE). Only used if #' \code{name} passed. #' @param dataTypes (character) Specifies the datatypes that will be returned. See Details for #' options. This variable is ignored if \code{name} parameter is passed, but is used if the #' \code{id} parameter is passed. #' @param includeTree (logical) If TRUE (default: FALSE), returns a list containing information #' for parent taxa as well as the specified taxon. Only used if \code{id} passed. #' @param response (logical) Note that response is the object that returns from the Curl call, #' useful for debugging, and getting detailed info on the API call. #' @param ... Further args passed on to \code{\link[httr]{GET}}, main purpose being curl debugging #' @details You must provide one of name or id to this function. The other parameters are optional. #' Note that when passing in \code{name}, \code{fuzzy} can be used as well, while if \code{id} #' is passed, then \code{fuzzy} is ignored, and \code{dataTypes} \code{includeTree} can be used. #' #' Options for \code{dataTypes} parameter: #' #' \itemize{ #' \item all returns all data #' \item basic returns basic taxon information #' \item images returns specimen image. Includes copyright information, image URL, image metadata. #' \item stats Returns specimen and sequence statistics. Includes public species count, public BIN #' count, public marker counts, public record count, specimen count, sequenced specimen count, #' barcode specimen count, species count, barcode species count. #' \item geo Returns collection site information. Includes country, collection site map. #' \item sequencinglabs Returns sequencing labs. Includes lab name, record count. #' \item depository Returns specimen depositories. Includes depository name, record count. #' \item thirdparty Returns information from third parties. Includes wikipedia summary, wikipedia #' URL, GBIF map. #' } #' @references \url{http://www.boldsystems.org/index.php/resources/api} #' @return A list of data.frame's. #' @examples \dontrun{ #' # A basic example #' bold_search(name="Apis") #' bold_search(name="Agapostemon") #' bold_search(name="Poa") #' #' # Fuzzy search #' head(bold_search(name="Po", fuzzy=TRUE)) #' head(bold_search(name="Aga", fuzzy=TRUE)) #' #' # Many names #' bold_search(name=c("Apis","Puma concolor")) #' nms <- names_list('species') #' bold_search(name=nms) #' #' # Searching by ID - dataTypes can be used, and includeTree can be used #' bold_search(id=88899) #' bold_search(id=88899, dataTypes="stats") #' bold_search(id=88899, dataTypes="geo") #' bold_search(id=88899, dataTypes="basic") #' bold_search(id=88899, includeTree=TRUE) #' } bold_search <- function(name = NULL, id = NULL, fuzzy = FALSE, dataTypes='basic', includeTree=FALSE, response=FALSE, ...) { stopifnot(!is.null(name) | !is.null(id)) type <- if (is.null(name)) "id" else 'name' tmp <- switch(type, name = bold_tax_name(name = name, fuzzy = fuzzy, response = response, ...), id = bold_tax_id(id = id, dataTypes = dataTypes, includeTree = includeTree, response = response, ...) ) return(tmp) } parsecoldata <- function(x){ vals <- x[c('id','name','rank','name_status','source_database')] vals[sapply(vals, is.null)] <- NA names(vals) <- c('id','name','rank','name_status','source_database') bb <- data.frame(vals, stringsAsFactors = FALSE) names(bb)[4:5] <- c('status', 'source') acc <- x$accepted_name if (is.null(acc)) { accdf <- data.frame(acc_id = NA, acc_name = NA, acc_rank = NA, acc_status = NA, acc_source = NA, stringsAsFactors = FALSE) } else { accdf <- data.frame(acc[c('id','name','rank','name_status','source_database')], stringsAsFactors = FALSE) names(accdf) <- c('acc_id','acc_name','acc_rank','acc_status','acc_source') } cbind(bb, accdf) } taxize/R/eubon_children.R0000644000176200001440000000333213060060133015053 0ustar liggesusers#' EUBON children #' #' @export #' @param id (character) identifier for the taxon. (LSID, DOI, URI, or any #' other identifier used by the checklist provider) #' @param providers (character) A list of provider id strings concatenated by #' comma characters. The default : "pesi,bgbm-cdm-server[col]" will be used if #' this parameter is not set. A list of all available provider ids can be #' obtained from the '/capabilities' service end point. Providers can be #' nested, that is a parent provider can have sub providers. If the id of the #' parent provider is supplied all subproviders will be queried. The query #' can also be restricted to one or more subproviders by using the following #' syntax: parent-id[sub-id-1,sub-id2,...] #' @param timeout (numeric) The maximum of milliseconds to wait for responses #' from any of the providers. If the timeout is exceeded the service will just #' return the responses that have been received so far. The default timeout is #' 0 ms (wait for ever) #' @param ... Curl options passed on to \code{\link[httr]{GET}} #' @references \url{http://cybertaxonomy.eu/eu-bon/utis/1.2/doc.html} #' @return a data.frame or an empty list if no results found #' @family eubon-methods #' @examples \dontrun{ #' x <- eubon_children(id = "urn:lsid:marinespecies.org:taxname:126141", #' providers = 'worms') #' head(x) #' } eubon_children <- function(id, providers = NULL, timeout = 0, ...) { args <- tc(list(providers = paste0(providers, collapse = ","), timeout = timeout)) res <- httr::GET(file.path(eubon_base(), "classification", id, "children"), query = args, ...) eubon_error(res) tmp <- jsonlite::fromJSON(con_utf8(res), TRUE, flatten = TRUE) tmp$query$response[[1]] } taxize/R/tpl_search.r0000644000176200001440000000043312672106003014263 0ustar liggesusers#' A light wrapper around the taxonstand fxn to call Theplantlist.org database. #' #' THIS FUNCTION IS DEFUNCT. #' #' @export #' @rdname tpl_search-defunct tpl_search <- function() { .Defunct(msg = "This function is defunct. Use the Taxonstand functions TPL or TPLck directly.") } taxize/R/lowest_common.R0000644000176200001440000002057213023133330014764 0ustar liggesusers#' Retrieve the lowest common taxon and rank for a given taxon name or ID #' #' @export #' @param x Vector of taxa names (character) or id (character or numeric) to #' query. #' @param db character; database to query. either \code{ncbi}, \code{itis}, #' \code{gbif}, \code{col}, or \code{tol} #' @param rows (numeric) Any number from 1 to infinity. If the default NA, #' all rows are considered. Note that this parameter is ignored if you pass in #' a taxonomic id of any of the acceptable classes: tsn, colid, gbifid, tolid. #' NCBI has a method for this function but rows doesn't work. #' @param class_list (list) A list of classifications, as returned from #' \code{\link[taxize]{classification}} #' @param low_rank (character) taxonomic rank to return, of length 1 #' @param ... Other arguments passed to \code{\link[taxize]{get_tsn}}, #' \code{\link[taxize]{get_uid}}, \code{\link[taxize]{get_colid}}, #' \code{\link[taxize]{get_gbifid}}, \code{\link[taxize]{get_tolid}} #' #' @return NA when no match, or a data.frame with columns #' \itemize{ #' \item name #' \item rank #' \item id #' } #' @author Jimmy O'Donnell \email{jodonnellbio@@gmail.com} #' Scott Chamberlain \email{myrmecocystus@gmail.com} #' @examples \dontrun{ #' id <- c("9031", "9823", "9606", "9470") #' id_class <- classification(id, db = 'ncbi') #' lowest_common(id[2:4], db = "ncbi") #' lowest_common(id[2:4], db = "ncbi", low_rank = 'class') #' lowest_common(id[2:4], db = "ncbi", low_rank = 'family') #' lowest_common(id[2:4], class_list = id_class) #' lowest_common(id[2:4], class_list = id_class, low_rank = 'class') #' lowest_common(id[2:4], class_list = id_class, low_rank = 'family') #' #' # COL #' taxa <- c('Nycticebus coucang', 'Homo sapiens', 'Sus scrofa') #' cls <- classification(taxa, db = "col") #' lowest_common(taxa, class_list = cls, db = "col") #' lowest_common(get_colid(taxa), class_list = cls) #' xx <- get_colid(taxa) #' lowest_common(xx, class_list = cls) #' #' # TOL #' taxa <- c("Angraecum sesquipedale", "Dracula vampira", #' "Masdevallia coccinea") #' (cls <- classification(taxa, db = "tol")) #' lowest_common(taxa, db = "tol", class_list = cls) #' lowest_common(get_tolid(taxa), class_list = cls) #' xx <- get_tolid(taxa) #' lowest_common(xx, class_list = cls) #' #' spp <- c("Sus scrofa", "Homo sapiens", "Nycticebus coucang") #' lowest_common(spp, db = "ncbi") #' lowest_common(get_uid(spp)) #' #' lowest_common(spp, db = "itis") #' lowest_common(get_tsn(spp)) #' #' gbifid <- c("2704179", "3119195") #' lowest_common(gbifid, db = "gbif") #' #' spp <- c("Poa annua", "Helianthus annuus") #' lowest_common(spp, db = "gbif") #' lowest_common(get_gbifid(spp)) #' #' cool_orchid <- c("Angraecum sesquipedale", "Dracula vampira", #' "Masdevallia coccinea") #' orchid_ncbi <- get_uid(cool_orchid) #' orchid_gbif <- get_gbifid(cool_orchid) #' #' cool_orchids2 <- c("Domingoa haematochila", "Gymnadenia conopsea", #' "Masdevallia coccinea") #' orchid_itis <- get_tsn(cool_orchids2) #' #' orchid_hier_ncbi <- classification(orchid_ncbi, db = 'ncbi') #' orchid_hier_gbif <- classification(orchid_gbif, db = 'gbif') #' orchid_hier_itis <- classification(orchid_itis, db = 'itis') #' #' lowest_common(orchid_ncbi, low_rank = 'class') #' lowest_common(orchid_ncbi, class_list = orchid_hier_ncbi, #' low_rank = 'class') #' lowest_common(orchid_gbif, low_rank = 'class') #' lowest_common(orchid_gbif, orchid_hier_gbif, low_rank = 'class') #' lowest_common(get_uid(cool_orchid), low_rank = 'class') #' lowest_common(get_uid(cool_orchid), low_rank = 'family') #' #' lowest_common(orchid_ncbi, class_list = orchid_hier_ncbi, #' low_rank = 'subfamily') #' lowest_common(orchid_gbif, class_list = orchid_hier_gbif, #' low_rank = 'subfamily') #' #' lowest_common(orchid_itis, class_list = orchid_hier_itis, #' low_rank = 'class') #' #' ## Pass in sci. names #' nms <- c("Angraecum sesquipedale", "Dracula vampira", "Masdevallia coccinea") #' lowest_common(x = nms, db = "ncbi") #' lowest_common(x = nms, db = "gbif") #' # lowest_common(x = nms, db = "itis") #' #' ## NAs due to taxon not found, stops with error message #' # lowest_common(orchid_itis, db = "itis") #' # lowest_common(get_tsn(cool_orchid)) #' } lowest_common <- function(...){ UseMethod("lowest_common") } #' @export #' @rdname lowest_common lowest_common.default <- function(x, db = NULL, rows = NA, class_list = NULL, low_rank = NULL, ...) { if (is.null(db)) if (!is.null(class_list)) db <- attr(class_list, "db") nstop(db) switch( db, itis = { id <- process_lowest_ids(x, db, get_tsn, rows = rows, ...) lowest_common(id, class_list, ...) }, ncbi = { id <- process_lowest_ids(x, db, get_uid, rows = rows, ...) lowest_common(id, class_list, ...) }, gbif = { id <- process_lowest_ids(x, db, get_gbifid, rows = rows, ...) lowest_common(id, class_list, ...) }, col = { id <- process_lowest_ids(x, db, get_colid, rows = rows, ...) lowest_common(id, class_list, ...) }, tol = { id <- process_lowest_ids(x, db, get_tolid, rows = rows, ...) lowest_common(id, class_list, ...) }, stop("the provided db value was not recognised", call. = FALSE) ) } #' @export #' @rdname lowest_common lowest_common.uid <- function(x, class_list = NULL, low_rank = NULL, ...) { check_lowest_ids(x) class_list <- get_class(x, class_list, db = "uid", ...) lc_helper(x, class_list, low_rank, ...) } #' @export #' @rdname lowest_common lowest_common.tsn <- function(x, class_list = NULL, low_rank = NULL, ...) { check_lowest_ids(x) class_list <- get_class(x, class_list, db = "itis", ...) lc_helper(x, class_list, low_rank, ...) } #' @export #' @rdname lowest_common lowest_common.gbifid <- function(x, class_list = NULL, low_rank = NULL, ...) { check_lowest_ids(x) class_list <- get_class(x, class_list, db = "gbif", ...) lc_helper(x, class_list, low_rank, ...) } #' @export #' @rdname lowest_common lowest_common.colid <- function(x, class_list = NULL, low_rank = NULL, ...) { check_lowest_ids(x) class_list <- get_class(x, class_list, db = "col", ...) names(class_list) <- x lc_helper(x, class_list, low_rank, ...) } #' @export #' @rdname lowest_common lowest_common.tolid <- function(x, class_list = NULL, low_rank = NULL, ...) { check_lowest_ids(x) class_list <- get_class(x, class_list, db = "tol", ...) names(class_list) <- x lc_helper(x, class_list, low_rank, ...) } # helpers ------------------------------------------------- lc_helper <- function(x, class_list, low_rank = NULL, ...) { idc <- class_list[x] # next line NCBI specific cseq <- vapply(idc, function(x) x[1, 1] != "unclassified sequences", logical(1)) idc <- idc[cseq] if (is.null(low_rank)) { x_row <- length(Reduce(intersect, lapply(idc, "[[", 1))) x <- idc[[1]][x_row, ] if (x[1, "rank"] == "no rank") { x[1, "rank"] <- next_best_taxon(idc[[1]][1:x_row, ]) } return(x) } else { valid_ranks <- tolower(ritis::rank_names()$rankname) if (!(low_rank %in% valid_ranks)) { warning('the supplied rank is not valid') } # low_rank_names <- as.character(unique(unlist(lapply(idc, function(x) x$name[which(x$rank == low_rank)])))) low_rank_names <- unique(setDF(rbindlist(lapply(idc, function(x) x[which(x$rank == low_rank),])))) if (NROW(low_rank_names) == 1) { return(low_rank_names) } else { return(NA) } } } next_best_taxon <- function(x){ paste("below-", tail(x[, "rank"][!duplicated(x[, "rank"])], n = 1 ), sep = "") } get_class <- function(x, y, db, ...) { if (is.null(y)) { classification(x, db = db, ...) } else { yattr <- str_replace(attr(y, "db"), "ncbi", "uid") if (yattr != db) { stop(sprintf("class_list input must be of class '%s'", db), call. = FALSE) } y } } check_lowest_ids <- function(x) { notmiss <- na.omit(x) if (length(notmiss) < 2) { stop(length(notmiss), " found, ", length(x) - length(notmiss), " were NA; > 1 needed", call. = FALSE) } } process_lowest_ids <- function(input, db, fxn, ...) { g <- tryCatch(as.numeric(as.character(input)), warning = function(e) e) if (inherits(g, "numeric") || is.character(input) && grepl("[[:digit:]]", input)) { as_fxn <- switch(db, itis = as.tsn, gbif = as.gbifid, ncbi = as.uid, col = as.colid, tol = as.tolid) as_fxn(input, check = FALSE) } else { eval(fxn)(input, ...) } } taxize/R/tp_accnames.R0000644000176200001440000000376412672106003014366 0ustar liggesusers#' Return all accepted names for a taxon name with a given id. #' #' @export #' @param id the taxon identifier code #' @param key Your Tropicos API key; loads from .Rprofile. #' @param ... Curl options passed on to \code{\link[httr]{GET}} #' @return List or dataframe. #' @examples \dontrun{ #' tp_accnames(id = 25503923) #' tp_accnames(id = 25538750) #' #' # No accepted names found #' tp_accnames(id = 25509881) #' } tp_accnames <- function(id, key = NULL, ...) { url = sprintf('http://services.tropicos.org/Name/%s/AcceptedNames', id) key <- getkey(key, "tropicosApiKey") args <- tc(list(apikey = key, format = 'json')) tmp <- GET(url, query = args, ...) stop_for_status(tmp) tmp2 <- con_utf8(tmp) res <- jsonlite::fromJSON(tmp2, FALSE) if ("Error" %in% names(res[[1]])) { res[[1]] } else { vvv <- lapply(res, getdata) syns <- do.call(rbind.fill, lapply(vvv, "[[", "syn")) accs <- do.call(rbind.fill, lapply(vvv, "[[", "acc")) refs <- do.call(rbind.fill, lapply(vvv, "[[", "ref")) list(synonyms = syns, acceptednames = accs, reference = refs) } } getdata <- function(x) { syn <- data.frame(x$SynonymName, stringsAsFactors = FALSE) names(syn) <- tolower(names(syn)) acc <- data.frame(x$AcceptedName, stringsAsFactors = FALSE) names(acc) <- tolower(names(acc)) ref <- data.frame(x$Reference, stringsAsFactors = FALSE) names(ref) <- tolower(names(ref)) list(syn = syn, acc = acc, ref = ref) } #' Return all accepted names for a taxon name with a given id. #' #' Function name changed to tp_accnames. #' #' @param id the taxon identifier code #' @param format return in json or xml format (defaults to json) #' @param output raw = json or xml; or df = data.frame #' @param key Your Tropicos API key; loads from .Rprofile. #' @export #' @keywords internal #' @rdname tp_acceptednames-deprecated tp_acceptednames <- function(id, format = 'json', output = 'df', key = NULL) { .Deprecated("tp_accnames", "taxize", "Function name changed. See tp_accnames", "tp_acceptednames") } taxize/R/scrapenames.r0000644000176200001440000001223313124513241014440 0ustar liggesusers#' @title Resolve names using Global Names Recognition and Discovery. #' #' @description Uses the Global Names Recognition and Discovery service, see #' \url{http://gnrd.globalnames.org/}. #' #' Note: this function sometimes gives data back and sometimes not. The API #' that this function is extremely buggy. #' #' @export #' @param url An encoded URL for a web page, PDF, Microsoft Office document, or #' image file, see examples #' @param file When using multipart/form-data as the content-type, a file may #' be sent. This should be a path to your file on your machine. #' @param text Type: string. Text content; best used with a POST request, see #' examples #' @param engine (optional) (integer) Default: 0. Either 1 for TaxonFinder, #' 2 for NetiNeti, or 0 for both. If absent, both engines are used. #' @param unique (optional) (logical) If \code{TRUE} (default), response has #' unique names without offsets. #' @param verbatim (optional) Type: boolean, If \code{TRUE} (default to #' \code{FALSE}), response excludes verbatim strings. #' @param detect_language (optional) Type: boolean, When \code{TRUE} (default), #' NetiNeti is not used if the language of incoming text is determined not to #' be English. When \code{FALSE}, NetiNeti will be used if requested. #' @param all_data_sources (optional) Type: boolean. Resolve found names #' against all available Data Sources. #' @param data_source_ids (optional) Type: string. Pipe separated list of #' data source ids to resolve found names against. See list of Data Sources #' \url{http://resolver.globalnames.org/data_sources}. #' @param return_content (logical) return OCR'ed text. returns text #' string in \code{x$meta$content} slot. Default: \code{FALSE} #' @param ... Further args passed to \code{\link[httr]{GET}} #' @author Scott Chamberlain {myrmecocystus@@gmail.com} #' @return A list of length two, first is metadata, second is the data as a #' data.frame. #' @details One of url, file, or text must be specified - and only one of them. #' @examples \dontrun{ #' # Get data from a website using its URL #' scrapenames('http://en.wikipedia.org/wiki/Araneae') #' scrapenames('http://en.wikipedia.org/wiki/Animalia') #' scrapenames('http://www.plosone.org/article/info%3Adoi%2F10.1371%2Fjournal.pone.0095068') #' scrapenames('http://www.plosone.org/article/info%3Adoi%2F10.1371%2Fjournal.pone.0080498') #' scrapenames('http://ucjeps.berkeley.edu/cgi-bin/get_JM_treatment.pl?CARYOPHYLLACEAE') #' #' # Scrape names from a pdf at a URL #' url <- 'http://www.plosone.org/article/fetchObject.action?uri= #' info%3Adoi%2F10.1371%2Fjournal.pone.0058268&representation=PDF' #' scrapenames(url = sub('\n', '', url)) #' #' # With arguments #' scrapenames(url = 'http://www.mapress.com/zootaxa/2012/f/z03372p265f.pdf', #' unique=TRUE) #' scrapenames(url = 'http://en.wikipedia.org/wiki/Araneae', #' data_source_ids=c(1, 169)) #' #' # Get data from a file #' speciesfile <- system.file("examples", "species.txt", package = "taxize") #' scrapenames(file = speciesfile) #' #' nms <- paste0(names_list("species"), collapse="\n") #' file <- tempfile(fileext = ".txt") #' writeLines(nms, file) #' scrapenames(file = file) #' #' # Get data from text string #' scrapenames(text='A spider named Pardosa moesta Banks, 1892') #' #' # return OCR content #' scrapenames(url='http://www.mapress.com/zootaxa/2012/f/z03372p265f.pdf', #' return_content = TRUE) #' #' # use curl options #' library("httr") #' scrapenames(text='A spider named Pardosa moesta Banks, 1892') #' } scrapenames <- function(url = NULL, file = NULL, text = NULL, engine = NULL, unique = NULL, verbatim = NULL, detect_language = NULL, all_data_sources = NULL, data_source_ids = NULL, return_content = FALSE, ...) { method <- tc(list(url = url, file = file, text = text)) if (length(method) > 1) { stop("Only one of url, file, or text can be used", call. = FALSE) } base <- "http://gnrd.globalnames.org/name_finder.json" if (!is.null(data_source_ids)) data_source_ids <- paste0(data_source_ids, collapse = "|") args <- tc(list(url = url, text = text, engine = engine, unique = unique, verbatim = verbatim, detect_language = detect_language, all_data_sources = all_data_sources, data_source_ids = data_source_ids, return_content = as_l(return_content))) if (names(method) == 'url') { tt <- GET(base, query = args, ...) warn_for_status(tt) out <- jsonlite::fromJSON(con_utf8(tt)) token_url <- out$token_url } else { if (names(method) == "text") { tt <- POST(base, body = list(text = text), encode = "form", dontfollow(), ...) } else { tt <- POST(base, query = argsnull(args), encode = "multipart", body = list(file = upload_file(file)), dontfollow(), ...) } if (tt$status_code != 303) warn_for_status(tt) token_url <- tt$headers$location } st <- 303 while (st == 303) { dat <- GET(token_url) warn_for_status(dat) tmp <- con_utf8(dat) datout <- jsonlite::fromJSON(tmp) st <- datout$status } meta <- datout[!names(datout) %in% c("names")] list(meta = meta, data = nmslwr(datout$names)) } dontfollow <- function() config(followlocation = 0) taxize/R/itis_terms.R0000644000176200001440000000222612771303100014260 0ustar liggesusers#' Get ITIS terms, i.e., tsn's, authors, common names, and scientific names. #' #' @export #' @param query One or more common or scientific names, or partial names #' @param what One of both (search common and scientific names), common #' (search just common names), or scientific (search just scientific names) #' @param ... Further arguments passed on to \code{\link[ritis]{terms}} #' @examples \dontrun{ #' # Get terms searching both common and scientific names #' itis_terms(query='bear') #' #' # Get terms searching just common names #' itis_terms(query='tarweed', "common") #' #' # Get terms searching just scientific names #' itis_terms(query='Poa annua', "scientific") #' } itis_terms <- function(query, what = "both", ...) { if (!what %in% c('both', 'scientific', 'common')) { stop("what must be one of 'both', 'scientific', 'common'", call. = FALSE) } temp <- switch( what, both = lapply(query, ritis::terms, ...), common = lapply(query, ritis::terms, what = "common", ...), scientific = lapply(query, ritis::terms, what = "scientific", ...) ) if (length(query) == 1) { temp[[1]] } else { stats::setNames(temp, query) } } taxize/R/get_uid.R0000644000176200001440000003354013160573036013533 0ustar liggesusers#' Get the UID codes from NCBI for taxonomic names. #' #' Retrieve the Unique Identifier (UID) of a taxon from NCBI taxonomy browser. #' #' @export #' @param sciname character; scientific name. #' @param ask logical; should get_uid be run in interactive mode? If TRUE and #' more than one TSN is found for the species, the user is asked for input. If #' FALSE NA is returned for multiple matches. #' @param verbose logical; If TRUE the actual taxon queried is printed on the #' console. #' @param rows numeric; Any number from 1 to infinity. If the default NA, all #' rows are considered. Note that this function still only gives back a uid #' class object with one to many identifiers. See #' \code{\link[taxize]{get_uid_}} to get back all, or a subset, of the raw #' data that you are presented during the ask process. #' @param modifier (character) A modifier to the \code{sciname} given. Options #' include: Organism, Scientific Name, Common Name, All Names, Division, #' Filter, Lineage, GC, MGC, Name Tokens, Next Level, PGC, Properties, Rank, #' Subtree, Synonym, Text Word. These are not checked, so make sure they are #' entered correctly, as is. #' @param rank_query (character) A taxonomic rank name to modify the query sent #' to NCBI. See \code{\link{rank_ref}} for possible options. Though note that #' some data sources use atypical ranks, so inspect the data itself for #' options. Optional. See \code{Querying} below. #' @param division_filter (character) A division (aka phylum) name to filter #' data after retrieved from NCBI. Optional. See \code{Filtering} below. #' @param rank_filter (character) A taxonomic rank name to filter data after #' retrieved from NCBI. See \code{\link{rank_ref}} for possible options. #' Though note that some data sources use atypical ranks, so inspect the data #' itself for options. Optional. See \code{Filtering} below. #' @param x Input to \code{\link{as.uid}} #' @param ... Ignored #' @param check logical; Check if ID matches any existing on the DB, only used #' in \code{\link{as.uid}} #' @template getreturn #' #' @section Querying: The parameter \code{rank_query} is used in the search sent #' to NCBI, whereas \code{rank_filter} filters data after it comes back. The #' parameter \code{modifier} adds modifiers to the name. For example, #' \code{modifier="Organism"} adds that to the name, giving e.g., #' \code{Helianthus[Organism]}. #' #' @section Filtering: The parameters \code{division_filter} and #' \code{rank_filter} are not used in the search to the data provider, but are #' used in filtering the data down to a subset that is closer to the target #' you want. For all these parameters, you can use regex strings since we use #' \code{\link{grep}} internally to match. Filtering narrows down to the set #' that matches your query, and removes the rest. #' #' @section Beware: NCBI does funny things sometimes. E.g., if you search on #' Fringella morel, a slight misspelling of the genus name, and a non-existent #' epithet, NCBI gives back a morel fungal species. In addition, NCBI doesn't #' really do fuzzy searching very well, so if there is a slight mis-spelling #' in your names, you likely won't get what you are expecting. The lesson: #' clean your names before using this function. Other data sources are better #' about fuzzy matching. #' #' @family taxonomic-ids #' @seealso \code{\link[taxize]{classification}} #' #' @author Eduard Szoecs, \email{eduardszoecs@@gmail.com} #' #' @examples \dontrun{ #' get_uid(c("Chironomus riparius", "Chaetopteryx")) #' get_uid(c("Chironomus riparius", "aaa vva")) #' #' # When not found #' get_uid("howdy") #' get_uid(c("Chironomus riparius", "howdy")) #' #' # Narrow down results to a division or rank, or both #' ## By modifying the query #' ### w/ modifiers to the name #' get_uid(sciname = "Aratinga acuticauda", modifier = "Organism") #' get_uid(sciname = "bear", modifier = "Common Name") #' #' ### w/ rank query #' get_uid(sciname = "Pinus", rank_query = "genus") #' get_uid(sciname = "Pinus", rank_query = "subgenus") #' ### division query doesn't really work, for unknown reasons, so not available #' #' ## By filtering the result #' ## Echinacea example #' ### Results w/o narrowing #' get_uid("Echinacea") #' ### w/ division #' get_uid(sciname = "Echinacea", division_filter = "eudicots") #' get_uid(sciname = "Echinacea", division_filter = "sea urchins") #' #' ## Satyrium example #' ### Results w/o narrowing #' get_uid(sciname = "Satyrium") #' ### w/ division #' get_uid(sciname = "Satyrium", division_filter = "monocots") #' get_uid(sciname = "Satyrium", division_filter = "butterflies") #' #' ## Rank example #' get_uid(sciname = "Pinus") #' get_uid(sciname = "Pinus", rank_filter = "genus") #' get_uid(sciname = "Pinus", rank_filter = "subgenus") #' #' # Fuzzy filter on any filtering fields #' ## uses grep on the inside #' get_uid("Satyrium", division_filter = "m") #' #' # specify rows to limit choices available #' get_uid('Dugesia') # user prompt needed #' get_uid('Dugesia', rows=1) # 2 choices, so returns only 1 row, so no choices #' get_uid('Dugesia', ask = FALSE) # returns NA for multiple matches #' #' # Go to a website with more info on the taxon #' res <- get_uid("Chironomus riparius") #' browseURL(attr(res, "uri")) #' #' # Convert a uid without class information to a uid class #' as.uid(get_uid("Chironomus riparius")) # already a uid, returns the same #' as.uid(get_uid(c("Chironomus riparius","Pinus contorta"))) # same #' as.uid(315567) # numeric #' as.uid(c(315567,3339,9696)) # numeric vector, length > 1 #' as.uid("315567") # character #' as.uid(c("315567","3339","9696")) # character vector, length > 1 #' as.uid(list("315567","3339","9696")) # list, either numeric or character #' ## dont check, much faster #' as.uid("315567", check=FALSE) #' as.uid(315567, check=FALSE) #' as.uid(c("315567","3339","9696"), check=FALSE) #' as.uid(list("315567","3339","9696"), check=FALSE) #' #' (out <- as.uid(c(315567,3339,9696))) #' data.frame(out) #' as.uid( data.frame(out) ) #' #' # Get all data back #' get_uid_("Puma concolor") #' get_uid_("Dugesia") #' get_uid_("Dugesia", rows=2) #' get_uid_("Dugesia", rows=1:2) #' get_uid_(c("asdfadfasd","Pinus contorta")) #' #' # use curl options #' library("httr") #' get_uid("Quercus douglasii", config=verbose()) #' bb <- get_uid("Quercus douglasii", config=progress()) #' } get_uid <- function(sciname, ask = TRUE, verbose = TRUE, rows = NA, modifier = NULL, rank_query = NULL, division_filter = NULL, rank_filter = NULL, ...) { assert(ask, "logical") assert(verbose, "logical") assert(modifier, "character") assert(rank_query, "character") assert(division_filter, "character") assert(rank_filter, "character") fun <- function(sciname, ask, verbose, rows, ...) { direct <- FALSE mssg(verbose, "\nRetrieving data for taxon '", sciname, "'\n") sciname <- gsub(" ", "+", sciname) if (!is.null(modifier)) sciname <- paste0(sciname, sprintf("[%s]", modifier)) url <- paste(paste0(ncbi_base(), "/entrez/eutils/esearch.fcgi?db=taxonomy&term="), sciname, sep = "") if (!is.null(rank_query)) url <- paste0(url, sprintf(" AND %s[Rank]", rank_query)) url <- utils::URLencode(url) errors_to_catch <- c("Could not resolve host: eutils.ncbi.nlm.nih.gov") xml_result <- xml2::read_xml(repeat_until_it_works(catch = errors_to_catch, url = url)) # NCBI limits requests to three per second Sys.sleep(0.33) uid <- xml2::xml_text(xml2::xml_find_all(xml_result, "//IdList/Id")) mm <- length(uid) > 1 if (length(uid) == 0) { # if taxon name is not found uid <- NA_character_ } else { att <- 'found' } # not found on ncbi if (length(uid) == 0 || is.na(uid)) { mssg(verbose, "Not found. Consider checking the spelling or alternate classification") uid <- NA_character_ att <- 'NA due to not found' } # more than one found on ncbi -> user input if (length(uid) > 1) { baseurl <- paste0(ncbi_base(), "/entrez/eutils/esummary.fcgi?db=taxonomy") ID <- paste("ID=", paste(uid, collapse = ","), sep = "") url <- paste(baseurl, ID, sep = "&") errors_to_catch <- c("Could not resolve host: eutils.ncbi.nlm.nih.gov") tt <- repeat_until_it_works(catch = errors_to_catch, url = url, ...) ttp <- xml2::read_xml(tt) df <- parse_ncbi(ttp) rownames(df) <- 1:nrow(df) if (!is.null(division_filter) || !is.null(rank_filter)) { df <- filt(df, "division", division_filter) df <- filt(df, "rank", rank_filter) } df <- sub_rows(df, rows) uid <- df$uid if (length(uid) == 1) { direct <- TRUE att <- "found" } if (length(uid) == 0) { uid <- NA_character_ } if (length(uid) > 1) { if (!ask) { if (length(uid) == 1) { att <- "found" } else { warning( sprintf("More than one UID found for taxon '%s'; refine query or set ask=TRUE", sciname), call. = FALSE ) uid <- NA_character_ att <- 'NA due to ask=FALSE & > 1 result' } } else { # prompt rownames(df) <- 1:nrow(df) message("\n\n") message("\nMore than one UID found for taxon '", sciname, "'!\n Enter rownumber of taxon (other inputs will return 'NA'):\n") print(df) take <- scan(n = 1, quiet = TRUE, what = 'raw') if (length(take) == 0) { take <- 'notake' att <- 'nothing chosen' } if (take %in% seq_len(nrow(df))) { take <- as.numeric(take) message("Input accepted, took UID '", as.character(df$uid[take]), "'.\n") uid <- as.character(df$uid[take]) att <- 'found' } else { uid <- NA_character_ att <- 'NA due to user input out of range' mssg(verbose, "\nReturned 'NA'!\n\n") } } } } return(data.frame(uid, att, multiple = mm, direct = direct, stringsAsFactors = FALSE)) } sciname <- as.character(sciname) outd <- ldply(sciname, fun, ask, verbose, rows, ...) out <- structure(outd$uid, class = "uid", match = outd$att, multiple_matches = outd$multiple, pattern_match = outd$direct) add_uri(out, 'https://www.ncbi.nlm.nih.gov/taxonomy/%s') } repeat_until_it_works <- function(catch, url, max_tries = 3, wait_time = 10, verbose = TRUE, ...) { error_handler <- function(e) { if (e$message %in% catch) { if (verbose) warning(paste("Caught error:", e$message)) return(NA) } else { stop(e$message) } } for (count in 1:max_tries) { output <- tryCatch(con_utf8(GET(url = url, ...)), error = error_handler) if (!is.na(output)) return(output) Sys.sleep(wait_time * count) } return(output) } #' @export #' @rdname get_uid as.uid <- function(x, check=TRUE) UseMethod("as.uid") #' @export #' @rdname get_uid as.uid.uid <- function(x, check=TRUE) x #' @export #' @rdname get_uid as.uid.character <- function(x, check=TRUE) if(length(x) == 1) make_uid(x, check) else collapse(x, make_uid, "uid", check=check) #' @export #' @rdname get_uid as.uid.list <- function(x, check=TRUE) if(length(x) == 1) make_uid(x, check) else collapse(x, make_uid, "uid", check=check) #' @export #' @rdname get_uid as.uid.numeric <- function(x, check=TRUE) as.uid(as.character(x), check) #' @export #' @rdname get_uid as.uid.data.frame <- function(x, check=TRUE) { structure(x$ids, class="uid", match=x$match, multiple_matches = x$multiple_matches, pattern_match = x$pattern_match, uri=x$uri) } #' @export #' @rdname get_uid as.data.frame.uid <- function(x, ...){ data.frame(ids = as.character(unclass(x)), class = "uid", match = attr(x, "match"), multiple_matches = attr(x, "multiple_matches"), pattern_match = attr(x, "pattern_match"), uri = attr(x, "uri"), stringsAsFactors = FALSE) } make_uid <- function(x, check=TRUE) make_generic(x, 'http://www.ncbi.nlm.nih.gov/taxonomy/%s', "uid", check) check_uid <- function(x){ url <- paste0(ncbi_base(), "/entrez/eutils/esummary.fcgi?db=taxonomy&id=") res <- GET(paste0(url, x)) tt <- xml2::read_xml(con_utf8(res)) tryid <- xml2::xml_text(xml2::xml_find_all(tt, "//Id")) identical(as.character(x), tryid) } #' @export #' @rdname get_uid get_uid_ <- function(sciname, verbose = TRUE, rows = NA){ setNames(lapply(sciname, get_uid_help, verbose = verbose, rows = rows), sciname) } get_uid_help <- function(sciname, verbose, rows){ mssg(verbose, "\nRetrieving data for taxon '", sciname, "'\n") url <- paste(paste0(ncbi_base(), "/entrez/eutils/esearch.fcgi?db=taxonomy&term="), gsub(" ", "+", sciname), sep = "") xml_result <- xml2::read_xml(con_utf8(GET(url))) Sys.sleep(0.33) uid <- xml_text(xml_find_all(xml_result, "//IdList/Id")) if (length(uid) == 0) { NULL } else { baseurl <- paste0(ncbi_base(), "/entrez/eutils/esummary.fcgi?db=taxonomy") ID <- paste("ID=", paste(uid, collapse = ","), sep = "") url <- paste(baseurl, ID, sep = "&") tt <- con_utf8(GET(url)) ttp <- xml2::read_xml(tt) df <- parse_ncbi(ttp) sub_rows(df, rows) } } parse_ncbi <- function(x) { mget <- c("Status", "Rank", "Division", "ScientificName", "CommonName", "TaxId", "Genus", "Species", "Subsp", "ModificationDate") nget <- paste0('Item[@Name="', mget, "\"]") nodes <- xml_find_all(x, "//DocSum") tmp <- taxize_ldfast(lapply(nodes, function(z) { data.frame(as.list(setNames(sapply(nget, function(w) xml_text(xml_find_all(z, w))), tolower(mget))), stringsAsFactors = FALSE) })) rename(tmp, c('taxid' = 'uid')) } ncbi_base <- function() "https://eutils.ncbi.nlm.nih.gov" taxize/R/eol_invasive.R0000644000176200001440000000044612672106003014566 0ustar liggesusers#' Search for presence of taxonomic names in EOL invasive species databases. #' #' THIS FUNCTION IS DEFUNCT. #' #' @export #' @rdname eol_invasive-defunct #' @keywords internal eol_invasive <- function(...) { .Defunct("eol", "originr", msg = "This function is defunct. See originr::eol()") } taxize/R/get_tpsid.R0000644000176200001440000002325513160773625014105 0ustar liggesusers#' Get the NameID codes from Tropicos for taxonomic names. #' #' @export #' @param sciname (character) One or more scientific name's as a vector or list. #' @param ask logical; should get_tpsid be run in interactive mode? #' If TRUE and more than one ID is found for the species, the user is asked for #' input. If FALSE NA is returned for multiple matches. #' @param verbose logical; If TRUE the actual taxon queried is printed on the console. #' @param key Your API key; loads from .Rprofile. #' @param rows numeric; Any number from 1 to infinity. If the default NA, all rows are considered. #' Note that this function still only gives back a tpsid class object with one to many identifiers. #' See \code{\link[taxize]{get_tpsid_}} to get back all, or a subset, of the raw data that you are #' presented during the ask process. #' @param family (character) A family name. Optional. See \code{Filtering} below. #' @param rank (character) A taxonomic rank name. See \code{\link{rank_ref}} for possible #' options. Though note that some data sources use atypical ranks, so inspect the #' data itself for options. Optional. See \code{Filtering} below. #' @param ... Other arguments passed to \code{\link[taxize]{tp_search}}. #' @param x Input to \code{\link{as.tpsid}} #' @param check logical; Check if ID matches any existing on the DB, only used in #' \code{\link{as.tpsid}} #' @template getreturn #' #' @section Filtering: #' The parameters \code{family} and \code{rank} are not used in the search to the data #' provider, but are used in filtering the data down to a subset that is closer to the #' target you want. For all these parameters, #' you can use regex strings since we use \code{\link{grep}} internally to match. #' Filtering narrows down to the set that matches your query, and removes the rest. #' #' @family taxonomic-ids #' @seealso \code{\link[taxize]{classification}} #' #' @author Scott Chamberlain, \email{myrmecocystus@@gmail.com} #' #' @examples \dontrun{ #' get_tpsid(sciname='Poa annua') #' get_tpsid(sciname='Pinus contorta') #' #' get_tpsid(c("Poa annua", "Pinus contorta")) #' #' # specify rows to limit choices available #' get_tpsid('Poa annua') #' get_tpsid('Poa annua', rows=1) #' get_tpsid('Poa annua', rows=25) #' get_tpsid('Poa annua', rows=1:2) #' #' # When not found, NA given (howdy is not a species name, and Chrinomus is a fly) #' get_tpsid("howdy") #' get_tpsid(c("Chironomus riparius", "howdy")) #' #' # Narrow down results to a division or rank, or both #' ## Satyrium example #' ### Results w/o narrowing #' get_tpsid("Satyrium") #' ### w/ rank #' get_tpsid("Satyrium", rank = "var.") #' get_tpsid("Satyrium", rank = "sp.") #' #' ## w/ family #' get_tpsid("Poa") #' get_tpsid("Poa", family = "Iridaceae") #' get_tpsid("Poa", family = "Orchidaceae") #' get_tpsid("Poa", family = "Orchidaceae", rank = "gen.") #' #' # Fuzzy filter on any filtering fields #' ## uses grep on the inside #' get_tpsid("Poa", family = "orchidaceae") #' get_tpsid("Aga", fuzzy = TRUE, parent = "*idae") #' #' # pass to classification function to get a taxonomic hierarchy #' classification(get_tpsid(sciname='Poa annua')) #' #' # factor class names are converted to character internally #' spnames <- as.factor(c("Poa annua", "Pinus contorta")) #' class(spnames) #' get_tpsid(spnames) #' #' # pass in a list, works fine #' get_tpsid(list("Poa annua", "Pinus contorta")) #' #' # Convert a tpsid without class information to a tpsid class #' as.tpsid(get_tpsid("Pinus contorta")) # already a tpsid, returns the same #' as.tpsid(get_tpsid(c("Chironomus riparius","Pinus contorta"))) # same #' as.tpsid(24900183) # numeric #' as.tpsid(c(24900183,50150089,50079838)) # numeric vector, length > 1 #' as.tpsid("24900183") # character #' as.tpsid(c("24900183","50150089","50079838")) # character vector, length > 1 #' as.tpsid(list("24900183","50150089","50079838")) # list, either numeric or character #' ## dont check, much faster #' as.tpsid("24900183", check=FALSE) #' as.tpsid(24900183, check=FALSE) #' as.tpsid(c("24900183","50150089","50079838"), check=FALSE) #' as.tpsid(list("24900183","50150089","50079838"), check=FALSE) #' #' (out <- as.tpsid(c(24900183,50150089,50079838))) #' data.frame(out) #' as.tpsid( data.frame(out) ) #' #' # Get all data back #' get_tpsid_("Poa annua") #' get_tpsid_("Poa annua", rows=2) #' get_tpsid_("Poa annua", rows=1:2) #' get_tpsid_(c("asdfadfasd","Pinus contorta"), rows=1:5) #' #' # use curl options #' library("httr") #' get_tpsid("Quercus douglasii", config=verbose()) #' bb <- get_tpsid("Quercus douglasii", config=progress()) #' } get_tpsid <- function(sciname, ask = TRUE, verbose = TRUE, key = NULL, rows = NA, family = NULL, rank = NULL, ...){ assert(ask, "logical") assert(verbose, "logical") assert(family, "character") assert(rank, "character") fun <- function(sciname, ask, verbose, rows, ...) { direct <- FALSE mssg(verbose, "\nRetrieving data for taxon '", sciname, "'\n") tmp <- tp_search(name = sciname, key = key, ...) mm <- NROW(tmp) > 1 # tmp <- sub_rows(tmp, rows) if (names(tmp)[[1]] == 'error' || is.na(tmp) || inherits(tmp, "character")) { mssg(verbose, "Not found. Consider checking the spelling or alternate classification") id <- NA_character_ att <- 'not found' } else { df <- tmp[,c('nameid','scientificname','family','rankabbreviation', 'nomenclaturestatusname','author','displaydate')] names(df) <- c('tpsid','name','family','rank','status','author','date') id <- df$tpsid att <- 'found' } # not found on tropicos if (length(id) == 0) { mssg(verbose, "Not found. Consider checking the spelling or alternate classification") id <- NA_character_ att <- 'not found' } # more than one found on tropicos -> user input if (length(id) > 1) { if (!is.null(family) || !is.null(rank)) { df <- filt(df, "family", family) df <- filt(df, "rank", rank) } df <- sub_rows(df, rows) id <- df$tpsid if (length(id) == 1) { rank_taken <- as.character(df$rank) direct <- TRUE att <- "found" } if (length(id) > 1) { if (ask) { # prompt rownames(df) <- 1:nrow(df) message("\n\n") message("\nMore than one tpsid found for taxon '", sciname, "'!\n Enter rownumber of taxon (other inputs will return 'NA'):\n") rownames(df) <- 1:nrow(df) print(df) take <- scan(n = 1, quiet = TRUE, what = 'raw') if (length(take) == 0) { take <- 'notake' att <- 'nothing chosen' } if (take %in% seq_len(nrow(df))) { take <- as.numeric(take) message("Input accepted, took tpsid '", as.character(df$tpsid[take]), "'.\n") id <- as.character(df$tpsid[take]) att <- 'found' } else { id <- NA_character_ mssg(verbose, "\nReturned 'NA'!\n\n") att <- 'not found' } } else { if (length(id) != 1) { warning( sprintf("More than one tpsid found for taxon '%s'; refine query or set ask=TRUE", sciname), call. = FALSE ) id <- NA_character_ att <- 'NA due to ask=FALSE & > 1 result' } } } } list(id = as.character(id), att = att, multiple = mm, direct = direct) } sciname <- as.character(sciname) out <- lapply(sciname, fun, ask, verbose, rows, ...) ids <- pluck(out, "id", "") atts <- pluck(out, "att", "") ids <- structure(ids, class = "tpsid", match = atts, multiple_matches = pluck(out, "multiple", logical(1)), pattern_match = pluck(out, "direct", logical(1))) add_uri(ids, 'http://tropicos.org/Name/%s') } #' @export #' @rdname get_tpsid as.tpsid <- function(x, check=TRUE) UseMethod("as.tpsid") #' @export #' @rdname get_tpsid as.tpsid.tpsid <- function(x, check=TRUE) x #' @export #' @rdname get_tpsid as.tpsid.character <- function(x, check=TRUE) if(length(x) == 1) make_tpsid(x, check) else collapse(x, make_tpsid, "tpsid", check=check) #' @export #' @rdname get_tpsid as.tpsid.list <- function(x, check=TRUE) if(length(x) == 1) make_tpsid(x, check) else collapse(x, make_tpsid, "tpsid", check=check) #' @export #' @rdname get_tpsid as.tpsid.numeric <- function(x, check=TRUE) as.tpsid(as.character(x), check) #' @export #' @rdname get_tpsid as.tpsid.data.frame <- function(x, check=TRUE) { structure(x$ids, class="tpsid", match=x$match, multiple_matches = x$multiple_matches, pattern_match = x$pattern_match, uri=x$uri) } #' @export #' @rdname get_tpsid as.data.frame.tpsid <- function(x, ...){ data.frame(ids = as.character(unclass(x)), class = "tpsid", match = attr(x, "match"), multiple_matches = attr(x, "multiple_matches"), pattern_match = attr(x, "pattern_match"), uri = attr(x, "uri"), stringsAsFactors = FALSE) } make_tpsid <- function(x, check=TRUE) make_generic(x, 'http://tropicos.org/Name/%s', "tpsid", check) check_tpsid <- function(x){ res <- tp_summary(x) !identical(names(res), "error") } #' @export #' @rdname get_tpsid get_tpsid_ <- function(sciname, verbose = TRUE, key = NULL, rows = NA, ...){ setNames(lapply(sciname, get_tpsid_help, verbose = verbose, key=key, rows = rows, ...), sciname) } get_tpsid_help <- function(sciname, verbose, key, rows, ...){ mssg(verbose, "\nRetrieving data for taxon '", sciname, "'\n") df <- tp_search(name=sciname, key=key, ...) if("error" %in% names(df)) NULL else sub_rows(df, rows) } taxize/R/getkey.R0000644000176200001440000000261612672106003013374 0ustar liggesusers#' Function to get API key. #' #' Checks first to get key from your .Rprofile file for an API key with the #' name 'tropicoskey'. If it is not found, the default key is used. #' #' @param x An API key, defaults to NULL. #' @param service The API data provider, used to match to default guest key. #' @examples \dontrun{ #' getkey(service="tropicos") #' getkey(service="eol") #' } #' @keywords internal #' @export getkey <- function(x = NULL, service) { if (is.null(x)) { keynames <- c("tropicosApiKey", "eolApiKey", "pmApiKey") service <- match.arg(service, keynames, several.ok = FALSE) key <- getOption(service) if (is.null(key)) { keys <- c("00ca3d6a-cbcc-4924-b882-c26b16d54446", "44f1a53227f1c0b6238a997fcfe7513415f948d2", "750bc6b8a550f2b9af1e8aaa34651b4c1111862a", "530763730") names(keys) <- keynames key <- keys[[service]] urls <- c("http://services.tropicos.org/help?requestkey", "http://eol.org/users/register", "http://www.plantminer.com/") names(urls) <- keynames message(paste("Using default key: Please get your own API key at ", urls[service], sep = "")) } else if (is(key, "character")) { key <- key } else { stop("check your key input - it should be a character string", call. = FALSE) } } else { key <- x } key } taxize/R/eol_hierarchy.R0000644000176200001440000000041012672106003014707 0ustar liggesusers#' Retrieve the taxonomic hierarchy from given EOL taxonID. #' #' THIS FUNCTION IS DEFUNCT. #' #' @export #' @rdname eol_hierarchy-defunct #' @keywords internal eol_hierarchy <- function(...) { .Defunct(msg = "This function is defunct. See classification().") } taxize/R/classification.R0000644000176200001440000006700113160565607015112 0ustar liggesusers#' Retrieve the taxonomic hierarchy for a given taxon ID. #' #' @export #' @param x Vector of taxa names (character) or IDs (character or numeric) #' to query. #' @param db character; database to query. either \code{ncbi}, \code{itis}, #' \code{eol}, \code{col}, \code{tropicos}, \code{gbif}, \code{nbn}, #' \code{worms}, \code{natserv}, \code{bold}, or \code{wiki}. Note that each #' taxonomic data source has, their own identifiers, so that if you provide #' the wrong \code{db} value for the identifier you could get a result, but #' it will likely be wrong (not what you were expecting). #' @param id character; identifiers, returned by \code{\link{get_tsn}}, #' \code{\link{get_uid}}, \code{\link{get_eolid}}, #' \code{\link{get_colid}}, \code{\link{get_tpsid}}, #' \code{\link{get_gbifid}}, \code{\link{get_tolid}}, #' \code{\link{get_wormsid}}, \code{\link{get_natservid}}, #' \code{\link{get_wormsid}}, \code{\link{get_wiki}} #' @param callopts Curl options passed on to \code{\link[httr]{GET}} #' @param ... For \code{classification}: other arguments passed to #' \code{\link{get_tsn}}, #' \code{\link{get_uid}}, \code{\link{get_eolid}}, #' \code{\link{get_colid}}, \code{\link{get_tpsid}}, #' \code{\link{get_gbifid}}, \code{\link{get_wormsid}}, #' \code{\link{get_natservid}}, \code{\link{get_wormsid}}, #' \code{\link{get_wiki}}. For \code{rbind.classification} and #' \code{cbind.classification}: one or more objects of class #' \code{classification} #' #' @param start The first record to return. If omitted, the results are returned #' from the first record (start=0). This is useful if the total number of #' results is larger than the maximum number of results returned by a single #' Web service query (currently the maximum number of results returned by a #' single query is 500 for terse queries and 50 for full queries). #' @param checklist character; The year of the checklist to query, if you want #' a specific year's checklist instead of the lastest as default (numeric). #' @param key Your API key; loads from .Rprofile. #' @param return_id (logical) If \code{TRUE} (default), return the taxon id #' as well as the name and rank of taxa in the lineage returned. #' Ignored for natserv as they don't return IDs in their taxonomic #' classification data. #' @param rows (numeric) Any number from 1 to infinity. If the default NA, #' all rows are considered. Note that this parameter is ignored if you pass #' in a taxonomic id instead of a name of class character. #' #' @return A named list of data.frames with the taxonomic classification of #' every supplied taxa. #' @details If IDs are supplied directly (not from the \code{get_*} functions) #' you must specify the type of ID. There is a timeout of 1/3 seconds between #' queries to NCBI. #' #' BEWARE: Right now, NBN doesn't return the queried taxon in the #' classification. But you can attach it yourself quite easily of course. #' This behavior is different from the other data sources. #' #' @seealso \code{\link{get_tsn}}, \code{\link{get_uid}}, #' \code{\link{get_eolid}}, \code{\link{get_colid}}, #' \code{\link{get_tpsid}}, \code{\link{get_gbifid}} #' \code{\link{get_wormsid}}, \code{\link{get_natservid}}, #' \code{\link{get_boldid}}, \code{\link{get_wiki}} #' #' @section Lots of results: #' It may happen sometimes that you get more results back from your query #' than will show in the data.frame on screen. Our advice is to refine your #' query in those cases. On a data source basis we can attempt to help #' make it easier to refine queries, whether it be with the data provider #' (unlikely to happen), or in the code in this package (more likely) - #' let us know if you run into too many results problem and we'll see what #' we can do. #' #' @examples \dontrun{ #' # Plug in taxon IDs #' classification(9606, db = 'ncbi') #' classification(c(9606, 55062), db = 'ncbi') #' classification(129313, db = 'itis') #' classification(57361017, db = 'eol') #' classification(126436, db = 'worms') #' classification("ELEMENT_GLOBAL.2.134717", db = 'natserv') #' classification(c(2704179, 2441176), db = 'gbif') #' classification(25509881, db = 'tropicos') #' classification("NBNSYS0000004786", db = 'nbn') #' classification(as.nbnid("NBNSYS0000004786"), db = 'nbn') #' classification(3930798, db = 'tol') #' ## works the same if IDs are in class character #' classification(c("2704179", "2441176"), db = 'gbif') #' classification("Agapostemon", db = "bold") #' #' # wikispecies #' classification("Malus domestica", db = "wiki") #' classification("Pinus contorta", db = "wiki") #' classification("Pinus contorta", db = "wiki", wiki_site = "commons") #' classification("Pinus contorta", db = "wiki", wiki_site = "pedia") #' classification("Pinus contorta", db = "wiki", wiki_site = "pedia", wiki = "fr") #' #' classification(get_wiki("Malus domestica", "commons")) #' classification(get_wiki("Malus domestica", "species")) #' classification(c("Pinus contorta", "Malus domestica"), db = "wiki") #' #' # Plug in taxon names #' ## in this case, we use get_*() fxns internally to first get taxon IDs #' classification(c("Chironomus riparius", "aaa vva"), db = 'ncbi') #' classification(c("Chironomus riparius", "aaa vva"), db = 'ncbi', #' verbose=FALSE) #' classification(c("Chironomus riparius", "aaa vva"), db = 'itis') #' classification(c("Chironomus riparius", "aaa vva"), db = 'itis', #' verbose=FALSE) #' classification(c("Chironomus riparius", "aaa vva"), db = 'eol') #' classification(c("Chironomus riparius", "aaa vva"), db = 'col') #' classification("Alopias vulpinus", db = 'nbn') #' classification('Gadus morhua', db = 'worms') #' classification('Aquila chrysaetos', db = 'natserv') #' classification('Gadus morhua', db = 'natserv') #' classification('Pomatomus saltatrix', db = 'natserv') #' classification('Aquila chrysaetos', db = 'natserv') #' classification(c("Chironomus riparius", "aaa vva"), db = 'col', #' verbose=FALSE) #' classification(c("Chironomus riparius", "asdfasdfsfdfsd"), db = 'gbif') #' classification("Chironomus", db = 'tol') #' classification("Poa annua", db = 'tropicos') #' #' # Use methods for get_uid, get_tsn, get_eolid, get_colid, get_tpsid #' classification(get_uid(c("Chironomus riparius", "Puma concolor"))) #' #' classification(get_uid(c("Chironomus riparius", "aaa vva"))) #' classification(get_tsn(c("Chironomus riparius", "aaa vva"))) #' classification(get_tsn(c("Chironomus riparius", "aaa vva"), #' verbose = FALSE)) #' classification(get_eolid(c("Chironomus riparius", "aaa vva"))) #' classification(get_colid(c("Chironomus riparius", "aaa vva"))) #' classification(get_tpsid(c("Poa annua", "aaa vva"))) #' classification(get_gbifid(c("Poa annua", "Bison bison"))) #' #' # Pass many ids from class "ids" #' (out <- get_ids(names="Puma concolor", db = c('ncbi','gbif'))) #' (cl <- classification(out)) #' #' # Bind width-wise from class classification_ids #' cbind(cl) #' #' # Bind length-wise #' rbind(cl) #' #' # Many names to get_ids #' (out <- get_ids(names=c("Puma concolor","Accipiter striatus"), #' db = c('ncbi','itis','col'))) #' (cl <- classification(out)) #' rbind(cl) #' ## cbind with so many names results in some messy data #' cbind(cl) #' ## so you can turn off return_id #' cbind( classification(out, return_id=FALSE) ) #' #' # rbind and cbind on class classification (from a #' # call to get_colid, get_tsn, etc. other than get_ids) #' (cl_col <- classification( #' get_colid(c("Puma concolor","Accipiter striatus")))) #' rbind(cl_col) #' cbind(cl_col) #' #' (cl_uid <- classification(get_uid(c("Puma concolor","Accipiter striatus")), #' return_id=FALSE)) #' rbind(cl_uid) #' cbind(cl_uid) #' ## cbind works a bit odd when there are lots of ranks without names #' (cl_uid <- classification(get_uid(c("Puma concolor","Accipiter striatus")), #' return_id=TRUE)) #' cbind(cl_uid) #' #' (cl_tsn <- classification(get_tsn(c("Puma concolor","Accipiter striatus")))) #' rbind(cl_tsn) #' cbind(cl_tsn) #' #' (tsns <- get_tsn(c("Puma concolor","Accipiter striatus"))) #' (cl_tsns <- classification(tsns)) #' cbind(cl_tsns) #' #' # NBN data #' (res <- classification(c("Alopias vulpinus","Pinus sylvestris"), #' db = 'nbn')) #' rbind(res) #' cbind(res) #' #' # Return taxonomic IDs #' ## the return_id parameter is logical, and you can turn it on or off. #' ## It's TRUE by default #' classification(c("Alopias vulpinus","Pinus sylvestris"), db = 'ncbi', #' return_id = TRUE) #' classification(c("Alopias vulpinus","Pinus sylvestris"), db = 'ncbi', #' return_id = FALSE) #' #' # Use rows parameter to select certain #' classification('Poa annua', db = 'tropicos') #' classification('Poa annua', db = 'tropicos', rows=1:4) #' classification('Poa annua', db = 'tropicos', rows=1) #' classification('Poa annua', db = 'tropicos', rows=6) #' } #' #' @examples \dontrun{ #' # Fails without db param set #' # classification(315576) #' } classification <- function(...){ UseMethod("classification") } #' @export #' @rdname classification classification.default <- function(x, db = NULL, callopts = list(), return_id = TRUE, rows = NA, ...) { nstop(db) switch( db, itis = { id <- process_ids(x, db, get_tsn, rows = rows, ...) stats::setNames(classification(id, callopts = callopts, return_id = return_id, ...), x) }, ncbi = { id <- process_ids(x, db, get_uid, rows = rows, ...) stats::setNames(classification(id, callopts = callopts, return_id = return_id, ...), x) }, eol = { id <- process_ids(x, db, get_eolid, rows = rows, ...) stats::setNames(classification(id, callopts = callopts, return_id = return_id, ...), x) }, col = { id <- process_ids(x, db, get_colid, rows = rows, ...) stats::setNames(classification(id, callopts = callopts, return_id = return_id, ...), x) }, tropicos = { id <- process_ids(x, db, get_tpsid, rows = rows, ...) stats::setNames(classification(id, callopts = callopts, return_id = return_id, ...), x) }, gbif = { id <- process_ids(x, db, get_gbifid, rows = rows, ...) stats::setNames(classification(id, callopts = callopts, return_id = return_id, ...), x) }, nbn = { id <- process_ids(x, db, get_nbnid, rows = rows, ...) stats::setNames(classification(id, callopts = callopts, return_id = return_id, ...), x) }, tol = { id <- process_ids(x, db, get_tolid, rows = rows, ...) stats::setNames(classification(id, callopts = callopts, return_id = return_id, ...), x) }, worms = { id <- process_ids(x, db, get_wormsid, rows = rows, ...) stats::setNames(classification(id, callopts = callopts, return_id = return_id, ...), x) }, natserv = { id <- process_ids(x, db, get_natservid, rows = rows, ...) stats::setNames(classification(id, callopts = callopts, return_id = return_id, ...), x) }, bold = { id <- process_ids(x, db, get_boldid, rows = rows, ...) stats::setNames(classification(id, callopts = callopts, return_id = return_id, ...), x) }, wiki = { id <- process_ids(x, db, get_wiki, rows = rows, ...) stats::setNames(classification(id, callopts = callopts, return_id = return_id, ...), x) }, stop("the provided db value was not recognised", call. = FALSE) ) } process_ids <- function(input, db, fxn, ...){ g <- tryCatch(as.numeric(as.character(input)), warning = function(e) e) if ( inherits(g, "numeric") || is.character(input) && grepl("N[HB]", input) || is.character(input) && grepl("ELEMENT_GLOBAL", input) ) { as_fxn <- switch(db, itis = as.tsn, ncbi = as.uid, eol = as.eolid, col = as.colid, tropicos = as.tpsid, gbif = as.gbifid, nbn = as.nbnid, tol = as.tolid, worms = as.wormsid, natserv = as.natservid, bold = as.boldid, wiki = as.wiki) as_fxn(input, check = FALSE) } else { eval(fxn)(input, ...) } } #' @export #' @rdname classification classification.tsn <- function(id, return_id = TRUE, ...) { fun <- function(x) { # return NA if NA is supplied if (is.na(x)) { out <- NA } else { out <- ritis::hierarchy_full(as.character(x), wt = "json", raw = FALSE) if (NROW(out) < 1) return(NA) # make normal data.frame out <- data.frame(out, stringsAsFactors = FALSE) # remove overhang out <- out[1:which(out$tsn == x), c('taxonname', 'rankname', 'tsn')] names(out) <- c('name', 'rank', 'id') # Optionally return tsn of lineage if (!return_id) out <- out[, c('name', 'rank')] out$rank <- tolower(out$rank) } return(out) } out <- lapply(id, fun) names(out) <- id structure(out, class = 'classification', db = 'itis') } #' @export #' @rdname classification classification.uid <- function(id, callopts = list(), return_id = TRUE, ...) { fun <- function(x, callopts){ # return NA if NA is supplied if (is.na(x)) { out <- NA } else { baseurl <- paste0(ncbi_base(), "/entrez/eutils/efetch.fcgi?db=taxonomy") ID <- paste("ID=", x, sep = "") searchurl <- paste(baseurl, ID, sep = "&") res <- GET(searchurl, callopts) stop_for_status(res) tt <- con_utf8(res) ttp <- xml2::read_xml(tt) out <- data.frame(name = xml2::xml_text(xml2::xml_find_all(ttp, "//TaxaSet/Taxon/LineageEx/Taxon/ScientificName")), rank = xml2::xml_text(xml2::xml_find_all(ttp, "//TaxaSet/Taxon/LineageEx/Taxon/Rank")), id = xml2::xml_text(xml2::xml_find_all(ttp, "//TaxaSet/Taxon/LineageEx/Taxon/TaxId")), stringsAsFactors = FALSE) if (NROW(out) == 0) { out <- NA } else { out <- rbind(out, c(xml2::xml_text(xml2::xml_find_all(ttp, "//TaxaSet/Taxon/ScientificName")), xml2::xml_text(xml2::xml_find_all(ttp, "//TaxaSet/Taxon/Rank")), xml2::xml_text(xml2::xml_find_all(ttp, "//TaxaSet/Taxon/TaxId"))) ) # Optionally return tsn of lineage if (!return_id) out <- out[, c('name', 'rank')] out$rank <- tolower(out$rank) return(out) } } # NCBI limits requests to three per second Sys.sleep(0.33) return(out) } out <- lapply(id, fun, callopts = callopts) names(out) <- id structure(out, class = 'classification', db = 'ncbi') } #' @export #' @rdname classification classification.eolid <- function(id, key = NULL, callopts = list(), return_id = TRUE, ...) { common_names = synonyms = NULL fun <- function(x){ if (is.na(x)) { out <- NA } else { url = 'http://eol.org/api/hierarchy_entries/1.0/' key <- getkey(key, "eolApiKey") urlget <- paste(url, x, '.json', sep = "") args <- tc(list(common_names = common_names, synonyms = synonyms)) tt <- GET(urlget, query = args, callopts) stop_for_status(tt) res <- jsonlite::fromJSON(con_utf8(tt), FALSE) if (length(res$ancestors) == 0) { return(sprintf("No hierarchy information for %s", x)) } else { out <- do.call(rbind.fill, lapply(res$ancestors, data.frame, stringsAsFactors = FALSE))[,c('scientificName','taxonRank', 'taxonID')] # add querried taxon tr <- res$taxonRank out <- rbind(out, c(res$scientificName, if ( is.null(tr) ) NA else tr, x)) names(out) <- c('name', 'rank', 'id') # Optionally return id of lineage if (!return_id) out <- out[, c('name', 'rank')] out$rank <- tolower(out$rank) return(out) } } } out <- lapply(id, fun) names(out) <- id structure(out, class = 'classification', db = 'eol') } #' @export #' @rdname classification classification.colid <- function(id, start = NULL, checklist = NULL, callopts = list(), return_id = TRUE, ...) { fun <- function(x, checklist, start, callopts){ # return NA if NA is supplied if (is.na(x)) { out <- NA } else { url <- make_url(checklist) args <- tc(list(id = x, response = "full", start = start)) out <- GET(url, query = args, callopts) stop_for_status(out) tt <- xml2::read_xml(con_utf8(out)) out <- search_col_classification_df(tt) # add query-ied taxon out <- rbind(out, c(xml2::xml_text(xml2::xml_find_first(tt, "//result/name")), xml2::xml_text(xml2::xml_find_first(tt, "//result/rank")), xml2::xml_text(xml2::xml_find_first(tt, "//result/id")))) # Optionally return id of lineage if (!return_id) out <- out[, c('name', 'rank')] out$rank <- tolower(out$rank) } return(out) } out <- lapply(id, fun, checklist = checklist, start = start, callopts = callopts) names(out) <- id structure(out, class = 'classification', db = 'col') } search_col_classification_df <- function(x) { name <- xml2::xml_text(xml2::xml_find_all(x, "//classification//name")) rank <- xml2::xml_text(xml2::xml_find_all(x, "//classification//rank")) id <- xml2::xml_text(xml2::xml_find_all(x, "//classification//id")) if (any(grepl("species", rank, ignore.case = TRUE))) { name[which(rank %in% "Species")] <- paste(name[which(rank %in% "Genus")], name[which(rank %in% "Species")], collapse = " ") } data.frame(name, rank, id, stringsAsFactors = FALSE) } #' @export #' @rdname classification classification.tpsid <- function(id, key = NULL, callopts = list(), return_id = TRUE, ...) { fun <- function(x, callopts){ if (is.na(x)) { out <- NA } else { url <- sprintf('http://services.tropicos.org/Name/%s/HigherTaxa', x) key <- getkey(key, "tropicosApiKey") args <- tc(list(format = 'json', apikey = key)) tt <- GET(url, query = args, callopts) stop_for_status(tt) out <- jsonlite::fromJSON(con_utf8(tt), FALSE) if (names(out[[1]])[[1]] == "Error") { out <- data.frame(ScientificName = NA, Rank = NA) } else { out <- do.call(rbind.fill, lapply(out, data.frame))[,c('ScientificName','Rank', 'NameId')] } names(out) <- c('name', 'rank', 'id') # Optionally return id of lineage if (!return_id) out <- out[, c('name', 'rank')] out$rank <- tolower(out$rank) } return(out) } out <- lapply(id, fun, callopts = callopts) names(out) <- id structure(out, class = 'classification', db = 'tropicos') } #' @export #' @rdname classification classification.gbifid <- function(id, callopts = list(), return_id = TRUE, ...) { fun <- function(x, callopts){ if (is.na(x)) { out <- NA } else { out <- suppressWarnings(tryCatch(gbif_name_usage(key = x, callopts = callopts), error = function(e) e)) if (is(out, "simpleError")) { NA } else { nms <- ldply(out[c('kingdom','phylum','class','order','family','genus','species')]) keys <- unname(unlist(out[paste0(c('kingdom','phylum','class','order','family','genus','species'), "Key")])) df <- data.frame(name = nms$V1, rank = nms$.id, id = keys, stringsAsFactors = FALSE) df$rank <- tolower(df$rank) # Optionally return id of lineage if (!return_id) df[, c('name', 'rank')] else df } } } out <- lapply(id, fun, callopts = callopts) names(out) <- id structure(out, class = 'classification', db = 'gbif') } #' @export #' @rdname classification classification.nbnid <- function(id, callopts = list(), return_id = TRUE, ...) { fun <- function(x, callopts){ if (is.na(x)) { out <- NA } else { out <- suppressWarnings(tryCatch(nbn_classification(id = x, callopts), error = function(e) e)) if (inherits(out, "simpleError")) { NA } else { out <- out[ , c('scientificname', 'rank', 'guid')] names(out) <- c('name', 'rank', 'id') # Optionally return id of lineage if (!return_id) out <- out[, c('name', 'rank')] out$rank <- tolower(out$rank) return(out) } } } out <- lapply(id, fun, callopts = callopts) names(out) <- id structure(out, class = 'classification', db = 'nbn') } #' @export #' @rdname classification classification.tolid <- function(id, callopts = list(), return_id = TRUE, ...) { fun <- function(x, callopts){ if (is.na(x)) { out <- NA } else { out <- tryCatch(rotl::taxonomy_taxon_info(x, include_lineage = TRUE), error = function(e) e) if (inherits(out, "error")) { NA } else { outdf <- rotl::tax_lineage(out)[[1]] # we have to reverse row order outdf <- outdf[NROW(outdf):1, ] # tack on species searched for orig <- c(out[[1]]$rank, out[[1]]$name, out[[1]]$unique_name, out[[1]]$ott_id) outdf <- rbind(outdf, orig) row.names(outdf) <- NULL outdf <- outdf[ , c('name','rank', 'ott_id')] names(outdf) <- c('name', 'rank', 'id') if (!return_id) outdf <- outdf[, c('name', 'rank')] return(outdf) } } } out <- lapply(id, fun, callopts = callopts) names(out) <- id structure(out, class = 'classification', db = 'tol') } #' @export #' @rdname classification classification.wormsid <- function(id, callopts = list(), return_id = TRUE, ...) { fun <- function(x, callopts){ if (is.na(x)) { out <- NA } else { out <- tryCatch(worrms::wm_classification(as.numeric(x)), error = function(e) e) if (inherits(out, "error")) { NA } else { row.names(out) <- NULL out <- out[ , c('scientificname','rank', 'AphiaID')] names(out) <- c('name', 'rank', 'id') if (!return_id) out <- out[, c('name', 'rank')] return(out) } } } out <- lapply(id, fun, callopts = callopts) names(out) <- id structure(out, class = 'classification', db = 'worms') } #' @export #' @rdname classification classification.natservid <- function(id, callopts = list(), return_id = TRUE, ...) { fun <- function(x, callopts) { if (is.na(x)) { out <- NA } else { out <- tryCatch(natserv::ns_data(x), error = function(e) e) if (inherits(out, "error")) { NA } else { tmp <- out[[1]]$classification if (is.null(tmp)) return(NA) tmp <- tmp$taxonomy$formalTaxonomy if (is.null(tmp)) return(NA) tmp <- tmp[names(tmp) %in% c('kingdom', 'phylum', 'class', 'order', 'family', 'genus')] df <- data.frame(scientificname = unname(unlist(tmp)), rank = names(tmp), stringsAsFactors = FALSE) rks <- c('kingdom', 'phylum', 'class', 'order', 'family', 'genus', 'species') targ_taxon <- c( out[[1]]$classification$names$scientificName$unformattedName[[1]], rks[which(df$rank[length(df$rank)] == rks) + 1] ) df <- rbind(df, targ_taxon) return(df) } } } out <- lapply(id, fun, callopts = callopts) names(out) <- id structure(out, class = 'classification', db = 'natserv') } #' @export #' @rdname classification classification.boldid <- function(id, callopts = list(), return_id = TRUE, ...) { fun <- function(x, callopts) { if (is.na(x)) { out <- NA } else { out <- tryCatch(bold_search(id = x, includeTree = TRUE), error = function(e) e) if (inherits(out, "error")) { NA } else { if (is.null(out)) return(NA) tmp <- out[names(out) %in% c('taxid', 'taxon', 'tax_rank')] df <- data.frame(name = tmp$taxon, rank = tmp$tax_rank, id = tmp$taxid, stringsAsFactors = FALSE) return(df) } } } out <- lapply(id, fun, callopts = callopts) names(out) <- id structure(out, class = 'classification', db = 'bold') } #' @export #' @rdname classification classification.wiki <- function(id, callopts = list(), return_id = TRUE, ...) { fun <- function(x, wiki_site = "species", wiki = "en", callopts) { if (is.na(x)) { out <- NA } else { fxn <- switch( wiki_site, species = wikitaxa::wt_wikispecies, commons = wikitaxa::wt_wikicommons, pedia = wikitaxa::wt_wikipedia ) out <- tryCatch(fxn(x)$classification, error = function(e) e) if (inherits(out, "error")) { NA } else { if (is.null(out) || NROW(out) == 0) return(NA) df <- data.frame(name = out$name, rank = out$rank, stringsAsFactors = FALSE) return(df) } } } out <- list() for (i in seq_along(id)) { out[[i]] <- fun(id[i], attr(id, "wiki_site"), attr(id, "wiki_lang")) } #out <- lapply(id, fun, callopts = callopts) names(out) <- id structure(out, class = 'classification', db = 'wiki', wiki_site = attr(id, "wiki_site"), wiki = attr(id, "wiki_lang")) } # --------- #' @export #' @rdname classification classification.ids <- function(id, ...) { fun <- function(x, ...){ # return NA if NA is supplied if (all(is.na(x))) { out <- NA } else { out <- classification(x, ...) } return(out) } structure(lapply(id, fun, ...), class = 'classification_ids') } #' @export #' @rdname classification cbind.classification <- function(...) { gethiernames <- function(x) { x <- data.frame(x) x$name <- as.character(x$name) x$rank <- as.character(x$rank) values <- setNames(data.frame(t(x[,'name']), stringsAsFactors = FALSE), tolower(x[,'rank'])) if ("id" %in% names(x)) { x$id <- as.character(x$id) ids <- setNames(data.frame(t(x[,'id']), stringsAsFactors = FALSE), paste0(tolower(x[,'rank']),"_id") ) data.frame(values, ids) } else { values } } input <- x <- c(...) input <- input[vapply(x, function(z) inherits(z, "data.frame"), logical(1))] tmp <- do.call(rbind.fill, lapply(input, gethiernames)) tmp$query <- names(x) tmp$db <- attr(x, "db") tmp } #' @export #' @rdname classification rbind.classification <- function(...) { input <- x <- c(...) db <- attr(input, "db") x <- input[vapply(x, function(z) inherits(z, "data.frame"), logical(1))] for (i in seq_along(x)) { x[[i]]$query <- names(x[i]) } df <- do.call(rbind.fill, x) df$db <- db return( df ) } #' @export #' @rdname classification cbind.classification_ids <- function(...) { input <- c(...) # remove non-data.frames input <- input[vapply(input, function(x) class(x[[1]])[1], "") %in% c("data.frame", "tbl_df")] gethiernames <- function(x){ x$name <- as.character(x$name) x$rank <- as.character(x$rank) values <- setNames(data.frame(t(x$name), stringsAsFactors = FALSE), tolower(x$rank)) if ("id" %in% names(x)) { x$id <- as.character(x$id) ids <- setNames(data.frame(t(x$id), stringsAsFactors = FALSE), paste0(tolower(x$rank), "_id") ) data.frame(values, ids) } else { values } } dat <- do.call(rbind.fill, lapply(input, function(h){ tmp <- lapply(h, gethiernames) tmp <- do.call(rbind.fill, tmp) tmp$query <- names(h) tmp$db <- attr(h, "db") tmp }) ) move_col(tt = dat, y = c('query','db')) } #' @export #' @rdname classification rbind.classification_ids <- function(...) { input <- c(...) # remove non-data.frames input <- input[vapply(input, function(x) class(x[[1]])[1], "") %in% c("data.frame", "tbl_df")] df <- lapply(input, function(x){ coll <- list() for (i in seq_along(x)) { coll[[i]] <- data.frame(names(x[i]), x[i][[1]], stringsAsFactors = FALSE) } coll }) get <- list() for (i in seq_along(df[[1]])) { tmp <- do.call(rbind, lapply(df, "[[", i)) source2 <- gsub("\\.[0-9]+", "", row.names(tmp)) row.names(tmp) <- NULL names(tmp)[1] <- "query" tmp <- data.frame(db = source2, tmp, stringsAsFactors = FALSE) get[[i]] <- tmp } tt <- if (length(get) == 1) get[[1]] else do.call(rbind.fill, get) move_col(tt, c('query', 'db')) } taxize/R/ion.R0000644000176200001440000000162612744503537012706 0ustar liggesusers#' ION - Index to Organism Names #' #' @export #' @param x An LSID number. Required. #' @param ... Curl options passed on to \code{\link[httr]{GET}} #' @references http://www.organismnames.com #' @return A data.frame #' @examples \dontrun{ #' ion(155166) #' ion(298678) #' ion(4796748) # ursus americanus #' ion(1280626) # puma concolor #' } ion <- function(x, ...) { res <- GET(ion_base(), query = list(lsid = x), ...) stop_for_status(res) xml <- xml2::read_xml(con_utf8(res)) dc <- as.list(sapply(c('identifier', 'Title'), function(z) { xml_text(xml_find_all(xml, paste0("//dc:", z), xml_ns(xml))) })) tdwg <- as.list( setNames( xml_text(xml_find_all(xml, "//tdwg_tn:nameComplete", xml_ns(xml))), "nameComplete") ) df <- data.frame(c(dc, tdwg), stringsAsFactors = FALSE) setNames(df, tolower(names(df))) } ion_base <- function() 'http://www.organismnames.com/lsidmetadata.htm' taxize/R/col_classification.R0000644000176200001440000000042112672106003015724 0ustar liggesusers#' Search Catalogue of Life for taxonomic classifications. #' #' THIS FUNCTION IS DEFUNCT. #' #' @export #' @rdname col_classification-defunct #' @keywords internal col_classification <- function(...) { .Defunct(msg = "This function is defunct. See classification().") } taxize/R/tax_name.R0000644000176200001440000001230413160314643013677 0ustar liggesusers#' Get taxonomic names for a given rank #' #' @export #' @param query (character) Vector of taxonomic names to query. required. #' @param get (character) The ranks of the taxonomic name to get, see #' \code{\link{rank_ref}}. required. #' @param db (character) The database to search from: 'itis', 'ncbi' or 'both'. #' If 'both' both NCBI and ITIS will be queried. Result will be the union of #' both. #' @param pref (character) If db = 'both', sets the preference for the union. #' Either 'ncbi' (default) or 'itis'. Currently not implemented. #' @param verbose (logical) If \code{TRUE} the actual taxon queried is printed #' on the console. #' @param ... Other arguments passed to \code{\link{get_tsn}} or #' \code{\link{get_uid}}. #' #' @return A data.frame with one column for every queried rank, in addition to #' a column for db and queried term. #' #' @note While \code{\link{tax_rank}} returns the actual rank of a #' taxon, \code{\link{tax_name}} searches and returns any specified rank #' higher in taxonomy. #' #' @seealso \code{\link{classification}} #' #' @examples \dontrun{ #' # A case where itis and ncbi use the same names #' tax_name(query = "Helianthus annuus", get = "family", db = "itis") #' tax_name(query = "Helianthus annuus", get = "family", db = "ncbi") #' tax_name(query = "Helianthus annuus", get = c("genus","family","order"), #' db = "ncbi") #' #' # Case where itis and ncbi use different names #' tax_name(query = "Helianthus annuus", get = "kingdom", db = "itis") #' tax_name(query = "Helianthus annuus", get = "kingdom", db = "ncbi") #' #' # multiple rank arguments #' tax_name(query = c("Helianthus annuus","Baetis rhodani"), get = c("genus", #' "kingdom"), db = "ncbi") #' tax_name(query = c("Helianthus annuus","Baetis rhodani"), get = c("genus", #' "kingdom"), db = "itis") #' #' # query both sources #' tax_name(query=c("Helianthus annuus", 'Baetis rhodani'), get=c("genus", #' "kingdom"), db="both") #' } tax_name <- function(query, get, db = "itis", pref = 'ncbi', verbose = TRUE, ...) { if (missing(get)) stop("you must supply a 'get' value", call. = FALSE) db <- match.arg(db, c('itis', 'ncbi', 'both')) if (db == 'both' & !pref %in% c('ncbi', 'itis')) { stop("if db=both, pref must be either 'itis' or 'ncbi'!\n", call. = FALSE) } fun <- function(query, get, db, verbose, ...){ # NCBI if (db == "ncbi") return( do_ncbi(query, get, verbose, ...) ) # ITIS if (db == "itis") return( do_itis(query, get, verbose, ...) ) # combine both if (db == 'both') { match_uid <- do_ncbi(query, get, verbose, TRUE, ...) match_tsn <- do_itis(query, get, verbose, TRUE, ...) setNames( data.frame(rbind(t(c("itis", match_tsn)), t(c("ncbi", match_uid))), stringsAsFactors = FALSE), c("db", "query", get)) } } plyr::ldply(query, .fun = fun, get = get, db = db, verbose = verbose, ...) } do_ncbi <- function(query, get, verbose, both=FALSE, ...) { uid <- get_uid(query, verbose = verbose, ...) if (is.na(uid)) { if (verbose) message("No UID found for species '", query, "'!\n") if (both) c(query, rep(NA, length(get))) else setNames(data.frame(t(c("ncbi", query, rep(NA, length(get))))), c("db", "query", get)) } else { hierarchy <- classification(uid, ...)[[1]] if (all(is.na(hierarchy))) return(NULL) match <- hierarchy$name[match(tolower(get), tolower(hierarchy$rank))] if (both) c(query, match) else setNames(data.frame(t(c("ncbi", query, match)), stringsAsFactors = FALSE), c("db", "query", get)) } } do_itis <- function(query, get, verbose, both = FALSE, ...){ tsn <- get_tsn(query, searchtype = "scientific", verbose = verbose, ...) if (is.na(tsn)) { if (verbose) message("No TSN found for species '", query, "'!\n") if (both) c(query, rep(NA, length(get))) else setNames(data.frame(t(c("itis", query, rep(NA, length(get)))), stringsAsFactors = FALSE), c("db", "query", get)) } else { tt <- classification(tsn, verbose = verbose, ...)[[1]] if (all(is.na(tt))) { warning(sprintf("%s: no hierarchy data found in ITIS", query), call. = FALSE) setNames(data.frame(t(c("itis", query, rep(NA, length(get)))), stringsAsFactors = FALSE), c("db", "query", get)) } else { if (max(unlist(Filter(function(x) length(x) > 0, sapply(get, which_rank)))) < which_rank(tt$rank[1])) { warning(sprintf("%s: highest rank of ITIS classification is '%s'", query, tt$rank[1]), call. = FALSE) } if (!all(tolower(get) %in% tolower(tt$rank))) { warning( sprintf("%s: rank requested ('%s') not in ITIS classification", query, paste0(tolower(get)[!tolower(get) %in% tolower(tt$rank)], collapse = ", ")), call. = FALSE) } if (both) { c(query, tt$name[match(tolower(get), tolower(tt$rank))]) } else { out <- tt[tolower(tt$rank) %in% tolower(get), ]$name if (length(out) == 0) out <- rep(NA_character_, length(get)) rname <- tolower(tt[tolower(tt$rank) %in% tolower(get), ]$rank) if (length(rname) == 0) rname <- get setNames( data.frame(t(c("itis", query, out)), stringsAsFactors = FALSE), c("db", "query", rname) ) } } } } taxize/R/itis_hierarchy.R0000644000176200001440000000300412771327747015126 0ustar liggesusers#' @title ITIS hierarchy #' #' @description Get hierarchies from TSN values, full, upstream only, or #' immediate downstream only #' #' @export #' @param tsn One or more TSN's (taxonomic serial number). Required. #' @param what One of full (full hierarchy), up (immediate upstream), or down #' (immediate downstream) #' @param ... Further arguments passed on to \code{\link[ritis]{hierarchy_full}}, #' \code{\link[ritis]{hierarchy_up}}, or \code{\link[ritis]{hierarchy_down}} #' @seealso \code{\link{itis_downstream}} #' @details Note that \code{\link{itis_downstream}} gets taxa downstream to a #' particular rank, while this function only gets immediate names downstream. #' @examples \dontrun{ #' # Get full hierarchy #' itis_hierarchy(tsn=180543) #' #' # Get hierarchy upstream #' itis_hierarchy(tsn=180543, "up") #' #' # Get hierarchy downstream #' itis_hierarchy(tsn=180543, "down") #' #' # Many tsn's #' itis_hierarchy(tsn=c(180543,41074,36616)) #' } itis_hierarchy <- function(tsn, what = "full", ...) { temp <- switch( what, full = lapply(tsn, function(x) ritis::hierarchy_full(x, ...)), up = lapply(tsn, function(x) ritis::hierarchy_up(x, ...)), down = lapply(tsn, function(x) ritis::hierarchy_down(x, ...)) ) if (length(tsn) == 1) { tmp <- temp[[1]] names(tmp) <- tolower(names(tmp)) tmp$rankname <- tolower(tmp$rankname) tmp } else { names(temp) <- tsn lapply(temp, function(x){ names(x) <- tolower(names(x)) x$rankname <- tolower(x$rankname) x }) } } taxize/R/itis_taxrank.R0000644000176200001440000000175412771125612014615 0ustar liggesusers#' Retrieve taxonomic rank name from given TSN. #' #' @export #' @param query TSN for a taxonomic group (numeric). If query is left as default #' (NULL), you get all possible rank names, and their TSN's (using function #' \code{\link[ritis]{rank_names}}. There is slightly different terminology for #' Monera vs. Plantae vs. Fungi vs. Animalia vs. Chromista, so there are #' separate terminologies for each group. #' @param ... Further arguments passed on to \code{\link[ritis]{rank_name}} #' @details You can print messages by setting \code{verbose=FALSE}. #' @return Taxonomic rank names or data.frame of all ranks. #' @examples \dontrun{ #' # All ranks #' itis_taxrank() #' #' # A single TSN #' itis_taxrank(query=202385) #' #' # Many TSN's #' itis_taxrank(query=c(202385,183833,180543)) #' } itis_taxrank <- function(query = NULL, ...) { if (is.null(query)) { ritis::rank_names() } else { sapply( query, function(z) as.character(ritis::rank_name(z, ...)$rankname) ) } } taxize/R/genbank2uid.R0000644000176200001440000001050013076225631014274 0ustar liggesusers#' Get NCBI taxonomy UID from GenBankID #' #' @export #' @param id A GenBank accession alphanumeric string, or a gi numeric string. #' @param batch_size The number of queries to submit at a time. #' @param ... Curl args passed on to \code{\link[httr]{GET}} #' @details See \url{http://www.ncbi.nlm.nih.gov/Sitemap/sequenceIDs.html} for #' help on why there are two identifiers, and the difference between them. #' #' Note that if you pass in > 1 item, if one or more of your items is not #' found, the entire batch will return \code{NA}'s. To get around this, #' set \code{batch_size = 1} - so each is sent separtaely to NCBI. #' However, this of course is much slower than the default, which is to send #' up to 100 at a time. #' @return one or more NCBI taxonomic IDs #' @examples \dontrun{ #' # with accession numbers #' genbank2uid(id = 'AJ748748') #' genbank2uid(id = 'Y13155') #' genbank2uid(id = 'X78312') #' genbank2uid(id = 'KM495596') #' #' # with gi numbers #' genbank2uid(id = 62689767) #' genbank2uid(id = 22775511) #' genbank2uid(id = 156446673) #' #' # pass in many accession or gi numbers #' genbank2uid(c(62689767,156446673)) #' genbank2uid(c('X78312','KM495596')) #' genbank2uid(list('X78312',156446673)) #' #' # curl options #' library('httr') #' genbank2uid(id = 156446673, config=verbose()) #' } genbank2uid <- function(id, batch_size = 100, ...) { assert(batch_size, c("integer", "numeric")) process_batch <- function(id, ...) { #removes version number of accession ids id <- gsub(pattern = "\\.[0-9]+$", "", id) url2 <- paste0( ncbi_base(), "/entrez/eutils/elink.fcgi?dbfrom=nucleotide&db=taxonomy&id=") query <- paste0(url2, paste(id, collapse = "&id=")) res <- GET(query, ...) stop_for_status(res) result <- xml_text(xml_find_all(read_xml(con_utf8(res)), "//LinkSetDb//Link//Id")) if (length(result) > length(id)) { url3 <- paste0( ncbi_base(), "/entrez/eutils/esummary.fcgi?db=taxonomy&id=") query <- paste0(url3, paste(result, collapse = ",")) res <- GET(query, ...) stop_for_status(res) nn <- xml_find_all(read_xml(con_utf8(res)), "//eSummaryResult//DocSum") result <- lapply(nn, function(z) { list( name = xml_text(xml_find_all(z, "Item[@Name=\"ScientificName\"]")), id = xml_text(xml_find_all(z, "Item[@Name=\"TaxId\"]")) ) }) } if (length(result) < length(id)) { result <- rep(NA_character_, length(id)) } Sys.sleep(0.34) # NCBI limits requests to three per second return(result) } batches <- split(id, ceiling(seq_along(id) / batch_size)) result <- lapply(batches, function(x) map_unique(x, process_batch, ...)) if (!is.null(names(result[[1]][[1]]))) { result <- lapply(result[[1]], function(z) { m <- rep("found", length(z$id)) m[is.na(z$id)] <- "not found" f <- as.uid(z$id, check = FALSE) attr(f, "match") <- m attr(f, "name") <- z$name f }) } else { result <- as.uid(unname(unlist(result))) matched <- rep("found", length(result)) matched[is.na(result)] <- "not found" attr(result, "match") <- matched } if (any(is.na(result))) { warning("An error occurred looking up taxon ID(s).") if (batch_size > 1 && length(id) > 1) { warning("NOTE: This function looks up IDs in batches to save time. However, the way that NCBI has implemented the API we use makes it so we cannot tell which IDs failed when a batch failed. Therefore, as few as one ID could be invalid yet still cause the whole batch to be NA. To identify the invalid IDs, set the 'batch_size' option to 1 and rerun the command.") } } return(result) } is_acc <- function(x){ gg <- suppressWarnings(as.numeric(x)) is.na(gg) } #===================================================================== # get indexes of a unique set of the input unique_mapping <- function(input) { unique_input <- unique(input) vapply(input, function(x) which(x == unique_input), numeric(1)) } #===================================================================== # run a function on unique values of a iterable map_unique <- function(input, func, ...) { input_class <- class(input) unique_input <- unique(input) class(unique_input) <- input_class func(unique_input, ...) # func(unique_input, ...)[unique_mapping(input)] } taxize/R/get_natservid.R0000644000176200001440000002346113160770135014751 0ustar liggesusers#' Get NatureServe taxonomic ID for a taxon name #' #' @export #' @param query character; A vector of common or scientific names. #' @param searchtype character; One of 'scientific' (default) or 'common'. #' This doesn't affect the query to NatureServe - but rather affects what #' column of data is targeted in name filtering post data request. #' @param ask logical; should get_natservid be run in interactive mode? #' If \code{TRUE} and more than one wormsid is found for the species, the #' user is asked for input. If \code{FALSE} NA is returned for #' multiple matches. #' @param verbose logical; should progress be printed? #' @param rows numeric; Any number from 1 to infinity. If the default NaN, all #' rows are considered. Note that this function still only gives back a #' natservid class object with one to many identifiers. See #' \code{\link[taxize]{get_natservid_}} to get back all, or a subset, of the raw #' data that you are presented during the ask process. #' @param key (character) your NatureServe API key. Required. See #' \strong{Authentication} below for more. #' @param x Input to as.natservid #' @param ... Ignored #' @param check logical; Check if ID matches any existing on the DB, only #' used in \code{\link{as.natservid}} #' @template getreturn #' #' @family taxonomic-ids #' @seealso \code{\link[taxize]{classification}} #' #' @section Authentication: #' Get an API key from NatureServe at #' \url{https://services.natureserve.org/developer/index.jsp}. #' You can pass your token in as an argument or store it one of two places: #' #' \itemize{ #' \item your .Rprofile file with an entry like #' \code{options(NatureServeKey = "your-natureserve-key")} #' \item your .Renviron file with an entry like #' \code{NATURE_SERVE_KEY=your-natureserve-key} #' } #' #' See \code{\link{Startup}} for information on how to create/find your #' .Rprofile and .Renviron files #' #' @examples \dontrun{ #' (x <- get_natservid("Helianthus annuus")) #' attributes(x) #' attr(x, "match") #' attr(x, "multiple_matches") #' attr(x, "pattern_match") #' attr(x, "uri") #' #' get_natservid('Gadus morhua') #' get_natservid(c("Helianthus annuus", 'Gadus morhua')) #' #' # specify rows to limit choices available #' get_natservid('Ruby Quaker Moth', 'common') #' get_natservid('Ruby*', 'common') #' get_natservid('Ruby*', 'common', rows=1) #' get_natservid('Ruby*', 'common', rows=1:2) #' #' # When not found #' get_natservid("howdy") #' get_natservid(c('Gadus morhua', "howdy")) #' #' # Convert a natservid without class information to a natservid class #' # already a natservid, returns the same #' as.natservid(get_natservid('Gadus morhua')) #' # same #' as.natservid(get_natservid(c('Gadus morhua', 'Pomatomus saltatrix'))) #' # character #' as.natservid("ELEMENT_GLOBAL.2.101905") #' # character vector, length > 1 #' as.natservid(c("ELEMENT_GLOBAL.2.101905", "ELEMENT_GLOBAL.2.101998")) #' # list, either numeric or character #' as.natservid(list("ELEMENT_GLOBAL.2.101905", "ELEMENT_GLOBAL.2.101998")) #' ## dont check, much faster #' as.natservid("ELEMENT_GLOBAL.2.101905", check = FALSE) #' as.natservid(c("ELEMENT_GLOBAL.2.101905", "ELEMENT_GLOBAL.2.101998"), #' check = FALSE) #' as.natservid(list("ELEMENT_GLOBAL.2.101905", "ELEMENT_GLOBAL.2.101998"), #' check = FALSE) #' #' (out <- as.natservid( #' c("ELEMENT_GLOBAL.2.101905", "ELEMENT_GLOBAL.2.101998"))) #' data.frame(out) #' as.natservid( data.frame(out) ) #' #' # Get all data back #' get_natservid_("Ruby*") #' get_natservid_("Ruby*", rows=1:3) #' } get_natservid <- function(query, searchtype = "scientific", ask = TRUE, verbose = TRUE, rows = NA, key = NULL, ...) { assert(ask, "logical") assert(searchtype, "character") assert(ask, "logical") assert(verbose, "logical") fun <- function(x, searchtype, ask, verbose, key, rows, ...) { direct <- FALSE mssg(verbose, "\nRetrieving data for taxon '", x, "'\n") if (!searchtype %in% c("scientific", "common")) { stop("'searchtype' must be one of 'scientific' or 'common'", call. = FALSE) } nsdf <- ns_worker(x, key, ...) mm <- NROW(nsdf) > 1 if (!inherits(nsdf, "tbl_df") || NROW(nsdf) == 0) { nsid <- NA_character_ att <- "not found" } else { nsdf <- suppressWarnings(data.frame(nsdf)) nsdf <- sub_rows(nsdf, rows) # should return NA if spec not found if (nrow(nsdf) == 0) { mssg( verbose, "Not found. Consider checking the spelling or alternate classification") nsid <- NA_character_ att <- 'not found' } # take the one nsid from data.frame if (nrow(nsdf) == 1) { nsid <- nsdf$id att <- 'found' } # check for direct match if (nrow(nsdf) > 1) { names(nsdf)[grep(searchtype, names(nsdf))] <- "target" direct <- match(tolower(nsdf$target), tolower(x)) if (length(direct) == 1) { if (!all(is.na(direct))) { nsid <- nsdf$id[!is.na(direct)] direct <- TRUE att <- 'found' } else { direct <- FALSE nsid <- NA_character_ att <- 'not found' } } else { direct <- FALSE nsid <- NA_character_ att <- 'NA due to ask=FALSE & no direct match found' warning("> 1 result; no direct match found", call. = FALSE) } } # multiple matches if (any( nrow(nsdf) > 1 && is.na(nsid) || nrow(nsdf) > 1 && att == "found" && length(nsid) > 1 )) { if (ask) { names(nsdf)[grep(searchtype, names(nsdf))] <- "target" # user prompt nsdf <- nsdf[order(nsdf$target), ] # prompt message("\n\n") rownames(nsdf) <- seq_len(NROW(nsdf)) print(nsdf) message("\nMore than one NatureServe ID found for taxon '", x, "'!\n Enter rownumber of taxon (other inputs will return 'NA'):\n") # prompt take <- scan(n = 1, quiet = TRUE, what = 'raw') if (length(take) == 0) { take <- 'notake' att <- 'nothing chosen' } if (take %in% seq_len(nrow(nsdf))) { take <- as.numeric(take) message("Input accepted, took taxon '", as.character(nsdf$target[take]), "'.\n") nsid <- nsdf$id[take] att <- 'found' } else { nsid <- NA_character_ mssg(verbose, "\nReturned 'NA'!\n\n") att <- 'not found' } } else { if (length(nsid) != 1) { warning( sprintf("More than one NatureServe ID found for taxon '%s'; refine query or set ask=TRUE", x), call. = FALSE ) nsid <- NA_character_ att <- 'NA due to ask=FALSE & > 1 result' } } } } data.frame( nsid = as.character(nsid), att = att, multiple = mm, direct = direct, stringsAsFactors = FALSE) } query <- as.character(query) outd <- ldply(query, fun, searchtype = searchtype, ask = ask, verbose = verbose, key = key, rows = rows, ...) out <- outd$nsid attr(out, 'match') <- outd$att attr(out, 'multiple_matches') <- outd$multiple attr(out, 'pattern_match') <- outd$direct if ( !all(is.na(out)) ) { urlmake <- na.omit(out) attr(out, 'uri') <- sprintf(ns_base_uri(), urlmake) } class(out) <- "natservid" return(out) } #' @export #' @rdname get_natservid as.natservid <- function(x, check=TRUE) UseMethod("as.natservid") #' @export #' @rdname get_natservid as.natservid.natservid <- function(x, check=TRUE) x #' @export #' @rdname get_natservid as.natservid.character <- function(x, check=TRUE) if (length(x) == 1) make_natserv(x, check) else collapse(x, make_natserv, "natservid", check = check) #' @export #' @rdname get_natservid as.natservid.list <- function(x, check=TRUE) if (length(x) == 1) make_natserv(x, check) else collapse(x, make_natserv, "natservid", check = check) #' @export #' @rdname get_natservid as.natservid.numeric <- function(x, check=TRUE) as.natservid(as.character(x), check) #' @export #' @rdname get_natservid as.natservid.data.frame <- function(x, check=TRUE) { structure(x$ids, class = "natservid", match = x$match, multiple_matches = x$multiple_matches, pattern_match = x$pattern_match, uri = x$uri) } #' @export #' @rdname get_natservid as.data.frame.natservid <- function(x, ...){ data.frame(ids = as.character(unclass(x)), class = "natservid", match = attr(x, "match"), multiple_matches = attr(x, "multiple_matches"), pattern_match = attr(x, "pattern_match"), uri = attr(x, "uri"), stringsAsFactors = FALSE) } make_natserv <- function(x, check=TRUE) make_generic(x, ns_base_uri(), "natservid", check) check_natservid <- function(x){ tt <- httr::content(httr::GET(sprintf(ns_base_uri(), x)), "text") !grepl("No records matched", tt) } #' @export #' @rdname get_natservid get_natservid_ <- function(query, verbose = TRUE, rows = NA, key = NULL, ...) { stats::setNames( lapply(query, get_natservid_help, verbose = verbose, rows = rows, key = key, ...), query ) } get_natservid_help <- function(query, verbose, rows, key, ...) { mssg(verbose, "\nRetrieving data for taxon '", query, "'\n") df <- ns_worker(query, key, ...) sub_rows(df, rows) } ns_base_uri <- function() "http://explorer.natureserve.org/servlet/NatureServe?searchSpeciesUid=%s" ns_worker <- function(x, key, ...) { tmp <- tryCatch(natserv::ns_search(x = x, key = key, ...), error = function(e) e) if (inherits(tmp, "error")) return(tibble::data_frame()) tmp <- tmp[, c("globalSpeciesUid","jurisdictionScientificName","commonName","natureServeExplorerURI")] names(tmp) <- c('id', 'scientificname', 'commonname', 'uri') tmp } taxize/R/comm2sci.R0000644000176200001440000001225313143141314013614 0ustar liggesusers#' Get scientific names from common names. #' #' @export #' @param commnames One or more common names or partial names. #' @param db Data source, one of \emph{"eol"} (default), \emph{"itis"}, #' \emph{"tropicos"}, \emph{"ncbi"}, or \emph{"worms"}. #' @param itisby Search for common names across entire names (search, default), #' at beginning of names (begin), or at end of names (end). #' @param simplify (logical) If \code{TRUE}, simplify output to a vector #' of names. If \code{FALSE}, return variable formats from different sources, #' usually a data.frame. #' @param ... Further arguments passed on to internal methods. #' @return If \code{simplify=TRUE}, a list of scientific names, with list #' labeled by your input names. If \code{simplify=FALSE}, a data.frame with #' columns that vary by data source #' @seealso \code{\link[taxize]{sci2comm}} #' @details For data sources ITIS and NCBI you can pass in common names #' directly, and use \code{\link[taxize]{get_uid}} or #' \code{\link[taxize]{get_tsn}} to get ids first, then pass in to this fxn. #' #' For the other data sources, you can only pass in common names directly. #' @author Scott Chamberlain #' @examples \dontrun{ #' comm2sci(commnames='black bear') #' comm2sci(commnames='black bear', simplify = FALSE) #' comm2sci(commnames='black bear', db='itis') #' comm2sci(commnames='annual blue grass', db='tropicos') #' comm2sci(commnames=c('annual blue grass','tree of heaven'), db='tropicos') #' comm2sci(commnames=c('black bear', 'roe deer')) #' comm2sci('blue whale', db = "worms") #' comm2sci(c('blue whale', 'dwarf surfclam'), db = "worms") #' #' # Output easily converts to a data.frame with plyr::ldply #' library(plyr) #' ldply(comm2sci(commnames=c('annual blue grass','tree of heaven'), #' db='tropicos')) #' #' # ncbi: pass in uid's from get_uid() directly #' x <- get_uid("western capercaillie", modifier = "Common Name") #' comm2sci(x) #' # itis: pass in tsn's from get_tsn() directly #' x <- get_tsn(c("Louisiana black bear", "american crow"), #' searchtype = "common") #' comm2sci(x) #' } comm2sci <- function(commnames, db='eol', itisby='search', simplify=TRUE, ...) { UseMethod("comm2sci") } #' @export comm2sci.default <- function(commnames, db='eol', itisby='search', simplify=TRUE, ...) { assert(commnames, "character") assert(simplify, "logical") temp <- lapply(commnames, sci_from_comm, db = db, simplify = simplify, itisby = itisby, ...) stats::setNames(temp, commnames) } sci_from_comm <- function(nn, db, simplify, itisby, ...) { switch( db, eol = c2s_eol(terms = nn, simplify, ...), itis = c2s_itis(nn, itisby, simplify, ...), tropicos = c2s_tp(simplify, commonname = nn, ...), ncbi = { ids <- get_uid(nn, modifier = "Common Name", ...) c2s_ncbi(ids, ...) }, worms = c2s_worms(nn, simplify, ...), stop("'db' must be one of 'eol', 'itis', 'tropicos', 'ncbi', 'worms'", call. = FALSE) ) } #' @export comm2sci.tsn <- function(commnames, db='eol', itisby='search', simplify=TRUE, ...) { temp <- lapply(commnames, c2s_itis_, simplify = simplify, ...) stats::setNames(temp, commnames) } #' @export comm2sci.uid <- function(commnames, db='eol', itisby='search', simplify=TRUE, ...) { temp <- lapply(commnames, c2s_ncbi, simplify = simplify, ...) stats::setNames(temp, commnames) } # helpers ------------ c2s_itis <- function(x, by='search', simplify, ...){ tmp <- switch( by, search = ritis::search_common(x, ...), begin = ritis::search_common(x, from = "begin", ...), end = ritis::search_common(x, from = "end", ...) ) # remove empty tsn slots tsns <- as.character(suppressWarnings(tmp$tsn)) tsns <- tsns[!sapply(tsns, nchar, keepNA = FALSE) == 0] # get scientific names tmp <- data.table::setDF( data.table::rbindlist( lapply(tsns, ritis::scientific_name), fill = TRUE, use.names = TRUE ) ) if (simplify) { as.character(tmp$combinedname) } else{ tmp } } c2s_itis_ <- function(x, by='search', simplify, ...){ tmp <- data.table::setDF( data.table::rbindlist( lapply(x, ritis::scientific_name), fill = TRUE, use.names = TRUE ) ) if (simplify) { as.character(tmp$combinedname) } else{ tmp } } c2s_ncbi <- function(x, simplify, ...) { baseurl <- paste0(ncbi_base(), "/entrez/eutils/efetch.fcgi?db=taxonomy") ID <- paste("ID=", x, sep = "") searchurl <- paste(baseurl, ID, sep = "&") tt <- GET(searchurl) stop_for_status(tt) res <- con_utf8(tt) ttp <- xml2::read_xml(res) # common name out <- xml_text(xml_find_all(ttp, "//TaxaSet/Taxon/ScientificName")) # NCBI limits requests to three per second Sys.sleep(0.33) return(out) } c2s_eol <- function(simplify, ...){ tmp <- eol_search(...) if (simplify) { as.character(tmp$name) } else { tmp } } c2s_tp <- function(simplify, ...){ tmp <- tp_search(...) if (simplify) { as.character(tmp$scientificname) } else{ tmp } } c2s_worms <- function(x, simplify, ...){ tmp <- try_df(worrms::wm_records_common(name = x, ...)) if (simplify) { as.character(tmp$scientificname) } else{ tmp } } taxize/R/status_codes.R0000644000176200001440000000060412672032225014603 0ustar liggesusers#' Get HTTP status codes #' #' @export #' @seealso \code{\link{ping}} #' @examples #' status_codes() status_codes <- function() { c( 100,101,102,200,201,202,203,204,205,206,207,208,226,300,301,302, 303,304,305,306,307,308,400,401,402,403,404,405,406,407,408,409, 410,411,412,413,414,415,416,417,418,419,420,422,423,424,425,426, 500,501,502,503,504,505,506,507,508 ) } taxize/R/tp_refs.R0000644000176200001440000000267212672106003013550 0ustar liggesusers#' Return all reference records for for a taxon name with a given id. #' #' @export #' @param id the taxon identifier code #' @param key Your Tropicos API key; loads from .Rprofile. #' @param ... Curl options passed on to \code{\link[httr]{GET}} #' @return List or dataframe. #' @examples \dontrun{ #' tp_refs(id = 25509881) #' } tp_refs <- function(id, key = NULL, ...) { url = sprintf('http://services.tropicos.org/Name/%s/References', id) key <- getkey(key, "tropicosApiKey") args <- tc(list(apikey = key, format = 'json')) tmp <- GET(url, query = args, ...) stop_for_status(tmp) tmp2 <- con_utf8(tmp) res <- jsonlite::fromJSON(tmp2, FALSE) do.call(rbind.fill, lapply(res, function(x){ x <- x$Reference names(x) <- tolower(names(x)) data.frame(x, stringsAsFactors = FALSE) })) } #' Return all reference records for for a taxon name with a given id. #' #' Function name changed to tp_refs. #' #' @param id the taxon identifier code #' @param format return in json or xml format (defaults to json) #' @param output raw = json or xml; or df = data.frame #' @param key Your Tropicos API key; loads from .Rprofile. #' @param verbose Print messages (default) or not, logical #' @export #' @keywords internal #' @rdname tp_namereferences-deprecated tp_namereferences <- function(id, format = 'json', output = 'df', key = NULL, verbose=TRUE) { .Deprecated("tp_refs", "taxize", "Function name changed. See tp_refs", "tp_namereferences") } taxize/R/tax_rank.R0000644000176200001440000000715113114317150013711 0ustar liggesusers#' Get rank for a given taxonomic name. #' #' @export #' @param x (character) Vector of one or more taxon names (character) or #' IDs (character or numeric) to query. Or objects returned from #' \code{get_*()} functions like \code{\link{get_tsn}} #' @param db (character) database to query. either \code{ncbi}, \code{itis}, #' \code{eol}, \code{col}, \code{tropicos}, \code{gbif}, \code{nbn}, #' \code{worms}, \code{natserv}, \code{bold}. Note that each taxonomic data #' source has their own identifiers, so that if you provide the wrong #' \code{db} value for the identifier you may get a result, but it will #' likely be wrong (not what you were expecting). #' @param ... Additional arguments to \code{\link{classification}} #' @return A named list of character vectors with ranks (all lower-cased) #' @note While \code{\link[taxize]{tax_name}} returns the name of a specified #' rank, \code{\link[taxize]{tax_rank}} returns the actual rank of the taxon. #' @seealso \code{\link[taxize]{classification}}, \code{\link[taxize]{tax_name}} #' @examples \dontrun{ #' tax_rank(x = "Helianthus annuus", db = "itis") #' tax_rank(get_tsn("Helianthus annuus")) #' tax_rank(c("Helianthus", "Pinus", "Poa"), db = "itis") #' #' tax_rank(get_boldid("Helianthus annuus")) #' tax_rank("421377", db = "bold") #' tax_rank(421377, db = "bold") #' #' tax_rank(c("Plantae", "Helianthus annuus", #' "Puma", "Homo sapiens"), db = 'itis') #' tax_rank(c("Helianthus annuus", "Quercus", "Fabaceae"), db = 'tropicos') #' #' tax_rank(names_list("species"), db = 'gbif') #' tax_rank(names_list("family"), db = 'gbif') #' #' tax_rank(c("Platanista gangetica", "Lichenopora neapolitana"), #' db = "worms") #' } tax_rank <- function(x, db = NULL, ...) { UseMethod("tax_rank") } #' @export tax_rank.default <- function(x, db = NULL, ...) { stop("no 'tax_rank' method for ", class(x), call. = FALSE) } #' @export tax_rank.default <- function(x, db = NULL, ...) { stats::setNames(tax_rank_(x, ...), x) } #' @export tax_rank.character <- function(x, db = NULL, ...) { nstop(db) stopifnot(length(db) == 1) switch( db, bold = stats::setNames(tax_rank_(process_ids(x, db, get_boldid), ...), x), col = stats::setNames(tax_rank_(process_ids(x, db, get_colid), ...), x), eol = stats::setNames(tax_rank_(process_ids(x, db, get_eolid), ...), x), gbif = stats::setNames(tax_rank_(process_ids(x, db, get_gbifid), ...), x), natserv = stats::setNames(tax_rank_(process_ids(x, db, get_natservid), ...), x), nbn = stats::setNames(tax_rank_(process_ids(x, db, get_nbnid), ...), x), tol = stats::setNames(tax_rank_(process_ids(x, db, get_tolid), ...), x), tropicos = stats::setNames(tax_rank_(process_ids(x, db, get_tpsid), ...), x), itis = stats::setNames(tax_rank_(process_ids(x, db, get_tsn), ...), x), ncbi = stats::setNames(tax_rank_(process_ids(x, db, get_uid), ...), x), worms = stats::setNames(tax_rank_(process_ids(x, db, get_wormsid), ...), x), stop("the provided db value was not recognised", call. = FALSE) ) } #' @export tax_rank.numeric <- function(x, db = NULL, ...) { tax_rank(as.character(x), db, ...) } # --------- tax_rank_ <- function(id, ...) { fun <- function(x, clz, ...) { res <- classification(x, db = clz, ...) if (is.na(res)) { NA_character_ } else { if (NROW(res[[1]]) > 0) { tt <- res[[1]] out <- tt[nrow(tt), 'rank'][[1]] if (length(out) == 0) NA_character_ else tolower(out) } else { NA_character_ } } } lapply(id, fun, clz = dbswap(class(id)), ...) } taxize/R/iucn_summary.R0000755000176200001440000002613213142671537014635 0ustar liggesusers#' @title Get a summary from the IUCN Red List #' #' @description Get a summary from the IUCN Red List (\url{http://www.iucnredlist.org/}). #' #' @export #' @param x character; Scientific name. Should be cleaned and in the #' format \emph{ }. #' @param silent logical; Make errors silent or not (when species not found). #' @param parallel logical; Search in parallel to speed up search. You have to #' register a parallel backend if \code{TRUE}. See e.g., doMC, doSNOW, etc. #' @param distr_detail logical; If \code{TRUE}, the geographic distribution is #' returned as a list of vectors corresponding to the different range types: #' native, introduced, etc. #' @param key a Redlist API key, get one from \url{http://apiv3.iucnredlist.org/api/v3/token} #' Required for \code{iucn_summary} but not needed for \code{iucn_summary_id}. Defaults to #' \code{NULL} in case you have your key stored (see \code{Redlist Authentication} below). #' @param ... Currently not used. #' #' @return A list (for every species one entry) of lists with the following #' items: #' \item{status}{Red List Category.} #' \item{history}{History of status, if available.} #' \item{distr}{Geographic distribution, if available.} #' \item{trend}{Trend of population size, if available.} #' #' @note Not all entries (history, distr, trend) are available for every species #' and NA is returned. #' \code{\link[taxize]{iucn_status}} is an extractor function to easily extract #' status into a vector. #' #' @seealso \code{\link[taxize]{iucn_status}} #' #' @details Beware: IUCN functions can give back incorrect data. This isn't our fault. #' We do our best to get you the correct data quickly, but sometimes IUCN gives #' back the wrong data, and sometimes Global Names gives back the wrong data. #' We will fix these as soon as possible. In the meantime, just make sure that #' the data you get back is correct. #' #' \code{iucn_summary} has a default method that errors when anything's #' passed in that's not \code{character} or \code{iucn} class - a #' \code{iucn_summary.character} method for when you pass in taxon names - #' and a \code{iucn_summary.iucn} method so you can pass in iucn class objects #' as output from \code{\link{get_iucn}} or \code{\link{as.iucn}}. If you #' already have IUCN IDs, coerce them to \code{iucn} class via #' \code{as.iucn(..., check = FALSE)} #' #' @author Eduard Szoecs, \email{eduardszoecs@@gmail.com} #' @author Philippe Marchand, \email{marchand.philippe@@gmail.com} #' @author Scott Chamberlain, \email{myrmecocystus@@gmail.com} #' #' @section Redlist Authentication: #' \code{iucn_summary} uses the new Redlist API for searching for a IUCN ID, so we #' use the \code{\link[rredlist]{rl_search}} function internally. This function #' requires an API key. Get the key at \url{http://apiv3.iucnredlist.org/api/v3/token}, #' and pass it to the \code{key} parameter, or store in your \code{.Renviron} file like #' \code{IUCN_REDLIST_KEY=yourkey} or in your \code{.Rprofile} file like #' \code{options(iucn_redlist_key="yourkey"}. We strongly encourage you to not pass #' the key in the function call but rather store it in one of those two files. #' This key will also set you up to use the \pkg{rredlist} package. #' #' @examples \dontrun{ #' # if you send a taxon name, an IUCN API key is required #' ## here, the key is being detected from a .Rprofile file #' ## or .Renviron file, See "Redlist Authentication" above #' iucn_summary("Lutra lutra") #' #' ia <- iucn_summary(c("Panthera uncia", "Lynx lynx")) #' ia <- iucn_summary(c("Panthera uncia", "Lynx lynx", "aaa")) #' #' ## get detailed distribution #' iac <- iucn_summary(x="Ara chloropterus", distr_detail = TRUE) #' iac[[1]]$distr #' #' #' # If you pass in an IUCN ID, you don't need to pass in a Redlist API Key #' ia <- iucn_summary_id(c(22732, 12519)) #' # extract status #' iucn_status(ia) #' # extract other available information #' ia[['Lynx lynx']]$history #' ia[['Panthera uncia']]$distr #' ia[[2]]$trend #' ## the outputs aren't quite identical, but we're working on it #' identical( #' iucn_summary_id(c(22732, 12519)), #' iucn_summary(as.iucn(c(22732, 12519))) #' ) #' #' # using parallel, e.g., with doMC package, register cores first #' # library(doMC) #' # registerDoMC(cores = 2) #' # nms <- c("Panthera uncia", "Lynx lynx", "Ara chloropterus", "Lutra lutra") #' # (res <- iucn_summary(nms, parallel = TRUE)) #' } iucn_summary <- function(x, parallel = FALSE, distr_detail = FALSE, key = NULL, ...) { UseMethod("iucn_summary") } #' @export iucn_summary.default <- function(x, parallel = FALSE, distr_detail = FALSE, key = NULL, ...) { stop("no 'iucn_summary' method for ", class(x), call. = FALSE) } #' @export iucn_summary.character <- function(x, parallel = FALSE, distr_detail = FALSE, key = NULL, ...) { xid <- get_iucn(x) if (any(is.na(xid))) { nas <- x[is.na(xid)] warning("taxa '", paste0(nas, collapse = ", ") , "' not found!\n Returning NAs!") if (all(is.na(xid))) { return(list(status = NA, history = NA, distr = NA, trend = NA)) } } xid <- as.numeric(xid) res <- get_iucn_summary2(xid, parallel, distr_detail, key = key, ...) structure(stats::setNames(res, x), class = "iucn_summary") } #' @export iucn_summary.iucn <- function(x, parallel = FALSE, distr_detail = FALSE, key = NULL, ...) { res <- get_iucn_summary2(x, parallel, distr_detail, key = key, ...) structure(stats::setNames(res, x), class = "iucn_summary") } #' @param species_id an IUCN ID #' @export #' @rdname iucn_summary iucn_summary_id <- function(species_id, silent = TRUE, parallel = FALSE, distr_detail = FALSE, ...) { .Deprecated(msg = gsub("\\s\\s|\n", "", "this function will be deprecated in the next version. use iucn_summary()")) res <- get_iucn_summary(species_id, silent, parallel, distr_detail, by_id = TRUE, ...) structure(stats::setNames(res, species_id), class = "iucn_summary") } ## helpers -------- get_iucn_summary <- function(query, silent, parallel, distr_detail, by_id, key = NULL, ...) { fun <- function(query) { if (!by_id) { #to deal with subspecies sciname_q <- strsplit(query, " ") spec <- tolower(paste(sciname_q[[1]][1], sciname_q[[1]][2])) res <- tryCatch(rredlist::rl_search(spec, key = key), error = function(e) e) if (inherits(res, "error")) { stop(res$message, " - see ?iucn_summary and http://apiv3.iucnredlist.org/api/v3/token", call. = FALSE) } if (!inherits(res, "try-error") && NROW(res$result) > 0) { df <- unique(res$result) #check if there are several matches scinamelist <- df$scientific_name species_id <- df$taxonid[which(tolower(scinamelist) == tolower(query))] } } else { species_id <- query } if (!exists('species_id')) { warning("Species '", query , "' not found!\n Returning NA!") out <- list(status = NA, history = NA, distr = NA, trend = NA) } else { url <- paste("http://api.iucnredlist.org/details/", species_id, "/0", sep = "") e <- try(h <- xml2::read_html(url), silent = silent) if (!inherits(e, "try-error")) { # scientific name if (by_id) { sciname <- xml2::xml_text(xml2::xml_find_all(h, '//h1[@id = "scientific_name"]')) } # status status <- xml2::xml_text(xml2::xml_find_all(h, '//div[@id ="red_list_category_code"]')) # history history <- data.frame(year = xml2::xml_text(xml2::xml_find_all(h, '//div[@class="year"]')), category = xml2::xml_text(xml2::xml_find_all(h, '//div[@class="category"]'))) if (nrow(history) == 0) history <- NA # distribution distr <- xml2::xml_text(xml2::xml_find_all(h, '//ul[@class="countries"]')) if (length(distr) == 0) { distr <- NA } else { distr <- sub("^\n", "", distr) # remove leading newline distr <- strsplit(distr, "\n") if (distr_detail) { names(distr) <- xml2::xml_text(xml2::xml_find_all(h, '//ul[@class="country_distribution"]//div[@class="distribution_type"]')) } else { distr <- unlist(distr) } } # trend trend <- xml2::xml_text(xml2::xml_find_all(h, '//div[@id="population_trend"]')) if (length(trend) == 0) trend <- NA out <- list(status = status, history = history, distr = distr, trend = trend) if (by_id) out$sciname <- sciname } else { warning("Species '", query , "' not found!\n Returning NA!", call. = FALSE) out <- list(status = NA, history = NA, distr = NA, trend = NA) } } return(out) } if (parallel) { out <- llply(query, fun, .parallel = TRUE) } else { out <- lapply(query, fun) } if (by_id) { names(out) <- llply(out, `[[`, "sciname") out <- llply(out, function(x) {x$sciname <- NULL; x}) } else { names(out) <- query } return(out) } try_red <- function(fun, x) { tryCatch(fun(id = x), error = function(e) e) } null_res <- list(status = NA, history = NA, distr = NA, trend = NA) get_iucn_summary2 <- function(query, parallel, distr_detail, key = NULL, ...) { fun <- function(z) { if (is.na(z)) return(null_res) res <- try_red(rredlist::rl_search, z) if (!inherits(res, "error")) { # history history <- try_red(rredlist::rl_history, z) if (NROW(history$result) == 0 || inherits(history, "error")) { history <- NA } else { history <- history$result } # distribution distr <- try_red(rredlist::rl_occ_country, z) if (NROW(distr$result) == 0 || inherits(distr, "error")) { distr <- NA } else { distr <- distr$result if (distr_detail) { distr <- split(distr, distr$distribution_code) } else { distr <- distr$country } } # trend - NOT SURE HOW TO GET IT # build output out <- list(status = res$result$category, history = history, distr = distr, trend = NA) } else { warning("taxon ID '", z , "' not found!\n Returning NA!", call. = FALSE) out <- null_res } return(out) } if (parallel) { llply(query, fun, .parallel = TRUE) } else { lapply(query, fun) } } #' Extractor functions for \code{iucn}-class. #' #' @export #' @param x an \code{iucn}-object as returned by \code{iucn_summary} #' @param ... Currently not used #' @return A character vector with the status. #' @seealso \code{\link[taxize]{iucn_summary}} #' @examples \dontrun{ #' ia <- iucn_summary(c("Panthera uncia", "Lynx lynx")) #' iucn_status(ia)} iucn_status <- function(x, ...){ UseMethod("iucn_status") } #' @export iucn_status.default <- function(x, ...) { stop("no method for 'iucn_status' for ", class(x), call. = FALSE) } #' @export iucn_status.iucn_summary <- function(x, ...) { unlist(lapply(x, function(x) x$status)) } taxize/R/fungorum.R0000644000176200001440000000711212753133434013752 0ustar liggesusers#' @title Index Fungorum #' #' @description Search for taxonomic names in Index Fungorum #' #' @name fungorum #' @param q (character) Query term #' @param anywhere (logical) Default: \code{TRUE} #' @param limit (integer) Number of results to return. max limit #' value appears to be 6000, not positive about that though #' @param key (character) A IndexFungorum taxon key #' @param lsid (character) an LSID, e.,g. "urn:lsid:indexfungorum.org:names:81085" #' @param date (character) Date, of the form YYYMMDD #' @param ... Curl options passed on to \code{\link[httr]{GET}} #' @references \url{http://www.indexfungorum.org/}, API docs: #' \url{http://www.indexfungorum.org/ixfwebservice/fungus.asmx} #' @return A \code{data.frame}, or \code{NULL} if no results #' @examples \dontrun{ #' # NameSearch #' fg_name_search(q = "Gymnopus", limit = 2) #' fg_name_search(q = "Gymnopus") #' #' # EpithetSearch #' fg_epithet_search(q = "phalloides") #' #' # NameByKey #' fg_name_by_key(17703) #' #' # NameFullByKey #' fg_name_full_by_lsid("urn:lsid:indexfungorum.org:names:81085") #' #' # AllUpdatedNames #' fg_all_updated_names(date = gsub("-", "", Sys.Date() - 2)) #' #' # DeprecatedNames #' fg_deprecated_names(date=20151001) #' #' # AuthorSearch #' fg_author_search(q = "Fayod", limit = 2) #' } #' @export #' @rdname fungorum fg_name_search <- function(q, anywhere = TRUE, limit = 10, ...) { by_name_search("NameSearch", q, anywhere, limit, ...) } #' @export #' @rdname fungorum fg_author_search <- function(q, anywhere = TRUE, limit = 10, ...) { by_name_search("AuthorSearch", q, anywhere, limit, ...) } #' @export #' @rdname fungorum fg_epithet_search <- function(q, anywhere = TRUE, limit = 10, ...) { by_name_search("EpithetSearch", q, anywhere, limit, ...) } #' @export #' @rdname fungorum fg_name_by_key <- function(key, ...) { tmp <- fung_GET("NameByKey", list(NameKey = key), ...) fg_df(fung_parse(tmp)) } #' @export #' @rdname fungorum fg_name_full_by_lsid <- function(lsid, ...) { tmp <- fung_GET("NameFullByKey", list(NameLsid = lsid), ...) xml2::xml_text(xml2::read_xml(tmp)) } #' @export #' @rdname fungorum fg_all_updated_names <- function(date, ...) { tmp <- fung_GET("AllUpdatedNames", list(startDate = date), ...) xml <- fung_parse(tmp) (x <- setDF(rbindlist(lapply(xml, function(z) { vapply(xml_children(z), function(w) as.list(xml_text(w)), list(1)) })))) } #' @export #' @rdname fungorum fg_deprecated_names <- function(date, ...) { tmp <- fung_GET("DeprecatedNames", list(startDate = date), ...) xml <- fung_parse(tmp) df <- setDF(rbindlist( lapply(xml, function(z) { vapply(xml_children(z), function(w) as.list(xml_text(w)), list(1)) }) )) if (NROW(df) > 0) setNames(df, c('fungusnameoldlsid', 'fungusnamenewlsid')) else df } # helpers ----------------- fung_base <- function() "http://www.indexfungorum.org/ixfwebservice/fungus.asmx" fung_GET <- function(path, args, ...) { tt <- GET(file.path(fung_base(), path), query = args, ...) stop_for_status(tt) con_utf8(tt) } fung_parse <- function(x) { xml <- xml2::read_xml(x) xml_find_all(xml, "//IndexFungorum") } fg_df <- function(x) { (x <- setDF(rbindlist( lapply(x, function(z) { data.frame( lapply(xml_children(z), function(w) as.list(setNames(xml_text(w), gsub("x0020_", "", tolower(xml_name(w)))))), stringsAsFactors = FALSE ) }), use.names = TRUE, fill = TRUE ))) } by_name_search <- function(path, q, anywhere, limit, ...) { args <- tc(list(SearchText = q, AnywhereInText = as_l(anywhere), MaxNumber = limit)) tmp <- fung_GET(path, args, ...) fg_df(fung_parse(tmp)) } taxize/R/tpl_get.r0000644000176200001440000000520113160315102013566 0ustar liggesusers#' Get The Plant List csv files. #' #' @export #' @param x Directory to write csv files to. #' @param family If you want just one, or >1 family, but not all, list #' them in a vector. #' @param ... (list) Curl options passed on to \code{\link[httr]{GET}} #' @details Throws a warning if you already have a directory of the one #' provided, but still works. Writes to your home directory, change x #' as needed. #' @return Returns nothing to console, except a message and progress bar. #' Writes csv files to x. #' @author John Baumgartner (johnbb@@student.unimelb.edu.au) #' @seealso \code{\link{tpl_families}} #' @references The Plant List http://www.theplantlist.org #' @examples \dontrun{ #' # Get a few families #' dir <- file.path(tempdir(), "abc") #' tpl_get(dir, family = c("Platanaceae","Winteraceae")) #' readLines(file.path(dir, "Platanaceae.csv"), n = 5) #' #' # You can now get Gymnosperms as well #' dir1 <- file.path(tempdir(), "def") #' tpl_get(dir1, family = c("Pinaceae","Taxaceae")) #' #' # You can get mosses too! #' dir2 <- file.path(tempdir(), "ghi") #' tpl_get(dir2, family = "Echinodiaceae") #' #' # Get all families #' ## Beware, will take a while #' ## dir3 <- file.path(tempdir(), "jkl") #' ## tpl_get("dir3) #' } tpl_get <- function(x, family = NULL, ...) { temp <- httr::GET('http://www.theplantlist.org/1.1/browse/-/', ...) temp <- xml2::read_html(con_utf8(temp), encoding = "UTF-8") families <- xml2::xml_text( xml2::xml_find_all(temp, "//ul[@id='nametree']//a")) csvlinks <- sprintf( 'http://www.theplantlist.org%s%s.csv', xml2::xml_attr(xml2::xml_find_all(temp, "//ul[@id='nametree']//a"), 'href'), families) if (!is.null(family) && all(!family %in% families)) { stop(paste('Requested families not found on TPL.', 'Use tpl_families() to list plant families indexed by TPL.'), call. = FALSE) } if (!is.null(family) && any(!family %in% families)) { warning( sprintf('Requested families not found on TPL: %s.\n%s', paste(family[!family %in% families], collapse = ', '), 'Use tpl_families() to list plant families indexed by TPL.'), call. = FALSE) } if (!is.null(family)) { csvlinks <- csvlinks[families %in% family] families <- families[families %in% family] } message("Downloading csv files to ", x, "...") dir.create(x, showWarnings = FALSE, recursive = TRUE) plyr::l_ply(csvlinks, getcsv, x = x, .progress = "text") message("...el fin") } getcsv <- function(z, x) { #download.file(z, destfile = file.path(x, basename(z)), quiet = TRUE) invisible(GET(z, httr::write_disk(path = file.path(x, basename(z)), overwrite = TRUE))) } taxize/R/gnr_resolve.R0000644000176200001440000002747313125255342014446 0ustar liggesusers#' Resolve names using Global Names Resolver. #' #' @export #' @param names character; taxonomic names to be resolved. Doesn't work for #' vernacular/common names. #' @param data_source_ids character; IDs to specify what data source #' is searched. See \code{\link[taxize]{gnr_datasources}}. #' @param resolve_once logical; Find the first available match instead of #' matches across all data sources with all possible renderings of a name. #' When \code{TRUE}, response is rapid but incomplete. #' @param with_context logical; Reduce the likelihood of matches to taxonomic #' homonyms. When \code{TRUE} a common taxonomic context is calculated for #' all supplied names from matches in data sources that have classification #' tree paths. Names out of determined context are penalized during score #' calculation. #' @param canonical logical; If \code{FALSE} (default), gives back names with #' taxonomic authorities. If \code{TRUE}, returns canocial names #' (without tax. authorities and abbreviations). #' @param highestscore logical; Return those names with the highest score for #' each searched name? Defunct #' @param best_match_only (logical) If \code{TRUE}, best match only returned. #' Default: \code{FALSE} #' @param preferred_data_sources (character) A vector of one or more data #' source IDs. #' @param with_canonical_ranks (logical) Returns names with infraspecific #' ranks, if present. If \code{TRUE}, we force \code{canonical=TRUE}, otherwise #' this parameter would have no effect. Default: \code{FALSE} #' @param http The HTTP method to use, one of "get" or "post". Default: "get". #' Use \code{http="post"} with large queries. Queries with > 300 records #' use "post" automatically because "get" would fail #' @param ... Curl options passed on to \code{\link[httr]{GET}} #' @param cap_first (logical) For each name, fix so that the first name part is #' capitalized, while others are not. This web service is sensitive to #' capitalization, so you'll get different results depending on capitalization. #' First name capitalized is likely what you'll want and is the default. #' If \code{FALSE}, names are not modified. Default: \code{TRUE} #' @param fields (character) One of minimal (default) or all. Minimal gives #' back just four fields, whereas all gives all fields back. #' #' @author Scott Chamberlain \email{myrmecocystus@@gmail.com} #' @return A data.frame with one attribute \code{not_known}: a character #' vector of taxa unknown to the Global Names Index. Access like #' \code{attr(output, "not_known")}, or \code{attributes(output)$not_known}. #' Columns of the output data.frame: #' \itemize{ #' \item user_supplied_name (character) - the name you passed in to the #' \code{names} parameter, unchanged. #' \item submitted_name (character) - the actual name submitted to the GNR #' service #' \item data_source_id (integer/numeric) - data source ID #' \item data_source_title (character) - data source name #' \item gni_uuid (character) - Global Names Index UUID (aka identifier) #' \item matched_name (character) - the matched name in the GNR service #' \item matched_name2 (character) - returned if \code{canonical=TRUE}, in #' which case \emph{matched_name} is not returned #' \item classification_path (character) - names of the taxonomic #' classification tree, with names separated by pipes (\code{|}) #' \item classification_path_ranks (character) - ranks of the taxonomic #' classification tree, with names separated by pipes (\code{|}) #' \item classification_path_ids (character) - identifiers of the taxonomic #' classification tree, with names separated by pipes (\code{|}) #' \item taxon_id (character) - taxon identifier #' \item edit_distance (integer/numeric) - edit distance #' \item imported_at (character) - date imported #' \item match_type (integer/numeric) - match type #' \item match_value (character) - description of match type #' \item prescore (character) - pre score #' \item score (numeric) - score #' \item local_id (character) - local identifier #' \item url (character) - URL for taxon #' \item global_id (character) - global identifier #' \item current_taxon_id (character) - current taxon id #' \item current_name_string (character) - current name string #' } #' Note that names (i.e. rows) are dropped that are NA, are zero length #' strings, are not character vectors, or are not found by the API. #' @seealso \code{\link[taxize]{gnr_datasources}} \code{\link{tnrs}} #' @keywords resolve names taxonomy #' @references \url{http://gnrd.globalnames.org/api} #' \url{http://gnrd.globalnames.org/} #' @examples \dontrun{ #' gnr_resolve(names = c("Helianthus annuus", "Homo sapiens")) #' gnr_resolve(names = c("Asteraceae", "Plantae")) #' #' # Using data source 12 (Encyclopedia of Life) #' sources <- gnr_datasources() #' sources #' eol <- sources$id[sources$title == 'EOL'] #' gnr_resolve(names=c("Helianthos annuus","Homo sapians"), data_source_ids=eol) #' #' # Two species in the NE Brazil catalogue #' sps <- c('Justicia brasiliana','Schinopsis brasiliensis') #' gnr_resolve(names = sps, data_source_ids = 145) #' #' # Best match only, compare the two #' gnr_resolve(names = "Helianthus annuus", best_match_only = FALSE) #' gnr_resolve(names = "Helianthus annuus", best_match_only = TRUE) #' #' # Preferred data source #' gnr_resolve(names = "Helianthus annuus", preferred_data_sources = c(3,4)) #' #' # Return canonical names - default is canonical=FALSE #' head(gnr_resolve(names = "Helianthus annuus")) #' head(gnr_resolve(names = "Helianthus annuus", canonical=TRUE)) #' #' # Return canonical names with authority stripped but #' # ranks still present #' gnr_resolve("Scorzonera hispanica L. subsp. asphodeloides Wallr.") #' ## vs. #' gnr_resolve("Scorzonera hispanica L. subsp. asphodeloides Wallr.", #' with_canonical_ranks = TRUE) #' } gnr_resolve <- function(names, data_source_ids = NULL, resolve_once = FALSE, with_context = FALSE, canonical = FALSE, highestscore = TRUE, best_match_only = FALSE, preferred_data_sources = NULL, with_canonical_ranks = FALSE, http = "get", cap_first = TRUE, fields = "minimal", ...) { fields <- match.arg(fields, c("minimal", "all")) http <- match.arg(http, c("get", "post")) num = NULL url <- "http://resolver.globalnames.org/name_resolvers.json" # clean out zero length strings names <- Filter(function(x) nzchar(x) && !is.na(x) && is.character(x), names) # store original names supplied by user orig_names <- names if (cap_first) names <- taxize_capwords(names, onlyfirst = TRUE) names2 <- paste0(names, collapse = "|") if (length(names) > 300 && http == "get") http <- "post" data_source_ids <- paste0(data_source_ids, collapse = "|") preferred_data_sources <- paste0(preferred_data_sources, collapse = "|") if (nchar(preferred_data_sources, keepNA = FALSE) == 0) preferred_data_sources <- NULL if (with_canonical_ranks) canonical <- TRUE args <- tc(list(names = names2, data_source_ids = data_source_ids, resolve_once = cv(resolve_once), with_context = cv(with_context), best_match_only = cv(best_match_only), preferred_data_sources = preferred_data_sources, with_canonical_ranks = cv(with_canonical_ranks))) args <- argsnull(args) if (http == 'get') { tmp <- GET(url, query = args, ...) warn_for_status(tmp) tmp2 <- con_utf8(tmp) dat <- jsonlite::fromJSON(tmp2, FALSE)$data } else { args <- args[!names(args) %in% "names"] nms <- split(names, ceiling(seq_along(names)/500)) datbits <- list() for (i in seq_along(nms)) { tt <- data.frame(num = 1:length(nms[[i]]), names = nms[[i]]) tt <- data.frame(ddply(tt, .(num), summarise, paste0(num, "|", names))[,2]) file <- tempfile(fileext = ".txt") write.table(tt, file = file, row.names = FALSE, col.names = FALSE, quote = FALSE) ss <- POST(url, query = args, body = list(file = upload_file(path = file)), ...) warn_for_status(ss) ss <- con_utf8(ss) datbits[[i]] <- jsonlite::fromJSON(ss, FALSE)$data } dat <- do.call("c", datbits) } # add original name supplied by user dat <- Map(function(x,y) c(original_name = y, x), dat, orig_names) data_ <- lapply(dat, function(y) { if (!is.null(unlist(y$results))) { res <- lapply(y$results, function(x) { take_fields <- switch(fields, minimal = c("name_string", "data_source_title","score", "canonical_form"), all = names(x) ) take <- x[take_fields] take[sapply(take, is.null)] <- NA return(data.frame(take, stringsAsFactors = FALSE)) }) } else { res <- NULL } list(y[c("original_name", "supplied_name_string")], res) }) not_known <- Filter(function(x) is.null(x[[2]]), data_) not_known <- sapply(not_known, function(x) x[[1]]$original_name) # vapply(not_known, "[[", "", 1) data_ <- Filter(function(x) !is.null(x[[2]]), data_) # check for empty data object drill <- tryCatch(data_[[1]], error = function(e) e) to_rename <- c("original_name", "supplied_name_string", "name_string", "canonical_form") if (inherits(drill, "simpleError")) { out <- data.frame(NULL) } else { if (is.null(preferred_data_sources)) { data_2 <- ldply(data_, function(x) data.frame(x[[1]], ldply( if (length(x[[2]]) == 0) { list(data.frame(name_string = "", data_source_title = "", score = NaN, canonical_form = "")) } else { x[[2]] }), stringsAsFactors = FALSE)) names(data_2)[names(data_2) %in% to_rename] <- c("user_supplied_name", "submitted_name", "matched_name", "matched_name2") data_2$matched_name <- as.character(data_2$matched_name) data_2$data_source_title <- as.character(data_2$data_source_title) data_2$matched_name2 <- as.character(data_2$matched_name2) if (canonical) { data_2 <- data_2[ , !names(data_2) %in% "matched_name"] } else { data_2 <- data_2[ , !names(data_2) %in% "matched_name2"] } # canonical = TRUE, may result into duplicates out <- unique(data_2) } else { data_preferred <- lapply(dat, function(y) { if (!is.null(unlist(y$preferred_results))) { res <- lapply(y$preferred_results, function(x) { data.frame(x[c("name_string", "data_source_title", "score", "canonical_form")], stringsAsFactors = FALSE) }) } else { res <- NULL } list(y[c("original_name", "supplied_name_string")], res) }) data_2_preferred <- ldply(data_preferred, function(x) data.frame(x[[1]], ldply(if (length(x[[2]]) == 0) { list(data.frame(name_string = "", data_source_title = "", score = NaN, canonical_form = "")) } else { x[[2]] }), stringsAsFactors = FALSE)) if (NROW(data_2_preferred) == 0) { out <- data_2_preferred } else { names(data_2_preferred)[names(data_2_preferred) %in% to_rename] <- c("user_supplied_name", "submitted_name", "matched_name", "matched_name2") data_2_preferred$matched_name <- as.character(data_2_preferred$matched_name) data_2_preferred$data_source_title <- as.character(data_2_preferred$data_source_title) data_2_preferred$matched_name2 <- as.character(data_2_preferred$matched_name2) if (canonical) { out <- data_2_preferred[ , !names(data_2_preferred) %in% "matched_name"] } else { out <- data_2_preferred[ , !names(data_2_preferred) %in% "matched_name2"] } } } } row.names(out) <- NULL structure(out, not_known = not_known) } cv <- function(x) { if (x) { 'true' } else { NULL } } taxize/R/iucn_getname.R0000644000176200001440000000276513160565550014560 0ustar liggesusers#' Get any matching IUCN species names #' #' @export #' @param name character; taxon name #' @param verbose logical; should messages be printed? #' @param ... Further arguments passed on to \code{\link{iucn_summary}} #' @seealso \code{\link{iucn_summary}} \code{\link{iucn_status}} #' @return Character vector of names that matched in IUCN #' @details Beware: IUCN functions can give back incorrect data. This isn't #' our fault. We do our best to get you the correct data quickly, but sometimes #' IUCN gives back the wrong data, and sometimes Global Names gives back the #' wrong data. We will fix these as soon as possible. In the meantime, just #' make sure that the data you get back is correct. #' @examples \dontrun{ #' iucn_getname(name = "Cyanistes caeruleus") #' iucn_getname(name = "Panthera uncia") #' #' # not found in global names #' # iucn_getname(name = "Abronia pinsapo") #' #' # not found in IUCN search #' iucn_getname(name = "Acacia allenii") #' } iucn_getname <- function(name, verbose = TRUE, ...) { mssg(verbose, "searching Global Names ...") all_names <- gni_search(search_term = name, parse_names = TRUE) if (NROW(all_names) == 0) { stop("No names found matching ", name, call. = FALSE) } mssg(verbose, "searching IUCN...") # res <- gnr_resolve(all_names$canonical, data_source_ids = 163, fields = "all") # unique(res$canonical_form) out <- suppressWarnings(iucn_summary(all_names$canonical, ...)) as.character(all_names$canonical[!sapply(out, function(x) x$status) %in% NA]) } taxize/R/get_boldid.R0000644000176200001440000002700413160602077014203 0ustar liggesusers#' Get the BOLD (Barcode of Life) code for a search term. #' #' @importFrom bold bold_tax_name bold_tax_id #' @export #' @param searchterm character; A vector of common or scientific names. #' @param fuzzy (logical) Whether to use fuzzy search or not (default: FALSE). #' @param dataTypes (character) Specifies the datatypes that will be returned. #' See \code{\link{bold_search}} for options. #' @param includeTree (logical) If TRUE (default: FALSE), returns a list #' containing information for parent taxa as well as the specified taxon. #' @param ask logical; should get_tsn be run in interactive mode? #' If TRUE and more than one TSN is found for teh species, the user is asked for #' input. If FALSE NA is returned for multiple matches. #' @param verbose logical; should progress be printed? #' @param x Input to \code{\link{as.boldid}} #' @param ... Curl options passed on to \code{\link[httr]{GET}} #' @param rows numeric; Any number from 1 to infinity. If the default NA, all rows are #' considered. Note that this function still only gives back a boldid class object with one #' to many identifiers. See \code{\link[taxize]{get_boldid_}} to get back all, or a subset, #' of the raw data that you are presented during the ask process. #' @param division (character) A division (aka phylum) name. Optional. See \code{Filtering} #' below. #' @param parent (character) A parent name (i.e., the parent of the target search #' taxon). Optional. See \code{Filtering} below. #' @param rank (character) A taxonomic rank name. See \code{\link{rank_ref}} for possible #' options. Though note that some data sources use atypical ranks, so inspect the #' data itself for options. Optional. See \code{Filtering} below. #' @param check logical; Check if ID matches any existing on the DB, only used in #' \code{\link{as.boldid}} #' @template getreturn #' #' @section Filtering: #' The parameters \code{division}, \code{parent}, and \code{rank} are not #' used in the search to the data provider, but are used in filtering the data down to a #' subset that is closer to the target you want. For all these parameters, #' you can use regex strings since we use \code{\link{grep}} internally to match. #' Filtering narrows down to the set that matches your query, and removes the rest. #' #' @family taxonomic-ids #' @seealso \code{\link[taxize]{classification}} #' #' @examples \dontrun{ #' get_boldid(searchterm = "Agapostemon") #' get_boldid(searchterm = "Chironomus riparius") #' get_boldid(c("Chironomus riparius","Quercus douglasii")) #' splist <- names_list('species') #' get_boldid(splist, verbose=FALSE) #' #' # Fuzzy searching #' get_boldid(searchterm="Osmi", fuzzy=TRUE) #' #' # Get back a subset #' get_boldid(searchterm="Osmi", fuzzy=TRUE, rows = 1) #' get_boldid(searchterm="Osmi", fuzzy=TRUE, rows = 1:10) #' get_boldid(searchterm=c("Osmi","Aga"), fuzzy=TRUE, rows = 1) #' get_boldid(searchterm=c("Osmi","Aga"), fuzzy=TRUE, rows = 1:3) #' #' # When not found #' get_boldid("howdy") #' get_boldid(c("Chironomus riparius", "howdy")) #' get_boldid('Epicordulia princeps') #' get_boldid('Arigomphus furcifer') #' get_boldid("Cordulegaster erronea") #' get_boldid("Nasiaeshna pentacantha") #' #' # Narrow down results to a division or rank, or both #' ## Satyrium example #' ### Results w/o narrowing #' get_boldid("Satyrium") #' ### w/ phylum #' get_boldid("Satyrium", division = "Plants") #' get_boldid("Satyrium", division = "Animals") #' #' ## Rank example #' get_boldid("Osmia", fuzzy = TRUE) #' get_boldid("Osmia", fuzzy = TRUE, rank = "genus") #' #' # Fuzzy filter on any filtering fields #' ## uses grep on the inside #' get_boldid("Satyrium", division = "anim") #' get_boldid("Aga", fuzzy = TRUE, parent = "*idae") #' #' # Convert a boldid without class information to a boldid class #' as.boldid(get_boldid("Agapostemon")) # already a boldid, returns the same #' as.boldid(get_boldid(c("Agapostemon","Quercus douglasii"))) # same #' as.boldid(1973) # numeric #' as.boldid(c(1973,101009,98597)) # numeric vector, length > 1 #' as.boldid("1973") # character #' as.boldid(c("1973","101009","98597")) # character vector, length > 1 #' as.boldid(list("1973","101009","98597")) # list, either numeric or character #' ## dont check, much faster #' as.boldid("1973", check=FALSE) #' as.boldid(1973, check=FALSE) #' as.boldid(c("1973","101009","98597"), check=FALSE) #' as.boldid(list("1973","101009","98597"), check=FALSE) #' #' (out <- as.boldid(c(1973,101009,98597))) #' data.frame(out) #' as.boldid( data.frame(out) ) #' #' # Get all data back #' get_boldid_("Osmia", fuzzy=TRUE, rows=1:5) #' get_boldid_("Osmia", fuzzy=TRUE, rows=1) #' get_boldid_(c("Osmi","Aga"), fuzzy=TRUE, rows = 1:3) #' } get_boldid <- function(searchterm, fuzzy = FALSE, dataTypes = 'basic', includeTree = FALSE, ask = TRUE, verbose = TRUE, rows = NA, rank = NULL, division = NULL, parent = NULL, ...) { assert(ask, "logical") assert(verbose, "logical") assert(fuzzy, "logical") assert(dataTypes, "character") assert(includeTree, "logical") assert(rank, "character") assert(division, "character") assert(parent, "character") fun <- function(x, ask, verbose, rows) { direct <- FALSE mssg(verbose, "\nRetrieving data for taxon '", x, "'\n") bold_df <- bold_search(name = x, fuzzy = fuzzy, dataTypes = dataTypes, includeTree = includeTree, ...) mm <- NROW(bold_df) > 1 if (!class(bold_df) == "data.frame") { boldid <- NA_character_ att <- "not found" } else { if (all(names(bold_df) == "input")) { boldid <- NA_character_ att <- "not found" } else { bold_df <- rename(bold_df, c('parentname' = 'parent', 'tax_rank' = 'rank', 'tax_division' = 'division')) bold_df <- bold_df[,c("taxid","taxon","rank","division","parentid","parent")] # should return NA if spec not found if (nrow(bold_df) == 0) { mssg(verbose, "Not found. Consider checking the spelling or alternate classification") boldid <- NA_character_ att <- 'not found' } # take the one tsn from data.frame if (nrow(bold_df) == 1) { boldid <- bold_df$taxid att <- 'found' } # check for direct match if (nrow(bold_df) > 1) { names(bold_df)[grep('taxon', names(bold_df))] <- "target" di_rect <- match(tolower(bold_df$target), tolower(x)) if (length(di_rect) == 1) { if (!all(is.na(di_rect))) { boldid <- bold_df$taxid[!is.na(di_rect)] direct <- TRUE att <- 'found' } else { boldid <- NA_character_ att <- 'not found' } } else { direct <- FALSE boldid <- NA_character_ att <- 'found' } } # multiple matches if (any( nrow(bold_df) > 1 && is.na(boldid) | nrow(bold_df) > 1 && att == "found" && length(boldid) > 1 )) { names(bold_df)[grep('^taxon$', names(bold_df))] <- "target" if (!is.null(division) || !is.null(parent) || !is.null(rank)) { bold_df <- filt(bold_df, "division", division) bold_df <- filt(bold_df, "parent", parent) bold_df <- filt(bold_df, "rank", rank) } bold_df <- sub_rows(bold_df, rows) boldid <- id <- bold_df$taxid if (length(id) == 1) { direct <- TRUE att <- "found" } if (ask) { # user prompt bold_df <- bold_df[order(bold_df$target), ] rownames(bold_df) <- 1:nrow(bold_df) if (length(boldid) > 1 || NROW(bold_df) > 1) { # prompt message("\n\n") print(bold_df) message("\nMore than one TSN found for taxon '", x, "'!\n Enter rownumber of taxon (other inputs will return 'NA'):\n") # prompt take <- scan(n = 1, quiet = TRUE, what = 'raw') if (length(take) == 0) take <- 'notake' if (take %in% seq_len(nrow(bold_df))) { take <- as.numeric(take) message("Input accepted, took taxon '", as.character(bold_df$target[take]), "'.\n") boldid <- bold_df$taxid[take] att <- 'found' } else { boldid <- NA_character_ mssg(verbose, "\nReturned 'NA'!\n\n") att <- 'not found' } } } else { if (length(boldid) == 1) { att <- "found" } else { warning( sprintf("More than one boldid found for taxon '%s'; refine query or set ask=TRUE", x), call. = FALSE ) boldid <- NA_character_ att <- 'NA due to ask=FALSE & > 1 result' } } } } } data.frame( boldid = as.character(boldid), att = att, multiple = mm, direct = direct, stringsAsFactors = FALSE) } searchterm <- as.character(searchterm) outd <- ldply(searchterm, fun, ask, verbose, rows) out <- structure(outd$boldid, class = "boldid", match = outd$att, multiple_matches = outd$multiple, pattern_match = outd$direct) add_uri(out, 'http://boldsystems.org/index.php/Taxbrowser_Taxonpage?taxid=%s') } #' @export #' @rdname get_boldid as.boldid <- function(x, check=TRUE) UseMethod("as.boldid") #' @export #' @rdname get_boldid as.boldid.boldid <- function(x, check=TRUE) x #' @export #' @rdname get_boldid as.boldid.character <- function(x, check=TRUE) if(length(x) == 1) make_boldid(x, check) else collapse(x, make_boldid, "boldid", check=check) #' @export #' @rdname get_boldid as.boldid.list <- function(x, check=TRUE) if(length(x) == 1) make_boldid(x, check) else collapse(x, make_boldid, "boldid", check=check) #' @export #' @rdname get_boldid as.boldid.numeric <- function(x, check=TRUE) as.boldid(as.character(x), check) #' @export #' @rdname get_boldid as.boldid.data.frame <- function(x, check=TRUE) { structure(x$ids, class="boldid", match=x$match, multiple_matches = x$multiple_matches, pattern_match = x$pattern_match, uri=x$uri) } #' @export #' @rdname get_boldid as.data.frame.boldid <- function(x, ...){ data.frame(ids = as.character(unclass(x)), class = "boldid", match = attr(x, "match"), multiple_matches = attr(x, "multiple_matches"), pattern_match = attr(x, "pattern_match"), uri = attr(x, "uri"), stringsAsFactors = FALSE) } make_boldid <- function(x, check=TRUE) make_generic(x, 'http://boldsystems.org/index.php/Taxbrowser_Taxonpage?taxid=%s', "boldid", check) check_boldid <- function(x){ tryid <- bold_tax_id(x) !identical("noresults", names(tryid)[2]) } #' @export #' @rdname get_boldid get_boldid_ <- function(searchterm, verbose = TRUE, fuzzy = FALSE, dataTypes='basic', includeTree=FALSE, rows = NA, ...){ setNames(lapply(searchterm, get_boldid_help, verbose = verbose, fuzzy = fuzzy, dataTypes=dataTypes, includeTree=includeTree, rows = rows, ...), searchterm) } get_boldid_help <- function(searchterm, verbose, fuzzy, dataTypes, includeTree, rows, ...){ mssg(verbose, "\nRetrieving data for taxon '", searchterm, "'\n") df <- bold_search(name = searchterm, fuzzy = fuzzy, dataTypes = dataTypes, includeTree = includeTree) if(NROW(df) == 0) NULL else sub_rows(df, rows) } taxize/R/rename.R0000644000176200001440000000206212672106003013346 0ustar liggesusersrename <- function (x, replace, warn_missing = TRUE) { names(x) <- revalue(names(x), replace, warn_missing = warn_missing) x } revalue <- function (x, replace = NULL, warn_missing = TRUE) { if (!is.null(x) && !is.factor(x) && !is.character(x)) { stop("x is not a factor or a character vector.") } mapvalues(x, from = names(replace), to = replace, warn_missing = warn_missing) } mapvalues <- function (x, from, to, warn_missing = TRUE) { if (length(from) != length(to)) { stop("`from` and `to` vectors are not the same length.") } if (!is.atomic(x)) { stop("`x` must be an atomic vector.") } if (is.factor(x)) { levels(x) <- mapvalues(levels(x), from, to, warn_missing) return(x) } mapidx <- match(x, from) mapidxNA <- is.na(mapidx) from_found <- sort(unique(mapidx)) if (warn_missing && length(from_found) != length(from)) { message("The following `from` values were not present in `x`: ", paste(from[!(1:length(from) %in% from_found)], collapse = ", ")) } x[!mapidxNA] <- to[mapidx[!mapidxNA]] x } taxize/R/ncbi_downstream.R0000644000176200001440000000646013125222400015255 0ustar liggesusers#' Retrieve all taxa names downstream in hierarchy for NCBI #' #' @export #' @param id (numeric/integer) An NCBI taxonomic identifier #' @param downto The taxonomic level you want to go down to. See examples below. #' The taxonomic level IS case sensitive, and you do have to spell it #' correctly. See \code{data(rank_ref)} for spelling. #' @param intermediate (logical) If \code{TRUE}, return a list of length two #' with target taxon rank names, with additional list of data.frame's of #' intermediate taxonomic groups. Default: \code{FALSE} #' @param ... Further args passed on to \code{\link{ncbi_children}} #' @return Data.frame of taxonomic information downstream to family from e.g., #' Order, Class, etc., or if \code{intermediate=TRUE}, list of length two, #' with target taxon rank names, and intermediate names. #' @author Scott Chamberlain \email{myrmecocystus@@gmail.com} #' @section No Rank: #' A sticky point with NCBI is that they can have designation for taxonomic #' rank of "No Rank". So we have no way of programatically knowing what to #' do with that taxon. Of course one can manually look at a name and perhaps #' know what it is, or look it up on the web - but we can't do anything #' programatically. So, no rank things will sometimes be missing. #' @examples \dontrun{ #' ## genus Apis #' ncbi_downstream(id = 7459, downto="species") #' #' ## get intermediate taxa as a separate object #' ncbi_downstream(id = 7459, downto="species", intermediate = TRUE) #' #' ## Lepidoptera #' ncbi_downstream(id = 7088, downto="superfamily") #' #' ## families in the ferns (Moniliformopses) #' (id <- get_uid("Moniliformopses")) #' ncbi_downstream(id = id, downto = "order") #' } ncbi_downstream <- function(id, downto, intermediate = FALSE, ...) { should_be('intermediate', intermediate, 'logical') downto <- tolower(downto) poss_ranks <- unique(do.call(c, sapply(rank_ref$ranks, strsplit, split = ",", USE.NAMES = FALSE))) downto <- match.arg(downto, choices = poss_ranks) torank <- sapply(rank_ref[which_rank(downto), "ranks"], function(x) strsplit(x, ",")[[1]][[1]], USE.NAMES = FALSE) stop_ <- "not" notout <- data.frame(rank = "", stringsAsFactors = FALSE) out <- list() if (intermediate) intermed <- list() iter <- 0 while (stop_ == "not") { iter <- iter + 1 tt <- dt2df(lapply(id, function(x) ncbi_children(id = x)[[1]])) tt$.id <- NULL tt <- rename(tt, c('childtaxa_rank' = 'rank')) tt <- prune_too_low(tt, downto, ignore_no_rank = TRUE) if (NROW(tt) == 0) { out[[iter]] <- data.frame(stringsAsFactors = FALSE) stop_ <- "nodata" } else { if (intermediate) intermed[[iter]] <- tt if (NROW(tt[tt$rank == downto, ]) > 0) { out[[iter]] <- tt[tt$rank == downto, ] } if (NROW(tt[!tt$rank == downto, ]) > 0) { notout <- tt[!tt$rank %in% torank, ] } else { notout <- data.frame(rank = downto, stringsAsFactors = FALSE) } if (all(notout$rank == downto)) { stop_ <- "fam" } else { id <- notout$childtaxa_id stop_ <- "not" } } if (intermediate) intermed[[iter]] <- intermed[[iter]] } # end while loop tmp <- ldply(out) if (intermediate) { list(target = tmp, intermediate = intermed) } else { tmp } } taxize/R/get_iucn.R0000644000176200001440000001203013161014760013672 0ustar liggesusers#' Get a IUCN Redlist taxon #' #' @export #' @param x (character) A vector of common or scientific names #' @param verbose logical; should progress be printed? #' @param key (character) required. you IUCN Redlist API key. See #' \code{\link[rredlist]{rredlist-package}} for help on authenticating with #' IUCN Redlist #' @param check (logical) Check if ID matches any existing on the DB, only #' used in \code{\link{as.iucn}} #' @param ... Ignored #' #' @return A vector of taxonomic identifiers as an S3 class. #' #' Comes with the following attributes: #' \itemize{ #' \item \emph{match} (character) - the reason for NA, either 'not found', #' 'found' or if \code{ask = FALSE} then 'NA due to ask=FALSE') #' \item \emph{name} (character) - the taxonomic name, which is needed in #' \code{\link{synonyms}} and \code{\link{sci2comm}} methods since they #' internally use \pkg{rredlist} functions which require the taxonomic name, #' and not the taxonomic identifier #' \item \emph{uri} (character) - The URI where more information can be #' read on the taxon - includes the taxonomic identifier in the URL somewhere #' } #' #' \emph{multiple_matches} and \emph{pattern_match} do not apply here as in #' other \code{get_*} methods since there is no IUCN Redlist search, #' so you either get a match or you do not get a match. #' #' @details There is no underscore method, because there's no real #' search for IUCN, that is, where you search for a string, and get back #' a bunch of results due to fuzzy matching. If that exists in the future #' we'll add an underscore method here. #' #' IUCN ids only work with \code{\link{synonyms}} and \code{\link{sci2comm}} #' methods. #' #' @family taxonomic-ids #' #' @examples \dontrun{ #' get_iucn(x = "Branta canadensis") #' get_iucn(x = "Branta bernicla") #' get_iucn(x = "Panthera uncia") #' #' # as coercion #' as.iucn(22732) #' as.iucn("22732") #' (res <- as.iucn(c(22679946, 22732, 22679935))) #' data.frame(res) #' as.iucn(data.frame(res)) #' } get_iucn <- function(x, verbose = TRUE, key = NULL, ...) { assert(x, "character") assert(verbose, "logical") fun <- function(x, verbose, key, ...) { direct <- FALSE mssg(verbose, "\nRetrieving data for taxon '", x, "'\n") df <- rredlist::rl_search(x, key = key, ...) if (!inherits(df$result, "data.frame") || NROW(df$result) == 0) { id <- NA_character_ att <- "not found" } else { df <- df$result[, c("taxonid", "scientific_name", "kingdom", "phylum", "order", "family", "genus", "authority")] # should return NA if species not found if (NROW(df) == 0) { mssg(verbose, tx_msg_not_found) id <- NA_character_ att <- 'not found' } # check for direct match direct <- match(tolower(df$scientific_name), tolower(x)) if (!all(is.na(direct))) { id <- df$taxonid[!is.na(direct)] direct <- TRUE att <- 'found' } else { direct <- FALSE id <- df$taxonid att <- 'found' } # multiple matches not possible because no real search } data.frame( id = id, name = x, att = att, stringsAsFactors = FALSE) } outd <- ldply(x, fun, verbose = verbose, key = key, ...) out <- outd$id attr(out, 'match') <- outd$att attr(out, 'name') <- outd$name if ( !all(is.na(out)) ) { attr(out, 'uri') <- sprintf("http://www.iucnredlist.org/details/%s/0", out) } class(out) <- "iucn" return(out) } #' @export #' @rdname get_iucn as.iucn <- function(x, check = TRUE, key = NULL) { UseMethod("as.iucn") } #' @export #' @rdname get_iucn as.iucn.iucn <- function(x, check = TRUE, key = NULL) x #' @export #' @rdname get_iucn as.iucn.character <- function(x, check = TRUE, key = NULL) { if (length(x) == 1) { make_iucn(x, check, key = key) } else { collapse(x, make_iucn, "iucn", check = check, key = key) } } #' @export #' @rdname get_iucn as.iucn.list <- function(x, check = TRUE, key = NULL) { if (length(x) == 1) { make_iucn(x, check) } else { collapse(x, make_iucn, "iucn", check = check) } } #' @export #' @rdname get_iucn as.iucn.numeric <- function(x, check=TRUE, key = NULL) { as.iucn(as.character(x), check, key = key) } #' @export #' @rdname get_iucn as.iucn.data.frame <- function(x, check=TRUE, key = NULL) { structure(x$ids, class = "iucn", match = x$match, name = x$name, uri = x$uri) } #' @export #' @rdname get_iucn as.data.frame.iucn <- function(x, ...){ data.frame(ids = unclass(x), class = "iucn", name = attr(x, "name"), match = attr(x, "match"), uri = attr(x, "uri"), stringsAsFactors = FALSE) } make_iucn <- function(x, check = TRUE, key = NULL) { url <- 'http://www.iucnredlist.org/details/%s/0' make_iucn_generic(x, uu = url, clz = "iucn", check, key) } check_iucn <- function(x) { tt <- httr::GET(sprintf("http://www.iucnredlist.org/details/%s/0", x)) tt$status_code == 200 } check_iucn_getname <- function(x, key = NULL) { rredlist::rl_search(id = as.numeric(x), key = key) } taxize/R/gni_details.R0000644000176200001440000000376512672106003014374 0ustar liggesusers#' @title Search for taxonomic name details using the Global Names Index. #' #' @description Uses the Global Names Index, see \url{http://gni.globalnames.org/}. #' #' @export #' @param id Name id. Required. #' @param all_records If all_records is 1, GNI returns all records from all #' repositories for the name string (takes 0, or 1 [default]). #' @param ... Curl options passed on to \code{\link[httr]{GET}} #' @author Scott Chamberlain {myrmecocystus@@gmail.com} #' @return Data.frame of results. #' @seealso \code{\link{gnr_datasources}}, \code{\link{gni_search}}. #' @keywords globalnamesindex names taxonomy #' @examples \dontrun{ #' gni_details(id = 17802847) #' library("plyr") #' ldply(list(1265133, 17802847), gni_details) #' #' # pass on curl options to httr #' library("httr") #' gni_details(id = 17802847, config = verbose()) #' } gni_details <- function(id, all_records = 1, ...) { calls <- names(sapply(match.call(), deparse))[-1] calls_vec <- "url" %in% calls if (any(calls_vec)) stop("The parameter url has been removed", call. = FALSE) url2 <- paste0(gni_base(), "name_strings/", id, ".json") query <- tc(list(all_records = all_records)) tt <- GET(url2, query = argsnull(query), ...) stop_for_status(tt) out <- jsonlite::fromJSON(con_utf8(tt), FALSE) outdf <- ldply(out$data, function(x) data.frame(t(c(checknull(x$records[[1]]$created_at), checknull(x$records[[1]]$updated_at), checknull(x$records[[1]]$global_id), checknull(x$records[[1]]$url), checknull(x$records[[1]]$kingdom_id), checknull(x$records[[1]]$original_name_string), checknull(x$records[[1]]$id), checknull(x$records[[1]]$name_rank_id), checknull(x$records[[1]]$name_index_id), checknull(x$records[[1]]$record_hash), checknull(x$records[[1]]$local_id), checknull(x$records[[1]]$nomenclatural_code_id) )))) setNames(outdf, c( "created_at","updated_at","global_id","url","kingdom_id","original_name_string", "id","name_rank_id","name_index_id","record_hash","local_id","nomenclatural_code_id" )) } taxize/R/get_wiki.R0000644000176200001440000002231513160774521013715 0ustar liggesusers#' Get the page name for a Wiki taxon #' #' @export #' @param x (character) A vector of common or scientific names. #' @param wiki_site (character) Wiki site. One of species (default), pedia, #' commons #' @param wiki (character) language. Default: en #' @param ask logical; should get_wiki be run in interactive mode? #' If \code{TRUE} and more than one wiki is found for the species, the user is #' asked for input. If \code{FALSE} NA is returned for multiple matches. #' @param verbose logical; should progress be printed? #' @param rows numeric; Any number from 1 to infinity. If the default NA, all #' rows are considered. Note that this function still only gives back a wiki #' class object with one to many identifiers. See #' \code{\link[taxize]{get_wiki_}} to get back all, or a subset, of the #' raw data that you are presented during the ask process. #' @param limit (integer) number of records to return #' @param ... Ignored #' @param check logical; Check if ID matches any existing on the DB, only #' used in \code{\link{as.wiki}} #' @template getreturn #' #' @details For \code{type = pedia}, we use the english language site by #' default. Set the \code{language} parameter for a different language site. #' #' @family taxonomic-ids #' @seealso \code{\link[taxize]{classification}} #' #' @examples \dontrun{ #' get_wiki(x = "Quercus douglasii") #' get_wiki(x = "Quercu") #' get_wiki(x = "Quercu", "pedia") #' get_wiki(x = "Quercu", "commons") #' #' # diff. wikis with wikipedia #' get_wiki("Malus domestica", "pedia") #' get_wiki("Malus domestica", "pedia", "fr") #' #' # as coercion #' as.wiki("Malus_domestica") #' as.wiki("Malus_domestica", wiki_site = "commons") #' as.wiki("Malus_domestica", wiki_site = "pedia") #' as.wiki("Malus_domestica", wiki_site = "pedia", wiki = "fr") #' as.wiki("Malus_domestica", wiki_site = "pedia", wiki = "da") #' } get_wiki <- function(x, wiki_site = "species", wiki = "en", ask = TRUE, verbose = TRUE, limit = 100, rows = NA, ...) { assert(ask, "logical") assert(x, "character") assert(wiki_site, "character") assert(wiki, "character") assert(verbose, "logical") fun <- function(x, wiki_site, wiki, ask, verbose, limit, rows, ...) { direct <- FALSE mssg(verbose, "\nRetrieving data for taxon '", x, "'\n") df <- switch( wiki_site, species = wikitaxa::wt_wikispecies_search(query = x, limit = limit, ...), pedia = wikitaxa::wt_wikipedia_search(query = x, wiki = wiki, limit = limit, ...), commons = wikitaxa::wt_wikicommons_search(query = x, limit = limit, ...) )$query$search mm <- NROW(df) > 1 if (!inherits(df, "tbl_df") || NROW(df) == 0) { id <- NA_character_ att <- "not found" } else { df <- df[, c("title", "size", "wordcount")] df <- sub_rows(df, rows) # should return NA if spec not found if (NROW(df) == 0) { mssg(verbose, tx_msg_not_found) id <- NA_character_ att <- 'not found' } df$title <- gsub("\\s", "_", df$title) # take the one wiki from data.frame if (NROW(df) == 1) { id <- df$title att <- 'found' } # check for direct match if (NROW(df) > 1) { df <- data.frame(df, stringsAsFactors = FALSE) direct <- match(tolower(df$title), gsub("\\s", "_", tolower(x))) if (length(direct) == 1) { if (!all(is.na(direct))) { id <- df$title[!is.na(direct)] direct <- TRUE att <- 'found' } else { direct <- FALSE id <- NA_character_ att <- 'not found' } } else { direct <- FALSE id <- NA_character_ att <- 'NA due to ask=FALSE & no direct match found' warning("> 1 result; no direct match found", call. = FALSE) } } # multiple matches if (any( NROW(df) > 1 && is.na(id) | NROW(df) > 1 && att == "found" && length(id) > 1 )) { if (ask) { # user prompt df <- df[order(df$title), ] rownames(df) <- NULL # prompt message("\n\n") print(df) message("\nMore than one wiki ID found for taxon '", x, "'!\n Enter rownumber of taxon (other inputs will return 'NA'):\n") take <- scan(n = 1, quiet = TRUE, what = 'raw') if (length(take) == 0) { take <- 'notake' att <- 'nothing chosen' } if (take %in% seq_len(nrow(df))) { take <- as.numeric(take) message("Input accepted, took taxon '", as.character(df$title[take]), "'.\n") id <- df$title[take] att <- 'found' } else { id <- NA_character_ mssg(verbose, "\nReturned 'NA'!\n\n") att <- 'not found' } } else { if (length(id) != 1) { warning( sprintf("More than one wiki ID found for taxon '%s'; refine query or set ask=TRUE", x), call. = FALSE ) id <- NA_character_ att <- 'NA due to ask=FALSE & > 1 result' } } } } data.frame( id = id, att = att, multiple = mm, direct = direct, stringsAsFactors = FALSE) } outd <- ldply(x, fun, wiki_site, wiki, ask, verbose, limit, rows, ...) out <- outd$id attr(out, 'match') <- outd$att attr(out, 'multiple_matches') <- outd$multiple attr(out, 'pattern_match') <- outd$direct attr(out, 'wiki_site') <- wiki_site attr(out, 'wiki_lang') <- wiki if ( !all(is.na(out)) ) { zz <- gsub("\\s", "_", na.omit(out)) base_url <- switch( wiki_site, species = 'https://species.wikimedia.org/wiki/', pedia = sprintf('https://%s.wikipedia.org/wiki/', wiki), commons = 'https://commons.wikimedia.org/wiki/' ) attr(out, 'uri') <- paste0(base_url, zz) } class(out) <- "wiki" return(out) } #' @export #' @rdname get_wiki as.wiki <- function(x, check=TRUE, wiki_site = "species", wiki = "en") { UseMethod("as.wiki") } #' @export #' @rdname get_wiki as.wiki.wiki <- function(x, check=TRUE, wiki_site = "species", wiki = "en") x #' @export #' @rdname get_wiki as.wiki.character <- function(x, check=TRUE, wiki_site = "species", wiki = "en") { if (length(x) == 1) { make_wiki(x, check, wiki_site, wiki) } else { collapse(x, make_wiki, "wiki", check = check) } } #' @export #' @rdname get_wiki as.wiki.list <- function(x, check=TRUE, wiki_site = "species", wiki = "en") { if (length(x) == 1) { make_wiki(x, check) } else { collapse(x, make_wiki, "wiki", check = check) } } #' @export #' @rdname get_wiki as.wiki.numeric <- function(x, check=TRUE, wiki_site = "species", wiki = "en") { as.wiki(as.character(x), check) } #' @export #' @rdname get_wiki as.wiki.data.frame <- function(x, check=TRUE, wiki_site = "species", wiki = "en") { structure(x$ids, class = "wiki", match = x$match, multiple_matches = x$multiple_matches, pattern_match = x$pattern_match, wiki_site = x$wiki_site, wiki_lang = x$wiki_lang, uri = x$uri) } #' @export #' @rdname get_wiki as.data.frame.wiki <- function(x, ...){ data.frame(ids = unclass(x), class = "wiki", match = attr(x, "match"), multiple_matches = attr(x, "multiple_matches"), pattern_match = attr(x, "pattern_match"), wiki_site = attr(x, 'wiki_site'), wiki_lang = attr(x, 'wiki_lang'), uri = attr(x, "uri"), stringsAsFactors = FALSE) } make_wiki <- function(x, check = TRUE, wiki_site, wiki) { url <- switch( wiki_site, species = 'https://species.wikimedia.org/wiki/%s', pedia = paste0(sprintf('https://%s.wikipedia.org/wiki', wiki), "/%s"), commons = 'https://commons.wikimedia.org/wiki/%s' ) make_wiki_generic(x, url, "wiki", check) } check_wiki <- function(x) { tt <- wikitaxa::wt_wiki_page(x) identical(tt$status_code, 200) } #' @export #' @rdname get_wiki get_wiki_ <- function(x, verbose = TRUE, wiki_site = "species", wiki = "en", limit = 100, rows = NA, ...) { stats::setNames( lapply(x, get_wiki_help, verbose = verbose, wiki_site = wiki_site, wiki = wiki, limit = limit, rows = rows, ...), x ) } get_wiki_help <- function(x, verbose, wiki_site = "species", wiki = "en", limit = 100, rows, ...) { mssg(verbose, "\nRetrieving data for taxon '", x, "'\n") assert(x, "character") assert(wiki_site, "character") assert(wiki, "character") df <- switch( wiki_site, species = wikitaxa::wt_wikispecies_search(query = x, limit = limit, ...), pedia = wikitaxa::wt_wikipedia_search(query = x, wiki = wiki, limit = limit, ...), commons = wikitaxa::wt_wikicommons_search(query = x, limit = limit, ...) )$query$search if (!inherits(df, "tbl_df") || NROW(df) == 0) { NULL } else { df <- df[, c("title", "size", "wordcount")] sub_rows(df, rows) } } taxize/R/ubio_id.R0000644000176200001440000000035412672106003013513 0ustar liggesusers#' Search uBio by namebank ID. #' #' THIS FUNCTION IS DEFUNCT. #' #' @rdname ubio_id-defunct #' @export #' @param ... Parameters, ignored ubio_id <- function(...) { .Defunct(msg = "the uBio API is down, for good as far as we know") } taxize/R/tp_classification.R0000644000176200001440000000041512672106003015575 0ustar liggesusers#' Return all synonyms for a taxon name with a given id. #' #' THIS FUNCTION IS DEFUNCT. #' #' @export #' @rdname tp_classification-defunct #' @keywords internal tp_classification <- function(...) { .Defunct(msg = "This function is defunct. See classification().") } taxize/R/itis_name.R0000644000176200001440000000124112672032225014051 0ustar liggesusers#' Get taxonomic names for a given taxonomic name query. #' #' @param query TSN number (taxonomic serial number). #' @param get The rank of the taxonomic name to get. #' @return Taxonomic name for the searched taxon. #' @examples \dontrun{ #' itis_name(query="Helianthus annuus", get="family") #' } #' @export #' @rdname itis_name-deprecated itis_name <- function(query = NULL, get = NULL) { # tsn <- get_tsn(query, searchtype="sciname") # tt <- getfullhierarchyfromtsn(tsn) # as.character(tt[tt$rankName == capwords(get, onlyfirst=T), "taxonName"]) .Deprecated("tax_name", "taxize", msg="This function is deprecated. This function has changed name to tax_name.") } taxize/R/gni_search.R0000644000176200001440000000661312672106003014207 0ustar liggesusers#' @title Search for taxonomic names using the Global Names Index. #' #' @description Uses the Global Names Index, see \url{http://gni.globalnames.org/}. #' #' @export #' @param search_term Name pattern you want to search for. WARNING: Does not work for #' vernacular/common names. Search term may #' include following options (Note: can, uni, gen, sp, ssp, au, yr work only #' for parsed names): #' \itemize{ #' \item * wild card - Search by part of a word (E.g.: planta*) #' \item exact exact match - Search for exact match of a literal string (E.g.: exact:Parus major) #' \item ns name string- Search for literal string from its beginning (other modifiers will be ignored) (E.g.: ns:parus maj*) #' \item can canonical form- Search name without authors (other modifiers will be ignored) (E.g.: can:parus major) #' \item uni uninomial- Search for higher taxa (E.g.: uni:parus) #' \item gen genus - Search by genus epithet of species name (E.g.: gen:parus) #' \item sp species - Search by species epithet (E.g.: sp:major) #' \item ssp subspecies - Search by infraspecies epithet (E.g.: ssp:major) #' \item au author - Search by author word (E.g.: au:Shipunov) #' \item yr year - Search by year (E.g.: yr:2005) #' } #' @param per_page Number of items per one page (numbers larger #' than 1000 will be decreased to 1000) (default is 30). #' @param page Page number you want to see (default is 1). #' @param justtotal Return only the total results found. #' @param parse_names If \code{TRUE}, use \code{\link{gni_parse}} to parse names. #' Default: \code{FALSE} #' @param ... Curl options passed on to \code{\link[httr]{GET}} #' @author Scott Chamberlain {myrmecocystus@@gmail.com} #' @return data.frame of results. #' @seealso \code{\link{gnr_datasources}}, \code{\link{gni_search}}. #' @keywords globalnamesindex names taxonomy #' @references \url{http://gni.globalnames.org/}, \url{https://github.com/dimus/gni/wiki/api} #' @details Note that you can use fuzzy searching, e.g., by attaching an asterisk to the #' end of a search term. See the first two examples below. #' @examples \dontrun{ #' gni_search(search_term = "ani*") #' gni_search(search_term = "ama*", per_page = 3, page = 21) #' gni_search(search_term = "animalia", per_page = 8, page = 1) #' gni_search(search_term = "animalia", per_page = 8, page = 1, justtotal=TRUE) #' #' gni_search(search_term = "Cyanistes caeruleus", parse_names=TRUE) #' #' # pass on curl options to httr #' library("httr") #' gni_search(search_term = "ani*", config = verbose()) #' } gni_search <- function(search_term = NULL, per_page = NULL, page = NULL, justtotal = FALSE, parse_names = FALSE, ...) { query <- tc(list(search_term = search_term, per_page = per_page, page = page)) tt <- GET(paste0(gni_base(), "name_strings.json"), query = argsnull(query), ...) stop_for_status(tt) out <- jsonlite::fromJSON(con_utf8(tt), FALSE) if (justtotal) { out$name_strings_total } else { df <- ldply(out$name_strings, function(x) t(data.frame(c( checknull(x[["name"]]), checknull(x[["id"]]), checknull(x[["lsid"]]), checknull(x[["uuid_hex"]]), checknull(x[["resource_url"]]) )))) df <- colClasses(df, "character") if (NROW(df) != 0) { names(df) <- c("name","id","lsid","uuid_hex","resource_url") } if (parse_names) { data.frame(df, gni_parse(as.character(df$name)), stringsAsFactors = FALSE) } else { df } } } taxize/R/tax_agg.R0000644000176200001440000001065613060060133013514 0ustar liggesusers#' Aggregate species data to given taxonomic rank #' #' @export #' @param x Community data matrix. Taxa in columns, samples in rows. #' @param rank character; Taxonomic rank to aggregate by. #' @param db character; taxonomic API to use, 'ncbi, 'itis' or both, see #' \code{\link[taxize]{tax_name}}. Note that each taxonomic data source has #' their own identifiers, so that if you provide the wrong \code{db} value #' for the identifier you could get a result, but it will likely be wrong (not #' what you were expecting). #' @param verbose (logical) If FALSE (Default) suppress messages #' @param ... Other arguments passed to \code{\link[taxize]{get_tsn}} or \code{\link[taxize]{get_uid}}. #' #' @details \code{tax_agg} aggregates (sum) taxa to a specific taxonomic level. #' If a taxon is not found in the database (ITIS or NCBI) or the supplied taxon #' is on higher taxonomic level this taxon is not aggregated. #' #' #' @return A list of class \code{tax_agg} with the following items: #' \item{x}{Community data matrix with aggregated data.} #' \item{by}{A lookup-table showing which taxa were aggregated.} #' \item{n_pre}{Number of taxa before aggregation.} #' \item{rank}{Rank at which taxa have been aggregated.} #' #' @seealso \code{\link[taxize]{tax_name}} #' @examples \dontrun{ #' if (requireNamespace("vegan", quietly = TRUE)) { #' # use dune dataset #' library("vegan") #' data(dune, package='vegan') #' species <- c("Bellis perennis", "Empetrum nigrum", "Juncus bufonius", #' "Juncus articulatus", #' "Aira praecox", "Eleocharis parvula", "Rumex acetosa", "Vicia lathyroides", #' "Brachythecium rutabulum", "Ranunculus flammula", "Cirsium arvense", #' "Hypochaeris radicata", "Leontodon autumnalis", "Potentilla palustris", #' "Poa pratensis", "Calliergonella cuspidata", "Trifolium pratense", #' "Trifolium repens", "Anthoxanthum odoratum", "Salix repens", "Achillea #' millefolium", #' "Poa trivialis", "Chenopodium album", "Elymus repens", "Sagina procumbens", #' "Plantago lanceolata", "Agrostis stolonifera", "Lolium perenne", "Alopecurus #' geniculatus", "Bromus hordeaceus") #' colnames(dune) <- species #' #' # aggregate sample to families #' (agg <- tax_agg(dune, rank = 'family', db = 'ncbi')) #' #' # extract aggregated community data matrix for further usage #' agg$x #' # check which taxa have been aggregated #' agg$by #' } #' #' # A use case where there are different taxonomic levels in the same dataset #' spnames <- c('Puma','Ursus americanus','Ursidae') #' df <- data.frame(c(1,2,3), c(11,12,13), c(1,4,50)) #' names(df) <- spnames #' out <- tax_agg(df, rank = 'family', db='itis') #' out$x #' #' # You can input a matrix too #' mat <- matrix(c(1,2,3, 11,12,13), nrow = 2, ncol = 3, #' dimnames=list(NULL, c('Puma concolor','Ursus americanus','Ailuropoda melanoleuca'))) #' tax_agg(mat, rank = 'family', db='itis') #' } tax_agg <- function(x, rank, db = 'ncbi', verbose=FALSE, ...) { if (is.matrix(x)) { if (is.null(colnames(x))) stop("The community data matrix must have named columns") x <- data.frame(x, check.names = FALSE) } # bring to long format x$rownames <- rownames(x) df_m <- melt(x, id = 'rownames') # aggregate to family level (by querying NCBI for taxonomic classification) uniq_tax <- as.character(unique(df_m$variable)) agg <- tax_name(uniq_tax, get = rank, db = db, verbose = verbose, ...) lookup <- data.frame(variable = uniq_tax, agg = agg[ , 3], stringsAsFactors = FALSE) # merge lookup with orig. df_merged <- merge(lookup, df_m, by = 'variable') # if not found , or on higher level -> use orig. = no aggrgation df_merged$agg <- ifelse(is.na(df_merged$agg), df_merged$variable, df_merged$agg) # bring back to long format and aggregate df_l <- dcast(df_merged, rownames ~ agg, value.var = 'value', fun.aggregate = sum) rownames(df_l) <- df_l$rownames df_l$rownames <- NULL # restore order df_l <- df_l[x$rownames, ] out <- list(x = df_l, by = lookup, n_pre = ncol(x) - 1, rank = rank) class(out) <- 'tax_agg' return(out) } #' @method print tax_agg #' @export #' @rdname tax_agg print.tax_agg <- function(x, ...) { cat("\n") writeLines(strwrap("Aggregated community data\n", prefix = "\t")) cat(paste("\nLevel of Aggregation:", toupper(x$rank))) cat(paste("\nNo. taxa before aggregation:", x$n_pre)) cat(paste("\nNo. taxa after aggregation:", ncol(x$x))) cat(paste("\nNo. taxa not found:", sum(is.na(x$by$agg)))) } taxize/R/tp_summary.R0000644000176200001440000000164512672106003014305 0ustar liggesusers#' Return summary data a taxon name with a given id. #' #' @export #' @param id the taxon identifier code #' @param key Your Tropicos API key; loads from .Rprofile. #' @param ... Curl options passed on to \code{\link[httr]{GET}} #' @return A data.frame. #' @examples \dontrun{ #' tp_summary(id = 25509881) #' tp_summary(id = 2700851) #' tp_summary(id = 24900183) #' } tp_summary <- function(id, key = NULL, ...) { url <- sprintf('http://services.tropicos.org/Name/%s', id) key <- getkey(key, "tropicosApiKey") args <- tc(list(apikey = key, format = 'json')) tmp <- GET(url, query = args, ...) stop_for_status(tmp) tmp2 <- con_utf8(tmp) res <- jsonlite::fromJSON(tmp2, FALSE) typespec <- data.frame(res$TypeSpecimens, stringsAsFactors = FALSE) df <- data.frame(res[!names(res) %in% "TypeSpecimens"], stringsAsFactors = FALSE) if (NROW(typespec) > 0) df <- cbind(df, typespec) setNames(df, tolower(names(df))) } taxize/R/get_utils.R0000644000176200001440000000226013124573471014110 0ustar liggesusersmake_generic <- function(x, uu, clz, check = TRUE) { if (check) { if ( evalfxn(clz)(x) ) { toid(x, uu, clz) } else { structure( NA, class = clz, match = "not found", multiple_matches = FALSE, pattern_match = FALSE, uri = NA ) } } else { toid(x, uu, clz) } } make_iucn_generic <- function(x, uu, clz, check = TRUE, key = NULL) { if (check) { res <- check_iucn_getname(x, key = key) if (length(res$result) != 0) { toid(res$result$taxonid, uu, clz, name = res$result$scientific_name) } else { structure( NA, class = clz, match = "not found", multiple_matches = NA, pattern_match = NA, uri = NA, name = NA ) } } else { toid(x, uu, clz) } } make_wiki_generic <- function(x, uu, clz, check = TRUE) { if (check) { if ( evalfxn(clz)(sprintf(uu, x)) ) { toid(x, uu, clz) } else { structure( NA, class = clz, match = "not found", multiple_matches = FALSE, pattern_match = FALSE, uri = NA ) } } else { toid(x, uu, clz) } } # messages tx_msg_not_found <- "Not found. Consider checking the spelling or alternate classification" taxize/R/col_downstream.R0000644000176200001440000001267513132777511015144 0ustar liggesusers#' Use Catalogue of Life to get downstream taxa to a given taxonomic level. #' #' @param name The string to search for. Only exact matches found the name given #' will be returned, unless one or wildcards are included in the search #' string. An * (asterisk) character denotes a wildcard; a % (percentage) #' character may also be used. The name must be at least 3 characters long, #' not counting wildcard characters. #' @param id The record ID of the specific record to return (only for scientific #' names of species or infraspecific taxa) #' @param downto The taxonomic level you want to go down to. See examples below. #' The taxonomic level IS case sensitive, and you do have to spell it #' correctly. See \code{data(rank_ref)} for spelling. #' @param format The returned format (default = NULL). If NULL xml is used. #' Currently only xml is supported. #' @param start The first record to return (default = NULL). If NULL, the #' results are returned from the first record (start=0). This is useful if #' the total number of results is larger than the maximum number of results #' returned by a single Web service query (currently the maximum number of #' results returned by a single query is 500 for terse queries and 50 for #' full queries). #' @param checklist The year of the checklist to query, if you want a specific #' year's checklist instead of the lastest as default (numeric). #' @param verbose Print or suppress messages. #' @param intermediate (logical) If TRUE, return a list of length two with target #' taxon rank names, with additional list of data.frame's of intermediate #' taxonomic groups. Default: FALSE #' @param ... Curl options passed on to \code{\link[httr]{GET}} #' @details Provide only names instead of id's #' @return A list of data.frame's. #' @export #' @examples \dontrun{ #' # Some basic examples #' col_downstream(name="Apis", downto="species") #' col_downstream(name="Bryophyta", downto="family") #' #' # get classes down from the kingdom Animalia #' col_downstream(name="Animalia", downto="class") #' col_downstream(name="Animalia", downto="class", intermediate=TRUE) #' #' # An example that takes a bit longer #' col_downstream(name=c("Plantae", "Animalia"), downto="class") #' #' # Using a checklist from a specific year #' col_downstream(name="Bryophyta", downto="family", checklist=2009) #' #' # By id #' col_downstream(id='576d098d770a39d09e2bcfa1c0896b26', downto="species", #' checklist=2012) #' } col_downstream <- function(name = NULL, id = NULL, downto, format = NULL, start = NULL, checklist = NULL, verbose = TRUE, intermediate = FALSE, ...) { downto <- tolower(downto) poss_ranks <- unique(do.call(c, sapply(rank_ref$ranks, strsplit, split = ",", USE.NAMES = FALSE))) downto <- match.arg(downto, choices = poss_ranks) func <- function(x=NULL, y=NULL, checklist, format, start, ...) { url <- make_url(checklist) torank <- sapply(rank_ref[which_rank(downto), "ranks"], function(x) strsplit(x, ",")[[1]][[1]], USE.NAMES = FALSE) toget <- ifelse(is.null(y), x, y) stop_ <- "not" notout <- data.frame(rankName = "") out <- list() if (intermediate) intermed <- list() iter <- 0 while (stop_ == "not") { iter <- iter + 1 if (is.null(x)) { tt <- ldply(toget, function(z) { search_col_safe(name = NULL, id = z, checklist = checklist, format = format, start = start, ...) }) } else { tt <- ldply(toget, function(z) { search_col_safe(name = z, id = NULL, checklist = checklist, format = format, start = start, ...) }) } # prune if too low tt <- prune_too_low_col(tt, downto) if (NROW(tt) == 0) { out[[iter]] <- data.frame(stringsAsFactors = FALSE) stop_ <- "nodata" } else { # remove if (NROW(tt[tt$childtaxa_rank == downto, ]) > 0) { out[[iter]] <- tt[tt$childtaxa_rank == downto, ] } if (NROW(tt[!tt$childtaxa_rank == downto, ]) > 0) { notout <- tt[!tt$childtaxa_rank %in% torank, ] } else { notout <- data.frame(rankName = downto) } if (all(notout$childtaxa_rank == downto)) { stop_ <- "fam" } else { if (intermediate) intermed[[iter]] <- notout x <- NULL toget <- as.character(notout$childtaxa_id) stop_ <- "not" } } } # end while loop if (length(out) == 0) { ret <- data.frame(childtaxa_id = NA, childtaxa_name = NA, childtaxa_rank = NA) } else { res <- tc(out) ret <- do.call(rbind.fill, res) } if (intermediate) list(target = ret, intermediate = intermed) else ret } # end fxn func safe_func <- plyr::failwith(NULL, func) if (is.null(id)) { temp <- setNames(lapply(name, safe_func, y = NULL, checklist = checklist, format = format, start = start, ...), name) } else { temp <- setNames(lapply(id, function(z) { safe_func(x = NULL, y = id, checklist = checklist, format = format, start = start, ...) }), id) } nas <- sapply(temp, function(z) NROW(na.omit( if (intermediate) z$target else z ))) if (verbose) message( sprintf('These taxa with no data: %s\nTry adjusting input parameters', names(nas[nas == 0]))) return( temp ) } taxize/R/eubon_hierarchy.R0000644000176200001440000000330713060060133015243 0ustar liggesusers#' EUBON hierarchy #' #' @export #' @param id (character) identifier for the taxon. (LSID, DOI, URI, or any #' other identifier used by the checklist provider) #' @param providers (character) A list of provider id strings concatenated by #' comma characters. The default : "pesi,bgbm-cdm-server[col]" will be used if #' this parameter is not set. A list of all available provider ids can be #' obtained from the '/capabilities' service end point. Providers can be #' nested, that is a parent provider can have sub providers. If the id of the #' parent provider is supplied all subproviders will be queried. The query #' can also be restricted to one or more subproviders by using the following #' syntax: parent-id[sub-id-1,sub-id2,...] #' @param timeout (numeric) The maximum of milliseconds to wait for responses #' from any of the providers. If the timeout is exceeded the service will just #' return the responses that have been received so far. The default timeout is #' 0 ms (wait for ever) #' @param ... Curl options passed on to \code{\link[httr]{GET}} #' @references \url{http://cybertaxonomy.eu/eu-bon/utis/1.2/doc.html} #' @family eubon-methods #' @examples \dontrun{ #' eubon_hierarchy(id = "urn:lsid:marinespecies.org:taxname:126141", 'worms') #' eubon_hierarchy(id = "urn:lsid:marinespecies.org:taxname:274350", 'worms') #' } eubon_hierarchy <- function(id, providers = 'pesi', timeout = 0, ...) { args <- tc(list(providers = paste0(providers, collapse = ","), timeout = timeout)) res <- httr::GET(file.path(eubon_base(), "classification", id, "parent"), query = args, ...) eubon_error(res) tmp <- jsonlite::fromJSON(con_utf8(res), TRUE, flatten = TRUE) tmp$query$response[[1]] } taxize/R/tp_search.R0000644000176200001440000000527112672106003014054 0ustar liggesusers#' Search Tropicos by scientific name, common name, or Tropicos ID. #' #' @export #' @param name Your search string. For instance "poa annua". See Details. #' @param commonname Your search string. For instance "annual blue grass" #' @param nameid Your search string. For instance "25509881" #' @param orderby Your search string. For instance "1" #' @param sortorder Your search string. For instance "ascending" #' @param pagesize Your search string. For instance "100" #' @param startrow Your search string. For instance "1" #' @param type Type of search, "wildcard" (default) will add a wildcard to the end #' of your search string. "exact" will use your search string exactly. #' @param key Your Tropicos API key; loads from .Rprofile. #' @param ... Further args passed on to \code{\link[httr]{GET}} #' @return List or dataframe. #' @references \url{http://services.tropicos.org/help?method=SearchNameXml} #' @details More details on the \code{name} parameter: Tropicos will fail #' if you include a period (\code{.}) in your name string, e.g., \code{var.}, #' so we replace periods before the request is made to the Tropicos web service. #' In addition, Tropicos for some reason doesn't want to see sub-specific rank #' names like \code{var}/\code{subsp}, so remove those from your query. #' @examples \dontrun{ #' tp_search(name = 'Poa annua') #' tp_search(name = 'Poa annua subsp. annua') #' tp_search(name = 'Poa annua var. annua') #' tp_search(name = 'Poa annua var annua') #' tp_search(name = 'Poa annua annua') #' } tp_search <- function(name=NULL, commonname=NULL, nameid=NULL, orderby=NULL, sortorder=NULL, pagesize=NULL, startrow=NULL, type=NULL, key=NULL, ...) { url = 'http://services.tropicos.org/Name/Search' key <- getkey(key, "tropicosApiKey") if (!is.null(name)) { if (grepl(paste(sprintf("\\s%s\\.?\\s", subsp_ranks), collapse = "|"), name)) { warning("Tropicos doesn't like sub-specific ranks - remove them in your query", call. = FALSE) } if (grepl("\\.", name)) { warning("'.' detected, being URL encoded prior to data request", call. = FALSE) } name <- gsub("\\.", "%2E", name) } args <- tc(list(format='json', name=name, nameid=nameid, commonname=commonname, orderby=orderby, sortorder=sortorder, pagesize=pagesize, startrow=startrow, type=type, apikey=key)) tt <- GET(url, query = args, ...) warn_for_status(tt) if (tt$status_code > 202) { NA } else { out <- jsonlite::fromJSON(con_utf8(tt), FALSE) tmp <- do.call(rbind.fill, lapply(out, data.frame, stringsAsFactors = FALSE)) setNames(tmp, tolower(names(tmp))) } } subsp_ranks <- c('sp', 'ssp', 'subsp', 'subspecies', 'var', 'varietas', 'fo', 'f', 'forma') taxize/R/vascan_search.r0000644000176200001440000000505112672106003014740 0ustar liggesusers#' Search the CANADENSYS Vascan API. #' #' @export #' @param q (character) Can be a scientific name, a vernacular name or a VASCAN #' taxon identifier (e.g. 861) #' @param format (character) One of json (default) or xml. #' @param raw (logical) If TRUE, raw json or xml returned, if FALSE, parsed data returned. #' @param ... (list) Further args passed on to \code{\link[httr]{GET}} #' @author Scott Chamberlain {myrmecocystus@@gmail.com} #' @return json, xml or a list. #' @references API docs http://data.canadensys.net/vascan/api #' @keywords names taxonomy #' @details Note that we lowercase all outputs in data.frame's, but when a list is #' given back, we don't touch the list names. #' @examples \dontrun{ #' vascan_search(q = "Helianthus annuus") #' vascan_search(q = "Helianthus annuus", raw=TRUE) #' vascan_search(q = c("Helianthus annuus", "Crataegus dodgei"), raw=TRUE) #' #' # format type #' ## json #' c <- vascan_search(q = "Helianthus annuus", format="json", raw=TRUE) #' library("jsonlite") #' fromJSON(c, FALSE) #' #' ## xml #' d <- vascan_search(q = "Helianthus annuus", format="xml", raw=TRUE) #' library("xml2") #' xml2::read_xml(d) #' #' # lots of names, in this case 50 #' splist <- names_list(rank='species', size=50) #' vascan_search(q = splist) #' #' # Curl options #' library("httr") #' vascan_search(q = "Helianthus annuus", config = verbose()) #' } vascan_search <- function(q, format='json', raw=FALSE, ...) { url <- sprintf("http://data.canadensys.net/vascan/api/0.1/search.%s", format) if (!length(q) > 1) { tt <- GET(url, query = list(q = q), ...) stop_for_status(tt) out <- con_utf8(tt) } else { args <- paste(q, collapse = '\n') tt <- POST(url, body = list(q = args), encode = 'form', ...) stop_for_status(tt) out <- con_utf8(tt) } if (raw) { return( out ) } else { tmp <- jsonlite::fromJSON(out, FALSE) res <- tmp$results[[1]] lapply(tmp$results, vascan_parse) } } vascan_parse <- function(x){ parsed <- lapply(x$matches, function(y) { taxass <- nmslwr(data.frame(y$taxonomicAssertions, stringsAsFactors = FALSE)) dist <- nmslwr(data.frame(rbindlist(y$distribution))) vern <- nmslwr(data.frame(rbindlist(y$vernacularNames))) list(taxonomicassertions = taxass, distribution = dist, vernacularnames = vern) }) if (length(parsed) == 0) { nmslwr(data.frame(searchedterm = x$searchedTerm, nummatches = x$numMatches, matches = NA, stringsAsFactors = FALSE)) } else { list(searchedterm = x$searchedTerm, nummatches = x$numMatches, matches = parsed) } } taxize/R/gbif_downstream.R0000644000176200001440000000744313071521170015261 0ustar liggesusers#' Retrieve all taxa names downstream in hierarchy for GBIF #' #' @export #' @param key A taxonomic serial number. #' @param downto The taxonomic level you want to go down to. See examples below. #' The taxonomic level IS case sensitive, and you do have to spell it #' correctly. See \code{data(rank_ref)} for spelling. #' @param intermediate (logical) If TRUE, return a list of length two with #' target taxon rank names, with additional list of data.frame's of #' intermediate taxonomic groups. Default: FALSE #' @param ... Further args passed on to \code{\link{gbif_name_usage}} #' @return Data.frame of taxonomic information downstream to family from e.g., #' Order, Class, etc., or if \code{intermediated=TRUE}, list of length two, #' with target taxon rank names, and intermediate names. #' @author Scott Chamberlain \email{myrmecocystus@@gmail.com} #' @examples \dontrun{ #' ## the plant class Bangiophyceae #' gbif_downstream(key = 198, downto="genus") #' gbif_downstream(key = 198, downto="genus", intermediate=TRUE) #' #' # families downstream from the family Strepsiptera (twisted wing parasites) #' gbif_downstream(key = 1227, "family") #' ## here, intermediate leads to the same result as the target #' gbif_downstream(key = 1227, "family", intermediate=TRUE) #' #' # Lepidoptera #' gbif_downstream(key = 797, "family") #' #' # get species downstream from the genus Ursus #' gbif_downstream(key = 2433406, "species") #' #' # get tribes down from the family Apidae #' gbif_downstream(key = 7799978, downto="species") #' gbif_downstream(key = 7799978, downto="species", intermediate=TRUE) #' } gbif_downstream <- function(key, downto, intermediate = FALSE, ...) { should_be('intermediate', intermediate, 'logical') downto <- tolower(downto) poss_ranks <- unique(do.call(c, sapply(rank_ref$ranks, strsplit, split = ",", USE.NAMES = FALSE))) downto <- match.arg(downto, choices = poss_ranks) torank <- sapply(rank_ref[which_rank(downto), "ranks"], function(x) strsplit(x, ",")[[1]][[1]], USE.NAMES = FALSE) stop_ <- "not" notout <- data.frame(rank = "", stringsAsFactors = FALSE) out <- list() if (intermediate) intermed <- list() iter <- 0 while (stop_ == "not") { iter <- iter + 1 temp <- ldply(key, function(x) gbif_name_usage_clean(x)) tt <- ldply(temp$key, function(x) gbif_name_usage_children(x)) tt <- prune_too_low(tt, downto) if (NROW(tt) == 0) { out[[iter]] <- data.frame(stringsAsFactors = FALSE) stop_ <- "nodata" } else { if (intermediate) intermed[[iter]] <- tt if (NROW(tt[tt$rank == downto, ]) > 0) out[[iter]] <- tt[tt$rank == downto, ] if (NROW(tt[!tt$rank == downto, ]) > 0) { notout <- tt[!tt$rank %in% torank, ] } else { notout <- data.frame(rank = downto, stringsAsFactors = FALSE) } if (all(notout$rank == downto)) { stop_ <- "fam" } else { key <- notout$key stop_ <- "not" } } if (intermediate) intermed[[iter]] <- intermed[[iter]] } # end while loop tmp <- ldply(out) if (intermediate) { list(target = tmp, intermediate = intermed) } else { tmp } } gbif_name_usage_clean <- function(x, ...) { tt <- gbif_name_usage(x, ...) tt <- tt[sapply(tt, length) != 0] tt$rank <- tolower(tt$rank) tt <- setNames(tt, tolower(names(tt))) data.frame(tt, stringsAsFactors = FALSE)[, c('canonicalname', 'rank', 'key')] } gbif_name_usage_children <- function(x, ...) { tt <- gbif_name_usage(x, data = 'children', limit = 100, ...)$results rbind.fill(lapply(tt, function(z) { z <- z[sapply(z, length) != 0] df <- data.frame(z, stringsAsFactors = FALSE) df$rank <- tolower(df$rank) df <- setNames(df, tolower(names(df))) df[, c('canonicalname', 'rank', 'key')] })) } taxize/R/get_tolid.R0000644000176200001440000002144213160773651014070 0ustar liggesusers#' Get the OTT id for a search term #' #' Retrieve the Open Tree of Life Taxonomy (OTT) id of a taxon from #' OpenTreeOfLife #' #' @export #' @inheritParams tol_resolve #' @param sciname character; scientific name. #' @param ask logical; should \code{get_tolid} be run in interactive mode? #' If \code{TRUE} and more than one TOL is found for the species, the user is #' asked for input. If \code{FALSE} NA is returned for multiple matches. #' @param verbose logical; should progress be printed? #' @param rows numeric; Any number from 1 to infinity. If the default NA, all #' rows are considered. Note that this function still only gives back a tol #' class object with one to many identifiers. See \code{\link[taxize]{get_tolid_}} #' to get back all, or a subset, of the raw data that you are presented during #' the ask process. #' @param x Input to \code{as.tolid} #' @param ... Ignored #' @param check logical; Check if ID matches any existing on the DB, only #' used in #' \code{\link{as.tolid}} #' @template getreturn #' #' @family taxonomic-ids #' @seealso \code{\link[taxize]{classification}} #' #' @examples \dontrun{ #' get_tolid(sciname = "Quercus douglasii") #' get_tolid(sciname = "Chironomus riparius") #' get_tolid(c("Chironomus riparius","Quercus douglasii")) #' splist <- c("annona cherimola", 'annona muricata', "quercus robur", #' "shorea robusta", "pandanus patina", "oryza sativa", "durio zibethinus") #' get_tolid(splist, verbose=FALSE) #' #' # specify rows to limit choices available #' get_tolid('Arni') #' get_tolid('Arni', rows=1) #' get_tolid('Arni', rows=1:2) #' #' # When not found #' get_tolid("howdy") #' get_tolid(c("Chironomus riparius", "howdy")) #' #' # Convert a tol without class information to a tol class #' as.tolid(get_tolid("Quercus douglasii")) # already a tol, returns the same #' as.tolid(get_tolid(c("Chironomus riparius","Pinus contorta"))) # same #' as.tolid(3930798) # numeric #' as.tolid(c(3930798,515712,872577)) # numeric vector, length > 1 #' as.tolid("3930798") # character #' as.tolid(c("3930798","515712","872577")) # character vector, length > 1 #' as.tolid(list("3930798","515712","872577")) # list, either numeric or character #' ## dont check, much faster #' as.tolid("3930798", check=FALSE) #' as.tolid(3930798, check=FALSE) #' as.tolid(c("3930798","515712","872577"), check=FALSE) #' as.tolid(list("3930798","515712","872577"), check=FALSE) #' #' (out <- as.tolid(c(3930798,515712,872577))) #' data.frame(out) #' as.tolid( data.frame(out) ) #' #' # Get all data back #' get_tolid_(sciname="Arni") #' get_tolid_("Arni", rows=1) #' get_tolid_("Arni", rows=1:2) #' get_tolid_(c("asdfadfasd","Pinus contorta")) #' } get_tolid <- function(sciname, ask = TRUE, verbose = TRUE, rows = NA, ...) { assert(ask, "logical") assert(verbose, "logical") fun <- function(x, ask, verbose, rows, ...) { mssg(verbose, "\nRetrieving data for taxon '", x, "'\n") tol_df <- tryCatch(tol_resolve(x, ...), error = function(e) e) if (!inherits(tol_df, "data.frame") || NROW(tol_df) == 0 || inherits(tol_df, "error")) { id <- NA_character_ att <- "not found" } else { tol_df <- tol_fetch_fuzzy(tol_df) tol_df <- sub_rows(tol_df, rows) # should return NA if spec not found if (NROW(tol_df) == 0) { mssg(verbose, "Not found. Consider checking the spelling or alternate classification") id <- NA_character_ att <- 'not found' } # take the one tol from data.frame if (NROW(tol_df) == 1) { id <- tol_df$ott_id att <- 'found' } # more than one found -> user input if (NROW(tol_df) > 1) { # check for exact match matchtmp <- tol_df[tol_df$unique_name %in% x, "ott_id"] if (length(matchtmp) == 1) { id <- as.character(matchtmp) direct <- TRUE } else { tol_df <- sub_rows(tol_df, rows) if (NROW(tol_df) == 0) { id <- NA_character_ att <- "not found" } else { id <- tol_df$ott_id if (length(id) == 1) { rank_taken <- tol_df$rank att <- "found" } } if (length(id) > 1) { if (ask) { # prompt message("\n\n") message("\nMore than one ToL ID found for taxon '", x, "'!\n Enter rownumber of taxon (other inputs will return 'NA'):\n") rownames(tol_df) <- 1:nrow(tol_df) print(tol_df) take <- scan(n = 1, quiet = TRUE, what = 'raw') if (length(take) == 0) { take <- 'notake' att <- 'nothing chosen' } if (take %in% seq_len(nrow(tol_df))) { take <- as.numeric(take) message("Input accepted, took tol ID '", as.character(tol_df$ott_id[take]), "'.\n") id <- as.character(tol_df$ott_id[take]) att <- "found" } else { id <- NA_character_ att <- "not found" mssg(verbose, "\nReturned 'NA'!\n\n") } } else { if (length(id) != 1) { warning( sprintf("More than one ToL ID found for taxon '%s'; refine query or set ask=TRUE", x), call. = FALSE ) id <- NA_character_ att <- 'NA due to ask=FALSE & > 1 result' } } } } } } data.frame( tol = as.character(id), att = att, multiple = FALSE, direct = FALSE, stringsAsFactors = FALSE) } sciname <- as.character(sciname) outd <- ldply(sciname, fun, ask, verbose, rows, ...) out <- outd$tol attr(out, 'match') <- outd$att attr(out, 'multiple_matches') <- outd$multiple attr(out, 'pattern_match') <- outd$direct if ( !all(is.na(out)) ) { urlmake <- na.omit(out) attr(out, 'uri') <- paste0('https://tree.opentreeoflife.org/opentree/argus/ottol@', urlmake) } class(out) <- "tolid" return(out) } #' @export #' @rdname get_tolid as.tolid <- function(x, check=TRUE) UseMethod("as.tolid") #' @export #' @rdname get_tolid as.tolid.tolid <- function(x, check=TRUE) x #' @export #' @rdname get_tolid as.tolid.character <- function(x, check=TRUE) { if (length(x) == 1) make_tol(x, check) else collapse(x, make_tol, "tolid", check = check) } #' @export #' @rdname get_tolid as.tolid.list <- function(x, check=TRUE) { if (length(x) == 1) make_tol(x, check) else collapse(x, make_tol, "tolid", check = check) } #' @export #' @rdname get_tolid as.tolid.numeric <- function(x, check=TRUE) as.tolid(as.character(x), check) #' @export #' @rdname get_tolid as.tolid.data.frame <- function(x, check=TRUE) { structure(x$ids, class = "tolid", match = x$match, multiple_matches = x$multiple_matches, pattern_match = x$pattern_match, uri = x$uri) } #' @export #' @rdname get_tolid as.data.frame.tolid <- function(x, ...){ data.frame(ids = as.character(unclass(x)), class = "tolid", match = attr(x, "match"), multiple_matches = attr(x, "multiple_matches"), pattern_match = attr(x, "pattern_match"), uri = attr(x, "uri"), stringsAsFactors = FALSE) } make_tol <- function(x, check=TRUE) { make_generic(x, 'https://tree.opentreeoflife.org/opentree/argus/ottol@%s', "tolid", check) } check_tolid <- function(x){ tt <- tryCatch(rotl::taxonomy_taxon_info(x), error = function(e) e) !inherits(tt, "error") } #' @export #' @rdname get_tolid get_tolid_ <- function(sciname, verbose = TRUE, rows = NA){ stats::setNames( lapply(sciname, get_tolid_help, verbose = verbose, rows = rows), sciname ) } get_tolid_help <- function(sciname, verbose, rows, ...){ mssg(verbose, "\nRetrieving data for taxon '", sciname, "'\n") tol_df <- tryCatch(tol_resolve(sciname, ...), error = function(e) e) if (!inherits(tol_df, "data.frame") || NROW(tol_df) == 0 || inherits(tol_df, "error")) { NULL } else { df <- tol_fetch_fuzzy(tol_df) sub_rows(df, rows) } } tol_fetch_fuzzy <- function(x) { atts <- attr(x, "original_response") df <- dtrbsetdf(lapply(atts$results, function(z) { dtrbsetdf(lapply(z$matches, function(w) { c( pop(w, "taxon"), lapply(w$taxon, function(m) { if (length(m) > 1) { paste0(m, collapse = ",") } else if (length(m) == 0) { "" } else if (length(m) == 1) { m[[1]] } else { m } }) ) })) })) df <- move_col_begin(df, "matched_name") df <- move_col_begin(df, "unique_name") df } dtrbsetdf <- function(x) { (out <- data.table::setDF( data.table::rbindlist(x, use.names = TRUE, fill = TRUE) )) } taxize/R/nbn_synonyms.R0000644000176200001440000000105213067665634014654 0ustar liggesusers#' Return all synonyms for a taxon name with a given id from NBN #' #' @export #' @param id the taxon identifier code #' @param ... Further args passed on to \code{\link[httr]{GET}} #' @return A data.frame #' @family nbn #' @references #' @examples \dontrun{ #' nbn_synonyms(id = 'NHMSYS0001501147') #' nbn_synonyms(id = 'NHMSYS0000456036') #' #' # none #' nbn_synonyms(id = 'NHMSYS0000502940') #' } nbn_synonyms <- function(id, ...) { url <- file.path(nbn_base(), "species", id) df <- nbn_GET_2(url, ...) df$synonyms } taxize/R/iplant_resolve.R0000644000176200001440000000207512672106003015131 0ustar liggesusers#' iPlant name resolution #' #' @export #' @param query Vector of one or more taxonomic names. (no common names) #' @param retrieve Specifies whether to retrieve all matches for the names submitted. One of 'best' #' (retrieves only the single best match for each name submitted) or 'all' (retrieves all matches) #' @param ... Curl options passed on to \code{\link[httr]{GET}} #' @return A data.frame #' @examples \dontrun{ #' iplant_resolve(query=c("Helianthus annuus", "Homo sapiens")) #' iplant_resolve("Helianthusss") #' iplant_resolve("Pooa") #' #' library("httr") #' iplant_resolve("Helianthusss", config=verbose()) #' } iplant_resolve <- function(query, retrieve='all', ...){ url <- "http://tnrs.iplantc.org/tnrsm-svc/matchNames" query <- paste(query, collapse = ",") args <- tc(list(names = query, retrieve = retrieve)) out <- GET(url, query = argsnull(args), ...) warn_for_status(out) tt <- con_utf8(out) res <- jsonlite::fromJSON(tt, FALSE)$items df <- do.call(rbind, lapply(res, data.frame, stringsAsFactors = FALSE)) if (!is.null(df)) nmslwr(df) else df } taxize/R/itis_kingdomnames.R0000644000176200001440000000103412771322534015612 0ustar liggesusers#' Get kingdom names #' #' @export #' @param tsn One or more TSN's (taxonomic serial number) #' @param ... Further arguments passed on to getkingdomnamefromtsn #' @examples \dontrun{ #' itis_kingdomnames(202385) #' itis_kingdomnames(tsn=c(202385,183833,180543)) #' } itis_kingdomnames <- function(tsn=NULL, ...) { if (is.null(tsn)) { ritis::kingdom_names(...) } else { sapply( tsn, function(z) { suppressWarnings( as.character(ritis::kingdom_name(z, ...)$kingdomname) ) } ) } } taxize/R/zzz.R0000644000176200001440000001230213160573620012740 0ustar liggesuserscon_utf8 <- function(x) content(x, "text", encoding = "UTF-8") mssg <- function(v, ...) if (v) message(...) tc <- function(l) Filter(Negate(is.null), l) tcnull <- function(x) if (all(sapply(x, is.null))) NULL else x pluck <- function(x, name, type) { if (missing(type)) { lapply(x, "[[", name) } else { vapply(x, "[[", name, FUN.VALUE = type) } } collapse <- function(x, fxn, class, match=TRUE, ...) { tmp <- lapply(x, fxn, ...) if (match) { structure(sapply(tmp, unclass), class = class, name = unlist(sapply(tmp, attr, which = "name")), match = sapply(tmp, attr, which = "match"), multiple_matches = sapply(tmp, attr, which = "multiple_matches"), pattern_match = sapply(tmp, attr, which = "pattern_match"), uri = tcnull(sapply(tmp, attr, which = "uri"))) } else { structure(sapply(tmp, unclass), class = class, uri = tcnull(sapply(tmp, attr, which = "uri"))) } } evalfxn <- function(x) eval(parse(text = paste0("check", "_", x))) toid <- function(x, url, class, ...) { uri <- sprintf(url, x) structure(x, class = class, match = "found", multiple_matches = FALSE, pattern_match = FALSE, uri = uri, ...) } add_uri <- function(ids, url, z = NULL){ if ( !all(is.na(ids)) ) { uri_ids <- if (!is.null(z)) z else ids attr(ids, 'uri') <- sapply(uri_ids, function(x) { if (!is.na(x)) sprintf(url, x) else NA }, USE.NAMES = FALSE) } ids } check_rows <- function(x){ if (!is.numeric(x) && !any(is.na(x))) { stop("'rows' must be numeric or NA", call. = FALSE) } if (is.numeric(x)) { if (length(x) == 1) { if (x < 1) { stop("'rows' value must be an integer 1 or greater", call. = FALSE) } } } } sub_rows <- function(x, rows){ check_rows(rows) if ( any(is.na(rows)) ) { x } else { # subset if (NROW(x) == 0) { x } else { # check that vector is = or > nrow of data.frame if (NROW(x) < max(rows)) rows <- min(rows):NROW(x) x[rows, ] } } } sub_vector <- function(x, rows){ rows <- check_rows(rows) if (length(x) < max(rows)) rows <- min(rows):length(x) if ( any(is.na(rows)) ) x else x[rows] } nstop <- function(x, arg='db') if (is.null(x)) stop(sprintf("Must specify %s!", arg), call. = FALSE) colClasses <- function(d, colClasses) { colClasses <- rep(colClasses, len=length(d)) d[] <- lapply(seq_along(d), function(i) switch(colClasses[i], numeric=as.numeric(d[[i]]), character=as.character(d[[i]]), Date=as.Date(d[[i]], origin='1970-01-01'), POSIXct=as.POSIXct(d[[i]], origin='1970-01-01'), factor=as.factor(d[[i]]), as(d[[i]], colClasses[i]) )) d } strtrim <- function(str) { gsub("^\\s+|\\s+$", "", str) } # function to help filter get_*() functions for a rank name or rank itself -------------- filt <- function(df, rank, z) { if (NROW(df) == 0) { df } else { if (!is.null(z)) { #mtch <- grep(tolower(z), tolower(df[,rank])) mtch <- grep(sprintf("%s", tolower(z)), tolower(df[,rank])) if (length(mtch) != 0) { df[mtch, ] } else { data.frame(NULL) } } else { df } } } # failwith replacment ------------------ try_default <- function(expr, default, quiet = FALSE){ result <- default if (quiet) { tryCatch(result <- expr, error = function(e) { }) } else { try(result <- expr) } result } failwith <- function(default = NULL, f, quiet = FALSE){ f <- match.fun(f) function(...) try_default(f(...), default, quiet = quiet) } argsnull <- function(x) { if (length(x) == 0) { NULL } else { x } } as_l <- function(z) { if (is.logical(z) || tolower(z) == "true" || tolower(z) == "false") { if (z) { return('true') } else { return('false') } } else { return(z) } } should_be <- function(arg_name, x, class) { if (!is(x, class)) { stop(sprintf("'%s' should be of class '%s'", arg_name, class), call. = FALSE) } } move_col <- function(tt, y){ tt[ c(names(tt)[ -sapply(y, function(m) grep(m, names(tt))) ], y) ] } move_col2 <- function(x, y) x[ c(names(x)[-grep(y, names(x))], y) ] move_col_begin <- function(tt, y){ tt[ c(y, names(tt)[ -sapply(y, function(m) grep(m, names(tt))) ]) ] } pop <- function(x, nms) { x[ !names(x) %in% nms ] } assert <- function(x, y) { if (!is.null(x)) { if (!class(x) %in% y) { stop(deparse(substitute(x)), " must be of class ", paste0(y, collapse = ", "), call. = FALSE) } } } dt2df <- function(x) { (data.table::setDF( data.table::rbindlist(x, use.names = TRUE, fill = TRUE, idcol = TRUE))) } dbswap <- function(x) { switch( x, boldid = "bold", colid = "col", eolid = "eol", gbifid = "gbif", natservid = "natserv", nbnid = "nbn", tolid = "tol", tpsid = "tropicos", tsn = "itis", uid = "ncbi", wormsid = "worms", stop("'db' not recognized", call. = FALSE) ) } taxize/R/ncbi_get_taxon_summary.R0000644000176200001440000000503413012141336016636 0ustar liggesusers#' @title NCBI taxon information from uids #' #' @description Downloads summary taxon information from the NCBI taxonomy databases #' for a set of taxonomy UIDs using eutils esummary. #' #' @export #' @param id (character) NCBI taxonomy uids to retrieve information for. See Details. #' @param ... Curl options passed on to \code{\link[httr]{GET}} #' @return A \code{data.frame} with the following columns: #' \describe{ #' \item{uid}{The uid queried for} #' \item{name}{The name of the taxon; a binomial name if the taxon is of rank species} #' \item{rank}{The taxonomic rank (e.g. 'Genus')} #' } #' @author Zachary Foster \email{zacharyfoster1989@@Sgmail.com} #' @details If your input vector or list of NCBI IDs is longer than about 8000 characters #' (use \code{nchar(paste(ids, collapse = "+"))}), split the list up into chunks since #' at about that number of characters you will run into the HTTP 414 error #' "Request-URI Too Long". #' @examples \dontrun{ #' ncbi_get_taxon_summary(c(1430660, 4751)) #' #' # use curl options #' library("httr") #' ncbi_get_taxon_summary(c(1430660, 4751), config = verbose()) #' } ncbi_get_taxon_summary <- function(id, ...) { # Argument validation ---------------------------------------------------------------------------- if (is.null(id)) return(NULL) if (length(id) <= 1 && is.na(id)) return(NA) id <- as.character(id) if (nchar(paste(id, collapse = "+")) > 8000L) message("You may want to split your ids up into chunks") # Make eutils esummary query --------------------------------------------------------------------- base_url <- paste0(ncbi_base(), "/entrez/eutils/esummary.fcgi?db=taxonomy") query <- paste0(base_url, "&id=", paste(id, collapse = "+")) # Search ncbi taxonomy for uid ------------------------------------------------------------------- rr <- GET(query, ...) stop_for_status(rr) raw_results <- con_utf8(rr) # Parse results ---------------------------------------------------------------------------------- results <- xml2::read_xml(raw_results) output <- data.frame(stringsAsFactors = FALSE, uid = xml2::xml_text(xml2::xml_find_all(results, "/eSummaryResult//DocSum/Id")), name = xml2::xml_text(xml2::xml_find_all(results, "/eSummaryResult//DocSum/Item[@Name='ScientificName']")), rank = xml2::xml_text(xml2::xml_find_all(results, "/eSummaryResult//DocSum/Item[@Name='Rank']")) ) output$rank[output$rank == ''] <- "no rank" Sys.sleep(0.34) # NCBI limits requests to three per second return(output) } taxize/R/get_tsn.R0000644000176200001440000002270313161006035013544 0ustar liggesusers#' Get the TSN code for a search term. #' #' Retrieve the taxonomic serial numbers (TSN) of a taxon from ITIS. #' #' @export #' @param searchterm character; A vector of common or scientific names. #' @param searchtype character; One of 'scientific' or 'common', or any unique abbreviation #' @param accepted logical; If TRUE, removes names that are not accepted valid names #' by ITIS. Set to \code{FALSE} (default) to give back both accepted and unaccepted names. #' @param ask logical; should get_tsn be run in interactive mode? #' If \code{TRUE} and more than one TSN is found for the species, the user is asked for #' input. If \code{FALSE} NA is returned for multiple matches. #' @param verbose logical; should progress be printed? #' @param rows numeric; Any number from 1 to infinity. If the default NA, all rows are considered. #' Note that this function still only gives back a tsn class object with one to many identifiers. #' See \code{\link[taxize]{get_tsn_}} to get back all, or a subset, of the raw data that you are #' presented during the ask process. #' @param x Input to as.tsn #' @param ... Ignored #' @param check logical; Check if ID matches any existing on the DB, only used in #' \code{\link{as.tsn}} #' @template getreturn #' #' @family taxonomic-ids #' @seealso \code{\link[taxize]{classification}} #' #' @examples \dontrun{ #' get_tsn("Quercus douglasii") #' get_tsn("Chironomus riparius") #' get_tsn(c("Chironomus riparius","Quercus douglasii")) #' splist <- c("annona cherimola", 'annona muricata', "quercus robur", #' "shorea robusta", "pandanus patina", "oryza sativa", "durio zibethinus") #' get_tsn(splist, verbose=FALSE) #' #' # specify rows to limit choices available #' get_tsn('Arni') #' get_tsn('Arni', rows=1) #' get_tsn('Arni', rows=1:2) #' #' # When not found #' get_tsn("howdy") #' get_tsn(c("Chironomus riparius", "howdy")) #' #' # Using common names #' get_tsn(searchterm="black bear", searchtype="common") #' #' # Convert a tsn without class information to a tsn class #' as.tsn(get_tsn("Quercus douglasii")) # already a tsn, returns the same #' as.tsn(get_tsn(c("Chironomus riparius","Pinus contorta"))) # same #' as.tsn(19322) # numeric #' as.tsn(c(19322,129313,506198)) # numeric vector, length > 1 #' as.tsn("19322") # character #' as.tsn(c("19322","129313","506198")) # character vector, length > 1 #' as.tsn(list("19322","129313","506198")) # list, either numeric or character #' ## dont check, much faster #' as.tsn("19322", check=FALSE) #' as.tsn(19322, check=FALSE) #' as.tsn(c("19322","129313","506198"), check=FALSE) #' as.tsn(list("19322","129313","506198"), check=FALSE) #' #' (out <- as.tsn(c(19322,129313,506198))) #' data.frame(out) #' as.tsn( data.frame(out) ) #' #' # Get all data back #' get_tsn_("Arni") #' get_tsn_("Arni", rows=1) #' get_tsn_("Arni", rows=1:2) #' get_tsn_(c("asdfadfasd","Pinus contorta"), rows=1:5) #' } get_tsn <- function(searchterm, searchtype = "scientific", accepted = FALSE, ask = TRUE, verbose = TRUE, rows = NA, ...) { assert(ask, "logical") assert(verbose, "logical") assert(searchtype, "character") assert(accepted, "logical") fun <- function(x, searchtype, ask, verbose, rows, ...) { direct <- FALSE mssg(verbose, "\nRetrieving data for taxon '", x, "'\n") searchtype <- match.arg(searchtype, c("scientific", "common")) tsn_df <- ritis::terms(x, what = searchtype, ...) mm <- NROW(tsn_df) > 1 if (!inherits(tsn_df, "tbl_df") || NROW(tsn_df) == 0) { tsn <- NA_character_ att <- "not found" } else { if ("commonNames" %in% names(tsn_df)) { tsn_df$commonNames <- sapply(tsn_df$commonNames, function(z) paste0(z, collapse = ",")) } tsn_df <- tsn_df[,c("tsn","scientificName","commonNames","nameUsage")] if (accepted) { tsn_df <- tsn_df[ tsn_df$nameUsage %in% c('valid','accepted'), ] } tsn_df <- sub_rows(tsn_df, rows) # should return NA if spec not found if (nrow(tsn_df) == 0) { mssg(verbose, "Not found. Consider checking the spelling or alternate classification") tsn <- NA_character_ att <- 'not found' } # take the one tsn from data.frame if (nrow(tsn_df) == 1) { tsn <- tsn_df$tsn att <- 'found' } # check for direct match if (nrow(tsn_df) > 1) { tsn_df <- data.frame(tsn_df, stringsAsFactors = FALSE) names(tsn_df)[grep(searchtype, names(tsn_df))] <- "target" direct <- match(tolower(tsn_df$target), tolower(x)) if (length(direct) == 1) { if (!all(is.na(direct))) { tsn <- tsn_df$tsn[!is.na(direct)] direct <- TRUE att <- 'found' } else { direct <- FALSE tsn <- NA_character_ att <- 'not found' } } else { direct <- FALSE tsn <- NA_character_ att <- 'NA due to ask=FALSE & no direct match found' warning("> 1 result; no direct match found", call. = FALSE) } } # multiple matches if (any( nrow(tsn_df) > 1 && is.na(tsn) | nrow(tsn_df) > 1 && att == "found" && length(tsn) > 1 )) { if (ask) { names(tsn_df)[grep(searchtype, names(tsn_df))] <- "target" # user prompt tsn_df <- tsn_df[order(tsn_df$target), ] rownames(tsn_df) <- NULL # prompt message("\n\n") print(tsn_df) message("\nMore than one TSN found for taxon '", x, "'!\n Enter rownumber of taxon (other inputs will return 'NA'):\n") # prompt take <- scan(n = 1, quiet = TRUE, what = 'raw') if (length(take) == 0) { take <- 'notake' att <- 'nothing chosen' } if (take %in% seq_len(nrow(tsn_df))) { take <- as.numeric(take) message("Input accepted, took taxon '", as.character(tsn_df$target[take]), "'.\n") tsn <- tsn_df$tsn[take] att <- 'found' } else { tsn <- NA_character_ mssg(verbose, "\nReturned 'NA'!\n\n") att <- 'not found' } } else { if (length(tsn) != 1) { warning( sprintf("More than one tsn found for taxon '%s'; refine query or set ask=TRUE", x), call. = FALSE ) tsn <- NA_character_ att <- 'NA due to ask=FALSE & > 1 result' } } } } data.frame( tsn = as.character(tsn), att = att, multiple = mm, direct = direct, stringsAsFactors = FALSE) } searchterm <- as.character(searchterm) outd <- ldply(searchterm, fun, searchtype, ask, verbose, rows, ...) out <- outd$tsn attr(out, 'match') <- outd$att attr(out, 'multiple_matches') <- outd$multiple attr(out, 'pattern_match') <- outd$direct if ( !all(is.na(out)) ) { urlmake <- na.omit(out) attr(out, 'uri') <- sprintf('http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=%s', urlmake) } class(out) <- "tsn" return(out) } #' @export #' @rdname get_tsn as.tsn <- function(x, check=TRUE) UseMethod("as.tsn") #' @export #' @rdname get_tsn as.tsn.tsn <- function(x, check=TRUE) x #' @export #' @rdname get_tsn as.tsn.character <- function(x, check=TRUE) if (length(x) == 1) make_tsn(x, check) else collapse(x, make_tsn, "tsn", check = check) #' @export #' @rdname get_tsn as.tsn.list <- function(x, check=TRUE) if (length(x) == 1) make_tsn(x, check) else collapse(x, make_tsn, "tsn", check = check) #' @export #' @rdname get_tsn as.tsn.numeric <- function(x, check=TRUE) as.tsn(as.character(x), check) #' @export #' @rdname get_tsn as.tsn.data.frame <- function(x, check=TRUE) { structure(x$ids, class = "tsn", match = x$match, multiple_matches = x$multiple_matches, pattern_match = x$pattern_match, uri = x$uri) } #' @export #' @rdname get_tsn as.data.frame.tsn <- function(x, ...){ data.frame(ids = as.character(unclass(x)), class = "tsn", match = attr(x, "match"), multiple_matches = attr(x, "multiple_matches"), pattern_match = attr(x, "pattern_match"), uri = attr(x, "uri"), stringsAsFactors = FALSE) } make_tsn <- function(x, check=TRUE) make_generic(x, 'http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=%s', "tsn", check) check_tsn <- function(x){ tt <- suppressMessages(itis_getrecord(x)) identical(tt$acceptedNameList$tsn, as.character(x)) } #' @export #' @rdname get_tsn get_tsn_ <- function(searchterm, verbose = TRUE, searchtype = "scientific", accepted = TRUE, rows = NA, ...) { stats::setNames( lapply(searchterm, get_tsn_help, verbose = verbose, searchtype = searchtype, accepted = accepted, rows = rows, ...), searchterm ) } get_tsn_help <- function(searchterm, verbose, searchtype, accepted, rows, ...) { mssg(verbose, "\nRetrieving data for taxon '", searchterm, "'\n") searchtype <- match.arg(searchtype, c("scientific","common")) df <- ritis::terms(searchterm, what = searchtype, ...) if (!inherits(df, "tbl_df") || NROW(df) == 0) { NULL } else { df <- df[,c("tsn","scientificName","commonNames","nameUsage")] if ("commonNames" %in% names(df)) { df$commonNames <- sapply(df$commonNames, function(z) paste0(z, collapse = ",")) } if (accepted) df <- df[ df$nameUsage %in% c('valid','accepted'), ] sub_rows(df, rows) } } taxize/R/ncbi_search.R0000644000176200001440000000107112672106003014336 0ustar liggesusers#' Search for gene sequences available for taxa from NCBI. #' #' THIS FUNCTION IS DEFUNCT. #' #' @rdname ncbi_search-defunct #' @keywords internal #' @export ncbi_search <- function(...) { .Defunct("ncbi_searcher", "traits", msg = "This function is defunct. See traits::ncbi_searcher()") } #' Retrieve gene sequences from NCBI by accession number. #' #' THIS FUNCTION IS DEFUNCT. #' #' @export #' @keywords internal #' @rdname get_genes_avail-defunct get_genes_avail <- function(...) { .Defunct("ncbi_search", "taxize", "Function name changed. See ncbi_search") } taxize/R/taxize_cite.R0000644000176200001440000003111313037740173014416 0ustar liggesusers#' Get citations and licenses for data sources used in taxize #' #' @export #' @param fxn Function to search on. A special case is the package name #' 'taxize' that will give the citations for the package. #' @param what One of citation (default), license, or both. #' @examples #' taxize_cite(fxn='eol_search') #' taxize_cite(fxn='itis_hierarchy') #' taxize_cite(fxn='tp_classification') #' taxize_cite(fxn='gbif_ping') #' taxize_cite(fxn='plantminer') #' taxize_cite(fxn='get_natservid_') #' taxize_cite(fxn='as.natservid') #' taxize_cite(fxn='get_wormsid') #' taxize_cite(fxn='as.wormsid') #' #' # Functions that use many data sources #' taxize_cite(fxn='synonyms') #' taxize_cite(fxn='classification') #' #' # Get the taxize citation #' taxize_cite(fxn='taxize') #' #' # Get license information #' taxize_cite(fxn='taxize', "license") taxize_cite <- function(fxn = "itis", what = 'citation'){ what <- match.arg(what, c("citation","license","both")) if (what == "citation") { out <- data_citations(fxn) if (is.null(out)) { cat("Nothing found, try different inputs", "\n\n") cat("Can this citation be improved? https://github.com/ropensci/taxize/issues", "\n") cat("Please cite taxize in your paper: citation(package = 'taxize')") } else { if (fxn == 'taxize') { cat("The paper: ","\n") print(out[[1]]) cat("\n") cat("The software: ","\n") print(out[[2]]) } else { for (i in seq_along(out)) { cat(sprintf("Source: %s", names(out)[i]), "\n") cat(sprintf(" Home page: %s", out[[i]]$url_home), "\n") cat(sprintf(" API help: %s", out[[i]]$apidocs), "\n") cat(sprintf(" Citation: %s", out[[i]]$citation), "\n\n") } cat("Can any of these citations be improved? https://github.com/ropensci/taxize/issues") } } } else if (what == "license") { out <- data_licenses(fxn) if (is.null(out)) { cat("Unknown...") } else{ cat(sprintf("License: %s", out$license), "\n") cat(sprintf("URL: %s", out$url)) } } } data_citations <- function(x){ switch(x, itis_acceptname = list(itis = c_itis), itis_downstream = list(itis = c_itis), itis_getrecord = list(itis = c_itis), itis_hierarchy = list(itis = c_itis), itis_kingdomnames = list(itis = c_itis), itis_lsid = list(itis = c_itis), itis_name = list(itis = c_itis), itis_native = list(itis = c_itis), itis_ping = list(itis = c_itis), itis_refs = list(itis = c_itis), itis_taxrank = list(itis = c_itis), itis_terms = list(itis = c_itis), apg_lookup = list(apg = c_apg), as.boldid = list(bold = c_bold), as.colid = list(col = c_col), as.eolid = list(eol = c_eol), as.gbifid = list(gbif = c_gbif), as.natservid = list(natserv = c_natureserve), as.nbnid = list(nbn = c_nbn), as.tpsid = list(tropicos = c_tropicos), as.tsn = list(itis = c_itis), as.uid = list(ncbi = c_ncbi), as.wormsid = list(worms = c_worms), bold_ping = list(bold = c_bold), bold_search = list(bold = c_bold), cbind.classification = list(none = c_none), cbind.classification_ids = list(none = c_none), children = list(itis = c_itis, col = c_col, ncbi = c_ncbi, worms = c_worms), class2tree = list(none = c_none), classification = list(itis = c_itis, col = c_col, ncbi = c_ncbi, gbif = c_gbif, eol = c_eol, troicos = c_tropicos, nbn = c_nbn, worms = c_worms, natserv = c_natureserve), col_children = list(col = c_col), col_classification = list(col = c_col), col_downstream = list(col = c_col), col_ping = list(col = c_col), col_search = list(col = c_col), comm2sci = list(c_itis, c_ncbi, c_eol, c_tropicos, worms = c_worms), downstream = list(itis = c_itis, col = c_col), eol_dataobjects = list(eol = c_eol), eol_hierarchy = list(eol = c_eol), eol_invasive = list(eol = c_eol), eol_pages = list(eol = c_eol), eol_ping = list(eol = c_eol), eol_search = list(eol = c_eol), gbif_name_usage = list(gbif = c_gbif), gbif_parse = list(gbif = c_gbif), gbif_ping = list(gbif = c_gbif), genbank2uid = list(genbank = c_genbank), get_boldid = list(bold = c_bold), get_boldid_ = list(bold = c_bold), get_colid = list(col = c_col), get_colid_ = list(col = c_col), get_eolid = list(eol = c_eol), get_eolid_ = list(eol = c_eol), get_gbifid = list(gbif = c_gbif), get_gbifid_ = list(gbif = c_gbif), get_ids = list(itis = c_itis, col = c_col, ncbi = c_ncbi, gbif = c_gbif, eol = c_eol, tropicos = c_tropicos, nbn = c_nbn), get_ids_ = list(itis = c_itis, col = c_col, ncbi = c_ncbi, gbif = c_gbif, eol = c_eol, tropicos = c_tropicos, nbn = c_nbn), get_natservid = list(natserv = c_natureserve), get_natservid_ = list(natserv = c_natureserve), get_nbnid = list(nbn = c_nbn), get_nbnid_ = list(nbn = c_nbn), get_seqs = list(genbank = c_genbank), get_tpsid = list(tropicos = c_tropicos), get_tpsid_ = list(tropicos = c_tropicos), get_tsn = list(itis = c_itis), get_tsn_ = list(itis = c_itis), get_uid = list(ncbi = c_ncbi), get_uid_ = list(ncbi = c_ncbi), get_wormsid = list(worms = c_worms), get_wormsid_ = list(worms = c_worms), gisd_isinvasive = list(gisd = c_gisd), gni_details = list(gni = c_gni), gni_parse = list(gni = c_gni), gni_search = list(gni = c_gni), gnr_datasources = list(global_names = c_gnames), gnr_resolve = list(global_names = c_gnames), iplant_resolve = list(iplant = c_iplant), ipni_ping = list(ipni = c_ipni), ipni_search = list(ipni = c_ipni), iucn_getname = list(iucn = c_iucn), iucn_status = list(iucn = c_iucn), iucn_summary = list(iucn = c_iucn), names_list = list(theplantlist = c_plist), nbn_classification = list(nbn = c_nbn), nbn_ping = list(nbn = c_nbn), nbn_search = list(nbn = c_nbn), nbn_synonyms = list(nbn = c_nbn), ncbi_children = list(ncbi = c_ncbi), ncbi_get_taxon_summary = list(ncbi = c_ncbi), ncbi_getbyid = list(genbank = c_genbank), ncbi_getbyname = list(genbank = c_genbank), ncbi_ping = list(ncbi = c_ncbi), ncbi_search = list(genbank = c_genbank), plantminer = list(plantminer = c_plantminer), rankagg = list(none = c_none), rbind.classification = list(none = c_none), rbind.classification_ids = list(none = c_none), resolve = list(global_names = c_gnames, iplant = c_iplant), sci2comm = list(itis = c_itis, ncbi = c_ncbi, eol = c_eol, worms = c_worms), scrapenames = list(global_names = c_gnames), synonyms = list(itis = c_itis, col = c_col, tropicos = c_tropicos, nbn = c_nbn, worms = c_worms), tax_agg = list(itis = c_itis, ncbi = c_ncbi), tax_name = list(itis = c_itis, ncbi = c_ncbi), tax_rank = list(itis = c_itis, ncbi = c_ncbi), tp_acceptednames = list(tropicos = c_tropicos), tp_accnames = list(tropicos = c_tropicos), tp_classification = list(tropicos = c_tropicos), tp_dist = list(tropicos = c_tropicos), tp_namedistributions = list(tropicos = c_tropicos), tp_namereferences = list(tropicos = c_tropicos), tp_refs = list(tropicos = c_tropicos), tp_search = list(tropicos = c_tropicos), tp_summary = list(tropicos = c_tropicos), tp_synonyms = list(tropicos = c_tropicos), tpl_families = list(theplantlist = c_plist), tpl_get = list(theplantlist = c_plist), tpl_search = list(theplantlist = c_plist), tropicos_ping = list(theplantlist = c_plist), upstream = list(c_itis, c_col), vascan_ping = list(vascan = c_vascan), vascan_search = list(vascan = c_vascan), taxize = citation("taxize") ) } data_licenses <- function(x){ switch(x, taxize = list(license = "MIT", url = "http://opensource.org/licenses/MIT") ) } c_itis_url <- "http://www.itis.gov/" c_itis_api <- "http://www.itis.gov/ws_description.html" c_itis_citation <- "Retrieved [month, day, year], from the Integrated Taxonomic Information System on-line database, http://www.itis.gov." c_itis <- list(url_home = c_itis_url, apidocs = c_itis_api, citation = c_itis_citation) c_eol <- list(url_home = 'http://eol.org/', apidocs = 'http://eol.org/api/') c_gbif = list(url_home = 'http://www.gbif.org', apidocs = 'http://www.gbif.org/developer/summary', citation = 'GBIF (2013). GBIF (Ed.), Global Biodiversity Information Facility Data Portal (2013)', dataset_citation = 'http://www.gbif.org/resources/2381') c_tropicos <- list(url_home = "http://tropicos.org/", apidocs = "http://services.tropicos.org/") c_plist <- list(url_home = "http://theplantlist.org/", apidocs = NULL, citation = "The Plant List (2013). Version 1.1. Published on the Internet; http://www.theplantlist.org/ ([accessed ).") c_vascan <- list(url_home = "http://data.canadensys.net/explorer/en/search", apidocs = "http://data.canadensys.net/vascan/api", citation = "Brouillet, L., F. Coursol, S.J. Meades, M. Favreau, M. Anions, P. Belisle & P. Desmet. 2010+. VASCAN, the Database of Vascular Plants of Canada. http://data.canadensys.net/vascan/ (consulted on )") c_plantminer <- list(url_home = "http://www.plantminer.com/", apidocs = "http://www.plantminer.com/help", citation = 'See The Plant List or Tropicos citations') c_nbn <- list(url_home = "http://www.nbn.org.uk/", apidocs = "https://data.nbn.org.uk/Documentation/Web_Services/", citation = NULL) c_ncbi <- list(url_home = "http://www.ncbi.nlm.nih.gov/taxonomy", apidocs = "http://www.ncbi.nlm.nih.gov/books/NBK25501/", citation = "Federhen S: The NCBI Taxonomy database. Nucleic Acids Res 2012, 40 (Database issue): D136-D143.") c_genbank <- list(url_home = "http://www.ncbi.nlm.nih.gov/genbank/", apidocs = "http://www.ncbi.nlm.nih.gov/books/NBK25501/", citation = 'Bilofsky, Howard S., and Burks Christian. "The GenBank genetic sequence data bank." Nucleic acids research 16.5 (1988): 1861-1863.') c_col <- list(url_home = "http://www.catalogueoflife.org/", apidocs = "http://www.catalogueoflife.org/content/web-services", citation = "See > http://www.catalogueoflife.org/col/info/cite") c_iplant <- list(url_home = "http://tnrs.iplantcollaborative.org/", apidocs = "http://tnrs.iplantcollaborative.org/api.html", citation = 'Boyle, B. et al. 2013. The taxonomic name resolution service: an online tool for automated standardization of plant names. BMC bioinformatics 14:16. doi:10.1186/1471-2105-14-16') c_gnames <- list(url_home = "http://gnrd.globalnames.org/", apidocs = "http://gnrd.globalnames.org/api", citation = NULL) c_gni <- list(url_home = "http://gni.globalnames.org/", apidocs = "https://github.com/dimus/gni/wiki/api", citation = NULL) c_bold <- list(url_home = "http://www.boldsystems.org/", apidocs = "http://www.boldsystems.org/index.php/resources/api", citation = "Ratnasingham, S., & Hebert, P. D. (2007). BOLD: The Barcode of Life Data System (http://www. barcodinglife. org). Molecular ecology notes, 7(3), 355-364.") c_iucn <- list(url_home = "http://www.iucn.org/", apidocs = NULL, citation = "IUCN 2015. The IUCN Red List of Threatened Species. Version 2015.1. . Downloaded on .") c_ipni <- list(url_home = "http://www.ipni.org/", apidocs = "http://www.ipni.org/ipni/advPlantNameSearch.do", citation = "The International Plant Names Index (). Published on the Internet http://www.ipni.org [accessed ]") c_apg <- list(url_home = "http://www.mobot.org/MOBOT/research/APweb/", apidocs = NULL, citation = "Stevens, P. F. (). Angiosperm Phylogeny Website. Version 13, July 2012.") c_gisd <- list(url_home = "http://www.issg.org/database/welcome/", apidocs = NULL, citation = NULL) c_none <- list(url_home = "no data source", apidocs = "no data source", citation = "no data source") c_worms <- list(url_home = "http://www.marinespecies.org/", apidocs = "http://www.marinespecies.org/rest/", citation = "We ask you to cite the individual global or regional species lists, or species pages as appropriate. Their citations are shown on their web pages. The database as a whole is to be cited as follows:\n\n WoRMS Editorial Board (2017). World Register of Marine Species. Available from http://www.marinespecies.org at VLIZ. Accessed . doi:10.14284/170") c_natureserve <- list(url_home = "http://www.natureserve.org/", apidocs = "https://services.natureserve.org/index.jsp", citation = "Citation: Natureserve. 2017. NatureServe Web Service. Arlington, VA. U.S.A. Available http://services.natureserve.org. (Accessed: )") taxize/R/itis_acceptname.R0000644000176200001440000000377112771322176015252 0ustar liggesusers#' Retrieve accepted TSN and name #' #' @export #' @param searchtsn One or more TSN for a taxon (numeric/integer) #' @param ... Curl options passed on to \code{\link[httr]{GET}} #' #' @return data.frame with with row number equal to input vector length, and #' with three columns: #' \itemize{ #' \item submittedtsn (numeric) - The submitted TSN #' \item acceptedname (character) - The accepted name - if the submitted TSN is the #' accepted TSN, then this is \code{NA_character_} because ITIS does not return a #' name along with the TSN if it's an accepted name. We could make an extra HTTP #' request to ITIS, but that means additional time. #' \item acceptedtsn (numeric) - The accepted TSN #' \item author (character) - taxonomic authority #' } #' #' @examples \dontrun{ #' # TSN accepted - good name #' itis_acceptname(searchtsn = 208527) #' #' # TSN not accepted - input TSN is old #' itis_acceptname(searchtsn = 504239) #' #' # many accepted names #' ids <- c(18161, 18162, 18163, 18164, 18165, 18166, 46173, 46174, #' 46178, 46181, 46186, 46193, 46196, 46197, 46200, 46201, 46204, #' 46207, 46867, 46868) #' itis_acceptname(searchtsn = ids) #' #' # many unaccepted names #' ids <- c(39087, 46208, 46973, 46976, 46978, 46980, 47295, 47445, #' 47448, 47512, 47515, 47527, 47546, 47622, 47783, 47786, 47787, #' 47788, 47835, 47839) #' itis_acceptname(searchtsn = ids) #' #' # many: mix of accepted and unaccepted names #' ids <- c(18161, 18162, 47527, 47546, 47622, 46200) #' itis_acceptname(searchtsn = ids) #' } itis_acceptname <- function(searchtsn, ...) { (dddd <- data.table::setDF(data.table::rbindlist(lapply(searchtsn, function(z) { tmp <- ritis::accepted_names(z) if (NROW(tmp) == 0) { data.frame(submittedtsn = z, acceptedname = NA, acceptedtsn = z, author = NA, stringsAsFactors = FALSE) } else { data.frame( submittedtsn = z, stats::setNames(tmp, tolower(names(tmp))), stringsAsFactors = FALSE ) } }), fill = TRUE, use.names = TRUE))) } taxize/R/get_wormsid.R0000644000176200001440000002524213160775175014446 0ustar liggesusers#' Get Worms ID for a taxon name #' #' Retrieve Worms ID of a taxon from World Register of Marine #' Species (WORMS). #' #' @export #' @param query character; A vector of common or scientific names. #' @param searchtype character; One of 'scientific' or 'common', or any unique #' abbreviation #' @param accepted logical; If TRUE, removes names that are not accepted valid #' names by WORMS. Set to \code{FALSE} (default) to give back both accepted #' and unaccepted names. #' @param ask logical; should get_wormsid be run in interactive mode? #' If \code{TRUE} and more than one wormsid is found for the species, the #' user is asked for input. If \code{FALSE} NA is returned for #' multiple matches. #' @param verbose logical; should progress be printed? #' @param rows numeric; Any number from 1 to infinity. If the default NaN, all #' rows are considered. Note that this function still only gives back a wormsid #' class object with one to many identifiers. See #' \code{\link[taxize]{get_wormsid_}} to get back all, or a subset, of the raw #' data that you are presented during the ask process. #' @param x Input to as.wormsid #' @param ... Ignored #' @param check logical; Check if ID matches any existing on the DB, only #' used in \code{\link{as.wormsid}} #' @template getreturn #' #' @family taxonomic-ids #' @seealso \code{\link[taxize]{classification}} #' #' @examples \dontrun{ #' (x <- get_wormsid('Platanista gangetica')) #' attributes(x) #' attr(x, "match") #' attr(x, "multiple_matches") #' attr(x, "pattern_match") #' attr(x, "uri") #' #' get_wormsid('Gadus morhua') #' get_wormsid('Pomatomus saltatrix') #' get_wormsid(c("Platanista gangetica", "Lichenopora neapolitana")) #' #' # by common name #' get_wormsid("dolphin", 'common') #' get_wormsid("clam", 'common') #' #' # specify rows to limit choices available #' get_wormsid('Plat') #' get_wormsid('Plat', rows=1) #' get_wormsid('Plat', rows=1:2) #' #' # When not found #' get_wormsid("howdy") #' get_wormsid(c('Gadus morhua', "howdy")) #' #' # Convert a wormsid without class information to a wormsid class #' # already a wormsid, returns the same #' as.wormsid(get_wormsid('Gadus morhua')) #' # same #' as.wormsid(get_wormsid(c('Gadus morhua', 'Pomatomus saltatrix'))) #' # numeric #' as.wormsid(126436) #' # numeric vector, length > 1 #' as.wormsid(c(126436,151482)) #' # character #' as.wormsid("126436") #' # character vector, length > 1 #' as.wormsid(c("126436","151482")) #' # list, either numeric or character #' as.wormsid(list("126436","151482")) #' ## dont check, much faster #' as.wormsid("126436", check=FALSE) #' as.wormsid(126436, check=FALSE) #' as.wormsid(c("126436","151482"), check=FALSE) #' as.wormsid(list("126436","151482"), check=FALSE) #' #' (out <- as.wormsid(c(126436,151482))) #' data.frame(out) #' as.wormsid( data.frame(out) ) #' #' # Get all data back #' get_wormsid_("Plat") #' get_wormsid_("Plat", rows=1) #' get_wormsid_("Plat", rows=1:2) #' get_wormsid_("Plat", rows=1:75) #' # get_wormsid_(c("asdfadfasd","Plat"), rows=1:5) #' } get_wormsid <- function(query, searchtype = "scientific", accepted = FALSE, ask = TRUE, verbose = TRUE, rows = NA, ...) { assert(searchtype, "character") assert(accepted, "logical") assert(ask, "logical") assert(verbose, "logical") fun <- function(x, searchtype, ask, verbose, ...) { direct <- FALSE mssg(verbose, "\nRetrieving data for taxon '", x, "'\n") if (!searchtype %in% c("scientific", "common")) { stop("'searchtype' must be one of 'scientific' or 'common'", call. = FALSE) } wmdf <- switch( searchtype, scientific = worms_worker(x, worrms::wm_records_name, rows, ...), common = worms_worker(x, worrms::wm_records_common, rows, ...) ) mm <- NROW(wmdf) > 1 if (!inherits(wmdf, "tbl_df") || NROW(wmdf) == 0) { wmid <- NA_character_ att <- "not found" } else { wmdf <- suppressWarnings(data.frame(wmdf)) wmdf <- wmdf[, c("AphiaID","scientificname","authority","status")] names(wmdf)[1] <- "id" if (accepted) { wmdf <- wmdf[ wmdf$status %in% 'accepted', ] } wmdf <- sub_rows(wmdf, rows) # should return NA if spec not found if (nrow(wmdf) == 0) { mssg( verbose, "Not found. Consider checking the spelling or alternate classification") wmid <- NA_character_ att <- 'not found' } # take the one wmid from data.frame if (nrow(wmdf) == 1) { wmid <- wmdf$id att <- 'found' } # check for direct match if (nrow(wmdf) > 1) { names(wmdf)[grep("scientificname", names(wmdf))] <- "target" direct <- match(tolower(wmdf$target), tolower(x)) if (length(direct) == 1) { if (!all(is.na(direct))) { wmid <- wmdf$id[!is.na(direct)] direct <- TRUE att <- 'found' } else { direct <- FALSE wmid <- NA_character_ att <- 'not found' } } else { direct <- FALSE wmid <- NA_character_ att <- 'NA due to ask=FALSE & no direct match found' warning("> 1 result; no direct match found", call. = FALSE) } } # multiple matches if (any( nrow(wmdf) > 1 && is.na(wmid) | nrow(wmdf) > 1 && att == "found" & length(wmid) > 1 )) { if (ask) { names(wmdf)[grep("scientificname", names(wmdf))] <- "target" # user prompt wmdf <- wmdf[order(wmdf$target), ] # prompt message("\n\n") print(wmdf) message("\nMore than one WORMS ID found for taxon '", x, "'!\n Enter rownumber of taxon (other inputs will return 'NA'):\n") # prompt take <- scan(n = 1, quiet = TRUE, what = 'raw') if (length(take) == 0) { take <- 'notake' att <- 'nothing chosen' } if (take %in% seq_len(nrow(wmdf))) { take <- as.numeric(take) message("Input accepted, took taxon '", as.character(wmdf$target[take]), "'.\n") wmid <- wmdf$id[take] att <- 'found' } else { wmid <- NA_character_ mssg(verbose, "\nReturned 'NA'!\n\n") att <- 'not found' } } else { if (length(wmid) != 1) { warning( sprintf("More than one WORMS ID found for taxon '%s'; refine query or set ask=TRUE", x), call. = FALSE ) wmid <- NA_character_ att <- 'NA due to ask=FALSE & > 1 result' } } } } data.frame( wmid = as.character(wmid), att = att, multiple = mm, direct = direct, stringsAsFactors = FALSE) } query <- as.character(query) outd <- ldply(query, fun, searchtype, ask, verbose, ...) out <- outd$wmid attr(out, 'match') <- outd$att attr(out, 'multiple_matches') <- outd$multiple attr(out, 'pattern_match') <- outd$direct if ( !all(is.na(out)) ) { urlmake <- na.omit(out) attr(out, 'uri') <- sprintf('http://www.marinespecies.org/aphia.php?p=taxdetails&id=%s', urlmake) } class(out) <- "wormsid" return(out) } try_df <- function(expr) { res <- tryCatch(expr, error = function(e) e) if (inherits(res, "error")) { data.frame(NULL) } else { res } } #' @export #' @rdname get_wormsid as.wormsid <- function(x, check=TRUE) UseMethod("as.wormsid") #' @export #' @rdname get_wormsid as.wormsid.wormsid <- function(x, check=TRUE) x #' @export #' @rdname get_wormsid as.wormsid.character <- function(x, check=TRUE) if (length(x) == 1) make_worms(x, check) else collapse(x, make_worms, "wormsid", check = check) #' @export #' @rdname get_wormsid as.wormsid.list <- function(x, check=TRUE) if (length(x) == 1) make_worms(x, check) else collapse(x, make_worms, "wormsid", check = check) #' @export #' @rdname get_wormsid as.wormsid.numeric <- function(x, check=TRUE) as.wormsid(as.character(x), check) #' @export #' @rdname get_wormsid as.wormsid.data.frame <- function(x, check=TRUE) { structure(x$ids, class = "wormsid", match = x$match, multiple_matches = x$multiple_matches, pattern_match = x$pattern_match, uri = x$uri) } #' @export #' @rdname get_wormsid as.data.frame.wormsid <- function(x, ...){ data.frame(ids = as.character(unclass(x)), class = "wormsid", match = attr(x, "match"), multiple_matches = attr(x, "multiple_matches"), pattern_match = attr(x, "pattern_match"), uri = attr(x, "uri"), stringsAsFactors = FALSE) } make_worms <- function(x, check=TRUE) make_generic(x, 'http://www.marinespecies.org/aphia.php?p=taxdetails&id=%s', "wormsid", check) check_wormsid <- function(x){ tt <- worrms::wm_record(as.numeric(x)) identical(as.character(tt$AphiaID), as.character(x)) } #' @export #' @rdname get_wormsid get_wormsid_ <- function(query, verbose = TRUE, searchtype = "scientific", accepted = TRUE, rows = NA, ...) { stats::setNames( lapply(query, get_wormsid_help, verbose = verbose, searchtype = searchtype, accepted = accepted, rows = rows, ...), query ) } get_wormsid_help <- function(query, verbose, searchtype, accepted, rows, ...) { mssg(verbose, "\nRetrieving data for taxon '", query, "'\n") searchtype <- match.arg(searchtype, c("scientific", "common")) df <- switch( searchtype, scientific = worms_worker(query, worrms::wm_records_name, rows, ...), common = worms_worker(query, worrms::wm_records_common, rows, ...) ) if (!inherits(df, "tbl_df") || NROW(df) == 0) { NULL } else { df <- df[, c("AphiaID","scientificname","authority","status")] if (accepted) df <- df[ df$status %in% 'accepted', ] sub_rows(df, rows) } } # WORMS WORKER # worms_worker(x = "Plat", expr = worrms::wm_records_name) worms_worker <- function(x, expr, rows, ...) { if ( all(!is.na(rows)) && class(rows) %in% c('numeric', 'integer') && rows[length(rows)] <= 50 ) { expr(x, ...) } else if ( all(!is.na(rows)) && class(rows) %in% c('numeric', 'integer') && rows[length(rows)] > 50 ) { out <- try_df(expr(x)) out <- list(out) i <- 1 total <- 0 while (NROW(out[[length(out)]]) == 50 && total < rows[length(rows)]) { i <- i + 1 out[[i]] <- try_df(expr(x, offset = sum(unlist(sapply(out, NROW))))) total <- sum(unlist(sapply(out, NROW))) } df2dt2tbl(out)[rows,] } else { out <- try_df(expr(x)) out <- list(out) i <- 1 while (NROW(out[[length(out)]]) == 50) { i <- i + 1 out[[i]] <- try_df(expr(x, offset = sum(unlist(sapply(out, NROW))), ...)) } df2dt2tbl(out) } } taxize/vignettes/0000755000176200001440000000000013162233432013565 5ustar liggesuserstaxize/vignettes/taxize_vignette.Rmd0000644000176200001440000010764713125505152017461 0ustar liggesusers taxize vignette - a taxonomic toolbelt for R ====== `taxize` is a taxonomic toolbelt for R. `taxize` wraps APIs for a large suite of taxonomic databases availab on the web. ## Installation First, install and load `taxize` into the R session. ```r install.packages("taxize") ``` ```r library("taxize") ``` Advanced users can also download and install the latest development copy from [GitHub](https://github.com/ropensci/taxize_). ## Resolve taxonomic name This is a common task in biology. We often have a list of species names and we want to know a) if we have the most up to date names, b) if our names are spelled correctly, and c) the scientific name for a common name. One way to resolve names is via the Global Names Resolver (GNR) service provided by the [Encyclopedia of Life][eol]. Here, we are searching for two misspelled names: ```r temp <- gnr_resolve(names = c("Helianthos annus", "Homo saapiens")) head(temp) ``` ``` #> user_supplied_name submitted_name matched_name #> 1 Helianthos annus Helianthos annus Helianthus annus #> 2 Helianthos annus Helianthos annus Helianthus annus L. #> 3 Helianthos annus Helianthos annus Helianthus annus #> 4 Helianthos annus Helianthos annus Helianthus annus #> 5 Helianthos annus Helianthos annus Helianthus annuus L. #> 6 Helianthos annus Helianthos annus Helianthus annuus L. #> data_source_title score #> 1 EOL 0.75 #> 2 EOL 0.75 #> 3 uBio NameBank 0.75 #> 4 Open Tree of Life Reference Taxonomy 0.75 #> 5 Catalogue of Life 0.75 #> 6 ITIS 0.75 ``` The correct spellings are *Helianthus annuus* and *Homo sapiens*. Another approach uses the Taxonomic Name Resolution Service via the Taxosaurus API developed by iPLant and the Phylotastic organization. In this example, we provide a list of species names, some of which are misspelled, and we'll call the API with the *tnrs* function. ```r mynames <- c("Helianthus annuus", "Pinus contort", "Poa anua", "Abis magnifica", "Rosa california", "Festuca arundinace", "Sorbus occidentalos","Madia sateva") tnrs(query = mynames, source = "iPlant_TNRS")[ , -c(5:7)] ``` ``` #> submittedname acceptedname sourceid score #> 1 Sorbus occidentalos Sorbus occidentalis iPlant_TNRS 0.99 #> 2 Festuca arundinace Festuca arundinacea iPlant_TNRS 0.99 #> 3 Abis magnifica Abies magnifica iPlant_TNRS 0.96 #> 4 Pinus contort Pinus contorta iPlant_TNRS 0.98 #> 5 Poa anua Poa annua iPlant_TNRS 0.96 #> 6 Madia sateva Madia sativa iPlant_TNRS 0.97 #> 7 Helianthus annuus Helianthus annuus iPlant_TNRS 1 #> 8 Rosa california Rosa californica iPlant_TNRS 0.99 ``` It turns out there are a few corrections: e.g., *Madia sateva* should be *Madia sativa*, and *Rosa california* should be *Rosa californica*. Note that this search worked because fuzzy matching was employed to retrieve names that were close, but not exact matches. Fuzzy matching is only available for plants in the TNRS service, so we advise using EOL's Global Names Resolver if you need to resolve animal names. taxize takes the approach that the user should be able to make decisions about what resource to trust, rather than making the decision. Both the EOL GNR and the TNRS services provide data from a variety of data sources. The user may trust a specific data source, thus may want to use the names from that data source. In the future, we may provide the ability for taxize to suggest the best match from a variety of sources. Another common use case is when there are many synonyms for a species. In this example, we have three synonyms of the currently accepted name for a species. ```r mynames <- c("Helianthus annuus ssp. jaegeri", "Helianthus annuus ssp. lenticularis", "Helianthus annuus ssp. texanus") (tsn <- get_tsn(mynames, accepted = FALSE)) ``` ``` [1] "525928" "525929" "525930" attr(,"match") [1] "found" "found" "found" attr(,"multiple_matches") [1] FALSE FALSE FALSE attr(,"pattern_match") [1] FALSE FALSE FALSE attr(,"uri") [1] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=525928" [2] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=525929" [3] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=525930" attr(,"class") [1] "tsn" ``` ```r lapply(tsn, itis_acceptname) ``` ``` [[1]] submittedtsn acceptedname acceptedtsn author 1 525928 Helianthus annuus 36616 L. [[2]] submittedtsn acceptedname acceptedtsn author 1 525929 Helianthus annuus 36616 L. [[3]] submittedtsn acceptedname acceptedtsn author 1 525930 Helianthus annuus 36616 L. ``` ## Retrieve higher taxonomic names Another task biologists often face is getting higher taxonomic names for a taxa list. Having the higher taxonomy allows you to put into context the relationships of your species list. For example, you may find out that species A and species B are in Family C, which may lead to some interesting insight, as opposed to not knowing that Species A and B are closely related. This also makes it easy to aggregate/standardize data to a specific taxonomic level (e.g., family level) or to match data to other databases with different taxonomic resolution (e.g., trait databases). A number of data sources in taxize provide the capability to retrieve higher taxonomic names, but we will highlight two of the more useful ones: [Integrated Taxonomic Information System (ITIS)][itis] and [National Center for Biotechnology Information (NCBI)][ncbi]. First, we'll search for two species, *Abies procera} and *Pinus contorta* within ITIS. ```r specieslist <- c("Abies procera","Pinus contorta") classification(specieslist, db = 'itis') ``` ``` #> $`Abies procera` #> name rank id #> 1 Plantae kingdom 202422 #> 2 Viridiplantae subkingdom 954898 #> 3 Streptophyta infrakingdom 846494 #> 4 Embryophyta superdivision 954900 #> 5 Tracheophyta division 846496 #> 6 Spermatophytina subdivision 846504 #> 7 Pinopsida class 500009 #> 8 Pinidae subclass 954916 #> 9 Pinales order 500028 #> 10 Pinaceae family 18030 #> 11 Abies genus 18031 #> 12 Abies procera species 181835 #> #> $`Pinus contorta` #> name rank id #> 1 Plantae kingdom 202422 #> 2 Viridiplantae subkingdom 954898 #> 3 Streptophyta infrakingdom 846494 #> 4 Embryophyta superdivision 954900 #> 5 Tracheophyta division 846496 #> 6 Spermatophytina subdivision 846504 #> 7 Pinopsida class 500009 #> 8 Pinidae subclass 954916 #> 9 Pinales order 500028 #> 10 Pinaceae family 18030 #> 11 Pinus genus 18035 #> 12 Pinus contorta species 183327 #> #> attr(,"class") #> [1] "classification" #> attr(,"db") #> [1] "itis" ``` It turns out both species are in the family Pinaceae. You can also get this type of information from the NCBI by doing `classification(specieslist, db = 'ncbi')`. Instead of a full classification, you may only want a single name, say a family name for your species of interest. The function *tax_name} is built just for this purpose. As with the `classification` function you can specify the data source with the `db` argument, either ITIS or NCBI. ```r tax_name(query = "Helianthus annuus", get = "family", db = "ncbi") ``` ``` #> db query family #> 1 ncbi Helianthus annuus Asteraceae ``` I may happen that a data source does not provide information on the queried species, than one could take the result from another source and union the results from the different sources. ## Interactive name selection As mentioned most databases use a numeric code to reference a species. A general workflow in taxize is: Retrieve Code for the queried species and then use this code to query more data/information. Below are a few examples. When you run these examples in R, you are presented with a command prompt asking for the row that contains the name you would like back; that output is not printed below for brevity. In this example, the search term has many matches. The function returns a data frame of the matches, and asks for the user to input what row number to accept. ```r get_uid(sciname = "Pinus") ``` ``` #> status rank division scientificname commonname uid genus #> 1 active subgenus seed plants Pinus hard pines 139271 #> 2 active genus seed plants Pinus 3337 #> species subsp modificationdate #> 1 2015/09/16 00:00 #> 2 2004/09/10 00:00 ``` ``` #> [1] "139271" #> attr(,"class") #> [1] "uid" #> attr(,"match") #> [1] "found" #> attr(,"multiple_matches") #> [1] TRUE #> attr(,"pattern_match") #> [1] FALSE #> attr(,"uri") #> [1] "https://www.ncbi.nlm.nih.gov/taxonomy/139271" ``` In another example, you can pass in a long character vector of taxonomic names (although this one is rather short for demo purposes): ```r splist <- c("annona cherimola", 'annona muricata', "quercus robur") get_tsn(searchterm = splist, searchtype = "scientific") ``` ``` #> [1] "506198" "18098" "19405" #> attr(,"match") #> [1] "found" "found" "found" #> attr(,"multiple_matches") #> [1] FALSE FALSE TRUE #> attr(,"pattern_match") #> [1] FALSE FALSE TRUE #> attr(,"uri") #> [1] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=506198" #> [2] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=18098" #> [3] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=19405" #> attr(,"class") #> [1] "tsn" ``` There are functions for many other sources * `get_boldid()` * `get_colid()` * `get_eolid()` * `get_gbifid()` * `get_nbnid()` * `get_tpsid()` Sometimes with these functions you get a lot of data back. In these cases you may want to limit your choices. Soon we will incorporate the ability to filter using `regex` to limit matches, but for now, we have a new parameter, `rows`, which lets you select certain rows. For example, you can select the first row of each given name, which means there is no interactive component: ```r get_nbnid(c("Zootoca vivipara","Pinus contorta"), rows = 1) ``` ``` #> [1] "NHMSYS0001706186" "NBNSYS0000004786" #> attr(,"class") #> [1] "nbnid" #> attr(,"match") #> [1] "found" "found" #> attr(,"multiple_matches") #> [1] TRUE TRUE #> attr(,"pattern_match") #> [1] FALSE FALSE #> attr(,"uri") #> [1] "https://data.nbn.org.uk/Taxa/NHMSYS0001706186" #> [2] "https://data.nbn.org.uk/Taxa/NBNSYS0000004786" ``` Or you can select a range of rows ```r get_nbnid(c("Zootoca vivipara","Pinus contorta"), rows = 1:3) ``` ``` #> nbnid scientificName rank #> 1 NHMSYS0001706186 Zootoca vivipara species #> 2 NHMSYS0020784960 Zootoca vivipara subsp. pannonica subspecies #> 3 NHMSYS0000461615 Bistorta vivipara species #> taxonomicStatus #> 1 accepted #> 2 accepted #> 3 synonym #> nbnid scientificName rank #> 1 NBNSYS0000004786 Pinus contorta species #> 2 NHMSYS0000494848 Pinus contorta subsp. contorta subspecies #> 3 NHMSYS0000494858 Pinus contorta subsp. murreyana subspecies #> taxonomicStatus #> 1 accepted #> 2 synonym #> 3 synonym ``` ``` #> [1] "NHMSYS0001706186" "NBNSYS0000004786" #> attr(,"class") #> [1] "nbnid" #> attr(,"match") #> [1] "found" "found" #> attr(,"multiple_matches") #> [1] TRUE TRUE #> attr(,"pattern_match") #> [1] FALSE FALSE #> attr(,"uri") #> [1] "https://data.nbn.org.uk/Taxa/NHMSYS0001706186" #> [2] "https://data.nbn.org.uk/Taxa/NBNSYS0000004786" ``` In addition, in case you don't want to do interactive name selection in the case where there are a lot of names, you can get all data back with functions of the form, e.g., `get_tsn_()`, and likewise for other data sources. For example: ```r out <- get_nbnid_("Poa annua") NROW(out$`Poa annua`) ``` ``` #> [1] 25 ``` That's a lot of data, so we can get only certain rows back ```r get_nbnid_("Poa annua", rows = 1:10) ``` ``` #> $`Poa annua` #> guid scientificName rank taxonomicStatus #> 1 NBNSYS0000002544 Poa annua species accepted #> 2 NBNSYS0000002739 Adonis annua species synonym #> 3 NBNSYS0200001901 Bellis annua species accepted #> 4 NHMSYS0000456951 Carrichtera annua species synonym #> 5 NBNSYS0200003392 Triumfetta annua species accepted #> 6 NBNSYS0000002918 Lunaria annua species accepted #> 7 NBNSYS0200002555 Lonas annua species accepted #> 8 NBNSYS0000033325 Artemisia annua species accepted #> 9 NHMSYS0000456951 Carrichtera annua species accepted #> 10 NHMSYS0000461806 Poa imbecilla species synonym ``` ## Coerce numerics/alphanumerics to taxon IDs We've also introduced in `v0.5` the ability to coerce numerics and alphanumerics to taxonomic ID classes that are usually only retrieved via `get_*()` functions. For example, adfafd ```r as.gbifid(get_gbifid("Poa annua")) # already a uid, returns the same ``` ``` #> gbifid scientificname rank status matchtype #> 1 2704179 Poa annua L. species ACCEPTED EXACT #> 2 8422205 Poa annua Cham. & Schltdl. species SYNONYM EXACT #> 3 7730008 Poa annua Steud. species DOUBTFUL EXACT ``` ``` #> [1] "2704179" #> attr(,"class") #> [1] "gbifid" #> attr(,"match") #> [1] "found" #> attr(,"multiple_matches") #> [1] TRUE #> attr(,"pattern_match") #> [1] FALSE #> attr(,"uri") #> [1] "http://www.gbif.org/species/2704179" ``` ```r as.gbifid(2704179) # numeric ``` ``` #> [1] "2704179" #> attr(,"class") #> [1] "gbifid" #> attr(,"match") #> [1] "found" #> attr(,"multiple_matches") #> [1] FALSE #> attr(,"pattern_match") #> [1] FALSE #> attr(,"uri") #> [1] "http://www.gbif.org/species/2704179" ``` ```r as.gbifid("2704179") # character ``` ``` #> [1] "2704179" #> attr(,"class") #> [1] "gbifid" #> attr(,"match") #> [1] "found" #> attr(,"multiple_matches") #> [1] FALSE #> attr(,"pattern_match") #> [1] FALSE #> attr(,"uri") #> [1] "http://www.gbif.org/species/2704179" ``` ```r as.gbifid(list("2704179","2435099","3171445")) # list, either numeric or character ``` ``` #> [1] "2704179" "2435099" "3171445" #> attr(,"class") #> [1] "gbifid" #> attr(,"match") #> [1] "found" "found" "found" #> attr(,"multiple_matches") #> [1] FALSE FALSE FALSE #> attr(,"pattern_match") #> [1] FALSE FALSE FALSE #> attr(,"uri") #> [1] "http://www.gbif.org/species/2704179" #> [2] "http://www.gbif.org/species/2435099" #> [3] "http://www.gbif.org/species/3171445" ``` These `as.*()` functions do a quick check of the web resource to make sure it's a real ID. However, you can turn this check off, making this coercion much faster: ```r system.time( replicate(3, as.gbifid(c("2704179","2435099","3171445"), check=TRUE)) ) ``` ``` #> user system elapsed #> 0.072 0.002 1.656 ``` ```r system.time( replicate(3, as.gbifid(c("2704179","2435099","3171445"), check=FALSE)) ) ``` ``` #> user system elapsed #> 0.002 0.000 0.002 ``` ## What taxa are downstream of my taxon of interest? If someone is not a taxonomic specialist on a particular taxon he likely does not know what children taxa are within a family, or within a genus. This task becomes especially unwieldy when there are a large number of taxa downstream. You can of course go to a website like [Wikispecies][wikispecies] or [Encyclopedia of Life][eol] to get downstream names. However, taxize provides an easy way to programatically search for downstream taxa, both for the [Catalogue of Life (CoL)][col] and the [Integrated Taxonomic Information System][itis]. Here is a short example using the CoL in which we want to find all the species within the genus *Apis* (honey bees). ```r downstream("Apis", downto = "Species", db = "col") ``` ``` #> name rank colid #> 1 Apis genus 015be25f6b061ba517f495394b80f108 #> 2 Actinomadura apis species 1182a102a18b40aa19385bf5f1f53367 #> 3 Anisocentropus apis species 8891d18874dde14e44df52e931c44206 #> 4 Apis andreniformis species 7a4a38c5095963949d6d6ec917d471de #> 5 Apis cerana species 39610a4ceff7e5244e334a3fbc5e47e5 #> 6 Apis dorsata species e1d4cbf3872c6c310b7a1c17ddd00ebc #> 7 Apis florea species 92dca82a063fedd1da94b3f3972d7b22 #> 8 Apis koschevnikovi species 4bbc06b9dfbde0b72c619810b564c6e6 #> 9 Apis mellifera species 67cbbcf92cd60748759e58e802d98518 #> 10 Apis nigrocincta species 213668a26ba6d2aad9575218f10d422f #> 11 Ascosphaera apis species 088549f2fb602367e84d5ffdb8c1d4fc #> 12 Candida apis species 3219a9635d3438e8b76a645cecf87287 #> 13 Eristalis apis species 16d7c8023308d38f6bb831ed5fa82002 #> 14 Hister apis species d2d7483acf488b5ed932f49b0aa51d19 #> 15 Ifephylus apis species 9b4d00e009b58bbfc003b51bd3d0c6f0 #> 16 Impatiens nidus-apis species 6aecf448e6aa0cb46387066db94426d1 #> 17 Kirkaldykra apis species 70a68f13454abd937aabf56746f4a6ad #> 18 Mallota apis species 10c3c3921d2ea9f9425ef9fd41914520 #> 19 Melanosella mors-apis species 4ac238f1597847dbc7998d97b8d45a0e #> 20 Microdon apis species 9be92242562eb923e711dc24b7bbab9a #> 21 Nosema apis species 5b2838dfd0ec15844fc6f659f7580322 #> 22 Scutirodes apis species 164ab3ac910547bc945cdbb994be1ee5 #> 23 Spiroplasma apis species 789f91571ce55de4df9821f2d05efab0 #> 24 Trichomonascus apis species 17dc4d840323e2c5b87e67a952f6dff3 #> 25 Pericystis apis species 088549f2fb602367e84d5ffdb8c1d4fc #> 26 Pericystis apis species 088549f2fb602367e84d5ffdb8c1d4fc #> 27 Torulopsis apis species 3219a9635d3438e8b76a645cecf87287 #> 28 Torulopsis apis species 3219a9635d3438e8b76a645cecf87287 #> 29 Apis aestuans species a517bc572c3c2697fe3bbfabc46a1493 #> 30 Apis alpina species f2781627115e4212ddab5979cdd425d2 #> 31 Apis bicornis species e67e82d00faae69da173bb31f9914056 #> 32 Apis canescens species d6b8850db971d65d6079e3a22f35e10e #> 33 Apis clypeata species 706060924801130f6c3abf454087c100 #> 34 Apis cunicularia species ebc3c5166ce2cabf419c4c6dc332cf3b #> 35 Apis etrusca species 6d27fd39a1d8b10050ba4e331987f3c9 #> 36 Apis globosa species 254c8e847ca4ff128bba57fe94deb98d #> 37 Apis hispanica species e8d2057a3efeb2cfdaebe27ea8191cd5 #> 38 Apis hypnorum species dfb743f54f50b9b9dbee378473542821 #> 39 Apis ichneumonea species 13c35287e20ab9373fa445dbc44981ea #> 40 Apis lapidaria species f8da5667af3562ebc0f6a83e1ec408f0 #> 41 Apis muscorum species 5bbfe59da5ce7fe59eb9ca3a7a45916c #> 42 Apis mystacea species fba8e4752a7fa5939a7eae293ba633ec #> 43 Apis obsoleta species da42bcb6cc0267903fb175f8a215aecb #> 44 Apis rostrata species e155a4277b66d1114182cafd875afbe3 #> 45 Apis rostrata species e155a4277b66d1114182cafd875afbe3 #> 46 Apis rufa species e67e82d00faae69da173bb31f9914056 #> 47 Apis signata species 551f101ad3b9bc17b24575585b2500c1 #> 48 Apis smaragdula species 4bc5c886b061e17e9aecb537a04c616d #> 49 Apis spinulosa species 56e7e9f854c9ed31ea6d0a06567607d0 #> 50 Apis subterranea species 3d2adff364a87bf7dd30524aa8071807 #> name_status kingdom family acc_name #> 1 accepted name Animalia Apidae #> 2 accepted name Bacteria Thermomonosporaceae #> 3 accepted name Animalia Calamoceratidae #> 4 accepted name Animalia Apidae #> 5 accepted name Animalia Apidae #> 6 accepted name Animalia Apidae #> 7 accepted name Animalia Apidae #> 8 accepted name Animalia Apidae #> 9 accepted name Animalia Apidae #> 10 accepted name Animalia Apidae #> 11 accepted name Fungi Ascosphaeraceae #> 12 accepted name Fungi Not assigned #> 13 accepted name Animalia Syrphidae #> 14 accepted name Animalia Histeridae #> 15 accepted name Animalia Miridae #> 16 accepted name Plantae Balsaminaceae #> 17 accepted name Animalia Cicadellidae #> 18 accepted name Animalia Syrphidae #> 19 accepted name Fungi Not assigned #> 20 accepted name Animalia Syrphidae #> 21 accepted name Protozoa Nosematidae #> 22 accepted name Animalia Noctuidae #> 23 accepted name Bacteria Spiroplasmataceae #> 24 accepted name Fungi Trichomonascaceae #> 25 ambiguous synonym Ascosphaera apis #> 26 ambiguous synonym Ascosphaera apis #> 27 ambiguous synonym Candida apis #> 28 ambiguous synonym Candida apis #> 29 synonym Xylocopa aestuans #> 30 synonym Bombus alpinus #> 31 synonym Osmia rufa #> 32 synonym Bembix canescens #> 33 synonym Lestica clypeata #> 34 synonym Colletes cunicularius #> 35 synonym Tachytes etruscus #> 36 synonym Exomalopsis similis #> 37 synonym Tachytes freygessneri #> 38 synonym Bombus hypnorum #> 39 synonym Sphex ichneumoneus #> 40 synonym Bombus lapidarius #> 41 synonym Bombus muscorum #> 42 synonym Argogorytes mystaceus #> 43 synonym Tachytes obsoletus #> 44 synonym Bembix rostrata #> 45 synonym Bembix rostrata #> 46 synonym Osmia rufa #> 47 synonym Stictia signata #> 48 synonym Ceratina smaragdula #> 49 synonym Hoplosmia spinulosa #> 50 synonym Bombus subterraneus ``` ``` #> $Apis #> childtaxa_id childtaxa_name childtaxa_rank #> 1 7a4a38c5095963949d6d6ec917d471de Apis andreniformis species #> 2 39610a4ceff7e5244e334a3fbc5e47e5 Apis cerana species #> 3 e1d4cbf3872c6c310b7a1c17ddd00ebc Apis dorsata species #> 4 92dca82a063fedd1da94b3f3972d7b22 Apis florea species #> 5 4bbc06b9dfbde0b72c619810b564c6e6 Apis koschevnikovi species #> 6 67cbbcf92cd60748759e58e802d98518 Apis mellifera species #> 7 213668a26ba6d2aad9575218f10d422f Apis nigrocincta species #> #> attr(,"class") #> [1] "downstream" #> attr(,"db") #> [1] "col" ``` We can also request data from ITIS ```r downstream("Apis", downto = "Species", db = "itis") ``` ``` #> $Apis #> tsn parentname parenttsn taxonname rankid rankname #> 1 154396 Apis 154395 Apis mellifera 220 species #> 2 763550 Apis 154395 Apis andreniformis 220 species #> 3 763551 Apis 154395 Apis cerana 220 species #> 4 763552 Apis 154395 Apis dorsata 220 species #> 5 763553 Apis 154395 Apis florea 220 species #> 6 763554 Apis 154395 Apis koschevnikovi 220 species #> 7 763555 Apis 154395 Apis nigrocincta 220 species #> #> attr(,"class") #> [1] "downstream" #> attr(,"db") #> [1] "itis" ``` ## Direct children You may sometimes only want the direct children. We got you covered on that front, with methods for ITIS, NCBI, and Catalogue of Life. For example, let's get direct children (species in this case) of the bee genus _Apis_ using COL data: ```r children(get_colid("Apis")) ``` ``` #> name rank colid #> 1 Apis genus 015be25f6b061ba517f495394b80f108 #> 2 Actinomadura apis species 1182a102a18b40aa19385bf5f1f53367 #> 3 Anisocentropus apis species 8891d18874dde14e44df52e931c44206 #> 4 Apis andreniformis species 7a4a38c5095963949d6d6ec917d471de #> 5 Apis cerana species 39610a4ceff7e5244e334a3fbc5e47e5 #> 6 Apis dorsata species e1d4cbf3872c6c310b7a1c17ddd00ebc #> 7 Apis florea species 92dca82a063fedd1da94b3f3972d7b22 #> 8 Apis koschevnikovi species 4bbc06b9dfbde0b72c619810b564c6e6 #> 9 Apis mellifera species 67cbbcf92cd60748759e58e802d98518 #> 10 Apis nigrocincta species 213668a26ba6d2aad9575218f10d422f #> 11 Ascosphaera apis species 088549f2fb602367e84d5ffdb8c1d4fc #> 12 Candida apis species 3219a9635d3438e8b76a645cecf87287 #> 13 Eristalis apis species 16d7c8023308d38f6bb831ed5fa82002 #> 14 Hister apis species d2d7483acf488b5ed932f49b0aa51d19 #> 15 Ifephylus apis species 9b4d00e009b58bbfc003b51bd3d0c6f0 #> 16 Impatiens nidus-apis species 6aecf448e6aa0cb46387066db94426d1 #> 17 Kirkaldykra apis species 70a68f13454abd937aabf56746f4a6ad #> 18 Mallota apis species 10c3c3921d2ea9f9425ef9fd41914520 #> 19 Melanosella mors-apis species 4ac238f1597847dbc7998d97b8d45a0e #> 20 Microdon apis species 9be92242562eb923e711dc24b7bbab9a #> 21 Nosema apis species 5b2838dfd0ec15844fc6f659f7580322 #> 22 Scutirodes apis species 164ab3ac910547bc945cdbb994be1ee5 #> 23 Spiroplasma apis species 789f91571ce55de4df9821f2d05efab0 #> 24 Trichomonascus apis species 17dc4d840323e2c5b87e67a952f6dff3 #> 25 Pericystis apis species 088549f2fb602367e84d5ffdb8c1d4fc #> 26 Pericystis apis species 088549f2fb602367e84d5ffdb8c1d4fc #> 27 Torulopsis apis species 3219a9635d3438e8b76a645cecf87287 #> 28 Torulopsis apis species 3219a9635d3438e8b76a645cecf87287 #> 29 Apis aestuans species a517bc572c3c2697fe3bbfabc46a1493 #> 30 Apis alpina species f2781627115e4212ddab5979cdd425d2 #> 31 Apis bicornis species e67e82d00faae69da173bb31f9914056 #> 32 Apis canescens species d6b8850db971d65d6079e3a22f35e10e #> 33 Apis clypeata species 706060924801130f6c3abf454087c100 #> 34 Apis cunicularia species ebc3c5166ce2cabf419c4c6dc332cf3b #> 35 Apis etrusca species 6d27fd39a1d8b10050ba4e331987f3c9 #> 36 Apis globosa species 254c8e847ca4ff128bba57fe94deb98d #> 37 Apis hispanica species e8d2057a3efeb2cfdaebe27ea8191cd5 #> 38 Apis hypnorum species dfb743f54f50b9b9dbee378473542821 #> 39 Apis ichneumonea species 13c35287e20ab9373fa445dbc44981ea #> 40 Apis lapidaria species f8da5667af3562ebc0f6a83e1ec408f0 #> 41 Apis muscorum species 5bbfe59da5ce7fe59eb9ca3a7a45916c #> 42 Apis mystacea species fba8e4752a7fa5939a7eae293ba633ec #> 43 Apis obsoleta species da42bcb6cc0267903fb175f8a215aecb #> 44 Apis rostrata species e155a4277b66d1114182cafd875afbe3 #> 45 Apis rostrata species e155a4277b66d1114182cafd875afbe3 #> 46 Apis rufa species e67e82d00faae69da173bb31f9914056 #> 47 Apis signata species 551f101ad3b9bc17b24575585b2500c1 #> 48 Apis smaragdula species 4bc5c886b061e17e9aecb537a04c616d #> 49 Apis spinulosa species 56e7e9f854c9ed31ea6d0a06567607d0 #> 50 Apis subterranea species 3d2adff364a87bf7dd30524aa8071807 #> name_status kingdom family acc_name #> 1 accepted name Animalia Apidae #> 2 accepted name Bacteria Thermomonosporaceae #> 3 accepted name Animalia Calamoceratidae #> 4 accepted name Animalia Apidae #> 5 accepted name Animalia Apidae #> 6 accepted name Animalia Apidae #> 7 accepted name Animalia Apidae #> 8 accepted name Animalia Apidae #> 9 accepted name Animalia Apidae #> 10 accepted name Animalia Apidae #> 11 accepted name Fungi Ascosphaeraceae #> 12 accepted name Fungi Not assigned #> 13 accepted name Animalia Syrphidae #> 14 accepted name Animalia Histeridae #> 15 accepted name Animalia Miridae #> 16 accepted name Plantae Balsaminaceae #> 17 accepted name Animalia Cicadellidae #> 18 accepted name Animalia Syrphidae #> 19 accepted name Fungi Not assigned #> 20 accepted name Animalia Syrphidae #> 21 accepted name Protozoa Nosematidae #> 22 accepted name Animalia Noctuidae #> 23 accepted name Bacteria Spiroplasmataceae #> 24 accepted name Fungi Trichomonascaceae #> 25 ambiguous synonym Ascosphaera apis #> 26 ambiguous synonym Ascosphaera apis #> 27 ambiguous synonym Candida apis #> 28 ambiguous synonym Candida apis #> 29 synonym Xylocopa aestuans #> 30 synonym Bombus alpinus #> 31 synonym Osmia rufa #> 32 synonym Bembix canescens #> 33 synonym Lestica clypeata #> 34 synonym Colletes cunicularius #> 35 synonym Tachytes etruscus #> 36 synonym Exomalopsis similis #> 37 synonym Tachytes freygessneri #> 38 synonym Bombus hypnorum #> 39 synonym Sphex ichneumoneus #> 40 synonym Bombus lapidarius #> 41 synonym Bombus muscorum #> 42 synonym Argogorytes mystaceus #> 43 synonym Tachytes obsoletus #> 44 synonym Bembix rostrata #> 45 synonym Bembix rostrata #> 46 synonym Osmia rufa #> 47 synonym Stictia signata #> 48 synonym Ceratina smaragdula #> 49 synonym Hoplosmia spinulosa #> 50 synonym Bombus subterraneus ``` ``` #> $`015be25f6b061ba517f495394b80f108` #> childtaxa_id childtaxa_name childtaxa_rank #> 1 7a4a38c5095963949d6d6ec917d471de Apis andreniformis species #> 2 39610a4ceff7e5244e334a3fbc5e47e5 Apis cerana species #> 3 e1d4cbf3872c6c310b7a1c17ddd00ebc Apis dorsata species #> 4 92dca82a063fedd1da94b3f3972d7b22 Apis florea species #> 5 4bbc06b9dfbde0b72c619810b564c6e6 Apis koschevnikovi species #> 6 67cbbcf92cd60748759e58e802d98518 Apis mellifera species #> 7 213668a26ba6d2aad9575218f10d422f Apis nigrocincta species #> #> attr(,"class") #> [1] "children" #> attr(,"db") #> [1] "col" ``` The direct children (genera in this case) of _Pinaceae_ using NCBI data: ```r children("Pinaceae", db = "ncbi") ``` ``` #> $Pinaceae #> childtaxa_id childtaxa_name childtaxa_rank #> 1 123600 Nothotsuga genus #> 2 64685 Cathaya genus #> 3 3358 Tsuga genus #> 4 3356 Pseudotsuga genus #> 5 3354 Pseudolarix genus #> 6 3337 Pinus genus #> 7 3328 Picea genus #> 8 3325 Larix genus #> 9 3323 Keteleeria genus #> 10 3321 Cedrus genus #> 11 3319 Abies genus #> #> attr(,"class") #> [1] "children" #> attr(,"db") #> [1] "ncbi" ``` ## Get NCBI ID from GenBank Ids With accession numbers ```r genbank2uid(id = 'AJ748748') ``` ``` #> [1] "282199" #> attr(,"class") #> [1] "uid" #> attr(,"match") #> [1] "found" #> attr(,"multiple_matches") #> [1] FALSE #> attr(,"pattern_match") #> [1] FALSE #> attr(,"uri") #> [1] "http://www.ncbi.nlm.nih.gov/taxonomy/282199" ``` With gi numbers ```r genbank2uid(id = 62689767) ``` ``` #> [1] "282199" #> attr(,"class") #> [1] "uid" #> attr(,"match") #> [1] "found" #> attr(,"multiple_matches") #> [1] FALSE #> attr(,"pattern_match") #> [1] FALSE #> attr(,"uri") #> [1] "http://www.ncbi.nlm.nih.gov/taxonomy/282199" ``` ## Matching species tables with different taxonomic resolution Biologist often need to match different sets of data tied to species. For example, trait-based approaches are a promising tool in ecology. One problem is that abundance data must be matched with trait databases. These two data tables may contain species information on different taxonomic levels and possibly data must be aggregated to a joint taxonomic level, so that the data can be merged. taxize can help in this data-cleaning step, providing a reproducible workflow: We can use the mentioned `classification`-function to retrieve the taxonomic hierarchy and then search the hierarchies up- and downwards for matches. Here is an example to match a species with names on three different taxonomic levels. ```r A <- "gammarus roeseli" B1 <- "gammarus roeseli" B2 <- "gammarus" B3 <- "gammaridae" A_clas <- classification(A, db = 'ncbi') B1_clas <- classification(B1, db = 'ncbi') B2_clas <- classification(B2, db = 'ncbi') B3_clas <- classification(B3, db = 'ncbi') B1[match(A, B1)] ``` ``` #> [1] "gammarus roeseli" ``` ```r A_clas[[1]]$rank[tolower(A_clas[[1]]$name) %in% B2] ``` ``` #> [1] "genus" ``` ```r A_clas[[1]]$rank[tolower(A_clas[[1]]$name) %in% B3] ``` ``` #> [1] "family" ``` If we find a direct match (here *Gammarus roeseli*), we are lucky. But we can also match Gammaridae with *Gammarus roeseli*, but on a lower taxonomic level. A more comprehensive and realistic example (matching a trait table with an abundance table) is given in the vignette on matching. [eol]: http://www.eol.org/ [ncbi]: http://www.ncbi.nlm.nih.gov/ [itis]: http://www.itis.gov/ [wikispecies]: http://species.wikimedia.org/wiki/Main_Page [col]: http://www.catalogueoflife.org/ taxize/vignettes/name_cleaning.Rmd0000644000176200001440000002470213125505152017016 0ustar liggesusers Strategies for programmatic name cleaning ========================================= `taxize` offers interactive prompts when using `get_*()` functions (e.g., `get_tsn()`). These prompts make it easy in interactive use to select choices when there are more than one match found. However, to make your code reproducible you don't want interactive prompts. This vignette covers some options for programmatic name cleaning. ```r library("taxize") ``` ## get_* functions When using `get_*()` functions programatically, you have a few options. ### rows parameter Normally, if you get more than one result, you get a prompt asking you to select which taxon you want. ```r get_tsn(searchterm = "Quercus b") #> tsn target commonnames nameusage #> 1 19298 Quercus beebiana not accepted #> 2 507263 Quercus berberidifolia scrub oak accepted #> 3 19300 Quercus bicolor swamp white oak accepted #> 4 19303 Quercus borealis not accepted #> 5 195131 Quercus borealis var. maxima not accepted #> 6 195166 Quercus boyntonii Boynton's sand post oak accepted #> 7 506533 Quercus brantii Brant's oak accepted #> 8 195150 Quercus breviloba not accepted #> 9 195099 Quercus breweri not accepted #> 10 195168 Quercus buckleyi Texas oak accepted #> #> More than one TSN found for taxon 'Quercus b'! #> #> Enter rownumber of taxon (other inputs will return 'NA'): #> #> 1: ``` Instead, we can use the rows parameter to specify which records we want by number only (not by a name itself). Here, we want the first 3 records: ```r get_tsn(searchterm = 'Quercus b', rows = 1:3) #> tsn target commonnames nameusage #> 1 19298 Quercus beebiana not accepted #> 2 19300 Quercus bicolor swamp white oak accepted #> 3 19303 Quercus borealis not accepted #> #> More than one TSN found for taxon 'Quercus b'! #> #> Enter rownumber of taxon (other inputs will return 'NA'): #> #> 1: ``` However, you still get a prompt as there is more than one result. Thus, for full programmatic usage, you can specify a single row, if you happen to know which one you want: ```r get_tsn(searchterm = 'Quercus b', rows = 3) #> [1] "19303" #> attr(,"match") #> [1] "found" #> attr(,"multiple_matches") #> [1] TRUE #> attr(,"pattern_match") #> [1] FALSE #> attr(,"uri") #> [1] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=19303" #> attr(,"class") #> [1] "tsn" ``` In reality it is unlikely you'll know which row you want, unless perhaps you just want one result from each query, regardless of what it is. ### underscore methods A better fit for programmatic use are underscore methods. Each `get_*()` function has a sister method with and trailing underscore, e.g., `get_tsn()` and `get_tsn_()`. ```r get_tsn_(searchterm = "Quercus b") #> $`Quercus b` #> # A tibble: 5 x 4 #> tsn scientificName commonNames #> #> 1 19300 Quercus bicolor swamp white oak,chne bicolore #> 2 195166 Quercus boyntonii Boynton's sand post oak,Boynton's oak #> 3 195168 Quercus buckleyi Texas oak,Buckley's oak #> 4 506533 Quercus brantii Brant's oak #> 5 507263 Quercus berberidifolia scrub oak #> # ... with 1 more variables: nameUsage ``` The result is a single data.frame for each taxon queried, which can be processed downstream with whatever logic is required in your workflow. You can also combine `rows` parameter with underscore functions, as a single number of a range of numbers: ```r get_tsn_(searchterm = "Quercus b", rows = 1) #> $`Quercus b` #> # A tibble: 1 x 4 #> tsn scientificName commonNames nameUsage #> #> 1 19300 Quercus bicolor swamp white oak,chne bicolore accepted ``` ```r get_tsn_(searchterm = "Quercus b", rows = 1:2) #> $`Quercus b` #> # A tibble: 2 x 4 #> tsn scientificName commonNames nameUsage #> #> 1 19300 Quercus bicolor swamp white oak,chne bicolore accepted #> 2 195166 Quercus boyntonii Boynton's sand post oak,Boynton's oak accepted ``` ## as.* methods All `get_*()` functions have associated `as.*()` functions (e.g., `get_tsn()` and `as.tsn()`). Many `taxize` functions use taxonomic identifier classes (S3 objects) that are the output of `get_*()` functions. `as.*()` methods make it easy to make the required S3 taxonomic identifier classes if you already know the identifier. For example: Already a tsn, returns the same ```r as.tsn(get_tsn("Quercus douglasii")) #> [1] "19322" #> attr(,"match") #> [1] "found" #> attr(,"multiple_matches") #> [1] FALSE #> attr(,"pattern_match") #> [1] FALSE #> attr(,"uri") #> [1] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=19322" #> attr(,"class") #> [1] "tsn" ``` numeric ```r as.tsn(c(19322, 129313, 506198)) #> [1] "19322" "129313" "506198" #> attr(,"class") #> [1] "tsn" #> attr(,"match") #> [1] "found" "found" "found" #> attr(,"multiple_matches") #> [1] FALSE FALSE FALSE #> attr(,"pattern_match") #> [1] FALSE FALSE FALSE #> attr(,"uri") #> [1] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=19322" #> [2] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=129313" #> [3] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=506198" ``` And you can do the same for character, or list inputs - depending on the data source. The above `as.tsn()` examples have the parameter `check = TRUE`, meaning we ping the data source web service to make sure the identifier exists. You can skip that check if you like by setting `check = FALSE`, and the result is returned much faster: ```r as.tsn(c("19322","129313","506198"), check = FALSE) #> [1] "19322" "129313" "506198" #> attr(,"class") #> [1] "tsn" #> attr(,"match") #> [1] "found" "found" "found" #> attr(,"multiple_matches") #> [1] FALSE FALSE FALSE #> attr(,"pattern_match") #> [1] FALSE FALSE FALSE #> attr(,"uri") #> [1] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=19322" #> [2] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=129313" #> [3] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=506198" ``` With the output of `as.*()` methods, you can then proceed with other `taxize` functions. ## gnr_resolve Some functions in `taxize` are meant specifically for name cleaning. One of those is `gnr_resolve()`. `gnr_resolve()` doesn't provide prompts as do `get_*()` functions, but instead return data.frame's. So we don't face the same problem, and can use `gnr_resolve()` in a programmatic workflow straight away. ```r spp <- names_list(rank = "species", size = 10) gnr_resolve(names = spp, preferred_data_sources = 11) #> user_supplied_name submitted_name #> 1 Helichrysum candollei Helichrysum candollei #> 2 Haworthia retusa Haworthia retusa #> 3 Crypsinus bakeri Crypsinus bakeri #> 4 Mangifera philippinensis Mangifera philippinensis #> 5 Selaginella atirrensis Selaginella atirrensis #> 6 Hymenostomum sullivanii Hymenostomum sullivanii #> 7 Hymenostomum sullivanii Hymenostomum sullivanii #> 8 Cytisus urumoffii Cytisus urumoffii #> 9 Cytisus urumoffii Cytisus urumoffii #> 10 Cytisus urumoffii Cytisus urumoffii #> 11 Baptisia uniflora Baptisia uniflora #> 12 Baptisia uniflora Baptisia uniflora #> 13 Baptisia uniflora Baptisia uniflora #> 14 Baptisia uniflora Baptisia uniflora #> 15 Nephelium xerocarpum Nephelium xerocarpum #> 16 Baccharis gnaphalioides Baccharis gnaphalioides #> 17 Baccharis gnaphalioides Baccharis gnaphalioides #> matched_name #> 1 Helichrysum candollei (Bojer ex DC.) R.Vig. & Humbert #> 2 Haworthia retusa (L.) Duval #> 3 Crypsinus bakeri (Luerss.) Tag. #> 4 Mangifera philippinensis Mukherji #> 5 Selaginella atirrensis Hieron. #> 6 Hymenostomum sullivanii C. Müller ex Geheeb, 1897 #> 7 Hymenostomum sullivanii C. Müller #> 8 Cytisus urumoffii Davidov ex Stoj. #> 9 Cytisus urumoffii Davidoff ex Stoyanoff #> 10 Cytisus urumoffii Davidoff #> 11 Baptisia uniflora Hook. #> 12 Baptisia uniflora (Michx.) Nutt. #> 13 Baptisia uniflora (Michx.) Sm. #> 14 Baptisia uniflora Spreng. #> 15 Nephelium xerocarpum (Bl.) Cambess. #> 16 Baccharis gnaphalioides Spreng. #> 17 Baccharis gnaphalioides DC. #> data_source_title score #> 1 GBIF Backbone Taxonomy 0.988 #> 2 GBIF Backbone Taxonomy 0.988 #> 3 GBIF Backbone Taxonomy 0.988 #> 4 GBIF Backbone Taxonomy 0.988 #> 5 GBIF Backbone Taxonomy 0.988 #> 6 GBIF Backbone Taxonomy 0.988 #> 7 GBIF Backbone Taxonomy 0.988 #> 8 GBIF Backbone Taxonomy 0.988 #> 9 GBIF Backbone Taxonomy 0.988 #> 10 GBIF Backbone Taxonomy 0.988 #> 11 GBIF Backbone Taxonomy 0.988 #> 12 GBIF Backbone Taxonomy 0.988 #> 13 GBIF Backbone Taxonomy 0.988 #> 14 GBIF Backbone Taxonomy 0.988 #> 15 GBIF Backbone Taxonomy 0.988 #> 16 GBIF Backbone Taxonomy 0.988 #> 17 GBIF Backbone Taxonomy 0.988 ``` ## Other functions Some other functions in `taxize` use `get_*()` functions internally (e.g., `classification()`), but you can can generally pass on parameters to the `get_*()` functions internally. ## Feedback? Let us know if you have ideas for better ways to do programmatic name cleaning at or ! taxize/vignettes/taxize_infotable.Rmd0000644000176200001440000000422513125505152017563 0ustar liggesusers Some key functions in taxize, what they do, and their data sources. ====== Function name | What it does | Source | ----------- | ----------- | ----------- | `children` | Get direct children | COL, NCBI, ITIS | `classification` | Upstream classification | COL, NCBI, ITIS, Tropicos, EOL, GBIF, NBN | `comm2sci` | Get scientific from common names | EOL, NCBI, ITIS, Tropicos | `downstream` | Downstream taxa to specified rank | COL, ITIS, GBIF | `get_ids` | Get taxonomic identifiers | COL, NCBI, ITIS, Tropicos, EOL, GBIF, NBN | `resolve` | Resolve names using many resolvers | GNR, TNRS, iPlant | `gnr_resolve` | Resolve names using Global Names Resolver | GNR | `tnrs` | Phylotastic Taxonomic Name Resolution Service | NCBI, iPlant, MSW3 | `tol_resolve` | Resolve names using any resolver | TOL | `iplant_resolve` | iPlant name resolution| iPlant | `sci2comm` | Get common from scientific names | EOL, NCBI, ITIS | `synonyms` | Retrieve synonyms given input names/identifiers | COL, NCBI, ITIS, Tropicos | `upstream` | Retrieve upstream taxa given names/identifiers | COL, ITIS | `lowest_common` | Retrieve the lowest common taxon and rank for a given taxon name or ID | COL, ITIS, GBIF, TOL, NCBI | `genbank2uid` | Get NCBI taxonomy UID from GenBankID | NCBI | `tax_name` | Get taxonomic names for a given rank | NCBI, ITIS | `tax_rank` | Get rank for a given taxonomic name | BOLD, COL, EOL, GBIF, NATSERV, NBN, TOL, TROPICOS, ITIS, NCBI, WORMS | `tpl_get` | Get The Plant List csv files | TPL | ### Acronyms * COL: Catalogue of Life * NCBI: National Center for Biotechnology Information * ITIS: Integrated Taxonomic Information Service * EOL: Encylopedia of Life * GBIF: Global Biodiversity Information Facility * NBN: National Biodiversity Network (UK) * iPlant: iPlant Name Resolution Service * GNR: Global Names Resolver * TNRS: Taxonomic Name Resolution Service * TOL: Open Tree of Life * MSW3: Mammal Species of the World, 3rd Edition * TPL: The Plant List * BOLD: Barcode of Life * NATSERV: Natureserve * TROPICOS: Tropicos plant database * WORMS: World Register of Marine Species taxize/README.md0000644000176200001440000005427513161015572013053 0ustar liggesuserstaxize ====== [![Build Status](https://travis-ci.org/ropensci/taxize.svg?branch=master)](https://travis-ci.org/ropensci/taxize) [![Build status](https://ci.appveyor.com/api/projects/status/6mgc02mkd8j4sq3g/branch/master)](https://ci.appveyor.com/project/sckott/taxize-175/branch/master) [![codecov.io](https://codecov.io/github/ropensci/taxize/coverage.svg?branch=master)](https://codecov.io/github/ropensci/taxize?branch=master) [![rstudio mirror downloads](http://cranlogs.r-pkg.org/badges/taxize)](https://github.com/metacran/cranlogs.app) [![cran version](http://www.r-pkg.org/badges/version/taxize)](https://cran.r-project.org/package=taxize) `taxize` allows users to search over many taxonomic data sources for species names (scientific and common) and download up and downstream taxonomic hierarchical information - among other things. The `taxize` tutorial is can be found at The functions in the package that hit a specific API have a prefix and suffix separated by an underscore. They follow the format of `service_whatitdoes`. For example, `gnr_resolve` uses the Global Names Resolver API to resolve species names. General functions in the package that don't hit a specific API don't have two words separated by an underscore, e.g., `classification`. You need API keys for Encyclopedia of Life (EOL), Tropicos, IUCN, and NatureServe. ## SOAP Note that a few data sources require SOAP web services, which are difficult to support in R across all operating systems. These include: Pan-European Species directories Infrastructure and Mycobank. Data sources that use SOAP web services have been moved to `taxizesoap` at . ## Currently implemented in `taxize`
Souce Function prefix API Docs API key
Encylopedia of Life eol link link
Taxonomic Name Resolution Service tnrs "api.phylotastic.org/tnrs" none
Integrated Taxonomic Information Service itis link none
Global Names Resolver gnr link none
Global Names Index gni link none
IUCN Red List iucn link link
Tropicos tp link link
Theplantlist dot org tpl ** none
Catalogue of Life col link none
National Center for Biotechnology Information ncbi none none
CANADENSYS Vascan name search API vascan link none
International Plant Names Index (IPNI) ipni link none
Barcode of Life Data Systems (BOLD) bold link none
National Biodiversity Network (UK) nbn link none
Index Fungorum fg link none
EU BON eubon link none
Index of Names (ION) ion link none
Open Tree of Life (TOL) tol link none
World Register of Marine Species (WoRMS) worms link none
NatureServe natserv link link
Wikipedia wiki link none
**: There are none! We suggest using `TPL` and `TPLck` functions in the [taxonstand package](https://cran.r-project.org/package=Taxonstand). We provide two functions to get bullk data: `tpl_families` and `tpl_get`. \***: There are none! The function scrapes the web directly. ### May be in taxize in the future... See the [newdatasource](https://github.com/ropensci/taxize/labels/newdatasource) tag in the issue tracker ## Tutorial For more examples see the [tutorial][tut] ## Installation ### Stable version from CRAN ```r install.packages("taxize") ``` ### Development version from GitHub Windows users install [Rtools](https://cran.r-project.org/bin/windows/Rtools/) first. ```r install.packages("devtools") devtools::install_github("ropensci/taxize") ``` ```r library('taxize') ``` ## Get unique taxonomic identifier from NCBI Alot of `taxize` revolves around taxonomic identifiers. Because, as you know, names can be a mess (misspelled, synonyms, etc.), it's better to get an identifier that a particular data sources knows about, then we can move forth acquiring more fun taxonomic data. ```r uids <- get_uid(c("Chironomus riparius", "Chaetopteryx")) ``` ## Retrieve classifications Classifications - think of a species, then all the taxonomic ranks up from that species, like genus, family, order, class, kingdom. ```r out <- classification(uids) lapply(out, head) #> $`315576` #> name rank id #> 1 cellular organisms no rank 131567 #> 2 Eukaryota superkingdom 2759 #> 3 Opisthokonta no rank 33154 #> 4 Metazoa kingdom 33208 #> 5 Eumetazoa no rank 6072 #> 6 Bilateria no rank 33213 #> #> $`492549` #> name rank id #> 1 cellular organisms no rank 131567 #> 2 Eukaryota superkingdom 2759 #> 3 Opisthokonta no rank 33154 #> 4 Metazoa kingdom 33208 #> 5 Eumetazoa no rank 6072 #> 6 Bilateria no rank 33213 ``` ## Immediate children Get immediate children of _Salmo_. In this case, _Salmo_ is a genus, so this gives species within the genus. ```r children("Salmo", db = 'ncbi') #> $Salmo #> childtaxa_id childtaxa_name childtaxa_rank #> 1 1509524 Salmo marmoratus x Salmo trutta species #> 2 1484545 Salmo cf. cenerinus BOLD:AAB3872 species #> 3 1483130 Salmo zrmanjaensis species #> 4 1483129 Salmo visovacensis species #> 5 1483128 Salmo rhodanensis species #> 6 1483127 Salmo pellegrini species #> 7 1483126 Salmo opimus species #> 8 1483125 Salmo macedonicus species #> 9 1483124 Salmo lourosensis species #> 10 1483123 Salmo labecula species #> 11 1483122 Salmo farioides species #> 12 1483121 Salmo chilo species #> 13 1483120 Salmo cettii species #> 14 1483119 Salmo cenerinus species #> 15 1483118 Salmo aphelios species #> 16 1483117 Salmo akairos species #> 17 1201173 Salmo peristericus species #> 18 1035833 Salmo ischchan species #> 19 700588 Salmo labrax species #> 20 237411 Salmo obtusirostris species #> 21 235141 Salmo platycephalus species #> 22 234793 Salmo letnica species #> 23 62065 Salmo ohridanus species #> 24 33518 Salmo marmoratus species #> 25 33516 Salmo fibreni species #> 26 33515 Salmo carpio species #> 27 8032 Salmo trutta species #> 28 8030 Salmo salar species #> #> attr(,"class") #> [1] "children" #> attr(,"db") #> [1] "ncbi" ``` ## Downstream children to a rank Get all species in the genus _Apis_ ```r downstream(as.tsn(154395), db = 'itis', downto = 'species', verbose = FALSE) #> $`154395` #> tsn parentname parenttsn taxonname rankid rankname #> 1 154396 Apis 154395 Apis mellifera 220 species #> 2 763550 Apis 154395 Apis andreniformis 220 species #> 3 763551 Apis 154395 Apis cerana 220 species #> 4 763552 Apis 154395 Apis dorsata 220 species #> 5 763553 Apis 154395 Apis florea 220 species #> 6 763554 Apis 154395 Apis koschevnikovi 220 species #> 7 763555 Apis 154395 Apis nigrocincta 220 species #> #> attr(,"class") #> [1] "downstream" #> attr(,"db") #> [1] "itis" ``` ## Upstream taxa Get all genera up from the species _Pinus contorta_ (this includes the genus of the species, and its co-genera within the same family). ```r upstream("Pinus contorta", db = 'itis', upto = 'Genus', verbose=FALSE) #> tsn target #> 1 183327 Pinus contorta #> 2 183332 Pinus contorta ssp. bolanderi #> 3 822698 Pinus contorta ssp. contorta #> 4 183329 Pinus contorta ssp. latifolia #> 5 183330 Pinus contorta ssp. murrayana #> 6 529672 Pinus contorta var. bolanderi #> 7 183328 Pinus contorta var. contorta #> 8 529673 Pinus contorta var. latifolia #> 9 529674 Pinus contorta var. murrayana #> commonNames #> 1 scrub pine,shore pine,tamarack pine,lodgepole pine #> 2 Bolander's beach pine #> 3 NA #> 4 black pine,Rocky Mountain lodgepole pine #> 5 tamarack pine,Sierra lodgepole pine #> 6 Bolander beach pine #> 7 coast pine,lodgepole pine,beach pine,shore pine #> 8 tall lodgepole pine,lodgepole pine,Rocky Mountain lodgepole pine #> 9 Murray's lodgepole pine,Sierra lodgepole pine,tamarack pine #> nameUsage #> 1 accepted #> 2 not accepted #> 3 not accepted #> 4 not accepted #> 5 not accepted #> 6 accepted #> 7 accepted #> 8 accepted #> 9 accepted #> $`Pinus contorta` #> tsn parentname parenttsn taxonname rankid rankname #> 1 18031 Pinaceae 18030 Abies 180 genus #> 2 18033 Pinaceae 18030 Picea 180 genus #> 3 18035 Pinaceae 18030 Pinus 180 genus #> 4 183396 Pinaceae 18030 Tsuga 180 genus #> 5 183405 Pinaceae 18030 Cedrus 180 genus #> 6 183409 Pinaceae 18030 Larix 180 genus #> 7 183418 Pinaceae 18030 Pseudotsuga 180 genus #> 8 822529 Pinaceae 18030 Keteleeria 180 genus #> 9 822530 Pinaceae 18030 Pseudolarix 180 genus #> #> attr(,"class") #> [1] "upstream" #> attr(,"db") #> [1] "itis" ``` ## Get synonyms ```r synonyms("Acer drummondii", db="itis") #> tsn target commonNames nameUsage #> 1 183671 Acer drummondii NA not accepted #> 2 183672 Rufacer drummondii NA not accepted #> $`Acer drummondii` #> sub_tsn acc_name acc_tsn #> 1 183671 Acer rubrum var. drummondii 526853 #> 2 183671 Acer rubrum var. drummondii 526853 #> 3 183671 Acer rubrum var. drummondii 526853 #> acc_author syn_author #> 1 (Hook. & Arn. ex Nutt.) Sarg. (Hook. & Arn. ex Nutt.) E. Murray #> 2 (Hook. & Arn. ex Nutt.) Sarg. Hook. & Arn. ex Nutt. #> 3 (Hook. & Arn. ex Nutt.) Sarg. (Hook. & Arn. ex Nutt.) Small #> syn_name syn_tsn #> 1 Acer rubrum ssp. drummondii 28730 #> 2 Acer drummondii 183671 #> 3 Rufacer drummondii 183672 #> #> attr(,"class") #> [1] "synonyms" #> attr(,"db") #> [1] "itis" ``` ## Get taxonomic IDs from many sources ```r get_ids(names="Salvelinus fontinalis", db = c('itis', 'ncbi'), verbose=FALSE) #> $itis #> Salvelinus fontinalis #> "162003" #> attr(,"match") #> [1] "found" #> attr(,"multiple_matches") #> [1] FALSE #> attr(,"pattern_match") #> [1] FALSE #> attr(,"uri") #> [1] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=162003" #> attr(,"class") #> [1] "tsn" #> #> $ncbi #> Salvelinus fontinalis #> "8038" #> attr(,"class") #> [1] "uid" #> attr(,"match") #> [1] "found" #> attr(,"multiple_matches") #> [1] FALSE #> attr(,"pattern_match") #> [1] FALSE #> attr(,"uri") #> [1] "https://www.ncbi.nlm.nih.gov/taxonomy/8038" #> #> attr(,"class") #> [1] "ids" ``` You can limit to certain rows when getting ids in any `get_*()` functions ```r get_ids(names="Poa annua", db = "gbif", rows=1) #> $gbif #> Poa annua #> "2704179" #> attr(,"class") #> [1] "gbifid" #> attr(,"match") #> [1] "found" #> attr(,"multiple_matches") #> [1] TRUE #> attr(,"pattern_match") #> [1] FALSE #> attr(,"uri") #> [1] "http://www.gbif.org/species/2704179" #> #> attr(,"class") #> [1] "ids" ``` Furthermore, you can just back all ids if that's your jam with the `get_*_()` functions (all `get_*()` functions with additional `_` underscore at end of function name) ```r get_ids_(c("Chironomus riparius", "Pinus contorta"), db = 'nbn', rows=1:3) #> $nbn #> $nbn$`Chironomus riparius` #> guid scientificName rank taxonomicStatus #> 1 NBNSYS0000027573 Chironomus riparius species accepted #> 2 NHMSYS0000864966 Damaeus (Damaeus) riparius species accepted #> 3 NHMSYS0021059238 Rhizoclonium riparium species accepted #> #> $nbn$`Pinus contorta` #> guid scientificName rank taxonomicStatus #> 1 NBNSYS0000004786 Pinus contorta species accepted #> 2 NHMSYS0000494858 Pinus contorta var. murrayana variety accepted #> 3 NHMSYS0000494848 Pinus contorta var. contorta variety accepted #> #> #> attr(,"class") #> [1] "ids" ``` ## Common names from scientific names ```r sci2comm('Helianthus annuus', db = 'itis') #> tsn target #> 1 36616 Helianthus annuus #> 2 525928 Helianthus annuus ssp. jaegeri #> 3 525929 Helianthus annuus ssp. lenticularis #> 4 525930 Helianthus annuus ssp. texanus #> 5 536095 Helianthus annuus var. lenticularis #> 6 536096 Helianthus annuus var. macrocarpus #> 7 536097 Helianthus annuus var. texanus #> commonNames nameUsage #> 1 annual sunflower,sunflower,wild sunflower,common sunflower accepted #> 2 NA not accepted #> 3 NA not accepted #> 4 NA not accepted #> 5 NA not accepted #> 6 NA not accepted #> 7 NA not accepted #> $`Helianthus annuus` #> [1] "common sunflower" "sunflower" "wild sunflower" #> [4] "annual sunflower" ``` ## Scientific names from common names ```r comm2sci("black bear", db = "itis") #> $`black bear` #> [1] "Chiropotes satanas" "Ursus thibetanus" #> [3] "Ursus thibetanus" "Ursus americanus luteolus" #> [5] "Ursus americanus" "Ursus americanus" #> [7] "Ursus americanus americanus" ``` ## Lowest common rank among taxa ```r spp <- c("Sus scrofa", "Homo sapiens", "Nycticebus coucang") lowest_common(spp, db = "ncbi") #> name rank id #> 21 Boreoeutheria below-class 1437010 ``` ## Coerce codes to taxonomic id classes `numeric` to `uid` ```r as.uid(315567) #> [1] "315567" #> attr(,"class") #> [1] "uid" #> attr(,"match") #> [1] "found" #> attr(,"multiple_matches") #> [1] FALSE #> attr(,"pattern_match") #> [1] FALSE #> attr(,"uri") #> [1] "http://www.ncbi.nlm.nih.gov/taxonomy/315567" ``` `list` to `uid` ```r as.uid(list("315567", "3339", "9696")) #> [1] "315567" "3339" "9696" #> attr(,"class") #> [1] "uid" #> attr(,"match") #> [1] "found" "found" "found" #> attr(,"multiple_matches") #> [1] FALSE FALSE FALSE #> attr(,"pattern_match") #> [1] FALSE FALSE FALSE #> attr(,"uri") #> [1] "http://www.ncbi.nlm.nih.gov/taxonomy/315567" #> [2] "http://www.ncbi.nlm.nih.gov/taxonomy/3339" #> [3] "http://www.ncbi.nlm.nih.gov/taxonomy/9696" ``` ## Coerce taxonomic id classes to a data.frame ```r out <- as.uid(c(315567, 3339, 9696)) (res <- data.frame(out)) #> ids class match multiple_matches pattern_match #> 1 315567 uid found FALSE FALSE #> 2 3339 uid found FALSE FALSE #> 3 9696 uid found FALSE FALSE #> uri #> 1 http://www.ncbi.nlm.nih.gov/taxonomy/315567 #> 2 http://www.ncbi.nlm.nih.gov/taxonomy/3339 #> 3 http://www.ncbi.nlm.nih.gov/taxonomy/9696 ``` ## Contributors Alphebetical + [Ignasi Bartomeus](https://github.com/ibartomeus) + [John Baumgartner](https://github.com/johnbaums) + [Carl Boettiger](https://github.com/cboettig) + [Joseph Brown](https://github.com/josephwb) + [Scott Chamberlain](https://github.com/sckott) + [Anirvan Chatterjee](https://github.com/anirvan) + [Zachary Foster](https://github.com/zachary-foster) + [Oliver Keyes](https://github.com/Ironholds) + [David LeBauer](https://github.com/dlebauer) + [Philippe Marchand](https://github.com/pmarchand1) + [Ben Marwick](https://github.com/benmarwick) + [Francois Michonneau](https://github.com/fmichonneau) + [James O'Donnell](https://github.com/jimmyodonnell) + [Jari Oksanen](https://github.com/jarioksa) + [Karthik Ram](https://github.com/karthik) + [raredd](https://github.com/raredd) + [Eduard Szöcs](https://github.com/EDiLD) + [Luis Villanueva](https://github.com/ljvillanueva) + [Jakub Wilk](https://github.com/jwilk) ## Road map Check out our [milestones](https://github.com/ropensci/taxize/milestones) to see what we plan to get done for each version. ## Meta * Please [report any issues or bugs](https://github.com/ropensci/taxize/issues). * License: MIT * Get citation information for `taxize` in R doing `citation(package = 'taxize')` * Please note that this project is released with a [Contributor Code of Conduct](CONDUCT.md). By participating in this project you agree to abide by its terms. [tut]: https://ropensci.org/tutorials/taxize.html taxize/MD50000644000176200001440000005164313163021640012073 0ustar liggesusersad3c30c3f49d7a7251dffdaba7cbb753 *DESCRIPTION c5af52351472a750055a760a8924ce71 *LICENSE 26d09532158806d45190fdf3d0c2a1b6 *NAMESPACE 069d5c53baceeb26990598a455682ea2 *NEWS.md 7f11465aa3af8b5ab06988e9f332deb3 *R/apg.R 37930c9da8fe4fc8ee0a14a00d20bb09 *R/apg_lookup.R 9a346ec0950068852aa014d3a17da18e *R/bold_search.R bb674a003f41b52ef007b2044be9f244 *R/children.R dd22ad2309bf6c93d1e180e2d9b4bdbf *R/class2tree.R a8c9d9e9dc08283d1caaa81159f35da7 *R/classification.R 7c05448a916dda9644b1b5f8d367beaf *R/col_children.R 195579f9b76048573a11b9929fa07fa2 *R/col_classification.R 46444c086ac4f7589d48ca426137ce88 *R/col_downstream.R d9968ff7cfb1ec2ebf74251d1098e794 *R/col_search.R 8b1527ac82f62bd793db27428eee4085 *R/comm2sci.R 06344945fe46a86b16daf0302fcb55d4 *R/downstream-utils.R e6e7af1fb834955675606a5ac5df0c4f *R/downstream.R a7ab1473047a827f895980cd4f38b304 *R/eol_dataobjects.R 199b9484fd1ef5c7880e887b0a7d2937 *R/eol_hierarchy.R 48cb4fa9ad1f738002f7215ff4d7da63 *R/eol_invasive.R 9d34eb3f01e10d24e2f200947304abb4 *R/eol_pages.R 8fae80c51f54b1b492efac806c6eba2f *R/eol_search.R 9662cc2c3e84d28c5f4b8df5f69246b2 *R/eol_utiils.R 9956057a6d15991d836d21ddc8358fc4 *R/eubon.R b221a6858ed101d5d71b0bbb571f21af *R/eubon_capabilities.R 1a5d30eba64a2b48fd57b0a69efa88ef *R/eubon_children.R bbf5ed47e9f93b1a256f47e4b68928c0 *R/eubon_hierarchy.R 1819f80f4f9e066a33873ef0d2e0fec2 *R/fungorum.R a3d472739a1a129b577f7d63810de21a *R/gbif_downstream.R e08636fb1e2f0adab835b633106a6946 *R/gbif_helpers.R ed9642d32d86ed158d91cca40844c2a0 *R/gbif_name_usage.R b1cd977e49c921fa6f09a6983c163adb *R/gbif_parse.R a067c65d2c525c9394c01bf3a0bb1447 *R/genbank2uid.R bbecb26c6a6e08928b7f237d3363406a *R/get-id-details.R 4962e17fb05746bfa98177941df657f1 *R/get_boldid.R 191459bf4ecc61cf00b4d770338c16d6 *R/get_colid.R 720d1fdb1a1d7138124ebb741c7ea995 *R/get_eolid.R 61c2969a6d8661ba97c44ae699fa795a *R/get_gbifid.R 98785ffc3be249faff7120d1a086ddf9 *R/get_ids.R c03fb18f7ae57a6abea97f5e8d61db06 *R/get_iucn.R 18465cba3db639dbf2e3a9428a37af37 *R/get_natservid.R ec8894ea798ef46899fd249a10d8f15c *R/get_nbnid.R 1ba84838ed2bb659670accc156a146e8 *R/get_tolid.R 0162dee69e99dccc48d2d58cb0eef9a5 *R/get_tpsid.R 0d3bf3bc109d0713f2d0546123e44e29 *R/get_tsn.R 28387d718ed39bc10dd799f50e0f3ce7 *R/get_ubioid.R 3b18a2f37cc917c301148d0b8b13f0d7 *R/get_uid.R 26cf8f184153ce26df443567b6ae9270 *R/get_utils.R fabbea6ec2ba8add6848e929c5dce93f *R/get_wiki.R 6989137a349610d5df133c7a0a7a4cae *R/get_wormsid.R 0e056aaca5d73c4c050ee6ab05210cb7 *R/getkey.R 795b1bd8ab4b16828818cec853998df1 *R/gisd_isinvasive.R e063060ee5b7b87cf8ee9597d94f0783 *R/globals.R 79b0b3ea6bdf3cfb0edabc093b069c50 *R/gni_details.R c7f213cf1c1395925b07590424b51b59 *R/gni_helpers.R bf9037d21b09b7299225cc15e8687082 *R/gni_parse.R 327a0e636e9e0f129fb0379661ef1af1 *R/gni_search.R 29ee33781020b56b7b3985fc3a4a5718 *R/gnr_datasources.R 7c2ae186bac1d1f4c1bb25d089c15790 *R/gnr_resolve.R fcdbb9038d13d1fa2b705f71fb107750 *R/ion.R e72d825cb36b6edcbad41183a6481d95 *R/iplant_resolve.R 9644fa8fea4acbdb2c9e6b9a3e49f8f3 *R/ipni_search.R aaf8562b26ac2d52a5b443fcbd6d0495 *R/itis_acceptname.R 296458ede35020589b42e41056ba501a *R/itis_downstream.R dd8db047f0b6d2d6b6f6f9d73b80262d *R/itis_getrecord.R d1a6522cb5ae8a7933c4dad747bf9d35 *R/itis_hierarchy.R 5d49e4d1e99d2d51b389f774d61a58ea *R/itis_kingdomnames.R b8732758c977ef5328a71a7e92ef4ab3 *R/itis_lsid.R fed20d5d6a355927c28bcf62e4b984ca *R/itis_name.R 85f567c51f3884662d89c8253a9643d1 *R/itis_native.R f33a0c7d889e993fc243760769563ff3 *R/itis_refs.R 032151f91ebcfa3628f5c6e4cff55422 *R/itis_taxrank.R ec16f9665ddd9cb52585bd9bb280fc1d *R/itis_terms.R 10fd6c65b162c35fbac382ad8a86c35a *R/iucn_getname.R 2dabd9e43adf0aed9c0893c5e5abf50b *R/iucn_id.R 66fdc2c50763dd7ef53c0156bff8aecd *R/iucn_summary.R 312066cc0ed53da2ebd49d29a0488f3f *R/lowest_common.R e11e745720445731361002b5dffc4fb4 *R/names_list.r 0f6f0516e5428a4659bdc0adabf1726b *R/nbn_classification.R 1e072b8f81e6bbec3c84e645ebc15678 *R/nbn_search.R 3c604599cf9d5a652c866241c189ab96 *R/nbn_synonyms.R 597cd6621332dff4cfb334019d653e4c *R/ncbi_children.R 0df47ac6318659e420c57e57d5189393 *R/ncbi_downstream.R a61cd559bfb0bb70d5a8d38db934f5dc *R/ncbi_get_taxon_summary.R 8b4cc2f1fe4edd8fae50030cf5ee4d01 *R/ncbi_getbyid.R 70e0e2778d2eebab5e1f5401f8efaaaa *R/ncbi_getbyname.R b4dc72c26cff34289d42adb56e1d5b40 *R/ncbi_search.R 2eea2799b5f058fe31f78f6d52353619 *R/phylomatic_format.R 8712e9f26257b392aa9a1016da370e70 *R/phylomatic_tree.R 8c78f8c67eeb6d50599002044df01a7e *R/ping.R c8988da5f827bcf2e31b841e6ed3705e *R/plantminer.R 0abba2f6fd3aed5b6f37f553391233f8 *R/rankagg.R 57c9d73251a14dab67912a49e6b3eb4e *R/rename.R 0849a8578d30dcaaddfda9d44f674cd9 *R/resolve.R 44f1bc06bf8e3f4aed5dd570ea21b357 *R/sci2comm.R 614e0d532122aa652db8c3caee1f1fd7 *R/scrapenames.r d65519a4074cf96ed573547f9f9d294c *R/status_codes.R 7d8a9410921c615fd951f9080e53498a *R/synonyms.R 9a606566e77f0755339bf76a7e09e288 *R/tax_agg.R 5534e32467109e2095ed818aa2d0b430 *R/tax_name.R c7e3e2eb788b6e0f92150b2dfb40a84c *R/tax_rank.R 5528d8bbfb39a9ddc8a588b13aba95cf *R/taxize-package.R 91b944860248e52f0dadb75483a4a4f7 *R/taxize_capwords.r 0e5c1db2e14e0ab89b3d611642f63205 *R/taxize_cite.R b0aee22aadbb01b3b359ef8aa2c3fd41 *R/taxize_ldfast.R d038400213bc1147ef52c870143e73af *R/tnrs.R 5cdf8289915d127df5e3e59b4b054ad7 *R/tnrs_sources.r 29173140ebc0b9fb2d22b4a4968acf4d *R/tol_resolve.R 1cfd59f7ca0fb53a669f3fa8a9a2c5a7 *R/tp_accnames.R 3790bc4cd1388f61d7559c37811882bc *R/tp_classification.R 74eb08d7525dfca49552d00265ff73da *R/tp_dist.R b8887daaf18e0cf74034ac38b635d647 *R/tp_refs.R 7cafae630f27b098f630e9e2714ef412 *R/tp_search.R 68275e8551fc4f0f25f88c5063faec71 *R/tp_summary.R 3f7c48ae232c337795d6fde57331cba9 *R/tp_synonyms.R 08cf07e9f7805f932b791667a95c0d05 *R/tpl_families.r 84e1c1fae04a14974ab2a43ef0ec3fa3 *R/tpl_get.r acb4faf140e0dfaef9405d42c1c4b999 *R/tpl_search.r 1a670f04069b229616673cb2876f96bd *R/ubio_classification.R 13a74db8991d29e356892277ffcd0ed8 *R/ubio_classification_search.R f4b5227c3af3bf11ded4364a2ebddb3e *R/ubio_id.R 8715051dbe12b813ac113e520f1ce926 *R/ubio_search.R 7260c416f401d0ad7aa1fc68e461d5d6 *R/ubio_synonyms.R ba9df64a13acee972ddbeb0489a521bf *R/upstream.R 3933fc90cfe2a975efa10fac32019bf3 *R/vascan_search.r 1ca1e227652164a60067c785605eb9c6 *R/zzz.R 4ae55c1f0e4afdc04f073c67b05a954a *README.md d5bc173668d72370c20743058084b84e *build/vignette.rds be73efb3e7b6a0ab72e5f7067343b598 *data/apg_families.RData e4071c6f9f4984f2245762c876072775 *data/apg_orders.RData e661723ce7d3b531f38b95efd64c4038 *data/plantGenusNames.RData 3d9e8a3106a169ab1425561aa603faeb *data/plantNames.RData 1c2ca89a273c41a6284ee95bd9fdda23 *data/rank_ref.RData f7fd5fcec20070d0ec823b9c6ce2505b *data/theplantlist.RData 0c688c04a812081338c07f62cf8426d6 *inst/CITATION 342627c848411b37647f6436f70649dc *inst/doc/name_cleaning.Rmd 02fe4781b5ad236cf50cb8241f802f4a *inst/doc/name_cleaning.html 6325be667e313f94e839aad1d3fe7ee0 *inst/doc/taxize_infotable.Rmd a9b49c76655cd4a27fb93ee59c367299 *inst/doc/taxize_infotable.html 649cc6bb3103d11ec7a05a4fa0d15d6c *inst/doc/taxize_vignette.Rmd 658233850231a67fd5624ef18c59b9cd *inst/doc/taxize_vignette.html a293c4bc7e3041347b0266283706588f *inst/examples/species.txt c0858c66ef19889fd5e406618a7032d4 *inst/ignore/aou_notes.R ab696e4e4632b5eefc96e906c109c4b5 *inst/ignore/nature_serve.R 328b6ca31302ce0b4afdeace5d5a903b *inst/ignore/phylomatic_tree2.R f18a4de49bda8667b7eb8b759a38d3e6 *inst/ignore/phytools_fxns_touse.r 8464e68f991570276ee7487e0f045cdd *inst/ignore/rbladj.r 3daaf521765f2bfbd35b0ee2b963ee2d *inst/ignore/taxonclass.R a9c5194c1da391c6f721cd091bc0d574 *inst/ignore/taxonclass2.R 3f8a1536112ee805d8f3be4df72a9f00 *inst/ignore/taxonid.R e861a7b40fc0ff44d6fbd4196728a89e *inst/ignore/tests/test-ubio_classification.R a041c7791ad03c6122e5103f1e4f530c *inst/ignore/tests/test-ubio_id.R f76dbd0fa03aa2fbea0c06792fcb932a *inst/ignore/tests/test-ubio_namebank.R 8ed04b870dc8fff21d066d612a3cc3f9 *inst/ignore/tests/test-ubio_search.R 1a4ba81c15bc29a4656a8fa48ae6ec52 *inst/ignore/tests/test-ubio_synonyms.R 825b56f17bf991a0357744c30dd3cc06 *inst/ignore/try_with_timeout.R 412adf4e492bca9e165ccb43c9b93c6e *inst/vign/cache/__packages b74f9547c50318db4fa5c7e0b763e37d *inst/vign/cache/taxname_0f3fcc7119f159af267de7a029f64f5e.RData d41d8cd98f00b204e9800998ecf8427e *inst/vign/cache/taxname_0f3fcc7119f159af267de7a029f64f5e.rdb 71c275b66e192ab5f0fafa0daac76d66 *inst/vign/cache/taxname_0f3fcc7119f159af267de7a029f64f5e.rdx eed8eac7b64ea5c7922915b90ab4d605 *inst/vign/cache/tnrs_c39c1e0c556437f6b37ba3c369e8be54.RData 2acd1a8cc301003745e3698ddc28e071 *inst/vign/cache/tnrs_c39c1e0c556437f6b37ba3c369e8be54.rdb f6ad0828c34eb7ea05f9fd61919e2a73 *inst/vign/cache/tnrs_c39c1e0c556437f6b37ba3c369e8be54.rdx a156ba276922541829613a200126f3ae *inst/vign/name_cleaning.Rmd 342627c848411b37647f6436f70649dc *inst/vign/name_cleaning.md 6325be667e313f94e839aad1d3fe7ee0 *inst/vign/taxize_infotable.Rmd 6325be667e313f94e839aad1d3fe7ee0 *inst/vign/taxize_infotable.md c18e3b634c773ad1c7f81209f8e39833 *inst/vign/taxize_vignette.Rmd 649cc6bb3103d11ec7a05a4fa0d15d6c *inst/vign/taxize_vignette.md 0cf018beea9931380c7df26b53a3b5d3 *man/apg.Rd 31a02f7a8d1551892f20800c71d38b82 *man/apg_families.Rd a4ca44570c75180fae8cedf16b76555e *man/apg_lookup.Rd 2c098020b181ef24caa88f457d9b5c32 *man/apg_orders.Rd d3a8a6b7886a29eefaced90953c76513 *man/bold_search.Rd c6c33ba6ceb9eeed1cc458eeebe27698 *man/children.Rd 99bdfa0be1472aaae3b7d38e83c8adf9 *man/class2tree.Rd 5040e33a71929c9aa407a535ab8c187d *man/classification.Rd ed07d020993269a0a62d25d69dd583b7 *man/col_children.Rd 556906ce976874874741f1a8489451fc *man/col_classification-defunct.Rd 6cc33f82c2a892312fc9749e1df87c7a *man/col_downstream.Rd 25ee6f774368c330e478a5e4846b0c90 *man/col_search.Rd 21f7d74a7cd62a6246eb0ddec3bc5263 *man/comm2sci.Rd 310a5f92ccb5cb5d0c7028849af60373 *man/downstream.Rd 53ce14379cbbc4ef1f0cad6779dcd213 *man/eol_dataobjects.Rd 1d9589af774510203a0531d05217363a *man/eol_hierarchy-defunct.Rd 2ac21d9027245f8c0f87390795b8d302 *man/eol_invasive-defunct.Rd 8b8e1a61e297098d38216c5ed6e37dad *man/eol_pages.Rd a086b1bea48eb7b58b3bfd25b1e704a2 *man/eol_search.Rd 0e0894523140595b38219781185d47ec *man/eubon.Rd 5a34077b1191368233d009928b6bbae2 *man/eubon_capabilities.Rd 51c6f743e415c080a02066c54acc1ebb *man/eubon_children.Rd dcbd6ba1325a3b2f3f04546583c4ec4b *man/eubon_hierarchy.Rd e060c4fd9cf9c5dac35199352b7077fa *man/fungorum.Rd c458fc05084f5bc9dafc620fe098a500 *man/gbif_downstream.Rd 13fa8b7a38410ff6a47041a694513128 *man/gbif_name_usage.Rd 5fad68e93ea9b224f55d416b5c1aa382 *man/gbif_parse.Rd 0a2825e4af20a83596c07f631f760b60 *man/genbank2uid.Rd b2226c3eaaf5b9b9d91d5cfa0e9f11ef *man/get_boldid.Rd 5280ab859023f101bf1c0bded798bea8 *man/get_colid.Rd 05d1ef8cd666c93d724da3c1c56b3207 *man/get_eolid.Rd a910d04cbf2b4a6b0d19d82a3bd96d58 *man/get_gbifid.Rd bfc719a1bd689893858eb3d8a8c9ea58 *man/get_genes-defunct.Rd e9345d9a45556263ea70d3891355e2fe *man/get_genes_avail-defunct.Rd 4093c375ed2fcc4517f90a4a7fc4ce17 *man/get_id_details.Rd 941380a163f36ade66d4d40d682e59e4 *man/get_ids.Rd 897de5bcd1b6ed19c9284b565f35d47d *man/get_iucn.Rd cc79b354b934723ae237f49b38972391 *man/get_natservid.Rd 786d3364b064979f04907921ef5f9fc9 *man/get_nbnid.Rd 26883aeef271e7bea205d03966e2c334 *man/get_seqs-defunct.Rd 27cd86a344f11489128ca2333f27604a *man/get_tolid.Rd 3c7433a882bedc3826c5586f45da53ab *man/get_tpsid.Rd 7fdc2e75b8d9340cbad0a8dd33cbe102 *man/get_tsn.Rd 893dd5a71ead0a52ad52cfa0d5547e20 *man/get_ubioid-defunct.Rd 5963b71e5d59feb35158deefde751185 *man/get_uid.Rd 3b2421b55e12f566a59110ef9c8b95f5 *man/get_wiki.Rd b9fb69564a1953038cce844254cd497f *man/get_wormsid.Rd ffe368a0030062f80113c2c6955c70f7 *man/getkey.Rd b6b53725a259bcca461c29c2651d0e4e *man/gisd_invasive-defunct.Rd e4ee478dae080fee5f86daf235ca3383 *man/gni_details.Rd ff322f059fbcf7da2f8be11a9615dd37 *man/gni_parse.Rd da802c4eb9e77c3f80dee0f154c46cf3 *man/gni_search.Rd ef795158bedb79647e70f45153aff140 *man/gnr_datasources.Rd 08d0b6d8e7ebd2dd524b134b071e9c58 *man/gnr_resolve.Rd 78ef21a2325b403912e790e50c4c5d32 *man/ion.Rd 87b4e3419520e04d42bdebb0b1eb454b *man/iplant_resolve.Rd 58aa0e5f259f2e7b0da7ec05d9739975 *man/ipni_search.Rd 69aa93c4b54a7a9a33c795a159404931 *man/itis_acceptname.Rd 01e9c144fac92077018aab67786c56a6 *man/itis_downstream.Rd b2f850893b76606f9684f21b3fb59bc8 *man/itis_getrecord.Rd d4c72fc2a9bad81d1360156bf46a2042 *man/itis_hierarchy.Rd ce8ff5ad47311deeaec8be25b8b65fcd *man/itis_kingdomnames.Rd 08b964dc0adefca1d22a19639de00bdd *man/itis_lsid.Rd 015946da8bbc186db1da4a50fc2496e8 *man/itis_name-deprecated.Rd 05b53572d8288b41516196b3e5cf4474 *man/itis_native.Rd 36f374a5ad7aea956322a92b9cf99e1e *man/itis_refs.Rd 1b120b46bae153940f965097d6d972d4 *man/itis_taxrank.Rd 0f7ee243aefdc35689dff4ae861aef94 *man/itis_terms.Rd bb703f7fd7a10017e0acc4a27c749565 *man/iucn_getname.Rd 9e194cb8711a92aec18e3c7f07fa6de1 *man/iucn_id.Rd fbd2f01e4d3bd517cebda687dcf62d93 *man/iucn_status.Rd 226938cdedfdf30a164b9119a8c90ee2 *man/iucn_summary.Rd 8daa26e237201c9153c7b3cacd1bc01c *man/lowest_common.Rd 491629cca1c508eded1d06434b1f479f *man/names_list.Rd 89d1eaf41f89b4f3a947ea58c3d654ca *man/nbn_classification.Rd 26c7740560e96af8d92a4d2a0cf67428 *man/nbn_search.Rd 64367b550e4a36597f7b2376338b4261 *man/nbn_synonyms.Rd 6f21601488226954b87312a347d0c6ff *man/ncbi_children.Rd b9877206b3d119341c3c0a006dc2d512 *man/ncbi_downstream.Rd fdf2f834f2556f1596c230934166b803 *man/ncbi_get_taxon_summary.Rd 66b6fda20458c2e71ec46a5abd0474cd *man/ncbi_getbyid-defunct.Rd 9a30084e2e029edec667034fd6ba910b *man/ncbi_getbyname-defunct.Rd c48a56403da77c7be09bdd3d8dc22d30 *man/ncbi_search-defunct.Rd 70d489a616cb9368c05483c8698290f4 *man/phylomatic_format-defunct.Rd 85cabba4967b0b36f5893bdb0cf95339 *man/phylomatic_tree-defunct.Rd 2939eed8fae0373971eaaac59c45fd6c *man/ping.Rd 63ceaf7439d1c5a01a3002b59736c98e *man/plantGenusNames.Rd 3caf74659e1c7372175c7903a08fec8b *man/plantNames.Rd d07f2339501b5f0435f0495dbbe59ff2 *man/plantminer.Rd a76d162b4393d7925be55b45f424849e *man/rank_ref.Rd e79e5072fc9c8a7c1eafe59bb2ef49f3 *man/rankagg.Rd 65943dd1d168c1f2ef872b0755fbdd59 *man/resolve.Rd 66d12e2d4237b2ca1331316ce63f8ae9 *man/sci2comm.Rd 1d1b0cc6a4172980036ddc7996474912 *man/scrapenames.Rd 91a4148dddc1ae8987170058072ee15b *man/status_codes.Rd e0da469225863e46b301520189d3ea5d *man/synonyms.Rd bb1ebbe77ed358ccc364332b52899d2f *man/tax_agg.Rd 3c12348e203c3e1643dafc73cb880bed *man/tax_name.Rd bd34244436422404ca7c0d4feb4be377 *man/tax_rank.Rd 6be0cf190c6ae3c5b29d88b6798170a7 *man/taxize-defunct.Rd d30ee77c9885b7953ab3d47c238c78a1 *man/taxize-package.Rd 0e65a74dcd609e7daf56c0c4843f3ad5 *man/taxize_capwords.Rd 60aa8153900c1086f5c9529cb024402a *man/taxize_cite.Rd 79a37363a34414e921dffce7091267bd *man/taxize_ldfast.Rd df89d65c018acb1c9776a9c5375ec5bb *man/theplantlist.Rd cbd73e45f1ceb6aafc8b1e54239c8869 *man/tnrs.Rd e1748d0a0c5df6e032b974b1edd1985d *man/tnrs_sources.Rd 0bcba8705e3c0a64555b2a3e422ef57f *man/tol_resolve.Rd a87efb3d1b25f35d5127912eaeb50a7a *man/tp_acceptednames-deprecated.Rd 81850afaa64f638f8c917057e7c813dd *man/tp_accnames.Rd ba702e652fc4ad949e19526893dbfd95 *man/tp_classification-defunct.Rd 00547b33099a28d9b9bbb5a5cc9a5eb4 *man/tp_dist.Rd 1f3c1d2e2405fe6a7086f5f8689dea13 *man/tp_namedistributions-deprecated.Rd ecfbbfd48014b5fb1445e1ffbae5861d *man/tp_namereferences-deprecated.Rd 22924ce2b4e3a3a97eeabcb9fff401f7 *man/tp_refs.Rd e7b7adcbaed818d75edf0f2748e8a06f *man/tp_search.Rd ce570a789247f77d38d72654994f906b *man/tp_summary.Rd df55f821c37952fb9624d5f714c4be6a *man/tp_synonyms.Rd 9584ae54c199421d865d09d3aa1c3347 *man/tpl_families.Rd b74d1cba4059b4c323cb26155402869e *man/tpl_get.Rd 8c0ca844c7b29395664a44a7c48d0c1a *man/tpl_search-defunct.Rd 7f81130cf82446f8b460b7a9a2f0bafb *man/ubio_classification-defunct.Rd bf76d448cde71ad04ca7a20c24a6eddb *man/ubio_classification_search-defunct.Rd ba6de5b38936399618cef06376c4306d *man/ubio_id-defunct.Rd cf98559aeff03c9a28de7bd05baaf8df *man/ubio_ping-defunct.Rd a07b1aa0bf1fe21cee69fe3cd22da4e8 *man/ubio_search-defunct.Rd 7793a86d59987daa27cbc6642d52f7f3 *man/ubio_synonyms-defunct.Rd aff9081e5a5fee2fb31640b8a8c6d7d2 *man/upstream.Rd 6344287eac81dc6c4c8828af4d2fe96a *man/vascan_search.Rd 265c6f13798f3db6770e9265dd5c0665 *tests/test-all.R 213f589671405c76198f0f7182c47adf *tests/testthat/Rplots.pdf 05bde94e06b40bfd1880e4269bd7e2a9 *tests/testthat/helper-taxize.R ba5ea9dd2262e033d2eb57666bbf74da *tests/testthat/test-apgscraping.R 39f43147b6d26c90572bb3ea06e609ca *tests/testthat/test-bold_search.R 0da63a8d3e636578855eb9abbdda9241 *tests/testthat/test-children.R 42ab3a201aef66bdee4e00de1c529dd9 *tests/testthat/test-class2tree.R cb4ec44b982b4d88cf9a6192c07474a2 *tests/testthat/test-classification.R 801883cedcdf4b25b116f4425d88134c *tests/testthat/test-col_children.R fbfbacaee7d17d369606e65829189800 *tests/testthat/test-col_downstream.R 4c23a71c3e3b4eda4c2fd42a2ea21847 *tests/testthat/test-col_search.R 61464b1d48ab5cbeafa3a44c58aa75bc *tests/testthat/test-comm2sci.R 3889da36337778315eb79d4f6dce9201 *tests/testthat/test-downstream.R 1499a1f93b84b8dcedf38745db4a25c5 *tests/testthat/test-eol_dataobjects.R bdaea607a3e3efa6b49d52a28ab80392 *tests/testthat/test-eol_pages.R 46d8097e6bfd71f70fa3cdf0ba9c7739 *tests/testthat/test-eol_ping.R c5cd01c27db39d72047a07fd98158fbb *tests/testthat/test-eol_search.R 92ce9f7c39d34b539ab7b91a21c7decc *tests/testthat/test-eubon.R ee97af136efa0f4a106fc594ec251490 *tests/testthat/test-fungorum.R 0e51f8862edc5c7af0ea439f8a448021 *tests/testthat/test-gbif_downstream.R 5ff94fe37bf52908cc07d0f1a91e53dd *tests/testthat/test-gbif_parse.R a46a34158af92d906ee180fa85ef4760 *tests/testthat/test-genbank2uid.R 2e3b2b41042524fc2dd6d073ddaff29f *tests/testthat/test-get_boldid.R f87b1b4be8cb247a11b22af3f6b01b1b *tests/testthat/test-get_colid.R 5a96f2d0f6c9ddce5d992e4a2007d7fd *tests/testthat/test-get_eolid.R d02c0a74463767807756cc836fa8a177 *tests/testthat/test-get_gbifid.R ccf1afd37b6c8899a4754db04eb0c923 *tests/testthat/test-get_ids.R cc81c4a0a53c8a6506dad169cfcd6538 *tests/testthat/test-get_natservid.R 4c7a360e68fccc5af31abc8b852d7975 *tests/testthat/test-get_tpsid.R e256ba62244213fb6c98ef03071e4c67 *tests/testthat/test-get_tsn.R 49f57a572a3c74425b3041b3b04d4ca4 *tests/testthat/test-get_uid.R efff66bce942b18a6765a8aeb3cee42d *tests/testthat/test-get_wormsid.R 9bb5cc090f44b6eba1c9927224baac5c *tests/testthat/test-gni_details.R 6216212133a18781250ca0d92c617ffc *tests/testthat/test-gni_parse.R bf936b30c142a00a86ab27c68eff4800 *tests/testthat/test-gni_search.R d823a4ffbb5f82ae89365b6c50773152 *tests/testthat/test-gnr_datasources.R 25554b2af4cf787a486d60ead55e6580 *tests/testthat/test-gnr_resolve.R 4138fdca52cc0c7862c33b7d863e6d98 *tests/testthat/test-ion.R 3bacfc9a4ef8788bd9d21c8311d2d167 *tests/testthat/test-ipni_search.R 105733019de838bb4fb9b21107c10b0c *tests/testthat/test-itis_acceptname.R 23e8deec9f69c1bc5aad57d4014f0291 *tests/testthat/test-itis_downstream.R 404d206d8d676507b53ff5d5aff97ecf *tests/testthat/test-itis_getrecord.R f72dbbf4aaf1e28e72b5885be81fe73e *tests/testthat/test-itis_hierarchy.R 832a5605f43d4b62bbb589339f0baeb3 *tests/testthat/test-itis_kingdomnames.R 127c455c67c6767370839e4ff5a9ab4e *tests/testthat/test-itis_lsid.R 31023e96dd78674f81adc6515608bc87 *tests/testthat/test-itis_native.R 7b6b04c42b170dd63729beab5840656a *tests/testthat/test-itis_ping.R 3003bc9c30285161edf69e73f8b0db49 *tests/testthat/test-itis_refs.R da61912a2712791bf45dbcf516c948f0 *tests/testthat/test-itis_taxrank.R b054f470967e2963cfa79e85e10850f7 *tests/testthat/test-itis_terms.R 0e47a85a197b26de8f0d87d983c36fc1 *tests/testthat/test-iucn_getname.R e4d4bdd0aba054dfd6d1def537d0a9ca *tests/testthat/test-iucn_id.R 3a69dcd3821b1f1fddfaedc100984133 *tests/testthat/test-iucn_summary.R 32b33c1ff6004b6f4e8abf9a49098cad *tests/testthat/test-lowest_common.R 3f3002b2a19eedf3bca00e657755ac5e *tests/testthat/test-names_list.R 504b29f839e833355c6720eafae26fcf *tests/testthat/test-ncbi_children.R e34aac1ea1dc0ace531e9207ce546b6a *tests/testthat/test-ncbi_get_taxon_summary.R ececc0ec2d43992d3ed22f348ae11c92 *tests/testthat/test-ping.R 95875c4e58c6df99ac6c2c3b8e2f4832 *tests/testthat/test-plantminer.R 3cce84d61f520e1de43e2458cce384b7 *tests/testthat/test-rankagg.R d6bff37137a2919f8a637a15d2808382 *tests/testthat/test-sci2comm.R fbe73dbf015e49afea4d7cbefd623116 *tests/testthat/test-synonyms.R 541af6911dcc9a0ad6ffc5a01859ee7e *tests/testthat/test-tax_agg.R 3b5eb349d67508058d113b4b48c448b1 *tests/testthat/test-tax_name.R d36b648c35c072088cebbcf59c12cbe4 *tests/testthat/test-tax_rank.R 66509497bd986b4136e3afda0019d0d6 *tests/testthat/test-tnrs.R 9147254a3d55246759a7eb7f4fbcb35c *tests/testthat/test-tnrs_sources.R aa881434675d8ba4f4d3b2bd963ff42b *tests/testthat/test-tol_resolve.R ceb4c3939fab7a4eeeb8127c005c17a5 *tests/testthat/test-tp_accnames.R 80047db34d31d1e16d0837ffb4b2694f *tests/testthat/test-tp_dist.R b01148a27883a1933a4ff5dc06238279 *tests/testthat/test-tp_refs.R 62883bace4fed63128ca093ce0cc8547 *tests/testthat/test-tp_search.R f74257ba1182b14f533ee5097f3b0f2b *tests/testthat/test-tp_summary.R 9739b1654944ba59a799687639328546 *tests/testthat/test-tp_synonyms.R 4d2d5045ad928da3ad9af40c3dc69451 *tests/testthat/test-vascan_search.r 342627c848411b37647f6436f70649dc *vignettes/name_cleaning.Rmd 6325be667e313f94e839aad1d3fe7ee0 *vignettes/taxize_infotable.Rmd 649cc6bb3103d11ec7a05a4fa0d15d6c *vignettes/taxize_vignette.Rmd taxize/build/0000755000176200001440000000000013162233431012653 5ustar liggesuserstaxize/build/vignette.rds0000644000176200001440000000043213162233431015211 0ustar liggesusers‹…R;OÃ0vZ©âѲ{eɯ¨º° ÂÀV™ä’ZŠíÊ9(0ñÇ!ØÍ5)Rßë³ïû|öó„1³$Xœ¸0™93rëÊ',ec篵P°ÎkZê*[©‚€9Šwù k©Kƒâ¥†lFØ›¬4 vP¿ïÝ#ZPIhxi,ßZSY¡”@™sÏÉ'˜ÞÃ/_uŽÒ膊—D’›¾ø ªšÛ#õà|(õ[³#﮽ǻ}ìOcg"êwæ¥7ލ˜.e aÓĿ$yX,)ŒVœ/` º£ºpóÛëò>ÑØš]ȦþG|9Ó¶í÷PQ^‹&( ÅI!Pd¥{9?ûŸ_oýÖStaxize/DESCRIPTION0000644000176200001440000000355413163021640013267 0ustar liggesusersPackage: taxize Title: Taxonomic Information from Around the Web Description: Interacts with a suite of web 'APIs' for taxonomic tasks, such as getting database specific taxonomic identifiers, verifying species names, getting taxonomic hierarchies, fetching downstream and upstream taxonomic names, getting taxonomic synonyms, converting scientific to common names and vice versa, and more. Version: 0.9.0 License: MIT + file LICENSE URL: https://github.com/ropensci/taxize BugReports: https://github.com/ropensci/taxize/issues Authors@R: c( person("Scott", "Chamberlain", role = c("aut", "cre"), email = "myrmecocystus@gmail.com"), person("Eduard", "Szoecs", role = "aut"), person("Zachary", "Foster", role = "aut"), person("Carl", "Boettiger", role = "ctb"), person("Karthik", "Ram", role = "ctb"), person("Ignasi", "Bartomeus", role = "ctb"), person("John", "Baumgartner", role = "ctb"), person("James", "O'Donnell", role = "ctb"), person("Jari", "Oksanen", role = "ctb") ) LazyLoad: yes LazyData: yes VignetteBuilder: knitr Depends: R(>= 3.2.1) Imports: graphics, methods, stats, utils, httr (>= 1.2.1), xml2 (>= 1.0.0), jsonlite, reshape2, stringr, plyr, foreach, ape, bold (>= 0.3.5), data.table, rredlist (>= 0.3.0), rotl (>= 3.0.0), ritis (>= 0.5.0), tibble (>= 1.2), worrms (>= 0.1.0), natserv (>= 0.1.4), wikitaxa (>= 0.1.4) Suggests: testthat, roxygen2 (>= 6.0.1), knitr, vegan RoxygenNote: 6.0.1 NeedsCompilation: no Packaged: 2017-09-25 17:04:26 UTC; sacmac Author: Scott Chamberlain [aut, cre], Eduard Szoecs [aut], Zachary Foster [aut], Carl Boettiger [ctb], Karthik Ram [ctb], Ignasi Bartomeus [ctb], John Baumgartner [ctb], James O'Donnell [ctb], Jari Oksanen [ctb] Maintainer: Scott Chamberlain Repository: CRAN Date/Publication: 2017-09-27 22:18:08 UTC taxize/man/0000755000176200001440000000000013162233432012330 5ustar liggesuserstaxize/man/tp_refs.Rd0000644000176200001440000000106513057575431014276 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/tp_refs.R \name{tp_refs} \alias{tp_refs} \title{Return all reference records for for a taxon name with a given id.} \usage{ tp_refs(id, key = NULL, ...) } \arguments{ \item{id}{the taxon identifier code} \item{key}{Your Tropicos API key; loads from .Rprofile.} \item{...}{Curl options passed on to \code{\link[httr]{GET}}} } \value{ List or dataframe. } \description{ Return all reference records for for a taxon name with a given id. } \examples{ \dontrun{ tp_refs(id = 25509881) } } taxize/man/iucn_summary.Rd0000755000176200001440000001067113142671551015350 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/iucn_summary.R \name{iucn_summary} \alias{iucn_summary} \alias{iucn_summary_id} \title{Get a summary from the IUCN Red List} \usage{ iucn_summary(x, parallel = FALSE, distr_detail = FALSE, key = NULL, ...) iucn_summary_id(species_id, silent = TRUE, parallel = FALSE, distr_detail = FALSE, ...) } \arguments{ \item{x}{character; Scientific name. Should be cleaned and in the format \emph{ }.} \item{parallel}{logical; Search in parallel to speed up search. You have to register a parallel backend if \code{TRUE}. See e.g., doMC, doSNOW, etc.} \item{distr_detail}{logical; If \code{TRUE}, the geographic distribution is returned as a list of vectors corresponding to the different range types: native, introduced, etc.} \item{key}{a Redlist API key, get one from \url{http://apiv3.iucnredlist.org/api/v3/token} Required for \code{iucn_summary} but not needed for \code{iucn_summary_id}. Defaults to \code{NULL} in case you have your key stored (see \code{Redlist Authentication} below).} \item{...}{Currently not used.} \item{species_id}{an IUCN ID} \item{silent}{logical; Make errors silent or not (when species not found).} } \value{ A list (for every species one entry) of lists with the following items: \item{status}{Red List Category.} \item{history}{History of status, if available.} \item{distr}{Geographic distribution, if available.} \item{trend}{Trend of population size, if available.} } \description{ Get a summary from the IUCN Red List (\url{http://www.iucnredlist.org/}). } \details{ Beware: IUCN functions can give back incorrect data. This isn't our fault. We do our best to get you the correct data quickly, but sometimes IUCN gives back the wrong data, and sometimes Global Names gives back the wrong data. We will fix these as soon as possible. In the meantime, just make sure that the data you get back is correct. \code{iucn_summary} has a default method that errors when anything's passed in that's not \code{character} or \code{iucn} class - a \code{iucn_summary.character} method for when you pass in taxon names - and a \code{iucn_summary.iucn} method so you can pass in iucn class objects as output from \code{\link{get_iucn}} or \code{\link{as.iucn}}. If you already have IUCN IDs, coerce them to \code{iucn} class via \code{as.iucn(..., check = FALSE)} } \note{ Not all entries (history, distr, trend) are available for every species and NA is returned. \code{\link[taxize]{iucn_status}} is an extractor function to easily extract status into a vector. } \section{Redlist Authentication}{ \code{iucn_summary} uses the new Redlist API for searching for a IUCN ID, so we use the \code{\link[rredlist]{rl_search}} function internally. This function requires an API key. Get the key at \url{http://apiv3.iucnredlist.org/api/v3/token}, and pass it to the \code{key} parameter, or store in your \code{.Renviron} file like \code{IUCN_REDLIST_KEY=yourkey} or in your \code{.Rprofile} file like \code{options(iucn_redlist_key="yourkey"}. We strongly encourage you to not pass the key in the function call but rather store it in one of those two files. This key will also set you up to use the \pkg{rredlist} package. } \examples{ \dontrun{ # if you send a taxon name, an IUCN API key is required ## here, the key is being detected from a .Rprofile file ## or .Renviron file, See "Redlist Authentication" above iucn_summary("Lutra lutra") ia <- iucn_summary(c("Panthera uncia", "Lynx lynx")) ia <- iucn_summary(c("Panthera uncia", "Lynx lynx", "aaa")) ## get detailed distribution iac <- iucn_summary(x="Ara chloropterus", distr_detail = TRUE) iac[[1]]$distr # If you pass in an IUCN ID, you don't need to pass in a Redlist API Key ia <- iucn_summary_id(c(22732, 12519)) # extract status iucn_status(ia) # extract other available information ia[['Lynx lynx']]$history ia[['Panthera uncia']]$distr ia[[2]]$trend ## the outputs aren't quite identical, but we're working on it identical( iucn_summary_id(c(22732, 12519)), iucn_summary(as.iucn(c(22732, 12519))) ) # using parallel, e.g., with doMC package, register cores first # library(doMC) # registerDoMC(cores = 2) # nms <- c("Panthera uncia", "Lynx lynx", "Ara chloropterus", "Lutra lutra") # (res <- iucn_summary(nms, parallel = TRUE)) } } \seealso{ \code{\link[taxize]{iucn_status}} } \author{ Eduard Szoecs, \email{eduardszoecs@gmail.com} Philippe Marchand, \email{marchand.philippe@gmail.com} Scott Chamberlain, \email{myrmecocystus@gmail.com} } taxize/man/fungorum.Rd0000644000176200001440000000341213057575430014473 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/fungorum.R \name{fungorum} \alias{fungorum} \alias{fg_name_search} \alias{fg_author_search} \alias{fg_epithet_search} \alias{fg_name_by_key} \alias{fg_name_full_by_lsid} \alias{fg_all_updated_names} \alias{fg_deprecated_names} \title{Index Fungorum} \usage{ fg_name_search(q, anywhere = TRUE, limit = 10, ...) fg_author_search(q, anywhere = TRUE, limit = 10, ...) fg_epithet_search(q, anywhere = TRUE, limit = 10, ...) fg_name_by_key(key, ...) fg_name_full_by_lsid(lsid, ...) fg_all_updated_names(date, ...) fg_deprecated_names(date, ...) } \arguments{ \item{q}{(character) Query term} \item{anywhere}{(logical) Default: \code{TRUE}} \item{limit}{(integer) Number of results to return. max limit value appears to be 6000, not positive about that though} \item{...}{Curl options passed on to \code{\link[httr]{GET}}} \item{key}{(character) A IndexFungorum taxon key} \item{lsid}{(character) an LSID, e.,g. "urn:lsid:indexfungorum.org:names:81085"} \item{date}{(character) Date, of the form YYYMMDD} } \value{ A \code{data.frame}, or \code{NULL} if no results } \description{ Search for taxonomic names in Index Fungorum } \examples{ \dontrun{ # NameSearch fg_name_search(q = "Gymnopus", limit = 2) fg_name_search(q = "Gymnopus") # EpithetSearch fg_epithet_search(q = "phalloides") # NameByKey fg_name_by_key(17703) # NameFullByKey fg_name_full_by_lsid("urn:lsid:indexfungorum.org:names:81085") # AllUpdatedNames fg_all_updated_names(date = gsub("-", "", Sys.Date() - 2)) # DeprecatedNames fg_deprecated_names(date=20151001) # AuthorSearch fg_author_search(q = "Fayod", limit = 2) } } \references{ \url{http://www.indexfungorum.org/}, API docs: \url{http://www.indexfungorum.org/ixfwebservice/fungus.asmx} } taxize/man/tax_agg.Rd0000644000176200001440000000574313060060133014233 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/tax_agg.R \name{tax_agg} \alias{tax_agg} \alias{print.tax_agg} \title{Aggregate species data to given taxonomic rank} \usage{ tax_agg(x, rank, db = "ncbi", verbose = FALSE, ...) \method{print}{tax_agg}(x, ...) } \arguments{ \item{x}{Community data matrix. Taxa in columns, samples in rows.} \item{rank}{character; Taxonomic rank to aggregate by.} \item{db}{character; taxonomic API to use, 'ncbi, 'itis' or both, see \code{\link[taxize]{tax_name}}. Note that each taxonomic data source has their own identifiers, so that if you provide the wrong \code{db} value for the identifier you could get a result, but it will likely be wrong (not what you were expecting).} \item{verbose}{(logical) If FALSE (Default) suppress messages} \item{...}{Other arguments passed to \code{\link[taxize]{get_tsn}} or \code{\link[taxize]{get_uid}}.} } \value{ A list of class \code{tax_agg} with the following items: \item{x}{Community data matrix with aggregated data.} \item{by}{A lookup-table showing which taxa were aggregated.} \item{n_pre}{Number of taxa before aggregation.} \item{rank}{Rank at which taxa have been aggregated.} } \description{ Aggregate species data to given taxonomic rank } \details{ \code{tax_agg} aggregates (sum) taxa to a specific taxonomic level. If a taxon is not found in the database (ITIS or NCBI) or the supplied taxon is on higher taxonomic level this taxon is not aggregated. } \examples{ \dontrun{ if (requireNamespace("vegan", quietly = TRUE)) { # use dune dataset library("vegan") data(dune, package='vegan') species <- c("Bellis perennis", "Empetrum nigrum", "Juncus bufonius", "Juncus articulatus", "Aira praecox", "Eleocharis parvula", "Rumex acetosa", "Vicia lathyroides", "Brachythecium rutabulum", "Ranunculus flammula", "Cirsium arvense", "Hypochaeris radicata", "Leontodon autumnalis", "Potentilla palustris", "Poa pratensis", "Calliergonella cuspidata", "Trifolium pratense", "Trifolium repens", "Anthoxanthum odoratum", "Salix repens", "Achillea millefolium", "Poa trivialis", "Chenopodium album", "Elymus repens", "Sagina procumbens", "Plantago lanceolata", "Agrostis stolonifera", "Lolium perenne", "Alopecurus geniculatus", "Bromus hordeaceus") colnames(dune) <- species # aggregate sample to families (agg <- tax_agg(dune, rank = 'family', db = 'ncbi')) # extract aggregated community data matrix for further usage agg$x # check which taxa have been aggregated agg$by } # A use case where there are different taxonomic levels in the same dataset spnames <- c('Puma','Ursus americanus','Ursidae') df <- data.frame(c(1,2,3), c(11,12,13), c(1,4,50)) names(df) <- spnames out <- tax_agg(df, rank = 'family', db='itis') out$x # You can input a matrix too mat <- matrix(c(1,2,3, 11,12,13), nrow = 2, ncol = 3, dimnames=list(NULL, c('Puma concolor','Ursus americanus','Ailuropoda melanoleuca'))) tax_agg(mat, rank = 'family', db='itis') } } \seealso{ \code{\link[taxize]{tax_name}} } taxize/man/col_search.Rd0000644000176200001440000000467713057575430014751 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/col_search.R \name{col_search} \alias{col_search} \title{Search Catalogue of Life for taxonomic IDs} \usage{ col_search(name = NULL, id = NULL, start = NULL, checklist = NULL, response = "terse", ...) } \arguments{ \item{name}{The string to search for. Only exact matches found the name given will be returned, unless one or wildcards are included in the search string. An * (asterisk) character denotes a wildcard; a % (percentage) character may also be used. The name must be at least 3 characters long, not counting wildcard characters.} \item{id}{The record ID of the specific record to return (only for scientific names of species or infraspecific taxa)} \item{start}{The first record to return. If omitted, the results are returned from the first record (start=0). This is useful if the total number of results is larger than the maximum number of results returned by a single Web service query (currently the maximum number of results returned by a single query is 500 for terse queries and 50 for full queries).} \item{checklist}{The year of the checklist to query, if you want a specific year's checklist instead of the lastest as default (numeric).} \item{response}{(character) one of "terse" or "full"} \item{...}{Curl options passed on to \code{\link[httr]{GET}}} } \value{ A list of data.frame's. } \description{ Search Catalogue of Life for taxonomic IDs } \details{ You must provide one of name or id. The other parameters (format and start) are optional. } \examples{ \dontrun{ # A basic example col_search(name="Apis") col_search(name="Agapostemon") col_search(name="Poa") # Get full response, i.e., more data col_search(name="Apis", response="full") col_search(name="Poa", response="full") # Many names col_search(name=c("Apis","Puma concolor")) col_search(name=c("Apis","Puma concolor"), response = "full") # An example where there is no data col_search(id = "36c623ad9e3da39c2e978fa3576ad415") col_search(id = "36c623ad9e3da39c2e978fa3576ad415", response = "full") col_search(id = "787ce23969f5188c2467126d9a545be1") col_search(id = "787ce23969f5188c2467126d9a545be1", response = "full") col_search(id = c("36c623ad9e3da39c2e978fa3576ad415", "787ce23969f5188c2467126d9a545be1")) ## a synonym col_search(id = "f726bdaa5924cabf8581f99889de51fc") col_search(id = "f726bdaa5924cabf8581f99889de51fc", response = "full") } } \references{ \url{http://webservice.catalogueoflife.org/} } taxize/man/phylomatic_format-defunct.Rd0000644000176200001440000000063213057575431020002 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/phylomatic_format.R \name{phylomatic_format} \alias{phylomatic_format} \title{Get family names to make Phylomatic input object, and output input string to Phylomatic for use in the function phylomatic_tree.} \usage{ phylomatic_format(...) } \arguments{ \item{...}{Parameters, ignored} } \description{ THIS FUNCTION IS DEFUNCT. } taxize/man/apg.Rd0000644000176200001440000000104113057575430013374 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/apg.R \name{apg} \alias{apg} \alias{apgOrders} \alias{apgFamilies} \title{Get APG names} \usage{ apgOrders(...) apgFamilies(...) } \arguments{ \item{...}{Curl args passed on to \code{\link[httr]{GET}}} } \description{ Generic names and their replacements from the Angiosperm Phylogeny Group III system of flowering plant classification. } \examples{ \dontrun{ head(apgOrders()) head(apgFamilies()) } } \references{ \url{http://www.mobot.org/MOBOT/research/APweb/} } taxize/man/itis_getrecord.Rd0000644000176200001440000000145513125023405015626 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/itis_getrecord.R \name{itis_getrecord} \alias{itis_getrecord} \title{Get full ITIS record for one or more ITIS TSN's or lsid's.} \usage{ itis_getrecord(values, by = "tsn", ...) } \arguments{ \item{values}{(character) One or more TSN's (taxonomic serial number) or lsid's for a taxonomic group} \item{by}{(character) By "tsn" (default) or "lsid"} \item{...}{Further arguments passed on to \code{\link[ritis]{full_record}}} } \description{ Get full ITIS record for one or more ITIS TSN's or lsid's. } \details{ You can only enter values in tsn parameter or lsid, not both. } \examples{ \dontrun{ # by TSN itis_getrecord(202385) itis_getrecord(c(202385,70340)) # by lsid itis_getrecord("urn:lsid:itis.gov:itis_tsn:202385", "lsid") } } taxize/man/ncbi_get_taxon_summary.Rd0000644000176200001440000000241113057575431017370 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ncbi_get_taxon_summary.R \name{ncbi_get_taxon_summary} \alias{ncbi_get_taxon_summary} \title{NCBI taxon information from uids} \usage{ ncbi_get_taxon_summary(id, ...) } \arguments{ \item{id}{(character) NCBI taxonomy uids to retrieve information for. See Details.} \item{...}{Curl options passed on to \code{\link[httr]{GET}}} } \value{ A \code{data.frame} with the following columns: \describe{ \item{uid}{The uid queried for} \item{name}{The name of the taxon; a binomial name if the taxon is of rank species} \item{rank}{The taxonomic rank (e.g. 'Genus')} } } \description{ Downloads summary taxon information from the NCBI taxonomy databases for a set of taxonomy UIDs using eutils esummary. } \details{ If your input vector or list of NCBI IDs is longer than about 8000 characters (use \code{nchar(paste(ids, collapse = "+"))}), split the list up into chunks since at about that number of characters you will run into the HTTP 414 error "Request-URI Too Long". } \examples{ \dontrun{ ncbi_get_taxon_summary(c(1430660, 4751)) # use curl options library("httr") ncbi_get_taxon_summary(c(1430660, 4751), config = verbose()) } } \author{ Zachary Foster \email{zacharyfoster1989@Sgmail.com} } taxize/man/get_natservid.Rd0000644000176200001440000001170713160563500015463 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_natservid.R \name{get_natservid} \alias{get_natservid} \alias{as.natservid} \alias{as.natservid.natservid} \alias{as.natservid.character} \alias{as.natservid.list} \alias{as.natservid.numeric} \alias{as.natservid.data.frame} \alias{as.data.frame.natservid} \alias{get_natservid_} \title{Get NatureServe taxonomic ID for a taxon name} \usage{ get_natservid(query, searchtype = "scientific", ask = TRUE, verbose = TRUE, rows = NA, key = NULL, ...) as.natservid(x, check = TRUE) \method{as.natservid}{natservid}(x, check = TRUE) \method{as.natservid}{character}(x, check = TRUE) \method{as.natservid}{list}(x, check = TRUE) \method{as.natservid}{numeric}(x, check = TRUE) \method{as.natservid}{data.frame}(x, check = TRUE) \method{as.data.frame}{natservid}(x, ...) get_natservid_(query, verbose = TRUE, rows = NA, key = NULL, ...) } \arguments{ \item{query}{character; A vector of common or scientific names.} \item{searchtype}{character; One of 'scientific' (default) or 'common'. This doesn't affect the query to NatureServe - but rather affects what column of data is targeted in name filtering post data request.} \item{ask}{logical; should get_natservid be run in interactive mode? If \code{TRUE} and more than one wormsid is found for the species, the user is asked for input. If \code{FALSE} NA is returned for multiple matches.} \item{verbose}{logical; should progress be printed?} \item{rows}{numeric; Any number from 1 to infinity. If the default NaN, all rows are considered. Note that this function still only gives back a natservid class object with one to many identifiers. See \code{\link[taxize]{get_natservid_}} to get back all, or a subset, of the raw data that you are presented during the ask process.} \item{key}{(character) your NatureServe API key. Required. See \strong{Authentication} below for more.} \item{...}{Ignored} \item{x}{Input to as.natservid} \item{check}{logical; Check if ID matches any existing on the DB, only used in \code{\link{as.natservid}}} } \value{ A vector of taxonomic identifiers as an S3 class. If a taxon is not found an \code{NA} is given. If more than one identifier is found the function asks for user input if \code{ask = TRUE}, otherwise returns \code{NA}. If \code{ask=FALSE} and \code{rows} does not equal \code{NA}, then a data.frame is given back, but not of the uid class, which you can't pass on to other functions as you normally can. See \code{\link{get_id_details}} for further details including attributes and exceptions } \description{ Get NatureServe taxonomic ID for a taxon name } \section{Authentication}{ Get an API key from NatureServe at \url{https://services.natureserve.org/developer/index.jsp}. You can pass your token in as an argument or store it one of two places: \itemize{ \item your .Rprofile file with an entry like \code{options(NatureServeKey = "your-natureserve-key")} \item your .Renviron file with an entry like \code{NATURE_SERVE_KEY=your-natureserve-key} } See \code{\link{Startup}} for information on how to create/find your .Rprofile and .Renviron files } \examples{ \dontrun{ (x <- get_natservid("Helianthus annuus")) attributes(x) attr(x, "match") attr(x, "multiple_matches") attr(x, "pattern_match") attr(x, "uri") get_natservid('Gadus morhua') get_natservid(c("Helianthus annuus", 'Gadus morhua')) # specify rows to limit choices available get_natservid('Ruby Quaker Moth', 'common') get_natservid('Ruby*', 'common') get_natservid('Ruby*', 'common', rows=1) get_natservid('Ruby*', 'common', rows=1:2) # When not found get_natservid("howdy") get_natservid(c('Gadus morhua', "howdy")) # Convert a natservid without class information to a natservid class # already a natservid, returns the same as.natservid(get_natservid('Gadus morhua')) # same as.natservid(get_natservid(c('Gadus morhua', 'Pomatomus saltatrix'))) # character as.natservid("ELEMENT_GLOBAL.2.101905") # character vector, length > 1 as.natservid(c("ELEMENT_GLOBAL.2.101905", "ELEMENT_GLOBAL.2.101998")) # list, either numeric or character as.natservid(list("ELEMENT_GLOBAL.2.101905", "ELEMENT_GLOBAL.2.101998")) ## dont check, much faster as.natservid("ELEMENT_GLOBAL.2.101905", check = FALSE) as.natservid(c("ELEMENT_GLOBAL.2.101905", "ELEMENT_GLOBAL.2.101998"), check = FALSE) as.natservid(list("ELEMENT_GLOBAL.2.101905", "ELEMENT_GLOBAL.2.101998"), check = FALSE) (out <- as.natservid( c("ELEMENT_GLOBAL.2.101905", "ELEMENT_GLOBAL.2.101998"))) data.frame(out) as.natservid( data.frame(out) ) # Get all data back get_natservid_("Ruby*") get_natservid_("Ruby*", rows=1:3) } } \seealso{ \code{\link[taxize]{classification}} Other taxonomic-ids: \code{\link{get_boldid}}, \code{\link{get_colid}}, \code{\link{get_eolid}}, \code{\link{get_gbifid}}, \code{\link{get_ids}}, \code{\link{get_iucn}}, \code{\link{get_nbnid}}, \code{\link{get_tolid}}, \code{\link{get_tpsid}}, \code{\link{get_tsn}}, \code{\link{get_uid}}, \code{\link{get_wiki}}, \code{\link{get_wormsid}} } taxize/man/tp_search.Rd0000644000176200001440000000350413057575431014604 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/tp_search.R \name{tp_search} \alias{tp_search} \title{Search Tropicos by scientific name, common name, or Tropicos ID.} \usage{ tp_search(name = NULL, commonname = NULL, nameid = NULL, orderby = NULL, sortorder = NULL, pagesize = NULL, startrow = NULL, type = NULL, key = NULL, ...) } \arguments{ \item{name}{Your search string. For instance "poa annua". See Details.} \item{commonname}{Your search string. For instance "annual blue grass"} \item{nameid}{Your search string. For instance "25509881"} \item{orderby}{Your search string. For instance "1"} \item{sortorder}{Your search string. For instance "ascending"} \item{pagesize}{Your search string. For instance "100"} \item{startrow}{Your search string. For instance "1"} \item{type}{Type of search, "wildcard" (default) will add a wildcard to the end of your search string. "exact" will use your search string exactly.} \item{key}{Your Tropicos API key; loads from .Rprofile.} \item{...}{Further args passed on to \code{\link[httr]{GET}}} } \value{ List or dataframe. } \description{ Search Tropicos by scientific name, common name, or Tropicos ID. } \details{ More details on the \code{name} parameter: Tropicos will fail if you include a period (\code{.}) in your name string, e.g., \code{var.}, so we replace periods before the request is made to the Tropicos web service. In addition, Tropicos for some reason doesn't want to see sub-specific rank names like \code{var}/\code{subsp}, so remove those from your query. } \examples{ \dontrun{ tp_search(name = 'Poa annua') tp_search(name = 'Poa annua subsp. annua') tp_search(name = 'Poa annua var. annua') tp_search(name = 'Poa annua var annua') tp_search(name = 'Poa annua annua') } } \references{ \url{http://services.tropicos.org/help?method=SearchNameXml} } taxize/man/iplant_resolve.Rd0000644000176200001440000000150513057575431015661 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/iplant_resolve.R \name{iplant_resolve} \alias{iplant_resolve} \title{iPlant name resolution} \usage{ iplant_resolve(query, retrieve = "all", ...) } \arguments{ \item{query}{Vector of one or more taxonomic names. (no common names)} \item{retrieve}{Specifies whether to retrieve all matches for the names submitted. One of 'best' (retrieves only the single best match for each name submitted) or 'all' (retrieves all matches)} \item{...}{Curl options passed on to \code{\link[httr]{GET}}} } \value{ A data.frame } \description{ iPlant name resolution } \examples{ \dontrun{ iplant_resolve(query=c("Helianthus annuus", "Homo sapiens")) iplant_resolve("Helianthusss") iplant_resolve("Pooa") library("httr") iplant_resolve("Helianthusss", config=verbose()) } } taxize/man/sci2comm.Rd0000644000176200001440000000576613142671010014345 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/sci2comm.R \name{sci2comm} \alias{sci2comm} \alias{sci2comm.default} \alias{sci2comm.uid} \alias{sci2comm.tsn} \alias{sci2comm.wormsid} \alias{sci2comm.iucn} \title{Get common names from scientific names.} \usage{ sci2comm(...) \method{sci2comm}{default}(scinames, db = "eol", simplify = TRUE, ...) \method{sci2comm}{uid}(id, ...) \method{sci2comm}{tsn}(id, simplify = TRUE, ...) \method{sci2comm}{wormsid}(id, simplify = TRUE, ...) \method{sci2comm}{iucn}(id, simplify = TRUE, ...) } \arguments{ \item{...}{Further arguments passed on to functions \code{\link[taxize]{get_uid}}, \code{\link[taxize]{get_tsn}}.} \item{scinames}{character; One or more scientific names or partial names.} \item{db}{character; Data source, one of \emph{"eol"} (default), \emph{"itis"} \emph{"ncbi"}, \emph{"worms"}, or \emph{"iucn"}. Note that each taxonomic data source has their own identifiers, so that if you provide the wrong \code{db} value for the identifier you could get a result, but it will likely be wrong (not what you were expecting).} \item{simplify}{(logical) If TRUE, simplify output to a vector of names. If FALSE, return variable formats from different sources, usually a data.frame. Only applies to eol and itis. Specify \code{FALSE} to obtain the language of each vernacular in the output for eol and itis.} \item{id}{character; identifiers, as returned by \code{\link[taxize]{get_tsn}}, \code{\link[taxize]{get_uid}}.} } \value{ List of character vectors, named by input taxon name, or taxon ID } \description{ Get common names from scientific names. } \details{ Note that EOL requires an API key. You can pass in your EOL api key in the function call like \code{sci2comm('Helianthus annuus', key="")}. You can also store your EOL API key in your .Rprofile file as \code{options(eolApiKey = "")}, or just for the current session by running \code{options(eolApiKey = "")} in the console. Note that IUCN also requires an API key. See \code{\link[rredlist]{rredlist-package}} for help on authentiating with IUCN Redlist } \examples{ \dontrun{ sci2comm(scinames='Helianthus annuus', db='eol') sci2comm(scinames='Helianthus annuus', db='itis') sci2comm(scinames=c('Helianthus annuus', 'Poa annua')) sci2comm(scinames='Puma concolor', db='ncbi') sci2comm('Gadus morhua', db='worms') sci2comm('Pomatomus saltatrix', db='worms') sci2comm('Loxodonta africana', db='iucn') # Passing id in, works for sources: itis and ncbi, not eol sci2comm(get_tsn('Helianthus annuus')) sci2comm(get_uid('Helianthus annuus')) sci2comm(get_wormsid('Gadus morhua')) sci2comm(get_iucn('Loxodonta africana')) # Don't simplify returned sci2comm(get_tsn('Helianthus annuus'), simplify=FALSE) sci2comm(get_iucn('Loxodonta africana'), simplify=FALSE) # Use curl options library("httr") sci2comm('Helianthus annuus', db="ncbi", config=verbose()) } } \seealso{ \code{\link[taxize]{comm2sci}} } \author{ Scott Chamberlain (myrmecocystus@gmail.com) } taxize/man/children.Rd0000644000176200001440000000573713160564347014435 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/children.R \name{children} \alias{children} \alias{children.default} \alias{children.tsn} \alias{children.colid} \alias{children.wormsid} \alias{children.ids} \alias{children.uid} \title{Retrieve immediate children taxa for a given taxon name or ID.} \usage{ children(...) \method{children}{default}(x, db = NULL, rows = NA, ...) \method{children}{tsn}(x, db = NULL, ...) \method{children}{colid}(x, db = NULL, ...) \method{children}{wormsid}(x, db = NULL, ...) \method{children}{ids}(x, db = NULL, ...) \method{children}{uid}(x, db = NULL, ...) } \arguments{ \item{...}{Further args passed on to \code{\link{col_children}}, \code{\link[ritis]{hierarchy_down}}, \code{\link{ncbi_children}}, or \code{\link[worrms]{wm_children}} See those functions for what parameters can be passed on.} \item{x}{Vector of taxa names (character) or IDs (character or numeric) to query.} \item{db}{character; database to query. One or more of \code{itis}, \code{col}, \code{ncbi}, or \code{worms}. Note that each taxonomic data source has their own identifiers, so that if you provide the wrong \code{db} value for the identifier you could get a result, but it will likely be wrong (not what you were expecting).} \item{rows}{(numeric) Any number from 1 to infinity. If the default NA, all rows are considered. Note that this parameter is ignored if you pass in a taxonomic id of any of the acceptable classes: tsn, colid. NCBI has a method for this function but rows doesn't work.} } \value{ A named list of data.frames with the children names of every supplied taxa. You get an NA if there was no match in the database. } \description{ This function is different from \code{\link{downstream}} in that it only collects immediate taxonomic children, while \code{\link{downstream}} collects taxonomic names down to a specified taxonomic rank, e.g., getting all species in a family. } \examples{ \dontrun{ # Plug in taxonomic IDs children(161994, db = "itis") children(8028, db = "ncbi") children("578cbfd2674a9b589f19af71a33b89b6", db = "col") ## works with numeric if as character as well children("161994", db = "itis") # Plug in taxon names children("Salmo", db = 'col') children("Salmo", db = 'itis') children("Salmo", db = 'ncbi') children("Salmo", db = 'worms') # Plug in IDs (id <- get_colid("Apis")) children(id) (id <- get_wormsid("Platanista")) children(id) ## Equivalently, plug in the call to get the id via e.g., get_colid ## into children (id <- get_colid("Apis")) children(id) children(get_colid("Apis")) # Many taxa sp <- c("Tragia", "Schistocarpha", "Encalypta") children(sp, db = 'col') children(sp, db = 'itis') # Two data sources (ids <- get_ids("Apis", db = c('col','itis'))) children(ids) ## same result children(get_ids("Apis", db = c('col','itis'))) # Use the rows parameter children("Poa", db = 'col') children("Poa", db = 'col', rows=1) # use curl options library("httr") res <- children("Poa", db = 'col', rows=1, config=verbose()) } } taxize/man/get_tpsid.Rd0000644000176200001440000001355613160514701014612 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_tpsid.R \name{get_tpsid} \alias{get_tpsid} \alias{as.tpsid} \alias{as.tpsid.tpsid} \alias{as.tpsid.character} \alias{as.tpsid.list} \alias{as.tpsid.numeric} \alias{as.tpsid.data.frame} \alias{as.data.frame.tpsid} \alias{get_tpsid_} \title{Get the NameID codes from Tropicos for taxonomic names.} \usage{ get_tpsid(sciname, ask = TRUE, verbose = TRUE, key = NULL, rows = NA, family = NULL, rank = NULL, ...) as.tpsid(x, check = TRUE) \method{as.tpsid}{tpsid}(x, check = TRUE) \method{as.tpsid}{character}(x, check = TRUE) \method{as.tpsid}{list}(x, check = TRUE) \method{as.tpsid}{numeric}(x, check = TRUE) \method{as.tpsid}{data.frame}(x, check = TRUE) \method{as.data.frame}{tpsid}(x, ...) get_tpsid_(sciname, verbose = TRUE, key = NULL, rows = NA, ...) } \arguments{ \item{sciname}{(character) One or more scientific name's as a vector or list.} \item{ask}{logical; should get_tpsid be run in interactive mode? If TRUE and more than one ID is found for the species, the user is asked for input. If FALSE NA is returned for multiple matches.} \item{verbose}{logical; If TRUE the actual taxon queried is printed on the console.} \item{key}{Your API key; loads from .Rprofile.} \item{rows}{numeric; Any number from 1 to infinity. If the default NA, all rows are considered. Note that this function still only gives back a tpsid class object with one to many identifiers. See \code{\link[taxize]{get_tpsid_}} to get back all, or a subset, of the raw data that you are presented during the ask process.} \item{family}{(character) A family name. Optional. See \code{Filtering} below.} \item{rank}{(character) A taxonomic rank name. See \code{\link{rank_ref}} for possible options. Though note that some data sources use atypical ranks, so inspect the data itself for options. Optional. See \code{Filtering} below.} \item{...}{Other arguments passed to \code{\link[taxize]{tp_search}}.} \item{x}{Input to \code{\link{as.tpsid}}} \item{check}{logical; Check if ID matches any existing on the DB, only used in \code{\link{as.tpsid}}} } \value{ A vector of taxonomic identifiers as an S3 class. If a taxon is not found an \code{NA} is given. If more than one identifier is found the function asks for user input if \code{ask = TRUE}, otherwise returns \code{NA}. If \code{ask=FALSE} and \code{rows} does not equal \code{NA}, then a data.frame is given back, but not of the uid class, which you can't pass on to other functions as you normally can. See \code{\link{get_id_details}} for further details including attributes and exceptions } \description{ Get the NameID codes from Tropicos for taxonomic names. } \section{Filtering}{ The parameters \code{family} and \code{rank} are not used in the search to the data provider, but are used in filtering the data down to a subset that is closer to the target you want. For all these parameters, you can use regex strings since we use \code{\link{grep}} internally to match. Filtering narrows down to the set that matches your query, and removes the rest. } \examples{ \dontrun{ get_tpsid(sciname='Poa annua') get_tpsid(sciname='Pinus contorta') get_tpsid(c("Poa annua", "Pinus contorta")) # specify rows to limit choices available get_tpsid('Poa annua') get_tpsid('Poa annua', rows=1) get_tpsid('Poa annua', rows=25) get_tpsid('Poa annua', rows=1:2) # When not found, NA given (howdy is not a species name, and Chrinomus is a fly) get_tpsid("howdy") get_tpsid(c("Chironomus riparius", "howdy")) # Narrow down results to a division or rank, or both ## Satyrium example ### Results w/o narrowing get_tpsid("Satyrium") ### w/ rank get_tpsid("Satyrium", rank = "var.") get_tpsid("Satyrium", rank = "sp.") ## w/ family get_tpsid("Poa") get_tpsid("Poa", family = "Iridaceae") get_tpsid("Poa", family = "Orchidaceae") get_tpsid("Poa", family = "Orchidaceae", rank = "gen.") # Fuzzy filter on any filtering fields ## uses grep on the inside get_tpsid("Poa", family = "orchidaceae") get_tpsid("Aga", fuzzy = TRUE, parent = "*idae") # pass to classification function to get a taxonomic hierarchy classification(get_tpsid(sciname='Poa annua')) # factor class names are converted to character internally spnames <- as.factor(c("Poa annua", "Pinus contorta")) class(spnames) get_tpsid(spnames) # pass in a list, works fine get_tpsid(list("Poa annua", "Pinus contorta")) # Convert a tpsid without class information to a tpsid class as.tpsid(get_tpsid("Pinus contorta")) # already a tpsid, returns the same as.tpsid(get_tpsid(c("Chironomus riparius","Pinus contorta"))) # same as.tpsid(24900183) # numeric as.tpsid(c(24900183,50150089,50079838)) # numeric vector, length > 1 as.tpsid("24900183") # character as.tpsid(c("24900183","50150089","50079838")) # character vector, length > 1 as.tpsid(list("24900183","50150089","50079838")) # list, either numeric or character ## dont check, much faster as.tpsid("24900183", check=FALSE) as.tpsid(24900183, check=FALSE) as.tpsid(c("24900183","50150089","50079838"), check=FALSE) as.tpsid(list("24900183","50150089","50079838"), check=FALSE) (out <- as.tpsid(c(24900183,50150089,50079838))) data.frame(out) as.tpsid( data.frame(out) ) # Get all data back get_tpsid_("Poa annua") get_tpsid_("Poa annua", rows=2) get_tpsid_("Poa annua", rows=1:2) get_tpsid_(c("asdfadfasd","Pinus contorta"), rows=1:5) # use curl options library("httr") get_tpsid("Quercus douglasii", config=verbose()) bb <- get_tpsid("Quercus douglasii", config=progress()) } } \seealso{ \code{\link[taxize]{classification}} Other taxonomic-ids: \code{\link{get_boldid}}, \code{\link{get_colid}}, \code{\link{get_eolid}}, \code{\link{get_gbifid}}, \code{\link{get_ids}}, \code{\link{get_iucn}}, \code{\link{get_natservid}}, \code{\link{get_nbnid}}, \code{\link{get_tolid}}, \code{\link{get_tsn}}, \code{\link{get_uid}}, \code{\link{get_wiki}}, \code{\link{get_wormsid}} } \author{ Scott Chamberlain, \email{myrmecocystus@gmail.com} } taxize/man/tnrs.Rd0000644000176200001440000000670213125002171013603 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/tnrs.R \name{tnrs} \alias{tnrs} \title{Phylotastic Taxonomic Name Resolution Service.} \usage{ tnrs(query = NA, source = NULL, code = NULL, getpost = "POST", sleep = 0, splitby = 30, verbose = TRUE, ...) } \arguments{ \item{query}{Vector of quoted taxonomic names to search (character).} \item{source}{Specify the source you want to match names against. Defaults to just retrieve data from all sources. Options: NCBI, iPlant_TNRS, or MSW3. Only available when using getpost="POST".} \item{code}{Nomenclatural code. One of: ICZN (zoological), ICN (algae, fungi, and plants), ICNB (bacteria), ICBN (botanical), ICNCP (cultivated plants), ICTV (viruses). Only available when using getpost="POST".} \item{getpost}{Use GET or POST method to send the query. If you have more than say 50 species or so in your query, you should probably use POST. IMPORTANT!!!!! -> POST is the only option for this parameter if you want to use source or code parameters.} \item{sleep}{Number of seconds by which to pause between calls. Defaults to 0 seconds. Use when doing many calls in a for loop ar lapply type call.} \item{splitby}{Number by which to split species list for querying the TNRS.} \item{verbose}{Verbosity or not (default \code{TRUE})} \item{...}{Curl options to pass in \code{\link[httr]{GET}} or \code{\link[httr]{POST}}} } \value{ data.frame of results from TNRS plus the name submitted, with rows in order of user supplied names, though those with no matches are dropped } \description{ Match taxonomic names using the Taxonomic Name Resolution Service (TNRS). Returns score of the matched name, and whether it was accepted or not. } \details{ If there is no match in the Taxosaurus database, nothing is returned, so you will not get anything back for non-matches. TNRS doesn't provide any advice about the occurrence of homonyms when queries have no indication of a taxonomic name's authority. So if there is any chance of a homonym, you probably want to send the authority as well, or use \code{\link{gnr_resolve}}. For example, \code{tnrs(query="Jussiaea linearis", source="iPlant_TNRS")} gives result of \emph{Jussiaea linearis (Willd.) Oliv. ex Kuntze}, but there is a homonym. If you do \code{tnrs(query="Jussiaea linearis Hochst.", source="iPlant_TNRS")} you get a direct match for that name. So, beware that there's no indication of homonyms. } \examples{ \dontrun{ mynames <- c("Helianthus annuus", "Poa annua", "Mimulus bicolor") tnrs(query = mynames, source = "iPlant_TNRS") # Specifying the nomenclatural code to match against mynames <- c("Helianthus annuus", "Poa annua") tnrs(query = mynames, code = "ICBN") # You can specify multiple sources, by comma-separating them mynames <- c("Panthera tigris", "Eutamias minimus", "Magnifera indica", "Humbert humbert") tnrs(query = mynames, source = "NCBI,MSW3") mynames <- c("Panthera tigris", "Eutamias minimus", "Magnifera indica", "Humbert humbert", "Helianthus annuus", "Pinus contorta", "Poa annua", "Abies magnifica", "Rosa california", "Festuca arundinace", "Mimulus bicolor", "Sorbus occidentalis","Madia sativa", "Thymopsis thymodes", "Bartlettia scaposa") tnrs(mynames, source = "NCBI") # Pass on curl options library("httr") mynames <- c("Helianthus annuus", "Poa annua", "Mimulus bicolor") tnrs(query = mynames, source = "iPlant_TNRS", config = verbose()) } } \references{ \url{http://taxosaurus.org/} } \seealso{ \code{\link{gnr_resolve}} } taxize/man/get_tsn.Rd0000644000176200001440000001037113160514701014263 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_tsn.R \name{get_tsn} \alias{get_tsn} \alias{as.tsn} \alias{as.tsn.tsn} \alias{as.tsn.character} \alias{as.tsn.list} \alias{as.tsn.numeric} \alias{as.tsn.data.frame} \alias{as.data.frame.tsn} \alias{get_tsn_} \title{Get the TSN code for a search term.} \usage{ get_tsn(searchterm, searchtype = "scientific", accepted = FALSE, ask = TRUE, verbose = TRUE, rows = NA, ...) as.tsn(x, check = TRUE) \method{as.tsn}{tsn}(x, check = TRUE) \method{as.tsn}{character}(x, check = TRUE) \method{as.tsn}{list}(x, check = TRUE) \method{as.tsn}{numeric}(x, check = TRUE) \method{as.tsn}{data.frame}(x, check = TRUE) \method{as.data.frame}{tsn}(x, ...) get_tsn_(searchterm, verbose = TRUE, searchtype = "scientific", accepted = TRUE, rows = NA, ...) } \arguments{ \item{searchterm}{character; A vector of common or scientific names.} \item{searchtype}{character; One of 'scientific' or 'common', or any unique abbreviation} \item{accepted}{logical; If TRUE, removes names that are not accepted valid names by ITIS. Set to \code{FALSE} (default) to give back both accepted and unaccepted names.} \item{ask}{logical; should get_tsn be run in interactive mode? If \code{TRUE} and more than one TSN is found for the species, the user is asked for input. If \code{FALSE} NA is returned for multiple matches.} \item{verbose}{logical; should progress be printed?} \item{rows}{numeric; Any number from 1 to infinity. If the default NA, all rows are considered. Note that this function still only gives back a tsn class object with one to many identifiers. See \code{\link[taxize]{get_tsn_}} to get back all, or a subset, of the raw data that you are presented during the ask process.} \item{...}{Ignored} \item{x}{Input to as.tsn} \item{check}{logical; Check if ID matches any existing on the DB, only used in \code{\link{as.tsn}}} } \value{ A vector of taxonomic identifiers as an S3 class. If a taxon is not found an \code{NA} is given. If more than one identifier is found the function asks for user input if \code{ask = TRUE}, otherwise returns \code{NA}. If \code{ask=FALSE} and \code{rows} does not equal \code{NA}, then a data.frame is given back, but not of the uid class, which you can't pass on to other functions as you normally can. See \code{\link{get_id_details}} for further details including attributes and exceptions } \description{ Retrieve the taxonomic serial numbers (TSN) of a taxon from ITIS. } \examples{ \dontrun{ get_tsn("Quercus douglasii") get_tsn("Chironomus riparius") get_tsn(c("Chironomus riparius","Quercus douglasii")) splist <- c("annona cherimola", 'annona muricata', "quercus robur", "shorea robusta", "pandanus patina", "oryza sativa", "durio zibethinus") get_tsn(splist, verbose=FALSE) # specify rows to limit choices available get_tsn('Arni') get_tsn('Arni', rows=1) get_tsn('Arni', rows=1:2) # When not found get_tsn("howdy") get_tsn(c("Chironomus riparius", "howdy")) # Using common names get_tsn(searchterm="black bear", searchtype="common") # Convert a tsn without class information to a tsn class as.tsn(get_tsn("Quercus douglasii")) # already a tsn, returns the same as.tsn(get_tsn(c("Chironomus riparius","Pinus contorta"))) # same as.tsn(19322) # numeric as.tsn(c(19322,129313,506198)) # numeric vector, length > 1 as.tsn("19322") # character as.tsn(c("19322","129313","506198")) # character vector, length > 1 as.tsn(list("19322","129313","506198")) # list, either numeric or character ## dont check, much faster as.tsn("19322", check=FALSE) as.tsn(19322, check=FALSE) as.tsn(c("19322","129313","506198"), check=FALSE) as.tsn(list("19322","129313","506198"), check=FALSE) (out <- as.tsn(c(19322,129313,506198))) data.frame(out) as.tsn( data.frame(out) ) # Get all data back get_tsn_("Arni") get_tsn_("Arni", rows=1) get_tsn_("Arni", rows=1:2) get_tsn_(c("asdfadfasd","Pinus contorta"), rows=1:5) } } \seealso{ \code{\link[taxize]{classification}} Other taxonomic-ids: \code{\link{get_boldid}}, \code{\link{get_colid}}, \code{\link{get_eolid}}, \code{\link{get_gbifid}}, \code{\link{get_ids}}, \code{\link{get_iucn}}, \code{\link{get_natservid}}, \code{\link{get_nbnid}}, \code{\link{get_tolid}}, \code{\link{get_tpsid}}, \code{\link{get_uid}}, \code{\link{get_wiki}}, \code{\link{get_wormsid}} } taxize/man/iucn_getname.Rd0000644000176200001440000000221713160566125015265 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/iucn_getname.R \name{iucn_getname} \alias{iucn_getname} \title{Get any matching IUCN species names} \usage{ iucn_getname(name, verbose = TRUE, ...) } \arguments{ \item{name}{character; taxon name} \item{verbose}{logical; should messages be printed?} \item{...}{Further arguments passed on to \code{\link{iucn_summary}}} } \value{ Character vector of names that matched in IUCN } \description{ Get any matching IUCN species names } \details{ Beware: IUCN functions can give back incorrect data. This isn't our fault. We do our best to get you the correct data quickly, but sometimes IUCN gives back the wrong data, and sometimes Global Names gives back the wrong data. We will fix these as soon as possible. In the meantime, just make sure that the data you get back is correct. } \examples{ \dontrun{ iucn_getname(name = "Cyanistes caeruleus") iucn_getname(name = "Panthera uncia") # not found in global names # iucn_getname(name = "Abronia pinsapo") # not found in IUCN search iucn_getname(name = "Acacia allenii") } } \seealso{ \code{\link{iucn_summary}} \code{\link{iucn_status}} } taxize/man/iucn_id.Rd0000644000176200001440000000212213161015007014221 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/iucn_id.R \name{iucn_id} \alias{iucn_id} \title{Get an ID for a IUCN listed taxon} \usage{ iucn_id(sciname, key = NULL, ...) } \arguments{ \item{sciname}{character; Scientific name. Should be cleand and in the format \emph{ }. One or more.} \item{key}{(character) required. you IUCN Redlist API key. See \code{\link[rredlist]{rredlist-package}} for help on authenticating with IUCN Redlist} \item{...}{Curl options passed on to \code{crul::HttpClient}} } \value{ A named list (names are input taxa names) of one or more IUCN IDs. Taxa that aren't found are silently dropped. } \description{ Get an ID for a IUCN listed taxon } \examples{ \dontrun{ iucn_id("Branta canadensis") iucn_id("Branta bernicla") iucn_id("Panthera uncia") iucn_id("Lynx lynx") # many names iucn_id(c("Panthera uncia", "Lynx lynx")) # many names, some not found iucn_id(c("Panthera uncia", "Lynx lynx", "foo bar", "hello world")) # a name not found iucn_id("Foo bar") } } \author{ Scott Chamberlain, \email{myrmecocystus@gmail.com} } taxize/man/ubio_id-defunct.Rd0000644000176200001440000000041213057575431015667 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ubio_id.R \name{ubio_id} \alias{ubio_id} \title{Search uBio by namebank ID.} \usage{ ubio_id(...) } \arguments{ \item{...}{Parameters, ignored} } \description{ THIS FUNCTION IS DEFUNCT. } taxize/man/ubio_ping-defunct.Rd0000644000176200001440000000027213057575431016234 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ping.R \name{ubio_ping} \alias{ubio_ping} \title{uBio ping} \usage{ ubio_ping() } \description{ uBio ping } taxize/man/taxize-package.Rd0000644000176200001440000000601413057575431015530 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/taxize-package.R \docType{package} \name{taxize-package} \alias{taxize-package} \alias{taxize} \title{Taxonomic Information from Around the Web} \description{ This package interacts with a suite of web 'APIs' for taxonomic tasks, such as verifying species names, getting taxonomic hierarchies, and verifying name spelling. } \section{About}{ Allows users to search over many websites for species names (scientific and common) and download up- and downstream taxonomic hierarchical information - and many other things. The functions in the package that hit a specific API have a prefix and suffix separated by an underscore. They follow the format of \code{service_whatitdoes}. For example, \code{gnr_resolve} uses the Global Names Resolver API to resolve species names. General functions in the package that don't hit a specific API don't have two words separated by an underscore, e.g., \code{classification} You need API keys for Encyclopedia of Life (EOL), and Tropicos. } \section{Currently supported APIs}{ \tabular{llc}{ API \tab prefix \tab SOAP? \cr Encyclopedia of Life (EOL) \tab eol \tab FALSE \cr Taxonomic Name Resolution Service \tab tnrs \tab FALSE \cr Integrated Taxonomic Information Service (ITIS) \tab itis \tab FALSE \cr Global Names Resolver (from EOL/GBIF) \tab gnr \tab FALSE \cr Global Names Index (from EOL/GBIF) \tab gni \tab FALSE \cr IUCN Red List \tab iucn \tab FALSE \cr Tropicos (from Missouri Botanical Garden) \tab tp \tab FALSE \cr Theplantlist.org \tab tpl \tab FALSE \cr Catalogue of Life \tab col \tab FALSE \cr National Center for Biotechnology Information \tab ncbi \tab FALSE \cr CANADENSYS Vascan name search API \tab vascan \tab FALSE \cr International Plant Names Index (IPNI) \tab ipni \tab FALSE \cr World Register of Marine Species (WoRMS) \tab worms \tab TRUE \cr Barcode of Life Data Systems (BOLD) \tab bold \tab FALSE \cr Pan-European Species directories Infrastructure (PESI) \tab pesi \tab TRUE \cr Mycobank \tab myco \tab TRUE \cr National Biodiversity Network (UK) \tab nbn \tab FALSE \cr Index Fungorum \tab fg \tab FALSE \cr EU BON \tab eubon \tab FALSE \cr Index of Names (ION) \tab ion \tab FALSE \cr Open Tree of Life (TOL) \tab tol \tab FALSE \cr World Register of Marine Species (WoRMS) \tab worms \tab FALSE \cr NatureServe \tab natserv \tab FALSE \cr } If the source above has a \code{TRUE} in the \code{SOAP?} column, it is not available in this package. They are available from a different package called \strong{taxizesoap}. See the GitHub repo for how to install \url{https://github.com/ropensci/taxizesoap} } \author{ Scott Chamberlain \email{myrmecocystus@gmail.com} Eduard Szoecs \email{eduardszoecs@gmail.com} Zachary Foster \email{zacharyfoster1989@gmail.com} Carl Boettiger \email{cboettig@gmail.com} Karthik Ram \email{karthik@ropensci.org} Ignasi Bartomeus \email{nacho.bartomeus@gmail.com} John Baumgartner \email{johnbb@student.unimelb.edu.au} James O'Donnell \email{jodonnellbio@gmail.com} } \keyword{package} taxize/man/gbif_name_usage.Rd0000644000176200001440000000402713057575430015727 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/gbif_name_usage.R \name{gbif_name_usage} \alias{gbif_name_usage} \title{Lookup details for specific names in all taxonomies in GBIF.} \usage{ gbif_name_usage(key = NULL, name = NULL, data = "all", language = NULL, datasetKey = NULL, uuid = NULL, sourceId = NULL, rank = NULL, shortname = NULL, start = NULL, limit = 20, ...) } \arguments{ \item{key}{(numeric) A GBIF key for a taxon} \item{name}{(character) Filters by a case insensitive, canonical namestring, e.g. 'Puma concolor'} \item{data}{(character) Specify an option to select what data is returned. See Description below.} \item{language}{(character) Language, default is english} \item{datasetKey}{(character) Filters by the dataset's key (a uuid)} \item{uuid}{(character) A uuid for a dataset. Should give exact same results as datasetKey.} \item{sourceId}{(numeric) Filters by the source identifier. Not used right now.} \item{rank}{(character) Taxonomic rank. Filters by taxonomic rank as one of: CLASS, CULTIVAR, CULTIVAR_GROUP, DOMAIN, FAMILY, FORM, GENUS, INFORMAL, INFRAGENERIC_NAME, INFRAORDER, INFRASPECIFIC_NAME, INFRASUBSPECIFIC_NAME, KINGDOM, ORDER, PHYLUM, SECTION, SERIES, SPECIES, STRAIN, SUBCLASS, SUBFAMILY, SUBFORM, SUBGENUS, SUBKINGDOM, SUBORDER, SUBPHYLUM, SUBSECTION, SUBSERIES, SUBSPECIES, SUBTRIBE, SUBVARIETY, SUPERCLASS, SUPERFAMILY, SUPERORDER, SUPERPHYLUM, SUPRAGENERIC_NAME, TRIBE, UNRANKED, VARIETY} \item{shortname}{(character) A short name..need more info on this?} \item{start}{Record number to start at} \item{limit}{Number of records to return} \item{...}{Curl options passed on to \code{\link[httr]{GET}}} } \value{ A list of length two. The first element is metadata. The second is either a data.frame (verbose=FALSE, default) or a list (verbose=TRUE) } \description{ This is a taxize version of the same function in the \code{rgbif} package so as to not have to import rgbif and thus require GDAL binary installation. } \references{ \url{http://www.gbif.org/developer/summary} } taxize/man/nbn_classification.Rd0000644000176200001440000000174613125220227016454 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/nbn_classification.R \name{nbn_classification} \alias{nbn_classification} \title{Search UK National Biodiversity Network database for taxonomic classification} \usage{ nbn_classification(id, ...) } \arguments{ \item{id}{(character) An NBN identifier.} \item{...}{Further args passed on to \code{\link[httr]{GET}}.} } \value{ A data.frame } \description{ Search UK National Biodiversity Network database for taxonomic classification } \examples{ \dontrun{ nbn_classification(id="NHMSYS0000376773") # get id first, then pass to this fxn id <- get_nbnid("Zootoca vivipara", rec_only = TRUE, rank = "Species") nbn_classification(id) library('httr') nbn_classification(id="NHMSYS0000502940", config=verbose()) } } \references{ } \seealso{ Other nbn: \code{\link{get_nbnid}}, \code{\link{nbn_search}}, \code{\link{nbn_synonyms}} } \author{ Scott Chamberlain, \email{myrmecocystus@gmail.com} } taxize/man/gni_parse.Rd0000644000176200001440000000160313057575430014600 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/gni_parse.R \name{gni_parse} \alias{gni_parse} \title{Parse scientific names using EOL's name parser.} \usage{ gni_parse(names, ...) } \arguments{ \item{names}{A vector of length 1 or more of taxonomic names} \item{...}{Curl options passed on to \code{\link[httr]{GET}}} } \value{ A data.frame with results, the submitted names, and the parsed names with additional information. } \description{ Parse scientific names using EOL's name parser. } \examples{ \dontrun{ gni_parse("Cyanistes caeruleus") gni_parse("Plantago minor") gni_parse("Plantago minor minor") gni_parse(c("Plantago minor minor","Helianthus annuus texanus")) # pass on curl options to httr library("httr") gni_parse("Cyanistes caeruleus", config = verbose()) } } \references{ \url{http://gni.globalnames.org/} } \seealso{ \code{\link{gbif_parse}} } taxize/man/get_ids.Rd0000644000176200001440000000722713124601571014246 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_ids.R \name{get_ids} \alias{get_ids} \alias{get_ids_} \title{Retrieve taxonomic identifiers for a given taxon name.} \usage{ get_ids(names, db = c("itis", "ncbi", "eol", "col", "tropicos", "gbif", "nbn"), ...) get_ids_(names, db = c("itis", "ncbi", "eol", "col", "tropicos", "gbif", "nbn"), rows = NA, ...) } \arguments{ \item{names}{character; Taxonomic name to query.} \item{db}{character; database to query. One or more of \code{ncbi}, \code{itis}, \code{eol}, \code{col}, \code{tropicos}, \code{gbif}, or \code{nbn}. By default db is set to search all data sources. Note that each taxonomic data source has their own identifiers, so that if you vide the wrong \code{db} value for the identifier you could get a result, it will likely be wrong (not what you were expecting).} \item{...}{Other arguments passed to \code{\link[taxize]{get_tsn}}, \code{\link[taxize]{get_uid}}, \code{\link[taxize]{get_eolid}}, \code{\link[taxize]{get_colid}}, \code{\link[taxize]{get_tpsid}}, \code{\link[taxize]{get_gbifid}}, \code{\link[taxize]{get_nbnid}}.} \item{rows}{numeric; Any number from 1 to infinity. If the default NA, all rows are returned. When used in \code{get_ids} this function still only gives back a ids class object with one to many identifiers. See \code{get_ids_} to get back all, or a subset, of the raw data that you are presented during the ask process.} } \value{ A vector of taxonomic identifiers, each retaining their respective S3 classes so that each element can be passed on to another function (see e.g.'s). } \description{ This is a convenience function to get identifiers across all data sources. You can use other \code{get_*} functions to get identifiers from specific sources if you like. } \note{ There is a timeout of 1/3 seconds between queries to NCBI. } \examples{ \dontrun{ # Plug in taxon names directly ## By default you get ids for all data sources get_ids(names="Chironomus riparius") # specify rows to limit choices available get_ids(names="Poa annua", db=c("col","eol"), rows=1) get_ids(names="Poa annua", db=c("col","eol"), rows=1:2) ## Or you can specify which source you want via the db parameter get_ids(names="Chironomus riparius", db = 'ncbi') get_ids(names="Salvelinus fontinalis", db = 'nbn') get_ids(names=c("Chironomus riparius", "Pinus contorta"), db = 'ncbi') get_ids(names=c("Chironomus riparius", "Pinus contorta"), db = c('ncbi','itis')) get_ids(names=c("Chironomus riparius", "Pinus contorta"), db = c('ncbi','itis','col')) get_ids(names="Pinus contorta", db = c('ncbi','itis','col','eol','tropicos')) get_ids(names="ava avvva", db = c('ncbi','itis','col','eol','tropicos')) get_ids(names="ava avvva", db = c('ncbi','itis','col','eol','tropicos'), verbose=FALSE) # Pass on to other functions out <- get_ids(names="Pinus contorta", db = c('ncbi','itis','col','eol','tropicos')) classification(out$itis) synonyms(out$tropicos) # Get all data back get_ids_(c("Chironomus riparius", "Pinus contorta"), db = 'nbn', rows=1:10) get_ids_(c("Chironomus riparius", "Pinus contorta"), db = c('nbn','gbif'), rows=1:10) # use curl options library("httr") get_ids("Agapostemon", db = "ncbi", config=verbose()) bb <- get_ids("Pinus contorta", db = c('nbn','gbif'), config=progress()) } } \seealso{ \code{\link[taxize]{classification}} Other taxonomic-ids: \code{\link{get_boldid}}, \code{\link{get_colid}}, \code{\link{get_eolid}}, \code{\link{get_gbifid}}, \code{\link{get_iucn}}, \code{\link{get_natservid}}, \code{\link{get_nbnid}}, \code{\link{get_tolid}}, \code{\link{get_tpsid}}, \code{\link{get_tsn}}, \code{\link{get_uid}}, \code{\link{get_wiki}}, \code{\link{get_wormsid}} } taxize/man/nbn_synonyms.Rd0000644000176200001440000000136013067666143015370 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/nbn_synonyms.R \name{nbn_synonyms} \alias{nbn_synonyms} \title{Return all synonyms for a taxon name with a given id from NBN} \usage{ nbn_synonyms(id, ...) } \arguments{ \item{id}{the taxon identifier code} \item{...}{Further args passed on to \code{\link[httr]{GET}}} } \value{ A data.frame } \description{ Return all synonyms for a taxon name with a given id from NBN } \examples{ \dontrun{ nbn_synonyms(id = 'NHMSYS0001501147') nbn_synonyms(id = 'NHMSYS0000456036') # none nbn_synonyms(id = 'NHMSYS0000502940') } } \references{ } \seealso{ Other nbn: \code{\link{get_nbnid}}, \code{\link{nbn_classification}}, \code{\link{nbn_search}} } taxize/man/tp_dist.Rd0000644000176200001440000000155613057575431014307 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/tp_dist.R \name{tp_dist} \alias{tp_dist} \title{Return all distribution records for for a taxon name with a given id.} \usage{ tp_dist(id, key = NULL, ...) } \arguments{ \item{id}{the taxon identifier code} \item{key}{Your Tropicos API key; loads from .Rprofile. Or you can passin your key in this arg.} \item{...}{Curl options passed on to \code{\link[httr]{GET}}} } \value{ List of two data.frame's, one named "location", and one "reference". } \description{ Return all distribution records for for a taxon name with a given id. } \examples{ \dontrun{ # Query using a taxon name Id out <- tp_dist(id = 25509881) ## just location data head(out[['location']]) ## just reference data head(out[['reference']]) } } \references{ \url{http://services.tropicos.org/help?method=GetNameDistributionsXml} } taxize/man/get_seqs-defunct.Rd0000644000176200001440000000042413057575431016072 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ncbi_getbyname.R \name{get_seqs} \alias{get_seqs} \title{Retrieve gene sequences from NCBI by accession number.} \usage{ get_seqs(...) } \description{ THIS FUNCTION IS DEFUNCT. } \keyword{internal} taxize/man/get_ubioid-defunct.Rd0000644000176200001440000000561413057575430016377 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_ubioid.R \name{get_ubioid} \alias{get_ubioid} \alias{as.ubioid} \alias{as.ubioid.ubioid} \alias{as.ubioid.character} \alias{as.ubioid.list} \alias{as.ubioid.numeric} \alias{as.ubioid.data.frame} \alias{as.data.frame.ubioid} \alias{get_ubioid_} \title{Get the uBio id for a search term} \usage{ get_ubioid(searchterm, searchtype = "scientific", ask = TRUE, verbose = TRUE, rows = NA, family = NULL, rank = NULL, ...) as.ubioid(x, check = TRUE) \method{as.ubioid}{ubioid}(x, check = TRUE) \method{as.ubioid}{character}(x, check = TRUE) \method{as.ubioid}{list}(x, check = TRUE) \method{as.ubioid}{numeric}(x, check = TRUE) \method{as.ubioid}{data.frame}(x, check = TRUE) \method{as.data.frame}{ubioid}(x, ...) get_ubioid_(searchterm, verbose = TRUE, searchtype = "scientific", rows = NA) } \arguments{ \item{searchterm}{character; A vector of common or scientific names.} \item{searchtype}{character; One of 'scientific' or 'common', or any unique abbreviation} \item{ask}{logical; should get_tsn be run in interactive mode? If TRUE and more than one TSN is found for teh species, the user is asked for input. If FALSE NA is returned for multiple matches.} \item{verbose}{logical; should progress be printed?} \item{rows}{numeric; Any number from 1 to infinity. If the default NA, all rows are considered. Note that this function still only gives back a ubioid class object with one to many identifiers. See \code{\link[taxize]{get_ubioid_}} to get back all, or a subset, of the raw data that you are presented during the ask process.} \item{family}{(character) A family name. Optional. See \code{Filtering} below.} \item{rank}{(character) A taxonomic rank name. See \code{\link{rank_ref}} for possible options. Though note that some data sources use atypical ranks, so inspect the data itself for options. Optional. See \code{Filtering} below.} \item{...}{Ignored} \item{x}{Input to \code{\link{as.ubioid}}} \item{check}{logical; Check if ID matches any existing on the DB, only used in \code{\link{as.ubioid}}} } \value{ A vector of uBio ids. If a taxon is not found NA is given. If more than one uBio id is found the function asks for user input (if ask = TRUE), otherwise returns NA. Comes with an attribute \emph{match} to investigate the reason for NA (either 'not found', 'found' or if ask = FALSE 'NA due to ask=FALSE') } \description{ THIS FUNCTION IS DEFUNCT. } \section{Filtering}{ The parameters \code{family} and \code{rank} are not used in the search to the data provider, but are used in filtering the data down to a subset that is closer to the target you want. For all these parameters, you can use regex strings since we use \code{\link{grep}} internally to match. Filtering narrows down to the set that matches your query, and removes the rest. } \seealso{ \code{\link[taxize]{get_uid}}, \code{\link[taxize]{ubio_search}} } taxize/man/eol_dataobjects.Rd0000644000176200001440000000250613057575430015756 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/eol_dataobjects.R \name{eol_dataobjects} \alias{eol_dataobjects} \title{Given the identifier for a data object, return all metadata about the object} \usage{ eol_dataobjects(id, taxonomy = TRUE, usekey = TRUE, key = NULL, verbose = TRUE, ...) } \arguments{ \item{id}{(character) The EOL data object identifier} \item{taxonomy}{(logical) Whether to return any taxonomy details from different taxon hierarchy providers, in an array named \code{taxonconcepts}} \item{usekey}{(logical) use your API key or not (\code{TRUE} or \code{FALSE})} \item{key}{(character) Your EOL API key; can load from .Rprofile if not passed as a parameter} \item{verbose}{(logical); If TRUE the actual taxon queried is printed on the console.} \item{...}{Curl options passed on to \code{\link[httr]{GET}}} } \value{ A list, optionally with a data.frame if \code{taxonomy=TRUE} } \description{ Given the identifier for a data object, return all metadata about the object } \details{ It's possible to return JSON or XML with the EOL API. However, this function only returns JSON for now. } \examples{ \dontrun{ eol_dataobjects(id = "d72801627bf4adf1a38d9c5f10cc767f") eol_dataobjects(id = "21929584") # curl options library("httr") eol_dataobjects(id = "21929584", config = verbose()) } } taxize/man/ion.Rd0000644000176200001440000000076713057575431013431 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ion.R \name{ion} \alias{ion} \title{ION - Index to Organism Names} \usage{ ion(x, ...) } \arguments{ \item{x}{An LSID number. Required.} \item{...}{Curl options passed on to \code{\link[httr]{GET}}} } \value{ A data.frame } \description{ ION - Index to Organism Names } \examples{ \dontrun{ ion(155166) ion(298678) ion(4796748) # ursus americanus ion(1280626) # puma concolor } } \references{ http://www.organismnames.com } taxize/man/itis_terms.Rd0000644000176200001440000000163113057575431015015 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/itis_terms.R \name{itis_terms} \alias{itis_terms} \title{Get ITIS terms, i.e., tsn's, authors, common names, and scientific names.} \usage{ itis_terms(query, what = "both", ...) } \arguments{ \item{query}{One or more common or scientific names, or partial names} \item{what}{One of both (search common and scientific names), common (search just common names), or scientific (search just scientific names)} \item{...}{Further arguments passed on to \code{\link[ritis]{terms}}} } \description{ Get ITIS terms, i.e., tsn's, authors, common names, and scientific names. } \examples{ \dontrun{ # Get terms searching both common and scientific names itis_terms(query='bear') # Get terms searching just common names itis_terms(query='tarweed', "common") # Get terms searching just scientific names itis_terms(query='Poa annua', "scientific") } } taxize/man/eubon_capabilities.Rd0000644000176200001440000000105413060060133016431 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/eubon_capabilities.R \name{eubon_capabilities} \alias{eubon_capabilities} \title{EUBON capabilities} \usage{ eubon_capabilities(...) } \arguments{ \item{...}{Curl options passed on to \code{\link[httr]{GET}}} } \description{ EUBON capabilities } \examples{ \dontrun{ eubon_capabilities() } } \references{ \url{http://cybertaxonomy.eu/eu-bon/utis/1.2/doc.html} } \seealso{ Other eubon-methods: \code{\link{eubon_children}}, \code{\link{eubon_hierarchy}}, \code{\link{eubon}} } taxize/man/gbif_parse.Rd0000644000176200001440000000176313057575430014741 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/gbif_parse.R \name{gbif_parse} \alias{gbif_parse} \title{Parse taxon names using the GBIF name parser.} \usage{ gbif_parse(scientificname, ...) } \arguments{ \item{scientificname}{(character) scientific names} \item{...}{Further args passed on to \code{\link[httr]{POST}}} } \value{ A \code{data.frame} containing fields extracted from parsed taxon names. Fields returned are the union of fields extracted from all species names in \code{scientificname}. } \description{ Parse taxon names using the GBIF name parser. } \examples{ \dontrun{ gbif_parse(scientificname='x Agropogon littoralis') gbif_parse(c('Arrhenatherum elatius var. elatius', 'Secale cereale subsp. cereale', 'Secale cereale ssp. cereale', 'Vanessa atalanta (Linnaeus, 1758)')) } } \references{ \url{http://tools.gbif.org/nameparser/api.do} } \seealso{ \code{\link{gni_parse}} } \author{ John Baumgartner (johnbb@student.unimelb.edu.au) } taxize/man/get_boldid.Rd0000644000176200001440000001411113160561475014722 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_boldid.R \name{get_boldid} \alias{get_boldid} \alias{as.boldid} \alias{as.boldid.boldid} \alias{as.boldid.character} \alias{as.boldid.list} \alias{as.boldid.numeric} \alias{as.boldid.data.frame} \alias{as.data.frame.boldid} \alias{get_boldid_} \title{Get the BOLD (Barcode of Life) code for a search term.} \usage{ get_boldid(searchterm, fuzzy = FALSE, dataTypes = "basic", includeTree = FALSE, ask = TRUE, verbose = TRUE, rows = NA, rank = NULL, division = NULL, parent = NULL, ...) as.boldid(x, check = TRUE) \method{as.boldid}{boldid}(x, check = TRUE) \method{as.boldid}{character}(x, check = TRUE) \method{as.boldid}{list}(x, check = TRUE) \method{as.boldid}{numeric}(x, check = TRUE) \method{as.boldid}{data.frame}(x, check = TRUE) \method{as.data.frame}{boldid}(x, ...) get_boldid_(searchterm, verbose = TRUE, fuzzy = FALSE, dataTypes = "basic", includeTree = FALSE, rows = NA, ...) } \arguments{ \item{searchterm}{character; A vector of common or scientific names.} \item{fuzzy}{(logical) Whether to use fuzzy search or not (default: FALSE).} \item{dataTypes}{(character) Specifies the datatypes that will be returned. See \code{\link{bold_search}} for options.} \item{includeTree}{(logical) If TRUE (default: FALSE), returns a list containing information for parent taxa as well as the specified taxon.} \item{ask}{logical; should get_tsn be run in interactive mode? If TRUE and more than one TSN is found for teh species, the user is asked for input. If FALSE NA is returned for multiple matches.} \item{verbose}{logical; should progress be printed?} \item{rows}{numeric; Any number from 1 to infinity. If the default NA, all rows are considered. Note that this function still only gives back a boldid class object with one to many identifiers. See \code{\link[taxize]{get_boldid_}} to get back all, or a subset, of the raw data that you are presented during the ask process.} \item{rank}{(character) A taxonomic rank name. See \code{\link{rank_ref}} for possible options. Though note that some data sources use atypical ranks, so inspect the data itself for options. Optional. See \code{Filtering} below.} \item{division}{(character) A division (aka phylum) name. Optional. See \code{Filtering} below.} \item{parent}{(character) A parent name (i.e., the parent of the target search taxon). Optional. See \code{Filtering} below.} \item{...}{Curl options passed on to \code{\link[httr]{GET}}} \item{x}{Input to \code{\link{as.boldid}}} \item{check}{logical; Check if ID matches any existing on the DB, only used in \code{\link{as.boldid}}} } \value{ A vector of taxonomic identifiers as an S3 class. If a taxon is not found an \code{NA} is given. If more than one identifier is found the function asks for user input if \code{ask = TRUE}, otherwise returns \code{NA}. If \code{ask=FALSE} and \code{rows} does not equal \code{NA}, then a data.frame is given back, but not of the uid class, which you can't pass on to other functions as you normally can. See \code{\link{get_id_details}} for further details including attributes and exceptions } \description{ Get the BOLD (Barcode of Life) code for a search term. } \section{Filtering}{ The parameters \code{division}, \code{parent}, and \code{rank} are not used in the search to the data provider, but are used in filtering the data down to a subset that is closer to the target you want. For all these parameters, you can use regex strings since we use \code{\link{grep}} internally to match. Filtering narrows down to the set that matches your query, and removes the rest. } \examples{ \dontrun{ get_boldid(searchterm = "Agapostemon") get_boldid(searchterm = "Chironomus riparius") get_boldid(c("Chironomus riparius","Quercus douglasii")) splist <- names_list('species') get_boldid(splist, verbose=FALSE) # Fuzzy searching get_boldid(searchterm="Osmi", fuzzy=TRUE) # Get back a subset get_boldid(searchterm="Osmi", fuzzy=TRUE, rows = 1) get_boldid(searchterm="Osmi", fuzzy=TRUE, rows = 1:10) get_boldid(searchterm=c("Osmi","Aga"), fuzzy=TRUE, rows = 1) get_boldid(searchterm=c("Osmi","Aga"), fuzzy=TRUE, rows = 1:3) # When not found get_boldid("howdy") get_boldid(c("Chironomus riparius", "howdy")) get_boldid('Epicordulia princeps') get_boldid('Arigomphus furcifer') get_boldid("Cordulegaster erronea") get_boldid("Nasiaeshna pentacantha") # Narrow down results to a division or rank, or both ## Satyrium example ### Results w/o narrowing get_boldid("Satyrium") ### w/ phylum get_boldid("Satyrium", division = "Plants") get_boldid("Satyrium", division = "Animals") ## Rank example get_boldid("Osmia", fuzzy = TRUE) get_boldid("Osmia", fuzzy = TRUE, rank = "genus") # Fuzzy filter on any filtering fields ## uses grep on the inside get_boldid("Satyrium", division = "anim") get_boldid("Aga", fuzzy = TRUE, parent = "*idae") # Convert a boldid without class information to a boldid class as.boldid(get_boldid("Agapostemon")) # already a boldid, returns the same as.boldid(get_boldid(c("Agapostemon","Quercus douglasii"))) # same as.boldid(1973) # numeric as.boldid(c(1973,101009,98597)) # numeric vector, length > 1 as.boldid("1973") # character as.boldid(c("1973","101009","98597")) # character vector, length > 1 as.boldid(list("1973","101009","98597")) # list, either numeric or character ## dont check, much faster as.boldid("1973", check=FALSE) as.boldid(1973, check=FALSE) as.boldid(c("1973","101009","98597"), check=FALSE) as.boldid(list("1973","101009","98597"), check=FALSE) (out <- as.boldid(c(1973,101009,98597))) data.frame(out) as.boldid( data.frame(out) ) # Get all data back get_boldid_("Osmia", fuzzy=TRUE, rows=1:5) get_boldid_("Osmia", fuzzy=TRUE, rows=1) get_boldid_(c("Osmi","Aga"), fuzzy=TRUE, rows = 1:3) } } \seealso{ \code{\link[taxize]{classification}} Other taxonomic-ids: \code{\link{get_colid}}, \code{\link{get_eolid}}, \code{\link{get_gbifid}}, \code{\link{get_ids}}, \code{\link{get_iucn}}, \code{\link{get_natservid}}, \code{\link{get_nbnid}}, \code{\link{get_tolid}}, \code{\link{get_tpsid}}, \code{\link{get_tsn}}, \code{\link{get_uid}}, \code{\link{get_wiki}}, \code{\link{get_wormsid}} } taxize/man/get_nbnid.Rd0000644000176200001440000001156313160514700014554 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_nbnid.R \name{get_nbnid} \alias{get_nbnid} \alias{as.nbnid} \alias{as.nbnid.nbnid} \alias{as.nbnid.character} \alias{as.nbnid.list} \alias{as.nbnid.data.frame} \alias{as.data.frame.nbnid} \alias{get_nbnid_} \title{Get the UK National Biodiversity Network ID from taxonomic names.} \usage{ get_nbnid(name, ask = TRUE, verbose = TRUE, rec_only = FALSE, rank = NULL, rows = NA, ...) as.nbnid(x, check = TRUE) \method{as.nbnid}{nbnid}(x, check = TRUE) \method{as.nbnid}{character}(x, check = TRUE) \method{as.nbnid}{list}(x, check = TRUE) \method{as.nbnid}{data.frame}(x, check = TRUE) \method{as.data.frame}{nbnid}(x, ...) get_nbnid_(name, verbose = TRUE, rec_only = FALSE, rank = NULL, rows = NA, ...) } \arguments{ \item{name}{character; scientific name.} \item{ask}{logical; should get_nbnid be run in interactive mode? If TRUE and more than one ID is found for the species, the user is asked for input. If FALSE NA is returned for multiple matches.} \item{verbose}{logical; If TRUE the actual taxon queried is printed on the console.} \item{rec_only}{(logical) If \code{TRUE} ids of recommended names are returned (i.e. synonyms are removed). Defaults to \code{FALSE}. Remember, the id of a synonym is a taxa with 'recommended' name status.} \item{rank}{(character) If given, we attempt to limit the results to those taxa with the matching rank.} \item{rows}{numeric; Any number from 1 to infinity. If the default NA, all rows are considered. Note that this function still only gives back a nbnid class object with one to many identifiers. See \code{\link[taxize]{get_nbnid_}} to get back all, or a subset, of the raw data that you are presented during the ask process.} \item{...}{Further args passed on to \code{nbn_search}} \item{x}{Input to \code{\link{as.nbnid}}} \item{check}{logical; Check if ID matches any existing on the DB, only used in \code{\link{as.nbnid}}} } \value{ A vector of taxonomic identifiers as an S3 class. If a taxon is not found an \code{NA} is given. If more than one identifier is found the function asks for user input if \code{ask = TRUE}, otherwise returns \code{NA}. If \code{ask=FALSE} and \code{rows} does not equal \code{NA}, then a data.frame is given back, but not of the uid class, which you can't pass on to other functions as you normally can. See \code{\link{get_id_details}} for further details including attributes and exceptions an object of class nbnid, a light wrapper around a character string that is the taxonomic ID - includes attributes with relavant metadata } \description{ Get the UK National Biodiversity Network ID from taxonomic names. } \examples{ \dontrun{ get_nbnid(name='Poa annua') get_nbnid(name='Poa annua', rec_only=TRUE) get_nbnid(name='Poa annua', rank='Species') get_nbnid(name='Poa annua', rec_only=TRUE, rank='Species') get_nbnid(name='Pinus contorta') # The NBN service handles common names too get_nbnid(name='red-winged blackbird') # specify rows to limit choices available get_nbnid('Poa annua') get_nbnid('Poa annua', rows=1) get_nbnid('Poa annua', rows=25) get_nbnid('Poa annua', rows=1:2) # When not found get_nbnid(name="uaudnadndj") get_nbnid(c("Zootoca vivipara", "uaudnadndj")) get_nbnid(c("Zootoca vivipara","Chironomus riparius", "uaudnadndj")) # Convert an nbnid without class information to a nbnid class as.nbnid(get_nbnid("Zootoca vivipara")) # already a nbnid, returns the same as.nbnid(get_nbnid(c("Zootoca vivipara","Pinus contorta"))) # same as.nbnid('NHMSYS0001706186') # character # character vector, length > 1 as.nbnid(c("NHMSYS0001706186","NHMSYS0000494848","NBNSYS0000010867")) # list as.nbnid(list("NHMSYS0001706186","NHMSYS0000494848","NBNSYS0000010867")) ## dont check, much faster as.nbnid('NHMSYS0001706186', check=FALSE) as.nbnid(list("NHMSYS0001706186","NHMSYS0000494848","NBNSYS0000010867"), check=FALSE) (out <- as.nbnid(c("NHMSYS0001706186","NHMSYS0000494848", "NBNSYS0000010867"))) data.frame(out) as.nbnid( data.frame(out) ) # Get all data back get_nbnid_("Zootoca vivipara") get_nbnid_("Poa annua", rows=2) get_nbnid_("Poa annua", rows=1:2) get_nbnid_(c("asdfadfasd","Pinus contorta"), rows=1:5) # use curl options library("httr") get_nbnid("Quercus douglasii", config=verbose()) bb <- get_nbnid("Quercus douglasii", config=progress()) } } \references{ } \seealso{ \code{\link[taxize]{classification}} Other taxonomic-ids: \code{\link{get_boldid}}, \code{\link{get_colid}}, \code{\link{get_eolid}}, \code{\link{get_gbifid}}, \code{\link{get_ids}}, \code{\link{get_iucn}}, \code{\link{get_natservid}}, \code{\link{get_tolid}}, \code{\link{get_tpsid}}, \code{\link{get_tsn}}, \code{\link{get_uid}}, \code{\link{get_wiki}}, \code{\link{get_wormsid}} Other nbn: \code{\link{nbn_classification}}, \code{\link{nbn_search}}, \code{\link{nbn_synonyms}} } \author{ Scott Chamberlain, \email{myrmecocystus@gmail.com} } taxize/man/get_eolid.Rd0000644000176200001440000001204413160514700014551 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_eolid.R \name{get_eolid} \alias{get_eolid} \alias{as.eolid} \alias{as.eolid.eolid} \alias{as.eolid.character} \alias{as.eolid.list} \alias{as.eolid.numeric} \alias{as.eolid.data.frame} \alias{as.data.frame.eolid} \alias{get_eolid_} \title{Get the EOL ID from Encyclopedia of Life from taxonomic names.} \usage{ get_eolid(sciname, ask = TRUE, verbose = TRUE, key = NULL, rows = NA, ...) as.eolid(x, check = TRUE) \method{as.eolid}{eolid}(x, check = TRUE) \method{as.eolid}{character}(x, check = TRUE) \method{as.eolid}{list}(x, check = TRUE) \method{as.eolid}{numeric}(x, check = TRUE) \method{as.eolid}{data.frame}(x, check = TRUE) \method{as.data.frame}{eolid}(x, ...) get_eolid_(sciname, verbose = TRUE, key = NULL, rows = NA, ...) } \arguments{ \item{sciname}{character; scientific name.} \item{ask}{logical; should get_eolid be run in interactive mode? If TRUE and more than one ID is found for the species, the user is asked for input. If FALSE NA is returned for multiple matches.} \item{verbose}{logical; If \code{TRUE} the actual taxon queried is printed on the console.} \item{key}{API key. passed on to \code{\link{eol_search}} and \code{\link{eol_pages}} internally} \item{rows}{numeric; Any number from 1 to infinity. If the default NA, all rows are considered. Note that this function still only gives back a eolid class object with one to many identifiers. See \code{\link[taxize]{get_eolid_}} to get back all, or a subset, of the raw data that you are presented during the ask process.} \item{...}{Further args passed on to \code{\link{eol_search}}} \item{x}{Input to \code{\link{as.eolid}}} \item{check}{logical; Check if ID matches any existing on the DB, only used in \code{\link{as.eolid}}} } \value{ A vector of taxonomic identifiers as an S3 class. If a taxon is not found an \code{NA} is given. If more than one identifier is found the function asks for user input if \code{ask = TRUE}, otherwise returns \code{NA}. If \code{ask=FALSE} and \code{rows} does not equal \code{NA}, then a data.frame is given back, but not of the uid class, which you can't pass on to other functions as you normally can. See \code{\link{get_id_details}} for further details including attributes and exceptions } \description{ Note that EOL doesn't expose an API endpoint for directly querying for EOL taxon ID's, so we first use the function \code{\link[taxize]{eol_search}} to find pages that deal with the species of interest, then use \code{\link[taxize]{eol_pages}} to find the actual taxon IDs. } \details{ EOL is a bit odd in that they have page IDs for each taxon, but then within that, they have taxon ids for various taxa within that page (e.g., GBIF and NCBI each have a taxon they refer to within the page [i.e., taxon]). And we need the taxon ids from a particular data provider (e.g, NCBI) to do other things, like get a higher classification tree. However, humans want the page id, not the taxon id. So, the id returned from this function is the taxon id, not the page id. You can get the page id for a taxon by using \code{\link{eol_search}} and \code{\link{eol_pages}}, and the URI returned in the attributes for a taxon will lead you to the taxon page, and the ID in the URL is the page id. } \examples{ \dontrun{ get_eolid(sciname='Pinus contorta') get_eolid(sciname='Puma concolor') get_eolid(c("Puma concolor", "Pinus contorta")) # specify rows to limit choices available get_eolid('Poa annua') get_eolid('Poa annua', rows=1) get_eolid('Poa annua', rows=2) get_eolid('Poa annua', rows=1:2) # When not found get_eolid(sciname="uaudnadndj") get_eolid(c("Chironomus riparius", "uaudnadndj")) # Convert a eolid without class information to a eolid class # already a eolid, returns the same as.eolid(get_eolid("Chironomus riparius")) # same as.eolid(get_eolid(c("Chironomus riparius","Pinus contorta"))) # numeric as.eolid(24954444) # numeric vector, length > 1 as.eolid(c(24954444,51389511,57266265)) # character as.eolid("24954444") # character vector, length > 1 as.eolid(c("24954444","51389511","57266265")) # list, either numeric or character as.eolid(list("24954444","51389511","57266265")) ## dont check, much faster as.eolid("24954444", check=FALSE) as.eolid(24954444, check=FALSE) as.eolid(c("24954444","51389511","57266265"), check=FALSE) as.eolid(list("24954444","51389511","57266265"), check=FALSE) (out <- as.eolid(c(24954444,51389511,57266265))) data.frame(out) as.eolid( data.frame(out) ) # Get all data back get_eolid_("Poa annua") get_eolid_("Poa annua", rows=2) get_eolid_("Poa annua", rows=1:2) get_eolid_(c("asdfadfasd", "Pinus contorta")) } } \seealso{ \code{\link[taxize]{classification}} Other taxonomic-ids: \code{\link{get_boldid}}, \code{\link{get_colid}}, \code{\link{get_gbifid}}, \code{\link{get_ids}}, \code{\link{get_iucn}}, \code{\link{get_natservid}}, \code{\link{get_nbnid}}, \code{\link{get_tolid}}, \code{\link{get_tpsid}}, \code{\link{get_tsn}}, \code{\link{get_uid}}, \code{\link{get_wiki}}, \code{\link{get_wormsid}} } \author{ Scott Chamberlain, \email{myrmecocystus@gmail.com} } taxize/man/itis_taxrank.Rd0000644000176200001440000000174513057575431015341 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/itis_taxrank.R \name{itis_taxrank} \alias{itis_taxrank} \title{Retrieve taxonomic rank name from given TSN.} \usage{ itis_taxrank(query = NULL, ...) } \arguments{ \item{query}{TSN for a taxonomic group (numeric). If query is left as default (NULL), you get all possible rank names, and their TSN's (using function \code{\link[ritis]{rank_names}}. There is slightly different terminology for Monera vs. Plantae vs. Fungi vs. Animalia vs. Chromista, so there are separate terminologies for each group.} \item{...}{Further arguments passed on to \code{\link[ritis]{rank_name}}} } \value{ Taxonomic rank names or data.frame of all ranks. } \description{ Retrieve taxonomic rank name from given TSN. } \details{ You can print messages by setting \code{verbose=FALSE}. } \examples{ \dontrun{ # All ranks itis_taxrank() # A single TSN itis_taxrank(query=202385) # Many TSN's itis_taxrank(query=c(202385,183833,180543)) } } taxize/man/taxize_capwords.Rd0000644000176200001440000000126113057575431016040 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/taxize_capwords.r \name{taxize_capwords} \alias{taxize_capwords} \title{Capitalize the first letter of a character string.} \usage{ taxize_capwords(s, strict = FALSE, onlyfirst = FALSE) } \arguments{ \item{s}{A character string} \item{strict}{Should the algorithm be strict about capitalizing. Defaults to FALSE.} \item{onlyfirst}{Capitalize only first word, lowercase all others. Useful for taxonomic names.} } \description{ Capitalize the first letter of a character string. } \examples{ taxize_capwords(c("using AIC for model selection")) taxize_capwords(c("using AIC for model selection"), strict=TRUE) } taxize/man/apg_orders.Rd0000644000176200001440000000117713060060133014743 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/taxize-package.R \docType{data} \name{apg_orders} \alias{apg_orders} \title{MOBOT order names} \format{A data frame with 494 rows and 3 variables: \describe{ \item{original}{original data record from APG website} \item{this}{Order name} \item{that}{Replacement order name} }} \source{ \url{http://www.mobot.org/MOBOT/research/APweb/} } \description{ Order names and their replacements from the Angiosperm Phylogeny Website system of flowering plant classification. } \details{ This dataset is from Version 13, incorporated on 2015-04-29. } \keyword{data} taxize/man/vascan_search.Rd0000644000176200001440000000303113057575431015427 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/vascan_search.r \name{vascan_search} \alias{vascan_search} \title{Search the CANADENSYS Vascan API.} \usage{ vascan_search(q, format = "json", raw = FALSE, ...) } \arguments{ \item{q}{(character) Can be a scientific name, a vernacular name or a VASCAN taxon identifier (e.g. 861)} \item{format}{(character) One of json (default) or xml.} \item{raw}{(logical) If TRUE, raw json or xml returned, if FALSE, parsed data returned.} \item{...}{(list) Further args passed on to \code{\link[httr]{GET}}} } \value{ json, xml or a list. } \description{ Search the CANADENSYS Vascan API. } \details{ Note that we lowercase all outputs in data.frame's, but when a list is given back, we don't touch the list names. } \examples{ \dontrun{ vascan_search(q = "Helianthus annuus") vascan_search(q = "Helianthus annuus", raw=TRUE) vascan_search(q = c("Helianthus annuus", "Crataegus dodgei"), raw=TRUE) # format type ## json c <- vascan_search(q = "Helianthus annuus", format="json", raw=TRUE) library("jsonlite") fromJSON(c, FALSE) ## xml d <- vascan_search(q = "Helianthus annuus", format="xml", raw=TRUE) library("xml2") xml2::read_xml(d) # lots of names, in this case 50 splist <- names_list(rank='species', size=50) vascan_search(q = splist) # Curl options library("httr") vascan_search(q = "Helianthus annuus", config = verbose()) } } \references{ API docs http://data.canadensys.net/vascan/api } \author{ Scott Chamberlain {myrmecocystus@gmail.com} } \keyword{names} \keyword{taxonomy} taxize/man/eubon_children.Rd0000644000176200001440000000314713060060133015575 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/eubon_children.R \name{eubon_children} \alias{eubon_children} \title{EUBON children} \usage{ eubon_children(id, providers = NULL, timeout = 0, ...) } \arguments{ \item{id}{(character) identifier for the taxon. (LSID, DOI, URI, or any other identifier used by the checklist provider)} \item{providers}{(character) A list of provider id strings concatenated by comma characters. The default : "pesi,bgbm-cdm-server[col]" will be used if this parameter is not set. A list of all available provider ids can be obtained from the '/capabilities' service end point. Providers can be nested, that is a parent provider can have sub providers. If the id of the parent provider is supplied all subproviders will be queried. The query can also be restricted to one or more subproviders by using the following syntax: parent-id[sub-id-1,sub-id2,...]} \item{timeout}{(numeric) The maximum of milliseconds to wait for responses from any of the providers. If the timeout is exceeded the service will just return the responses that have been received so far. The default timeout is 0 ms (wait for ever)} \item{...}{Curl options passed on to \code{\link[httr]{GET}}} } \value{ a data.frame or an empty list if no results found } \description{ EUBON children } \examples{ \dontrun{ x <- eubon_children(id = "urn:lsid:marinespecies.org:taxname:126141", providers = 'worms') head(x) } } \references{ \url{http://cybertaxonomy.eu/eu-bon/utis/1.2/doc.html} } \seealso{ Other eubon-methods: \code{\link{eubon_capabilities}}, \code{\link{eubon_hierarchy}}, \code{\link{eubon}} } taxize/man/col_classification-defunct.Rd0000644000176200001440000000046713057575430020116 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/col_classification.R \name{col_classification} \alias{col_classification} \title{Search Catalogue of Life for taxonomic classifications.} \usage{ col_classification(...) } \description{ THIS FUNCTION IS DEFUNCT. } \keyword{internal} taxize/man/tp_accnames.Rd0000644000176200001440000000121413057575431015105 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/tp_accnames.R \name{tp_accnames} \alias{tp_accnames} \title{Return all accepted names for a taxon name with a given id.} \usage{ tp_accnames(id, key = NULL, ...) } \arguments{ \item{id}{the taxon identifier code} \item{key}{Your Tropicos API key; loads from .Rprofile.} \item{...}{Curl options passed on to \code{\link[httr]{GET}}} } \value{ List or dataframe. } \description{ Return all accepted names for a taxon name with a given id. } \examples{ \dontrun{ tp_accnames(id = 25503923) tp_accnames(id = 25538750) # No accepted names found tp_accnames(id = 25509881) } } taxize/man/col_children.Rd0000644000176200001440000000515713057575430015266 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/col_children.R \name{col_children} \alias{col_children} \title{Search Catalogue of Life for for direct children of a particular taxon.} \usage{ col_children(name = NULL, id = NULL, format = NULL, start = NULL, checklist = NULL, ...) } \arguments{ \item{name}{The string to search for. Only exact matches found the name given will be returned, unless one or wildcards are included in the search string. An * (asterisk) character denotes a wildcard; a % (percentage) character may also be used. The name must be at least 3 characters long, not counting wildcard characters.} \item{id}{The record ID of the specific record to return (only for scientific names of species or infraspecific taxa)} \item{format}{format of the results returned. Valid values are format=xml and format=php; if the format parameter is omitted, the results are returned in the default XML format. If format=php then results are returned as a PHP array in serialized string format, which can be converted back to an array in PHP using the unserialize command} \item{start}{The first record to return. If omitted, the results are returned from the first record (start=0). This is useful if the total number of results is larger than the maximum number of results returned by a single Web service query (currently the maximum number of results returned by a single query is 500 for terse queries and 50 for full queries).} \item{checklist}{The year of the checklist to query, if you want a specific year's checklist instead of the lastest as default (numeric).} \item{...}{Curl options passed on to \code{\link[httr]{GET}}} } \value{ A list of data.frame's. } \description{ Search Catalogue of Life for for direct children of a particular taxon. } \details{ You must provide one of name or id. The other parameters (format and start) are optional. } \examples{ \dontrun{ # A basic example col_children(name="Apis") # An example where there is no classification, results in data.frame with # no rows col_children(id='b2f88f382aa5568f93a97472c6be6516') # Use a specific year's checklist col_children(name="Apis", checklist=2012) col_children(name="Apis", checklist=2009) # Pass in many names or many id's out <- col_children(name=c("Buteo","Apis","Accipiter","asdf"), checklist = "2012") out$Apis # get just the output you want library("plyr") ldply(out) # or combine to one data.frame # or pass many id's ids <- c('abe977b1d27007a76dd12a5c93a637bf', 'b2f88f382aa5568f93a97472c6be6516') out <- col_children(id = ids, checklist=2012) library("plyr") ldply(out) # combine to one data.frame } } taxize/man/tp_acceptednames-deprecated.Rd0000644000176200001440000000111013057575431020220 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/tp_accnames.R \name{tp_acceptednames} \alias{tp_acceptednames} \title{Return all accepted names for a taxon name with a given id.} \usage{ tp_acceptednames(id, format = "json", output = "df", key = NULL) } \arguments{ \item{id}{the taxon identifier code} \item{format}{return in json or xml format (defaults to json)} \item{output}{raw = json or xml; or df = data.frame} \item{key}{Your Tropicos API key; loads from .Rprofile.} } \description{ Function name changed to tp_accnames. } \keyword{internal} taxize/man/theplantlist.Rd0000644000176200001440000000127313057575431015350 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/taxize-package.R \docType{data} \name{theplantlist} \alias{theplantlist} \title{Lookup-table for family, genus, and species names for ThePlantList} \format{A data frame with 10,000 rows and 3 variables: \describe{ \item{family}{family name} \item{genus}{genus name} \item{species}{specific epithet name} }} \source{ http://www.theplantlist.org } \description{ These names are from http://www.theplantlist.org, and are from version 1.1 of their data. This data is used in the function \code{\link{names_list}}. This is a randomly selected subset of the ~350K accepted species names in Theplantlist. } \keyword{data} taxize/man/plantminer.Rd0000644000176200001440000000256113060060133014765 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/plantminer.R \name{plantminer} \alias{plantminer} \title{Search for taxonomy data from Plantminer.com} \usage{ plantminer(plants, from = "tpl", key = NULL, verbose = TRUE) } \arguments{ \item{plants}{(character) Vector of plant species names. Required.} \item{from}{(character) One of tpl (for theplantlist.com data), or flora (for Brazilian Flora Checklist). Required. Default: \code{tpl}} \item{key}{(character) Your api key for the plantminer.com site. Go to http://www.plantminer.com/ to get your api key. Two options for inputting your key. 1) You can input it manually within the function as the second argument, or 2) you can put the key in your .Rprofile file, which will then be loaded when you start R. See http://bit.ly/135eG0b for help on how to put api keys in your .Rprofile file.} \item{verbose}{(logical) Verbose or not. Default: \code{TRUE}} } \value{ data.frame of results. } \description{ Search for taxonomy data from Plantminer.com } \examples{ \dontrun{ # A single taxon plantminer("Ocotea pulchella") # Many taxa plants <- c("Myrcia lingua", "Myrcia bella", "Ocotea pulchella", "Miconia", "Coffea arabica var. amarella", "Bleh") plantminer(plants) # By deafult, tpl is used, for Theplantlist data, # toggle the from parameter here plantminer("Ocotea pulchella", from = "flora") } } taxize/man/apg_families.Rd0000644000176200001440000000124113060060133015226 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/taxize-package.R \docType{data} \name{apg_families} \alias{apg_families} \title{MOBOT family names} \format{A data frame with 1597 rows and 4 variables: \describe{ \item{original}{original data record from APG website} \item{this}{Order name} \item{that}{Replacement order name} \item{order}{Order name} }} \source{ \url{http://www.mobot.org/MOBOT/research/APweb/} } \description{ Family names and their replacements from the Angiosperm Phylogeny Website system of flowering plant classification. } \details{ This dataset is from Version 13, incorporated on 2015-04-29. } \keyword{data} taxize/man/ncbi_downstream.Rd0000644000176200001440000000356613125222460016005 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ncbi_downstream.R \name{ncbi_downstream} \alias{ncbi_downstream} \title{Retrieve all taxa names downstream in hierarchy for NCBI} \usage{ ncbi_downstream(id, downto, intermediate = FALSE, ...) } \arguments{ \item{id}{(numeric/integer) An NCBI taxonomic identifier} \item{downto}{The taxonomic level you want to go down to. See examples below. The taxonomic level IS case sensitive, and you do have to spell it correctly. See \code{data(rank_ref)} for spelling.} \item{intermediate}{(logical) If \code{TRUE}, return a list of length two with target taxon rank names, with additional list of data.frame's of intermediate taxonomic groups. Default: \code{FALSE}} \item{...}{Further args passed on to \code{\link{ncbi_children}}} } \value{ Data.frame of taxonomic information downstream to family from e.g., Order, Class, etc., or if \code{intermediate=TRUE}, list of length two, with target taxon rank names, and intermediate names. } \description{ Retrieve all taxa names downstream in hierarchy for NCBI } \section{No Rank}{ A sticky point with NCBI is that they can have designation for taxonomic rank of "No Rank". So we have no way of programatically knowing what to do with that taxon. Of course one can manually look at a name and perhaps know what it is, or look it up on the web - but we can't do anything programatically. So, no rank things will sometimes be missing. } \examples{ \dontrun{ ## genus Apis ncbi_downstream(id = 7459, downto="species") ## get intermediate taxa as a separate object ncbi_downstream(id = 7459, downto="species", intermediate = TRUE) ## Lepidoptera ncbi_downstream(id = 7088, downto="superfamily") ## families in the ferns (Moniliformopses) (id <- get_uid("Moniliformopses")) ncbi_downstream(id = id, downto = "order") } } \author{ Scott Chamberlain \email{myrmecocystus@gmail.com} } taxize/man/gnr_datasources.Rd0000644000176200001440000000163113057575431016016 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/gnr_datasources.R \name{gnr_datasources} \alias{gnr_datasources} \title{Get data sources for the Global Names Resolver.} \usage{ gnr_datasources(todf = TRUE) } \arguments{ \item{todf}{logical; Should a data.frame be returned?} } \value{ json or a data.frame } \description{ Retrieve data sources used in Global Names Index, see \url{http://gni.globalnames.org/} for information. } \examples{ \dontrun{ # all data sources gnr_datasources() # give me the id for EOL out <- gnr_datasources() out[out$title == "EOL", "id"] # Fuzzy search for sources with the word zoo out <- gnr_datasources() out[agrep("zoo", out$title, ignore.case = TRUE), ] # Output as a list gnr_datasources(FALSE) } } \seealso{ \code{\link[taxize]{gnr_resolve}} } \author{ Scott Chamberlain {myrmecocystus@gmail.com} } \keyword{names} \keyword{resolve} \keyword{taxonomy} taxize/man/ipni_search.Rd0000644000176200001440000000735113057575431015124 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ipni_search.R \name{ipni_search} \alias{ipni_search} \title{Search for names in the International Plant Names Index (IPNI).} \usage{ ipni_search(family = NULL, infrafamily = NULL, genus = NULL, infragenus = NULL, species = NULL, infraspecies = NULL, publicationtitle = NULL, authorabbrev = NULL, includepublicationauthors = NULL, includebasionymauthors = NULL, geounit = NULL, addedsince = NULL, modifiedsince = NULL, isapnirecord = NULL, isgcirecord = NULL, isikrecord = NULL, ranktoreturn = NULL, output = "minimal", ...) } \arguments{ \item{family}{Family name to search on (Optional)} \item{infrafamily}{Infrafamilial name to search on (Optional)} \item{genus}{Genus name to search on (Optional)} \item{infragenus}{Infrageneric name to search on (Optional)} \item{species}{Species name to search on (Optional) - Note, this is the epithet, not the full genus - epithet name combination.} \item{infraspecies}{Infraspecies name to search on (Optional)} \item{publicationtitle}{Publication name or abbreviation to search on. Again, replace any spaces with a '+' (e.g. 'J.+Bot.') (Optional)} \item{authorabbrev}{Author standard form to search on (publishing author, basionym author or both - see below) (Optional)} \item{includepublicationauthors}{TRUE (default) to include the taxon author in the search or FALSE to exclude it} \item{includebasionymauthors}{TRUE (default) to include the basionum author in the search or FALSE to exclude it} \item{geounit}{Country name or other geographical unit to search on (see the help pages for more information and warnings about the use of this option) (Optional)} \item{addedsince}{Date to search on in the format 'yyyy-mm-dd', e.g. 2005-08-01 for all records added since the first of August, 2005. (see the help pages for more information and warnings about the use of this option) (Optional. If supplied must be in format YYYY-MM-DD and must be greater than or equal to 1984-01-01.)} \item{modifiedsince}{Date to search on in the format 'yyyy-mm-dd', e.g. 2005-08-01 for all records edited since the first of August, 2005. (See the help pages for more information about the use of this option) (Optional. If supplied must be in format YYYY-MM-DD and must be greater than or equal to 1993-01-01.)} \item{isapnirecord}{FALSE (default) to exclude records from the Australian Plant Name Index} \item{isgcirecord}{FALSE (default) to exclude records from the Gray Cards Index} \item{isikrecord}{FALSE (default) to exclude records from the Index Kewensis} \item{ranktoreturn}{One of a few options to choose the ranks returned. See details.} \item{output}{One of minimal (default), classic, short, or extended} \item{...}{Curl options passed on to \code{\link[httr]{GET}} (Optional). Default: returns all ranks.} } \value{ A data frame } \description{ Note: This data source is also provided in the Global Names Index (GNI) (http://gni.globalnames.org/data_sources). The interface to the data is different among the two services though. } \details{ \code{rankToReturn} options: \itemize{ \item \item "all" - all records \item "fam" - family records \item "infrafam" - infrafamilial records \item "gen" - generic records \item "infragen" - infrageneric records \item "spec" - species records \item "infraspec" - infraspecific records } } \examples{ \dontrun{ ipni_search(genus='Brintonia', isapnirecord=TRUE, isgcirecord=TRUE, isikrecord=TRUE) head(ipni_search(genus='Ceanothus')) head(ipni_search(genus='Pinus', species='contorta')) # Different output formats head(ipni_search(genus='Ceanothus')) head(ipni_search(genus='Ceanothus', output='short')) head(ipni_search(genus='Ceanothus', output='extended')) } } \references{ http://www.ipni.org/link_to_ipni.html } taxize/man/get_genes-defunct.Rd0000644000176200001440000000042513057575431016221 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ncbi_getbyid.R \name{get_genes} \alias{get_genes} \title{Retrieve gene sequences from NCBI by accession number.} \usage{ get_genes(...) } \description{ THIS FUNCTION IS DEFUNCT. } \keyword{internal} taxize/man/plantGenusNames.Rd0000644000176200001440000000075413057575431015744 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/taxize-package.R \docType{data} \name{plantGenusNames} \alias{plantGenusNames} \title{Vector of plant genus names from ThePlantList} \format{A vector of length 793} \source{ http://www.theplantlist.org } \description{ These names are from http://www.theplantlist.org, and are a randomly chosen subset of genera names for the purpose of having some names to play with for examples in this package. } \keyword{data} taxize/man/gnr_resolve.Rd0000644000176200001440000001366113125256057015162 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/gnr_resolve.R \name{gnr_resolve} \alias{gnr_resolve} \title{Resolve names using Global Names Resolver.} \usage{ gnr_resolve(names, data_source_ids = NULL, resolve_once = FALSE, with_context = FALSE, canonical = FALSE, highestscore = TRUE, best_match_only = FALSE, preferred_data_sources = NULL, with_canonical_ranks = FALSE, http = "get", cap_first = TRUE, fields = "minimal", ...) } \arguments{ \item{names}{character; taxonomic names to be resolved. Doesn't work for vernacular/common names.} \item{data_source_ids}{character; IDs to specify what data source is searched. See \code{\link[taxize]{gnr_datasources}}.} \item{resolve_once}{logical; Find the first available match instead of matches across all data sources with all possible renderings of a name. When \code{TRUE}, response is rapid but incomplete.} \item{with_context}{logical; Reduce the likelihood of matches to taxonomic homonyms. When \code{TRUE} a common taxonomic context is calculated for all supplied names from matches in data sources that have classification tree paths. Names out of determined context are penalized during score calculation.} \item{canonical}{logical; If \code{FALSE} (default), gives back names with taxonomic authorities. If \code{TRUE}, returns canocial names (without tax. authorities and abbreviations).} \item{highestscore}{logical; Return those names with the highest score for each searched name? Defunct} \item{best_match_only}{(logical) If \code{TRUE}, best match only returned. Default: \code{FALSE}} \item{preferred_data_sources}{(character) A vector of one or more data source IDs.} \item{with_canonical_ranks}{(logical) Returns names with infraspecific ranks, if present. If \code{TRUE}, we force \code{canonical=TRUE}, otherwise this parameter would have no effect. Default: \code{FALSE}} \item{http}{The HTTP method to use, one of "get" or "post". Default: "get". Use \code{http="post"} with large queries. Queries with > 300 records use "post" automatically because "get" would fail} \item{cap_first}{(logical) For each name, fix so that the first name part is capitalized, while others are not. This web service is sensitive to capitalization, so you'll get different results depending on capitalization. First name capitalized is likely what you'll want and is the default. If \code{FALSE}, names are not modified. Default: \code{TRUE}} \item{fields}{(character) One of minimal (default) or all. Minimal gives back just four fields, whereas all gives all fields back.} \item{...}{Curl options passed on to \code{\link[httr]{GET}}} } \value{ A data.frame with one attribute \code{not_known}: a character vector of taxa unknown to the Global Names Index. Access like \code{attr(output, "not_known")}, or \code{attributes(output)$not_known}. Columns of the output data.frame: \itemize{ \item user_supplied_name (character) - the name you passed in to the \code{names} parameter, unchanged. \item submitted_name (character) - the actual name submitted to the GNR service \item data_source_id (integer/numeric) - data source ID \item data_source_title (character) - data source name \item gni_uuid (character) - Global Names Index UUID (aka identifier) \item matched_name (character) - the matched name in the GNR service \item matched_name2 (character) - returned if \code{canonical=TRUE}, in which case \emph{matched_name} is not returned \item classification_path (character) - names of the taxonomic classification tree, with names separated by pipes (\code{|}) \item classification_path_ranks (character) - ranks of the taxonomic classification tree, with names separated by pipes (\code{|}) \item classification_path_ids (character) - identifiers of the taxonomic classification tree, with names separated by pipes (\code{|}) \item taxon_id (character) - taxon identifier \item edit_distance (integer/numeric) - edit distance \item imported_at (character) - date imported \item match_type (integer/numeric) - match type \item match_value (character) - description of match type \item prescore (character) - pre score \item score (numeric) - score \item local_id (character) - local identifier \item url (character) - URL for taxon \item global_id (character) - global identifier \item current_taxon_id (character) - current taxon id \item current_name_string (character) - current name string } Note that names (i.e. rows) are dropped that are NA, are zero length strings, are not character vectors, or are not found by the API. } \description{ Resolve names using Global Names Resolver. } \examples{ \dontrun{ gnr_resolve(names = c("Helianthus annuus", "Homo sapiens")) gnr_resolve(names = c("Asteraceae", "Plantae")) # Using data source 12 (Encyclopedia of Life) sources <- gnr_datasources() sources eol <- sources$id[sources$title == 'EOL'] gnr_resolve(names=c("Helianthos annuus","Homo sapians"), data_source_ids=eol) # Two species in the NE Brazil catalogue sps <- c('Justicia brasiliana','Schinopsis brasiliensis') gnr_resolve(names = sps, data_source_ids = 145) # Best match only, compare the two gnr_resolve(names = "Helianthus annuus", best_match_only = FALSE) gnr_resolve(names = "Helianthus annuus", best_match_only = TRUE) # Preferred data source gnr_resolve(names = "Helianthus annuus", preferred_data_sources = c(3,4)) # Return canonical names - default is canonical=FALSE head(gnr_resolve(names = "Helianthus annuus")) head(gnr_resolve(names = "Helianthus annuus", canonical=TRUE)) # Return canonical names with authority stripped but # ranks still present gnr_resolve("Scorzonera hispanica L. subsp. asphodeloides Wallr.") ## vs. gnr_resolve("Scorzonera hispanica L. subsp. asphodeloides Wallr.", with_canonical_ranks = TRUE) } } \references{ \url{http://gnrd.globalnames.org/api} \url{http://gnrd.globalnames.org/} } \seealso{ \code{\link[taxize]{gnr_datasources}} \code{\link{tnrs}} } \author{ Scott Chamberlain \email{myrmecocystus@gmail.com} } \keyword{names} \keyword{resolve} \keyword{taxonomy} taxize/man/tp_namedistributions-deprecated.Rd0000644000176200001440000000106113057575431021174 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/tp_dist.R \name{tp_namedistributions} \alias{tp_namedistributions} \title{Return all distribution records for for a taxon name with a given id.} \usage{ tp_namedistributions(id, key = NULL, callopts = list()) } \arguments{ \item{id}{the taxon identifier code} \item{key}{Your Tropicos API key; loads from .Rprofile. Or you can passin your key in this arg.} \item{callopts}{Further args passed on to httr::GET} } \description{ Function name changed to tp_dist. } \keyword{internal} taxize/man/ubio_search-defunct.Rd0000644000176200001440000000050213057575431016540 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ubio_search.R \name{ubio_search} \alias{ubio_search} \title{This function will return NameBankIDs that match given search terms} \usage{ ubio_search(...) } \arguments{ \item{...}{Parameters, ignored} } \description{ THIS FUNCTION IS DEFUNCT. } taxize/man/status_codes.Rd0000644000176200001440000000043613057575431015335 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/status_codes.R \name{status_codes} \alias{status_codes} \title{Get HTTP status codes} \usage{ status_codes() } \description{ Get HTTP status codes } \examples{ status_codes() } \seealso{ \code{\link{ping}} } taxize/man/itis_lsid.Rd0000644000176200001440000000155213057575431014620 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/itis_lsid.R \name{itis_lsid} \alias{itis_lsid} \title{Get TSN from LSID} \usage{ itis_lsid(lsid = NULL, what = "tsn", ...) } \arguments{ \item{lsid}{One or more lsid's} \item{what}{What to retrieve. One of tsn, record, or fullrecord} \item{...}{Further arguments passed on to \code{\link[ritis]{lsid2tsn}}, \code{\link[ritis]{record}}, or \code{\link[ritis]{full_record}}} } \description{ Get TSN from LSID } \examples{ \dontrun{ # Get TSN itis_lsid("urn:lsid:itis.gov:itis_tsn:180543") itis_lsid(lsid=c("urn:lsid:itis.gov:itis_tsn:180543","urn:lsid:itis.gov:itis_tsn:28726")) # Get partial record itis_lsid("urn:lsid:itis.gov:itis_tsn:180543", "record") # Get full record itis_lsid("urn:lsid:itis.gov:itis_tsn:180543", "fullrecord") # An invalid lsid (a tsn actually) itis_lsid(202385) } } taxize/man/synonyms.Rd0000644000176200001440000001153513160566125014531 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/synonyms.R \name{synonyms} \alias{synonyms} \alias{synonyms.default} \alias{synonyms.tsn} \alias{synonyms.colid} \alias{synonyms.tpsid} \alias{synonyms.nbnid} \alias{synonyms.wormsid} \alias{synonyms.iucn} \alias{synonyms.ids} \alias{synonyms_df} \title{Retrieve synonyms from various sources given input taxonomic names or identifiers} \usage{ synonyms(...) \method{synonyms}{default}(x, db = NULL, rows = NA, ...) \method{synonyms}{tsn}(id, ...) \method{synonyms}{colid}(id, ...) \method{synonyms}{tpsid}(id, ...) \method{synonyms}{nbnid}(id, ...) \method{synonyms}{wormsid}(id, ...) \method{synonyms}{iucn}(id, ...) \method{synonyms}{ids}(id, ...) synonyms_df(x) } \arguments{ \item{...}{Other passed arguments to internal functions \code{get_*()} and functions to gather synonyms.} \item{x}{Vector of taxa names (character) or IDs (character or numeric) to query.} \item{db}{character; database to query. either \code{itis}, \code{tropicos}, \code{col}, \code{nbn}, or \code{worms}. Note that each taxonomic data source has their own identifiers, so that if you provide the wrong \code{db} value for the identifier you could get a result, but it will likely be wrong (not what you were expecting).} \item{rows}{(numeric) Any number from 1 to infinity. If the default NA, all rows are considered. Note that this parameter is ignored if you pass in a taxonomic id of any of the acceptable classes: tsn, tpsid, nbnid, ids.} \item{id}{character; identifiers, returned by \code{\link[taxize]{get_tsn}}, \code{\link[taxize]{get_tpsid}}, \code{\link[taxize]{get_nbnid}}, \code{\link[taxize]{get_colid}}, \code{\link[taxize]{get_wormsid}}} } \value{ A named list of data.frames with the synonyms of every supplied taxa. } \description{ Retrieve synonyms from various sources given input taxonomic names or identifiers } \details{ If IDs are supplied directly (not from the \code{get_*} functions) you must specify the type of ID. For \code{db = "itis"} you can pass in a parameter \code{accepted} to toggle whether only accepted names are used \code{accepted = TRUE}, or if all are used \code{accepted = FALSE}. The default is \code{accepted = FALSE} Note that IUCN requires an API key. See \code{\link[rredlist]{rredlist-package}} for help on authentiating with IUCN Redlist } \examples{ \dontrun{ # Plug in taxon IDs synonyms(183327, db="itis") synonyms("25509881", db="tropicos") synonyms("NBNSYS0000004629", db='nbn') # synonyms("87e986b0873f648711900866fa8abde7", db='col') # FIXME synonyms(105706, db='worms') synonyms(12392, db='iucn') # Plug in taxon names directly synonyms("Pinus contorta", db="itis") synonyms("Puma concolor", db="itis") synonyms(c("Poa annua",'Pinus contorta','Puma concolor'), db="itis") synonyms("Poa annua", db="tropicos") synonyms("Pinus contorta", db="tropicos") synonyms(c("Poa annua",'Pinus contorta'), db="tropicos") synonyms("Pinus sylvestris", db='nbn') synonyms("Puma concolor", db='col') synonyms("Ursus americanus", db='col') synonyms("Amblyomma rotundatum", db='col') synonyms('Pomatomus', db='worms') synonyms('Pomatomus saltatrix', db='worms') # not accepted names, with ITIS ## looks for whether the name given is an accepted name, ## and if not, uses the accepted name to look for synonyms synonyms("Acer drummondii", db="itis") synonyms("Spinus pinus", db="itis") # Use get_* methods synonyms(get_tsn("Poa annua")) synonyms(get_tpsid("Poa annua")) synonyms(get_nbnid("Carcharodon carcharias")) synonyms(get_colid("Ornithodoros lagophilus")) synonyms(get_iucn('Loxodonta africana')) # Pass many ids from class "ids" out <- get_ids(names="Poa annua", db = c('itis','tropicos')) synonyms(out) # Use the rows parameter to select certain rows synonyms("Poa annua", db='tropicos', rows=1) synonyms("Poa annua", db='tropicos', rows=1:3) synonyms("Pinus sylvestris", db='nbn', rows=1:3) synonyms("Amblyomma rotundatum", db='col', rows=2) synonyms("Amblyomma rotundatum", db='col', rows=2:3) # Use curl options synonyms("Poa annua", db='tropicos', rows=1, config=verbose()) synonyms("Poa annua", db='itis', rows=1, config=verbose()) synonyms("Poa annua", db='col', rows=1, config=verbose()) # combine many outputs together x <- synonyms(c("Osmia bicornis", "Osmia rufa", "Osmia"), db = "itis") synonyms_df(x) ## note here how Pinus contorta is dropped due to no synonyms found x <- synonyms(c("Poa annua",'Pinus contorta','Puma concolor'), db="col") synonyms_df(x) ## note here that ids are taxon identifiers b/c you start with them x <- synonyms(c(25509881, 13100094), db="tropicos") synonyms_df(x) ## xxx x <- synonyms(c('Aglais io', 'Usnea hirta', 'Arctostaphylos uva-ursi'), db="nbn") synonyms_df(x) } } \seealso{ \code{\link[taxize]{get_tsn}}, \code{\link[taxize]{get_tpsid}}, \code{\link[taxize]{get_nbnid}}, \code{\link[taxize]{get_colid}}, \code{\link[taxize]{get_wormsid}}, \code{\link[taxize]{get_iucn}} } taxize/man/comm2sci.Rd0000644000176200001440000000430113143141365014333 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/comm2sci.R \name{comm2sci} \alias{comm2sci} \title{Get scientific names from common names.} \usage{ comm2sci(commnames, db = "eol", itisby = "search", simplify = TRUE, ...) } \arguments{ \item{commnames}{One or more common names or partial names.} \item{db}{Data source, one of \emph{"eol"} (default), \emph{"itis"}, \emph{"tropicos"}, \emph{"ncbi"}, or \emph{"worms"}.} \item{itisby}{Search for common names across entire names (search, default), at beginning of names (begin), or at end of names (end).} \item{simplify}{(logical) If \code{TRUE}, simplify output to a vector of names. If \code{FALSE}, return variable formats from different sources, usually a data.frame.} \item{...}{Further arguments passed on to internal methods.} } \value{ If \code{simplify=TRUE}, a list of scientific names, with list labeled by your input names. If \code{simplify=FALSE}, a data.frame with columns that vary by data source } \description{ Get scientific names from common names. } \details{ For data sources ITIS and NCBI you can pass in common names directly, and use \code{\link[taxize]{get_uid}} or \code{\link[taxize]{get_tsn}} to get ids first, then pass in to this fxn. For the other data sources, you can only pass in common names directly. } \examples{ \dontrun{ comm2sci(commnames='black bear') comm2sci(commnames='black bear', simplify = FALSE) comm2sci(commnames='black bear', db='itis') comm2sci(commnames='annual blue grass', db='tropicos') comm2sci(commnames=c('annual blue grass','tree of heaven'), db='tropicos') comm2sci(commnames=c('black bear', 'roe deer')) comm2sci('blue whale', db = "worms") comm2sci(c('blue whale', 'dwarf surfclam'), db = "worms") # Output easily converts to a data.frame with plyr::ldply library(plyr) ldply(comm2sci(commnames=c('annual blue grass','tree of heaven'), db='tropicos')) # ncbi: pass in uid's from get_uid() directly x <- get_uid("western capercaillie", modifier = "Common Name") comm2sci(x) # itis: pass in tsn's from get_tsn() directly x <- get_tsn(c("Louisiana black bear", "american crow"), searchtype = "common") comm2sci(x) } } \seealso{ \code{\link[taxize]{sci2comm}} } \author{ Scott Chamberlain } taxize/man/phylomatic_tree-defunct.Rd0000644000176200001440000000047013057575431017451 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/phylomatic_tree.R \name{phylomatic_tree} \alias{phylomatic_tree} \title{Query Phylomatic for a phylogenetic tree.} \usage{ phylomatic_tree(...) } \arguments{ \item{...}{Parameters, ignored} } \description{ THIS FUNCTION IS DEFUNCT. } taxize/man/itis_hierarchy.Rd0000644000176200001440000000210613057575431015637 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/itis_hierarchy.R \name{itis_hierarchy} \alias{itis_hierarchy} \title{ITIS hierarchy} \usage{ itis_hierarchy(tsn, what = "full", ...) } \arguments{ \item{tsn}{One or more TSN's (taxonomic serial number). Required.} \item{what}{One of full (full hierarchy), up (immediate upstream), or down (immediate downstream)} \item{...}{Further arguments passed on to \code{\link[ritis]{hierarchy_full}}, \code{\link[ritis]{hierarchy_up}}, or \code{\link[ritis]{hierarchy_down}}} } \description{ Get hierarchies from TSN values, full, upstream only, or immediate downstream only } \details{ Note that \code{\link{itis_downstream}} gets taxa downstream to a particular rank, while this function only gets immediate names downstream. } \examples{ \dontrun{ # Get full hierarchy itis_hierarchy(tsn=180543) # Get hierarchy upstream itis_hierarchy(tsn=180543, "up") # Get hierarchy downstream itis_hierarchy(tsn=180543, "down") # Many tsn's itis_hierarchy(tsn=c(180543,41074,36616)) } } \seealso{ \code{\link{itis_downstream}} } taxize/man/iucn_status.Rd0000644000176200001440000000107313057575431015174 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/iucn_summary.R \name{iucn_status} \alias{iucn_status} \title{Extractor functions for \code{iucn}-class.} \usage{ iucn_status(x, ...) } \arguments{ \item{x}{an \code{iucn}-object as returned by \code{iucn_summary}} \item{...}{Currently not used} } \value{ A character vector with the status. } \description{ Extractor functions for \code{iucn}-class. } \examples{ \dontrun{ ia <- iucn_summary(c("Panthera uncia", "Lynx lynx")) iucn_status(ia)} } \seealso{ \code{\link[taxize]{iucn_summary}} } taxize/man/tol_resolve.Rd0000644000176200001440000000444713057575431015200 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/tol_resolve.R \name{tol_resolve} \alias{tol_resolve} \title{Resolve names using Open Tree of Life (OTL) resolver} \usage{ tol_resolve(names = NULL, context_name = NULL, do_approximate_matching = TRUE, ids = NULL, include_suppressed = FALSE, ...) } \arguments{ \item{names}{(character vector) taxon names to be queried} \item{context_name}{name of the taxonomic context to be searched (length-one character vector). Must match (case sensitive) one of the values returned by \code{\link[rotl]{tnrs_contexts}}.} \item{do_approximate_matching}{(logical) A logical indicating whether or not to perform approximate string (a.k.a. \dQuote{fuzzy}) matching. Using \code{FALSE} will greatly improve speed. Default: \code{TRUE}} \item{ids}{An array of OTL ids to use for identifying names. These will be assigned to each name in the names array. If ids is provided, then ids and names must be identical in length.} \item{include_suppressed}{(logical) Ordinarily, some quasi-taxa, such as incertae sedis buckets and other non-OTUs, are suppressed from TNRS results. If this parameter is true, these quasi-taxa are allowed as possible TNRS results. Default: \code{FALSE}} \item{...}{Curl options passed on to \code{\link[httr]{POST}} within \code{\link[rotl]{tnrs_match_names}}} } \value{ A data frame summarizing the results of the query. The original query output is appended as an attribute to the returned object (and can be obtained using \code{attr(object, "original_response")}). } \description{ Resolve names using Open Tree of Life (OTL) resolver } \examples{ \dontrun{ tol_resolve(names=c("echinodermata", "xenacoelomorpha", "chordata", "hemichordata")) tol_resolve(c("Hyla", "Salmo", "Diadema", "Nautilus")) tol_resolve(c("Hyla", "Salmo", "Diadema", "Nautilus"), context_name = "Animals") turducken_spp <- c("Meleagris gallopavo", "Anas platyrhynchos", "Gallus gallus") tol_resolve(turducken_spp, context_name="Animals") } } \references{ \url{https://github.com/OpenTreeOfLife/germinator/wiki/TNRS-API-v3#match_names} } \seealso{ \code{\link{gnr_resolve}}, \code{\link{tnrs}} } \author{ Francois Michonneau \email{francois.michonneau@gmail.com} Scott Chamberlain \email{myrmecocystus@gmail.com} } \keyword{names} \keyword{resolve} \keyword{taxonomy} taxize/man/eubon.Rd0000644000176200001440000000667313060060133013734 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/eubon.R \name{eubon} \alias{eubon} \alias{eubon_search} \title{EUBON taxonomy search} \usage{ eubon(query, providers = "pesi", searchMode = "scientificNameExact", addSynonymy = FALSE, addParentTaxon = FALSE, timeout = 0, dedup = NULL, ...) eubon_search(query, providers = "pesi", searchMode = "scientificNameExact", addSynonymy = FALSE, addParentTaxon = FALSE, timeout = 0, dedup = NULL, ...) } \arguments{ \item{query}{(character) The scientific name to search for. For example: "Bellis perennis", "Prionus" or "Bolinus brandaris". This is an exact search so wildcard characters are not supported} \item{providers}{(character) A list of provider id strings concatenated by comma characters. The default : "pesi,bgbm-cdm-server[col]" will be used if this parameter is not set. A list of all available provider ids can be obtained from the '/capabilities' service end point. Providers can be nested, that is a parent provider can have sub providers. If the id of the parent provider is supplied all subproviders will be queried. The query can also be restricted to one or more subproviders by using the following syntax: parent-id[sub-id-1,sub-id2,...]} \item{searchMode}{(character) Specifies the searchMode. Possible search modes are: scientificNameExact, scientificNameLike (begins with), vernacularNameExact, vernacularNameLike (contains), findByIdentifier. If the a provider does not support the chosen searchMode it will be skipped and the status message in the tnrClientStatus will be set to 'unsupported search mode' in this case.} \item{addSynonymy}{(logical) Indicates whether the synonymy of the accepted taxon should be included into the response. Turning this option on may cause an increased response time. Default: \code{FALSE}} \item{addParentTaxon}{(logical) Indicates whether the the parent taxon of the accepted taxon should be included into the response. Turning this option on may cause a slightly increased response time. Default: \code{FALSE}} \item{timeout}{(numeric) The maximum of milliseconds to wait for responses from any of the providers. If the timeout is exceeded the service will just return the responses that have been received so far. The default timeout is 0 ms (wait for ever)} \item{dedup}{(character) Allows to deduplicate the results by making use of a deduplication strategy. The deduplication is done by comparing specific properties of the taxon: \itemize{ \item id: compares 'taxon.identifier' \item id_name: compares 'taxon.identifier' AND 'taxon.taxonName.scientificName' \item name: compares 'taxon.taxonName.scientificName' Using the pure 'name' strategy is not recommended. }} \item{...}{Curl options passed on to \code{\link[httr]{GET}}} } \description{ EUBON taxonomy search } \details{ Note that paging is not yet implemented, so you only get the first chunk of up to 50 results for methods that require paging. We will implement paging here when it is available in the EU BON API. } \examples{ \dontrun{ eubon_search("Prionus") eubon_search("Salmo", 'pesi') eubon_search("Salmo", c('pesi', 'worms')) eubon_search("Salmo", 'worms', 'scientificNameLike') eubon_search("Salmo", 'worms', addSynonymy = TRUE) eubon_search("Salmo", 'worms', addParentTaxon = TRUE) } } \references{ \url{http://cybertaxonomy.eu/eu-bon/utis/1.2/doc.html} } \seealso{ Other eubon-methods: \code{\link{eubon_capabilities}}, \code{\link{eubon_children}}, \code{\link{eubon_hierarchy}} } taxize/man/get_iucn.Rd0000644000176200001440000000562413161015007014416 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_iucn.R \name{get_iucn} \alias{get_iucn} \alias{as.iucn} \alias{as.iucn.iucn} \alias{as.iucn.character} \alias{as.iucn.list} \alias{as.iucn.numeric} \alias{as.iucn.data.frame} \alias{as.data.frame.iucn} \title{Get a IUCN Redlist taxon} \usage{ get_iucn(x, verbose = TRUE, key = NULL, ...) as.iucn(x, check = TRUE, key = NULL) \method{as.iucn}{iucn}(x, check = TRUE, key = NULL) \method{as.iucn}{character}(x, check = TRUE, key = NULL) \method{as.iucn}{list}(x, check = TRUE, key = NULL) \method{as.iucn}{numeric}(x, check = TRUE, key = NULL) \method{as.iucn}{data.frame}(x, check = TRUE, key = NULL) \method{as.data.frame}{iucn}(x, ...) } \arguments{ \item{x}{(character) A vector of common or scientific names} \item{verbose}{logical; should progress be printed?} \item{key}{(character) required. you IUCN Redlist API key. See \code{\link[rredlist]{rredlist-package}} for help on authenticating with IUCN Redlist} \item{...}{Ignored} \item{check}{(logical) Check if ID matches any existing on the DB, only used in \code{\link{as.iucn}}} } \value{ A vector of taxonomic identifiers as an S3 class. Comes with the following attributes: \itemize{ \item \emph{match} (character) - the reason for NA, either 'not found', 'found' or if \code{ask = FALSE} then 'NA due to ask=FALSE') \item \emph{name} (character) - the taxonomic name, which is needed in \code{\link{synonyms}} and \code{\link{sci2comm}} methods since they internally use \pkg{rredlist} functions which require the taxonomic name, and not the taxonomic identifier \item \emph{uri} (character) - The URI where more information can be read on the taxon - includes the taxonomic identifier in the URL somewhere } \emph{multiple_matches} and \emph{pattern_match} do not apply here as in other \code{get_*} methods since there is no IUCN Redlist search, so you either get a match or you do not get a match. } \description{ Get a IUCN Redlist taxon } \details{ There is no underscore method, because there's no real search for IUCN, that is, where you search for a string, and get back a bunch of results due to fuzzy matching. If that exists in the future we'll add an underscore method here. IUCN ids only work with \code{\link{synonyms}} and \code{\link{sci2comm}} methods. } \examples{ \dontrun{ get_iucn(x = "Branta canadensis") get_iucn(x = "Branta bernicla") get_iucn(x = "Panthera uncia") # as coercion as.iucn(22732) as.iucn("22732") (res <- as.iucn(c(22679946, 22732, 22679935))) data.frame(res) as.iucn(data.frame(res)) } } \seealso{ Other taxonomic-ids: \code{\link{get_boldid}}, \code{\link{get_colid}}, \code{\link{get_eolid}}, \code{\link{get_gbifid}}, \code{\link{get_ids}}, \code{\link{get_natservid}}, \code{\link{get_nbnid}}, \code{\link{get_tolid}}, \code{\link{get_tpsid}}, \code{\link{get_tsn}}, \code{\link{get_uid}}, \code{\link{get_wiki}}, \code{\link{get_wormsid}} } taxize/man/rankagg.Rd0000644000176200001440000000176313057575431014253 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/rankagg.R \name{rankagg} \alias{rankagg} \title{Aggregate data by given taxonomic rank} \usage{ rankagg(data = NULL, datacol = NULL, rank = NULL, fxn = "sum") } \arguments{ \item{data}{A data.frame. Column headers must have capitalized ranks (e.g., Genus, Tribe, etc.) (data.frame)} \item{datacol}{The data column (character)} \item{rank}{Taxonomic rank to aggregate by (character)} \item{fxn}{Arithmetic function or vector or functions (character)} } \description{ Aggregate data by given taxonomic rank } \examples{ library("vegan") data(dune.taxon, package='vegan') dat <- dune.taxon set.seed(1234) dat$abundance <- round(rlnorm(n=nrow(dat),meanlog=5,sdlog=2),0) rankagg(data=dat, datacol="abundance", rank="Genus") rankagg(data=dat, "abundance", rank="Family") rankagg(data=dat, "abundance", rank="Genus", fxn="mean") rankagg(data=dat, "abundance", rank="Subclass") rankagg(data=dat, "abundance", rank="Subclass", fxn="sd") } taxize/man/genbank2uid.Rd0000644000176200001440000000270113076225243015015 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/genbank2uid.R \name{genbank2uid} \alias{genbank2uid} \title{Get NCBI taxonomy UID from GenBankID} \usage{ genbank2uid(id, batch_size = 100, ...) } \arguments{ \item{id}{A GenBank accession alphanumeric string, or a gi numeric string.} \item{batch_size}{The number of queries to submit at a time.} \item{...}{Curl args passed on to \code{\link[httr]{GET}}} } \value{ one or more NCBI taxonomic IDs } \description{ Get NCBI taxonomy UID from GenBankID } \details{ See \url{http://www.ncbi.nlm.nih.gov/Sitemap/sequenceIDs.html} for help on why there are two identifiers, and the difference between them. Note that if you pass in > 1 item, if one or more of your items is not found, the entire batch will return \code{NA}'s. To get around this, set \code{batch_size = 1} - so each is sent separtaely to NCBI. However, this of course is much slower than the default, which is to send up to 100 at a time. } \examples{ \dontrun{ # with accession numbers genbank2uid(id = 'AJ748748') genbank2uid(id = 'Y13155') genbank2uid(id = 'X78312') genbank2uid(id = 'KM495596') # with gi numbers genbank2uid(id = 62689767) genbank2uid(id = 22775511) genbank2uid(id = 156446673) # pass in many accession or gi numbers genbank2uid(c(62689767,156446673)) genbank2uid(c('X78312','KM495596')) genbank2uid(list('X78312',156446673)) # curl options library('httr') genbank2uid(id = 156446673, config=verbose()) } } taxize/man/tp_classification-defunct.Rd0000644000176200001440000000046113057575431017757 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/tp_classification.R \name{tp_classification} \alias{tp_classification} \title{Return all synonyms for a taxon name with a given id.} \usage{ tp_classification(...) } \description{ THIS FUNCTION IS DEFUNCT. } \keyword{internal} taxize/man/eol_search.Rd0000644000176200001440000000371113143100425014717 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/eol_search.R \name{eol_search} \alias{eol_search} \title{Search for terms in EOL database.} \usage{ eol_search(terms, page = 1, exact = NULL, filter_tid = NULL, filter_heid = NULL, filter_by_string = NULL, cache_ttl = NULL, key = NULL, ...) } \arguments{ \item{terms}{search terms (character)} \item{page}{A maximum of 30 results are returned per page. This parameter allows you to fetch more pages of results if there are more than 30 matches (Default 1)} \item{exact}{Will find taxon pages if the preferred name or any synonym or common name exactly matches the search term.} \item{filter_tid}{Given an EOL page ID, search results will be limited to members of that taxonomic group} \item{filter_heid}{Given a Hierarchy Entry ID, search results will be limited to members of that taxonomic group} \item{filter_by_string}{Given a search term, an exact search will be made and that matching page will be used as the taxonomic group against which to filter search results} \item{cache_ttl}{The number of seconds you wish to have the response cached.} \item{key}{Your EOL API key; loads from .Rprofile.} \item{...}{Curl options passed on to \code{\link[httr]{GET}}} } \value{ A data frame with four columns: \itemize{ \item pageid: pageid, this is the same as the eolid you can get from \code{\link{get_eolid}} \item name: taxonomic name, may or may not contain the taxonomic authority \item link: URL for the taxon in question \item content: a string of semi-colon separated names. it's not clear to us what these represent exactly, but figured why not give it to users in case some may find it useful } } \description{ Search for terms in EOL database. } \details{ It's possible to return JSON or XML with the EOL API. However, this function only returns JSON for now. } \examples{ \dontrun{ eol_search(terms='Homo') eol_search(terms='Salix') eol_search(terms='Ursus americanus luteolus') } } taxize/man/getkey.Rd0000644000176200001440000000106413057575430014122 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/getkey.R \name{getkey} \alias{getkey} \title{Function to get API key.} \usage{ getkey(x = NULL, service) } \arguments{ \item{x}{An API key, defaults to NULL.} \item{service}{The API data provider, used to match to default guest key.} } \description{ Checks first to get key from your .Rprofile file for an API key with the name 'tropicoskey'. If it is not found, the default key is used. } \examples{ \dontrun{ getkey(service="tropicos") getkey(service="eol") } } \keyword{internal} taxize/man/tpl_families.Rd0000644000176200001440000000151213057575431015301 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/tpl_families.r \name{tpl_families} \alias{tpl_families} \title{Get The Plant List families.} \usage{ tpl_families(...) } \arguments{ \item{...}{(list) Curl options passed on to \code{\link[httr]{GET}}} } \value{ Returns a \code{data.frame} including the names of all families indexed by The Plant List, and the major groups into which they fall (i.e. Angiosperms, Gymnosperms, Bryophytes and Pteridophytes). } \description{ Get The Plant List families. } \details{ Requires an internet connection in order to connect to www.theplantlist.org. } \examples{ \dontrun{ # Get a data.frame of plant families, with the group name (Angiosperms, etc.) head( tpl_families() ) } } \seealso{ \code{\link{tpl_get}} } \author{ John Baumgartner (johnbb@student.unimelb.edu.au) } taxize/man/gni_search.Rd0000644000176200001440000000527613057575430014745 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/gni_search.R \name{gni_search} \alias{gni_search} \title{Search for taxonomic names using the Global Names Index.} \usage{ gni_search(search_term = NULL, per_page = NULL, page = NULL, justtotal = FALSE, parse_names = FALSE, ...) } \arguments{ \item{search_term}{Name pattern you want to search for. WARNING: Does not work for vernacular/common names. Search term may include following options (Note: can, uni, gen, sp, ssp, au, yr work only for parsed names): \itemize{ \item * wild card - Search by part of a word (E.g.: planta*) \item exact exact match - Search for exact match of a literal string (E.g.: exact:Parus major) \item ns name string- Search for literal string from its beginning (other modifiers will be ignored) (E.g.: ns:parus maj*) \item can canonical form- Search name without authors (other modifiers will be ignored) (E.g.: can:parus major) \item uni uninomial- Search for higher taxa (E.g.: uni:parus) \item gen genus - Search by genus epithet of species name (E.g.: gen:parus) \item sp species - Search by species epithet (E.g.: sp:major) \item ssp subspecies - Search by infraspecies epithet (E.g.: ssp:major) \item au author - Search by author word (E.g.: au:Shipunov) \item yr year - Search by year (E.g.: yr:2005) }} \item{per_page}{Number of items per one page (numbers larger than 1000 will be decreased to 1000) (default is 30).} \item{page}{Page number you want to see (default is 1).} \item{justtotal}{Return only the total results found.} \item{parse_names}{If \code{TRUE}, use \code{\link{gni_parse}} to parse names. Default: \code{FALSE}} \item{...}{Curl options passed on to \code{\link[httr]{GET}}} } \value{ data.frame of results. } \description{ Uses the Global Names Index, see \url{http://gni.globalnames.org/}. } \details{ Note that you can use fuzzy searching, e.g., by attaching an asterisk to the end of a search term. See the first two examples below. } \examples{ \dontrun{ gni_search(search_term = "ani*") gni_search(search_term = "ama*", per_page = 3, page = 21) gni_search(search_term = "animalia", per_page = 8, page = 1) gni_search(search_term = "animalia", per_page = 8, page = 1, justtotal=TRUE) gni_search(search_term = "Cyanistes caeruleus", parse_names=TRUE) # pass on curl options to httr library("httr") gni_search(search_term = "ani*", config = verbose()) } } \references{ \url{http://gni.globalnames.org/}, \url{https://github.com/dimus/gni/wiki/api} } \seealso{ \code{\link{gnr_datasources}}, \code{\link{gni_search}}. } \author{ Scott Chamberlain {myrmecocystus@gmail.com} } \keyword{globalnamesindex} \keyword{names} \keyword{taxonomy} taxize/man/bold_search.Rd0000644000176200001440000000600413057575430015076 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/bold_search.R \name{bold_search} \alias{bold_search} \title{Search Barcode of Life for taxonomic IDs} \usage{ bold_search(name = NULL, id = NULL, fuzzy = FALSE, dataTypes = "basic", includeTree = FALSE, response = FALSE, ...) } \arguments{ \item{name}{(character) One or more scientific names.} \item{id}{(integer) One or more BOLD taxonomic identifiers.} \item{fuzzy}{(logical) Whether to use fuzzy search or not (default: FALSE). Only used if \code{name} passed.} \item{dataTypes}{(character) Specifies the datatypes that will be returned. See Details for options. This variable is ignored if \code{name} parameter is passed, but is used if the \code{id} parameter is passed.} \item{includeTree}{(logical) If TRUE (default: FALSE), returns a list containing information for parent taxa as well as the specified taxon. Only used if \code{id} passed.} \item{response}{(logical) Note that response is the object that returns from the Curl call, useful for debugging, and getting detailed info on the API call.} \item{...}{Further args passed on to \code{\link[httr]{GET}}, main purpose being curl debugging} } \value{ A list of data.frame's. } \description{ Search Barcode of Life for taxonomic IDs } \details{ You must provide one of name or id to this function. The other parameters are optional. Note that when passing in \code{name}, \code{fuzzy} can be used as well, while if \code{id} is passed, then \code{fuzzy} is ignored, and \code{dataTypes} \code{includeTree} can be used. Options for \code{dataTypes} parameter: \itemize{ \item all returns all data \item basic returns basic taxon information \item images returns specimen image. Includes copyright information, image URL, image metadata. \item stats Returns specimen and sequence statistics. Includes public species count, public BIN count, public marker counts, public record count, specimen count, sequenced specimen count, barcode specimen count, species count, barcode species count. \item geo Returns collection site information. Includes country, collection site map. \item sequencinglabs Returns sequencing labs. Includes lab name, record count. \item depository Returns specimen depositories. Includes depository name, record count. \item thirdparty Returns information from third parties. Includes wikipedia summary, wikipedia URL, GBIF map. } } \examples{ \dontrun{ # A basic example bold_search(name="Apis") bold_search(name="Agapostemon") bold_search(name="Poa") # Fuzzy search head(bold_search(name="Po", fuzzy=TRUE)) head(bold_search(name="Aga", fuzzy=TRUE)) # Many names bold_search(name=c("Apis","Puma concolor")) nms <- names_list('species') bold_search(name=nms) # Searching by ID - dataTypes can be used, and includeTree can be used bold_search(id=88899) bold_search(id=88899, dataTypes="stats") bold_search(id=88899, dataTypes="geo") bold_search(id=88899, dataTypes="basic") bold_search(id=88899, includeTree=TRUE) } } \references{ \url{http://www.boldsystems.org/index.php/resources/api} } taxize/man/classification.Rd0000644000176200001440000002427513160566124015631 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/classification.R \name{classification} \alias{classification} \alias{classification.default} \alias{classification.tsn} \alias{classification.uid} \alias{classification.eolid} \alias{classification.colid} \alias{classification.tpsid} \alias{classification.gbifid} \alias{classification.nbnid} \alias{classification.tolid} \alias{classification.wormsid} \alias{classification.natservid} \alias{classification.boldid} \alias{classification.wiki} \alias{classification.ids} \alias{cbind.classification} \alias{rbind.classification} \alias{cbind.classification_ids} \alias{rbind.classification_ids} \title{Retrieve the taxonomic hierarchy for a given taxon ID.} \usage{ classification(...) \method{classification}{default}(x, db = NULL, callopts = list(), return_id = TRUE, rows = NA, ...) \method{classification}{tsn}(id, return_id = TRUE, ...) \method{classification}{uid}(id, callopts = list(), return_id = TRUE, ...) \method{classification}{eolid}(id, key = NULL, callopts = list(), return_id = TRUE, ...) \method{classification}{colid}(id, start = NULL, checklist = NULL, callopts = list(), return_id = TRUE, ...) \method{classification}{tpsid}(id, key = NULL, callopts = list(), return_id = TRUE, ...) \method{classification}{gbifid}(id, callopts = list(), return_id = TRUE, ...) \method{classification}{nbnid}(id, callopts = list(), return_id = TRUE, ...) \method{classification}{tolid}(id, callopts = list(), return_id = TRUE, ...) \method{classification}{wormsid}(id, callopts = list(), return_id = TRUE, ...) \method{classification}{natservid}(id, callopts = list(), return_id = TRUE, ...) \method{classification}{boldid}(id, callopts = list(), return_id = TRUE, ...) \method{classification}{wiki}(id, callopts = list(), return_id = TRUE, ...) \method{classification}{ids}(id, ...) \method{cbind}{classification}(...) \method{rbind}{classification}(...) \method{cbind}{classification_ids}(...) \method{rbind}{classification_ids}(...) } \arguments{ \item{...}{For \code{classification}: other arguments passed to \code{\link{get_tsn}}, \code{\link{get_uid}}, \code{\link{get_eolid}}, \code{\link{get_colid}}, \code{\link{get_tpsid}}, \code{\link{get_gbifid}}, \code{\link{get_wormsid}}, \code{\link{get_natservid}}, \code{\link{get_wormsid}}, \code{\link{get_wiki}}. For \code{rbind.classification} and \code{cbind.classification}: one or more objects of class \code{classification}} \item{x}{Vector of taxa names (character) or IDs (character or numeric) to query.} \item{db}{character; database to query. either \code{ncbi}, \code{itis}, \code{eol}, \code{col}, \code{tropicos}, \code{gbif}, \code{nbn}, \code{worms}, \code{natserv}, \code{bold}, or \code{wiki}. Note that each taxonomic data source has, their own identifiers, so that if you provide the wrong \code{db} value for the identifier you could get a result, but it will likely be wrong (not what you were expecting).} \item{callopts}{Curl options passed on to \code{\link[httr]{GET}}} \item{return_id}{(logical) If \code{TRUE} (default), return the taxon id as well as the name and rank of taxa in the lineage returned. Ignored for natserv as they don't return IDs in their taxonomic classification data.} \item{rows}{(numeric) Any number from 1 to infinity. If the default NA, all rows are considered. Note that this parameter is ignored if you pass in a taxonomic id instead of a name of class character.} \item{id}{character; identifiers, returned by \code{\link{get_tsn}}, \code{\link{get_uid}}, \code{\link{get_eolid}}, \code{\link{get_colid}}, \code{\link{get_tpsid}}, \code{\link{get_gbifid}}, \code{\link{get_tolid}}, \code{\link{get_wormsid}}, \code{\link{get_natservid}}, \code{\link{get_wormsid}}, \code{\link{get_wiki}}} \item{key}{Your API key; loads from .Rprofile.} \item{start}{The first record to return. If omitted, the results are returned from the first record (start=0). This is useful if the total number of results is larger than the maximum number of results returned by a single Web service query (currently the maximum number of results returned by a single query is 500 for terse queries and 50 for full queries).} \item{checklist}{character; The year of the checklist to query, if you want a specific year's checklist instead of the lastest as default (numeric).} } \value{ A named list of data.frames with the taxonomic classification of every supplied taxa. } \description{ Retrieve the taxonomic hierarchy for a given taxon ID. } \details{ If IDs are supplied directly (not from the \code{get_*} functions) you must specify the type of ID. There is a timeout of 1/3 seconds between queries to NCBI. BEWARE: Right now, NBN doesn't return the queried taxon in the classification. But you can attach it yourself quite easily of course. This behavior is different from the other data sources. } \section{Lots of results}{ It may happen sometimes that you get more results back from your query than will show in the data.frame on screen. Our advice is to refine your query in those cases. On a data source basis we can attempt to help make it easier to refine queries, whether it be with the data provider (unlikely to happen), or in the code in this package (more likely) - let us know if you run into too many results problem and we'll see what we can do. } \examples{ \dontrun{ # Plug in taxon IDs classification(9606, db = 'ncbi') classification(c(9606, 55062), db = 'ncbi') classification(129313, db = 'itis') classification(57361017, db = 'eol') classification(126436, db = 'worms') classification("ELEMENT_GLOBAL.2.134717", db = 'natserv') classification(c(2704179, 2441176), db = 'gbif') classification(25509881, db = 'tropicos') classification("NBNSYS0000004786", db = 'nbn') classification(as.nbnid("NBNSYS0000004786"), db = 'nbn') classification(3930798, db = 'tol') ## works the same if IDs are in class character classification(c("2704179", "2441176"), db = 'gbif') classification("Agapostemon", db = "bold") # wikispecies classification("Malus domestica", db = "wiki") classification("Pinus contorta", db = "wiki") classification("Pinus contorta", db = "wiki", wiki_site = "commons") classification("Pinus contorta", db = "wiki", wiki_site = "pedia") classification("Pinus contorta", db = "wiki", wiki_site = "pedia", wiki = "fr") classification(get_wiki("Malus domestica", "commons")) classification(get_wiki("Malus domestica", "species")) classification(c("Pinus contorta", "Malus domestica"), db = "wiki") # Plug in taxon names ## in this case, we use get_*() fxns internally to first get taxon IDs classification(c("Chironomus riparius", "aaa vva"), db = 'ncbi') classification(c("Chironomus riparius", "aaa vva"), db = 'ncbi', verbose=FALSE) classification(c("Chironomus riparius", "aaa vva"), db = 'itis') classification(c("Chironomus riparius", "aaa vva"), db = 'itis', verbose=FALSE) classification(c("Chironomus riparius", "aaa vva"), db = 'eol') classification(c("Chironomus riparius", "aaa vva"), db = 'col') classification("Alopias vulpinus", db = 'nbn') classification('Gadus morhua', db = 'worms') classification('Aquila chrysaetos', db = 'natserv') classification('Gadus morhua', db = 'natserv') classification('Pomatomus saltatrix', db = 'natserv') classification('Aquila chrysaetos', db = 'natserv') classification(c("Chironomus riparius", "aaa vva"), db = 'col', verbose=FALSE) classification(c("Chironomus riparius", "asdfasdfsfdfsd"), db = 'gbif') classification("Chironomus", db = 'tol') classification("Poa annua", db = 'tropicos') # Use methods for get_uid, get_tsn, get_eolid, get_colid, get_tpsid classification(get_uid(c("Chironomus riparius", "Puma concolor"))) classification(get_uid(c("Chironomus riparius", "aaa vva"))) classification(get_tsn(c("Chironomus riparius", "aaa vva"))) classification(get_tsn(c("Chironomus riparius", "aaa vva"), verbose = FALSE)) classification(get_eolid(c("Chironomus riparius", "aaa vva"))) classification(get_colid(c("Chironomus riparius", "aaa vva"))) classification(get_tpsid(c("Poa annua", "aaa vva"))) classification(get_gbifid(c("Poa annua", "Bison bison"))) # Pass many ids from class "ids" (out <- get_ids(names="Puma concolor", db = c('ncbi','gbif'))) (cl <- classification(out)) # Bind width-wise from class classification_ids cbind(cl) # Bind length-wise rbind(cl) # Many names to get_ids (out <- get_ids(names=c("Puma concolor","Accipiter striatus"), db = c('ncbi','itis','col'))) (cl <- classification(out)) rbind(cl) ## cbind with so many names results in some messy data cbind(cl) ## so you can turn off return_id cbind( classification(out, return_id=FALSE) ) # rbind and cbind on class classification (from a # call to get_colid, get_tsn, etc. other than get_ids) (cl_col <- classification( get_colid(c("Puma concolor","Accipiter striatus")))) rbind(cl_col) cbind(cl_col) (cl_uid <- classification(get_uid(c("Puma concolor","Accipiter striatus")), return_id=FALSE)) rbind(cl_uid) cbind(cl_uid) ## cbind works a bit odd when there are lots of ranks without names (cl_uid <- classification(get_uid(c("Puma concolor","Accipiter striatus")), return_id=TRUE)) cbind(cl_uid) (cl_tsn <- classification(get_tsn(c("Puma concolor","Accipiter striatus")))) rbind(cl_tsn) cbind(cl_tsn) (tsns <- get_tsn(c("Puma concolor","Accipiter striatus"))) (cl_tsns <- classification(tsns)) cbind(cl_tsns) # NBN data (res <- classification(c("Alopias vulpinus","Pinus sylvestris"), db = 'nbn')) rbind(res) cbind(res) # Return taxonomic IDs ## the return_id parameter is logical, and you can turn it on or off. ## It's TRUE by default classification(c("Alopias vulpinus","Pinus sylvestris"), db = 'ncbi', return_id = TRUE) classification(c("Alopias vulpinus","Pinus sylvestris"), db = 'ncbi', return_id = FALSE) # Use rows parameter to select certain classification('Poa annua', db = 'tropicos') classification('Poa annua', db = 'tropicos', rows=1:4) classification('Poa annua', db = 'tropicos', rows=1) classification('Poa annua', db = 'tropicos', rows=6) } \dontrun{ # Fails without db param set # classification(315576) } } \seealso{ \code{\link{get_tsn}}, \code{\link{get_uid}}, \code{\link{get_eolid}}, \code{\link{get_colid}}, \code{\link{get_tpsid}}, \code{\link{get_gbifid}} \code{\link{get_wormsid}}, \code{\link{get_natservid}}, \code{\link{get_boldid}}, \code{\link{get_wiki}} } taxize/man/get_id_details.Rd0000644000176200001440000000607713160542532015573 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get-id-details.R \name{get_id_details} \alias{get_id_details} \title{Details on \code{get_*()} functions} \description{ Including outputs from \code{get_*()} functions, as well as their attributes, and all exception behaviors. } \details{ This document applies to the following functions: \itemize{ \item \code{\link{get_boldid}} \item \code{\link{get_colid}} \item \code{\link{get_eolid}} \item \code{\link{get_gbifid}} \item \code{\link{get_ids}} \item \code{\link{get_iucn}} \item \code{\link{get_natservid}} \item \code{\link{get_nbnid}} \item \code{\link{get_tolid}} \item \code{\link{get_tpsid}} \item \code{\link{get_tsn}} \item \code{\link{get_ubioid}} \item \code{\link{get_uid}} \item \code{\link{get_wiki}} \item \code{\link{get_wormsid}} } } \section{attributes}{ Each output from \code{get_*()} functions have the following attributes: \itemize{ \item \emph{match} (character) - the reason for NA, either 'not found', 'found' or if \code{ask = FALSE} then 'NA due to ask=FALSE') \item \emph{multiple_matches} (logical) - Whether multiple matches were returned by the data source. This can be \code{TRUE}, even if you get 1 name back because we try to pattern match the name to see if there's any direct matches. So sometimes this attribute is \code{TRUE}, as well as \code{pattern_match}, which then returns 1 resulting name without user prompt. \item \emph{pattern_match} (logical) - Whether a pattern match was made. If \code{TRUE} then \code{multiple_matches} must be \code{TRUE}, and we found a perfect match to your name, ignoring case. If \code{FALSE}, there wasn't a direct match, and likely you need to pick from many choices or further parameters can be used to limit results \item \emph{uri} (character) - The URI where more information can be read on the taxon - includes the taxonomic identifier in the URL somewhere. This may be missing if the value returned is \code{NA} } } \section{exceptions}{ The following are the various ways in which \code{get_*()} functions behave: \itemize{ \item success - the value returned is a character string or numeric \item no matches found - you'll get an NA, refine your search or possible the taxon searched for does not exist in the database you're using \item more than on match and ask = FALSE - if there's more than one matching result, and you have set \code{ask = FALSE}, then we can't determine the single match to return, so we give back \code{NA}. However, in this case we do set the \code{match} attribute to say \code{NA due to ask=FALSE & > 1 result} so it's very clear what happened - and you can even programatically check this as well \item NA due to some other reason - some \code{get_*()} functions have additional parameters for filtering taxa. It's possible that even though there's results (that is, \code{found} will say \code{TRUE}), you can get back an NA. This is most likely if the parameter filters taxa after they are returned from the data provider and the value passed to the parameter leads to no matches. } } taxize/man/upstream.Rd0000644000176200001440000000563513160566125014476 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/upstream.R \name{upstream} \alias{upstream} \alias{upstream.default} \alias{upstream.tsn} \alias{upstream.colid} \alias{upstream.ids} \title{Retrieve the upstream taxa for a given taxon name or ID.} \usage{ upstream(...) \method{upstream}{default}(x, db = NULL, upto = NULL, rows = NA, ...) \method{upstream}{tsn}(x, db = NULL, upto = NULL, ...) \method{upstream}{colid}(x, db = NULL, upto = NULL, ...) \method{upstream}{ids}(x, db = NULL, upto = NULL, ...) } \arguments{ \item{...}{Further args passed on to \code{\link{itis_downstream}} or \code{\link{col_downstream}}} \item{x}{Vector of taxa names (character) or IDs (character or numeric) to query.} \item{db}{character; database to query. One or both of \code{itis}, \code{col}. Note that each taxonomic data source has their own identifiers, so that if you provide the wrong \code{db} value for the identifier you could get a result, but it will likely be wrong (not what you were expecting).} \item{upto}{What taxonomic rank to go down to. One of: 'superkingdom', 'kingdom', 'subkingdom','infrakingdom','phylum','division','subphylum', 'subdivision','infradivision', 'superclass','class','subclass','infraclass', 'superorder','order','suborder','infraorder','superfamily','family', 'subfamily','tribe','subtribe','genus','subgenus', 'section','subsection', 'species','subspecies','variety','form','subvariety','race', 'stirp', 'morph','aberration','subform', or 'unspecified'} \item{rows}{(numeric) Any number from 1 to infinity. If the default NA, all rows are considered. Note that this parameter is ignored if you pass in a taxonomic id of any of the acceptable classes: tsn, colid.} } \value{ A named list of data.frames with the upstream names of every supplied taxa. You get an NA if there was no match in the database. } \description{ This function uses a while loop to continually collect taxa up to the taxonomic rank that you specify in the \code{upto} parameter. You can get data from ITIS (itis) or Catalogue of Life (col). There is no method exposed by itis or col for getting taxa at a specific taxonomic rank, so we do it ourselves inside the function. } \examples{ \dontrun{ ## col ### get all genera at one level up upstream("Pinus contorta", db = 'col', upto = 'genus') ### goes to same level, Abies is a genus upstream("Abies", db = 'col', upto = 'genus') upstream('Pinus contorta', db = 'col', upto = 'family') upstream('Poa annua', db = 'col', upto = 'family') upstream('Poa annua', db = 'col', upto = 'order') ## itis upstream(x='Pinus contorta', db = 'itis', upto = 'genus') ## both upstream(get_ids('Pinus contorta', db = c('col','itis')), upto = 'genus') # Use rows parameter to select certain upstream('Poa annua', db = 'col', upto = 'genus') upstream('Poa annua', db = 'col', upto = 'genus', rows=1) # use curl options res <- upstream('Poa annua', db = 'col', upto = 'genus', config=verbose()) } } taxize/man/itis_refs.Rd0000644000176200001440000000075713057575431014632 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/itis_refs.R \name{itis_refs} \alias{itis_refs} \title{Get references related to a ITIS TSN.} \usage{ itis_refs(tsn, ...) } \arguments{ \item{tsn}{One or more TSN's (taxonomic serial number) for a taxonomic group (numeric)} \item{...}{Further arguments passed on to getpublicationsfromtsn} } \description{ Get references related to a ITIS TSN. } \examples{ \dontrun{ itis_refs(202385) itis_refs(c(202385, 70340)) } } taxize/man/gisd_invasive-defunct.Rd0000644000176200001440000000047113057575430017113 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/gisd_isinvasive.R \name{gisd_isinvasive} \alias{gisd_isinvasive} \title{Check invasive species status for a set of species from GISD database} \usage{ gisd_isinvasive(...) } \description{ THIS FUNCTION IS DEFUNCT. } \keyword{internal} taxize/man/ncbi_children.Rd0000644000176200001440000000557213057575431015426 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ncbi_children.R \name{ncbi_children} \alias{ncbi_children} \title{Search NCBI for children of a taxon} \usage{ ncbi_children(name = NULL, id = NULL, start = 0, max_return = 1000, ancestor = NULL, out_type = c("summary", "uid"), ambiguous = FALSE, ...) } \arguments{ \item{name}{(\code{character}) The string to search for. Only exact matches found the name given will be returned. Not compatible with \code{id}.} \item{id}{(\code{character}) The uid to search for. Not compatible with \code{name}.} \item{start}{The first record to return. If omitted, the results are returned from the first record (start=0).} \item{max_return}{(\code{numeric; length=1}) The maximum number of children to return.} \item{ancestor}{(\code{character}) The ancestor of the taxon being searched for. This is useful if there could be more than one taxon with the same name. Has no effect if \code{id} is used.} \item{out_type}{(character) Currently either \code{"summary"} or \code{"uid"}: \describe{ \item{summary}{The output is a list of \code{data.frame} with children uid, name, and rank.} \item{uid}{A list of character vectors of children uids} }} \item{ambiguous}{\code{logical; length 1} If \code{FALSE}, children taxa with words like "unclassified", "unknown", "uncultured", or "sp." are removed from the output. NOTE: This option only applies when \code{out_type = "summary"}.} \item{...}{Curl options passed on to \code{\link[httr]{GET}}} } \value{ The output type depends on the value of the \code{out_type} parameter. Taxa that cannot be found will result in \code{NA}s and a lack of children results in an empty data structure. } \description{ Search the NCBI Taxonomy database for uids of children of taxa. Taxa can be referenced by name or uid. Referencing by name is faster. In a few cases, different taxa have the same name (e.g. Satyrium; see examples). If one of these are searched for then the children of both taxa will be returned. This can be avoided by using a uid instead of the name or specifying an ancestor. If an ancestor is provided, only children of both the taxon and its ancestor are returned. This will only fail if there are two taxa with the same name and the same specified ancestor. } \examples{ \dontrun{ ncbi_children(name="Satyrium") #Satyrium is the name of two different genera ncbi_children(name="Satyrium", ancestor="Eumaeini") # A genus of butterflies ncbi_children(name="Satyrium", ancestor="Orchidaceae") # A genus of orchids ncbi_children(id="266948") #"266948" is the uid for the butterfly genus ncbi_children(id="62858") #"62858" is the uid for the orchid genus # use curl options library("httr") ncbi_children(name="Satyrium", ancestor="Eumaeini", config=verbose()) } } \seealso{ \code{\link{ncbi_get_taxon_summary}}, \code{\link[taxize]{children}} } \author{ Zachary Foster \email{zacharyfoster1989@gmail.com} } taxize/man/tpl_search-defunct.Rd0000644000176200001440000000042613057575431016406 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/tpl_search.r \name{tpl_search} \alias{tpl_search} \title{A light wrapper around the taxonstand fxn to call Theplantlist.org database.} \usage{ tpl_search() } \description{ THIS FUNCTION IS DEFUNCT. } taxize/man/eubon_hierarchy.Rd0000644000176200001440000000314313060060133015757 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/eubon_hierarchy.R \name{eubon_hierarchy} \alias{eubon_hierarchy} \title{EUBON hierarchy} \usage{ eubon_hierarchy(id, providers = "pesi", timeout = 0, ...) } \arguments{ \item{id}{(character) identifier for the taxon. (LSID, DOI, URI, or any other identifier used by the checklist provider)} \item{providers}{(character) A list of provider id strings concatenated by comma characters. The default : "pesi,bgbm-cdm-server[col]" will be used if this parameter is not set. A list of all available provider ids can be obtained from the '/capabilities' service end point. Providers can be nested, that is a parent provider can have sub providers. If the id of the parent provider is supplied all subproviders will be queried. The query can also be restricted to one or more subproviders by using the following syntax: parent-id[sub-id-1,sub-id2,...]} \item{timeout}{(numeric) The maximum of milliseconds to wait for responses from any of the providers. If the timeout is exceeded the service will just return the responses that have been received so far. The default timeout is 0 ms (wait for ever)} \item{...}{Curl options passed on to \code{\link[httr]{GET}}} } \description{ EUBON hierarchy } \examples{ \dontrun{ eubon_hierarchy(id = "urn:lsid:marinespecies.org:taxname:126141", 'worms') eubon_hierarchy(id = "urn:lsid:marinespecies.org:taxname:274350", 'worms') } } \references{ \url{http://cybertaxonomy.eu/eu-bon/utis/1.2/doc.html} } \seealso{ Other eubon-methods: \code{\link{eubon_capabilities}}, \code{\link{eubon_children}}, \code{\link{eubon}} } taxize/man/nbn_search.Rd0000644000176200001440000000314713067674175014747 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/nbn_search.R \name{nbn_search} \alias{nbn_search} \title{Search UK National Biodiversity Network} \usage{ nbn_search(q, fq = NULL, order = NULL, sort = NULL, start = 0, rows = 25, facets = NULL, ...) } \arguments{ \item{q}{(character) The query terms(s)} \item{fq}{(character) Filters to be applied to the original query. These are additional params of the form fq=INDEXEDFIELD:VALUE e.g. fq=rank:kingdom. See for all the fields that are queryable.} \item{order}{(character) Supports "asc" or "desc"} \item{sort}{(character) The indexed field to sort by} \item{start}{(integer) Record offset, to enable paging} \item{rows}{(integer) Number of records to return} \item{facets}{(list) Comma separated list of the fields to create facets on e.g. facets=basis_of_record.} \item{...}{Further args passed on to \code{\link[httr]{GET}}.} } \value{ a list with slots for metadata (`meta`) with list of response attributes, and data (`data``) with a data.frame of results } \description{ Search UK National Biodiversity Network } \examples{ \dontrun{ x <- nbn_search(q = "Vulpes") x$meta$totalRecords x$meta$pageSize x$meta$urlParameters x$meta$queryTitle head(x$data) nbn_search(q = "blackbird", start = 4) # debug curl stuff library('httr') nbn_search(q = "blackbird", config = verbose()) } } \references{ } \seealso{ Other nbn: \code{\link{get_nbnid}}, \code{\link{nbn_classification}}, \code{\link{nbn_synonyms}} } \author{ Scott Chamberlain, \email{myrmecocystus@gmail.com} } taxize/man/itis_downstream.Rd0000644000176200001440000000367113057575431016054 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/itis_downstream.R \name{itis_downstream} \alias{itis_downstream} \title{Retrieve all taxa names or TSNs downstream in hierarchy from given TSN.} \usage{ itis_downstream(tsns, downto, intermediate = FALSE, ...) } \arguments{ \item{tsns}{A taxonomic serial number.} \item{downto}{The taxonomic level you want to go down to. See examples below. The taxonomic level IS case sensitive, and you do have to spell it correctly. See \code{data(rank_ref)} for spelling.} \item{intermediate}{(logical) If TRUE, return a list of length two with target taxon rank names, with additional list of data.frame's of intermediate taxonomic groups. Default: FALSE} \item{...}{Further args passed on to \code{\link[ritis]{rank_name}} and \code{\link[ritis]{hierarchy_down}}} } \value{ Data.frame of taxonomic information downstream to family from e.g., Order, Class, etc., or if \code{intermediated=TRUE}, list of length two, with target taxon rank names, and intermediate names. } \description{ Retrieve all taxa names or TSNs downstream in hierarchy from given TSN. } \examples{ \dontrun{ ## the plant class Bangiophyceae, tsn 846509 itis_downstream(tsns = 846509, downto="genus") itis_downstream(tsns = 846509, downto="genus", intermediate=TRUE) # get families downstream from Acridoidea itis_downstream(tsns = 650497, "family") ## here, intermediate leads to the same result as the target itis_downstream(tsns = 650497, "family", intermediate=TRUE) # get species downstream from Ursus itis_downstream(tsns = 180541, "species") # get orders down from the Division Rhodophyta (red algae) itis_downstream(tsns = 660046, "order") itis_downstream(tsns = 660046, "order", intermediate=TRUE) # get tribes down from the family Apidae itis_downstream(tsns = 154394, downto="tribe") itis_downstream(tsns = 154394, downto="tribe", intermediate=TRUE) } } \author{ Scott Chamberlain \email{myrmecocystus@gmail.com} } taxize/man/tax_name.Rd0000644000176200001440000000406513160514406014421 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/tax_name.R \name{tax_name} \alias{tax_name} \title{Get taxonomic names for a given rank} \usage{ tax_name(query, get, db = "itis", pref = "ncbi", verbose = TRUE, ...) } \arguments{ \item{query}{(character) Vector of taxonomic names to query. required.} \item{get}{(character) The ranks of the taxonomic name to get, see \code{\link{rank_ref}}. required.} \item{db}{(character) The database to search from: 'itis', 'ncbi' or 'both'. If 'both' both NCBI and ITIS will be queried. Result will be the union of both.} \item{pref}{(character) If db = 'both', sets the preference for the union. Either 'ncbi' (default) or 'itis'. Currently not implemented.} \item{verbose}{(logical) If \code{TRUE} the actual taxon queried is printed on the console.} \item{...}{Other arguments passed to \code{\link{get_tsn}} or \code{\link{get_uid}}.} } \value{ A data.frame with one column for every queried rank, in addition to a column for db and queried term. } \description{ Get taxonomic names for a given rank } \note{ While \code{\link{tax_rank}} returns the actual rank of a taxon, \code{\link{tax_name}} searches and returns any specified rank higher in taxonomy. } \examples{ \dontrun{ # A case where itis and ncbi use the same names tax_name(query = "Helianthus annuus", get = "family", db = "itis") tax_name(query = "Helianthus annuus", get = "family", db = "ncbi") tax_name(query = "Helianthus annuus", get = c("genus","family","order"), db = "ncbi") # Case where itis and ncbi use different names tax_name(query = "Helianthus annuus", get = "kingdom", db = "itis") tax_name(query = "Helianthus annuus", get = "kingdom", db = "ncbi") # multiple rank arguments tax_name(query = c("Helianthus annuus","Baetis rhodani"), get = c("genus", "kingdom"), db = "ncbi") tax_name(query = c("Helianthus annuus","Baetis rhodani"), get = c("genus", "kingdom"), db = "itis") # query both sources tax_name(query=c("Helianthus annuus", 'Baetis rhodani'), get=c("genus", "kingdom"), db="both") } } \seealso{ \code{\link{classification}} } taxize/man/get_wiki.Rd0000644000176200001440000000712613160514701014426 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_wiki.R \name{get_wiki} \alias{get_wiki} \alias{as.wiki} \alias{as.wiki.wiki} \alias{as.wiki.character} \alias{as.wiki.list} \alias{as.wiki.numeric} \alias{as.wiki.data.frame} \alias{as.data.frame.wiki} \alias{get_wiki_} \title{Get the page name for a Wiki taxon} \usage{ get_wiki(x, wiki_site = "species", wiki = "en", ask = TRUE, verbose = TRUE, limit = 100, rows = NA, ...) as.wiki(x, check = TRUE, wiki_site = "species", wiki = "en") \method{as.wiki}{wiki}(x, check = TRUE, wiki_site = "species", wiki = "en") \method{as.wiki}{character}(x, check = TRUE, wiki_site = "species", wiki = "en") \method{as.wiki}{list}(x, check = TRUE, wiki_site = "species", wiki = "en") \method{as.wiki}{numeric}(x, check = TRUE, wiki_site = "species", wiki = "en") \method{as.wiki}{data.frame}(x, check = TRUE, wiki_site = "species", wiki = "en") \method{as.data.frame}{wiki}(x, ...) get_wiki_(x, verbose = TRUE, wiki_site = "species", wiki = "en", limit = 100, rows = NA, ...) } \arguments{ \item{x}{(character) A vector of common or scientific names.} \item{wiki_site}{(character) Wiki site. One of species (default), pedia, commons} \item{wiki}{(character) language. Default: en} \item{ask}{logical; should get_wiki be run in interactive mode? If \code{TRUE} and more than one wiki is found for the species, the user is asked for input. If \code{FALSE} NA is returned for multiple matches.} \item{verbose}{logical; should progress be printed?} \item{limit}{(integer) number of records to return} \item{rows}{numeric; Any number from 1 to infinity. If the default NA, all rows are considered. Note that this function still only gives back a wiki class object with one to many identifiers. See \code{\link[taxize]{get_wiki_}} to get back all, or a subset, of the raw data that you are presented during the ask process.} \item{...}{Ignored} \item{check}{logical; Check if ID matches any existing on the DB, only used in \code{\link{as.wiki}}} } \value{ A vector of taxonomic identifiers as an S3 class. If a taxon is not found an \code{NA} is given. If more than one identifier is found the function asks for user input if \code{ask = TRUE}, otherwise returns \code{NA}. If \code{ask=FALSE} and \code{rows} does not equal \code{NA}, then a data.frame is given back, but not of the uid class, which you can't pass on to other functions as you normally can. See \code{\link{get_id_details}} for further details including attributes and exceptions } \description{ Get the page name for a Wiki taxon } \details{ For \code{type = pedia}, we use the english language site by default. Set the \code{language} parameter for a different language site. } \examples{ \dontrun{ get_wiki(x = "Quercus douglasii") get_wiki(x = "Quercu") get_wiki(x = "Quercu", "pedia") get_wiki(x = "Quercu", "commons") # diff. wikis with wikipedia get_wiki("Malus domestica", "pedia") get_wiki("Malus domestica", "pedia", "fr") # as coercion as.wiki("Malus_domestica") as.wiki("Malus_domestica", wiki_site = "commons") as.wiki("Malus_domestica", wiki_site = "pedia") as.wiki("Malus_domestica", wiki_site = "pedia", wiki = "fr") as.wiki("Malus_domestica", wiki_site = "pedia", wiki = "da") } } \seealso{ \code{\link[taxize]{classification}} Other taxonomic-ids: \code{\link{get_boldid}}, \code{\link{get_colid}}, \code{\link{get_eolid}}, \code{\link{get_gbifid}}, \code{\link{get_ids}}, \code{\link{get_iucn}}, \code{\link{get_natservid}}, \code{\link{get_nbnid}}, \code{\link{get_tolid}}, \code{\link{get_tpsid}}, \code{\link{get_tsn}}, \code{\link{get_uid}}, \code{\link{get_wormsid}} } taxize/man/lowest_common.Rd0000644000176200001440000001134313057575431015521 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/lowest_common.R \name{lowest_common} \alias{lowest_common} \alias{lowest_common.default} \alias{lowest_common.uid} \alias{lowest_common.tsn} \alias{lowest_common.gbifid} \alias{lowest_common.colid} \alias{lowest_common.tolid} \title{Retrieve the lowest common taxon and rank for a given taxon name or ID} \usage{ lowest_common(...) \method{lowest_common}{default}(x, db = NULL, rows = NA, class_list = NULL, low_rank = NULL, ...) \method{lowest_common}{uid}(x, class_list = NULL, low_rank = NULL, ...) \method{lowest_common}{tsn}(x, class_list = NULL, low_rank = NULL, ...) \method{lowest_common}{gbifid}(x, class_list = NULL, low_rank = NULL, ...) \method{lowest_common}{colid}(x, class_list = NULL, low_rank = NULL, ...) \method{lowest_common}{tolid}(x, class_list = NULL, low_rank = NULL, ...) } \arguments{ \item{...}{Other arguments passed to \code{\link[taxize]{get_tsn}}, \code{\link[taxize]{get_uid}}, \code{\link[taxize]{get_colid}}, \code{\link[taxize]{get_gbifid}}, \code{\link[taxize]{get_tolid}}} \item{x}{Vector of taxa names (character) or id (character or numeric) to query.} \item{db}{character; database to query. either \code{ncbi}, \code{itis}, \code{gbif}, \code{col}, or \code{tol}} \item{rows}{(numeric) Any number from 1 to infinity. If the default NA, all rows are considered. Note that this parameter is ignored if you pass in a taxonomic id of any of the acceptable classes: tsn, colid, gbifid, tolid. NCBI has a method for this function but rows doesn't work.} \item{class_list}{(list) A list of classifications, as returned from \code{\link[taxize]{classification}}} \item{low_rank}{(character) taxonomic rank to return, of length 1} } \value{ NA when no match, or a data.frame with columns \itemize{ \item name \item rank \item id } } \description{ Retrieve the lowest common taxon and rank for a given taxon name or ID } \examples{ \dontrun{ id <- c("9031", "9823", "9606", "9470") id_class <- classification(id, db = 'ncbi') lowest_common(id[2:4], db = "ncbi") lowest_common(id[2:4], db = "ncbi", low_rank = 'class') lowest_common(id[2:4], db = "ncbi", low_rank = 'family') lowest_common(id[2:4], class_list = id_class) lowest_common(id[2:4], class_list = id_class, low_rank = 'class') lowest_common(id[2:4], class_list = id_class, low_rank = 'family') # COL taxa <- c('Nycticebus coucang', 'Homo sapiens', 'Sus scrofa') cls <- classification(taxa, db = "col") lowest_common(taxa, class_list = cls, db = "col") lowest_common(get_colid(taxa), class_list = cls) xx <- get_colid(taxa) lowest_common(xx, class_list = cls) # TOL taxa <- c("Angraecum sesquipedale", "Dracula vampira", "Masdevallia coccinea") (cls <- classification(taxa, db = "tol")) lowest_common(taxa, db = "tol", class_list = cls) lowest_common(get_tolid(taxa), class_list = cls) xx <- get_tolid(taxa) lowest_common(xx, class_list = cls) spp <- c("Sus scrofa", "Homo sapiens", "Nycticebus coucang") lowest_common(spp, db = "ncbi") lowest_common(get_uid(spp)) lowest_common(spp, db = "itis") lowest_common(get_tsn(spp)) gbifid <- c("2704179", "3119195") lowest_common(gbifid, db = "gbif") spp <- c("Poa annua", "Helianthus annuus") lowest_common(spp, db = "gbif") lowest_common(get_gbifid(spp)) cool_orchid <- c("Angraecum sesquipedale", "Dracula vampira", "Masdevallia coccinea") orchid_ncbi <- get_uid(cool_orchid) orchid_gbif <- get_gbifid(cool_orchid) cool_orchids2 <- c("Domingoa haematochila", "Gymnadenia conopsea", "Masdevallia coccinea") orchid_itis <- get_tsn(cool_orchids2) orchid_hier_ncbi <- classification(orchid_ncbi, db = 'ncbi') orchid_hier_gbif <- classification(orchid_gbif, db = 'gbif') orchid_hier_itis <- classification(orchid_itis, db = 'itis') lowest_common(orchid_ncbi, low_rank = 'class') lowest_common(orchid_ncbi, class_list = orchid_hier_ncbi, low_rank = 'class') lowest_common(orchid_gbif, low_rank = 'class') lowest_common(orchid_gbif, orchid_hier_gbif, low_rank = 'class') lowest_common(get_uid(cool_orchid), low_rank = 'class') lowest_common(get_uid(cool_orchid), low_rank = 'family') lowest_common(orchid_ncbi, class_list = orchid_hier_ncbi, low_rank = 'subfamily') lowest_common(orchid_gbif, class_list = orchid_hier_gbif, low_rank = 'subfamily') lowest_common(orchid_itis, class_list = orchid_hier_itis, low_rank = 'class') ## Pass in sci. names nms <- c("Angraecum sesquipedale", "Dracula vampira", "Masdevallia coccinea") lowest_common(x = nms, db = "ncbi") lowest_common(x = nms, db = "gbif") # lowest_common(x = nms, db = "itis") ## NAs due to taxon not found, stops with error message # lowest_common(orchid_itis, db = "itis") # lowest_common(get_tsn(cool_orchid)) } } \author{ Jimmy O'Donnell \email{jodonnellbio@gmail.com} Scott Chamberlain \email{myrmecocystus@gmail.com} } taxize/man/tax_rank.Rd0000644000176200001440000000344213114320014014417 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/tax_rank.R \name{tax_rank} \alias{tax_rank} \title{Get rank for a given taxonomic name.} \usage{ tax_rank(x, db = NULL, ...) } \arguments{ \item{x}{(character) Vector of one or more taxon names (character) or IDs (character or numeric) to query. Or objects returned from \code{get_*()} functions like \code{\link{get_tsn}}} \item{db}{(character) database to query. either \code{ncbi}, \code{itis}, \code{eol}, \code{col}, \code{tropicos}, \code{gbif}, \code{nbn}, \code{worms}, \code{natserv}, \code{bold}. Note that each taxonomic data source has their own identifiers, so that if you provide the wrong \code{db} value for the identifier you may get a result, but it will likely be wrong (not what you were expecting).} \item{...}{Additional arguments to \code{\link{classification}}} } \value{ A named list of character vectors with ranks (all lower-cased) } \description{ Get rank for a given taxonomic name. } \note{ While \code{\link[taxize]{tax_name}} returns the name of a specified rank, \code{\link[taxize]{tax_rank}} returns the actual rank of the taxon. } \examples{ \dontrun{ tax_rank(x = "Helianthus annuus", db = "itis") tax_rank(get_tsn("Helianthus annuus")) tax_rank(c("Helianthus", "Pinus", "Poa"), db = "itis") tax_rank(get_boldid("Helianthus annuus")) tax_rank("421377", db = "bold") tax_rank(421377, db = "bold") tax_rank(c("Plantae", "Helianthus annuus", "Puma", "Homo sapiens"), db = 'itis') tax_rank(c("Helianthus annuus", "Quercus", "Fabaceae"), db = 'tropicos') tax_rank(names_list("species"), db = 'gbif') tax_rank(names_list("family"), db = 'gbif') tax_rank(c("Platanista gangetica", "Lichenopora neapolitana"), db = "worms") } } \seealso{ \code{\link[taxize]{classification}}, \code{\link[taxize]{tax_name}} } taxize/man/scrapenames.Rd0000644000176200001440000000716613124513252015131 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/scrapenames.r \name{scrapenames} \alias{scrapenames} \title{Resolve names using Global Names Recognition and Discovery.} \usage{ scrapenames(url = NULL, file = NULL, text = NULL, engine = NULL, unique = NULL, verbatim = NULL, detect_language = NULL, all_data_sources = NULL, data_source_ids = NULL, return_content = FALSE, ...) } \arguments{ \item{url}{An encoded URL for a web page, PDF, Microsoft Office document, or image file, see examples} \item{file}{When using multipart/form-data as the content-type, a file may be sent. This should be a path to your file on your machine.} \item{text}{Type: string. Text content; best used with a POST request, see examples} \item{engine}{(optional) (integer) Default: 0. Either 1 for TaxonFinder, 2 for NetiNeti, or 0 for both. If absent, both engines are used.} \item{unique}{(optional) (logical) If \code{TRUE} (default), response has unique names without offsets.} \item{verbatim}{(optional) Type: boolean, If \code{TRUE} (default to \code{FALSE}), response excludes verbatim strings.} \item{detect_language}{(optional) Type: boolean, When \code{TRUE} (default), NetiNeti is not used if the language of incoming text is determined not to be English. When \code{FALSE}, NetiNeti will be used if requested.} \item{all_data_sources}{(optional) Type: boolean. Resolve found names against all available Data Sources.} \item{data_source_ids}{(optional) Type: string. Pipe separated list of data source ids to resolve found names against. See list of Data Sources \url{http://resolver.globalnames.org/data_sources}.} \item{return_content}{(logical) return OCR'ed text. returns text string in \code{x$meta$content} slot. Default: \code{FALSE}} \item{...}{Further args passed to \code{\link[httr]{GET}}} } \value{ A list of length two, first is metadata, second is the data as a data.frame. } \description{ Uses the Global Names Recognition and Discovery service, see \url{http://gnrd.globalnames.org/}. Note: this function sometimes gives data back and sometimes not. The API that this function is extremely buggy. } \details{ One of url, file, or text must be specified - and only one of them. } \examples{ \dontrun{ # Get data from a website using its URL scrapenames('http://en.wikipedia.org/wiki/Araneae') scrapenames('http://en.wikipedia.org/wiki/Animalia') scrapenames('http://www.plosone.org/article/info\%3Adoi\%2F10.1371\%2Fjournal.pone.0095068') scrapenames('http://www.plosone.org/article/info\%3Adoi\%2F10.1371\%2Fjournal.pone.0080498') scrapenames('http://ucjeps.berkeley.edu/cgi-bin/get_JM_treatment.pl?CARYOPHYLLACEAE') # Scrape names from a pdf at a URL url <- 'http://www.plosone.org/article/fetchObject.action?uri= info\%3Adoi\%2F10.1371\%2Fjournal.pone.0058268&representation=PDF' scrapenames(url = sub('\\n', '', url)) # With arguments scrapenames(url = 'http://www.mapress.com/zootaxa/2012/f/z03372p265f.pdf', unique=TRUE) scrapenames(url = 'http://en.wikipedia.org/wiki/Araneae', data_source_ids=c(1, 169)) # Get data from a file speciesfile <- system.file("examples", "species.txt", package = "taxize") scrapenames(file = speciesfile) nms <- paste0(names_list("species"), collapse="\\n") file <- tempfile(fileext = ".txt") writeLines(nms, file) scrapenames(file = file) # Get data from text string scrapenames(text='A spider named Pardosa moesta Banks, 1892') # return OCR content scrapenames(url='http://www.mapress.com/zootaxa/2012/f/z03372p265f.pdf', return_content = TRUE) # use curl options library("httr") scrapenames(text='A spider named Pardosa moesta Banks, 1892') } } \author{ Scott Chamberlain {myrmecocystus@gmail.com} } taxize/man/eol_hierarchy-defunct.Rd0000644000176200001440000000044413057575430017076 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/eol_hierarchy.R \name{eol_hierarchy} \alias{eol_hierarchy} \title{Retrieve the taxonomic hierarchy from given EOL taxonID.} \usage{ eol_hierarchy(...) } \description{ THIS FUNCTION IS DEFUNCT. } \keyword{internal} taxize/man/tp_namereferences-deprecated.Rd0000644000176200001440000000122613057575431020416 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/tp_refs.R \name{tp_namereferences} \alias{tp_namereferences} \title{Return all reference records for for a taxon name with a given id.} \usage{ tp_namereferences(id, format = "json", output = "df", key = NULL, verbose = TRUE) } \arguments{ \item{id}{the taxon identifier code} \item{format}{return in json or xml format (defaults to json)} \item{output}{raw = json or xml; or df = data.frame} \item{key}{Your Tropicos API key; loads from .Rprofile.} \item{verbose}{Print messages (default) or not, logical} } \description{ Function name changed to tp_refs. } \keyword{internal} taxize/man/resolve.Rd0000644000176200001440000000437613057575431014323 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/resolve.R \name{resolve} \alias{resolve} \title{Resolve names from different data sources} \usage{ resolve(query, db = "gnr", ...) } \arguments{ \item{query}{Vector of one or more taxonomic names (common names not supported)} \item{db}{Source to check names against. One of iplant, tnrs, or gnr. Default: gnr Note that each taxonomic data source has their own identifiers, so that if you provide the wrong \code{db} value for the identifier you could get a result, but it will likely be wrong (not what you were expecting).} \item{...}{Curl options passed on to \code{\link[httr]{GET}} or \code{\link[httr]{POST}}. In addition, further named args passed on to each respective function. See examples} } \value{ A list with length equal to length of the db parameter (number of sources requested), with each element being a data.frame or list with results from that source. } \description{ Resolve names from iPlant's name resolver, the Taxonomic Name Resolution Service (TNRS), and the Global Names Resolver (GNR) } \examples{ \dontrun{ resolve(query=c("Helianthus annuus", "Homo sapiens")) resolve(query="Quercus keloggii", db='gnr') resolve(query=c("Helianthus annuus", "Homo sapiens"), db='tnrs') resolve(query=c("Helianthus annuus", "Homo sapiens"), db=c('iplant', 'gnr')) resolve(query="Quercus keloggii", db=c('iplant', 'gnr')) resolve(query="Quercus keloggii", db=c('iplant', 'gnr', 'tnrs')) # pass in options specific to each source resolve("Helianthus annuus", db = 'gnr', preferred_data_sources = c(3, 4)) resolve("Helianthus annuus", db = 'iplant', retrieve = 'best') identical( resolve("Helianthus annuus", db = 'iplant', retrieve = 'best')$iplant, iplant_resolve("Helianthus annuus", retrieve = 'best') ) mynames <- c("Helianthus annuus", "Pinus contorta", "Poa annua", "Abies magnifica", "Rosa california") resolve(mynames, db = 'tnrs', source = "NCBI") resolve(mynames, db = 'tnrs', source = "iPlant_TNRS") identical( resolve(mynames, db = 'tnrs', source = "iPlant_TNRS")$tnrs, tnrs(mynames, source = "iPlant_TNRS") ) # pass in curl options library("httr") resolve(query="Qercuss", db = "iplant", config=verbose()) res <- resolve(query=c("Helianthus annuus", "Homo sapiens"), config=progress()) } } taxize/man/get_uid.Rd0000644000176200001440000001672513160514701014251 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_uid.R \name{get_uid} \alias{get_uid} \alias{as.uid} \alias{as.uid.uid} \alias{as.uid.character} \alias{as.uid.list} \alias{as.uid.numeric} \alias{as.uid.data.frame} \alias{as.data.frame.uid} \alias{get_uid_} \title{Get the UID codes from NCBI for taxonomic names.} \usage{ get_uid(sciname, ask = TRUE, verbose = TRUE, rows = NA, modifier = NULL, rank_query = NULL, division_filter = NULL, rank_filter = NULL, ...) as.uid(x, check = TRUE) \method{as.uid}{uid}(x, check = TRUE) \method{as.uid}{character}(x, check = TRUE) \method{as.uid}{list}(x, check = TRUE) \method{as.uid}{numeric}(x, check = TRUE) \method{as.uid}{data.frame}(x, check = TRUE) \method{as.data.frame}{uid}(x, ...) get_uid_(sciname, verbose = TRUE, rows = NA) } \arguments{ \item{sciname}{character; scientific name.} \item{ask}{logical; should get_uid be run in interactive mode? If TRUE and more than one TSN is found for the species, the user is asked for input. If FALSE NA is returned for multiple matches.} \item{verbose}{logical; If TRUE the actual taxon queried is printed on the console.} \item{rows}{numeric; Any number from 1 to infinity. If the default NA, all rows are considered. Note that this function still only gives back a uid class object with one to many identifiers. See \code{\link[taxize]{get_uid_}} to get back all, or a subset, of the raw data that you are presented during the ask process.} \item{modifier}{(character) A modifier to the \code{sciname} given. Options include: Organism, Scientific Name, Common Name, All Names, Division, Filter, Lineage, GC, MGC, Name Tokens, Next Level, PGC, Properties, Rank, Subtree, Synonym, Text Word. These are not checked, so make sure they are entered correctly, as is.} \item{rank_query}{(character) A taxonomic rank name to modify the query sent to NCBI. See \code{\link{rank_ref}} for possible options. Though note that some data sources use atypical ranks, so inspect the data itself for options. Optional. See \code{Querying} below.} \item{division_filter}{(character) A division (aka phylum) name to filter data after retrieved from NCBI. Optional. See \code{Filtering} below.} \item{rank_filter}{(character) A taxonomic rank name to filter data after retrieved from NCBI. See \code{\link{rank_ref}} for possible options. Though note that some data sources use atypical ranks, so inspect the data itself for options. Optional. See \code{Filtering} below.} \item{...}{Ignored} \item{x}{Input to \code{\link{as.uid}}} \item{check}{logical; Check if ID matches any existing on the DB, only used in \code{\link{as.uid}}} } \value{ A vector of taxonomic identifiers as an S3 class. If a taxon is not found an \code{NA} is given. If more than one identifier is found the function asks for user input if \code{ask = TRUE}, otherwise returns \code{NA}. If \code{ask=FALSE} and \code{rows} does not equal \code{NA}, then a data.frame is given back, but not of the uid class, which you can't pass on to other functions as you normally can. See \code{\link{get_id_details}} for further details including attributes and exceptions } \description{ Retrieve the Unique Identifier (UID) of a taxon from NCBI taxonomy browser. } \section{Querying}{ The parameter \code{rank_query} is used in the search sent to NCBI, whereas \code{rank_filter} filters data after it comes back. The parameter \code{modifier} adds modifiers to the name. For example, \code{modifier="Organism"} adds that to the name, giving e.g., \code{Helianthus[Organism]}. } \section{Filtering}{ The parameters \code{division_filter} and \code{rank_filter} are not used in the search to the data provider, but are used in filtering the data down to a subset that is closer to the target you want. For all these parameters, you can use regex strings since we use \code{\link{grep}} internally to match. Filtering narrows down to the set that matches your query, and removes the rest. } \section{Beware}{ NCBI does funny things sometimes. E.g., if you search on Fringella morel, a slight misspelling of the genus name, and a non-existent epithet, NCBI gives back a morel fungal species. In addition, NCBI doesn't really do fuzzy searching very well, so if there is a slight mis-spelling in your names, you likely won't get what you are expecting. The lesson: clean your names before using this function. Other data sources are better about fuzzy matching. } \examples{ \dontrun{ get_uid(c("Chironomus riparius", "Chaetopteryx")) get_uid(c("Chironomus riparius", "aaa vva")) # When not found get_uid("howdy") get_uid(c("Chironomus riparius", "howdy")) # Narrow down results to a division or rank, or both ## By modifying the query ### w/ modifiers to the name get_uid(sciname = "Aratinga acuticauda", modifier = "Organism") get_uid(sciname = "bear", modifier = "Common Name") ### w/ rank query get_uid(sciname = "Pinus", rank_query = "genus") get_uid(sciname = "Pinus", rank_query = "subgenus") ### division query doesn't really work, for unknown reasons, so not available ## By filtering the result ## Echinacea example ### Results w/o narrowing get_uid("Echinacea") ### w/ division get_uid(sciname = "Echinacea", division_filter = "eudicots") get_uid(sciname = "Echinacea", division_filter = "sea urchins") ## Satyrium example ### Results w/o narrowing get_uid(sciname = "Satyrium") ### w/ division get_uid(sciname = "Satyrium", division_filter = "monocots") get_uid(sciname = "Satyrium", division_filter = "butterflies") ## Rank example get_uid(sciname = "Pinus") get_uid(sciname = "Pinus", rank_filter = "genus") get_uid(sciname = "Pinus", rank_filter = "subgenus") # Fuzzy filter on any filtering fields ## uses grep on the inside get_uid("Satyrium", division_filter = "m") # specify rows to limit choices available get_uid('Dugesia') # user prompt needed get_uid('Dugesia', rows=1) # 2 choices, so returns only 1 row, so no choices get_uid('Dugesia', ask = FALSE) # returns NA for multiple matches # Go to a website with more info on the taxon res <- get_uid("Chironomus riparius") browseURL(attr(res, "uri")) # Convert a uid without class information to a uid class as.uid(get_uid("Chironomus riparius")) # already a uid, returns the same as.uid(get_uid(c("Chironomus riparius","Pinus contorta"))) # same as.uid(315567) # numeric as.uid(c(315567,3339,9696)) # numeric vector, length > 1 as.uid("315567") # character as.uid(c("315567","3339","9696")) # character vector, length > 1 as.uid(list("315567","3339","9696")) # list, either numeric or character ## dont check, much faster as.uid("315567", check=FALSE) as.uid(315567, check=FALSE) as.uid(c("315567","3339","9696"), check=FALSE) as.uid(list("315567","3339","9696"), check=FALSE) (out <- as.uid(c(315567,3339,9696))) data.frame(out) as.uid( data.frame(out) ) # Get all data back get_uid_("Puma concolor") get_uid_("Dugesia") get_uid_("Dugesia", rows=2) get_uid_("Dugesia", rows=1:2) get_uid_(c("asdfadfasd","Pinus contorta")) # use curl options library("httr") get_uid("Quercus douglasii", config=verbose()) bb <- get_uid("Quercus douglasii", config=progress()) } } \seealso{ \code{\link[taxize]{classification}} Other taxonomic-ids: \code{\link{get_boldid}}, \code{\link{get_colid}}, \code{\link{get_eolid}}, \code{\link{get_gbifid}}, \code{\link{get_ids}}, \code{\link{get_iucn}}, \code{\link{get_natservid}}, \code{\link{get_nbnid}}, \code{\link{get_tolid}}, \code{\link{get_tpsid}}, \code{\link{get_tsn}}, \code{\link{get_wiki}}, \code{\link{get_wormsid}} } \author{ Eduard Szoecs, \email{eduardszoecs@gmail.com} } taxize/man/tp_synonyms.Rd0000644000176200001440000000105713057575431015237 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/tp_synonyms.R \name{tp_synonyms} \alias{tp_synonyms} \title{Return all synonyms for a taxon name with a given id.} \usage{ tp_synonyms(id, key = NULL, ...) } \arguments{ \item{id}{the taxon identifier code} \item{key}{Your Tropicos API key; loads from .Rprofile.} \item{...}{Curl options passed on to \code{\link[httr]{GET}}} } \value{ List or dataframe. } \description{ Return all synonyms for a taxon name with a given id. } \examples{ \dontrun{ tp_synonyms(id = 25509881) } } taxize/man/get_wormsid.Rd0000644000176200001440000001064013160564347015155 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_wormsid.R \name{get_wormsid} \alias{get_wormsid} \alias{as.wormsid} \alias{as.wormsid.wormsid} \alias{as.wormsid.character} \alias{as.wormsid.list} \alias{as.wormsid.numeric} \alias{as.wormsid.data.frame} \alias{as.data.frame.wormsid} \alias{get_wormsid_} \title{Get Worms ID for a taxon name} \usage{ get_wormsid(query, searchtype = "scientific", accepted = FALSE, ask = TRUE, verbose = TRUE, rows = NA, ...) as.wormsid(x, check = TRUE) \method{as.wormsid}{wormsid}(x, check = TRUE) \method{as.wormsid}{character}(x, check = TRUE) \method{as.wormsid}{list}(x, check = TRUE) \method{as.wormsid}{numeric}(x, check = TRUE) \method{as.wormsid}{data.frame}(x, check = TRUE) \method{as.data.frame}{wormsid}(x, ...) get_wormsid_(query, verbose = TRUE, searchtype = "scientific", accepted = TRUE, rows = NA, ...) } \arguments{ \item{query}{character; A vector of common or scientific names.} \item{searchtype}{character; One of 'scientific' or 'common', or any unique abbreviation} \item{accepted}{logical; If TRUE, removes names that are not accepted valid names by WORMS. Set to \code{FALSE} (default) to give back both accepted and unaccepted names.} \item{ask}{logical; should get_wormsid be run in interactive mode? If \code{TRUE} and more than one wormsid is found for the species, the user is asked for input. If \code{FALSE} NA is returned for multiple matches.} \item{verbose}{logical; should progress be printed?} \item{rows}{numeric; Any number from 1 to infinity. If the default NaN, all rows are considered. Note that this function still only gives back a wormsid class object with one to many identifiers. See \code{\link[taxize]{get_wormsid_}} to get back all, or a subset, of the raw data that you are presented during the ask process.} \item{...}{Ignored} \item{x}{Input to as.wormsid} \item{check}{logical; Check if ID matches any existing on the DB, only used in \code{\link{as.wormsid}}} } \value{ A vector of taxonomic identifiers as an S3 class. If a taxon is not found an \code{NA} is given. If more than one identifier is found the function asks for user input if \code{ask = TRUE}, otherwise returns \code{NA}. If \code{ask=FALSE} and \code{rows} does not equal \code{NA}, then a data.frame is given back, but not of the uid class, which you can't pass on to other functions as you normally can. See \code{\link{get_id_details}} for further details including attributes and exceptions } \description{ Retrieve Worms ID of a taxon from World Register of Marine Species (WORMS). } \examples{ \dontrun{ (x <- get_wormsid('Platanista gangetica')) attributes(x) attr(x, "match") attr(x, "multiple_matches") attr(x, "pattern_match") attr(x, "uri") get_wormsid('Gadus morhua') get_wormsid('Pomatomus saltatrix') get_wormsid(c("Platanista gangetica", "Lichenopora neapolitana")) # by common name get_wormsid("dolphin", 'common') get_wormsid("clam", 'common') # specify rows to limit choices available get_wormsid('Plat') get_wormsid('Plat', rows=1) get_wormsid('Plat', rows=1:2) # When not found get_wormsid("howdy") get_wormsid(c('Gadus morhua', "howdy")) # Convert a wormsid without class information to a wormsid class # already a wormsid, returns the same as.wormsid(get_wormsid('Gadus morhua')) # same as.wormsid(get_wormsid(c('Gadus morhua', 'Pomatomus saltatrix'))) # numeric as.wormsid(126436) # numeric vector, length > 1 as.wormsid(c(126436,151482)) # character as.wormsid("126436") # character vector, length > 1 as.wormsid(c("126436","151482")) # list, either numeric or character as.wormsid(list("126436","151482")) ## dont check, much faster as.wormsid("126436", check=FALSE) as.wormsid(126436, check=FALSE) as.wormsid(c("126436","151482"), check=FALSE) as.wormsid(list("126436","151482"), check=FALSE) (out <- as.wormsid(c(126436,151482))) data.frame(out) as.wormsid( data.frame(out) ) # Get all data back get_wormsid_("Plat") get_wormsid_("Plat", rows=1) get_wormsid_("Plat", rows=1:2) get_wormsid_("Plat", rows=1:75) # get_wormsid_(c("asdfadfasd","Plat"), rows=1:5) } } \seealso{ \code{\link[taxize]{classification}} Other taxonomic-ids: \code{\link{get_boldid}}, \code{\link{get_colid}}, \code{\link{get_eolid}}, \code{\link{get_gbifid}}, \code{\link{get_ids}}, \code{\link{get_iucn}}, \code{\link{get_natservid}}, \code{\link{get_nbnid}}, \code{\link{get_tolid}}, \code{\link{get_tpsid}}, \code{\link{get_tsn}}, \code{\link{get_uid}}, \code{\link{get_wiki}} } taxize/man/get_gbifid.Rd0000644000176200001440000001523713160514700014710 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_gbifid.R \name{get_gbifid} \alias{get_gbifid} \alias{as.gbifid} \alias{as.gbifid.gbifid} \alias{as.gbifid.character} \alias{as.gbifid.list} \alias{as.gbifid.numeric} \alias{as.gbifid.data.frame} \alias{as.data.frame.gbifid} \alias{get_gbifid_} \title{Get the GBIF backbone taxon ID from taxonomic names.} \usage{ get_gbifid(sciname, ask = TRUE, verbose = TRUE, rows = NA, phylum = NULL, class = NULL, order = NULL, family = NULL, rank = NULL, method = "backbone", ...) as.gbifid(x, check = FALSE) \method{as.gbifid}{gbifid}(x, check = FALSE) \method{as.gbifid}{character}(x, check = TRUE) \method{as.gbifid}{list}(x, check = TRUE) \method{as.gbifid}{numeric}(x, check = TRUE) \method{as.gbifid}{data.frame}(x, check = TRUE) \method{as.data.frame}{gbifid}(x, ...) get_gbifid_(sciname, verbose = TRUE, rows = NA, method = "backbone") } \arguments{ \item{sciname}{character; scientific name.} \item{ask}{logical; should get_colid be run in interactive mode? If TRUE and more than one ID is found for the species, the user is asked for input. If FALSE NA is returned for multiple matches.} \item{verbose}{logical; If TRUE the actual taxon queried is printed on the console.} \item{rows}{numeric; Any number from 1 to infinity. If the default NA, all rows are considered. Note that this function still only gives back a gbifid class object with one to many identifiers. See \code{\link[taxize]{get_gbifid_}} to get back all, or a subset, of the raw data that you are presented during the ask process.} \item{phylum}{(character) A phylum (aka division) name. Optional. See \code{Filtering} below.} \item{class}{(character) A class name. Optional. See \code{Filtering} below.} \item{order}{(character) An order name. Optional. See \code{Filtering} below.} \item{family}{(character) A family name. Optional. See \code{Filtering} below.} \item{rank}{(character) A taxonomic rank name. See \code{\link{rank_ref}} for possible options. Though note that some data sources use atypical ranks, so inspect the data itself for options. Optional. See \code{Filtering} below.} \item{method}{(character) one of "backbone" or "lookup". See Details.} \item{...}{Ignored} \item{x}{Input to \code{\link{as.gbifid}}} \item{check}{logical; Check if ID matches any existing on the DB, only used in \code{\link{as.gbifid}}} } \value{ A vector of taxonomic identifiers as an S3 class. If a taxon is not found an \code{NA} is given. If more than one identifier is found the function asks for user input if \code{ask = TRUE}, otherwise returns \code{NA}. If \code{ask=FALSE} and \code{rows} does not equal \code{NA}, then a data.frame is given back, but not of the uid class, which you can't pass on to other functions as you normally can. See \code{\link{get_id_details}} for further details including attributes and exceptions } \description{ Get the GBIF backbone taxon ID from taxonomic names. } \details{ Internally in this function we use a function to search GBIF's taxonomy, and if we find an exact match we return the ID for that match. If there isn't an exact match we return the options to you to pick from. } \section{method parameter}{ "backbone" uses the \code{/species/match} GBIF API route, matching against their backbone taxonomy. We turn on fuzzy matching by default, as the search without fuzzy against backbone is quite narrow. "lookup" uses the \code{/species/search} GBIF API route, doing a full text search of name usages covering scientific and vernacular named, species descriptions, distributions and the entire classification. } \section{Filtering}{ The parameters \code{phylum}, \code{class}, \code{order}, \code{family}, and \code{rank} are not used in the search to the data provider, but are used in filtering the data down to a subset that is closer to the target you want. For all these parameters, you can use regex strings since we use \code{\link{grep}} internally to match. Filtering narrows down to the set that matches your query, and removes the rest. } \examples{ \dontrun{ get_gbifid(sciname='Poa annua') get_gbifid(sciname='Pinus contorta') get_gbifid(sciname='Puma concolor') # multiple names get_gbifid(c("Poa annua", "Pinus contorta")) # specify rows to limit choices available get_gbifid(sciname='Pinus') get_gbifid(sciname='Pinus', rows=10) get_gbifid(sciname='Pinus', rows=1:3) # When not found, NA given get_gbifid(sciname="uaudnadndj") get_gbifid(c("Chironomus riparius", "uaudnadndj")) # Narrow down results to a division or rank, or both ## Satyrium example ### Results w/o narrowing get_gbifid("Satyrium") ### w/ phylum get_gbifid("Satyrium", phylum = "Tracheophyta") get_gbifid("Satyrium", phylum = "Arthropoda") ### w/ phylum & rank get_gbifid("Satyrium", phylum = "Arthropoda", rank = "genus") ## Rank example get_gbifid("Poa", method = "lookup") get_gbifid("Poa", method = "lookup", rank = "genus") get_gbifid("Poa", method = "lookup", family = "Thripidae") # Fuzzy filter on any filtering fields ## uses grep on the inside get_gbifid("Satyrium", phylum = "arthropoda") get_gbifid("A*", method = "lookup", order = "*tera") get_gbifid("A*", method = "lookup", order = "*ales") # Convert a uid without class information to a uid class as.gbifid(get_gbifid("Poa annua")) # already a uid, returns the same as.gbifid(get_gbifid(c("Poa annua","Puma concolor"))) # same as.gbifid(2704179) # numeric as.gbifid(c(2704179,2435099,3171445)) # numeric vector, length > 1 as.gbifid("2704179") # character as.gbifid(c("2704179","2435099","3171445")) # character vector, length > 1 as.gbifid(list("2704179","2435099","3171445")) # list, either numeric or character ## dont check, much faster as.gbifid("2704179", check=FALSE) as.gbifid(2704179, check=FALSE) as.gbifid(2704179, check=FALSE) as.gbifid(c("2704179","2435099","3171445"), check=FALSE) as.gbifid(list("2704179","2435099","3171445"), check=FALSE) (out <- as.gbifid(c(2704179,2435099,3171445))) data.frame(out) as.uid( data.frame(out) ) # Get all data back get_gbifid_("Puma concolor") get_gbifid_(c("Pinus", "uaudnadndj")) get_gbifid_(c("Pinus", "Puma"), rows=5) get_gbifid_(c("Pinus", "Puma"), rows=1:5) # use curl options library("httr") get_gbifid("Quercus douglasii", config=verbose()) bb <- get_gbifid("Quercus douglasii", config=progress()) } } \seealso{ \code{\link[taxize]{classification}} Other taxonomic-ids: \code{\link{get_boldid}}, \code{\link{get_colid}}, \code{\link{get_eolid}}, \code{\link{get_ids}}, \code{\link{get_iucn}}, \code{\link{get_natservid}}, \code{\link{get_nbnid}}, \code{\link{get_tolid}}, \code{\link{get_tpsid}}, \code{\link{get_tsn}}, \code{\link{get_uid}}, \code{\link{get_wiki}}, \code{\link{get_wormsid}} } \author{ Scott Chamberlain, \email{myrmecocystus@gmail.com} } taxize/man/get_colid.Rd0000644000176200001440000001355713160514700014561 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_colid.R \name{get_colid} \alias{get_colid} \alias{as.colid} \alias{as.colid.colid} \alias{as.colid.character} \alias{as.colid.list} \alias{as.colid.data.frame} \alias{as.data.frame.colid} \alias{get_colid_} \title{Get the Catalogue of Life ID from taxonomic names.} \usage{ get_colid(sciname, ask = TRUE, verbose = TRUE, rows = NA, kingdom = NULL, phylum = NULL, class = NULL, order = NULL, family = NULL, rank = NULL, ...) as.colid(x, check = TRUE) \method{as.colid}{colid}(x, check = TRUE) \method{as.colid}{character}(x, check = TRUE) \method{as.colid}{list}(x, check = TRUE) \method{as.colid}{data.frame}(x, check = TRUE) \method{as.data.frame}{colid}(x, ...) get_colid_(sciname, verbose = TRUE, rows = NA) } \arguments{ \item{sciname}{character; scientific name.} \item{ask}{logical; should get_colid be run in interactive mode? If TRUE and more than one ID is found for the species, the user is asked for input. If FALSE NA is returned for multiple matches.} \item{verbose}{logical; If TRUE the actual taxon queried is printed on the console.} \item{rows}{numeric; Any number from 1 to infinity. If the default NA, all rows are considered. Note that this function still only gives back a colid class object with one to many identifiers. See \code{\link[taxize]{get_colid_}} to get back all, or a subset, of the raw data that you are presented during the ask process.} \item{kingdom}{(character) A kingdom name. Optional. See \code{Filtering} below.} \item{phylum}{(character) A phylum (aka division) name. Optional. See \code{Filtering} below.} \item{class}{(character) A class name. Optional. See \code{Filtering} below.} \item{order}{(character) An order name. Optional. See \code{Filtering} below.} \item{family}{(character) A family name. Optional. See \code{Filtering} below.} \item{rank}{(character) A taxonomic rank name. See \code{\link{rank_ref}} for possible options. Though note that some data sources use atypical ranks, so inspect the data itself for options. Optional. See \code{Filtering} below.} \item{...}{Ignored} \item{x}{Input to as.colid} \item{check}{logical; Check if ID matches any existing on the DB, only used in \code{\link{as.colid}}} } \value{ A vector of taxonomic identifiers as an S3 class. If a taxon is not found an \code{NA} is given. If more than one identifier is found the function asks for user input if \code{ask = TRUE}, otherwise returns \code{NA}. If \code{ask=FALSE} and \code{rows} does not equal \code{NA}, then a data.frame is given back, but not of the uid class, which you can't pass on to other functions as you normally can. See \code{\link{get_id_details}} for further details including attributes and exceptions } \description{ Get the Catalogue of Life ID from taxonomic names. } \section{Filtering}{ The parameters \code{kingdom}, \code{phylum}, \code{class}, \code{order}, \code{family}, and \code{rank} are not used in the search to the data provider, but are used in filtering the data down to a subset that is closer to the target you want. For all these parameters, you can use regex strings since we use \code{\link{grep}} internally to match. Filtering narrows down to the set that matches your query, and removes the rest. } \examples{ \dontrun{ get_colid(sciname='Poa annua') get_colid(sciname='Pinus contorta') get_colid(sciname='Puma concolor') # get_colid(sciname="Abudefduf saxatilis") get_colid(c("Poa annua", "Pinus contorta")) # specify rows to limit choices available get_colid(sciname='Poa annua') get_colid(sciname='Poa annua', rows=1) get_colid(sciname='Poa annua', rows=2) get_colid(sciname='Poa annua', rows=1:2) # When not found get_colid(sciname="uaudnadndj") get_colid(c("Chironomus riparius", "uaudnadndj")) # Narrow down results to a division or rank, or both ## Satyrium example ### Results w/o narrowing get_colid("Satyrium") ### w/ division get_colid("Satyrium", kingdom = "Plantae") get_colid("Satyrium", kingdom = "Animalia") ## Rank example get_colid("Poa") get_colid("Poa", kingdom = "Plantae") get_colid("Poa", kingdom = "Animalia") # Fuzzy filter on any filtering fields ## uses grep on the inside get_colid("Satyrium", kingdom = "p") # Convert a uid without class information to a uid class as.colid(get_colid("Chironomus riparius")) # already a uid, returns the same as.colid(get_colid(c("Chironomus riparius","Pinus contorta"))) # same as.colid("714831352ad94741e4321eccdeb29f58") # character # character vector, length > 1 as.colid(c("714831352ad94741e4321eccdeb29f58", "3b35900f74ff6e4b073ddb95c32b1f8d")) # list, either numeric or character as.colid(list("714831352ad94741e4321eccdeb29f58", "3b35900f74ff6e4b073ddb95c32b1f8d")) ## dont check, much faster as.colid("714831352ad94741e4321eccdeb29f58", check=FALSE) as.colid(c("714831352ad94741e4321eccdeb29f58", "3b35900f74ff6e4b073ddb95c32b1f8d"), check=FALSE) as.colid(list("714831352ad94741e4321eccdeb29f58", "3b35900f74ff6e4b073ddb95c32b1f8d"), check=FALSE) (out <- as.colid(c("714831352ad94741e4321eccdeb29f58", "3b35900f74ff6e4b073ddb95c32b1f8d"))) data.frame(out) as.colid( data.frame(out) ) # Get all data back get_colid_("Poa annua") get_colid_("Poa annua", rows=2) get_colid_("Poa annua", rows=1:2) get_colid_(c("asdfadfasd","Pinus contorta")) get_colid(sciname="Andropadus nigriceps fusciceps", rows=1) # use curl options library("httr") get_colid("Quercus douglasii", config=verbose()) bb <- get_colid("Quercus douglasii", config=progress()) } } \seealso{ \code{\link[taxize]{classification}} Other taxonomic-ids: \code{\link{get_boldid}}, \code{\link{get_eolid}}, \code{\link{get_gbifid}}, \code{\link{get_ids}}, \code{\link{get_iucn}}, \code{\link{get_natservid}}, \code{\link{get_nbnid}}, \code{\link{get_tolid}}, \code{\link{get_tpsid}}, \code{\link{get_tsn}}, \code{\link{get_uid}}, \code{\link{get_wiki}}, \code{\link{get_wormsid}} } \author{ Scott Chamberlain, \email{myrmecocystus@gmail.com} } taxize/man/rank_ref.Rd0000644000176200001440000000132413133001467014405 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/taxize-package.R \docType{data} \name{rank_ref} \alias{rank_ref} \title{Lookup-table for IDs of taxonomic ranks} \description{ data.frame of 36 rows, with 2 columns: \itemize{ \item rankid - a numeric rank id, consecutive \item ranks - a comma separated vector of names that are considered equal to one another within the row } } \details{ We use this data.frame to do data sorting/filtering based on the ordering of ranks. Please let us know if there is a rank that occurs from one of the data sources \pkg{taxize} that we don't have in \code{rank_ref} dataset. Also let us know if you disagree with the ordering of ranks. } \keyword{data} taxize/man/eol_pages.Rd0000644000176200001440000000566013057575430014576 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/eol_pages.R \name{eol_pages} \alias{eol_pages} \title{Search for pages in EOL database using a taxonconceptID.} \usage{ eol_pages(taxonconceptID, iucn = FALSE, images = 0, videos = 0, sounds = 0, maps = 0, text = 0, subjects = "overview", licenses = "all", details = FALSE, common_names = FALSE, synonyms = FALSE, references = FALSE, taxonomy = TRUE, vetted = 0, cache_ttl = NULL, key = NULL, ...) } \arguments{ \item{taxonconceptID}{The taxonconceptID (numeric), which is also the page number.} \item{iucn}{Include the IUCN Red List status object (Default: \code{FALSE})} \item{images}{Limits the number of returned image objects (values 0 - 75)} \item{videos}{Limits the number of returned video objects (values 0 - 75)} \item{sounds}{Limits the number of returned sound objects (values 0 - 75)} \item{maps}{Limits the number of returned map objects (values 0 - 75)} \item{text}{Limits the number of returned text objects (values 0 - 75)} \item{subjects}{'overview' (default) to return the overview text (if exists), a pipe | delimited list of subject names from the list of EOL accepted subjects (e.g. TaxonBiology, FossilHistory), or 'all' to get text in any subject. Always returns an overview text as a first result (if one exists in the given context).} \item{licenses}{A pipe | delimited list of licenses or 'all' (default) to get objects under any license. Licenses abbreviated cc- are all Creative Commons licenses. Visit their site for more information on the various licenses they offer.} \item{details}{Include all metadata for data objects. (Default: \code{FALSE})} \item{common_names}{Return all common names for the page's taxon (Default: \code{FALSE})} \item{synonyms}{Return all synonyms for the page's taxon (Default: \code{FALSE})} \item{references}{Return all references for the page's taxon (Default: \code{FALSE})} \item{taxonomy}{(logical) Whether to return any taxonomy details from different taxon hierarchy providers, in an array named \code{taxonconcepts} (Default: \code{TRUE})} \item{vetted}{If 'vetted' is given a value of '1', then only trusted content will be returned. If 'vetted' is '2', then only trusted and unreviewed content will be returned (untrusted content will not be returned). The default is to return all content. (Default: \code{FALSE})} \item{cache_ttl}{The number of seconds you wish to have the response cached.} \item{key}{Your EOL API key; loads from .Rprofile, or you can specify the key manually the in the function call.} \item{...}{Curl options passed on to \code{\link[httr]{GET}}} } \value{ JSON list object, or data.frame. } \description{ Search for pages in EOL database using a taxonconceptID. } \details{ It's possible to return JSON or XML with the EOL API. However, this function only returns JSON for now. } \examples{ \dontrun{ (pageid <- eol_search('Pomatomus')$pageid[1]) eol_pages(taxonconceptID=pageid)$scinames } } taxize/man/tnrs_sources.Rd0000644000176200001440000000112313057575431015360 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/tnrs_sources.r \name{tnrs_sources} \alias{tnrs_sources} \title{TNRS sources} \usage{ tnrs_sources(source = NULL, ...) } \arguments{ \item{source}{The source to get information on, one of "iPlant_TNRS", "NCBI", or "MSW3".} \item{...}{Curl options to pass in \code{\link[httr]{GET}}} } \value{ Sources for the TNRS API in a vector or list } \description{ Get sources for the Phylotastic Taxonomic Name Resolution Service } \examples{ \dontrun{ # All tnrs_sources() # A specific source tnrs_sources(source="NCBI") } } taxize/man/class2tree.Rd0000644000176200001440000000523013057577777014720 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/class2tree.R \name{class2tree} \alias{class2tree} \alias{plot.classtree} \alias{print.classtree} \title{Convert list of classifications to a tree.} \usage{ class2tree(input, varstep = TRUE, check = TRUE, ...) \method{plot}{classtree}(x, ...) \method{print}{classtree}(x, ...) } \arguments{ \item{input}{List of classification data.frame's from the function \code{\link{classification}}} \item{varstep}{Vary step lengths between successive levels relative to proportional loss of the number of distinct classes.} \item{check}{If TRUE, remove all redundant levels which are different for all rows or constant for all rows and regard each row as a different basal taxon (species). If FALSE all levels are retained and basal taxa (species) also must be coded as variables (columns). You will get a warning if species are not coded, but you can ignore this if that was your intention.} \item{...}{Further arguments passed on to hclust.} \item{x}{Input object to print or plot - output from class2tree function.} } \value{ An object of class "classtree" with slots: \itemize{ \item phylo - The resulting object, a phylo object \item classification - The classification data.frame, with taxa as rows, and different classification levels as columns \item distmat - Distance matrix \item names - The names of the tips of the phylogeny } Note that when you execute the resulting object, you only get the phylo object. You can get to the other 3 slots by calling them directly, like output$names, etc. } \description{ This function converts a list of hierarchies for individual species into a single species by taxonomic level matrix, then calculates a distance matrix based on taxonomy alone, and outputs either a phylo or dist object. See details for more information. } \details{ See \code{\link[vegan]{taxa2dist}}. Thanks to Jari Oksanen for making the taxa2dist function and pointing it out, and Clarke & Warwick (1998, 2001), which taxa2dist was based on. } \examples{ \dontrun{ spnames <- c('Quercus robur', 'Iris oratoria', 'Arachis paraguariensis', 'Helianthus annuus','Madia elegans','Lupinus albicaulis', 'Pinus lambertiana') out <- classification(spnames, db='itis') tr <- class2tree(out) plot(tr) spnames <- c('Klattia flava', 'Trollius sibiricus', 'Arachis paraguariensis', 'Tanacetum boreale', 'Gentiana yakushimensis','Sesamum schinzianum', 'Pilea verrucosa','Tibouchina striphnocalyx','Lycium dasystemum', 'Berkheya echinacea','Androcymbium villosum', 'Helianthus annuus','Madia elegans','Lupinus albicaulis', 'Pinus lambertiana') out <- classification(spnames, db='ncbi') tr <- class2tree(out) plot(tr) } } taxize/man/itis_name-deprecated.Rd0000644000176200001440000000104213057575431016675 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/itis_name.R \name{itis_name} \alias{itis_name} \title{Get taxonomic names for a given taxonomic name query.} \usage{ itis_name(query = NULL, get = NULL) } \arguments{ \item{query}{TSN number (taxonomic serial number).} \item{get}{The rank of the taxonomic name to get.} } \value{ Taxonomic name for the searched taxon. } \description{ Get taxonomic names for a given taxonomic name query. } \examples{ \dontrun{ itis_name(query="Helianthus annuus", get="family") } } taxize/man/taxize_cite.Rd0000644000176200001440000000202513057575431015141 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/taxize_cite.R \name{taxize_cite} \alias{taxize_cite} \title{Get citations and licenses for data sources used in taxize} \usage{ taxize_cite(fxn = "itis", what = "citation") } \arguments{ \item{fxn}{Function to search on. A special case is the package name 'taxize' that will give the citations for the package.} \item{what}{One of citation (default), license, or both.} } \description{ Get citations and licenses for data sources used in taxize } \examples{ taxize_cite(fxn='eol_search') taxize_cite(fxn='itis_hierarchy') taxize_cite(fxn='tp_classification') taxize_cite(fxn='gbif_ping') taxize_cite(fxn='plantminer') taxize_cite(fxn='get_natservid_') taxize_cite(fxn='as.natservid') taxize_cite(fxn='get_wormsid') taxize_cite(fxn='as.wormsid') # Functions that use many data sources taxize_cite(fxn='synonyms') taxize_cite(fxn='classification') # Get the taxize citation taxize_cite(fxn='taxize') # Get license information taxize_cite(fxn='taxize', "license") } taxize/man/ncbi_getbyid-defunct.Rd0000644000176200001440000000053313057575431016703 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ncbi_getbyid.R \name{ncbi_getbyid} \alias{ncbi_getbyid} \title{Retrieve gene sequences from NCBI by accession number.} \usage{ ncbi_getbyid(...) } \description{ THIS FUNCTION IS DEFUNCT. } \author{ Scott Chamberlain \email{myrmecocystus@gmail.com} } \keyword{internal} taxize/man/apg_lookup.Rd0000644000176200001440000000234713057575430014777 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/apg_lookup.R \name{apg_lookup} \alias{apg_lookup} \title{Lookup in the APGIII taxonomy and replace family names} \usage{ apg_lookup(taxa, rank = "family") } \arguments{ \item{taxa}{(character) Taxonomic name to lookup a synonym for in APGIII taxonomy.} \item{rank}{(character) Taxonomic rank to lookup a synonym for. One of family or order.} } \value{ A APGIII family or order name, or the original name if no match. } \description{ Lookup in the APGIII taxonomy and replace family names } \details{ Internally in this function, we use the datasets \code{\link{apg_families}} and \code{\link{apg_orders}} - see their descriptions for the data in them. The functions \code{\link{apgOrders}} \code{\link{apgFamilies}} are for scraping current content from the \url{http://www.mobot.org/MOBOT/research/APweb/} website. BEWARE: The datasets used in this function are (I think) from Version 12 of the data on \url{http://www.mobot.org/MOBOT/research/APweb/} - I'll update data asap. } \examples{ # New name found apg_lookup(taxa = "Hyacinthaceae", rank = "family") apg_lookup(taxa = "Poaceae", rank = "family") # Name not found apg_lookup(taxa = "Asteraceae", rank = "family") } taxize/man/ubio_synonyms-defunct.Rd0000644000176200001440000000047313057575431017201 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ubio_synonyms.R \name{ubio_synonyms} \alias{ubio_synonyms} \title{Search uBio for taxonomic synonyms by hierarchiesID.} \usage{ ubio_synonyms(...) } \arguments{ \item{...}{Parameters, ignored} } \description{ THIS FUNCTION IS DEFUNCT. } taxize/man/ncbi_getbyname-defunct.Rd0000644000176200001440000000055413057575431017232 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ncbi_getbyname.R \name{ncbi_getbyname} \alias{ncbi_getbyname} \title{Retrieve gene sequences from NCBI by taxon name and gene names.} \usage{ ncbi_getbyname(...) } \description{ THIS FUNCTION IS DEFUNCT. } \author{ Scott Chamberlain \email{myrmecocystus@gmail.com} } \keyword{internal} taxize/man/gni_details.Rd0000644000176200001440000000175313057575430015121 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/gni_details.R \name{gni_details} \alias{gni_details} \title{Search for taxonomic name details using the Global Names Index.} \usage{ gni_details(id, all_records = 1, ...) } \arguments{ \item{id}{Name id. Required.} \item{all_records}{If all_records is 1, GNI returns all records from all repositories for the name string (takes 0, or 1 [default]).} \item{...}{Curl options passed on to \code{\link[httr]{GET}}} } \value{ Data.frame of results. } \description{ Uses the Global Names Index, see \url{http://gni.globalnames.org/}. } \examples{ \dontrun{ gni_details(id = 17802847) library("plyr") ldply(list(1265133, 17802847), gni_details) # pass on curl options to httr library("httr") gni_details(id = 17802847, config = verbose()) } } \seealso{ \code{\link{gnr_datasources}}, \code{\link{gni_search}}. } \author{ Scott Chamberlain {myrmecocystus@gmail.com} } \keyword{globalnamesindex} \keyword{names} \keyword{taxonomy} taxize/man/itis_acceptname.Rd0000644000176200001440000000317613057575431015771 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/itis_acceptname.R \name{itis_acceptname} \alias{itis_acceptname} \title{Retrieve accepted TSN and name} \usage{ itis_acceptname(searchtsn, ...) } \arguments{ \item{searchtsn}{One or more TSN for a taxon (numeric/integer)} \item{...}{Curl options passed on to \code{\link[httr]{GET}}} } \value{ data.frame with with row number equal to input vector length, and with three columns: \itemize{ \item submittedtsn (numeric) - The submitted TSN \item acceptedname (character) - The accepted name - if the submitted TSN is the accepted TSN, then this is \code{NA_character_} because ITIS does not return a name along with the TSN if it's an accepted name. We could make an extra HTTP request to ITIS, but that means additional time. \item acceptedtsn (numeric) - The accepted TSN \item author (character) - taxonomic authority } } \description{ Retrieve accepted TSN and name } \examples{ \dontrun{ # TSN accepted - good name itis_acceptname(searchtsn = 208527) # TSN not accepted - input TSN is old itis_acceptname(searchtsn = 504239) # many accepted names ids <- c(18161, 18162, 18163, 18164, 18165, 18166, 46173, 46174, 46178, 46181, 46186, 46193, 46196, 46197, 46200, 46201, 46204, 46207, 46867, 46868) itis_acceptname(searchtsn = ids) # many unaccepted names ids <- c(39087, 46208, 46973, 46976, 46978, 46980, 47295, 47445, 47448, 47512, 47515, 47527, 47546, 47622, 47783, 47786, 47787, 47788, 47835, 47839) itis_acceptname(searchtsn = ids) # many: mix of accepted and unaccepted names ids <- c(18161, 18162, 47527, 47546, 47622, 46200) itis_acceptname(searchtsn = ids) } } taxize/man/get_tolid.Rd0000644000176200001440000000771513160514701014602 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_tolid.R \name{get_tolid} \alias{get_tolid} \alias{as.tolid} \alias{as.tolid.tolid} \alias{as.tolid.character} \alias{as.tolid.list} \alias{as.tolid.numeric} \alias{as.tolid.data.frame} \alias{as.data.frame.tolid} \alias{get_tolid_} \title{Get the OTT id for a search term} \usage{ get_tolid(sciname, ask = TRUE, verbose = TRUE, rows = NA, ...) as.tolid(x, check = TRUE) \method{as.tolid}{tolid}(x, check = TRUE) \method{as.tolid}{character}(x, check = TRUE) \method{as.tolid}{list}(x, check = TRUE) \method{as.tolid}{numeric}(x, check = TRUE) \method{as.tolid}{data.frame}(x, check = TRUE) \method{as.data.frame}{tolid}(x, ...) get_tolid_(sciname, verbose = TRUE, rows = NA) } \arguments{ \item{sciname}{character; scientific name.} \item{ask}{logical; should \code{get_tolid} be run in interactive mode? If \code{TRUE} and more than one TOL is found for the species, the user is asked for input. If \code{FALSE} NA is returned for multiple matches.} \item{verbose}{logical; should progress be printed?} \item{rows}{numeric; Any number from 1 to infinity. If the default NA, all rows are considered. Note that this function still only gives back a tol class object with one to many identifiers. See \code{\link[taxize]{get_tolid_}} to get back all, or a subset, of the raw data that you are presented during the ask process.} \item{...}{Ignored} \item{x}{Input to \code{as.tolid}} \item{check}{logical; Check if ID matches any existing on the DB, only used in \code{\link{as.tolid}}} } \value{ A vector of taxonomic identifiers as an S3 class. If a taxon is not found an \code{NA} is given. If more than one identifier is found the function asks for user input if \code{ask = TRUE}, otherwise returns \code{NA}. If \code{ask=FALSE} and \code{rows} does not equal \code{NA}, then a data.frame is given back, but not of the uid class, which you can't pass on to other functions as you normally can. See \code{\link{get_id_details}} for further details including attributes and exceptions } \description{ Retrieve the Open Tree of Life Taxonomy (OTT) id of a taxon from OpenTreeOfLife } \examples{ \dontrun{ get_tolid(sciname = "Quercus douglasii") get_tolid(sciname = "Chironomus riparius") get_tolid(c("Chironomus riparius","Quercus douglasii")) splist <- c("annona cherimola", 'annona muricata', "quercus robur", "shorea robusta", "pandanus patina", "oryza sativa", "durio zibethinus") get_tolid(splist, verbose=FALSE) # specify rows to limit choices available get_tolid('Arni') get_tolid('Arni', rows=1) get_tolid('Arni', rows=1:2) # When not found get_tolid("howdy") get_tolid(c("Chironomus riparius", "howdy")) # Convert a tol without class information to a tol class as.tolid(get_tolid("Quercus douglasii")) # already a tol, returns the same as.tolid(get_tolid(c("Chironomus riparius","Pinus contorta"))) # same as.tolid(3930798) # numeric as.tolid(c(3930798,515712,872577)) # numeric vector, length > 1 as.tolid("3930798") # character as.tolid(c("3930798","515712","872577")) # character vector, length > 1 as.tolid(list("3930798","515712","872577")) # list, either numeric or character ## dont check, much faster as.tolid("3930798", check=FALSE) as.tolid(3930798, check=FALSE) as.tolid(c("3930798","515712","872577"), check=FALSE) as.tolid(list("3930798","515712","872577"), check=FALSE) (out <- as.tolid(c(3930798,515712,872577))) data.frame(out) as.tolid( data.frame(out) ) # Get all data back get_tolid_(sciname="Arni") get_tolid_("Arni", rows=1) get_tolid_("Arni", rows=1:2) get_tolid_(c("asdfadfasd","Pinus contorta")) } } \seealso{ \code{\link[taxize]{classification}} Other taxonomic-ids: \code{\link{get_boldid}}, \code{\link{get_colid}}, \code{\link{get_eolid}}, \code{\link{get_gbifid}}, \code{\link{get_ids}}, \code{\link{get_iucn}}, \code{\link{get_natservid}}, \code{\link{get_nbnid}}, \code{\link{get_tpsid}}, \code{\link{get_tsn}}, \code{\link{get_uid}}, \code{\link{get_wiki}}, \code{\link{get_wormsid}} } taxize/man/ubio_classification_search-defunct.Rd0000644000176200001440000000063613057575431021623 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ubio_classification_search.R \name{ubio_classification_search} \alias{ubio_classification_search} \title{This function will return ClassificationBankIDs (hierarchiesIDs) that refer to the given NamebankID} \usage{ ubio_classification_search(...) } \arguments{ \item{...}{Parameters, ignored} } \description{ THIS FUNCTION IS DEFUNCT. } taxize/man/itis_native.Rd0000644000176200001440000000151213057575431015147 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/itis_native.R \name{itis_native} \alias{itis_native} \title{Get jurisdiction data, i.e., native or not native in a region.} \usage{ itis_native(tsn = NULL, what = "bytsn", ...) } \arguments{ \item{tsn}{One or more TSN's (taxonomic serial number)} \item{what}{One of bytsn, values, or originvalues} \item{...}{Further arguments passed on to \code{\link[ritis]{jurisdictional_origin}}, \code{\link[ritis]{jurisdiction_values}}, or \code{\link[ritis]{jurisdiction_origin_values}}} } \description{ Get jurisdiction data, i.e., native or not native in a region. } \examples{ \dontrun{ # Get values itis_native(what="values") # Get origin values itis_native(what="originvalues") # Get values by tsn itis_native(tsn=180543) itis_native(tsn=c(180543,41074,36616)) } } taxize/man/ubio_classification-defunct.Rd0000644000176200001440000000046213057575431020273 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ubio_classification.R \name{ubio_classification} \alias{ubio_classification} \title{uBio classification} \usage{ ubio_classification(...) } \arguments{ \item{...}{Parameters, ignored} } \description{ THIS FUNCTION IS DEFUNCT. } taxize/man/downstream.Rd0000644000176200001440000001237413160566124015016 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/downstream.R \name{downstream} \alias{downstream} \alias{downstream.default} \alias{downstream.tsn} \alias{downstream.colid} \alias{downstream.gbifid} \alias{downstream.uid} \alias{downstream.ids} \title{Retrieve the downstream taxa for a given taxon name or ID.} \usage{ downstream(...) \method{downstream}{default}(x, db = NULL, downto = NULL, intermediate = FALSE, rows = NA, ...) \method{downstream}{tsn}(x, db = NULL, downto = NULL, intermediate = FALSE, ...) \method{downstream}{colid}(x, db = NULL, downto = NULL, intermediate = FALSE, ...) \method{downstream}{gbifid}(x, db = NULL, downto = NULL, intermediate = FALSE, ...) \method{downstream}{uid}(x, db = NULL, downto = NULL, intermediate = FALSE, ...) \method{downstream}{ids}(x, db = NULL, downto = NULL, intermediate = FALSE, ...) } \arguments{ \item{...}{Further args passed on to \code{itis_downstream}, \code{col_downstream}, \code{gbif_downstream}, or \code{ncbi_downstream}} \item{x}{Vector of taxa names (character) or IDs (character or numeric) to query.} \item{db}{character; database to query. One or more of \code{itis}, \code{col}, \code{gbif}, or \code{ncbi}. Note that each taxonomic data source has their own identifiers, so that if you provide the wrong \code{db} value for the identifier you could get a result, but it will likely be wrong (not what you were expecting).} \item{downto}{What taxonomic rank to go down to. One of: 'superkingdom', 'kingdom', 'subkingdom','infrakingdom','phylum','division','subphylum', 'subdivision','infradivision', 'superclass','class','subclass','infraclass', 'superorder','order','suborder','infraorder','superfamily','family', 'subfamily','tribe','subtribe','genus','subgenus','section','subsection', 'species group','species','subspecies','variety','form','subvariety','race', 'stirp', 'morph','aberration','subform', 'unspecified', 'no rank'} \item{intermediate}{(logical) If \code{TRUE}, return a list of length two with target taxon rank names, with additional list of data.frame's of intermediate taxonomic groups. Default: \code{FALSE}} \item{rows}{(numeric) Any number from 1 to infinity. If the default NA, all rows are considered. Note that this parameter is ignored if you pass in a taxonomic id of any of the acceptable classes: tsn, colid.} } \value{ A named list of data.frames with the downstream names of every supplied taxa. You get an NA if there was no match in the database. } \description{ This function uses a while loop to continually collect children taxa down to the taxonomic rank that you specify in the \code{downto} parameter. You can get data from ITIS (itis), Catalogue of Life (col), GBIF (gbif), or NCBI (ncbi). There is no method exposed by these four services for getting taxa at a specific taxonomic rank, so we do it ourselves here. } \examples{ \dontrun{ # Plug in taxon IDs ## col Ids have to be character, as they are alphanumeric IDs downstream("015be25f6b061ba517f495394b80f108", db = "col", downto = "species") ## ITIS tsn ids can be numeric or character downstream("154395", db = "itis", downto = "species") downstream(154395, db = "itis", downto = "species") # Plug in taxon names downstream("Insecta", db = 'col', downto = 'order') downstream("Apis", db = 'col', downto = 'species') downstream("Apis", db = 'ncbi', downto = 'species') downstream("Apis", db = 'itis', downto = 'species') downstream(c("Apis","Epeoloides"), db = 'itis', downto = 'species') downstream(c("Apis","Epeoloides"), db = 'col', downto = 'species') downstream("Ursus", db = 'gbif', downto = 'species') downstream(get_gbifid("Ursus"), db = 'gbif', downto = 'species') # Plug in IDs id <- get_colid("Apis") downstream(id, downto = 'species') ## Equivalently, plug in the call to get the id via e.g., get_colid ## into downstream identical(downstream(id, downto = 'species'), downstream(get_colid("Apis"), downto = 'species')) id <- get_colid("Apis") downstream(id, downto = 'species') downstream(get_colid("Apis"), downto = 'species') # Many taxa sp <- names_list("genus", 3) downstream(sp, db = 'col', downto = 'species') downstream(sp, db = 'itis', downto = 'species') downstream(sp, db = 'gbif', downto = 'species') # Both data sources ids <- get_ids("Apis", db = c('col','itis')) downstream(ids, downto = 'species') ## same result downstream(get_ids("Apis", db = c('col','itis')), downto = 'species') # Collect intermediate names ## itis downstream('Bangiophyceae', db="itis", downto="genus") downstream('Bangiophyceae', db="itis", downto="genus", intermediate=TRUE) downstream(get_tsn('Bangiophyceae'), downto="genus") downstream(get_tsn('Bangiophyceae'), downto="genus", intermediate=TRUE) ## col downstream(get_colid("Animalia"), downto="class") downstream(get_colid("Animalia"), downto="class", intermediate=TRUE) # Use the rows parameter ## note how in the second function call you don't get the prompt downstream("Poa", db = 'col', downto="species") downstream("Poa", db = 'col', downto="species", rows=1) downstream("Poa", db = 'ncbi', downto="species") # use curl options res <- downstream("Apis", db = 'col', downto = 'species', config=verbose()) res <- downstream("Apis", db = 'itis', downto = 'species', config=verbose()) res <- downstream("Ursus", db = 'gbif', downto = 'species', config=verbose()) } } taxize/man/plantNames.Rd0000644000176200001440000000103413057575431014732 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/taxize-package.R \docType{data} \name{plantNames} \alias{plantNames} \title{Vector of plant species (genus - specific epithet) names from ThePlantList} \format{A vector of length 1182} \source{ http://www.theplantlist.org } \description{ These names are from http://www.theplantlist.org, and are a randomly chosen subset of names of the form genus/specific epithet for the purpose of having some names to play with for examples in this package. } \keyword{data} taxize/man/get_genes_avail-defunct.Rd0000644000176200001440000000044613057575431017400 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ncbi_search.R \name{get_genes_avail} \alias{get_genes_avail} \title{Retrieve gene sequences from NCBI by accession number.} \usage{ get_genes_avail(...) } \description{ THIS FUNCTION IS DEFUNCT. } \keyword{internal} taxize/man/eol_invasive-defunct.Rd0000644000176200001440000000046113057575430016743 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/eol_invasive.R \name{eol_invasive} \alias{eol_invasive} \title{Search for presence of taxonomic names in EOL invasive species databases.} \usage{ eol_invasive(...) } \description{ THIS FUNCTION IS DEFUNCT. } \keyword{internal} taxize/man/ping.Rd0000644000176200001440000000351213057575431013570 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ping.R \name{ping} \alias{ping} \alias{col_ping} \alias{eol_ping} \alias{itis_ping} \alias{ncbi_ping} \alias{tropicos_ping} \alias{nbn_ping} \alias{gbif_ping} \alias{bold_ping} \alias{ipni_ping} \alias{vascan_ping} \alias{fg_ping} \title{Ping an API used in taxize to see if it's working.} \usage{ col_ping(what = "status", ...) eol_ping(what = "status", ...) itis_ping(what = "status", ...) ncbi_ping(what = "status", ...) tropicos_ping(what = "status", ...) nbn_ping(what = "status", ...) gbif_ping(what = "status", ...) bold_ping(what = "status", ...) ipni_ping(what = "status", ...) vascan_ping(what = "status", ...) fg_ping(what = "status", ...) } \arguments{ \item{what}{(character) One of status (default), content, or an HTTP status code. If status, we just check that the HTTP status code is 200, or similar signifying the service is up. If content, we do a simple, quick check to determine if returned content matches what's expected. If an HTTP status code, it must match an appropriate code. See \code{\link{status_codes}}.} \item{...}{Curl options passed on to \code{\link[httr]{GET}}} } \value{ A logical, TRUE or FALSE } \description{ Ping an API used in taxize to see if it's working. } \details{ For ITIS, see \code{\link[ritis]{description}}, which provides number of scientific and common names in a character string. } \examples{ \dontrun{ col_ping() col_ping("content") col_ping(200) col_ping("200") col_ping(204) itis_ping() eol_ping() ncbi_ping() tropicos_ping() nbn_ping() gbif_ping() gbif_ping(200) bold_ping() bold_ping(200) bold_ping("content") ipni_ping() ipni_ping(200) ipni_ping("content") vascan_ping() vascan_ping(200) vascan_ping("content") # curl options library("httr") vascan_ping(config=verbose()) eol_ping(500, config=verbose()) } } taxize/man/taxize-defunct.Rd0000644000176200001440000000525013057575431015566 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/taxize-package.R \name{taxize-defunct} \alias{taxize-defunct} \alias{defunct} \title{Defunct functions in taxize} \description{ The following functions are now defunct (no longer available): } \details{ \itemize{ \item \code{\link{col_classification}}: See \code{\link{classification}} \item \code{\link{eol_hierarchy}}: See \code{\link{classification}} \item \code{\link{tp_classification}}: See \code{\link{classification}} \item \code{\link{tpl_search}}: Use the \pkg{Taxonstand} functions \code{TPL} or \code{TPLck} directly. \item \code{\link{get_seqs}}: This function changed name to \code{\link{ncbi_getbyname}}. \item \code{\link{get_genes}}: This function changed name to \code{\link{ncbi_getbyid}}. \item \code{\link{get_genes_avail}}: This function changed name to \code{\link{ncbi_search}}. \item \code{\link{ncbi_getbyname}}: See \code{ncbi_byname} in the \pkg{traits} package. \item \code{\link{ncbi_getbyid}}: See \code{ncbi_byid} in the \pkg{traits} package. \item \code{\link{ncbi_search}}: See \code{ncbi_searcher} in the \pkg{traits} package. \item \code{\link{eol_invasive}}: See \code{eol} in the \pkg{originr} package. \item \code{\link{gisd_isinvasive}}: See \code{gisd} in the \pkg{originr} package. \item \code{\link{ubio_classification}}: The uBio web services was down for quite a while, is now (as of 2016-05-09) back up, but we don't trust that it will stay up and available. \item \code{\link{ubio_classification_search}}: The uBio web services was down for quite a while, is now (as of 2016-05-09) back up, but we don't trust that it will stay up and available. \item \code{\link{ubio_id}}: The uBio web services was down for quite a while, is now (as of 2016-05-09) back up, but we don't trust that it will stay up and available. \item \code{\link{ubio_ping}}: The uBio web services was down for quite a while, is now (as of 2016-05-09) back up, but we don't trust that it will stay up and available. \item \code{\link{ubio_search}}: The uBio web services was down for quite a while, is now (as of 2016-05-09) back up, but we don't trust that it will stay up and available. \item \code{\link{ubio_synonyms}}: The uBio web services was down for quite a while, is now (as of 2016-05-09) back up, but we don't trust that it will stay up and available. \item \code{\link{get_ubioid}}: The uBio web services are apparently down indefinitely. \item \code{\link{phylomatic_tree}}: This function is defunct. See \code{phylomatic} in the package \pkg{brranching} \item \code{\link{phylomatic_format}}: This function is defunct. See \code{phylomatic_names} in the package \pkg{brranching} } } taxize/man/names_list.Rd0000644000176200001440000000154413057575431014774 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/names_list.r \name{names_list} \alias{names_list} \title{Get a random vector of species names.} \usage{ names_list(rank = "genus", size = 10) } \arguments{ \item{rank}{Taxonomic rank, one of species, genus (default), family, order.} \item{size}{Number of names to get. Maximum depends on the rank.} } \value{ Vector of taxonomic names. } \description{ Family and order names come from the APG plant names list. Genus and species names come from Theplantlist.org. } \examples{ names_list() names_list('species') names_list('genus') names_list('family') names_list('order') names_list('order', '2') names_list('order', '15') # You can get a lot of genus or species names if you want nrow(theplantlist) names_list('genus', 500) } \author{ Scott Chamberlain \email{myrmecocystus@gmail.com} } taxize/man/gbif_downstream.Rd0000644000176200001440000000343313057575430016006 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/gbif_downstream.R \name{gbif_downstream} \alias{gbif_downstream} \title{Retrieve all taxa names downstream in hierarchy for GBIF} \usage{ gbif_downstream(key, downto, intermediate = FALSE, ...) } \arguments{ \item{key}{A taxonomic serial number.} \item{downto}{The taxonomic level you want to go down to. See examples below. The taxonomic level IS case sensitive, and you do have to spell it correctly. See \code{data(rank_ref)} for spelling.} \item{intermediate}{(logical) If TRUE, return a list of length two with target taxon rank names, with additional list of data.frame's of intermediate taxonomic groups. Default: FALSE} \item{...}{Further args passed on to \code{\link{gbif_name_usage}}} } \value{ Data.frame of taxonomic information downstream to family from e.g., Order, Class, etc., or if \code{intermediated=TRUE}, list of length two, with target taxon rank names, and intermediate names. } \description{ Retrieve all taxa names downstream in hierarchy for GBIF } \examples{ \dontrun{ ## the plant class Bangiophyceae gbif_downstream(key = 198, downto="genus") gbif_downstream(key = 198, downto="genus", intermediate=TRUE) # families downstream from the family Strepsiptera (twisted wing parasites) gbif_downstream(key = 1227, "family") ## here, intermediate leads to the same result as the target gbif_downstream(key = 1227, "family", intermediate=TRUE) # Lepidoptera gbif_downstream(key = 797, "family") # get species downstream from the genus Ursus gbif_downstream(key = 2433406, "species") # get tribes down from the family Apidae gbif_downstream(key = 7799978, downto="species") gbif_downstream(key = 7799978, downto="species", intermediate=TRUE) } } \author{ Scott Chamberlain \email{myrmecocystus@gmail.com} } taxize/man/ncbi_search-defunct.Rd0000644000176200001440000000043313057575431016520 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ncbi_search.R \name{ncbi_search} \alias{ncbi_search} \title{Search for gene sequences available for taxa from NCBI.} \usage{ ncbi_search(...) } \description{ THIS FUNCTION IS DEFUNCT. } \keyword{internal} taxize/man/tpl_get.Rd0000644000176200001440000000254613160514406014265 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/tpl_get.r \name{tpl_get} \alias{tpl_get} \title{Get The Plant List csv files.} \usage{ tpl_get(x, family = NULL, ...) } \arguments{ \item{x}{Directory to write csv files to.} \item{family}{If you want just one, or >1 family, but not all, list them in a vector.} \item{...}{(list) Curl options passed on to \code{\link[httr]{GET}}} } \value{ Returns nothing to console, except a message and progress bar. Writes csv files to x. } \description{ Get The Plant List csv files. } \details{ Throws a warning if you already have a directory of the one provided, but still works. Writes to your home directory, change x as needed. } \examples{ \dontrun{ # Get a few families dir <- file.path(tempdir(), "abc") tpl_get(dir, family = c("Platanaceae","Winteraceae")) readLines(file.path(dir, "Platanaceae.csv"), n = 5) # You can now get Gymnosperms as well dir1 <- file.path(tempdir(), "def") tpl_get(dir1, family = c("Pinaceae","Taxaceae")) # You can get mosses too! dir2 <- file.path(tempdir(), "ghi") tpl_get(dir2, family = "Echinodiaceae") # Get all families ## Beware, will take a while ## dir3 <- file.path(tempdir(), "jkl") ## tpl_get("dir3) } } \references{ The Plant List http://www.theplantlist.org } \seealso{ \code{\link{tpl_families}} } \author{ John Baumgartner (johnbb@student.unimelb.edu.au) } taxize/man/itis_kingdomnames.Rd0000644000176200001440000000075013057575431016340 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/itis_kingdomnames.R \name{itis_kingdomnames} \alias{itis_kingdomnames} \title{Get kingdom names} \usage{ itis_kingdomnames(tsn = NULL, ...) } \arguments{ \item{tsn}{One or more TSN's (taxonomic serial number)} \item{...}{Further arguments passed on to getkingdomnamefromtsn} } \description{ Get kingdom names } \examples{ \dontrun{ itis_kingdomnames(202385) itis_kingdomnames(tsn=c(202385,183833,180543)) } } taxize/man/taxize_ldfast.Rd0000644000176200001440000000072613057575431015500 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/taxize_ldfast.R \name{taxize_ldfast} \alias{taxize_ldfast} \title{Replacement function for ldply that should be faster in all cases.} \usage{ taxize_ldfast(x, convertvec = FALSE) } \arguments{ \item{x}{A list.} \item{convertvec}{Convert a vector to a data.frame before rbind is called.} } \description{ Replacement function for ldply that should be faster in all cases. } \keyword{internal} taxize/man/col_downstream.Rd0000644000176200001440000000525413057575430015657 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/col_downstream.R \name{col_downstream} \alias{col_downstream} \title{Use Catalogue of Life to get downstream taxa to a given taxonomic level.} \usage{ col_downstream(name = NULL, id = NULL, downto, format = NULL, start = NULL, checklist = NULL, verbose = TRUE, intermediate = FALSE, ...) } \arguments{ \item{name}{The string to search for. Only exact matches found the name given will be returned, unless one or wildcards are included in the search string. An * (asterisk) character denotes a wildcard; a % (percentage) character may also be used. The name must be at least 3 characters long, not counting wildcard characters.} \item{id}{The record ID of the specific record to return (only for scientific names of species or infraspecific taxa)} \item{downto}{The taxonomic level you want to go down to. See examples below. The taxonomic level IS case sensitive, and you do have to spell it correctly. See \code{data(rank_ref)} for spelling.} \item{format}{The returned format (default = NULL). If NULL xml is used. Currently only xml is supported.} \item{start}{The first record to return (default = NULL). If NULL, the results are returned from the first record (start=0). This is useful if the total number of results is larger than the maximum number of results returned by a single Web service query (currently the maximum number of results returned by a single query is 500 for terse queries and 50 for full queries).} \item{checklist}{The year of the checklist to query, if you want a specific year's checklist instead of the lastest as default (numeric).} \item{verbose}{Print or suppress messages.} \item{intermediate}{(logical) If TRUE, return a list of length two with target taxon rank names, with additional list of data.frame's of intermediate taxonomic groups. Default: FALSE} \item{...}{Curl options passed on to \code{\link[httr]{GET}}} } \value{ A list of data.frame's. } \description{ Use Catalogue of Life to get downstream taxa to a given taxonomic level. } \details{ Provide only names instead of id's } \examples{ \dontrun{ # Some basic examples col_downstream(name="Apis", downto="species") col_downstream(name="Bryophyta", downto="family") # get classes down from the kingdom Animalia col_downstream(name="Animalia", downto="class") col_downstream(name="Animalia", downto="class", intermediate=TRUE) # An example that takes a bit longer col_downstream(name=c("Plantae", "Animalia"), downto="class") # Using a checklist from a specific year col_downstream(name="Bryophyta", downto="family", checklist=2009) # By id col_downstream(id='576d098d770a39d09e2bcfa1c0896b26', downto="species", checklist=2012) } } taxize/man/tp_summary.Rd0000644000176200001440000000112013057575431015024 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/tp_summary.R \name{tp_summary} \alias{tp_summary} \title{Return summary data a taxon name with a given id.} \usage{ tp_summary(id, key = NULL, ...) } \arguments{ \item{id}{the taxon identifier code} \item{key}{Your Tropicos API key; loads from .Rprofile.} \item{...}{Curl options passed on to \code{\link[httr]{GET}}} } \value{ A data.frame. } \description{ Return summary data a taxon name with a given id. } \examples{ \dontrun{ tp_summary(id = 25509881) tp_summary(id = 2700851) tp_summary(id = 24900183) } } taxize/LICENSE0000644000176200001440000000005713037542441012570 0ustar liggesusersYEAR: 2017 COPYRIGHT HOLDER: Scott Chamberlain