• Stars
    star
    256
  • Rank 158,395 (Top 4 %)
  • Language
    Go
  • License
    MIT License
  • Created almost 8 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Practical and Efficient NCBI Taxonomy Toolkit, also supports creating NCBI-style taxdump files for custom taxonomies

TaxonKit - A Practical and Efficient NCBI Taxonomy Toolkit

Related projects:

  • Taxid-Changelog: Tracking all changes of TaxIds, including deletion, new adding, merge, reuse, and rank/name changes.
  • GTDB taxdump: GTDB taxonomy taxdump files with trackable TaxIds.
  • ICTV taxdump: NCBI-style taxdump files for International Committee on Taxonomy of Viruses (ICTV)

Table of Contents

Features

Subcommands

Subcommand Function
list List taxonomic subtrees (TaxIds) bellow given TaxIds
lineage Query taxonomic lineage of given TaxIds
reformat Reformat lineage in canonical ranks
name2taxid Convert scientific names to TaxIds
filter Filter TaxIds by taxonomic rank range
lca Compute lowest common ancestor (LCA) for TaxIds
taxid-changelog Create TaxId changelog from dump archives
profile2cami* Convert metagenomic profile table to CAMI format
cami-filter* Remove taxa of given TaxIds and their descendants in CAMI metagenomic profile
create-taxdump* Create NCBI-style taxdump files for custom taxonomy, e.g., GTDB and ICTV

Note: *New commands since the publication.

taxonkit

Benchmark

  1. Getting complete lineage for given TaxIds

    Versions: ETE=3.1.2, taxopy=0.5.0 (faster since 0.6.0), TaxonKit=0.7.2.

Dataset

  1. Download and uncompress taxdump.tar.gz: ftp://ftp.ncbi.nih.gov/pub/taxonomy/taxdump.tar.gz
  2. Copy names.dmp, nodes.dmp, delnodes.dmp and merged.dmp to data directory: $HOME/.taxonkit, e.g., /home/shenwei/.taxonkit ,
  3. Optionally copy to some other directories, and later you can refer to using flag --data-dir, or environment variable TAXONKIT_DB.

All-in-one command:

wget -c ftp://ftp.ncbi.nih.gov/pub/taxonomy/taxdump.tar.gz 
tar -zxvf taxdump.tar.gz

mkdir -p $HOME/.taxonkit
cp names.dmp nodes.dmp delnodes.dmp merged.dmp $HOME/.taxonkit

Update dataset: Simply re-download the taxdump files, uncompress and override old ones.

Installation

Go to Download Page for more download options and changelogs.

TaxonKit is implemented in Go programming language, executable binary files for most popular operating systems are freely available in release page.

Method 1: Download binaries (latest stable/dev version)

Just download compressed executable file of your operating system, and uncompress it with tar -zxvf *.tar.gz command or other tools. And then:

  1. For Linux-like systems

    1. If you have root privilege simply copy it to /usr/local/bin:

       sudo cp taxonkit /usr/local/bin/
      
    2. Or copy to anywhere in the environment variable PATH:

       mkdir -p $HOME/bin/; cp taxonkit $HOME/bin/
      
  2. For Windows, just copy taxonkit.exe to C:\WINDOWS\system32.

Method 2: Install via conda (latest stable version) Install-with-conda Anaconda Cloud downloads

conda install -c bioconda taxonkit

Method 3: Install via homebrew (out of date)

brew install brewsci/bio/taxonkit

Method 4: Compile from source (latest stable/dev version)

  1. Install go

     wget https://go.dev/dl/go1.17.13.linux-amd64.tar.gz
    
     tar -zxf go1.17.13.linux-amd64.tar.gz -C $HOME/
    
     # or 
     #   echo "export PATH=$PATH:$HOME/go/bin" >> ~/.bashrc
     #   source ~/.bashrc
     export PATH=$PATH:$HOME/go/bin
    
  2. Compile TaxonKit

     # ------------- the latest stable version -------------
    
     go get -v -u github.com/shenwei356/taxonkit/taxonkit
    
     # The executable binary file is located in:
     #   ~/go/bin/taxonkit
     # You can also move it to anywhere in the $PATH
     mkdir -p $HOME/bin
     cp ~/go/bin/taxonkit $HOME/bin/
    
    
     # --------------- the development version --------------
    
     git clone https://github.com/shenwei356/taxonkit
     cd taxonkit/taxonkit/
     go build
    
     # The executable binary file is located in:
     #   ./taxonkit
     # You can also move it to anywhere in the $PATH
     mkdir -p $HOME/bin
     cp ./taxonkit $HOME/bin/
    

Bash-completion

Supported shell: bash|zsh|fish|powershell

Bash:

# generate completion shell
taxonkit genautocomplete --shell bash

# configure if never did.
# install bash-completion if the "complete" command is not found.
echo "for bcfile in ~/.bash_completion.d/* ; do source \$bcfile; done" >> ~/.bash_completion
echo "source ~/.bash_completion" >> ~/.bashrc

Zsh:

# generate completion shell
taxonkit genautocomplete --shell zsh --file ~/.zfunc/_taxonkit

# configure if never did
echo 'fpath=( ~/.zfunc "${fpath[@]}" )' >> ~/.zshrc
echo "autoload -U compinit; compinit" >> ~/.zshrc

fish:

