How can I obtain the percentage gene expression per identity class in Seurat as further processible numbers (e.g. matrix)? I am analysing my single cell RNA seq data with the Seurat package. I want to know if there is a possibilty to obtain the percentage expression of a list of genes per identity class, as actual numbers (e.g. a matrix) which I can write out to say an excel file. For example I want to be able to say gene X is expressed in 30% of cell A, 10% of cell B etc.

I can generate something comparable with:

DotPlot(object = my_object, genes.plot = "my_gene")


However the results are only graphic and I wish to have further processible numbers. 

Furthermore:

AverageExpression(object, genes.use = "my_gene")


Produces expression values which I cannot transform to percentages.

I will be very grateful on any hints.
This can be solved like this:

library(Seurat)

my_genes &lt;- c("gene1", "gene2", "gene3")

exp &lt;- FetchData(object, my_genes)

matrix &lt;- as.matrix(colMeans(exp  &gt; 0))*100