Removing specific cluster based on one gene down regulation
1
0
Entering edit mode
18 months ago
nitin • 0

Hello,

I'm using seurat pipeline to analyze the single cell RNA-seq data. I m stuck with one problem I found two clusters with out gene A expression but this specific gene is expressed in all other clusters. It is important this gene it should be expressed so I would like to remove the two clusters which does not express it. But I use subset and invert = TRUE commands and recluster the data it changes original UMAP structure. Can any body suggest an other way to remove the clusters based on gene expression.

Thank you,
Ni

Single-cell Seurat scRNA-seq • 4.0k views
ADD COMMENT
0
Entering edit mode

using subset is a suitable method to remove cells in a given set of clusters. If you want to retain the original UMAP and clustering results then don't recluster.

ADD REPLY
0
Entering edit mode
18 months ago
Sasha ▴ 850

You can try the following approach to remove the clusters based on gene expression without changing the original UMAP structure. In this example, I'll use placeholder sample names and assume that you want to remove clusters 3 and 5 based on the expression of gene A.

  1. First, identify the cells in the clusters you want to remove:
    # Assuming your Seurat object is named 'seurat_obj'
    cells_to_remove <- WhichCells(seurat_obj, idents = c(3, 5))
    
  2. Next, create a new Seurat object without the cells from the clusters you want to remove:

    seurat_obj_filtered <- subset(seurat_obj, cells = setdiff(Cells(seurat_obj), cells_to_remove))
    
  3. Now, you can re-run the clustering and UMAP visualization on the filtered Seurat object:

# Find variable features
seurat_obj_filtered <- FindVariableFeatures(seurat_obj_filtered)

# Scale data
seurat_obj_filtered <- ScaleData(seurat_obj_filtered)

# Run PCA
seurat_obj_filtered <- RunPCA(seurat_obj_filtered)

# Run clustering
seurat_obj_filtered <- FindNeighbors(seurat_obj_filtered)
seurat_obj_filtered <- FindClusters(seurat_obj_filtered)

# Run UMAP
seurat_obj_filtered <- RunUMAP(seurat_obj_filtered, dims = 1:10)

# Visualize UMAP
DimPlot(seurat_obj_filtered, group.by = "ident")

This should give you a new UMAP plot with the unwanted clusters removed, while preserving the original UMAP structure for the remaining clusters.

I'm using my chatbot here (https://tinybio.cloud) to help generate this answer. You can download it from the website.

Good luck with your research!

ADD COMMENT

Login before adding your answer.

Traffic: 1931 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6