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?
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):
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."
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
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 insetup_params(): !stat_count()must only have an x or y aesthetic. Runrlang::last_error()to see where the error occurred."I forgot the
stat='identity'in geom_barHi 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:
! 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. Runrlang::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: statstatis an argument togeom_bar, not toaes(move it outside the parenthesis)