Question: CellScatter function Seurat not working
gravatar for f.morgana
8 months ago by
f.morgana0 wrote:

Hi all,

I am trying to plot the average gene expression of two clusters within my single cell RNAseq data using the CellScatter function (Seurat). I followed the exact steps of the vignette, however my plot looks like a black square sheet of evenly distributed cells instead of a proper cell scatter. Here is the code:

#Calculate the average gene expression within clusters to plot

cluster.averages <- AverageExpression(thymus)
head(cluster.averages[["RNA"]][, 1:3])

#Return this information as a Seurat object (enables downstream plotting and analysis) First,replace spaces with underscores '_' so ggplot2 doesn't fail
orig.levels <- levels(thymus)
Idents(thymus) <- gsub(pattern = " ", replacement = "_", x = Idents(thymus))
orig.levels <- gsub(pattern = " ", replacement = "_", x = orig.levels)
levels(thymus) <- orig.levels
cluster.averages <- AverageExpression(thymus, return.seurat = TRUE)

#How can I plot the average expression of cluster 1 vs. cluster 2? Pass do.hover = T for an interactive plot to identify gene outliers
CellScatter(cluster.averages, cell1 = "1", cell2 = "2")

In my data I have three clusters named 1-3. I am trying to plot the average gene expression of cluster 1 against cluster 2. Any idea what I might have done wrong? I wanted to post an image of the plot I am now getting but not sure how to. Sorry, I am still quite new!

Many thanks in advance, Florencia

seurat cellscatter scrna-seq • 351 views
ADD COMMENTlink modified 8 months ago by ATpoint44k • written 8 months ago by f.morgana0

Can you post the output of head(cluster.averages[["RNA"]][, 1:3]) and cluster.averages?

ADD REPLYlink written 8 months ago by geek_y11k

Hi geek_y,

Of course:

> head(cluster.averages[["RNA"]][, 1:3])
6 x 3 sparse Matrix of class "dgCMatrix"
                 1           2          3
A1BG    0.14812722 0.178343100 0.12386361
A1CF    0.02273091 0.006427456 0.06277195
A2M-AS1 0.02273091 0.073081493 .         
AAAS    0.68124170 0.480231933 0.72484221
AACSP1  .          0.065723290 0.06052527
AACS    0.05213810 0.122433900 .  

> cluster.averages
An object of class Seurat 
12013 features across 3 samples within 1 assay 
Active assay: RNA (12013 features)

Hope this brings some clarification!

Kind regards, Florencia

ADD REPLYlink modified 8 months ago by geek_y11k • written 8 months ago by f.morgana0

I don't see any problem with the data format. Did you see clear clusters with tSNE or UMAP before taking the average of gene expression for each cluster ? Here is a guideline on how to add images in biostars.

ADD REPLYlink written 8 months ago by geek_y11k

Thank you for the link to the guideline for images, geek_y!

I indeed could distinguish clear clusters to my opinion (although I only had a little more than 300 cells).

Here's my attempt to posting images then:

this is what my tSNE looks like

this is what the cell scatter plot looks like

Many cheers again for your time, Florencia

ADD REPLYlink modified 8 months ago • written 8 months ago by f.morgana0
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 968 users visited in the last hour