Skip to main content

从宏基因组组装的基因组中识别并删除错误分类的重叠群。

项目描述

MAG净化

该软件包使用不同特征和算法的组合来识别宏基因组组装基因组 (MAG) 中的污染。污染被定义为相对于 MAG 中存在的优势生物起源于不同物种的重叠群。

软件包中的每个模块都设计得非常具体。这意味着并非所有污染(来自其他物种的重叠群)都会被移除,但很少有重叠群会被错误地移除。随意修改默认参数以更灵敏地检测污染。

安装

MAGpurify 有两种安装方式:

  • 使用康达:
conda install -c conda-forge -c bioconda magpurify
  • 使用点子:
pip install magpurify

如果您使用 conda 安装 MAGpurify,所有依赖项都将自动安装。但是,如果选择通过 pip 安装,则需要安装一些必需的第三方软件:

MAGpurify 数据库

无论您选择安装 MAGpurify 的哪种方法,您都需要下载数据库才能使用它的一些模块(请参阅对外部数据的依赖部分):

tar -jxvf MAGpurify-db-v1.0.tar.bz2
  • 更新您的环境:
export MAGPURIFYDB=/path/to/MAGpurify-db-v1.0

如果你不想把数据库放到你的 PATH 中,你仍然可以通过,和模块的--db参数来使用它。phylo-markersclade-markersknown-contam

MAGpurify 数据库托管在 Zenodo 中,可以通过数字对象标识符进行引用:

DOI

快速概览

该程序分为几个模块:

$ magpurify

usage: magpurify [-h] [--version]
                 {phylo-markers,clade-markers,conspecific,tetra-freq,gc-content,coverage,known-contam,clean-bin}
                 ...

Identify and remove incorrectly binned contigs from metagenome-assembled
genomes.

positional arguments:
  {phylo-markers,clade-markers,conspecific,tetra-freq,gc-content,coverage,known-contam,clean-bin}
    phylo-markers       find taxonomic discordant contigs using a database of
                        phylogenetic marker genes.
    clade-markers       find taxonomic discordant contigs using a database of
                        clade-specific marker genes.
    conspecific         find contigs that fail to align to closely related
                        genomes.
    tetra-freq          find contigs with outlier tetranucleotide frequency.
    gc-content          find contigs with outlier GC content.
    coverage            find contigs with outlier coverage profile.
    known-contam        find contigs that match a database of known
                        contaminants.
    clean-bin           remove putative contaminant contigs from bin.

optional arguments:
  -h, --help            show this help message and exit
  --version             show program's version number and exit

MAGpurify 模块按顺序执行,通常使用以下命令结构:

$ magpurify <module> <input mag> <output directory>

执行所需的模块后,将删除标记的 contig:

$ magpurify clean-bin <input mag> <output directory> <output mag>

就这么简单!

对外部数据的依赖

tetra-freq并且gc-content不要依赖外部数据。phylo-markers和模块可以使用标准的 MAGpurify 数据库运行clade-markersknown-contamconspecific模块要求您构建自己的数据库。该coverage模块需要输入 BAM 文件。

使用默认数据库的示例

接下来的几行将向您展示如何使用软件随附的单个 MAG 运行软件。

首先,运行各个模块以预测示例example/test.fna文件中的污染并将结果存储在example/output

$ magpurify phylo-markers example/test.fna example/output
$ magpurify clade-markers example/test.fna example/output
$ magpurify tetra-freq example/test.fna example/output
$ magpurify gc-content example/test.fna example/output
$ magpurify known-contam example/test.fna example/output

每个模块的输出存储在输出目录中:

$ ls example/output

clade-markers gc-content known-contam phylo-markers tetra-freq

现在使用以下命令清除垃圾箱中的污染物clean-bin

$ magpurify clean-bin example/test.fna example/output example/test_cleaned.fna

• Reading genome bin
  genome length: 704 contigs, 4144.3 Kbp

• Reading flagged contigs
  phylo-markers: 1 contigs, 17.18 Kbp
  clade-markers: 3 contigs, 17.1 Kbp
  conspecific: no output file found
  tetra-freq: 0 contigs, 0.0 Kbp
  gc-content: 0 contigs, 0.0 Kbp
  coverage: no output file found
  known-contam: 0 contigs, 0.0 Kbp

• Removing flagged contigs
  removed: 4 contigs, 34.28 Kbp
  remains: 700 contigs, 4110.03 Kbp
  cleaned bin: example/test_cleaned.fna

总而言之,7 个模块中有 2 个预测至少有一种污染物,并且已清洁的垃圾箱被写入example/output/cleaned_bin.fna

conspecific使用模块的示例

要运行该conspecific模块,您需要使用 Mash 构建自己的参考数据库。我们提供了一些虚拟文件来说明这一点(但您不应该将它们与您的数据一起使用!):

$ mash sketch -l example/ref_genomes.list -o example/ref_genomes

example/ref_genomes.list此命令将创建位于 中列出的基因组的 Mash 草图example/ref_genomes。草图将被写入example/ref_genomes.msh

现在您可以运行特定模块:

$ magpurify conspecific example/test.fna example/output example/ref_genomes.msh

• Finding conspecific genomes in database
  25 genomes within 0.05 mash-dist
  list of genomes: example/output/conspecific/conspecific.list
  mash output: example/output/conspecific/mash.dist

• Performing pairwise alignment of contigs in bin to database genomes
  total alignments: 12125

• Summarizing alignments
  contig features: example/output/conspecific/contig_hits.tsv

• Identifying contigs with no conspecific alignments
  238 flagged contigs, 450.02 Kbp
  flagged contigs: example/output/conspecific/flagged_contigs

因此,仅同种模块就确定了 238 种假定的污染物!这说明当您的 MAG 与您的参考数据库中密切相关的基因组……或其他 MAG 相似时,此模块可能非常敏感!

coverage使用模块的示例

要运行该coverage模块,您需要输入一个排序的 BAM 文件,其中包含映射到 MAG(或原始宏基因组,只要 contig 名称不变)的读取。您还可以输入多个 BAM 文件,MAGpurify 将选择具有最大平均 contig 覆盖率的文件。

$ magpurify coverage example/test.fna example/output BAM/sample_1.bam BAM/sample_2.bam BAM/sample_3.bam

• Computing contig coverage

• Identifying outlier contigs

• Sample being used for outlier detection: sample_2
  2 flagged contigs: example/output/coverage/flagged_contigs

各个模块的详细信息

phylo-markers

该模块的工作原理是根据来自 PhyEco 数据库的系统发育标记基因数据库对您的重叠群进行分类注释,并识别分类不一致的重叠群。

clade-markers

该模块的工作方式与 非常相似phylo-markers,但使用来自 MetaPhlAn 2 数据库的进化枝特异性标记进行分类注释。

conspecific

该模块背后的逻辑是同一物种的菌株在大部分基因组中应该具有相似性。因此,该模块首先找到相同物种的菌株,然后进行重叠群的成对比对。鉴定出基因组之间根本不对齐的污染物。

tetra-freq

该模块的工作原理是根据四核苷酸频率 (TNF) 识别具有异常核苷酸组成的重叠群。为了将 TNF 降低到一维,执行主成分分析 (PCA) 并使用第一个主成分。

gc-content

该模块的工作原理是根据 GC 含量识别具有异常核苷酸组成的重叠群。

coverage

该模块通过基于读取映射信息识别具有异常覆盖率的重叠群来工作。

known-contam

该模块通过识别与已知污染物数据库匹配的重叠群来工作。到目前为止,人类基因组和 phiX 基因组是数据库中唯一的基因组。

引文

如果此代码有用,请引用:

Nayfach,斯蒂芬等人。“来自全球人类肠道微生物组未培养基因组的新见解。Nature 568.7753 (2019): 505-510。

项目详情


下载文件

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

源分布

magpurify-2.1.2.tar.gz (33.7 kB 查看哈希

已上传 source

内置分布

magpurify-2.1.2-py3-none-any.whl (41.8 kB 查看哈希

已上传 py3