This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to record Seurat DE analysis efficiently?

So Seurat can generate ViolinPlots that illustrate differential gene expression across clusters.

Example: Seurat DE What would be the best approach to record this data using automation/scripting?

Ideally, I want to record this information like this:

enter image description here

Where I could set some sort of threshold which results recording the cluster as X or TRUE? Or even better would be some sort of quantitative value?

I am familiar with basic R scripting, just not entirely sure where to begin with this!

Any help would be appreciated!

r rna-seq rna-seq

not sure if this helps here, probably not, but I usually present DE results as heatmaps (if you have many genes). The thing with violins is that they are only really illustrative if the median is above zero, meaning that at least 50% of cells need to have counts for that gene > 0 and this is (at least in 10X data) often not the case despite the gene was meaningful. Given the large dropout rate I find it often helpful for visualization to bin cells, e.g. average 10 cells that (along a trajectory per cluster) are adjacent. That helps denoising heatmaps.

Thank you for this ATPoint. I didn't know this. I'm going to play around with both now.

Question:

When you say:

binning cells eg. average 10 cells that (along a trajectory per cluster) are adjacent.

Do you mean doing something like this (in Seurat)?

DoHeatmap(subset(pbmc, downsample = 10), features = mygenesofinterest, size = 3)

I looked around and I'm thinking binning cells might be a functionality of Monocle or scanpy?

Or maybe I'm just speaking to my lack of understanding!!

I am not a Seurat user myself, I simply ordered the cells per cluster along the inferred trajectory using slingshot, and then used rowMeans to average cells adjacent in pseudotime (e.g. 10 cells). Not sure whether there are ready-made functions for this.

Oh, Okay. Thank you! I am thinking of playing around with trajectories at some point. Your approach definitely helped me gain additional exposure and understanding.

Definitely going to refer back here.

I don't think there are ready-made functions like this in Seurat.

Thank you again!

2 answers

Realized/found a solution!

Basically, I can use stacked violin plots as described in this post, which scanpy can do, but the Seurat version of it.

A: Seurat :Violin plot showing relative expression of select differentially express

This will be pretty much exactly what I need, if not, better.

And for further analysis of the specific clusters I am interested in. I'll subset the Seurat object, compile a list cluster-specific markers using FindMarkers, remove duplicates using dplyr's distinct() and then generate stacked ViolinPlots on the subsetted data.

Yay!

You can save the picture as a PDF. Or use rmarkdown to make a file which contains your script, some explanation, and your images.

Thank you. Okay. Let me do this.

Log in to answer this question.