Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Other visualization types #39

Open
nbokulich opened this issue Oct 21, 2016 · 0 comments
Open

Other visualization types #39

nbokulich opened this issue Oct 21, 2016 · 0 comments

Comments

@nbokulich
Copy link
Member

nbokulich commented Oct 21, 2016

Improvement Description
Are there plans to add other taxonomy visualization types eventually? q2-taxa just has me so excited about interactive taxonomy plotting... and I have some ideas. First (and most of this issue request) is about heatmaps. Second is for collapsible/colorable/adjustable dendrograms.

Proposed Behavior
Adding other plotting types, especially heatmaps, would make q2-taxa useful for plotting other types of feature data, not just taxa. E.g., gene/transcript abundance, metabolome data, etc.

Heatmaps

I like to use taxonomy heatmaps a lot, but I usually make these in R and it takes a lot of tweaking to get things right, since the appearance depends largely on the data. The ability to interactively modify the plot — precisely what you are doing with the barplots — would be awesome.

Heatmaps are very useful, particularly for large numbers of samples and/or large numbers of taxa. Especially with the following features:

  1. show abundance by either relative abundance within sample (current norm in bar plots) or z-score by column (sample), row (taxa), or both. Row z-score results in seeing differences in taxon abundance for all taxa, both high- and low-abundance
  2. hierarchical clustering/dendrograms. Cluster samples by bray-curtis, unifrac, or other methods, and have option to show tree. Cluster taxa by co-occurrence or by phylogeny, with option to show tree. For both samples and taxa, it could be interesting (though perhaps not feasible) to employ collapsable trees in D3 to collapse groups/clades and have averages shown on the heatmap.
  3. Metadata color bars. These appear next to samples (usually instead of sample name labels) and are colored based on one or more metadata categories.

All of these features are illustrated in this heatmap from this article. Just imagine how much more beautiful it could be if it were made in qiime2.

So all in all, I can envision many useful features for heatmaps, many of which are common to barplots, many of which are unique to heatmaps:

  1. selectable and possibly customizable heatmap color gradients (including spectral)
  2. customizable metadata bar colors
  3. toggle to add/remove metadata bars
  4. sort samples by one or more metadata categories OR by tree
  5. toggle trees on/off
  6. sort taxa by tree, by co-occurrence, by name, or by max/min/mean relative abundance
  7. Add/remove grid lines (separating samples/taxa)
  8. toggle sample and taxa labels on/off. Make labels customizable and allow labeling by sample metadata and taxonomy metadata (e.g., just show genus, phylum, etc).
  9. taxonomy metadata bars? Akin to sample metadata but, e.g., color by phylum or other taxonomic level.
  10. Set abundance filtration levels (e.g., to remove lower-abundance taxa from plot interactively).
  11. Select taxonomy abundance type (i.e., show z-scores by column, row, or both).
  12. customizable dendrograms (e.g., to adjust branch size by mean relative abundance across all samples) — exactly what I propose below as a stand-alone but why not combine with heatmaps into one awesome plot?

Dendrograms

Let's take another look at collapsable trees in D3. Enough could be done with the trees in heatmaps (or barplots — dendrograms could be linked to samples in barplots in the same way) that this could also be a stand-alone method — similar to topiary explorer but with additional features and generalized to cover other trees (e.g., of sample hierarchical trees). Basically, you would feed in a dendrogram/phylogeny and decorate it. Some ideas (all are meant to be interactively modified, of course):

  1. Collapsible at each node
  2. Make node and leaf size/color a function of taxon abundance across all samples. OR color by clade.
  3. Adjust branch thickness/color by mean (or max) abundance of that taxon across all samples, OR by clade.
  4. Toggle node labeling by clade
  5. Customizable branch/node labels (double click and relabel).

Another idea: Allow dendrograms to show differences between metadata groups by splitting each node marker into x sub-nodes, where x == the number of groups in a given metadata category (selectable from drop-down menu) (this obviously only works for a very small number of groups). Sub-nodes size or color would be a function of abundance of that taxon/clade in that sample, color(or shape) would distinguish sub-node groups (e.g., "control = blue square; treatment = red circle").

Such trees could be added to barplots (for samples) or heatmaps (for samples and/or taxa), but could also appear as stand-alone figures, especially if implementing the idea to show "sub-nodes" for metadata groups.

Comments
Hope I didn't just go way off topic. Anyway, I don't think I did — both of these are ways to represent taxonomic information in new ways, using (mostly) the same inputs as required for barplots.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants