I am trying to create a table with the abundances (or relative abundances) of taxa at different taxonomic levels (phylum, family, genus) from my feature table, where the abundances are given not by sample, rather by a category from my metadata file, for example by Sample type. Is this possible or do I need to do it manually summing up the abundances of each sample for that category?
I know that I can use qiime taxa collapse first to collapse at the level I want, but then I don't know what to do.
A question related to this one is: do you advise to present in a publication the taxonomic barplots and the type of tables I would like to generate which are built from the rarefied feature table or from the complete table?
Hi @thermokarst,
thank you for your answer. Great! it worked with that command.
So I first collapse my table at the taxonomic level I am interested, then use "feature-table group" (options: --p-axis sample --m-metadata-file metadata.tsv --m-metadata-column Sampletype --p-mode sum) and then I am able to export the table I wanted.
Now, I tried to create an abundance heatmap from that grouped table in order to have the sample type instead of the samples on one axis. I used the following command:
qiime feature-table heatmap
--i-table table_collapsed_bysampletype.qza
--m-metadata-file metadata.tsv
--m-metadata-column Sampletype --p-normalize --p-metric braycurtis
--p-cluster features --o-visualization table_collapsed_bysampletype_heatmap.qzv
It gives me an error saying that "The following IDs are not present in the metadata:" listing the sample types of my metadata. What am I doing wrong?
Thank you @thermokarst! I think I have got it. I simply solved it by using the command qiime feature-table heatmap without the –m-metadata-file and –m-metadata-column options.
Sorry to bother you with another question about this topic. I tried to generate a heatmap based on relative frequencies (so I collapsed the table at the level I wanted, then converted to relative frequencies and then used qiime feature-table heatmap). I get the following error:
"Argument to parameter 'table' is not a subtype of FeatureTable[Frequency]"
Is it possible to do what I am trying or the heatmap command already automatically convert itself into relative frequencies?
Oh c'mon, no need to apologize - that is what we are here for!
This viz is designed to accept a FeatureTable[Frequency] Artifact, not FeatureTable[RelativeFrequency]. That is because the action provides its own normalization via the --p-normalize / --p-no-normalize parameters:
--p-normalize / --p-no-normalize
Normalize the feature table by adding a
psuedocount of 1 and then taking the log10
of the table. [default: True]
So if I am understanding you correctly, skip the conversion to FeatureTable[RelativeFrequency] after you collapse the table and just go straight to the heatmap.