0
$\begingroup$

I am aware of this question Manually define clusters in Seurat and determine marker genes that is similar but I couldn't make tit work for my use case.

So I have a single cell experiments and the clustering id not great I have a small groups of 6 cells (I know it is extremely small, but nonetheless I would like to make the most of it) that are clearly isolate in UMAP and display marker that I am interresting in.

I managed to get those cells names in barcode (e.g.: AGCCAGCTCGCTTTAT).

I would like to compute differential expression of those cells against all others groups (using FindMarkers or FindAllMarkers).

I tried to manually define the cluster in: Seurat_obj@meta.data$seurat_clusters But using FindMarkers (it says this groups don't exist)

then I try to modify s_19270BC@active.ident

but then it could not found metadata attached to my newly define group.

I am kind of stuck and any help is warmly welcome

Code

My R is quite rusty...

names_ # a vector with the names of the cell I want as a cluster

# my seurat object have 5 cluster 0..4. So I want to add a 6th clusters with id 5

#First attempt manually modify the vector active.ident and cluster
# they are both factor so we need to add a factor level
levels(seurat_obj@active.ident) = c(levels(seurat_obj@active.ident), 5)
levels(seurat_obj@meta.data$seurat_clusters) = c(levels(seurat_obj@meta.data$seurat_clusters), 5)
# then modify them :
seurat_obj@active.ident[which(row.names(seurat_obj@meta.data) %in%  names_)] = 5
seurat_obj@meta.data$seurat_clusters[which(row.names(seurat_obj@meta.data) %in%  names_)] = 5

FindMarkers(s_19270BC, ident.1 = 5)
 

So This morning it works... I don't know what I have done yesterday...

EDIT: I added the Code I used

$\endgroup$
1
$\begingroup$

It would have been better if you have shared your code as well as the error messages you got format these as such.

As far as I can understand, your problem is that you failed to make your cluster as default ids. For this you can use:

seurat_obj <- SetIdent(seurat_obj, id=seurat_obj@meta.data$column_of_interest).

The cluster identities are stored in the @meta.data slot of your object.

| improve this answer | |
$\endgroup$
  • $\begingroup$ thank you for you answers, I don't know what I done yesterday, today it worked... do you know what I should do relative to the question? $\endgroup$ – RomainL. Jan 16 at 8:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.