Giter Site home page Giter Site logo

Comments (8)

FelixErnst avatar FelixErnst commented on June 15, 2024 1

Should the issue be closed?

from miaviz.

antagomir avatar antagomir commented on June 15, 2024

You can do: plotAbundance(se, add_x_text=TRUE)

I have now added an example on function manpage in a forthcoming PR.

See help("mia-plot-args") for more options (mentioned in function manpage but yep, perhaps a bit difficult to find).

from miaviz.

asierFernandezP avatar asierFernandezP commented on June 15, 2024

Thank you! But is it also possible to display the group names (of the grouping variable that it is used in order_sample_by) instead of the individual sample names? Otherwise it is difficult to fit all the individual names in the plot.

from miaviz.

antagomir avatar antagomir commented on June 15, 2024

Do you something like

plotAbundance(se, features = "SampleType")

from miaviz.

asierFernandezP avatar asierFernandezP commented on June 15, 2024

Yes, but this does indeed generate another barplot for the groups, right? And I could then merge both together using wrap_plots. But I was trying to add only the group names (once for all the samples belonging to the same group) to the X axis of the abundance plots (as samples have already been ordered by groups) or add something that indicates the different groups of the samples without the need of adding this additional plot generated by features = "SampleType".

from miaviz.

antagomir avatar antagomir commented on June 15, 2024

Right. I am not sure if this is easily possible currently. It is rather complicated scenario to have in a general case, where the group sizes and numbers of groups can potentially vary a lot. Also not sure how good ggplot support there is to this feature. Ideally, this could utilize already existing ggplot techniques. If there are pointers, we could have a look.

from miaviz.

asierFernandezP avatar asierFernandezP commented on June 15, 2024

Yes, thank you very much! I guess this is a rather specific case.

from miaviz.

FelixErnst avatar FelixErnst commented on June 15, 2024

Can you provide a workable example descibing your case?

I think the easiest solution would be to create a temporary object and rename the colnames. SOmething like this;

tmp <- se
colnames(tmp) <- colData(tmp)$whatever
plotAbundance(se, add_x_text=TRUE)

Depending on your number of samples, this might look ok, but I would try to optimize the wrapping of the two objects. The example give in https://microbiome.github.io/miaViz/reference/plotAbundance.html

Can be tweaked using the patchwork functions. For example you can remove labels from the second object and print it 1/10th of hight of the first object. FOr more details have a look here https://patchwork.data-imaginist.com/

from miaviz.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.