首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >噬菌体宿主预测工具——iPHoP

噬菌体宿主预测工具——iPHoP

作者头像
用户1075469
发布2025-08-25 17:39:46
发布2025-08-25 17:39:46
20500
代码可运行
举报
文章被收录于专栏:科技记者科技记者
运行总次数:0
代码可运行

Hello,Hello小伙伴们大家好,好久没跟大家分享干货啦!近年来,随着宏病毒组学研究的快速发展,病毒与宿主的互作关系逐渐成为微生物生态学和环境基因组学领域的研究重点。如何在大规模的病毒序列中准确、高效地预测潜在宿主,是解析病毒生态功能和宿主特异性的重要环节。

iPHoP(Integrated Phage Host Prediction)是一款由美国德克萨斯大学奥斯汀分校 Ben Bolduc 等人开发的综合性病毒宿主预测软件。该工具宏基因组、病毒组及微生物组数据的宿主推断,尤其在环境与临床样本中表现出较强的适应性和实用性。其主要优势包括:

  • 灵活的数据库扩展:允许用户引入自建 MAGs 数据库,从而提高宿主预测的局部相关性;
  • 详尽且可追溯的输出结果:预测结果包含置信度评分及多种证据类型,便于后续筛选与验证。

综上,iPHoP 为大规模病毒-宿主预测提供了一种高效且系统化的解决方案,对探索病毒生态学、噬菌体应用及病毒-宿主互作网络具有重要价值。

软件原理

iPHoP 工作原理与预测流程

iPHoP(Integrated Phage Host Prediction)是一种集成多源信息、基于多策略融合的病毒宿主预测软件,旨在从宏基因组或病毒组数据中推断噬菌体及古菌病毒的宿主属级分类。该方法主要分为以下三个关键模块:

① 并行运行多种宿主预测工具(图 D 左)

iPHoP 针对每条输入病毒序列,分别运行 6 种独立的宿主预测方法,包括:

  • 5 种基于宿主基因组的方法(host-based)
    • BLAST:基于病毒序列与宿主基因组的同源性比对;
    • CRISPR:识别宿主中的 spacer 序列是否匹配病毒序列;
    • VirHostMatcher(VHM):基于 k-mer 分布相似性计算宿主相似度;
    • WIsH:通过马尔可夫模型评估病毒与宿主基因组的统计相似性;
    • PHP:依据病毒蛋白质序列特征预测潜在宿主。
  • 1 种基于病毒基因组特征的方法(phage-based)
    • RaFAH:基于病毒序列本身训练的随机森林分类器,仅依赖病毒信息进行宿主分类预测。
② 分类学感知评分与候选宿主筛选(图 A 中)

对于基于宿主的方法(如 BLAST、CRISPR 等),iPHoP 在保留一定灵敏度的条件下提取命中列表,并计算所有命中宿主之间的系统发育距离(参考 GTDB 分类体系),形成一个命中评分矩阵。随后,iPHoP 采用一系列策略对这些命中进行聚类,并以候选宿主为中心,计算其与命中列表中其他物种的距离、支持数目和得分(如 Top 5 hit score、phylogenetic distance 等)。这些特征随后输入神经网络与随机森林分类器中,生成针对每一个候选宿主的置信得分,形成“taxonomy-aware”评分,强化预测的系统发育一致性。

③ 多策略结果整合与 FDR 评估(图 A 扩展)

iPHoP 对所有预测结果进行统一整合,策略如下:

  • 对于每一种宿主预测工具,选取最佳打分及其对应的经验假阳性率(empirical FDR)
  • 将所有基于宿主的方法的得分输入随机森林模型,计算一个整合得分(Combined-hosts RF classifier);
  • 将该整合结果与 RaFAH 的 phage-based 得分一起整合;
  • 最终输出每个病毒序列对应的预测宿主属(或属以上分类水平)、综合得分(称为 iPHoP score)及其经验 FDR 值,用于后续筛选与可视化。

下载网址:

https://bitbucket.org/srouxjgi/iphop/src/main/

软件安装
代码语言:javascript
代码运行次数:0
运行
复制
# Bioconda安装(推荐方式)
# 创建专属环境避免依赖冲突
conda create -n iPHoP -c conda-forge -c bioconda iphop
# 激活环境
conda activaste iPHoP
# 验证安装是否成功
iphop --version
# Docker容器部署
# 获取官方镜像
docker pull quay.io/biocontainers/iphop:v1.2.0
# 验证安装是否成功
docker run -it quay.io/biocontainers/iphop:v1.2.0 iphop --help
注:小编的安装方法和官网上提及的方法有所不同,因为小编习惯将每个软件单独创建一个虚拟conda环境。
数据库
简介:
iPHoP v1.4.1 引入了新的压缩数据库格式,支持最新的 GTDB r226 版本以及 2025 年的 IMG 和 MGnify 公共 MAG 数据,同时优化了数据库结构,简化了大规模 MAG 集合的添加流程。用户可按需下载不同数据库版本。

