跳转到主要内容

基于迁移学习的精确且全面的源追踪专家模型

项目描述

EXPERT

基于迁移学习的精确且全面的源追踪专家模型

微生物群落反映的栖息地特异性模式,以及群落与其环境或宿主特征之间的复杂相互作用,为微生物源追踪带来了障碍:多样化的和情境相关的应用要求量化不同生态位(生物群)的贡献,这已经使现有方法不堪重负。此外,现有的源追踪方法无法很好地扩展到来自未充分研究的生物群以及纵向研究样本的源追踪。

基于生物群落本体信息和迁移学习技术构建的EXPERT具有情境感知的灵活性,可以轻松扩展监督模型的搜索范围,包括情境相关的群落样本和未充分研究的生物群。同时,它在源追踪的准确性和速度上优于当前方法。EXPERT的优越性已经在多个源追踪任务中得到证明,包括收集于不同疾病阶段和纵向样本的源追踪样本。例如,当处理来自近期结直肠癌研究的635个样本时,EXPERT在预测宿主的表型状态时实现了AUROC 0.977。总之,EXPERT释放了基于模型的源追踪方法的潜力,使源追踪在多样化的情境相关设置中成为可能,并从微生物组中实现了广泛和深入的知识发现。

如果您在科学出版物中使用EXPERT,我们欢迎引用以下论文

Enabling technology for microbial source tracking based on transfer learning: From ontology-aware general knowledge to context-aware expert systems
Hui Chong, Qingyang Yu, Yuguo Zha, Guangzhou Xiong, Nan Wang, Chuqing Sun, Sicheng Wu, Weihua Chen, Kang Ning
bioRxiv 2021.01.29.428751; doi: https://doi.org/10.1101/2021.01.29.428751

如果您对我们的工作有任何疑问,请随时联系我们

感谢您使用EXPERT。

当前功能

  • 通过迁移学习实现情境感知的能力,以适应微生物组研究
  • 通过本体感知前向传播实现快速、准确和可解释的源追踪
  • 从训练数据中选择性学习
  • 通过内存中的NCBI分类数据库进行超快速数据清理和清洗
  • 通过tensorflow.keras并行化特征编码

安装

python setup.py install

使用方法

本体构建

使用microbiomes.txt构建生物群落本体

expert construct -i microbiomes.txt -o ontology.pkl
# Also equivalent to
expert construct --input microbiomes.txt --output ontology.pkl
  • 输入:microbiomes.txt文件,包含从“root”节点到生物群落本体中每个叶子节点的路径。
root:Environmental:Terrestrial:Soil
root:Environmental:Terrestrial:Soil:Agricultural
root:Environmental:Terrestrial:Soil:Boreal_forest
root:Environmental:Terrestrial:Soil:Contaminated
root:Environmental:Terrestrial:Soil:Crop
root:Environmental:Terrestrial:Soil:Crop:Agricultural_land
root:Environmental:Terrestrial:Soil:Desert
root:Environmental:Terrestrial:Soil:Forest_soil
root:Environmental:Terrestrial:Soil:Grasslands
root:Environmental:Terrestrial:Soil:Loam:Agricultural
root:Environmental:Terrestrial:Soil:Permafrost
root:Environmental:Terrestrial:Soil:Sand
root:Environmental:Terrestrial:Soil:Tropical_rainforest
root:Environmental:Terrestrial:Soil:Uranium_contaminated
root:Environmental:Terrestrial:Soil:Wetlands
root:Host-associated:Plants:Rhizosphere:Soil
  • 输出:构建的生物群落本体(pickle格式,不可读)。

源映射

将它们的源环境映射到生物群落本体

expert map --to-otlg -t ontology.pkl -i mapper.csv -o labels.h5
# Also equivalent to
expert map --to-otlg --otlg ontology.pkl --input mapper.csv --output labels.h5
  • 输入:映射文件,包含样本的生物群落源信息。
