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

Make function density_plot to work smoothly with genes that have only zero read counts #20

Open
aghr opened this issue Jan 21, 2023 · 0 comments

Comments

@aghr
Copy link

aghr commented Jan 21, 2023

Dear Nebulosa developers,

Nice tool. I work with Nebulosa_1.8.0. One suggestion for improvement: If you run the function plot_density on a gene that has only zero counts, it currently throws a rather cryptic error and doesn't produce any plot:

Error in linbin2D.ks(x, gpoints[[1]], gpoints[[2]], w = w) :
NA/NaN/Inf in foreign function call (arg 10)
In addition: Warning message:
In ks.defaults(x = x, w = w, binned = binned, bgridsize = bgridsize, :
Weights don't sum to sample size - they have been scaled accordingly

Instead, the function could check the read counts and in case they are all zero generate a simple plot with all dots of color = zero counts omitting the density estimation in this case.

Background: I want to use Nebulosa in a script that runs automatically over genes and it may happen in a few cases that all their read counts are zero.

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

1 participant