DataViz question for DEG and scRNA-seq
0
0
Entering edit mode
2.1 years ago
learner-MD ▴ 30

Maybe a dumb question, but I recently came across a single-cell paper that showed "volcano" plots for all clusters in one image by filtering for all genes that were FDR <0.05, the x-axis being represented by different colors characterizing different clusters, the y-axis with positive log2FC going up and negative log2FC going down, and the significant genes plotted that way with select ones labeled.

I really liked that visual representation but did not save the article and can't find it again! If anyone either knows that article or has an R script approach to making such a visualization, I'd appreciate it greatly. Thanks in advance!

visualization deg clusters • 643 views
ADD COMMENT
0
Entering edit mode

Can you describe it a bit more? Is it like a volcano plot with the coordinates flipped and different "compartments" for the different clusters? Something like this (with dots instead of lines)? interpretation of plot

ADD REPLY
1
Entering edit mode

Apologies for the delay and crude drawing, but was thinking something like the below (with all the plotted genes being FDR <0.05):

enter image description here

ADD REPLY
0
Entering edit mode

One way to hack something together would be to plot your p-adj value on the x axis and log2FC on the y then adjust the p-adj values by intervals of .1 depending on your cluster to shift them to the right. You could overlay geom_rect() on the plot to be within 0-.1 on the x-axis and -.5-.5 on the y-axis for your labels. I hope someone else chimes in because this doesn't seem like an elegant solution.

df <- tibble(padj = runif(300, min=0, max=.1),
         l2fc = runif(300, min=-3, max = 3),
         cluster = c(rep(1, times = 100), rep(2, times = 100), rep(3, times = 100)))
df %<>% mutate(xmin = case_when(cluster == 1 ~ 0,
                                cluster == 2 ~ .1,
                                cluster == 3 ~ .2,),
               xmax = case_when(cluster == 1 ~ .1,
                                cluster == 2 ~ .2,
                                cluster == 3 ~ .3),
               ymin = -0.5,
               ymax = 0.5,
               padj_new = case_when(cluster == 1 ~ padj,
                                    cluster == 2 ~ padj+.1,
                                    cluster == 3 ~ padj+.2))

  ggplot(df, aes(x = padj_new, y=l2fc, color = cluster))+
      geom_point()+
      geom_rect(aes(xmin = xmin, xmax = xmax, ymin = ymin, ymax = ymax, fill = cluster))+
      geom_text(aes(x = xmin + (xmax - xmin)/2, y = ymin + (ymax - ymin)/2, label = paste0("Cluster: ", cluster)), 
                size = 10, color = "#FFFFFF")+
      theme_classic()

enter image description here

ADD REPLY
0
Entering edit mode

Some personal changes: I would hide the entirety of the x-axis

  theme(axis.text.x = element_blank(),
        axis.line.x = element_blank(),
        axis.title.x = element_blank(),
        axis.ticks.x = element_blank())

I would also convert df$cluster to character before plotting. enter image description here

ADD REPLY

Login before adding your answer.

Traffic: 2984 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6