Q&A 3 How do you process raw sequencing data into a feature table using QIIME2?

3.1 Explanation

After obtaining your raw FASTQ data, the first analytical step is transforming it into a structured format for analysis — the feature table. This is a matrix of counts (samples × ASVs or OTUs).

QIIME2 is a powerful, Python-based platform for this entire workflow. It uses .qza files (QIIME artifacts) to structure data at each step and generates a .qzv summary for inspection.

This pipeline includes: - Importing FASTQ data - Demultiplexing reads - Denoising to generate ASVs using DADA2 or Deblur - Creating a feature table

3.2 Shell Code (QIIME2 CLI)

# 1. Import paired-end reads
qiime tools import \
  --type EMPPairedEndSequences \
  --input-path emp-paired-end-sequences \
  --output-path emp-paired-end-sequences.qza

# 2. Demultiplex (barcode + sample mapping required)
qiime demux emp-paired \
  --i-seqs emp-paired-end-sequences.qza \
  --m-barcodes-file sample-metadata.tsv \
  --m-barcodes-column BarcodeSequence \
  --o-per-sample-sequences demux.qza \
  --o-error-correction-details demux-details.qza

# 3. Visualize quality
qiime demux summarize \
  --i-data demux.qza \
  --o-visualization demux.qzv

# 4. Denoise with DADA2
qiime dada2 denoise-paired \
  --i-demultiplexed-seqs demux.qza \
  --p-trim-left-f 0 \
  --p-trim-left-r 0 \
  --p-trunc-len-f 240 \
  --p-trunc-len-r 200 \
  --o-table table.qza \
  --o-representative-sequences rep-seqs.qza \
  --o-denoising-stats denoising-stats.qza

3.3 Python Note

# Although QIIME2 is Python-based, its workflow is run via CLI.
# Feature table (table.qza) can be exported and summarized later using Python or R.