I have plotted my violin plots, but I am trying to find the mean and average expression at each of my time points.
Here is the code that I have used:
VlnPlot(spinalcord_neurons, features = c("Cx3cl1"), group.by= "time", pt.size = .5,) + theme (axis.text.x=element_text(angle=40, hjust=1)) + theme(legend.position = "right")
And here is the graph that I got:
I am new to using R and not familiar with all of the functions. Thank you for your help!
We can use some example data from the
SeuratData
package. Generally for comparing expression between classes, we use theRNA
assay (or if you have usedSCTransform
on your data, theSCT
assay)Seurat
makes it easy to generate results, but it can be tricky to make sure results are valid. Sorry for the long-winded answer.I assume by "mean and average expression" you want to get the mean expression of either your
counts
or normalized data (which may be in thedata
slot).This gave us these crazy high numbers, but from the documentation for
AverageExpression()
:This example dataset is not an integrated object with any sort of workflow done to normalize the data, so the
data
slot of theRNA
assay is currently just holding the counts, same as thecounts
slot. We can either return average expression of the counts, or ensure that thedata
slot is log-normalized. If it isn't already, you will want to ensure that your dataset is properly normalized, and integrated if need be.These vignettes from the Seurat website are extremely helpful and practically required reading if you want to get acquainted with single cell analysis.