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 am a little lost after essentially inheriting a scRNAseq pipeline, but I'd love to use this tool as an 'unbiased' annotation strategy. I'm looking for help as to how to apply this to my own seurat objects but don't quite understand the application of metadata well enough to do this on my own.
Any help parsing through this code would be really appreciated.
# Select genes of interest (using sample() here for demonstration purposes)gene.set<- sample(x= rownames(x=object@data), size=100, replace=FALSE)
# Get mean expression of genes of interest per cellmean.exp<- colMeans(x=object@data[gene.set, ], na.rm=TRUE)
# Add mean expression values in 'object@meta.data$gene.set.score'if (all(names(x=mean.exp) == rownames(x=object@meta.data))) {
cat("Cell names order match in 'mean.exp' and 'object@meta.data':\n",
"adding gene set mean expression values in 'object@meta.data$gene.set.score'")
object@meta.data$gene.set.score<-mean.exp
}
# Plot mean expression using Seurat::FeaturePlot()
FeaturePlot(object=object, features.plot="gene.set.score")
I'm not sure I can add much beyond what the comments already explain but basically, what this code chunk is doing is computing the per-cell mean for a set of genes and storing this as a cell-level meta.data entry. Those values are then being used by the FeaturePlot function to display these values in a scatter plot where cells are colored by gene set mean. Please feel free to update though if you have a more specific question.
Good day,
I am a little lost after essentially inheriting a scRNAseq pipeline, but I'd love to use this tool as an 'unbiased' annotation strategy. I'm looking for help as to how to apply this to my own seurat objects but don't quite understand the application of metadata well enough to do this on my own.
Any help parsing through this code would be really appreciated.
Originally posted by @leonfodoulian in #528 (comment)
The text was updated successfully, but these errors were encountered: