You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a seurat object comprising of my cells of interest in two different conditions – healthy and disease. I want to perfom Gene set enrichment analysis on the differentially expressed genes (DEGs) in one of my clusters.
However I want an appropriate background gene list to compare my DEGs. Using the whole genome isn’t relevant as many genes wont ever be expressed by my cell of interest therefore of course they are going to be underrepresented in my DEGs.
Wondered if I can make a “background gene list specific to my cell of interest” from my data i.e. I would like to pull out a list of all the genes expressed > 1 in my total Seurat object.
Is there an elegant way to do this?
<rownames(object)>
gives me a huge list of genes many of which are never expressed in my object
How do I obtain a list of genes that are expressed at least once?
The text was updated successfully, but these errors were encountered:
There is probably a better way to do this but this approach will tell you which genes are expressed in at least one cell in your subset.
dat <- subset(dat, subset = your_category == "your_value") #change to the name of your object and your subset rownames(dat@assays$RNA@counts)[rowSums(dat@assays$RNA@counts) > 1]#change dat to the name of your object, RNA to the name of your assay
dat@assays$RNA@counts returns the count matrix, rowSums takes the matrix and returns a vector of the sum of counts for each gene across all cells in the matrix (ie. the sum of each row as the name suggests), the >1 converts this vector to a logical vector which we then use to subset the rownames() vector.
I have a seurat object comprising of my cells of interest in two different conditions – healthy and disease. I want to perfom Gene set enrichment analysis on the differentially expressed genes (DEGs) in one of my clusters.
However I want an appropriate background gene list to compare my DEGs. Using the whole genome isn’t relevant as many genes wont ever be expressed by my cell of interest therefore of course they are going to be underrepresented in my DEGs.
Wondered if I can make a “background gene list specific to my cell of interest” from my data i.e. I would like to pull out a list of all the genes expressed > 1 in my total Seurat object.
Is there an elegant way to do this?
<rownames(object)>
gives me a huge list of genes many of which are never expressed in my object
How do I obtain a list of genes that are expressed at least once?
The text was updated successfully, but these errors were encountered: