Tangram icon indicating copy to clipboard operation
Tangram copied to clipboard

Cell type percentages per spot based on Tangram cell probabilities?

Open carloelle opened this issue 3 years ago • 1 comments

Hi,

from the matrix P(spatial spots X cells) I'd like to get the percentages for each cell type per spot. Starting from the probability matrix spatial spots X cells, I was thinking to proceed in this way:

  1. assign to each cell a known cell type
  2. calculate the median probability per cell type, obtaining the matrix spatial spot X cell type
  3. normalize each row value on the rowSum
  4. (optional) filter out values < 0.01 and rescale percentages similarly in (3)

Do you see any pitfalls in this methodology? Would you recommend any another strategies to calculate cell type percentages per spot? I observed that generalising on cell types starting from individual cell probabilities gives me slightly better predictions rather than calculating the probability for each cell type, but maybe it's data-dependent.

Best, Carlo

carloelle avatar Jun 21 '21 09:06 carloelle

Ciao Carlo,

In order to get the percentage of cell types per spot I would deconvolve. This means that you need to have prior information of how many cells you have per spot (eg via segmenting the corresponding H&E, if using Visium). You then need to deterministically assign the cells within the spot, then compute the percentage.

Alternatively, you can attempt the strategy you described although I am not entirely sure results will be consistent. Can you describe me in more detail how you want to do (1) and (3)?

Ciao,

lewlin avatar Jul 08 '21 23:07 lewlin