Learn R Programming

taxonomizr (version 0.8.0)

taxonomizr-package: taxonomizr: Functions to Work with NCBI Accessions and Taxonomy

Description

Functions for assigning taxonomy to NCBI accession numbers and taxon IDs based on NCBI's accession2taxid and taxdump files. This package allows the user to downloads NCBI data dumps and create a local database for fast and local taxonomic assignment.

Arguments

Details

taxonomizr provides some simple functions to parse NCBI taxonomy files and accession dumps and efficiently use them to assign taxonomy to accession numbers or taxonomic IDs (https://www.ncbi.nlm.nih.gov/Taxonomy/taxonomyhome.html/). This is useful for example to assign taxonomy to BLAST results. This is all done locally after downloading the appropriate files from NCBI using included functions. The major functions are:

  • prepareDatabase: download data from NCBI and prepare SQLite database

  • link{accessionToTaxa}: convert accession numbers to taxonomic IDs

  • getTaxonomy: convert taxonomic IDs to taxonomy

More specialized functions are:

  • getId: convert a biological name to taxonomic ID

  • getAccessions: find accessions for a given taxonomic ID

See Also

prepareDatabase, accessionToTaxa, getTaxonomy

Examples

Run this code
# NOT RUN {
  if(readline(
    "This will download a lot data and take a while to process.
     Make sure you have space and bandwidth. Type y to continue: "
  )!='y')
    stop('This is a stop to make sure no one downloads a bunch of data unintentionally')

  prepareDatabase('accessionTaxa.sql')
  blastAccessions<-c("Z17430.1","Z17429.1","X62402.1")
  ids<-accessionToTaxa(blastAccessions,'accessionTaxa.sql')
  getTaxonomy(ids,'accessionTaxa.sql')
# }

Run the code above in your browser using DataLab