How to record Seurat DE analysis efficiently?
2
0
Entering edit mode
21 months ago
Pratik ▴ 850

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

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

Ideally, I want to record this information like this:

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 • 770 views
1
Entering edit mode

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.

0
Entering edit mode

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!!

1
Entering edit mode

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.

0
Entering edit mode

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.

Thank you again!

1
Entering edit mode
21 months ago
Pratik ▴ 850

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!

3
Entering edit mode
21 months ago

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

0
Entering edit mode

Thank you. Okay. Let me do this.