Feature Table Exports


I am using Qiime2 version 2019.7. I would like a TSV output of a table that looks like what I posted in the picture above and cannot seem to figure out how to get all those pieces of information (i.e. Feature Number, Sequence, Taxonomy, Total Feature Count, Sample Feature Counts) combined. I do not want to collapse my features into higher-level taxonomic rankings, even those features that correlate to the same species. I want to use this table as an easy way to BLAST a few sequences against NCBI, import data into R, etc.

I am already familiar with the biom file export, i.e.:

qiime tools export
--input-path file.qza
--output-path file

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

However, I want just a few pieces of information added to this output. Any help on how to get my desired output or multiple outputs that contain the same information would be great.


Hi @jsogin574,
Since you are familiar with working with biom convert, I assume you already know how to get the feature counts that constitute most of your table.

To get the sequence and taxonomy information, use this:

qiime metadata tabulate \
    --m-input-file sequences.qza \
    --m-input-file taxonomy.qza \
    --o-visualization taxonomy.qzv

You can view that QZV in q2View and download the data as a TSV. Then merge with the biom table in R, or using biom add-metadata.

To get total feature count you could probably just sum the rows of the biom table after loading in R. You could also use qiime feature-table group to group all samples into one mega-sample (add a column to your sample metadata file that has the same value — “Total Feature Count” — for each sample and use that as the grouping column). Then add that grouped feature table as an additional input file to the tabulate command I provided above, and it will be included in that output.

Good luck!

@Nicholas_Bokulich I have successfully added my metadata to the BIOM file and been able to export one of the metadata columns using biom add-metadata. Is there a way to add multiple metadata columns (i.e. using the --header-key option) to the exported biom table? I want to keep using biom because my feature tables are somewhat filtered and BIOM will only add metadata that correlates to features in the biom table.

I know a workaround to this is to use non-hashed names when OTU calling (thereby using the sequence as my OTUID/‘feature name’) and add taxonomy as metadata. However, is there is a drawback to doing this other than long character strings as my OTU names?

I am not sure — you should check out the biom-format documentation. At the very worst, you can just use add-metadata multiple times and toss the intermediate files.

the feature IDs can be hashed or not — you just need to make sure the feature IDs are the same in your table and in your feature metadata.

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