-
Notifications
You must be signed in to change notification settings - Fork 20
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
Negative log counts values from registration_pseudobulk() #106
Comments
R version 4.3.2 Patched (2024-02-08 r85876) Matrix products: default locale: time zone: US/Eastern attached base packages: other attached packages: loaded via a namespace (and not attached): |
Thank you for developing this great package! @lahuuki and I discussed this issue and we wanted to get your input here. When I use the
registration_pseudobulk()
function on my own dataset and on the DLPFC dataset, I get a small percentage of values in the lognormalized pseudobulked matrix as negatives. Almost all of these values are 0 in the counts pseudobulked matrix. Is this behavior expected? I saw that theedgeR::cpm()
function uses an average pseudocount of 1, so there are likely some values less than 1.I bring this up for two reasons: 1) Are these negatives expected? If so, is this okay for running DE? 2) When visualizing the data, having negative logcounts values is hard to interpret. I would prefer to use the logcounts scale for visualization instead of the counts scale. My first solution would be to add a larger prior count, like 3, to prevent negatives while preserving the distribution of the data. Would you recommend this for the DE analysis as well?
spe <- spatialLIBD::fetch_data(type = "spatialDLPFC_Visium")
spe_pseudo <- registration_pseudobulk(spe, var_registration = "BayesSpace_harmony_09", var_sample_id = "sample_id" )
sum(logcounts(spe_pseudo)<0)
Which shows 170,257/3,276,300 values are negative.
The text was updated successfully, but these errors were encountered: