MarioniLab / miloR

R package implementation of Milo for testing for differential abundance in KNN graphs
https://bioconductor.org/packages/release/bioc/html/miloR.html
GNU General Public License v3.0
316 stars 20 forks source link

plotNhoodSizeHist not lining up with nhoodCounts #301

Closed LinearParadox closed 5 months ago

LinearParadox commented 5 months ago

When I run plotNhoodSizeHist(adata_milo) I get the following histogram, giving the smallest neighborhood as having less than 40 cells:

plot

However, when I run min(rowSums(nhoodCounts(adata_milo))) I get 54.

Is plotNhoodsize plotting something different than the actual counts for the neighborhood?

MikeDMorgan commented 5 months ago

Hi @LinearParadox without your processing code up until this point it's tricky to determine if this is a genuine bug or not. Please post your working code and output of sessionInfo(). Thanks.

LinearParadox commented 5 months ago

Thanks for your response! I think it's actually some weird R behavior. When I just manually add up a row, I get the right result, but rowSums seems to consistently give a greater result. Thank you again!