hdWGCNA icon indicating copy to clipboard operation
hdWGCNA copied to clipboard

Question about color of modules in volcano plots

Open DelongZHOU opened this issue 1 year ago • 6 comments

Hello,

I'm a bit confused about how color is used in the volcano plots vs in PlotKMEs and other plots

In some of my volcano plots all the modules retain their color, regardless if the pval of comparison; while other plots all modules are grey. Is there a meaningful difference in these two color regime?

Thank you!

DelongZHOU avatar Dec 13 '23 01:12 DelongZHOU

Hi,

Can you provide some more details, the code that you ran and the plots that were generated? What is the expected result vs the actual result etc.

smorabit avatar Dec 13 '23 18:12 smorabit

My script follows your basic tutorial and Differential module eigengene (DME) analysis. It first sets up the seurat object, then loop over the cell types with a function.

The codes I used to generate the volcano plot is as following:

group1 <- [email protected] %>% subset(subtype == celltype & condition == 'ctrl') %>% rownames group2 <- [email protected] %>% subset(subtype == celltype & condition == 'treatment') %>% rownames DMEs <- FindDMEs( seurat_obj, barcodes1 = group1, barcodes2 = group2, test.use='wilcox', wgcna_name='' ) p<-PlotDMEsVolcano( seurat_obj, DMEs, wgcna_name = 'project1' )

color no_color

but the figures generated in the basic tuto is colored code:

p <- PlotKMEs(seurat_obj, ncol=3) kme

DelongZHOU avatar Dec 14 '23 02:12 DelongZHOU

Looks like a bug to me, each point in the volcano plot should be colored based on the module's color. Can you reproduce this behavior with the tutorial dataset? I have not personally encountered this. There might be a problem with your code though, it looks like you didn't specify the same wgcna_name for both the FindDMEs function and the PlotDMEsVolcano function.

DMEs <- FindDMEs(
seurat_obj,
barcodes1 = group1,
barcodes2 = group2,
test.use='wilcox',
wgcna_name=''
)
p<-PlotDMEsVolcano(
seurat_obj,
DMEs,
wgcna_name = 'project1'
)

smorabit avatar Dec 15 '23 18:12 smorabit

Hi Sam,

The wgcna name part is because I was trying to remove information relative to my project. The code I ran use the correct name.

For the tutorial dataset, the KME, lollipop and volcano plot are consistant: creation: https://smorabit.github.io/hdWGCNA/articles/basic_tutorial.html diff eigen: https://smorabit.github.io/hdWGCNA/articles/differential_MEs.html

tuto plotkme inh lollipop inh volcano

The lollipop and volcano plots are using the color from the KME plot.

A few minute issues I noticed: (1) in my case the M13 module is assigned very pale blue and is almost invisible (2) the wgcna is named "tutorial" in the creation but in the DME is a different name (3) same with the rds name (4) in the DME tutorial, right before you introduce the volcano plot, the spelling of the lollipop function contains a typo (should be uppercase L here) image

BTW can I assume no "real" module is assigned grey, i.e. once a module is created after the dendrogram it should get a color other than grey?

DelongZHOU avatar Jan 15 '24 22:01 DelongZHOU

@DelongZHOU FindDMEs() will create a new assay to reuse Seurat::FindMarkers(). In your case, L6_CT-M2 is illegal for Seurat(underscores ('_')), which cause PlotDMEsVolcano() receive wrong module names.

dyinboisry4u avatar Feb 22 '24 02:02 dyinboisry4u

@DelongZHOU FindDMEs() will create a new assay to reuse Seurat::FindMarkers(). In your case, L6_CT-M2 is illegal for Seurat(underscores ('_')), which cause PlotDMEsVolcano() receive wrong module names.

Heh this seems indeed to be the case. All my other modules with underscore in their name also failed to get the color while those without underscore are fine.

DelongZHOU avatar Mar 05 '24 16:03 DelongZHOU