Question: Looking for differential gene expression between treatment, within a specific cluster (seurat)
0
gravatar for cook.675
16 months ago by
cook.67560
cook.67560 wrote:

This one is driving me crazy. I have two data sets, a Vehicle and a Stimulated. These went through the work flow and were integrated as per the the following vignette: Satija lab:Integrating stimulated vs. control PBMC datasets

Everything works great, the data is great. I can find differentially expressed genes for each cluster, irrespective of treatment just fine.

But now I want to find the differentially expressed genes between treatments, within one cluster that I specify. And Im trying to do it in the following way, and I can't figure out why it doesn't work. Everytime the output is the same, no matter what value I enter for subset.ident. Heres an example. My data is in AllCells.combined

 Idents(AllCells.combined) <- AllCells.combined@meta.data$stim
 DefaultAssay(AllCells.combined) <- "RNA"
 immune.deg.cluster0 <- FindMarkers(AllCells.combined, ident.1 = "VEH", ident.2 = "IMQ", verbose = TRUE, subset.ident = "0" logfc.threshold = log(2))

This code works for cluster 0 (at least I think its cluster 0) But if i change subset.ident to 1, which I would want to think it would point to cluster 1, it gives me the exact same values as if I had subset 0

I tried using the group.by argument also to no avail.

Any ideas?

Thanks!

seurat • 2.8k views
ADD COMMENTlink modified 16 months ago • written 16 months ago by cook.67560
0
gravatar for jared.andrews07
16 months ago by
jared.andrews078.3k
Memphis, TN
jared.andrews078.3k wrote:

You're setting your Idents to your stimulation conditions, so it how would it subset by cluster? Leave your Idents set to the clusters, then use group.by and subset.ident to set your groups to compare.

I think something like the following is what you want:

Idents(AllCells.combined) <- AllCells.combined$seurat_clusters
DefaultAssay(AllCells.combined) <- "RNA"
immune.deg.cluster0 <- FindMarkers(AllCells.combined, ident.1 = "VEH", ident.2 = "IMQ", verbose = TRUE, group.by="stim", subset.ident = "1", logfc.threshold = log(2))
ADD COMMENTlink modified 16 months ago • written 16 months ago by jared.andrews078.3k

Thanks Jared I didnt see this before I posted my follow up ill give it a try....

So I just tried it with cluster 1 and it gives me this error:

>   Error in WhichCells.Seurat(object = x, cells = cells, idents = idents,  : Cannot find the following identities in the object: 1
ADD REPLYlink modified 16 months ago • written 16 months ago by cook.67560
0
gravatar for cook.675
16 months ago by
cook.67560
cook.67560 wrote:

So I run head(Idents(AllCells.combined)) and get this:

Veh2_AAACCTGAGATCCTGT Veh2_AAACCTGCAGTACACT Veh2_AAACCTGGTCCCTTGT Veh2_AAACCTGTCAAAGACA 
                  VEH                   VEH                   VEH                   VEH 
Veh2_AAACCTGTCGCCAGCA Veh2_AAACGGGAGAGTGACC 
                  VEH                   VEH 
Levels: VEH IMQ

So it looks like theres no cluster information there, which I think s why im having this problem. So the question is, how do I also get that data over to Idents() in order to use it?

If it helps, the cluster information is appended in meta.data in a column called seurat_clusters

ADD COMMENTlink modified 16 months ago • written 16 months ago by cook.67560

Please don't post comments as an answer, it makes it difficult for people to follow the conversation and muddies up the thread.

You can use Idents(AllCells.combined) <- AllCells.combined$seurat_clusters to set the clusters as the Idents.

ADD REPLYlink written 16 months ago by jared.andrews078.3k

sorry im new to this thanks for your input!

ADD REPLYlink written 16 months ago by cook.67560
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1543 users visited in the last hour
_