jdekanter / CHETAH

scRNA-seq cell type identification
GNU Affero General Public License v3.0
42 stars 9 forks source link

seurat and 10x #13

Closed ibseq closed 3 years ago

ibseq commented 3 years ago

hi can this be used on 10x data processed using Seurat. if so, what input should be using? thanks ibseq

jdekanter commented 3 years ago

Hi!

Yes, the method generally works with 10X data, although 10X data is more sparse than other types of data, so in some 10X datasets, more cells are left Unassigned. To extract the data from the Seurat object simply do:

counts = seurat@assays$RNA@counts
input = SingleCellExperiment(assays = list(counts = counts),
                             reducedDims = SimpleList(UMAP = seurat@reductions$umap@cell.embeddings))

This should work for Seurat version >3.0, and you need to substitute seurat with the name of your seurat object. If you stored you data in something other than the standard RNA field, you need to change the RNA in line one to the custom field name. The same goes for UMAP, this should be changed if another dimensional reduction is used, e.g. tSNE Other than that, you can just follow the provided vignette.

Does this help?

Best, Jurrian

TiongSun commented 3 years ago

Alternatively, you can use as.SingleCellExperiments in Seurat

Convert Seurat to SingleCellExperiments

scrna.sce <- as.SingleCellExperiment(YourSeuratObject)

Load sample

counts_data <- assay(scrna.sce) tsne_data <- reducedDim(scrna.sce)[,1:2]

Load reference

load(file = "./CHETAH_TME_reference.Rdata") counts_ref <- assay(reference) celltypes_ref <- reference$celltypes

This works for me.

shengqh commented 3 years ago

Hi!

Yes, the method generally works with 10X data, although 10X data is more sparse than other types of data, so in some 10X datasets, more cells are left Unassigned. To extract the data from the Seurat object simply do:

counts = seurat@assays$RNA@counts
input = SingleCellExperiment(assays = list(counts = counts),
                             reducedDims = SimpleList(UMAP = seurat@reductions$umap@cell.embeddings))

This should work for Seurat version >3.0, and you need to substitute seurat with the name of your seurat object. If you stored you data in something other than the standard RNA field, you need to change the RNA in line one to the custom field name. The same goes for UMAP, this should be changed if another dimensional reduction is used, e.g. tSNE Other than that, you can just follow the provided vignette.

Does this help?

Best, Jurrian

I guess that the reference of CHETAH was generated with tSNE, should we use tSNE rather than UMAP? Is there any difference between using tSNE and UMAP?

jdekanter commented 3 years ago

Hi shengqh,

t-SNE and UMAP are algorithms that try to visually represent as much of the variance in a set of samples as possible in two dimensions. This is completely separated from what CHETAH does. t-SNE/UMAP plots can be used (e.g. with the DimPlot of Seurat, or the PlotCHETAH function in this package) to visualize the outcome of CHETAH. Whether you use t-SNE or UMAP will therefore not influence the results of CHETAH, but only the way the data (your cells) are visualized.

I hope that is clear. If you have more questions, please let me know.

shengqh commented 3 years ago

Hi shengqh,

t-SNE and UMAP are algorithms that try to visually represent as much of the variance in a set of samples as possible in two dimensions. This is completely separated from what CHETAH does. t-SNE/UMAP plots can be used (e.g. with the DimPlot of Seurat, or the PlotCHETAH function in this package) to visualize the outcome of CHETAH. Whether you use t-SNE or UMAP will therefore not influence the results of CHETAH, but only the way the data (your cells) are visualized.

I hope that is clear. If you have more questions, please let me know.

Thank you so much.