分类命名和注释工具

taxtastic的Python项目详细描述


taxtastic是一个python包,用于构建和维护引用 包-即参考树、参考路线的集合, 配置文件和相关的分类信息。

https://travis-ci.org/fhcrc/taxtastic.svg?branch=master

我们喜欢它,但它是什么?

名为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'
{tt9}$将退出一个错误,如果SqLITE3库 不满足依赖关系。在较旧的系统上(仅限于python2),它是 可以通过安装来替换内置的sqlite3模块 pysqlite2在安装 使用taxtasticgit中提供的脚本使用pip打包 存储库(假设是活动的virtualenv):

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/)执行 诡计。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java Intellij通过方法中的包查找用法   java中VS代码和打包命名的问题   将java CMS功能集成到具有高度动态内容的网站(Lucene/Mysql/Nosql)的策略   oracle的java类强制转换异常。jdbc。驾驶员OracleConnection   字节码向JVM添加上指令   如何在抽象类中执行java方法?   java是否可以在apache访问日志中排除指定的GET参数?(作者:W7开发环境)   java如何获取已安装音频播放器的列表?   尝试向HS学生展示如何使用Java访问MS数据库   使用正则表达式java对给定行中的特定字符串进行计数   java JOOQ Select查询中的Select计数   方法Java,如何从二维双精度数组中找到特定值?   获取图像URL的java正则表达式   java在切换到新的窗口驱动程序后找不到元素