How to make classic otu table with QIIME2?

Hi, i’ve been through the moving picture tutorial, and failed to find a way to build the classic otu table like this:
sample 1 sample2 sample3 sample4
OTU1 10000 5656 4442 3334
OTU2 9999 1232 11142 3214
OTU3 5998 4545 30340 2321
OTU4 3099 3432 3432 2323

I know that [OTU table] in qiime 1 is now [Feature frequency] in qiime2, but all i get is some statistic data (table.qzv), not the exact detailed OTU-sample relationship. how could i manage it? Thanks

2 Likes

Hi @puritan,

The table.qza which you would have used to create the table.qzv will contain the table you are looking for (though you might have to transpose it to the orientation you want. Can’t remember from the top of my head). You can see the exporting tutorial to see how you can export the biom version of this file. If you want the table in another format lets say a .tsv then you can use the biom convert option on the new .biom file.

biom convert -i table.biom -o table.tsv --to-tsv

Keep in mind that this feature table will have the sequence variant unique ID as its identifier and not taxonomy. If you want the taxonomic names instead you’ll have to do assign them before exporting which needs the taxonomy.qza artifact (if you’re following the moving pictures tutorial).

For this step you can use the qiime taxa collapse function:

qiime taxa collapse \
  --i-table table.qza \
  --i-taxonomy taxonomy.qza \
  --p-level 6 \ # or whatever level of taxonomy you want
  --output-dir taxtable/

Then you can follow the exporting directions as above.
Hope this helps!

7 Likes

Hi, pardon me for chiming (:unamused:) in like this, but it relates to something I was thinking about recently!

When you export the BIOM table from table.qza, you don’t get taxonomy, but you get ASV IDs. When you collapse taxa, you get taxonomy but lose the ASV IDs. So, when you’re looking through your rep seqs and BLASTing them, it’s not possible to ascertain the ASV ID that you’re interested in from taxonomy. This is something I do quite regularly, as a way of cross-referencing classifications.

The only way around this that I can discern is exporting the table.qza and taxonomy.qza and merging them via ‘biom add-metadata’. This gives you an OTU table with taxonomy, so you can find the taxon you’re interested in, find its ASV ID, and look for it in rep seqs. Perfect!

It would be great if we could come up with a shortcut that doesn’t require the user having to use the BIOM program. Perhaps ‘qiime feature-classifier classify-sklearn’ could sneak in an output BIOM table with taxonomy? I for one would find something like that useful. If rep seqs could find a way of reading the taxonomic output as well/instead, that would be amazing.

Thanks very much!
Peter

2 Likes

Hi @puritan & @peterleary, please take a look at this Community tutorial:

Thanks! :t_rex:

1 Like

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.