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

How can I re-arrange my samples in a plot in prolfqua #81

Open
jjGG opened this issue Jun 21, 2024 · 1 comment
Open

How can I re-arrange my samples in a plot in prolfqua #81

jjGG opened this issue Jun 21, 2024 · 1 comment

Comments

@jjGG
Copy link
Collaborator

jjGG commented Jun 21, 2024

I have my lfqdata object generate the plotter from it and for example would like to generate the intensity_distribution.

lfqpl <- lfqdata_prot$get_Plotter()
lfqpl$intensity_distribution_violin()

image

or similar:

# get the stats
ss <- lfqdata_prot$get_Stats()
ss$violin()

image

How can I change the order of samples ..

btw: prolfqua rocks ;)

@wolski
Copy link
Collaborator

wolski commented Jun 24, 2024

Hi @jjGG,

you need to get the data.frame with the statistics using lfqdata$get_Stats()$stats().
The returned table is a tidy table compatible with the grammar of graphics of ggplot.

bb <- prolfqua::sim_lfq_data_peptide_config()
> xx <- lfqdata$get_Stats()$stats()
completing cases
completing cases
> xx$group_ <- factor(xx$group_, levels = c("Ctrl", "B", "A", "All"))
> xx |> ggplot(aes(x = group_, y = CV)) + geom_violin() + ggplot2::stat_summary(fun.y = median,
                                          geom = "point", size = 1, color = "black")

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

No branches or pull requests

2 participants