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: [email protected]$seurat_clusters But using FindMarkers (it says this groups don't exist)

then I try to modify [email protected]

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([email protected]) = c(levels([email protected]), 5)
levels([email protected]$seurat_clusters) = c(levels([email protected]$seurat_clusters), 5)
# then modify them :
[email protected][which(row.names([email protected]) %in%  names_)] = 5
[email protected]$seurat_clusters[which(row.names([email protected]) %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 Answer 1

2
$\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, [email protected]$column_of_interest).

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

$\endgroup$
1
  • $\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.
    Commented Jan 16, 2020 at 8:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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