# How to set new identities for new clusters based on a gene expression in Seurat?

I have a group of cells that have yellow (EYFP) expression and cells that don't. I want to define the yellow and non-yellow genes in two cell identities.

I clustered the cells and then created Violin Plot for EYFP expression. Then I did FindMarkers between clusters that express high EYFP with low EYFP expression. However, this is not a very accurate way to isolate cells of high and low EYFP expression. I need to use ident to separate EYFP +ve and EYFP -ve cells (but don't know the exact syntax). Then FindMarkers between these two new identities.

I need to subset a certain set of barcodes that express a marker gene (in this case Olfm4).

• Welcome to Bioinformatics! Could you please clarify what have you tried? This will help us to give a better answer to your question. Also, it seems like the text of the question is incomplete, what do you want to compare the yellow and non-yellow genes or something else? – llrs May 20 '19 at 9:39
• you posted another question that looks like this one but completed. You can edit your questions to improve them (and you can delete this question if you do not longer want it). – llrs May 21 '19 at 7:17
• I subseted a group of cells and then created a Seurat object out of the subsetted cells. I clustered the cells and then created Violin Plot for EYFP expression. Then I did FindMarkers between clusters that express high EYFP with low EYFP expression. However this is not a very accurate way to isolate cells of high and low EYFP expression. I need to use ident to separate EYFP +ve and EYFP -ve cells (but don't know the exact syntax). Then FindMarkers between these two new identities. – Iro Pierides May 21 '19 at 13:30
• Sorry, but can you edit your question to include this? What is your question? I don't understand what you are trying to do or what are you having problems with. If you need help with the syntax, please post your code (to know which specific problem you have with the syntax). – llrs May 21 '19 at 15:39
• I need to subset a certain set of barcodes that express a marker gene (in this case Olfm4). – Iro Pierides May 22 '19 at 9:39

You have to define your ident it has to have the structure of a table. You put the cell names as names and clusters as value (for instance cell 1 = YEPF+ cell 2 = YEFP-):
pident=as.factor(clusters)

Then you can run the FindAllMarkers function on this object:
FindAllMarkers(object1, min.pct = 0.25, min.diff.pct = 0.25)