QIIME 2是一款功能强大、可扩展,去中心化的微生物组软件分析包,强调数据分析透明。QIIME 2可以使研究者从原始DNA序列开始分析,直接获取出版级的统计和图片结果。
1.安装
由于之前已经安装过Miniconda,此次不在安装。
https://www.jianshu.com/p/eb89ab4af035
官方安装文档https://docs.qiime2.org/2019.1/install/
点击Latest Docs,跳转到https://docs.qiime2.org/2019.4/install/native/
最新版本为qiime2-2019.4-py36-linux-conda.yml
1.1下载文件
wget https://data.qiime2.org/distro/core/qiime2-2019.4-py36-linux-conda.yml
1.2 conda创建环境 -n 环境名称
conda env create -n qiime2-2019.4 --file qiime2-2019.4-py36-linux-conda.yml
1.3 可选步骤,删除刚才下载的文件
rm qiime2-2019.4-py36-linux-conda.yml
1.4 激活conda环境,运行
source activate qiime2-2019.4
1.5 测试
qiime --help
如果运行此命令时未报告任何错误,则安装成功!
1.6停用环境,运行
source deactivate
2.导入数据
2.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.
#导入数据以开始新的qiime 2工作。
#有关用法示例和可以导入的文件类型和相关语义的详细信息类型参见https://docs.qiime2.org/。
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.
必须输入的参数有3个:
type、input-path、output-path
2.2 --type
输入以下命令查看参数type的类型
qiime tools import --show-importable-types
输出
DeblurStats
DistanceMatrix
EMPPairedEndSequences
EMPSingleEndSequences
ErrorCorrectionDetails
FeatureData[AlignedSequence]
FeatureData[Importance]
FeatureData[PairedEndSequence]
FeatureData[Sequence]
FeatureData[Taxonomy]
FeatureTable[Balance]
FeatureTable[Composition]
FeatureTable[Frequency]
FeatureTable[PercentileNormalized]
FeatureTable[PresenceAbsence]
FeatureTable[RelativeFrequency]
Hierarchy
MultiplexedPairedEndBarcodeInSequence
MultiplexedSingleEndBarcodeInSequence
PCoAResults
Phylogeny[Rooted]
Phylogeny[Unrooted]
Placements
QualityFilterStats
RawSequences
SampleData[AlphaDiversity]
SampleData[BooleanSeries]
SampleData[ClassifierPredictions]
SampleData[DADA2Stats]
SampleData[FirstDifferences]
SampleData[JoinedSequencesWithQuality]
SampleData[PairedEndSequencesWithQuality]
SampleData[RegressorPredictions]
SampleData[SequencesWithQuality]
SampleData[Sequences]
SampleEstimator[Classifier]
SampleEstimator[Regressor]
TaxonomicClassifier
UchimeStats
2.3 --input-path
qiime2要求除了fastq文件,还需要一个txt格式的manifest文件。
#absolute filepaths “Fastq manifest” formats *file name: pe-33-manifest
sample-id,absolute-filepath,direction
SRR6025627,/media/luozhixin/0000678400004823/Qiime2/20190601/SRR6025627.1.clean.fastq.gz,forward
SRR6025627,/media/luozhixin/0000678400004823/Qiime2/20190601/SRR6025627.2.clean.fastq.gz,reverse
SRR6025635,/media/luozhixin/0000678400004823/Qiime2/20190601/SRR6025635.1.clean.fastq.gz,forward
SRR6025635,/media/luozhixin/0000678400004823/Qiime2/20190601/SRR6025635.2.clean.fastq.gz,reverse
保存后重命名为pe-33-manifest
2.3 --output-path
输出文件路径和名称
当前路径:
--output-path paired-end-demux.qza \
2.4 --input-format
输入以下命令查看参数format的类型
qiime tools import --show-importable-formats
分为PairedEndFastqManifestPhred33 和 PairedEndFastqManifestPhred64
其实就是Phred33还是Phred64。
2.5 示例
qiime tools import \
--type 'SampleData[PairedEndSequencesWithQuality]' \
--input-path pe-33-manifest \
--output-path paired-end-demux.qza \
--input-format PairedEndFastqManifestPhred33
3.
3.1 生成可视化文件
qiime demux summarize \
--i-data paired-end-demux.qza \
--o-visualization paired-end-demux.qzv
--i-data,输入数据;--o-visualization,输出文件。
3.2 paired-end-demux.qzv文件可视化
qiime tools view paired-end-demux.qzv
Press the 'q' key, Control-C, or Control-D to quit.
4 去噪,合并双端序列
4.1.1 去噪
qiime dada2 denoise-paired \
--i-demultiplexed-seqs paired-end-demux.qza \
--p-trim-left-f 0 \
--p-trim-left-r 0 \
--p-trunc-len-f 270 \
--p-trunc-len-r 250 \
--o-table table.qza \
--o-representative-sequences rep-seqs.qza \
--o-denoising-stats denoising-stats.qza \
--p-n-threads 0
参数:
--i-demultiplexed-seqs #指定输入文件
--p-trim-left #用于切除边缘低质量区
--o-representative-sequences #输出代表性序列
--p-n-threads #调用CPU线程
4.1.2 生成可视化文件
qiime metadata tabulate \
--m-input-file denoising-stats.qza \
--o-visualization denoising-stats.qzv
qzv文件可在线查看
4.2.1 合并
qiime vsearch join-pairs \
--i-demultiplexed-seqs paired-end-demux.qza \
--o-joined-sequences joined.qza
4.2.2 生成可视化文件
qiime demux summarize \
--i-data joined.qza \
--o-visualization joined.qzv
5.质控
qiime quality-filter q-score-joined
--i-demux joined.qza
--o-filtered-sequences joined-filtered.qza\
--o-filter-stats joined-filtered-stats.qza
qiime metadata tabulate
--m-input-file joined-filtered-stats.qza\
--o-visualization joined-filtered-stats.qzv
转载于:https://www.jianshu.com/p/1c2cce847581