Merging DADA2 Results in QIIME2

One of the advantages of using DADA2 is that you can merge results processed at different times and/or from different plates. Here I provide an example of merging DADA2 ASV tables and representative sequences from four different 16S rRNA gene sequencing runs. The merged results are processed further for import into phyloseq.

An example QIIME2/DADA2 command for merging table files is:

qiime feature-table merge \
 --i-tables may_table.qza \
 --i-tables july_table.qza \
 --i-tables septoct_table.qza \
 --i-tables psomagen_2_table.qza \
 --o-merged-table merged_table.qza

And the corresponding command to merge the representative sequences is:

qiime feature-table merge-seqs \
 --i-data may_rep-seqs.qza \
 --i-data july_rep-seqs.qza \
 --i-data septoct_rep-seqs.qza \
 --i-data psomagen_2_rep-seqs.qza \
 --o-merged-data merged_rep-seqs.qza

The remaining steps for generating files that can be imported into phyloseq are identical to those in the section on processing 16S rRNA gene sequences.

To align and tree the representative sequences, enter the QIIME2 command:

qiime phylogeny align-to-tree-mafft-fasttree \
 --i-sequences merged_rep-seqs.qza \
 --o-alignment merged_aligned-rep-seqs.qza \
 --o-masked-alignment merged_masked-aligned-rep-seqs.qza \
 --o-tree merged_unrooted-tree.qza \
 --o-rooted-tree merged_rooted-tree.qza

Export the ASV table in biom format with the command:

mkdir phyloseq qiime tools export \
 --input-path merged_table.qza \
 --output-path phyloseq

Convert the biom format to a tab-separated file easily imported into R with the commands:

biom convert \
 -i phyloseq/feature-table.biom \
 -o phyloseq/otu_table.tsv \
 --to-tsv
cd phyloseq
sed -i '1d' otu_table.tsv 
sed -i 's/#OTU ID//' otu_table.tsv 
cd ../

Export the representative sequences and tree files with the QIIME2 commands:

qiime tools export \
 --input-path merged_rep-seqs.qza \
 --output-path phyloseq qiime tools export \
 --input-path merged_unrooted-tree.qza \
 --output-path phyloseq
cd phyloseq
mv tree.nwk merged_unrooted_tree.nwk
cd ../

qiime tools export \
 --input-path merged_rooted-tree.qza \
 --output-path phyloseq
cd phyloseq
mv tree.nwk rooted_tree.nwk

And finally classify the representative sequences with the RDP classifier. You will need to edit the path to classifier.jar to match your installation of the program.

java -Xmx4g -jar /mnt/research/rdp/public/RDPTools/classifier.jar classify -c 0.5 -f fixrank -g 16srrna -o classification_table.tsv dna-sequences.fasta