taxonkit genautocomplete --shell fish --file ~/.config/fish/completions/taxonkit.fish

Citation

If you use TaxonKit in your work, please cite:

Shen, W., Ren, H., TaxonKit: a practical and efficient NCBI Taxonomy toolkit, Journal of Genetics and Genomics, https://doi.org/10.1016/j.jgg.2021.03.006 Citation Badge

Contact

Create an issue to report bugs, propose new functions or ask for help.

License

MIT License

Starchart

Stargazers over time

More Repositories

1

seqkit

A cross-platform and ultrafast toolkit for FASTA/Q file manipulation
Go
1,066
star
2

csvtk

A cross-platform, efficient and practical CSV/TSV toolkit in Golang
Go
882
star
3

awesome

Awesome resources on Bioinformatics, data science, machine learning, programming language (Python, Golang, R, Perl) and miscellaneous stuff.
568
star
4

brename

A practical cross-platform command-line tool for safely batch renaming files/directories via regular expression
Go
224
star
5

kmcp

Accurate metagenomic profiling && Fast large-scale sequence/genome searching
Go
139
star
6

bio_scripts

Practical, reusable scripts for bioinformatics
Perl
90
star
7

bio

A lightweight and high-performance bioinformatics package in Golang
Go
83
star
8

unikmer

Toolkit for k-mer with taxonomic information
Go
53
star
9

ClipboardTextJoiner

Monitoring system clipboard change and joining multi-line text. It's very useful when copying multi-line text from PDF files.
Perl
47
star
10

go4bio

Golang for Bioinformatics
31
star
11

gtdb-taxdump

GTDB taxonomy taxdump files with trackable TaxIds
R
28
star
12

easy_qsub

Easily submitting multiple PBS jobs or running local jobs in parallel. Multiple input files supported.
Python
27
star
13

countminsketch

An implementation of Count-Min Sketch in Golang
Go
24
star
14

taxid-changelog

NCBI taxonomic identifier (taxid) changelog, including taxids deletion, new adding, merge, reuse, and rank/name changes.
R
19
star
15

bwt

Burrows-Wheeler Transform and FM-index in golang
Go
18
star
16

cnote

A platform independent command line note app
Go
17
star
17

gtaxon

gTaxon - a fast cross-platform NCBI taxonomy data querying (gi2taxid, taxid2taxon, name2taxid, LCA) tool, with cmd client and REST API server for both local and remote server.
Go
15
star
18

easy_sbatch

easy_sbatch - Batch submitting Slurm jobs with script templates
Python
14
star
19

ncbi_acc2gtdb_acc

Mapping NCBI Genbank accession to GTDB accession
14
star
20

strobemers

A Go implementation of the strobemers (https://github.com/ksahlin/strobemers)
Go
14
star
21

ictv-taxdump

NCBI-style taxdump files for International Committee on Taxonomy of Viruses (ICTV)
12
star
22

crun

Run workflow mixed with concurrent and sequential jobs. Please use https://github.com/shenwei356/rush
Go
10
star
23

breader

breader (Buffered File Reader), asynchronous parsing and pre-processing while reading file. Safe cancellation is also supported.
Go
9
star
24

pinyin

收集汉字,结合汉语拼音来取名
Python
8
star
25

pand

Bitwise AND on two byte-slices using SIMD instructions
Go
7
star
26

unik

A k-mer serialization package for Golang
Go
7
star
27

kmers

bit-packed k-mers methods for Golang
Go
7
star
28

install-windows

Windows系统安装经验
6
star
29

perfect-bioinformatic-tools

What should perfect bioinformatic tools be like?
6
star
30

breseq-rm-bg

Removing control/background mutations from breseq output index.html
Go
5
star
31

bbuffer

An alternative of standard library bytes.Buffer
Go
5
star
32

dirsize

Summarize size of directories and files in directories
Go
5
star
33

datakit

CSV/TSV file manipulation and more. Please use my another tool: csvtk, https://github.com/shenwei356/csvtk
Python
4
star
34

util

Golang utility packages
Go
4
star
35

uint64-hash-bench

Benchmark of three uint64 hash functions
Go
3
star
36

simhash-eval

Go
2
star
37

sun2021-cami-profiles

Ground truth metagenomic profiles in CAMI format for the 25 metagenomic reads in Sun et al.
2
star
38

go-hashing-kmer-bench

Benchmark of hashing k-mers in Golang
Go
2
star
39

shenwei356

2
star
40

RNA-HairpinFigure

Draw hairpin-like text figure from RNA sequence and its secondary structure in dot-bracket notation.
Perl
2
star
41

BioUtil

Bioinformatics Perl modules
Perl
2
star
42

rust-practice

Some tools in Rust for learning
2
star
43

todo

A very simple online todo list application
Go
1
star
44

blast-nf

A nextflow-based BLAST command-line helper tool
Nextflow
1
star
45

easy_run

Run command with default options in configuration file
Python
1
star
46

swr

Wei Shen' R utilities
R
1
star
47

shenwei356.github.io

HTML
1
star
48

uintset

Fast uint64 Set in golang
Go
1
star
49

process_queue

Process queue for high CPU/RAM/time usage processes
Perl
1
star
50

roux2016-mock-virome-cami-profile

Ground truth metagenomic profiles in CAMI format for the mock virome communities in Roux et al.
1
star