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
339 stars 22 forks source link

How to use MiloR after subsetting the cell types from total cell types? #337

Closed mainharryHR closed 2 months ago

mainharryHR commented 3 months ago

Dear MiloR team,

Thanks for the nice packages. Recently, I am thinking how to use MilorR properly after subsetting the cell types from total cell types. In my case, whole T cells are expanding proportionally out of stromal cells and epitheliums in disease conditions. After subsetting the T cells for detailed annotations and analysis, there is no significant expanding in disease conditions any more. I am wondering how to use MiloR to analyse the cell abundances after subsetting the cells from total cell populations by accommodating the cell compositions before subsetting.

I am wondering if there is parameter we could adjust in order to accommodate the information from previous layer (whole tissue data). For example, we observe T cells are expanding 1.5 times out of total cells.

I am not sure I describe my questions clearly.

Thank you very much.

Best,

MikeDMorgan commented 3 months ago

Hi @mainharryHR - the main issue here isn't to do with Milo. If the total T cell population is expanding relative to the stromal cells then when you subset to just the T cells you have removed the major difference, and it's just a difference in total number of cells (which is a normalising factor in the NB-GLM). Using Milo2.0 from Bioc 3.19, you can pass an explicit cell.sizes argument to testNhoods which is a vector of the number of cells for each sample in your model. So if you use the total number of cells for each sample then you might observe some differences - but that is not a guarantee.

mainharryHR commented 3 months ago

Thank you very much for great suggestions. It works. I input the total cell number per sample by using cell.sizes . I am not sure how to interpret the data correctly in the attached pictures. After detailed annotations, I still can see some populations are significantly increased and decreased at the same time, indicating the mixed populations. I do not think there are interesting sub populations in my data. I adjusted different prop = 0.1, I still see the similar results. Any comments? Here is the current "alpha = 0.1"

Many thanks.

Screenshot 2024-06-20 at 17 45 02
MikeDMorgan commented 3 months ago

@mainharryHR - you're asking me to interpret your results. You've noted there are heterogeneous changes in your annotated populations, so that's now up to you to interpret.

mainharryHR commented 3 months ago

Thank you very much for confirming my guess. I appreciate your kind help! :)

Have a nice day!