Tangram icon indicating copy to clipboard operation
Tangram copied to clipboard

Different celltype ratios of single cell data and spatial data

Open cuicathy opened this issue 2 years ago • 3 comments

Hi,

Thanks for sharing the Tangram. It is a very interesting work. I wonder can the tangram algorithm works well when the ratios of cell types of spatial data and single-cell data are different? For example, cell type A takes up 90% of spatial data, while takes up 10% of single-cell data. Although the "clustering" mode is provided for the data from different samples/tissues, do you still assume that the cell-type ratios of single-cell data and spatial data should be similar?

Look forward to your reply. Thank you very much!

Best, Cathy

cuicathy avatar May 02 '22 21:05 cuicathy

Yes it does work. Easy way to test, take some cells out from a cell type and remap. Also, you can map using cluster mode (which takes all cells of a certain cell types and compute the average, so you are actually mapping one cell per cell type).

lewlin avatar May 15 '22 00:05 lewlin

Thanks for your reply. I did a similar experiment (Copy all cells of modality M1 to M2. To simulate the ratio mismatch, cells of cell type A in the M1 modality were a subset of A in M2 by random reasmpling. Finally, cells were mapped from data modality M1 to M2). However, I got a very different mapping result of the original mapping without resampling and the mapping with resampling, either for the cell or cluster mode. Also, if I analyze this problem theoretically, I do not think I can get the same results either. Since the cells in M2 were copied from original M1, I know the ideal mapping matrix. Then, if I calculate the feature expression of M2 based on M1 with the ideal mapping matrix for the two mappings (resamped and original) separately, their cosine similarities in the loss function can be different. Based on the above, I think the ratio of celltypes may influence the mapping results. If I am wrong, please correct me. Thank you so much!

cuicathy avatar May 16 '22 09:05 cuicathy

That's interesting. I would love to see a figure to understand how much this matters.

Tangram look for a minimum of a loss function. If you change cell type ratio (aside from the fact that you are removing single cells, ie puzzle pieces, that could affect mapping quality), it should not change "too much" in the sense that the same minimum should still be there, given that a single cell can be used several times. However, it may be harder for Tangram to reach that minimum, and may converge on a different, less good one.

Cool!

lewlin avatar Jun 18 '22 17:06 lewlin