分类命名和注释工具
taxtastic的Python项目详细描述
taxtastic是一个python包,用于构建和维护引用 包-即参考树、参考路线的集合, 配置文件和相关的分类信息。
我们喜欢它,但它是什么?
名为taxit的脚本提供命令行界面:
% taxit --help usage: taxit [-h] [-V] [-v] [-q] {help,add_nodes,add_to_taxtable,check,composition,create,extract_nodes,findcompany,get_lineage,info,lonelynodes,new_database,refpkg_intersection,reroot,rollback,rollforward,rp,strip,taxids,taxtable,update,update_taxids} ... Creation, validation, and modification of reference packages for use with `pplacer` and related software. positional arguments: {help,add_nodes,add_to_taxtable,check,composition,create,extract_nodes,findcompany,get_lineage,info,lonelynodes,new_database,refpkg_intersection,reroot,rollback,rollforward,rp,strip,taxids,taxtable,update,update_taxids} help Detailed help for actions using `help <action>` add_nodes Add nodes and names to a database add_to_taxtable Add nodes to an existing taxtable csv check Validate a reference package composition Show taxonomic composition of a reference package create Create a reference package extract_nodes Extract nodes from a given source in yaml format findcompany Find company for lonely nodes get_lineage Calculate the taxonomic lineage of a taxid info Show information about reference packages. lonelynodes Extracts tax ids of all lonely nodes in a taxtable new_database Download NCBI taxonomy and create a database refpkg_intersection Find the intersection of a taxtable and a refpkg's taxonomy. reroot Taxonomically reroots a reference package rollback Undo an operation performed on a refpkg rollforward Restore a change to a refpkg immediately after being reverted rp Resolve path; get the path to a file in the reference package strip Remove rollback and rollforward information from a refpkg taxids Convert a list of taxonomic names into a recursive list of species taxtable Create a tabular representation of taxonomic lineages update Add or modify files or metadata in a refpkg update_taxids Update obsolete tax_ids optional arguments: -h, --help show this help message and exit -V, --version Print the version number and exit -v, --verbose Increase verbosity of screen output (eg, -v is verbose, -vv more so) -q, --quiet Suppress output
安装
taxtastic需要python版本2.7或3.4+。最简单的 安装方法是使用pip:
pip install taxtastic
我们强烈建议安装到virtualenv中。干净的 Ubuntu16.04系统,安装 taxtastic包和 下面是virtualenv。注意python2.7不再安装 在16.04中默认为:
sudo apt-get update sudo apt-get install python2.7 python-virtualenv
安装python2之后,创建一个virtualenv并安装taxtastic:
virtualenv taxtastic-env
或者使用python3.4+:
python3 -m venv taxtastic-env
然后,对于所有python版本:
source taxtastic-env/bin/activate pip install -U pip pip install taxtastic
如果您喜欢从git存储库安装:
git clone https://github.com/fhcrc/taxtastic.git cd taxtastic virtualenv taxtastic-env # eg, for python2 source taxtastic-env/bin/activate pip install .
如果你想危险地生活并将软件包安装到系统中 尽管我们请求不要这样做:
sudo apt-get install python-pip sudo pip install taxtastic
如果您不熟悉python虚拟环境,则 以下帖子很有帮助: https://realpython.com/blog/python/python-virtual-environments-a-primer/
最后,taxit可以从Docker托管的Docker映像运行 轮毂(https://hub.docker.com/r/nghoffman/taxtastic/),例如:
docker run --rm -it -v $(pwd):$(pwd) -w $(pwd) nghoffman/taxtastic:0.8.3 taxit -v new_database
注意,必须指定给定版本的标记:使用 :latest(对于这个或任何其他Docker映像)不是很好 可复制!
sqlite3
taxtastic使用递归公共表表达式来查询 分类数据库,它要求pythonsqlite3模块 是根据3.8.3或更高版本的sqlite3库构建的 (http://www.sqlite.org/releaselog/3_8_3.html)。你可以检查 这样的版本:
python -c 'import sqlite3; print sqlite3.sqlite_version'
dev/install_pysqlite.sh
或者,为了避免复制回购协议:
curl https://raw.githubusercontent.com/fhcrc/taxtastic/master/dev/install_pysqlite.sh | bash
脚本完成后,确认pysqlite2已安装:
python -c 'from pysqlite2 import dbapi2; print dbapi2.sqlite_version'
此时,Taxtastic可按上述方式安装。
注意pysqlite2只对python2可用,因此 在像ubuntu 14.04这样的旧系统上使用python3不是一个好的选择 早些时候,除非你想编译python3的一个版本 与更新的sqlite3库链接的解释器。如果你必须使用 旧的系统,使用python2,或者使用docker映像。
关于数据库的说明
此项目同时支持sqlite3和postgresql作为数据库 后端。对于大多数应用程序,我们建议使用sqlite3:一些操作 (特别是最初的数据库创建)使用sqlite3要快得多 由于postgresql如何实施数据库约束的细节(我们 在未来可能会尝试优化它-理论上,postgresql可以 做得至少和它一样快)。如果您确实想使用PostgreSQL,请注意 一些查询会消耗大量内存,默认情况下 配置往往是内存受限的(而且这个really速度变慢了 一切都结束了)。在一台相当新的Mac笔记本电脑上,我们发现 此处建议的优化 (http://big-elephants.com/2012-12/tuning-postgres-on-macos/)执行 诡计。