Is there any way to change the colors of the bars in vega editor for ANCOMBC results? I have several of these graphs that have both "enriched" and "depleted" which are colored in blue and orange respectively (see photo below). This graph however, only has depleted taxa, but it's in blue. I'd like to make it consistent with the other graphs in terms of color scheme for clarity.
You will see 4 parameters: "field", "sort", "title" and "type". We will add another parameter called "scale", with two sub-parameters: "domain" and "range". Parameter "domain" will be a list containing the possible tags, ["depleted", "enriched"]. Parameter "type" will contain the colors for the tags, e.g. ["red", "green"] (you can use HTML codes too, like ["#ff00ef", "#00ff8b"])¹. My new code looks like this (I added lines 13-16):
¹ I just realized the order of the list matters regarding the plot legend. I assume switching the order of the lists (["enriched", "depleted"] and also switch colors) would result in the plot legend with the original order.
Yes, that would be another really useful way to proceed. In this regard, unfortunately qiime2R cannot read ANCOM-BC results (the format is not supported so only a list of internal files and provenance is imported). I opened a PR addressing this some months ago (thanks to your post I remembered that I need to lint the code I added):
In the meantime, you can always use these custom functions I coded that essentially do the same as the code I put in the PR:
Best,
Sergio
Edit: PR was accepted so you can use the last version of qiiime2R directly!