识别并从宏基因组组装基因组中删除错误分类的contigs。
项目描述
MAGpurify
本包结合了不同的特性和算法来识别宏基因组组装基因组(MAGs)中的污染。污染定义为相对于MAG中占主导地位的生物体的不同物种起源的contigs。
软件包中的每个模块都设计得非常具体。这意味着并非所有污染(来自其他物种的contigs)都将被删除,但将被错误删除的contigs很少。您可以随意修改默认参数以进行更敏感的污染检测。
安装
安装MAGpurify有两种方式
- 使用conda
conda install -c conda-forge -c bioconda magpurify
- 使用pip
pip install magpurify
如果您使用conda安装MAGpurify,所有依赖项都将自动安装。但是,如果您选择通过pip安装,您将需要安装一些所需的第三方软件
MAGpurify数据库
无论您选择哪种方法安装MAGpurify,您都需要下载一个数据库才能使用其中的一些模块(请参阅对外部数据的依赖部分)
-
下载参考数据库: MAGpurify-db-v1.0.tar.bz2
-
解压缩数据库
tar -jxvf MAGpurify-db-v1.0.tar.bz2
- 更新您的环境
export MAGPURIFYDB=/path/to/MAGpurify-db-v1.0
如果您不想将数据库添加到PATH中,您仍然可以通过phylo-markers
、clade-markers
和known-contam
模块的--db
参数来使用它。
MAGpurify数据库托管在Zenodo上,可以通过数字对象标识符引用。
快速概述
程序被分解成几个模块
$ 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>
执行完所需的模块后,将删除标记的contigs
$ magpurify clean-bin <input mag> <output directory> <output mag>
就是这样简单!
对外部数据的依赖性
tetra-freq
和gc-content
不依赖于外部数据。《code>phylo-markers、《code>clade-markers和known-contam
模块可以使用标准的MAGpurify数据库运行。《code>conspecific模块要求您构建自己的数据库。《code>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
从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个至少预测了一个污染,清洁的bin已写入example/output/cleaned_bin.fna
使用conspecific
模块的示例
要运行conspecific
模块,您需要使用Mash构建自己的参考数据库。我们提供了一些示例文件来说明这一点(但您不应使用它们来处理您的数据!)
$ mash sketch -l example/ref_genomes.list -o example/ref_genomes
此命令将创建example/ref_genomes.list
中列出的位于example/ref_genomes
中的基因组的一个Mash草图。草图将被写入example/ref_genomes.msh
现在您可以运行conspecific模块
$ 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
所以,仅conspecific模块就识别出了238个潜在的污染物!这表明,当您的MAG与参考数据库中的密切相关的基因组相似时,该模块可以非常敏感……或者与其他MAG!
使用coverage
模块的示例
要运行coverage
模块,您需要输入一个包含映射到MAG(或原始宏基因组,只要contig名称未更改)的排序BAM文件。您还可以输入多个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数据库中系统发育标记基因的数据库对您的contigs进行分类注释,并识别系统发育不一致的contigs来工作。
clade-markers
此模块与phylo-markers
非常相似,但使用MetaPhlAn 2数据库中的族特异性标记进行分类注释。
conspecific
此模块背后的逻辑是,同一物种的菌株在大部分基因组中应该是相似的。因此,此模块首先找到同一物种的菌株,然后对contigs进行成对对齐。识别那些在基因组之间完全不对齐的污染物。
tetra-freq
此模块通过基于四核苷酸频率(TNF)识别具有异常核苷酸组成的contigs。为了将TNF降低到单一维度,进行主成分分析(PCA),并使用第一个主成分。
gc-content
此模块通过基于GC含量的核苷酸组成识别具有异常核苷酸组成的contigs。
coverage
此模块通过基于读映射信息识别具有异常覆盖率的contigs。
known-contam
此模块通过识别与已知污染物数据库匹配的contigs来工作。到目前为止,数据库中只有人类基因组phiX基因组。
引用
如果此代码对您有用,请引用
纳伊法赫,斯蒂芬等。《从全球人类肠道微生物组未培养基因组中获得的新见解。》自然 568.7753 (2019): 505-510。
项目详情
下载文件
下载适用于您的平台文件。如果您不确定选择哪个,请了解更多关于 安装包 的信息。
源分发
构建分发
magpurify-2.1.2.tar.gz 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | aeb2121824bf327e90a8f4101819dcff96ca7ecee7d9ad087b5ac3354ff0a77c |
|
MD5 | b3268a0e97625a2c30747518938e5d23 |
|
BLAKE2b-256 | bc6ab9119a3616477f2c07f3a004946fdbec7b8f6c070e2d5b73534207c2d315 |
magpurify-2.1.2-py3-none-any.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 9ca288b574bfb80452d1a6029f3163b92852212f87966f72de98a3f867199e33 |
|
MD5 | cf03c5764e03510b5f550799fa00f233 |
|
BLAKE2b-256 | 529c67587d873c52d47983f5973461bf398dbbb86b47b81461f3276d8d9f893b |