生物信息学管道管理与开发框架
bio-pype的Python项目详细描述
构建、组织和标准化的简单而纤细的python框架 生物信息学分析。
The system is built around the python argparse module, to provide command line interface to run the configured analyses. The framework is heavily customizable and provides basic method to access to Environment Modules and implements various queuing systems such as moab/torque.
安装
来自pypi
pip install bio_pype
来自git的开发版本
git clone https://bitbucket.org/ffavero/bio_pype cd bio_pype python setup.py test python setup.py install
在'computerome'中安装virtualenv HPC<;https://computerome.dtu.dk>;``系统:
(或在未在系统级安装Virtualenv的任何系统中)
mkdir ~/venv_files # Download virtualenv files (not installed in the python version used in computerome) curl -L -o ~/venv_files/setuptools-20.2.2-py2.py3-none-any.whl https://github.com/pypa/virtualenv/raw/develop/virtualenv_support/setuptools-20.2.2-py2.py3-none-any.whl curl -L -o ~/venv_files/pip-8.1.0-py2.py3-none-any.whl https://github.com/pypa/virtualenv/raw/develop/virtualenv_support/pip-8.1.0-py2.py3-none-any.whl curl -L -o ~/venv_files/virtualenv.py https://github.com/pypa/virtualenv/raw/develop/virtualenv.py # Create a virtual environment python ~/venv_files/virtualenv.py --extra-search-dir=~/venv_files ~/venv_bio_pype # Activate the environment source ~/venv_bio_pype/bin/activate # Install bio_pype as instructed above # The pype command line utility will be available upon the "activation" of the environment or by specifying the full path, in this case: # ~/venv_bio_pype/bin/pype # To deactivate the virtual env: deactivate
基本用法
访问一级模块:
$ pype usage: pype [-p PROFILE] {pipelines,profiles,repos,snippets} ... Slim and simple framework to ease the managements of data, tools and pipelines in the computerome HPC positional arguments: pipelines Workflows built by assembling pipelines and snippets profiles Set of databases softwares and meta information repos Management of pype modules snippets Single tasks implementations optional arguments: -p PROFILE, --profile PROFILE Select the profile. This will define things like databases, reference genomes paths,specific version of programs to loads and other similar configurations. Default: default This is version 0.9.0 - Francesco Favero - 15 May 2017
安装回购:
默认情况下,模块存储库为空。
要安装所需的存储库,请列出可用的存储库:
$ pype repos list -a
安装选定的存储库:
$ pype repos install -f sequenza
更多详细信息
可以通过 环境变量,包测试模块的示例:
$ PYPE_SNIPPETS=test/data/snippets pype snippets error: too few arguments usage: pype snippets {reverse_fa,complement_fa,lower_fa,test} ... positional arguments: {reverse_fa,complement_fa,lower_fa,test} reverse_fa reverse a fasta sequence complement_fa lower case a fasta sequence lower_fa lower case a fasta sequence test test_snippets
片段
代码片段是执行给定任务的python模块:
$ PYPE_SNIPPETS=test/data/snippets pype snippets test error: argument --test is required usage: pype snippets test --test TEST [-o OPT] optional arguments: --test TEST Test metavar -o OPT test option
$ PYPE_SNIPPETS=test/data/snippets pype snippets test --test World Hello World
$ PYPE_SNIPPETS=test/data/snippets pype snippets test --test mate -o Cheers Cheers mate
管道:
管道是yaml文件tbat group any snippet或其他管道, 具有所需的依赖顺序。
$ PYPE_SNIPPETS=test/data/snippets PYPE_PIPELINES=test/data/pipelines pype pipelines error: too few arguments usage: pype pipelines [--queue {echo,none}] {rev_compl_low_fa} ... positional arguments: {rev_compl_low_fa} rev_compl_low_fa Reverse Complement Lower case a fasta optional arguments: --queue {msub,echo,none} Select the queuing system to run the pipeline --log LOG Path used to write the pipeline logs. Default working directory.
管道的参数是从yaml文件中动态解析的, 它定义了工具和执行流程:
info: description: Reverse Complement Lower case a fasta date: 06/07/2016 items: - name: lower_fa type: snippet arguments: -i: '%(complement_fa)s' -o: '%(output)s' dependencies: items: - name: complement_fa type: snippet arguments: -i: '%(reverse_fa)s' -o: '%(complement_fa)s' dependencies: items: - name: reverse_fa type: snippet arguments: -i: '%(input_fa)s' -o: '%(reverse_fa)s'
生成的argparse接口:
$ PYPE_SNIPPETS=test/data/snippets PYPE_PIPELINES=test/data/pipelines pype pipelines rev_compl_low_fa error: argument --complement_fa is required usage: pype pipelines rev_compl_low_fa --complement_fa COMPLEMENT_FA --output OUTPUT --reverse_fa REVERSE_FA --input_fa INPUT_FA optional arguments: --complement_fa COMPLEMENT_FA complement_fa type: str --output OUTPUT output type: str --reverse_fa REVERSE_FA reverse_fa type: str --input_fa INPUT_FA input_fa type: str
有关read the docs的详细信息 (慢慢记录各种特性/变化)。