DE Analysis Between A Subset Seurat Object Versus Original Seurat Object
0
0
Entering edit mode
8 weeks ago
Zeddicus • 0

This is my first Biostars post and venture into R and seurat, so I apologize for the naivety of my question and if this has been answered elsewhere. It seems like this should be a common type of analysis question, but I have not been able to find out how to go about it via extensive Googling. Here are the steps I have taken and my question:

  1. Started with a complex tissue dataset which formed 11 low resolution clusters in the "original" seurat object.
  2. Subset the cells in "original" cluster-8 to form a separate "subset-1" seurat object containing 5 low resolution sub-clusters.
  3. Subset the cells in "subset-1" sub-cluster-1 to form a separate "subset-2" seurat object containing 6 high resolution sub-clusters.

How can I perform DE analysis of these "subset-2" sub-clusters compared to the rest of the "original" dataset?

Thanks in advance!

scRNA-seq seurat • 387 views
ADD COMMENT
0
Entering edit mode

You can add a column to the metadata of the original object and labelled the cells based on the subsets. In pseudocode: ifelse(rownames(meta.data) %in% cells_subset2,"cluster X","cluster Y").

ADD REPLY
0
Entering edit mode

Thanks for your response! I tried:

everything@meta.data$endothelial_subclusters <- ifelse(rownames(everything@meta.data) %in% colnames(endothelial_cells), "endothelial_1", "other")

But everything in the new "endothelial_subclusters" metadata column is labelled as "other" and nothing else

ADD REPLY
0
Entering edit mode

No worries, I got it to work this way:

Got cell names:

cellnames_all <- Cells(everything)
cellnames_ec <- Cells(endothelial_cells)

Created a vector of labels For cells in the endothelial subset, labelled them as "EC", for others label them as "Other"

labels <- ifelse(cellnames_all %in% cellnames_ec, "EC", "Other")

Added the labels as a new column to the metadata

everything_ec <- AddMetaData(everything, metadata = labels, col.name = "Labels")

Checked if the new column was added

head(everything_ec@meta.data, n = 2)

Checked to see if subset of original cells had the right number of labels

Idents(everything_ec) <- "Labels"

table(Idents(everything_ec))

Correct number of cells labelled with the "EC" label Can now do perform DE analysis

DefaultAssay(everything_ec) <- "RNA"

ec.vs.all.markers <- FindMarkers(everything_ec, ident.1 = "EC", ident.2 = "Other", logfc.threshold = 1, test.use = "roc", only.pos = TRUE)

Checked list of DE genes

head(ec.vs.all.markers, n = 20)

ADD REPLY

Login before adding your answer.

Traffic: 2276 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