borenstein-lab / burrito

A visualization tool for exploratory data analysis of metagenomic data
https://elbo-spice.gs.washington.edu/shiny/burrito/
GNU General Public License v3.0
35 stars 9 forks source link

choose colors for each taxa/function? #31

Open Valentin-Bio-zz opened 1 year ago

Valentin-Bio-zz commented 1 year ago

Hello im working with a dataset of 300 metagenomic samples and I performed a functional analysis with picrust2. For getting a reasonable visualization with no white screen así discussed here: https://github.com/borenstein-lab/burrito/issues/26 I subset the picrust2 output tables to 50 samples per each condition (asthmatic patients vs healthy patient vs rhinitis patients) and I used burrito to get the functional and taxonomic plots.

The problem is that the same taxa are displayed in different colors along my 3 burrito runs (1 run per each above mentioned condition). For example in the healthy patients, Proteobacteria is shown in red on the bar plot. but in the other conditions the color changes.

The same happens with the color assignation for the functional abundance plots. This is important for a better comparison along my 3 conditions so is there a way to make burrito assign the same color for each taxa/function ?

engal commented 1 year ago

Can you share some of the burrito output figures or screen shots of the results for a few of your different subsets?

engal commented 1 year ago

If you don't want to show the full data, then just showing the taxonomic tree and function tree would be sufficient. You don't need to include the relative abundance plots.

Valentin-Bio-zz commented 1 year ago

burrito_func_bar burrito_func_legend burrito_taxa_bar burrito_taxa_legend

This first 4 files are the plots for the first condition

And here the last 4 are of another condition:

burrito_func_bar-2 burrito_func_legend burrito_taxa_bar-2 burrito_taxa_legend

As you can see, there are different colors for the same taxa in the different output files. Is there a way to maintain the same color for a respective taxa/function?

Thanks for your time :)

engal commented 1 year ago

Ah, the issue is probably due to there being different sets of taxa/functions with non-zero abundance in the different subsets of your data. If the exact same set of taxa/functions are present, I think the colors should match across different datasets.

Burrito was developed assuming that you would be visualizing the whole dataset at once, so the colors would automatically match. However, it seems like you're having issues running Burrito with your full dataset as mentioned in the other issue. I think the quickest fix at the moment would be to modify your data subsets by adding one or more samples from the other subsets at the end to make sure the same set of taxa/functions are present at non-zero abundance in each subset of the data. This should force Burrito to set the same set of colors for all taxa/functions across your different plots.

Valentin-Bio-zz commented 1 year ago

Understandable I will try that, thanks so much for your answer.

On the other hand, I have a question regarding the function plot. The displayed functions on the function bar plot displays a few number of the functions found on my dataset. The displayed functions are taken by the most abundant functions? If not , by which criteria burrito displays the functions in the plot ?