基于conda环境使用mamba/conda安装配置QIIME 2 2023.9 Amplicon扩增子分析环境,q2cli主要功能模块介绍及使用

QIIME 2 2023.9 Amplicon Distribution介绍:

概述

qiime团队专门针对高通量扩增子序列分析退出的conda集成环境,包括了主要和常见的扩增子分析模块,用户可以单独使用各个模块,也可以使用各模块组成不同的分析流程。从2023.09版本开始特意将扩增子和宏基因组shotgun分成了两个环境,可能一个环境集成太大了。这样安装应该更轻盈。

QIIME 2 2023.9 Amplicon Distribution

看看文章吧,超强的团队:Reproducible, interactive, scalable and extensible microbiome data science using QIIME 2 | Nature Biotechnology

2023.9Amplicon分发版qiime2主要功能模块介绍: 

The 2023.9 release of the QIIME 2 Amplicon Distribution includes the QIIME 2 framework, q2cli (a QIIME 2 command-line interface) and the following plugins:

  • q2-alignment

  • q2-composition

  • q2-cutadapt

  • q2-dada2

  • q2-deblur

  • q2-demux

  • q2-diversity

  • q2-diversity-lib

  • q2-emperor

  • q2-feature-classifier

  • q2-feature-table

  • q2-fragment-insertion

  • q2-longitudinal

  • q2-metadata

  • q2-phylogeny

  • q2-quality-control

  • q2-quality-filter

  • q2-sample-classifier

  • q2-taxa

  • q2-types

  • q2-vsearch

还有更多的模块,都可以单独安装,一般建议成套安装就行:

QIIME 2 Library

 

QIIME2的安装:

还是继续用conda吧,这个用起来也挺方便,docker稍微增加了点门槛,看个人喜好

 官方安装介绍链接:

先看介绍选择分发板,根据自己喜好安装:Installing QIIME 2 — QIIME 2 2023.9.2 documentation

这里选择amplicon扩增子分析的环境:

查看安装指引:

Natively installing QIIME 2 — QIIME 2 2023.9.2 documentation

 选择amplicon分发版的linux环境配置指导:

下载环境依赖文件并安装: 

# 下载环境依赖配置文件
wget https://data.qiime2.org/distro/amplicon/qiime2-amplicon-2023.9-py38-linux-conda.yml


# 使用mamba或conda 安装 ,-n后的名字自己定义就行
mamba env create -n qiime2-amplicon-2023.9 --file qiime2-amplicon-2023.9-py38-linux-conda.yml

要升级qiime2?,建议按日期名称命名各个版本重新安装,不需要的就直接删除旧的环境,因为有些旧的环境下的模块大家可能还需要用到,而在新的环境下可能已经废弃或更新了,所以建议重新配置安装新的conda环境就行。

开始使用qiime2 amplicon分发版 

要看怎么使用,或纠错,这里应该是最全的了,User Support - QIIME 2 Forum

这里来自刘永鑫团队的扩增子分析流程大家可以参考,把其中对应的步骤改为使用qiime模块分析即可:

使用vsearch进行16s扩增子高通量序列分析步骤-CSDN博客

EasyAmplicon (易扩增子)-扩增子高通量序列分析软件流程及脚本-详细使用方法——来自刘永鑫团队的秘籍-CSDN博客

当然qiime2 不仅仅提供分析模块,还开发了很多workflow,一个命令就可以按照workflow来得到结果了;可视化也有流程,后面大家看着参考:

 Overview of QIIME 2 Plugin Workflows — QIIME 2 2023.9.2 documentation

先激活环境并查看环境信息

# 激活环境,conda或mamba
mamba activate qiime2-amplicon-2023.9

# 查看帮助信息
qiime --help

开始qiime2分析

分析前建议大家先建立独立的工作目录,并进入工作目录再开始操作:

1、导入数据:

查看帮助:

qiime tools import --help

Usage: qiime tools import [OPTIONS]

  Import data to create a new QIIME 2 Artifact. See https://docs.qiime2.org/
  for usage examples and details on the file types and associated semantic
  types that can be imported.

Options:
  --type TEXT             The semantic type of the artifact that will be
                          created upon importing. Use --show-importable-types
                          to see what importable semantic types are available
                          in the current deployment.                [required]
  --input-path PATH       Path to file or directory that should be imported.
                                                                    [required]
  --output-path ARTIFACT  Path where output artifact should be written.
                                                                    [required]
  --input-format TEXT     The format of the data to be imported. If not
                          provided, data must be in the format expected by the
                          semantic type provided via --type.
  --show-importable-types Show the semantic types that can be supplied to
                          --type to import data into an artifact.
  --show-importable-formats
                          Show formats that can be supplied to --input-format
                          to import data into an artifact.
  --help                  Show this message and exit.

 大家可以先使用样例文件做为参考,然后按样例文件整理自己的数据

双端序列导入(混合样品测序,序列文件带barcode,分析时需要导入样品的metadata)Multiplexed paired-end FASTQ with barcodes in sequence

这种应该符合大家现在常规混合样品测序的情况了。

 metadata格式,重要的是第一列和第二列,或者再加一列barcode2 

 序列文件导入(三个文件,forward.fastq.gz, reverse.fastq.gz, sample_metadata.tsv):

qiime tools import \
  --type MultiplexedPairedEndBarcodeInSequence \
  --input-path muxed-pe-barcode-in-seq \
  --output-path multiplexed-seqs.qza

单端序列导入(序列文件与barcode文件各自独立)

复制官方代码时注意删除上面的引号,这个复制过来容易变成中文的双引号,另外还需要注意存储路径的设置 :

获取样例文件 

# 进入工作目录
cd emp-single-end-sequences/

# barcode文件
wget \
  -O barcodes.fastq.gz \
  https://data.qiime2.org/2023.9/tutorials/moving-pictures/emp-single-end-sequences/barcodes.fastq.gz

# 序列文件,这里是单端序列
wget \
  -O sequences.fastq.gz \
  https://data.qiime2.org/2023.9/tutorials/moving-pictures/emp-single-end-sequences/sequences.fastq.gz

查看要导入的文件格式:

# 
zcat barcodes.fastq.gz | head -n 10
# barcode文件内容,
@HWI-EAS440_0386:1:23:17547:1423#0/1
ATGCAGCTCAGT
+
IIIIIIIIIIIH
@HWI-EAS440_0386:1:23:14818:1533#0/1
CCCCTCAGCGGC
+
DDD@D?@B<<+/
@HWI-EAS440_0386:1:23:14401:1629#0/1
GACGAGTCAGTC

#
zcat sequences.fastq.gz | head -n 10

# sequences文件内容
@HWI-EAS440_0386:1:23:17547:1423#0/1
TACGNAGGATCCGAGCGTTATCCGGATTTATTGGGTTTAAAGGGAGCGTAGATGGATGTTTAAGTCAGTTGTGAAAGTTTGCGGCTCAACCGTAAAATTGCAGTTGATACTGGATATCTTGAGTGCAGTTGAGGCAGGGGGGGATTGGTGTG
+
IIIE)EEEEEEEEGFIIGIIIHIHHGIIIGIIHHHGIIHGHEGDGIFIGEHGIHHGHHGHHGGHEEGHEGGEHEBBHBBEEDCEDDD>B?BE@@B>@@@@@CB@ABA@@?@@=>?08;3=;==8:5;@6?######################
@HWI-EAS440_0386:1:23:14818:1533#0/1
CCCCNCAGCGGCAAAAATTAAAATTTTTACCGCTTCGGCGTTATAGCCTCACACTCAATCTTTTATCACGAAGTCATGATTGAATCGCGAGTGGTCGGCAGATTGCGATAAACGGGCACATTAAATTTAAACTGATGATTCCACTGCAACAA
+
64<2$24;1)/:*B<?BBDDBBD<>BDD############################################################################################################################
@HWI-EAS440_0386:1:23:14401:1629#0/1
TACGNAGGATCCGAGCGTTATCCGGATTTATTGGGTTTAAAGGGAGCGTAGGCGGACGCTTAAGTCAGTTGTGAAAGTTTGCGGCTCAACCGTAAAATTGCAGTTGATACTGGGTGTCTTGAGTACAGTAGAGGCAGGGGGGGGGTTGGGGG

## 激活 qiime2环境:

## 导入数据
qiime tools import \
  --type EMPSingleEndSequences \
  --input-path ./ \
  --output-path emp-single-end-sequences.qza

#### qiime tools import --show-importable-types  这个命令已经废弃了,大家注意在新版里没法用

qiime tools list-types
Usage: qiime tools list-types [OPTIONS] [QUERIES]...

  List the available semantic types.

Options:
  --strict    Show only exact matches for the type argument(s).
  --tsv       Print as machine readable tab-separated values.
  --help      Show this message and exit.

双端序列导入(序列文件与barcode文件各自独立)

获取样例文件  

cd emp-paired-end-sequences
# 下载正向序列
wget \
  -O forward.fastq.gz \
  https://data.qiime2.org/2023.9/tutorials/atacama-soils/1p/forward.fastq.gz

#下载反向序列
wget \
  -O reverse.fastq.gz \
  https://data.qiime2.org/2023.9/tutorials/atacama-soils/1p/reverse.fastq.gz

# 下载barcodes文件
wget \
  -O barcodes.fastq.gz \
  https://data.qiime2.org/2023.9/tutorials/atacama-soils/1p/barcodes.fastq.gz
# 查看输入文件格式
# 正向序列文件内容
zcat forward.fastq.gz | head -n 10
@M00176:65:000000000-A41FR:1:1101:14282:1412 1:N:0:0
NACGTAGGGTGCAAGCGTTAATCGGAATTACNGGNNNTAAAGCGTGCNNAGGCNNNNNNNNNNNANNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
+
#>>>AAF@ACAA4BGCEEECGGHGGEFCFBG#BA###BABAEFGEEE##BBAA###########B######################################################################################
@M00176:65:000000000-A41FR:1:1101:16939:1420 1:N:0:0
NACGTAGGGGGCAAGCGTTGTCCGGAATCATTGGNNGTAAAGAGCGTGNAGGCNNNNNGNNANNTNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
+
#>>ABAF@ABBBGGGGEEFGGGHGGFFGFHHHHH##BBEFDHHCGGFG#ABFF#####B##B##B######################################################################################
@M00176:65:000000000-A41FR:1:1101:14746:1560 1:N:0:0
TACGTAGGGAGCTAGCGTTGTCCGGAATCATTGGGCGTAAAGCGCGCGTAGGCGGCCAGATAAGTCCGGTGTAAAAGCCACAGGCTNNNNNNNNNNNNNNNNCNGGANNNNNNNNNNNNNNNNNNNNNNANNNNNNNNNNNNANNNNNGGN

# 反向序列文件内容
zcat reverse.fastq.gz | head -n 10
@M00176:65:000000000-A41FR:1:1101:14282:1412 2:N:0:0
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNCGGAATNCCATNCCNCTCTGCNNNNNNNNNNNNNNNNNNNNNNNNN
+
#########################################################################################################<</?F/#/</?#?<#<???/<#########################
@M00176:65:000000000-A41FR:1:1101:16939:1420 2:N:0:0
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNCNCNNTNCNNNNNNNNNNNGGGAATTCCACNCGCCTCTTCNNNNNNNNNNNNNNNNNNNNNNNNN
+
######################################################################################?#?##?#?###########<??/?FC>FBF#</??FAGHG#########################
@M00176:65:000000000-A41FR:1:1101:14746:1560 2:N:0:0
NNNNTTTCGTNGATNNNNNNNCNGNNNNNNNNNNNNNNNNNNNTNNNNNNNTACCNNNNNNNNTGGGCCTCTGTGCGCATACCGTTCGAGAGCGCCGGCCACGGCATTCGTGTTGCTCCTCTAAGCTGTGCGTGTTCACTGTACAACCNNN

# barcode文件内容
zcat barcodes.fastq.gz | head -n 10
@M00176:65:000000000-A41FR:1:1101:14282:1412 1:N:0:0
NNNNNNNNNNNN
+
############
@M00176:65:000000000-A41FR:1:1101:16939:1420 1:N:0:0
NNNNNNNNNNNN
+
############
@M00176:65:000000000-A41FR:1:1101:14746:1560 1:N:0:0
NNNNNNNNNNNN

数据导入:

cd emp-paired-end-sequences

qiime tools import \
  --type EMPPairedEndSequences \
  --input-path ./ \
  --output-path emp-paired-end-sequences.qza

带barcodes的单端序列文件导入

获取样例文件 

#
cd muxed-se-barcode-in-seq/
wget \
  -O sequences.fastq.gz \
  https://data.qiime2.org/2023.9/tutorials/importing/muxed-se-barcode-in-seq.fastq.gz
# 查看输入文件格式:
zcat sequences.fastq.gz | head -n 20
@M00899:113:000000000-A5K20:1:1101:18850:2539 1:N:0:2
GCTACGGGGGGCAGCAGTGGGGAATATTGCACAATGGGCGAAAGCCTGATGCAGCAACGCCGCGTGAACGATGAAGGTCTTCGGATCGTAAAGTTCTGTTGCAGGGGAAGATAATGACGGTACCCTGTGAGGAAGCCCCGGCTAACTACGTGCCAGCAGCCGCGGTAATACGTAGGGGGCTAGCGTTATCCGGATTTACTGGGCGTAAAGGGTGCGTAGGTGGTCCTTCAAGTCGGTGGTTAAAGGCTAAGGCTCAACCGTAGTAAGCCGCCGAAACTGGAGGACTTGAGTGAAGGAGAGG
+
-8ABCC>=>5811884:<:99=?@EECFFGDFADECFFFEEDDEFEDEDFFFEEFCCBCF>CCB3CFF:BBFFFCCD,8@9C@C:+5@@:A@C<FDCFBEG>FFFDGCCEC?FGGGGGGGGGCFGGFCFGGGGGGGGGGEG7CFFGFFFGGGFG?FACE;:8CCCCEEF9<F@FFEGGC**/:3:2CC@:C;C81;C9<?>FF8C758CGGG2:7DC>EECEFE9+27CF492/8B7>D)7@F=FFCFF*9F52<2,289<0:44AB<49(3<>F51).69D?D34*44:4<5<B?::086
@M00899:113:000000000-A5K20:1:1101:25454:3578 1:N:0:2
CCTACGGGAGGCAGCAGTGAGGAATATTGGTCAATGGGCGAGAGCCTGAACCAGCCAAGTAGCGTGCAGGATGACGGCCCTATGGGTTGTAAACTGCTTTTGTATGGGGATAAAGTCAGTCACGTGTGATTGTTTGCAGGTACCATACGAATAAGGACCGGCTAATTCCGTGCCAGCAGCCGCGGTAATACGGAAGGTCCGGGCGTTATCCGGATTTATTGGGTTTAAAGGGAGCGTAGGCTGGAGATTAAGTGTGTTGTGAAATGTAGACGCTCAACGTCTGACTTGCAGCGCATACTGG
+
8ACCCGD@AA=18=======;CEFGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGFGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGEGGGGGGFFF?FGGGGGGGGEGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGCGFGGGFFFGGGGGGEFGGGGGGGGGGGGCGEGGDGGGGGGGGGG=CGGCECDGGFGGGGGGGGFGGGF>C>BFFEGFFFFF:FGGF=6=6:AFBGFFFFFFA9A<AFB?@0)>C:0<CF?C46FAD<??90;::?DA>
@M00899:113:000000000-A5K20:1:1101:25177:3605 1:N:0:2
CCTACGGGAGGCAGCAGTGAGGAATATTGGTCAATGGACGGAAGTCTGAACCAGCCAAGTAGCGTGCAGGATGACGGCCCTATGGGTTGTAAACTGCTTTTGTATGGGGATAAAGTTAGGGACGTGTCCCTATTTGCAGGTACCATACGAATAAGGACCGGCTAATTCCGTGCCAGCAGCCGCGGTAATACGGAAGGTCCAGGCGTTATCCGGATTTATTGGGTTTAAAGGGAGCGTAGGCTGGAGATTAAGTGTGTTGTGAAATGTAGACGCTCAACGTCTGAATTGCAGCGCATACTGG
+
88BCCEDAD9018======;;CCFGGGGFGGGFGGGGGGGGGGGGGGGGGGGGGGGFGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGFGGGGGGGGGGGGGFGGGGGGGGGGGGGGGGEGDGGGGGGGGGFFGGGGGGGGGFGGGFGGGFGGGFFGCGGGGGGFGGFDGGGGGGGGGGGGG5CBFGCGGGGC?FGGGGGGGGGGGDEGDDDGFGGGGGEGGGGGGA39>BFFDDEF4:D5@CE?CFFF>>ABGFFF9<A246<<<<B::DE=<?FGGFG4>F?DF?02211:DAF7

### barcode已经在序列中

导入文件:

qiime tools import \
  --type MultiplexedSingleEndBarcodeInSequence \
  --input-path sequences.fastq.gz \
  --output-path multiplexed-seqs.qza

当然还有其他可导入文件格式,慢慢看吧,个人觉得有需要的时候查一下就行,不用全部了解:

qiime tools list-formats --importable

2、导出数据

官方示例,大家可以下载下来测试一下就行了,不再细讲了。

 下载测试:

wget \
  -O "feature-table.qza" \
  "https://data.qiime2.org/2023.9/tutorials/exporting/feature-table.qza"

wget \
  -O "unrooted-tree.qza" \
  "https://data.qiime2.org/2023.9/tutorials/exporting/unrooted-tree.qza"

qiime tools export \
  --input-path feature-table.qza \
  --output-path exported-feature-table

## 导出为biom格式文件
## 参考:https://biom-format.org/documentation/format_versions/biom-2.1.html


qiime tools export \
  --input-path unrooted-tree.qza \
  --output-path exported-tree

