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

Ridgeplot Draws Empty Rows #288

Open
DarioS opened this issue Aug 21, 2024 · 2 comments
Open

Ridgeplot Draws Empty Rows #288

DarioS opened this issue Aug 21, 2024 · 2 comments

Comments

@DarioS
Copy link

DarioS commented Aug 21, 2024

geom_density_ridges requires a minimum of three values. But, sometimes a core gene set has only two.

image

ridgeplot should automatically filter out such uninformative gene sets and not display them as blank rows.

> result[, c(1:6, 10:11)] # core gene set has only PLAU and APOE genes in it.
                   ID                     Description setSize enrichmentScore     NES
GO:0030193 GO:0030193 regulation of blood coagulation      10        0.695895 1.60145
GO:0050818 GO:0050818       regulation of coagulation      10        0.695895 1.60145
GO:1900046 GO:1900046        regulation of hemostasis      10        0.695895 1.60145
           pvalue                  leading_edge core_enrichment
GO:0030193  0.027 tags=20%, list=4%, signal=20%       PLAU/APOE
GO:0050818  0.027 tags=20%, list=4%, signal=20%       PLAU/APOE
GO:1900046  0.027 tags=20%, list=4%, signal=20%       PLAU/APOE
@GuangchuangYu
Copy link
Member

A reproducible example pls.

@DarioS
Copy link
Author

DarioS commented Sep 3, 2024

I show the core issue. I subset the dataset so Virginica has only two samples.

library(ggridges)
ggplot(iris[1:102, ], aes(x = Sepal.Length, y = Species)) + geom_density_ridges() # However, 1:103 is fine.

image

Claus Wilke replied:

If you don't have at least 20-50 points, density estimates are useless.

So, he doesn't think that ggridges should support drawing a row with two observations.

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