Import Dada2 ASV feature table and add taxonomy

Using Qiime2 (qiime2/2018.4 on hpc), I am trying to import a feature table with the ASV frequencies per sample that I created using Dada2 on R. I used the following code to import the table into a qza file:

qiime tools import
–input-path seqtab-from-txt.biom
–type ‘FeatureTable[Frequency]’
–source-format BIOMV100Format
–output-path asv-feature-table.qza

Then I attempted to use feature-classifier to match up the features with their taxonomic ID with the following:

qiime feature-classifier classify-sklearn --i-classifier /project/mwkelly/mguid73/fall2019OysterMicrobiome/silva-132-99-nb-classifier.qza --i-reads asv-feature-table.qza --o-classification filtered-taxonomy.dn.99.silva.qza

I received the error message:

Plugin error from feature-classifier: Argument to parameter ‘reads’ is not a subtype of FeatureData[Sequence].

I know that my feature table is not in the FeatureData[Sequence] format and is in FeatureTable[Frequency] format. Any suggestions for a work around or a better way to match my features to taxonomy?

Hi @megguidry,
Welcome to the forum!

The issue here is that you also need to import the ASVs sequences output by r-dada2 as a FeatureData[Sequence] artifact.

This will be a FASTA file of your sequences. The feature table does not contain the necessary information for classify-sklearn to operate!

Give that a try and let us know if it helps!

Good morning,

Just like you said, classify-sklearn needs a FeatureData[Sequence], which would be the sequences of the ASVs made by dada2. This should be something else you could export from R as an .fna file, then import as a FeatureData[Sequence] file.

No workarounds here. You have got to get the DNA sequences in order classify them. (But don’t worry because you can totally export them from R!) :dna:

Colin

EDIT: Whoops, sorry to double post. :2nd_place_medal:

1 Like

Thanks for your reply! This is how my table exported from Dada2 looks:
seqtab
Do you have any suggestions on how to upload this data as a FeatureData[Sequence] or how to get that format type out of R-Dada2?

1 Like

@megguidry,
You need to convert your dada2 ASV table to a fasta file containing the representative sequences.

@Mehrbod_Estaki provided the way to do this in R:

in the example below asvtab=DADA2 feature table

In R:
uniquesToFasta(asvtab, fout=‘rep-seqs.fna’,ids=colnames(asvtab))

then q2:
qiime tools import
–input-path rep-seqs.fna
–output-path rep-seqs.qza
–type “FeatureData[Sequence]”

Then rep-seqs.qza would be your input to classify-sklearn

1 Like