## 导出为.nwk文件,可在各类软件再直接出发育树的图
head tree.nwk 
(((New.CleanUp.ReferenceOTU1480:0.11995,(New.CleanUp.ReferenceOTU202:0.04479,New.CleanUp.ReferenceOTU432:0.0049)0.769:0.04661)1:0.26705,((New.CleanUp.ReferenceOTU1150:0.00016,(New.CleanUp.ReferenceOTU782:0.04264,(New.CleanUp.ReferenceOTU643:0.10438,(((New.CleanUp.ReferenceOTU1014:0.01521,New.CleanUp.ReferenceOTU270:0.02738)0.879:0.02315,(((New.CleanUp.ReferenceOTU1008:0.0378,(New.CleanUp.ReferenceOTU1222:0.01621,(New.CleanUp.ReferenceOTU230:0.01829,(New.CleanUp.ReferenceOTU1047:0.0303,New.CleanUp.ReferenceOTU605:0.00015)0.88:0.01596)0.871:0.01515)0.714:0.01214)0.996:0.06757,(New.CleanUp.ReferenceOTU681:0.00441,(New.CleanUp.ReferenceOTU1485:0.01177,New.CleanUp.ReferenceOTU130:0.05699)0.923:0.02883)0.367:0.02397)0.17:0.00665,(New.CleanUp.ReferenceOTU1330:0.0258,(New.CleanUp.ReferenceOTU903:0.04234,(((New.CleanUp.ReferenceOTU1077:0.00014,(New.CleanUp.ReferenceOTU582:0.0171,New.CleanUp.ReferenceOTU987:0.0226)0.951:0.02372)0.892:0.02206,(New.CleanUp.ReferenceOTU891:0.01038,(((New.CleanUp.ReferenceOTU1066:0.01299,New.CleanUp.ReferenceOTU764:0.02254)0.851:0.01818,(New.CleanUp.ReferenceOTU180:0.02021,New.CleanUp.ReferenceOTU535:0.00014)0.795:0.01084)0.921:0.02441,(New.CleanUp.ReferenceOTU1212:0.00521


mkdir extracted-feature-table
qiime tools extract \
  --input-path feature-table.qza \
  --output-path extracted-feature-table

## 

3、样品元数据处理

这个可能得科学上网,给大家下载了,大家参考下载吧。

https://download.csdn.net/download/zrc_xiaoguo/88616825?spm=1001.2014.3001.5503

样例文件列表:

sample-metadata数据:

元数据表qiime2转换命令:

qiime metadata tabulate \
  --m-input-file sample-metadata.tsv \
  --o-visualization tabulated-sample-metadata.qzv

qiime metadata tabulate \
  --m-input-file faith_pd_vector.qza \
  --o-visualization tabulated-faith-pd-metadata.qzv

qiime metadata tabulate \
  --m-input-file sample-metadata.tsv \
  --m-input-file faith_pd_vector.qza \
  --o-visualization tabulated-combined-metadata.qzv

qiime emperor plot \
  --i-pcoa unweighted_unifrac_pcoa_results.qza \
  --m-metadata-file sample-metadata.tsv \
  --m-metadata-file faith_pd_vector.qza \
  --o-visualization unweighted-unifrac-emperor-with-alpha.qzv

转换后数据qzv查看

4、数据过滤

Filtering data — QIIME 2 2023.9.2 documentation

特征表过滤Filtering feature tables

基于总出现频率过滤,去掉低丰度序列,或筛选一定丰度的序列,比如说将频率低于1500的序列去掉,包括两个参数,最高和最低频率

The --p-min-frequency and --p-max-frequency can be combined to filter based on lower and upper limits of total frequency

这里只给了一个最低频率的限制。

qiime feature-table filter-samples \
  --i-table table.qza \
  --p-min-frequency 1500 \
  --o-filtered-table sample-frequency-filtered-table.qza

基于出现的偶然性的过滤???Contingency-based filtering,也就是最少在多少个样品中都需要出现,通量有最高和最低频率设定: --p-min-features and --p-min-samples。

qiime feature-table filter-features \
  --i-table table.qza \
  --p-min-samples 2 \
  --o-filtered-table sample-contingency-filtered-table.qza

 字段筛选Identifier-based filtering, 也就是保留哪些特征数据内容。

qiime feature-table filter-samples \
  --i-table table.qza \
  --m-metadata-file samples-to-keep.tsv \
  --o-filtered-table id-filtered-table.qza

同样还有很多其他的筛选方式:

Metadata-based filtering

Taxonomy-based filtering of tables and sequences

序列过滤Filtering sequences

比如说这里根据原序列文件和分类文件提取mitochondria,chloroplast这两个门水平的序列文件。

qiime taxa filter-seqs \
  --i-sequences sequences.qza \
  --i-taxonomy taxonomy.qza \
  --p-include p__ \
  --p-exclude mitochondria,chloroplast \
  --o-filtered-sequences sequences-with-phyla-no-mitochondria-no-chloroplast.qza

Filtering distance matrices

qiime diversity filter-distance-matrix \
  --i-distance-matrix distance-matrix.qza \
  --m-metadata-file samples-to-keep.tsv \
  --o-filtered-distance-matrix identifier-filtered-distance-matrix.qza


qiime diversity filter-distance-matrix \
  --i-distance-matrix distance-matrix.qza \
  --m-metadata-file sample-metadata.tsv \
  --p-where "[subject]='subject-2'" \
  --o-filtered-distance-matrix subject-2-filtered-distance-matrix.qza

5、重要参考数据库

这个不多说了吧,大家按使用需求来下载,后面逐步会用到:

Data resources — QIIME 2 2023.9.2 documentation

 6、各个插件模块使用

不熟悉的先查看help信息和官网介绍:

  • q2-alignment

q2-alignment 是 QIIME 2 生态系统中的一个插件,用于对生物信息学序列数据进行比对和序列比较的工具。它可以用于将不同样本中的序列进行比对,分析它们之间的相似性和差异性。q2-alignment 提供了一些常用的比对算法和工具,使用户能够对序列进行比对、生成比对结果和后续的分析。

以下是 q2-alignment 插件的一些主要功能和使用方法:

功能和用途:

  1. 序列比对:对DNA、RNA或蛋白质序列进行比对。
  2. 多序列比对:能够处理多个序列文件,比对它们之间的相似性。
  3. 生成比对结果:产生比对结果,以便后续分析或可视化。
  4. 支持多种比对算法:包括常用的比对算法,如BLAST、MUSCLE、MAFFT 等。
qiime alignment --help
Usage: qiime alignment [OPTIONS] COMMAND [ARGS]...

  Description: This QIIME 2 plugin provides support for generating and
  manipulating sequence alignments.

  Plugin website: https://github.com/qiime2/q2-alignment

  Getting user support: Please post to the QIIME 2 forum for help with this
  plugin: https://forum.qiime2.org

Options:
  --version            Show the version and exit.
  --example-data PATH  Write example data and exit.
  --citations          Show citations and exit.
  --help               Show this message and exit.

Commands:
  mafft      De novo multiple sequence alignment with MAFFT
  mafft-add  Add sequences to multiple sequence alignment with MAFFT.
  mask       Positional conservation and gap filtering.
# 运行比对(示例使用 MAFFT)
qiime alignment mafft \
  --i-sequences sequences.qza \
  --o-alignment aligned_sequences.qza
  • q2-composition

用于进行组成分析,尤其是在处理微生物组数据中的相对丰度数据时非常有用。该插件可以帮助用户探索和比较微生物组中微生物群落的组成。

qiime composition --help
Usage: qiime composition [OPTIONS] COMMAND [ARGS]...

  Description: This QIIME 2 plugin supports methods for compositional data
  analysis.

  Plugin website: https://github.com/qiime2/q2-composition

  Getting user support: Please post to the QIIME 2 forum for help with this
  plugin: https://forum.qiime2.org

Options:
  --version            Show the version and exit.
  --example-data PATH  Write example data and exit.
  --citations          Show citations and exit.
  --help               Show this message and exit.

Commands:
  add-pseudocount  Add pseudocount to table.
  ancom            Apply ANCOM to identify features that differ in abundance.
  ancombc          Analysis of Composition of Microbiomes with Bias Correction
  da-barplot       Differential abundance bar plots
  tabulate         View tabular output from ANCOM-BC.
# 导入数据
qiime composition add-pseudocount \
  --i-table table.qza \
  --o-composition-table composition.qza

#数据转换
qiime composition ilr-transform \
  --i-table composition.qza \
  --o-transformed-table ilr_composition.qza

#可视化分析结果
qiime composition pcoa \
  --i-table ilr_composition.qza \
  --o-pcoa ilr_composition_pcoa.qza

qiime emperor plot \
  --i-pcoa ilr_composition_pcoa.qza \
  --m-metadata-file metadata.txt \
  --o-visualization ilr_composition_emperor.qzv

 q2-cutadapt

q2-cutadapt插件是用于对DNA序列数据进行预处理和过滤的工具。它基于Cutadapt软件,允许用户对Illumina测序数据进行裁剪(trimming)、过滤(filtering)和修剪(adapter removal)等操作,以消除低质量序列、去除适配器、修剪序列末端等。这有助于提高序列数据的质量,为后续的分析准备干净、高质量的数据。

#
qiime cutadapt --help
Usage: qiime cutadapt [OPTIONS] COMMAND [ARGS]...

  Description: This QIIME 2 plugin uses cutadapt to work with adapters (e.g.
  barcodes, primers) in sequence data.

  Plugin website: https://github.com/qiime2/q2-cutadapt

  Getting user support: Please post to the QIIME 2 forum for help with this
  plugin: https://forum.qiime2.org

Options:
  --version            Show the version and exit.
  --example-data PATH  Write example data and exit.
  --citations          Show citations and exit.
  --help               Show this message and exit.

Commands:
  demux-paired  Demultiplex paired-end sequence data with barcodes in-
                sequence.
  demux-single  Demultiplex single-end sequence data with barcodes in-
                sequence.
  trim-paired   Find and remove adapters in demultiplexed paired-end
                sequences.
  trim-single   Find and remove adapters in demultiplexed single-end
                sequences.
qiime cutadapt trim-paired \
  --i-demultiplexed-sequences demux.qza \
  --p-cores 8 \
  --p-front-f CCTACGGGNGGCWGCAG \
  --p-front-r GACTACHVGGGTATCTAATCC \
  --p-discard-untrimmed \
  --o-trimmed-sequences demux_trimmed.qza

参数解释:
--i-demultiplexed-sequences: 输入的序列文件(需提前导入到QIIME 2)。
--p-cores: 并行处理的CPU核心数量。
--p-front-f 和 --p-front-r: 正向和反向引物序列。
--p-discard-untrimmed: 丢弃未被修剪的序列。
--o-trimmed-sequences: 输出修剪后的序列文件。 

  • q2-dada2

q2-dada2是QIIME 2的插件之一,基于DADA2算法,用于去噪和分析Illumina测序生成的16S rRNA数据。

qiime dada2 --help
Usage: qiime dada2 [OPTIONS] COMMAND [ARGS]...

  Description: This QIIME 2 plugin wraps DADA2 and supports sequence quality
  control for single-end and paired-end reads using the DADA2 R library.

  Plugin website: http://benjjneb.github.io/dada2/

  Getting user support: Please post to the QIIME 2 forum for help with this
  plugin: https://forum.qiime2.org

Options:
  --version            Show the version and exit.
  --example-data PATH  Write example data and exit.
  --citations          Show citations and exit.
  --help               Show this message and exit.

Commands:
  denoise-ccs     Denoise and dereplicate single-end Pacbio CCS
  denoise-paired  Denoise and dereplicate paired-end sequences
  denoise-pyro    Denoise and dereplicate single-end pyrosequences
  denoise-single  Denoise and dereplicate single-end sequences
qiime dada2 denoise-single \
  --i-demultiplexed-seqs input-demux.qza \
  --p-trim-left 0 \
  --p-trunc-len 120 \
  --o-representative-sequences rep-seqs-dada2.qza \
  --o-table table-dada2.qza \
  --o-denoising-stats stats-dada2.qza

 参数说明:

  • --i-demultiplexed-seqs:输入的demultiplexed序列文件。
  • --p-trim-left:要去除的序列的前部分碱基数量。
  • --p-trunc-len:截断序列的长度。
  • --o-representative-sequences:输出的代表序列文件。
  • --o-table:生成的特征表文件。
  • --o-denoising-stats:生成的去噪统计文件。
  • q2-deblur

q2-deblur插件通过识别和去除16S rRNA基因测序数据中的测序错误和噪声,以生成高质量的序列数据。其主要步骤包括:

  1. 生成特征表(Feature table): 从原始的FASTQ格式文件中导入数据,创建特征表。
  2. 质量过滤: 过滤低质量序列,去除低质量序列读数。
  3. 去噪处理: 使用Deblur算法去除测序错误和噪声,生成高质量的特征序列。
  4. 生成结果: 输出一个经过去噪处理和质量过滤的特征表和序列文件。
qiime deblur --help
Usage: qiime deblur [OPTIONS] COMMAND [ARGS]...

  Description: This QIIME 2 plugin wraps the Deblur software for performing
  sequence quality control.

  Plugin website: https://github.com/biocore/deblur

  Getting user support: Please post to the QIIME 2 forum for help with this
  plugin: https://forum.qiime2.org

Options:
  --version            Show the version and exit.
  --example-data PATH  Write example data and exit.
  --citations          Show citations and exit.
  --help               Show this message and exit.

Commands:
  denoise-16S      Deblur sequences using a 16S positive filter.
  denoise-other    Deblur sequences using a user-specified positive filter.
  visualize-stats  Visualize Deblur stats per sample.
qiime deblur denoise-16S \
  --i-demultiplexed-seqs your_qza_file.qza \
  --p-trim-length 250 \  # 设置序列截断长度
  --o-representative-sequences rep_seqs.qza \
  --o-table table.qza \
  --p-sample-stats \     # 如果需要生成样本统计信息
  --o-stats deblur_stats.qza

 结果数据导出

# 结果数据导出
qiime tools export --input-path rep_seqs.qza --output-path exported_rep_seqs
qiime tools export --input-path table.qza --output-path exported_table
qiime tools export --input-path deblur_stats.qza --output-path exported_stats
  • q2-demux

q2-demux 插件用于处理 DNA 或 RNA 测序数据的样本数据解复用(demultiplexing)和质量控制。这个插件允许用户根据样本的不同 DNA 或 RNA 序列标签(barcode 或者 Illumina 测序的 index)将混合测序数据集拆分成单独的样本。下面是 q2-demux 插件的基本介绍和使用步骤:

q2-demux 插件功能:
  1. 数据解复用(Demultiplexing)

    • 将混合测序数据根据每个样本的唯一标识(barcode 或 index)分割成单独的样本序列文件。
  2. 质量控制

    • 提供了检查序列数据质量的功能,允许用户查看样本数据的质量分数并进行必要的处理,比如修剪或过滤低质量序列。
qiime demux --help
Usage: qiime demux [OPTIONS] COMMAND [ARGS]...

  Description: This QIIME 2 plugin supports demultiplexing of single-end and
  paired-end sequence reads and visualization of sequence quality information.

  Plugin website: https://github.com/qiime2/q2-demux

  Getting user support: Please post to the QIIME 2 forum for help with this
  plugin: https://forum.qiime2.org

Options:
  --version            Show the version and exit.
  --example-data PATH  Write example data and exit.
  --citations          Show citations and exit.
  --help               Show this message and exit.

Commands:
  emp-paired                Demultiplex paired-end sequence data generated
                            with the EMP protocol.
  emp-single                Demultiplex sequence data generated with the EMP
                            protocol.
  filter-samples            Filter samples out of demultiplexed data.
  partition-samples-paired  Split demultiplexed sequence data into partitions.
  partition-samples-single  Split demultiplexed sequence data into partitions.
  subsample-paired          Subsample paired-end sequences without
                            replacement.
  subsample-single          Subsample single-end sequences without
                            replacement.
  summarize                 Summarize counts per sample.
  tabulate-read-counts      Tabulate counts per sample
# 执行去重复
qiime demux emp-paired \
  --i-seqs demux.qza \
  --m-barcodes-file sample-metadata.tsv \
  --m-barcodes-column BarcodeSequence \
  --o-per-sample-sequences demux-paired-end.qza \
  --o-error-correction-details demux-details.qza

## 查看结果
qiime demux summarize \
  --i-data demux-paired-end.qza \
  --o-visualization demux-summary.qzv

  • q2-diversity

q2-diversity是其中一个用于计算和分析生物多样性的插件。它可以帮助你评估样本群落的多样性和差异性。

qiime diversity --help
Usage: qiime diversity [OPTIONS] COMMAND [ARGS]...

  Description: This QIIME 2 plugin supports metrics for calculating and
  exploring community alpha and beta diversity through statistics and
  visualizations in the context of sample metadata.

  Plugin website: https://github.com/qiime2/q2-diversity

  Getting user support: Please post to the QIIME 2 forum for help with this
  plugin: https://forum.qiime2.org

Options:
  --version            Show the version and exit.
  --example-data PATH  Write example data and exit.
  --citations          Show citations and exit.
  --help               Show this message and exit.

Commands:
  adonis                     adonis PERMANOVA test for beta group significance
  alpha                      Alpha diversity
  alpha-correlation          Alpha diversity correlation
  alpha-group-significance   Alpha diversity comparisons
  alpha-phylogenetic         Alpha diversity (phylogenetic)
  alpha-rarefaction          Alpha rarefaction curves
  beta                       Beta diversity
  beta-correlation           Beta diversity correlation
  beta-group-significance    Beta diversity group significance
  beta-phylogenetic          Beta diversity (phylogenetic)
  beta-rarefaction           Beta diversity rarefaction
  bioenv                     bioenv
  core-metrics               Core diversity metrics (non-phylogenetic)
  core-metrics-phylogenetic  Core diversity metrics (phylogenetic and non-
                             phylogenetic)
  filter-distance-matrix     Filter samples from a distance matrix.
  mantel                     Apply the Mantel test to two distance matrices
  partial-procrustes         Partial Procrustes
  pcoa                       Principal Coordinate Analysis
  pcoa-biplot                Principal Coordinate Analysis Biplot
  procrustes-analysis        Procrustes Analysis
  tsne                       t-distributed stochastic neighbor embedding
  umap                       Uniform Manifold Approximation and Projection
# Alpha多样性(样本内部多样性)
# 计算Shannon指数:
qiime diversity alpha \
  --i-table your_feature_table.qza \
  --p-metric shannon \
  --o-alpha-diversity shannon_vector.qza

#Beta多样性(样本间多样性)
# 计算Bray-Curtis距离:

qiime diversity beta \
  --i-table your_feature_table.qza \
  --p-metric braycurtis \
  --o-distance-matrix braycurtis_distance_matrix.qza

# 可视化和统计分析
qiime diversity alpha-group-significance \
  --i-alpha-diversity shannon_vector.qza \
  --m-metadata-file your_sample_metadata.txt \
  --o-visualization shannon_group_significance.qzv
qiime diversity beta-group-significance \
  --i-distance-matrix braycurtis_distance_matrix.qza \
  --m-metadata-file your_sample_metadata.txt \
  --o-visualization braycurtis_group_significance.qzv

  • q2-diversity-lib
q2-diversity-lib 简介

q2-diversity-lib是QIIME 2的一个插件,用于计算多样性指数和样本间的差异。它基于多种生物多样性指标来评估微生物群落的多样性,并允许用户进行统计比较和可视化。

功能特性
  1. 计算多样性指数:支持计算多种多样性指数,如Shannon、Simpson、Chao1等,可以帮助衡量群落内物种的多样性和丰富度。
  2. Beta多样性计算:计算不同样本之间的差异和相似性,例如Bray-Curtis、Jaccard、Unweighted UniFrac、Weighted UniFrac等距离指标。
  3. Beta多样性可视化:生成多样性分析的可视化图表,如PCoA(Principal Coordinates Analysis)图表,展示样本之间的差异。
  4. 组间比较:支持组间多样性比较,通过PERMANOVA(Permutational Multivariate Analysis of Variance)等方法进行样本群落的差异性分析。
qiime diversity-lib --help
Usage: qiime diversity-lib [OPTIONS] COMMAND [ARGS]...

  Description: This QIIME 2 plugin computes individual metrics for  community
  alpha and beta diversity.

  Plugin website: https://github.com/qiime2/q2-diversity-lib

  Getting user support: Please post to the QIIME 2 forum for help with this
  plugin: https://forum.qiime2.org

Options:
  --version            Show the version and exit.
  --example-data PATH  Write example data and exit.
  --citations          Show citations and exit.
  --help               Show this message and exit.

Commands:
  alpha-passthrough               Alpha Passthrough (non-phylogenetic)
  beta-passthrough                Beta Passthrough (non-phylogenetic)
  beta-phylogenetic-meta-passthrough
                                  Beta Phylogenetic Meta Passthrough
  beta-phylogenetic-passthrough   Beta Phylogenetic Passthrough
  bray-curtis                     Bray-Curtis Dissimilarity
  faith-pd                        Faith's Phylogenetic Diversity
  jaccard                         Jaccard Distance
  observed-features               Observed Features
  pielou-evenness                 Pielou's Evenness
  shannon-entropy                 Shannon's Entropy
  unweighted-unifrac              Unweighted Unifrac
  weighted-unifrac                Weighted Unifrac

计算使用 

#计算Alpha多样性(多样性指数)
qiime diversity alpha \
  --i-table table.qza \
  --p-metric shannon \
  --o-alpha-diversity shannon_alpha.qza

#计算Beta多样性距离
qiime diversity beta \
  --i-table table.qza \
  --p-metric braycurtis \
  --o-distance-matrix braycurtis_distance.qza

#可视化Beta多样性分析结果(例如PCoA)
qiime diversity pcoa \
  --i-distance-matrix braycurtis_distance.qza \
  --o-pcoa braycurtis_pcoa.qza
qiime emperor plot \
  --i-pcoa braycurtis_pcoa.qza \
  --m-metadata-file sample-metadata.tsv \
  --o-visualization braycurtis_emperor.qzv

#进行组间多样性比较(以PERMANOVA为例)
qiime diversity beta-group-significance \
  --i-distance-matrix braycurtis_distance.qza \
  --m-metadata-file sample-metadata.tsv \
  --o-visualization braycurtis_permanova.qzv \
  --p-method permanova
  • q2-emperor
qiime emperor --help
Usage: qiime emperor [OPTIONS] COMMAND [ARGS]...

  Description: This QIIME 2 plugin wraps Emperor and supports interactive
  visualization of ordination plots.

  Plugin website: http://emperor.microbio.me

  Getting user support: Please post to the QIIME 2 forum for help with this
  plugin: https://forum.qiime2.org

Options:
  --version            Show the version and exit.
  --example-data PATH  Write example data and exit.
  --citations          Show citations and exit.
  --help               Show this message and exit.

Commands:
  biplot           Visualize and Interact with Principal Coordinates Analysis
                   Biplot
  plot             Visualize and Interact with Principal Coordinates Analysis
                   Plots
  procrustes-plot  Visualize and Interact with a procrustes plot
  • q2-feature-classifier

q2-feature-classifier 是 QIIME 2 中的一个插件,用于对16S rRNA或ITS等序列数据进行分类和注释。它主要用于将序列分类为特定的分类单元,比如对OTUs(操作分类单元)或者物种进行分类。

qiime feature-classifier --help
Usage: qiime feature-classifier [OPTIONS] COMMAND [ARGS]...

  Description: This QIIME 2 plugin supports taxonomic classification of
  features using a variety of methods, including Naive Bayes, vsearch, and
  BLAST+.

  Plugin website: https://github.com/qiime2/q2-feature-classifier

  Getting user support: Please post to the QIIME 2 forum for help with this
  plugin: https://forum.qiime2.org

Options:
  --version            Show the version and exit.
  --example-data PATH  Write example data and exit.
  --citations          Show citations and exit.
  --help               Show this message and exit.

Commands:
  blast                           BLAST+ local alignment search.
  classify-consensus-blast        BLAST+ consensus taxonomy classifier
  classify-consensus-vsearch      VSEARCH-based consensus taxonomy classifier
  classify-hybrid-vsearch-sklearn
                                  ALPHA Hybrid classifier: VSEARCH exact match
                                  + sklearn classifier
  classify-sklearn                Pre-fitted sklearn-based taxonomy classifier
  extract-reads                   Extract reads from reference sequences.
  find-consensus-annotation       Find consensus among multiple annotations.
  fit-classifier-naive-bayes      Train the naive_bayes classifier
  fit-classifier-sklearn          Train an almost arbitrary scikit-learn
                                  classifier
  makeblastdb                     Make BLAST database.
  vsearch-global                  VSEARCH global alignment search

#训练一个 SILVA 数据库上的分类器可以使用如下命令
qiime feature-classifier fit-classifier-naive-bayes \
  --i-reference-reads silva-132-99-515-806-nb-classifier.qza \
  --i-reference-taxonomy silva-132-99-515-806-nb-classifier.qza \
  --o-classifier classifier.qza

#  使用训练好的分类器对样本数据进行分类
qiime feature-classifier classify-sklearn \
  --i-classifier classifier.qza \
  --i-reads paired-end-demux.qza \
  --o-classification taxonomy.qza
  • q2-feature-table

q2-feature-table 插件是 QIIME 2 中的一个重要插件,用于处理和操作特征表(feature table)数据,它包括了许多功能,用于对微生物组数据进行分析和可视化。

以下是 q2-feature-table 插件的一些主要功能和使用方法:

  1. 导入特征表数据: 可以使用该插件将不同格式的特征表数据导入到 QIIME 2 中,如BIOM格式、文本格式、或其他常见格式的特征表。

  2. 特征表汇总和统计: 可以对特征表进行汇总和统计描述,比如计算每个样本中的特征数量、每个特征在样本中的出现频率等。

  3. 特征表的过滤和修剪: 提供了多种方法对特征表进行过滤和修剪,如去除低频特征、去除低丰度特征、保留指定样本数或特征数等。

  4. 特征表的转换和变换: 可以对特征表进行转换,如转置、归一化、对数转换等,以适应不同类型的分析需求。

  5. 特征表的合并和拆分: 可以将多个特征表合并为一个,也可以根据样本元数据信息将特征表拆分为多个子集。

  6. 特征表的可视化: 支持对特征表进行可视化展示,比如生成特征数量分布图、绘制热图展示特征在样本中的丰度等。

qiime feature-table --help
Usage: qiime feature-table [OPTIONS] COMMAND [ARGS]...

  Description: This is a QIIME 2 plugin supporting operations on sample by
  feature tables, such as filtering, merging, and transforming tables.

  Plugin website: https://github.com/qiime2/q2-feature-table

  Getting user support: Please post to the QIIME 2 forum for help with this
  plugin: https://forum.qiime2.org

Options:
  --version            Show the version and exit.
  --example-data PATH  Write example data and exit.
  --citations          Show citations and exit.
  --help               Show this message and exit.

Commands:
  core-features                  Identify core features in table
  filter-features                Filter features from table
  filter-features-conditionally  Filter features from a table based on
                                 abundance and prevalence
  filter-samples                 Filter samples from table
  filter-seqs                    Filter features from sequences
  group                          Group samples or features by a metadata
                                 column
  heatmap                        Generate a heatmap representation of a
                                 feature table
  merge                          Combine multiple tables
  merge-seqs                     Combine collections of feature sequences
  merge-taxa                     Combine collections of feature taxonomies
  presence-absence               Convert to presence/absence
  rarefy                         Rarefy table
  relative-frequency             Convert to relative frequencies
  rename-ids                     Renames sample or feature ids in a table
  split                          Split one feature table into many
  subsample                      Subsample table
  summarize                      Summarize table
  tabulate-seqs                  View sequence associated with each feature
  transpose                      Transpose a feature table.
#特征表的摘要和统计信息
qiime feature-table summarize \
  --i-table feature-table.qza \
  --o-visualization feature-table-summary.qzv

#特征表的过滤和修剪
qiime feature-table filter-features \
  --i-table feature-table.qza \
  --p-min-frequency 10 \
  --o-filtered-table filtered-feature-table.qza

qiime feature-table filter-samples \
  --i-table feature-table.qza \
  --p-min-frequency 500 \
  --o-filtered-table filtered-sample-table.qza

# 特征表的合并和操作
qiime feature-table merge \
  --i-tables table1.qza \
  --i-tables table2.qza \
  --o-merged-table merged-table.qza

#计算特征表的β-diversity:
qiime diversity beta \
  --i-table feature-table.qza \
  --o-distance-matrix beta-diversity.qza \
  --p-metric braycurtis

#可视化特征表
qiime feature-table summarize \
  --i-table feature-table.qza \
  --o-visualization feature-table-summary.qzv

#可视化β-diversity距离矩阵
qiime diversity beta-phylogenetic \
  --i-table feature-table.qza \
  --i-phylogeny rooted-tree.qza \
  --o-distance-matrix beta-diversity.qza \
  --p-metric unweighted_unifrac

qiime diversity pcoa \
  --i-distance-matrix beta-diversity.qza \
  --o-pcoa pcoa-results.qza

qiime emperor plot \
  --i-pcoa pcoa-results.qza \
  --m-metadata-file sample-metadata.tsv \
  --o-visualization emperor.qzv
  • q2-fragment-insertion

q2-fragment-insertion插件是用于将未分配的DNA序列(通常是16S rRNA或18S rRNA序列)嵌入(插入)到预先构建的参考进化树中的工具。这个插件可以帮助解决一些问题,比如通过将未知序列嵌入到进化树中,来推断未知序列的系统发育位置。

qiime fragment-insertion --help
Usage: qiime fragment-insertion [OPTIONS] COMMAND [ARGS]...

  Description: No description available. See plugin website:
  https://github.com/qiime2/q2-fragment-insertion

  Plugin website: https://github.com/qiime2/q2-fragment-insertion

  Getting user support: https://github.com/qiime2/q2-fragment-insertion/issues

Options:
  --version            Show the version and exit.
  --example-data PATH  Write example data and exit.
  --citations          Show citations and exit.
  --help               Show this message and exit.

Commands:
  classify-otus-experimental  Experimental: Obtain taxonomic lineages, by
                              finding closest OTU in reference phylogeny.
  filter-features             Filter fragments in tree from table.
  sepp                        Insert fragment sequences using SEPP into
                              reference phylogenies.
qiime fragment-insertion sepp \
  --i-representative-sequences <代表序列文件.qza> \
  --i-reference-database <参考数据库.qza> \
  --o-tree <输出进化树.qza> \
  --o-placements <输出插入位置文件.qza>
  • --i-representative-sequences 是代表性序列文件的位置。
  • --i-reference-database 是参考数据库文件的位置。
  • --o-tree 指定输出的进化树文件。
  • --o-placements 指定输出的插入位置文件。
  • q2-longitudinal

q2-longitudinal 插件是 QIIME 2 中的一个插件,专门用于处理微生物组长期研究的数据。该插件允许用户对时间序列实验数据进行分析,以便检测微生物组随时间变化的情况,比较不同条件下的变化,以及对这些变化的统计显著性进行评估。

以下是 q2-longitudinal 插件的一些主要功能和使用命令:

主要功能:
  1. 时间序列数据可视化:生成时间序列样本数据的可视化图表,比如长期研究的变化趋势、样本之间的差异等。
  2. 差异分析:比较不同时间点或不同处理组之间的微生物组成差异。
  3. Alpha 和 Beta 多样性分析:评估微生物群落在时间序列中的多样性和相似性变化。
  4. 线性混合效应模型:对微生物组数据进行线性模型分析,以研究时间、处理效应和其交互作用对微生物组成的影响。
qiime longitudinal --help
Usage: qiime longitudinal [OPTIONS] COMMAND [ARGS]...

  Description: This QIIME 2 plugin supports methods for analysis of time
  series data, involving either paired sample comparisons or longitudinal
  study designs.

  Plugin website: https://github.com/qiime2/q2-longitudinal

  Getting user support: Please post to the QIIME 2 forum for help with this
  plugin: https://forum.qiime2.org

Options:
  --version            Show the version and exit.
  --example-data PATH  Write example data and exit.
  --citations          Show citations and exit.
  --help               Show this message and exit.

Commands:
  anova                    ANOVA test
  feature-volatility       Feature volatility analysis
  first-differences        Compute first differences or difference from
                           baseline between sequential states
  first-distances          Compute first distances or distance from baseline
                           between sequential states
  linear-mixed-effects     Linear mixed effects modeling
  maturity-index           Microbial maturity index prediction.
  nmit                     Nonparametric microbial interdependence test
  pairwise-differences     Paired difference testing and boxplots
  pairwise-distances       Paired pairwise distance testing and boxplots
  plot-feature-volatility  Plot longitudinal feature volatility and
                           importances
  volatility               Generate interactive volatility plot
#导入数据
qiime longitudinal feature-table-merge \
  --i-longitudinal-feature-tables feature-table.qza \
  --o-merged-table merged-table.qza

#线性混合效应模型
qiime longitudinal linear-mixed-effects \
  --m-metadata-file sample-metadata.tsv \
  --m-metadata-file timepoints.tsv \
  --p-metric Shannon_index \
  --p-group-columns treatment \
  --p-state-column time \
  --p-individual-id-column subject \
  --o-visualization lme-results.qzv

#可视化
qiime longitudinal volatility \
  --i-table merged-table.qza \
  --m-metadata-file sample-metadata.tsv \
  --p-state-column time \
  --p-individual-id-column subject \
  --o-visualization volatility.qzv

#组间差异
qiime longitudinal pairwise-differences \
  --m-metadata-file sample-metadata.tsv \
  --m-metadata-file timepoints.tsv \
  --p-metric Shannon_index \
  --p-group-column treatment \
  --p-state-column time \
  --p-individual-id-column subject \
  --o-visualization pairwise-differences.qzv

#α多样性图表
qiime longitudinal maturity-index \
  --i-alpha-diversity alpha-diversity.qza \
  --m-metadata-file sample-metadata.tsv \
  --p-state-column time \
  --p-individual-id-column subject \
  --o-visualization maturity-index.qzv
  • q2-metadata

q2-metadata 插件用于处理和操作元数据,元数据是描述样本信息的数据,比如样本来源、处理方法、实验条件等。以下是 q2-metadata 插件的简要介绍和一些常见的使用命令:

q2-metadata 插件的功能:
  1. 元数据导入: 将元数据文件导入到 QIIME 2 格式中。
  2. 元数据可视化: 可视化元数据内容以便更好地理解样本信息。
  3. 元数据的处理和编辑: 对元数据进行筛选、编辑和转换。
  4. 元数据统计和摘要: 统计和生成关于元数据的摘要信息。
qiime metadata --help
Usage: qiime metadata [OPTIONS] COMMAND [ARGS]...

  Description: This QIIME 2 plugin provides functionality for working with and
  visualizing Metadata.

  Plugin website: https://github.com/qiime2/q2-metadata

  Getting user support: Please post to the QIIME 2 forum for help with this
  plugin: https://forum.qiime2.org

Options:
  --version            Show the version and exit.
  --example-data PATH  Write example data and exit.
  --citations          Show citations and exit.
  --help               Show this message and exit.

Commands:
  distance-matrix  Create a distance matrix from a numeric Metadata column
  merge            Merge metadata
  shuffle-groups   Shuffle values in a categorical sample metadata column.
  tabulate         Interactively explore Metadata in an HTML table
# 1. 元数据导入:
qiime metadata tabulate --m-input-file sample-metadata.tsv --o-visualization sample-metadata.qzv
# 2. 元数据可视化:
qiime metadata tabulate --m-input-file sample-metadata.qza --o-visualization sample-metadata.qzv
# 3. 元数据编辑与处理:
#  删除列:
qiime metadata tabulate --m-input-file sample-metadata.qza --o-visualization sample-metadata.qzv
#  筛选行(过滤):
qiime metadata tabulate --m-input-file sample-metadata.qza --o-visualization sample-metadata.qzv
# 4. 元数据统计和摘要:
qiime metadata tabulate --m-input-file sample-metadata.qza --o-visualization sample-me
  • q2-phylogeny

q2-phylogeny插件则提供了处理生物多样性分析中的系统发育信息的功能。该插件主要用于构建系统发育树和处理系统发育树相关的操作,例如序列的进化树推断、进化树的根节点分配等。

qiime phylogeny --help
Usage: qiime phylogeny [OPTIONS] COMMAND [ARGS]...

  Description: This QIIME 2 plugin supports generating and manipulating
  phylogenetic trees.

  Plugin website: https://github.com/qiime2/q2-phylogeny

  Getting user support: Please post to the QIIME 2 forum for help with this
  plugin: https://forum.qiime2.org

Options:
  --version            Show the version and exit.
  --example-data PATH  Write example data and exit.
  --citations          Show citations and exit.
  --help               Show this message and exit.

Commands:
  align-to-tree-mafft-fasttree  Build a phylogenetic tree using fasttree and
                                mafft alignment
  align-to-tree-mafft-iqtree    Build a phylogenetic tree using iqtree and
                                mafft alignment.
  align-to-tree-mafft-raxml     Build a phylogenetic tree using raxml and
                                mafft alignment.
  fasttree                      Construct a phylogenetic tree with FastTree.
  filter-table                  Remove features from table if they're not
                                present in tree.
  filter-tree                   Remove features from tree based on metadata
  iqtree                        Construct a phylogenetic tree with IQ-TREE.
  iqtree-ultrafast-bootstrap    Construct a phylogenetic tree with IQ-TREE
                                with bootstrap supports.
  midpoint-root                 Midpoint root an unrooted phylogenetic tree.
  raxml                         Construct a phylogenetic tree with RAxML.
  raxml-rapid-bootstrap         Construct a phylogenetic tree with bootstrap
                                supports using RAxML.
  robinson-foulds               Calculate Robinson-Foulds distance between
                                phylogenetic trees.
## 构建系统发育树:
#使用多序列比对后的结果构建系统发育树。可以使用q2-phylogeny中的FastTree或RAxML进行树的构建。以下是使用FastTree的示例命令:
qiime phylogeny fasttree \
  --i-alignment aligned-sequences.qza \
  --o-tree tree.qza

# 或者使用RAxML进行系统发育树的构建:
qiime phylogeny raxml \
  --i-alignment aligned-sequences.qza \
  --p-substitution-model GTRGAMMA \
  --o-tree tree.qza \
  --verbose

## 可选操作 - 根节点分配:
# 有时,你可能需要为系统发育树分配根节点。可以使用q2-phylogeny中的根节点分配插件进行此操作。以下是一个示例命令:
qiime phylogeny midpoint-root \
  --i-tree tree.qza \
  --o-rooted-tree rooted-tree.qza

  • q2-quality-control

q2-quality-control 插件旨在进行序列数据的质量控制和过滤,它可以执行以下任务:

  • 对序列数据进行质量评估
  • 去除低质量序列
  • 截取或修剪序列的部分
  • 去除嵌合序列(chimeras)
  • 过滤低频序列
  • q2-quality-filter

q2-quality-filter插件用于对DNA测序数据进行质量控制和过滤,以去除低质量的序列。这有助于提高后续分析的准确性和可靠性。

qiime quality-control --help
Usage: qiime quality-control [OPTIONS] COMMAND [ARGS]...

  Description: This QIIME 2 plugin supports methods for assessing and
  controlling the quality of feature and sequence data.

  Plugin website: https://github.com/qiime2/q2-quality-control

  Getting user support: Please post to the QIIME 2 forum for help with this
  plugin: https://forum.qiime2.org

Options:
  --version            Show the version and exit.
  --example-data PATH  Write example data and exit.
  --citations          Show citations and exit.
  --help               Show this message and exit.

Commands:
  bowtie2-build              Build bowtie2 index from reference sequences.
  decontam-identify          Identify contaminants
  decontam-identify-batches  Identify contaminants in Batch Mode
  decontam-remove            Removes contaminant
  decontam-score-viz         Generate a histogram representation of the scores
  evaluate-composition       Evaluate expected vs. observed taxonomic
                             composition of samples
  evaluate-seqs              Compare query (observed) vs. reference (expected)
                             sequences.
  evaluate-taxonomy          Evaluate expected vs. observed taxonomic
                             assignments
  exclude-seqs               Exclude sequences by alignment
  filter-reads               Filter demultiplexed sequences by alignment to
                             reference database.
qiime quality-filter q-score \
  --i-demux paired-end-demux.qza \
  --p-min-quality 20 \
  --o-filtered-sequences demux-filtered.qza \
  --o-filter-stats demux-filter-stats.qza
  • q2-sample-classifier

而q2-sample-classifier是Qiime 2中的一个插件,用于样本分类和预测。它可以帮助用户利用机器学习算法对样本进行分类,比较不同条件下的微生物组成差异,例如,预测分类数据(如临床数据)和微生物组成之间的关系。

qiime sample-classifier --help
Usage: qiime sample-classifier [OPTIONS] COMMAND [ARGS]...

  Description: This QIIME 2 plugin supports methods for supervised
  classification and regression of sample metadata, and other supervised
  machine learning methods.

  Plugin website: https://github.com/qiime2/q2-sample-classifier

  Getting user support: Please post to the QIIME 2 forum for help with this
  plugin: https://forum.qiime2.org

Options:
  --version            Show the version and exit.
  --example-data PATH  Write example data and exit.
  --citations          Show citations and exit.
  --help               Show this message and exit.

Commands:
  classify-samples            Train and test a cross-validated supervised
                              learning classifier.
  classify-samples-from-dist  Run k-nearest-neighbors on a labeled distance
                              matrix.
  classify-samples-ncv        Nested cross-validated supervised learning
                              classifier.
  confusion-matrix            Make a confusion matrix from sample classifier
                              predictions.
  fit-classifier              Fit a supervised learning classifier.
  fit-regressor               Fit a supervised learning regressor.
  heatmap                     Generate heatmap of important features.
  metatable                   Convert (and merge) positive numeric metadata
                              (in)to feature table.
  predict-classification      Use trained classifier to predict target values
                              for new samples.
  predict-regression          Use trained regressor to predict target values
                              for new samples.
  regress-samples             Train and test a cross-validated supervised
                              learning regressor.
  regress-samples-ncv         Nested cross-validated supervised learning
                              regressor.
  scatterplot                 Make 2D scatterplot and linear regression of
                              regressor predictions.
  split-table                 Split a feature table into training and testing
                              sets.
  summarize                   Summarize parameter and feature extraction
                              information for a trained estimator.
qiime sample-classifier classify-samples \
  --i-table feature-table.qza \
  --m-metadata-file sample-metadata.qza \
  --m-metadata-column TARGET_COLUMN \
  --p-test-size 0.2 \
  --p-random-state 42 \
  --p-n-estimators 100 \
  --p-n-jobs 1 \
  --o-visualization classification-results.qzv
  • --i-table 指定特征表格的位置
  • --m-metadata-file 指定样本元数据的位置
  • --m-metadata-column 指定用于分类的目标列
  • --p-test-size 设置测试集的比例
  • --p-random-state 设置随机种子以确保结果可重复
  • --p-n-estimators 设置分类器使用的估计器数量
  • --p-n-jobs 设置用于计算的作业数
  • --o-visualization 指定输出结果的位置
  • q2-taxa

q2-taxa 插件则用于分析和可视化分类学信息,特别是对于已经进行了序列分类(比如16S rRNA)的数据。q2-taxa 允许用户对物种注释信息进行处理、汇总和可视化。

qiime taxa --help
Usage: qiime taxa [OPTIONS] COMMAND [ARGS]...

  Description: This QIIME 2 plugin provides functionality for working with and
  visualizing taxonomic annotations of features.

  Plugin website: https://github.com/qiime2/q2-taxa

  Getting user support: Please post to the QIIME 2 forum for help with this
  plugin: https://forum.qiime2.org

Options:
  --version            Show the version and exit.
  --example-data PATH  Write example data and exit.
  --citations          Show citations and exit.
  --help               Show this message and exit.

Commands:
  barplot       Visualize taxonomy with an interactive bar plot
  collapse      Collapse features by their taxonomy at the specified level
  filter-seqs   Taxonomy-based feature sequence filter.
  filter-table  Taxonomy-based feature table filter.
# 1. 导入数据
# 使用命令 qiime taxa 可以导入并生成用于分类学分析的数据格式。例如:
qiime taxa import \
  --input-path taxonomy.tsv \
  --output-path taxonomy.qza \
  --type 'FeatureData[Taxonomy]'

# 2. 查看物种丰度
# 命令 qiime taxa barplot 可以用于生成物种丰度的柱状图,用于可视化各个样本中不同分类水平的相对丰度。
qiime taxa barplot \
  --i-table table.qza \
  --i-taxonomy taxonomy.qza \
  --m-metadata-file sample-metadata.tsv \
  --o-visualization taxa-bar-plot.qzv

# 3. 物种注释
# 可通过 qiime taxa classify-sklearn 命令使用机器学习分类器进行序列的物种注释。以下是一个例子:
qiime taxa classify-sklearn \
  --i-reads rep-seqs.qza \
  --i-classifier classifier.qza \
  --o-classification taxonomy.qza

# 4. 特定分类水平的筛选和可视化
# 可以使用 qiime taxa filter-table 和 qiime taxa filter-seqs 命令在特定分类水平对数据进行过滤。然后,可以使用其他命令可视化已过滤的数据。

# 5. 物种多样性分析
使用 qiime taxa collapse 和 qiime taxa rarefy 等命令可以对物种注释数据进行聚合和稀释,以进行多样性分析。
  • q2-types

q2-types插件旨在处理和管理不同类型的数据,包括:

  • DNA 序列
  • RNA 序列
  • 蛋白质序列
  • 样本和元数据信息
  • q2-vsearch

 q2-vsearch 插件则是 QIIME 2 中用于序列相似性搜索和聚类的插件之一。它基于 VSEARCH,提供了执行序列相似性搜索、聚类和序列分析的功能。这个基本上与直接使用vesearch直接使用差不多了,只不过这里集成后可以直接与qiime的其他模块相结合使用。

qiime vsearch --help
Usage: qiime vsearch [OPTIONS] COMMAND [ARGS]...

  Description: This plugin wraps the vsearch application, and provides methods
  for clustering and dereplicating features and sequences.

  Plugin website: https://github.com/qiime2/q2-vsearch

  Getting user support: Please post to the QIIME 2 forum for help with this
  plugin: https://forum.qiime2.org

Options:
  --version            Show the version and exit.
  --example-data PATH  Write example data and exit.
  --citations          Show citations and exit.
  --help               Show this message and exit.

Commands:
  cluster-features-closed-reference
                                  Closed-reference clustering of features.
  cluster-features-de-novo        De novo clustering of features.
  cluster-features-open-reference
                                  Open-reference clustering of features.
  dereplicate-sequences           Dereplicate sequences.
  fastq-stats                     Fastq stats with vsearch.
  merge-pairs                     Merge paired-end reads.
  uchime-denovo                   De novo chimera filtering with vsearch.
  uchime-ref                      Reference-based chimera filtering with
# 序列相似性搜索
# 使用 q2-vsearch 插件进行序列相似性搜索的命令:
qiime vsearch search-sequences \
  --i-query query_sequences.qza \
  --i-reference reference_sequences.qza \
  --o-results search_results.qza \
  --o-perc-identity output_identity.qza \
  --o-failed-sequences failed_sequences.qza
# 此命令将执行一项序列搜索,将查询序列与参考序列集进行比较,并生成包含搜索结果的文件。

# 序列聚类
# 利用 q2-vsearch 进行序列聚类的命令示例:
qiime vsearch cluster-features-de-novo \
  --i-sequences sequences.qza \
  --i-table table.qza \
  --p-perc-identity 0.97 \
  --o-clustered-table clustered_table.qza \
  --o-clustered-sequences clustered_sequences.qza \
  --o-new-reference-sequences new_reference_sequences.qza

当然还有分析结果的可视化

在线可视化,拖拽出图:QIIME 2 View

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:/a/237698.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

Linux——Web网站服务(二)

一、httpd服务的访问控制 1、客户机地址限制 通过Require配置项&#xff0c;可以根据主机的主机名或P地址来决定是否允许客户端访问。在 httpd服务器的主配置文件的<Location>&#xff0c;<Directory>、<Files>、<Limit>配置段中均可以使用Require配置…

MQ-Det: Multi-modal Queried Object Detection in the Wild

首个支持视觉和文本查询的开放集目标检测方法 NeurIPS2023 文章&#xff1a;https://arxiv.org/abs/2305.18980 代码&#xff1a;https://github.com/YifanXu74/MQ-Det 主框图 摘要 这篇文章提出了MQ-Det&#xff0c;一种高效的架构和预训练策略&#xff0c;它利用文本描述的…

【LeetCode刷题-树】-- 103.二叉树的锯齿形层序遍历

103.二叉树的锯齿形层序遍历 方法&#xff1a;广度优先搜索 /*** Definition for a binary tree node.* public class TreeNode {* int val;* TreeNode left;* TreeNode right;* TreeNode() {}* TreeNode(int val) { this.val val; }* TreeNode(int …

单片机(STM32,GD32,NXP等)中BootLoader的严谨实现详解

Bootloader(引导加载程序)的主要任务是引导加载并运行应用程序&#xff0c;我们的软件升级逻辑也一般在BootLoader中实现。本文将详细介绍BootLoader在单片机中的实现&#xff0c;包括STM32、GD32、NXP Kinetis等等的所有单片机&#xff0c;因为无论是什么样的芯片&#xff0c;…

​pathlib --- 面向对象的文件系统路径​

3.4 新版功能. 源代码 Lib/pathlib.py 该模块提供表示文件系统路径的类&#xff0c;其语义适用于不同的操作系统。路径类被分为提供纯计算操作而没有 I/O 的 纯路径&#xff0c;以及从纯路径继承而来但提供 I/O 操作的 具体路径。 如果以前从未用过此模块&#xff0c;或不确定…

07.仿简道云公式函数实战-逻辑函数-AND

1.AND函数 AND 函数可用于表示&#xff1a;当所有参数逻辑值为 true 时&#xff0c;返回 true&#xff1b;只要有任何一个参数逻辑值为 false&#xff0c;则返回false。 2. 函数用法 AND(语文成绩>90,数学成绩>90,英语成绩>90) 3.函数示例 1&#xff09;AND(A,B)&a…

Ruff智慧路灯方案让城市管理更智慧,物联网助力城市数智化运营

随着5G、物联网、人工智能等新一代信息技术的发展&#xff0c;路灯管理也被赋予了更多可能&#xff0c;路灯已经从简单的照明工具逐步成为智慧城市发展的新入口。 据了解&#xff0c;当前我国路灯照明耗电量约占总量的15%。传统路灯存在耗能大、设备故障无法定位、路灯状态难以…

安装LLaMA-Factory微调chatglm3,修改自我认知

安装git clone https://github.com/hiyouga/LLaMA-Factory.git conda create -n llama_factory python3.10 conda activate llama_factory cd LLaMA-Factory pip install -r requirements.txt 之后运行 CUDA_VISIBLE_DEVICES0 python src/train_web.py&#xff0c;按如下配置…

algorithm graphics

绘制地图坐标路线_哔哩哔哩_bilibili neo4j test-CSDN博客

如何使用Java在Excel中添加动态数组公式?

本文由葡萄城技术团队发布。转载请注明出处&#xff1a;葡萄城官网&#xff0c;葡萄城为开发者提供专业的开发工具、解决方案和服务&#xff0c;赋能开发者。 前言 动态数组公式是 Excel 引入的一项重要功能&#xff0c;它将 Excel 分为两种风格&#xff1a;Excel 365 和传统 …

Linux基础项目开发2:物联网监控——视频监控方案介绍(一)

前言&#xff1a; 这次我们来做一个关于视频监控的基础小项目&#xff0c;需要我们用到网络的相关知识&#xff0c;还会学到好多优秀的网络协议&#xff0c;下面让我们开始对物联网视频监控进行一个大体框架的介绍吧 目录 项目内容&#xff1a; 1.视频监控方案介绍 2.视频监控…

ROB的结构与作用

在流水线的提交&#xff08;Commit&#xff09;阶段&#xff0c;之所以能够将乱序执行的指令变回程序中指定的顺序状态,主要是通过重排序缓存(Reorder Buffer, ROB)来实现的 ROB本质上是一个FIFO在它当中存储了一条指令的相关信息,例如这条指令的类型、结果、目的寄存器和异常…

SpringCloud面试题——Sentinel

一&#xff1a;什么是Sentinel&#xff1f; Sentinel是一个面向分布式架构的轻量级服务保护框架&#xff0c;实现服务降级、服务熔断、服务限流等功能 二&#xff1a;什么是服务降级&#xff1f; 比如当某个服务繁忙,不能让客户端的请求一直等待,应该立刻返回给客户端一个备…

安装程序无法自动安装Virtual Machine Communication Interface Sockets(VSock)驱动程序

环境情况&#xff1a; 物理机win10系统 虚拟机windowserver08系统 vmware 16.0的版本 问题触发&#xff1a; 在虚拟机win7系统上安装vmware tools出现提示&#xff0c;报错信息“安装程序无法自动安装Virtual Machine Communication Interface Sockets&#xff08;VSock&a…

Android 11.0 systemui锁屏页面时钟显示样式的定制功能实现

1.前言 在11.0的系统ROM定制化开发中,在进行systemui的相关开发中,当开机完成后在锁屏页面就会显示时间日期的功能,由于 开发产品的需求要求时间显示周几上午下午接下来就需要对锁屏显示时间日期的相关布局进行分析,然后实现相关功能 效果图如图: 2.systemui锁屏页面时钟显…

Ubuntu Destktop 22.04 设置 ssh 超时时间

Ubuntu Destktop 22.04 使用 ssh 连接服务器时&#xff0c;发现一段时间不操作就会自动断开连接&#xff0c;解决方法如下&#xff1a; 打开 /etc/ssh/ssh_config 文件&#xff1a; sudo vim /etc/ssh/ssh_config在文件最后添加&#xff1a; # ssh 客户端会每隔 30 秒发送一…

4fiddler抓包工具的使用

一、定义 1.1 抓包的定义 说明&#xff1a;客户端向服务器发送请求以及服务器响应客户端的请求&#xff0c;都是以数据包来传递的。 抓包(packet capture)&#xff1a;通过工具拦截客户端与服务器交互的数据包 1.2 fiddler的介绍 Fiddler是一个http协议调试代理工具&#…

将数组转换为字符串 numpy.array_repr()

【小白从小学Python、C、Java】 【计算机等级考试500强双证书】 【Python-数据分析】 将数组转换为字符串 numpy.array_repr() [太阳]选择题 请问关于以下代码最后输出的数据类型是&#xff1f; import numpy as np a np.array([0, 1, 2]) print("【显示】a ",a) pr…

Node CLI 之 Yargs (2)

什么是 yargs&#xff1f; yargs 是一个用于处理命令行参数的 Node.js 库 安装 yargs npm install yargs简单例子 不定义任何选项&#xff0c;直接便可以使用 定义命令 const yargs require(yargs)yargs.command(hello, Prints hello world, (yargs) > {}, (argv) >…