<p>You have to define your <code>ident</code> 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-):</p>

<pre><code>pident=as.factor(clusters)
names(pident)=cellNames    
object1@ident=pident
</code></pre>

<p>Then you can run the <code>FindAllMarkers</code> function on this object:</p>

<pre><code>FindAllMarkers(object1, min.pct = 0.25, min.diff.pct = 0.25)
</code></pre>

CC BY-SA 4.0
2019-05-22T13:38:55.150Z
2019-05-22T13:38:55.150Z
jxx_fa
<p>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.</p>

<p>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.</p>

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

CC BY-SA 4.0
2019-05-20T09:39:06.387Z
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
CC BY-SA 4.0
2019-05-21T07:17:02.000Z
you posted [another question](https://bioinformatics.stackexchange.com/q/8659/48) 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
CC BY-SA 4.0
2019-05-21T13:30:29.653Z
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
CC BY-SA 4.0
2019-05-21T15:39:37.150Z
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
CC BY-SA 4.0
2019-05-22T09:39:08.683Z
I need to subset a certain set of barcodes that express a marker gene (in this case Olfm4).
Iro Pierides
CC BY-SA 4.0
2019-05-22T10:09:44.597Z
I need to subset a certain set of barcodes that express a marker gene. Olfm4.fetched<-FetchData(KRAS,vars='Olfm4') to fetch the barcodes and then to create a Seurat object I use Olfm4<-CraeteSeuratObject(Olfm4.fetched). But then I get errors:  Olfm4<-CreateSeuratObject(Olfm4.fetched)
Iro Pierides
<seurat>
How to set new identities for new clusters based on a gene expression in Seurat?
# How to set new identities for new clusters based on a gene expression in Seurat?

(Asked by: username_0 on 2019-05-20)

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).

**Tags:** seurat
> **Comments:**
> **username_1**: 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?  
> **username_1**: you posted [another question](https://bioinformatics.stackexchange.com/q/8659/48) 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).  
> **username_0**: 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.  
> **username_1**: 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).  
> **username_0**: I need to subset a certain set of barcodes that express a marker gene (in this case Olfm4).  
> **username_0**: I need to subset a certain set of barcodes that express a marker gene. Olfm4.fetched<-FetchData(KRAS,vars='Olfm4') to fetch the barcodes and then to create a Seurat object I use Olfm4<-CraeteSeuratObject(Olfm4.fetched). But then I get errors:  Olfm4<-CreateSeuratObject(Olfm4.fetched)  

---

## 1 answers

### Answer by username_2 on 2019-05-22. Score: 1

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)
names(pident)=cellNames    
object1@ident=pident

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


---