EnvSampleID
0root:Engineered:WastewaterERR2260442
1root:Engineered:WastewaterSRR980322
2root:Engineered:WastewaterERR2985272
3root:Engineered:WastewaterERR2814648
4root:Engineered:WastewaterERR2985275
  • 输出:生物群落本体各层中样本的标签(HDF格式,不可读)。

数据转换与清理

将输入数据转换为水平的计数矩阵。

expert convert -i countMatrices.txt -o countMatrix.h5 --in-cm
# Also equivalent to
expert convert --input countMatrices.txt --output countMatrix.h5 --in-cm 
  • 输入:包含输入计数矩阵文件/OTU表的路径的文本文件。
datasets/soil_dataset/root:Host-associated:Plants:Rhizosphere:Soil/MGYS00005146-ERR1690680.tsv
datasets/soil_dataset/root:Host-associated:Plants:Rhizosphere:Soil/MGYS00005146-ERR1689675.tsv
datasets/soil_dataset/root:Host-associated:Plants:Rhizosphere:Soil/MGYS00000513-ERR986792.tsv
datasets/soil_dataset/root:Host-associated:Plants:Rhizosphere:Soil/MGYS00005146-ERR1691198.tsv
datasets/soil_dataset/root:Host-associated:Plants:Rhizosphere:Soil/MGYS00001704-ERR1905845.tsv
datasets/soil_dataset/root:Host-associated:Plants:Rhizosphere:Soil/MGYS00005146-ERR1689214.tsv
datasets/soil_dataset/root:Host-associated:Plants:Rhizosphere:Soil/MGYS00005146-ERR1689910.tsv
  • 输出:转换后的属水平计数矩阵文件(HDF格式,不可读)。

从头训练

从头构建EXPERT模型并进行训练

expert train -i countMatrix.h5 -l labels.h5 -t ontology.pkl -o model
# Also equivalent to
expert train --input countMatrix.h5 --labels labels.h5 --otlg ontology.pkl --output model
  • 输入:生物群落本体和转换后的属水平计数矩阵(以及涉及计数矩阵的样本标签)。
  • 输出:训练后的模型。

快速适应

expert transfer -i countMatrix.h5 -l labels.h5 -t ontology.pkl -o model
# Also equivalent to
expert transfer --input countMatrix.h5 --labels labels.h5 --otlg ontology.pkl --output model
  • 输入:生物群落本体和转换后的属水平计数矩阵(以及涉及计数矩阵的样本标签)。
  • 输出:训练后的模型。

源追踪

expert search -i countMatrix.h5 -o searchResult -m model
# Also equivalent to
expert search --input countMatrix.h5 --output searchResult --model model
  • 输入:属水平转换后的计数矩阵。
  • 输出:搜索结果(多层级)。
searchResult
├── layer-2.csv
├── layer-3.csv
├── layer-4.csv
├── layer-5.csv
└── layer-6.csv

layer-2.csv为例。

root:Engineered root:Environmental root:Host-associated root:Mixed Unknown
ERR2278752 0.0041427016 0.26372418 0.68632126 0.00040003657 0.045411825
ERR2278753 0.002841179 0.07928896 0.91735524 0.00051463145 0.0
ERR2666855 0.0006751048 0.0021803565 0.9970531 9.1493675e-05 0.0
ERR2666860 0.0005227786 0.013902989 0.98542625 0.00014803928 0.0
ERR2666881 0.0009569057 0.0023957777 0.9965403 0.00010694566 0.0

评估

expert evaluate -i searchResultFolder -l labels.h5 -o EvaluationReport -p NUMProcesses
# Also equivalent to
expert evaluate --input searchResultFolder --labels labels.h5 --output EvaluationReport --processors NUMProcesses
  • 输入:样本的多层标签和搜索结果(源贡献)。
  • 输出:基于标签的评估报告。
