Commit 6a2c1c1c authored by Lena Hersemann's avatar Lena Hersemann

corrected q-value scale for same limits

parent b06fad96
......@@ -15,6 +15,7 @@ Options:
--qcutoff <qcutoff> Use a q-value cutoff of 0.01 instead of a q-value cutoff [default: 0.01]
'
# commandArgs <- function(x) c("--overlay_expr_data", "../plot_score_matrix.txt", "../degs_by_contrast.txt", "contrast")
opts <- docopt(doc, commandArgs(TRUE)) ## does not work when spining
# opts <- docopt(doc, "--overlay_expr_data ../plot_score_matrix.txt ../degs_by_contrast.txt contrast" )
......@@ -301,6 +302,8 @@ erPlotData %<>% mutate(fixed_width_term = str_sub(Term, 1, 70) %>% str_pad(70))
## evaluate gene ratios strings into actual proportions
erPlotData %<>% mutate(gene_ratio = map_dbl(GeneRatio, ~ eval(parse(text = .x))))
qmin <- erPlotData$qvalue %>% na.omit() %>% min()
qmax <- erPlotData$qvalue %>% na.omit() %>% max()
term_barplot_files = erPlotData %>% do({
# DEBUG enrResultsGrp <- erPlotData %>% first_group()
enrResultsGrp <- .
......@@ -332,7 +335,7 @@ term_barplot_files = erPlotData %>% do({
# ggplot(aes(fixed_width_term, Count)) +
geom_point(pch=21) +
scale_color_manual(values = term_category_colors, drop = F, name = "Ontology") +
scale_fill_gradient(low="red", high="white", name = "q-value", limits = c(min(erPlotData$qvalue), max(erPlotData$qvalue))) +
scale_fill_gradient(low="red", high="white", name = "q-value", limits = c(qmin, qmax)) +
coord_flip() +
# xlab("Enriched Terms") +
ggtitle(label)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment