跳转到主要内容

Python代码,用于整合tb-pipeline的结果并提供药敏谱、突变和变异

项目描述

Tests Build and release Docker PyPI version Docs

gnomonicus

Python代码,用于整合tb-pipeline的结果并提供药敏谱、突变和变异

提供了一个函数库,可在脚本中使用,以及一个CLI工具,用于将函数链接起来以生成输出

文档

开发者API参考和CLI说明可以在这里找到:https://oxfordmmm.github.io/gnomonicus/

用法

usage: gnomonicus [-h] [-v] --vcf_file VCF_FILE --genome_object GENOME_OBJECT [--catalogue_file CATALOGUE_FILE] [--ignore_vcf_filter] [--output_dir OUTPUT_DIR] [--json] [--csvs CSVS [CSVS ...]] [--debug]
                  [--resistance_genes] --min_dp MIN_DP

options:
  -h, --help            show this help message and exit
  -v, --version         show program's version number and exit
  --vcf_file VCF_FILE   the path to a single VCF file
  --genome_object GENOME_OBJECT
                        the path to a genbank file
  --catalogue_file CATALOGUE_FILE
                        the path to the resistance catalogue
  --ignore_vcf_filter   whether to ignore the FILTER field in the vcf (e.g. necessary for some versions of Clockwork VCFs)
  --output_dir OUTPUT_DIR
                        Directory to save output files to. Defaults to wherever the script is run from.
  --json                Flag to create a single JSON output as well as the CSVs
  --csvs CSVS [CSVS ...]
                        Types of CSV to produce. Accepted values are [variants, mutations, effects, predictions, all]. `all` produces all of the CSVs
  --debug               Whether to log debugging messages to the log. Defaults to False
  --resistance_genes    Flag to filter mutations and variants to only include genes present in the resistance catalogue
  --min_dp MIN_DP       Minimum depth for a variant to be considered in the VCF. Below this value, rows are interpreted as null calls.

安装

使用pip安装最新版本

pip install gnomonicus

从源安装

git clone https://github.com/oxfordmmm/gnomonicus.git
cd gnomonicus
pip install -e .

Docker

应在版本上构建Docker镜像。要打开安装了gnomonicus的shell

docker run -it oxfordmmm/gnomonicus:latest

注意

在生成突变时,在同义氨基酸突变的情况下,也会包括发生变化的核苷酸。这可能导致编码基因中核苷酸和氨基酸的混合,但除非在目录中指定,否则这些不包括在生成效果中。这意味着,无论引入的gene@*?如何,默认规则gene@*= --> S仍然有效。例如

  'MUTATIONS': [
      {
          'MUTATION': 'F2F',
          'GENE': 'S',
          'GENE_POSITION': 2
      },
      {
          'MUTATION': 't6c',
          'GENE': 'S',
          'GENE_POSITION': 6
      },
  ],
  'EFFECTS': {
      'AAA': [
          {
              'GENE': 'S',
              'MUTATION': 'F2F',
              'PREDICTION': 'S'
          },
          {
              'PHENOTYPE': 'S'
          }
      ],
  }

核苷酸变异包含在MUTATIONS中,但除非在目录中指定,否则明确从EFFECTS中移除。为了使这种变异被包含在内,目录中的S@F2F& S@t6c必须存在一行。

用户故事

  1. 作为一名生物信息学家,我希望能够在命令行上运行gnomonicus,传递给它(i)一个GenBank文件(或选择的gumpy.Genome对象),(ii)一个耐药性目录和(iii)一个VCF文件,并返回遗传变异、突变、效应和预测/抗菌谱的pandas.DataFrames。后者的目的是所有在传递的耐药性目录中描述的药物。

  2. 作为一名GPAS开发者,我希望能够将gnomonicus嵌入到Docker镜像/NextFlow管道中,该管道消耗tb-pipeline的输出,并发出一个描述遗传变异、突变、效应和预测/抗菌谱的结构化、精心设计的JSON对象。

  3. 通常,我还希望有输出固定和可变长度FASTA文件(后者考虑了任何输入VCF文件中描述的插入和删除)的选项。

单元测试

为了提高速度,我们不会使用NC_000962.3(即H37Rv M. tuberculosis),而是使用SARS-CoV-2,并创建了一个虚构的耐药性目录,以及一些vcf文件和tests/中的预期输出。

这些可以通过pytest -vv运行

项目详情


下载文件

下载适合您平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源分布

gnomonicus-3.0.1.tar.gz (23.3 kB 查看哈希值)

上传时间

构建分布

gnomonicus-3.0.1-py3-none-any.whl (23.4 kB 查看哈希值)

上传时间 Python 3