EvaluationReport
├── layer-2
│   └── root:Host-associated.csv
├── layer-2.csv
├── layer-3
│   └── root:Host-associated:Human.csv
├── layer-3.csv
├── layer-4
│   ├── root:Host-associated:Human:Circulatory_system.csv 
│   ├── root:Host-associated:Human:Digestive_system.csv
│   ├── root:Host-associated:Human:Lympathic_system.csv
│   ├── root:Host-associated:Human:Reproductive_system.csv
│   ├── root:Host-associated:Human:Respiratory_system.csv
│   └── root:Host-associated:Human:Skin.csv
├── layer-4.csv
├── layer-5
│   ├── root:Host-associated:Human:Circulatory_system:Blood.csv
│   ├── ...
│   └── root:Host-associated:Human:Respiratory_system:Pulmonary_system.csv
├── layer-5.csv
├── layer-6
│   ├── root:Host-associated:Human:Digestive_system:Large_intestine:Fecal.csv
│   ├── ...
│   └── root:Host-associated:Human:Respiratory_system:Pulmonary_system:Sputum.csv
└── layer-6.csv

layer-4/root:Host-associated:Human:Skin.csv为例。

t 真阴性 假阳性 假阴性 真阳性 准确率 灵敏度 特异度 真正率 假正率 召回率 精确率 F1分数 ROC-AUC F-max
0.0 0 47688 0 4847 0.0923 1.0 0.0 1.0 1.0 1.0 0.0923 0.1689 0.9951 0.9374
0.01 44794 2893 30 4816 0.9444 0.9938 0.9393 0.9938 0.0607 0.9938 0.6247 0.7672 0.9951 0.9374
0.02 45545 2142 44 4802 0.9584 0.9909 0.9551 0.9909 0.0449 0.9909 0.6915 0.8146 0.9951 0.9374
0.03 45934 1753 59 4787 0.9655 0.9878 0.9632 0.9878 0.0368 0.9878 0.732 0.8409 0.9951 0.9374
0.04 46228 1459 73 4773 0.9708 0.9849 0.9694 0.9849 0.0306 0.9849 0.7659 0.8617 0.9951 0.9374

使用-h选项运行程序,查看工作模式及选项的详细描述。

输入丰度数据

EXPERT接受两种类型的**丰度数据**作为输入。

单个样本的物种分配结果(OTU表)

注意,第一行有一个“# Constructed from biom file”的标题。

# Constructed from biom file
# OTU IDERR1754760taxonomy
20711919.0sk__Archaea
11809045.0sk__Archaea;k__;p__Thaumarchaeota;c__;o__Nitrosopumilales;f__Nitro...
15315638.0sk__Archaea;k__;p__Thaumarchaeota;c__;o__Nitrosopumilales;f__Nitro...
1317041.0sk__Archaea;k__;p__Thaumarchaeota;c__Nitrososphaeria;o__Nitrososp...
1031815174.0sk__Bacteria
1573619.0sk__Bacteria;k__;p__;c__;o__;f__;g__;s__agricultural_soil_bacterium_SC-I-11

多个样本的物种分配结果(计数矩阵)

#SampleIDERR1844510ERR1844449ERR1844450ERR1844451
sk__Archaea1.017.08.016.0
sk__Archaea;k__;p__Crenarchaeota0000
sk__Archaea;k__;p__Euryarchaeota8.02.03.01.0
sk__Archaea;k__;p__Eury...;c__...0000
sk__Archaea;k__;p__Eury...;c__...;o__...0000

许可协议

维护者

姓名 电子邮件 机构
Chong Hui huichong.me@gmail.com 华中科技大学生命科学与技术学院研究助理
Ning Kang ningkang@hust.edu.cn 华中科技大学生命科学与技术学院教授

项目详情


下载文件

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

源分布

expert-mst-0.3.tar.gz (74.2 MB 查看哈希值)

上传时间 源代码

构建分布版

expert_mst-0.3-py3-none-any.whl (74.2 MB 查看哈希值)

上传时间 Python 3

由以下支持