Hey all!
I did a bit of research on this, and it turns out there’s an easier way!
I’m going to use the DADA2 1.4 Tutorial as a reference. In order to accomplish things like beta diversity analysis we’re going to need the sequence table (we call it a feature-table), and the sequences. In the tutorial, those can both be made from seqtab.nochim
which I will reference in a few places.
I’m also going to imagine we have a directory dada2-analysis/
which I’ll use in place of an actual filepath.
In your R session, you’ll want to run the following (replacing the particular filepaths):
write.table(t(seqtab.nochim), "dada2-analysis/seqtab-nochim.txt", sep="\t", row.names=TRUE, col.names=NA, quote=FALSE)
uniquesToFasta(seqtab.nochim, fout='dada2-analysis/rep-seqs.fna', ids=colnames(seqtab.nochim))
We can import that fasta file easily with:
qiime tools import \
--input-path dada2-analysis/rep-seqs.fna \
--type 'FeatureData[Sequence]' \
--output-path rep-seqs.qza
For the feature-table, there are two steps we have to do first:
Add a special header for BIOM:
echo -n "#OTU Table" | cat - dada2-analysis/seqtab-nochim.txt > dada2-analysis/biom-table.txt
Convert to BIOM v2.1:
biom convert -i dada2-analysis/biom-table.txt -o dada2-analysis/table.biom --table-type="OTU table" --to-hdf5
Now we can import that as well:
qiime tools import \
--input-path dada2-analysis/table.biom \
--type 'FeatureTable[Frequency]' \
--source-format BIOMV210Format \
--output-path table.qza
This should leave you with a rep-seqs.qza
and table.qza
that you can use (following along with the moving pictures tutorial).