BayraktarLab / cell2location

Comprehensive mapping of tissue cell architecture via integrated single cell and spatial transcriptomics (cell2location model)
https://cell2location.readthedocs.io/en/latest/
Apache License 2.0
307 stars 57 forks source link

cell type annotation #296

Open wangjiawen2013 opened 1 year ago

wangjiawen2013 commented 1 year ago

Hi, I am a fan of cell2location!

It was said that " Although the emerging SRT technologies, such as MERFISH, Slide-seq and Stereo-seq, had achieved cell-level or subcellular spatial resolution, some deconvolution-based methods, e.g., Cell2location, can still support cell-type annotation at cell-level spatial resolution.", and " However, these integrated analysis methods also did not efficiently use the available spatial information.", which has been published on Nature Communications (Spatial-ID: a cell typing method for spatially resolved transcriptomics via transfer learning and spatial embedding).

But I cannot find the examples in cell2location's documentation, they're all on how to deconvolute cell types of the spots. Does cell2location support single cell-level annotation ? And does cell2location efficiently use the available spatial information which is challenged by Spatial-ID ?

vitkl commented 1 year ago

Does cell2location support single cell-level annotation

What is most likely meant is that you can apply cell2location to single-cell resolution spatial data (eg MERFISH) and use cell2location estimates to derive discrete cell labels.

use the available spatial information

Cell2location indeed doesn't use 2D/3D coordinates of locations to guide the estimation of cell abundance. However, during model development, we tried an approach similar to CARD method and observed that it doesn’t improve the accuracy on datasets reported in our paper.

Using 2D/3D coordinates of locations to guide the estimation of cell abundance could be more useful for Slide-seq and Stereo-seq. We are working on an extension that would enable this.

wangjiawen2013 commented 1 year ago

Yes, Cell2location can even add annotation at single-cell level ! I tried a toy data from scanpy tutorial (pbmc3k, https://scanpy-tutorials.readthedocs.io/en/latest/pbmc3k.html). I annotate the pbmc3k dataset with pbmc3k data itself, and here is the result: image

Fishball-zyw commented 1 year ago

Hi,

I've met a similar question to derive discrete cell labels.

Would you please share your code for this toy data. @wangjiawen2013

And are there any suggestions for giving discrete cell labels to single cell resolution spatial data. @vitkl

wangjiawen2013 commented 1 year ago

Hi, the code I used is essentially the code on cell2location documentation: https://cell2location.readthedocs.io/en/latest/notebooks/cell2location_tutorial.html with the following modifications:

  1. Replace the both the single cell reference data and 10x visium spatial data with pbmc single cell data (https://scanpy-tutorials.readthedocs.io/en/latest/pbmc3k.html)
  2. adapt the expected cell abundance N_cells_per_location =1 when creating and train the model mod = cell2location.models.Cell2location( adata_vis, cell_state_df=inf_aver, N_cells_per_location=1, detection_alpha=20 )
vitkl commented 1 year ago

I annotate the pbmc3k dataset with pbmc3k data itself, and here is the result

How do you derive "leiden predicted"?

In general, it is possible to apply the model to decomposition of scRNA data for various purposes such as transferring cell labels, and possibly identifying doublets - however, cell2location was not tested for this problem so I have not idea how well it works compared to eg scVI integration + weighted KNN majority voting.

Yes, Cell2location can even add annotation at single-cell level !

That you can apply cell2location to scRNA data does not mean that it adds the single cell-level annotation to the sequencing-based spatial data.

vitkl commented 1 year ago

giving discrete cell labels to single-cell resolution spatial data

@Fishball-zyw What do you mean by "single-cell resolution spatial data"?

Fishball-zyw commented 1 year ago

giving discrete cell labels to single-cell resolution spatial data

@Fishball-zyw What do you mean by "single-cell resolution spatial data"?

@vitkl

What I mean is spatial data from MERFISH or Stereo-seq and so on, which could achieve single-cell level "spot" through cell segmentation, rather than big spot (10 cells in a spot) from 10X.

For these single-cell resolution spatial data, it's important to get single cell level annotation, and that's my question about the output of cell2location: how to get the most accurate single cell level annotation for single-cell spatial data.

wangjiawen2013 commented 1 year ago

I annotate the pbmc3k dataset with pbmc3k data itself, and here is the result

How do you derive "leiden predicted"?

In general, it is possible to apply the model to decomposition of scRNA data for various purposes such as transferring cell labels, and possibly identifying doublets - however, cell2location was not tested for this problem so I have not idea how well it works compared to eg scVI integration + weighted KNN majority voting.

Yes, Cell2location can even add annotation at single-cell level !

That you can apply cell2location to scRNA data does not mean that it adds the single cell-level annotation to the sequencing-based spatial data.

I inferred gene expression of each cluster (leiden) of the pbmc single cell data using cell2location, then annotate the single cell data back again using these gene expression using cell2location. I named the result "leiden_predicted" by myself. I don't mean to add the single cell-level annotation to the sequencing-based spatial data, I mean cell2location can be used as a new cell type annotation tool, just like singleR, nothing related with spatial transcriptome in this use case.