下载网址:

https://portal.nersc.gov/cfs/m342/iphop/db/

版本说明:

Jun_25_pub_rw:当前最新的数据库

  • 基于 GTDB 第 226 版(共收录 482,038 个基因组,其中 143,614 个为代表性基因组)
  • 包含截至 2025 年 5 月IMG 公共 bin(192,260 个基因组,43,100 个代表性基因组)
  • 包含截至 2025 年 5 月MGnify 公共 bin(481,678 个基因组,5,279 个代表性基因组

默认下载数据库为当前最新版,当前最新版本为iPHoP_db_Jun25_rw,如下图所示;

数据库下载

代码语言:javascript
代码运行次数:0
运行
复制
# 软件推荐的下载命令
iphop download --db_dir iphop_db
# 这个数据库最新的版本有279G,根据小编的经验,使用iphop下载速度慢,而且容易中断,官方已经将数据集拆分成27个子集,类似于GTDB数据库,小伙伴们可以先用wget批量下载,经过md5校验后cat命令进行合并
for i in {00..27}
do 
    wget -c -nv -b -a download.log https://portal.nersc.gov/cfs/m342/iphop/db/iPHoP_db_Jun25_rw.tar.gz.${i}
done
cat iPHoP_db_Jun25_rw.tar.gz* > iPHoP_db_Jun25_rw.tar.gz
# 解压
mkdir -p iPHoP_db_Jun25_rw
tar -xvzf iPHoP_db_Jun25_rw.tar.gz -C iPHoP_db_Jun25_rw
# 检验数据库
cd iPHoP_db_Jun25_rw
md5sum -c md5checkfile.txt > md5checkfile.check
软件使用方法
1.查看软件主要功能
代码语言:javascript
代码运行次数:0
运行
复制
# 查看软件使用帮助
iphop -h 
iPHoP v1.3.3: integrating Host Phage Predictions
https://bitbucket.org/srouxjgi/iphop
usage: iphop <task> [options]
task:
        predict         run full pipeline to generate host prediction for some input phage genome(s)
        download        download and setup the latest host database
        add_to_db       add some host genomes to the database of hosts (e.g. MAGs derived from the same metagenome(s))
other:
        split           small utility to split a fasta file into smaller batches (can be useful if you would like to split your input and run iPHoP separately for each batch)
        clean           small utility to clean the output directory of iPHoP by compressing some of the larger files.
optional arguments:
  -h, --help  show this help message and exit

主要功能解读

子命令

功能概述

使用场景

predict

对输入的病毒序列进行宿主预测

标准分析流程

download

下载官方标准宿主数据库

下载/更新数据库

add_to_db

添加自定义宿主基因组(如 MAGs)至宿主数据库

定制分析特定环境样本

split

拆分大型FASTA文件,便于并行运行

大批量输入 / 多线程分析

clean

压缩中间文件,清理空间

批量运行完成后释放磁盘空间

2.预测病毒宿主
代码语言:javascript
代码运行次数:0
运行
复制
# 病毒宿主预测
iphop predict -h 
Run full pipeline to predict host of input bacteriophage/archaeal virus genomes
usage: iphop predict --fa_file <input genomes> --out_dir <output directory> [options]
optional arguments:
  -h, --help            show this help message and exit
  --fa_file INPUT_FILE, -f INPUT_FILE
                        input fasta file of virus sequences
  --out_dir OUT_DIR, -o OUT_DIR
                        output directory (default = ./)
  --db_dir DB_PATH, -d DB_PATH
                        database directory (default = /home/Data/Jun25_2025_pub_rw/db)
  --num_threads THREADS, -t THREADS
                        number of threads (default = 1)
  --step STEP, -s STEP  To run only specific step(s) (default: all, options: compute / classify)
  --min_score MIN_SCORE, -m MIN_SCORE
                        Minimum confidence score for final output file - between 75 and 100. Default is 90, i.e. ~10% FDR (roughly). For ~5% overall (roughly) estimated FDR, use a minimum score of 95, etc.').
  --no_qc               Bypass the automated QC that filters out input sequences with > 10% Ns or with characters other than ATCGN. Warning: if set to true, low-quality sequences (with Ns or unusual characters) may lead to unexpected failures at multiple steps. (default = False)
  --debug               Run in a more verbose mode for debugging / troubleshooting purposes (warning: iPHoP becomes quite chatty in this mode..)
  --single_thread_wish  Force the recoded version of wish to run on a single thread instead of all the threads given to iPHoP (with --num_threads)

主要功能解读

参数

功能描述与默认值

--fa_file / -f

输入病毒序列的 FASTA 文件(必填)。

--out_dir / -o

输出目录,默认当前目录 ./。

--db_dir / -d

宿主数据库目录,默认路径为 /home/Data/Jun25_2025_pub_rw/db,可通过 download 或 add_to_db 构建。

--num_threads / -t

设置并行线程数,默认 1,建议根据硬件资源设置更高值以提升运行效率。

--step / -s

控制执行步骤,默认运行全部流程(compute + classify),也可仅执行 compute 或 classify 用于调试。

--min_score / -m

设置最小置信分数阈值,区间[70-95],默认 90(约 10% 假阳性率 FDR),设为 95 可提高预测精度(约 5% FDR)。

--no_qc

跳过自动质控,默认关闭。启用后将保留 >10% N 或非标准字符序列,可能导致预测失败。

--debug

启用调试模式,默认关闭。开启后输出详细日志,适用于排查运行错误。

--single_thread_wish

强制 WIsH 子模块单线程运行,默认关闭,用于避免多线程冲突。

--help / -h

显示命令帮助信息并退出程序。

3.添加自定义宿主基因组(如 MAGs)至宿主数据库
代码语言:javascript
代码运行次数:0
运行
复制
# 自定义宿主库
iphop add_to_db -h 
Add new genomes to the host database, for instance, new MAGs assembled from the same sample as the input phage/archaeovirus genomes
ote: the original database will not be duplicated but only linked to the updated one. If the path to the original database changes, the updated database will need to be rebuilt.
usage: iphop add_to_db --input_dir <directory with new host genomes> --gtdb_dir <output directory from GTDBtk (bacteria and archaea)> [options]
optional arguments:
  -h, --help            show this help message and exit
  --fna_dir FNA_DIR, -f FNA_DIR
                        input fasta directory (one fasta file per genome)
  --gtdb_dir GTDB_DIR, -g GTDB_DIR
                        GTDBtk result directory, with bacteria and/or archaea tree(s) including the new genomes to be added to the database
  --out_dir OUT_DIR, -o OUT_DIR
                        output directory - will include the new database (default = ./new_db)
  --num_threads THREADS, -t THREADS
                        number of threads (default = 1)
  --db_dir DB_PATH, -d DB_PATH
                        absolute path to the original database directory - will be completed with new genomes (default = /mnt/sdb/share/database/Tools/iPHoP/Jun25_2025_pub_rw/db)
  --debug               Run in a more verbose mode for debugging / troubleshooting purposes (warning: iPHoP becomes quite chatty in this mode..)
主要功能解读

参数

功能与默认说明

--fna_dir / -f

输入基因组的 FASTA 文件目录(每个基因组一个文件),通常为组装和binning得到的 MAGs。

--gtdb_dir / -g

对应这些基因组的 GTDB-Tk 输出目录,应包含细菌和/或古菌的系统发育树结构文件(如bac120)。

--out_dir / -o

输出目录,默认值为 ./new_db。将生成包含新宿主信息的数据库副本。

--num_threads / -t

并行线程数,默认值为 1。建议根据系统资源设置为 8 或更高以提升速度。

--db_dir / -d

原始宿主数据库的绝对路径,默认值为/home/Data/Jun25_2025_pub_rw/db。新添加的 MAGs 信息将在此基础上进行扩展(不会复制原始数据库,仅建立链接)。

--debug

启用调试模式,默认关闭。开启后将输出详细调试日志,适用于故障排查。

--help / -h

显示帮助信息并退出程序。

实战演练
代码语言:javascript
代码运行次数:0
运行
复制
# 使用默认的数据库预测宿主
iphop predict --fa_file virus_assembly_genome.fna --out_dir iphop --db_dir iPHoP/Jun25_2025_pub_rw --num_threads 32 --min_score 90
# 添加binning好的MAGs当宿主(官方给的示例数据)
# GTDB构建系统发育信息(以细菌为例,这步很慢)
gtdbtk de_novo_wf --genome_dir Data_test_add_to_db_v1.4/Wetland_MAGs/ --bacteria --outgroup_taxon p__Patescibacteriota --out_dir Wetland_MAGs_GTDB-tk_results/ --cpus 32 --force --extension fa
# 将有注释信息和系统发育的信息添加到宿主数据库
iphop add_to_db --fna_dir Data_test_add_to_db_v1.4/Wetland_MAGs/ --gtdb_dir Wetland_MAGs_GTDB-tk_results/ --out_dir Jun_2025_pub_rw_w_Wetland_hosts --db_dir iPHoP/Jun_2025_pub_rw
# 使用新构建的数据库做预测
iphop predict --fa_file Input_viral_contigs.fasta --db_dir Jun_2025_pub_rw_w_Wetland_hosts/ --out_dir test_add_db -t 4 --min_score 75
结果文件说明

1.结果目录

2.文件或目录含义

  • Date_and_version.log
    • 日志文件,记录运行日期与 iPHoP 的版本信息。
    • 方便追踪分析结果的 reproducibility(可复现性)。
  • Detailed_output_by_tool.csv
    • 各个宿主预测软件(如 RaFAH、blastn、CRISPR、WIsH 等)的详细预测结果汇总。
    • 每条病毒序列对应的宿主候选及分值会逐一列出,适合做深入分析或工具间对比。
  • Host_prediction_to_genome_m90.csv
    • 将宿主预测结果映射到 具体基因组水平 的表格。
    • m90 表示采用最小置信度阈值 90(即 ~10% 假阳性率 FDR)。
    • 内容包括:病毒序列 ID、预测宿主基因组 ID、得分。
  • Host_prediction_to_genus_m90.csv
    • 将宿主预测结果聚合到 属水平(genus level) 的表格。
    • 与上一个文件类似,但结果做了分类学归并,更适合生态学层面的宿主-病毒互作分析。
  • virus_assembly_genome_clean.fna
    • 输入的病毒基因组(或 contigs)经过 iPHoP 内部质控(QC)后的 clean 版 FASTA 文件。
    • 已去除 >10% Ns 或不合法字符的序列。
  • Wdir/
    • 工作目录(working directory)。
    • 存放中间运行文件,例如临时比对结果、特征计算数据等。
    • 通常在后续分析中用不到,但对调试很有价值。

3.主要结果文件

小编这里用的是真实的项目数据,不方便展示,详见:https://bitbucket.org/srouxjgi/iphop/src/main/#Downloading-iPHoP-host-database网站的Main output files模块。

参考文献
  • Roux S, Camargo AP, Coutinho FH et el. iPHoP: An integrated machine learning framework to maximize host prediction for metagenome-derived viruses of archaea and bacteria. PLoS Biol. 2023 Apr 21;21(4):e3002083. doi: 10.1371/journal.pbio.3002083. PMID: 37083735.
  • Coutinho FH, Zaragoza-Solas A, López-Pérez M, et al. RaFAH: Host prediction for viruses of Bacteria and Archaea based on protein content. Patterns (N Y). 2021 Jun 15;2(7):100274. doi: 10.1016/j.patter.2021.100274. PMID: 34286299.
  • Galiez C, Siebert M, Enault F, et al. WIsH: who is the host? Predicting prokaryotic hosts from metagenomic phage contigs. Bioinformatics. 2017 Oct 1;33(19):3113–3114. doi: 10.1093/bioinformatics/btx383. PMID: 28957499.
  • Ahlgren NA, Ren J, Lu YY, et al. Alignment-free d2* oligonucleotide frequency dissimilarity measure improves prediction of hosts from metagenomically-derived viral sequences. Nucleic Acids Res. 2017 Jan 9;45(1):39–53. doi: 10.1093/nar/gkw1002. PMID: 27899557.
  • Lu C, Zhang Z, Cai Z, et al. Prokaryotic virus host predictor: a Gaussian model for host prediction of prokaryotic viruses in metagenomics. BMC Biol. 2021 Jan 14;19(1):5. doi: 10.1186/s12915-020-00938-6. PMID: 33441133.

关于小编

小编就职于中国热带农业科学院,环境与植物保护研究所农业农村部热带地区低碳绿色农业重点实验室。目前实验室主要以研究方向是使用宏基因组学、宏病毒组等多组学研究微生物对土壤,大气等介质中元素循环的作用,环境中微生物功能基因的挖掘。有兴趣的老师欢迎扫描下方的二维码,添加小编的微信号和小编交流。

本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2025-08-22,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 微因 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • Jun_25_pub_rw:当前最新的数据库
  • 主要功能解读
  • 主要功能解读
  • 3.主要结果文件
  • 小编这里用的是真实的项目数据,不方便展示,详见:https://bitbucket.org/srouxjgi/iphop/src/main/#Downloading-iPHoP-host-database网站的Main output files模块。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档