ANOVA results viz from ssGSEA
1
0
Entering edit mode
14 months ago
piotto ▴ 20

Hi there

I did an ANOVA test for some enriched pathways resulting from ssGSEA. Now, I have some issues regarding the visualization of the results. Also, I am not sure how I can set a threshold to visualize only statistically significant results?

enter image description here

visualization ssGSEA anova • 1.1k views
ADD COMMENT
0
Entering edit mode
14 months ago
LChart 3.9k

If you sort by p.value you can head the dataframe to the desired number of bars; or use FDR to have a fixed threshold. Similarly you can make a barplot of pathway against log-pvalue or log-FDR; and potentially color by the significance of another group. Like this (not tested):

dat$fdr <- p.adjust(dat$p.value)
dat$fdr.EMT <- p.adjust(dat$EMT_like_cellsvCAF.pvalue)
dat$signif.EMT <- ifelse(dat$fdr.EMT < 0.05, 'EMTvsCAF-signif', 'NS')
dat$pathway <- rownames(dat)
dat <- dat[order(dat$p.value, decreasing=False),]
desired.num.bars <- 15
ggplot(dat[1:desired.num.bars,]) + geom_bar(aes(x=pathway, y=-log10(fdr), fill=signif.EMT), stat='identity')
ADD COMMENT
0
Entering edit mode

Thank you for your quick response LChart

I could follow the code. However, some problems I faced. For example, what is NS? it means non-significant? If so, I do not want to be this in the results. Also, I got an error when I was running the last code for ggplot:

"Error in geom_bar(): ! Problem while computing stat. ℹ Error occurred in the 1st layer. Caused by error in setup_params(): ! stat_count() must only have an x or y aesthetic. Run rlang::last_error() to see where the error occurred."

ADD REPLY
0
Entering edit mode

I forgot the stat='identity' in geom_bar

ADD REPLY
0
Entering edit mode

Hi LChart Thank you for your reply. SO, I did not see your response which is so weird. I added the stat = 'identity' into the geom_bar but still get the error:

ggplot(output[1:desired.num.bars,]) + geom_bar(aes(x=pathways, y=-log10(fdr),
                                               fill=signif.EMT,
                                               stat = 'identity'))



Error in `geom_bar()`:

! Problem while computing stat. ℹ Error occurred in the 1st layer. Caused by error in setup_params(): ! stat_count() must only have an x or y aesthetic. Run rlang::last_trace() to see where the error occurred. Warning message: In geom_bar(aes(x = pathways, y = -log10(fdr), fill = signif.EMT, : Ignoring unknown aesthetics: stat

ADD REPLY
0
Entering edit mode

stat is an argument to geom_bar, not to aes (move it outside the parenthesis)

ADD REPLY

Login before adding your answer.

Traffic: 3927 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