Download and install QIIME2
To download QIIME2 natively, you can follow these steps:
- Install Miniconda appropriate to your system.
- Then, open terminal window.
- Confirm Miniconda is installed. Just write “conda” and press enter.
- Now install QIIME2 Metagenome Distribution running following code.
conda env create -n qiime2-metagenome-2024.10 –file https://data.qiime2.org/distro/metagenome/qiime2-metagenome-2024.10-py310-osx-conda.yml
It will take some time…..
Activate QIIME2 environment
1.Run following code to activate QIIME2 environment.
conda activate qiime2-metagenome-2024.10
You can see “qiime” environment being activated
Importing demultiplexed pair-end sequences
- Make sure your working directory is set to the folder where you have saved your demultiplexed sequences.
Run cd /path/to/your/file this will change your directory
Run pwd check your current working directory
- Make sure your sequences file are in .gz and has name format e.g.
Forward sequences AF05_SB09_L001_R1_001.fastq.gz
Reverse sequences AF05_SB09_L001_R2_001.fastq.gz
Here AF05 and SB09 are the sample information. You can use L001 and 001 for all samples, it will not affect importing demultiplexed sequences.
qiime tools import
–type ‘SampleData[PairedEndSequencesWithQuality]’ \
–input-path . \
–input-format CasavaOneEightSingleLanePerSampleDirFmt \
–output-path demux-paired-end.qza
Visualize imported paired-end sequences
To get .qvz file of imported paired-end sequences run following code
qiime demux summarize \
–i-data demux-paired-end.qza \
–o-visualization demux.qzv
use QIIME2view to view demux.qzv file
You can see one example in the following figures.
here, you can see the quality of sequences which will help you to determine the parameters for denoising sequences for both forward and reverse sequencing
Denoising
Denoising step includes cutting out ambiguous bp which are usually during begining and end of sequence amplification process, followed by removing chimeric sequences.
qiime dada2 denoise-paired \
–i-demultiplexed-seqs demux-paired-end.qza \
–p-trim-left-f 15 \
–p-trim-left-r 15 \
–p-trunc-len-f 260 \
–p-trunc-len-r 220 \
–o-table table.qza \
–o-representative-sequences rep-seqs.qza \
–o-denoising-stats stats.qza \
–verbose
here –verbose step will gives messages during the process of denoising.
View denoised samples stats
qiime metadata tabulate \
–m-input-file stats.qza \
–o-visualization stats.qzv
View feature table
qiime feature-table summarize \
–i-table table.qza \
–m-sample-metadata-file metadata.txt \
–o-visualization table.qzv
Export feature table
qiime tools export \
–input-path rarefied-table.qza \
–output-path Feature_table/
Convert feature table biom to tsv
biom convert \
-i Feature_table/feature-table.biom \
-o Feature_table/feature-table.tsv \
–to-tsv\
View representative sequences
qiime feature-table tabulate-seqs \
–i-data rep-seqs.qza \
–o-visualization rep-seqs.qzv
Alignment
qiime phylogeny align-to-tree-mafft-fasttree \
–i-sequences filtered-rep-seqs.qza \
–output-dir Aligned/
Diversity
qiime diversity core-metrics-phylogenetic \
–i-phylogeny clustered-sequences/Aligned/rooted_tree.qza \
–i-table clustered-sequences/rarefied-table.qza \
–p-sampling-depth 27300 \
–m-metadata-file metadata.txt \
–output-dir clustered-sequences/diversity-rarefied-data