Comments (9)
from fantaxtic.
@gmteunisse thank you for the fast reply!
I saw the palette section, I was wondering if instead of using:
palette = c(Bacteroidetes = "red",
Proteobacteria = "blue"),
I can also use a personalized object like this or directly a command of RColorBrewer
colourCount1=length(get_taxa_unique(e1_sub, taxonomic.rank = "Genus"))
pal <- colorRampPalette(brewer.pal(12,"Paired"))(colourCount1))
plot_nested_bar(top_e1$ps_obj,
top_level = "Class",
nested_level = "Genus",
nested_merged_label = "NA and other <tax>",
palette= pal,
legend_title = "Phyla and genera")
to assign the colour to the nested_level? e.g. trying this, just a blue color appears in the plot.
If that is not possible, could I also provide a color code in hex, like this, when defining the palette with taxoun_colours()
?
pal3 <- taxon_colours(top_e1$ps_obj,
tax_level = "Phylum",
palette = c(Alphaproteobacteria = "#6d4c3d",
Campylobacterota = "#095256",
Gammaproteobacteria= "#ec7357"))
from fantaxtic.
from fantaxtic.
Yes, is working but is following the order of priority (I suppose) that RColorBrewer give in the adopted palette...moreover, I have a sample with really low diversity in terms of top_level. I'm plotting with class and genus. So, probably this makes the barplot not completely differentiated aesthetically as I had in mind.
Probably, a suitable alternative for me, could be to better define the plot with the advance usage settings. Can I group the genus less abundant then 5% and NA, make the nested legends and plot it using ggplot, right?
from fantaxtic.
from fantaxtic.
Indeed, this is what I mean with my second question: they are samples from enrichment (most of them), which makes the top level not diverse also at class level, which is my actual top level.
I can manage the colour to arrange it down to the order or family. I want to know if there is a way to have a significant control on the filtering level when choosing the top_taxa.
I'm working on that:
top_e1 <- top_taxa(e1_sub,
n_taxa = 10,
tax_level = "Genus",
grouping = "Sample_id")
If I want to drop all the taxa below a specific value (e.g. less than 10% abundant) and group these together using a label Less abundant < 10% or similar... is there a way to do that in fantaxtic? So, with more fine-tuned filtering.
from fantaxtic.
There’s no native support for that, but you can use some fantaxtic helper functions to do so. You would need to identify the taxon ids of the taxa that you want to merge; fantaxtic can do the rest. See this issue for a code example for merging:
#25
See this stackoverflow answer for an approach of identifying taxa by %: https://stackoverflow.com/questions/76631141/filter-phyloseq-to-use-in-fantaxtic
from fantaxtic.
Thank you for the reply and sorry for mine late one.
The second example is working perfectly; I have two additional questions to end that:
In your opinion, what is the difference between using max and sum? It probably is not really clear to me what max is doing.
The second question...plot_nested_bar is a ggplot object, so it can be treated equally. Can I modify the aesthetic parameters of the plot without modifying/losing the legend organization? on the way around, there is a way to reproduce the same legend organization in fantaxtic in a normal ggplot taxa plotbar?
from fantaxtic.
from fantaxtic.
Related Issues (20)
- Bold legend titles fails when changing theme HOT 1
- Change X axis order with fantaxtic_bar HOT 3
- plot_nested_bar: Specify colors for each bacterial order HOT 2
- Relative abundance with others HOT 1
- nested_top_taxa HOT 6
- How can I group samples by fixed effects on the x axis instead of the model? HOT 3
- a
- How to install fantaxtic package? HOT 1
- Working with a taxonomic subset? HOT 3
- Most abundant genera across a complete phyloseq object HOT 5
- Change legend text size HOT 1
- Sorting stacked barplot based on abundance values HOT 1
- Unable to install Fantaxtic HOT 2
- n_taxa = is not working for me HOT 2
- Names must be unique issue HOT 2
- {X} values required in clr.pal, {<X} provided HOT 4
- top_taxa not properly grouping samples according to the grouping parameter HOT 6
- name_na_taxa function is not assigning higher taxonomic rank to genus or higher rank HOT 4
- Need help with formatting plot HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fantaxtic.