labsyspharm / mcmicro

Multiple-choice microscopy pipeline
https://mcmicro.org/
MIT License
98 stars 58 forks source link

Clarification on Cell-Type Assignment Process in NaiveStates: Role of Gaussian Mixture Models and Naive Bayes? #555

Closed ke2rchan closed 2 weeks ago

ke2rchan commented 2 weeks ago

Hello! Posting this issue to get a better understand behind how naivestates works!

I am not very knowledgable in the mathematical calculations used, but I am currently using naivestates for my automated cell type assignment. However, I was not able to find any detailed explanation on the naivestates github on how exactly this cell type assignment is done. Is it done using both Gaussian Mixture Models and Naive Bayes? It seems like it is not the cell type with the highest probability that gets assigned as seen below. ('Myeloid cell''s value has the highest value but the cell type assigned for cell ID-14 is still assigned as 'others'.) Would greatly appreciate any explanations as to how exactly the cell type assignment is done! :)

image
ke2rchan commented 2 weeks ago

also, for the UMAP generated by NaiveStates, what data or inputs are used to compute it?

ArtemSokolov commented 2 weeks ago

Hi @ke2rchan,

Yes, the method uses Gaussian Mixture Models to assign a probability that a marker is expressed in a given cell, then combines those probabilities using Naive Bayes based on the user-provided marker -> cell-type dictionary to derive the overall probability of each cell type. Take a look at the older version of README (before the tool was containerized) for some additional information.

There is a threshold that the probability must exceed for a cell type to be selected. In your example, there is only a 9% chance associated with Myeloid cells and 0% with everything else. That means that there is a 100 - 9 = 91% chance that the cell is something else, which is why the final label is "Other".

The UMAP produced by the tool is constructed using the probabilities derived from Gaussian Mixture Models as inputs.

ke2rchan commented 2 weeks ago

@ArtemSokolov I see! Thank you so much for your help and patience with me with all these questions! :)