comparison 02_ma_plot.Rmd @ 1:32210899a3dd draft

planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
author mingchen0919
date Sun, 30 Dec 2018 12:45:56 -0500
parents
children
comparison
equal deleted inserted replaced
0:6f94b4b9de44 1:32210899a3dd
1 ---
2 title: 'MA-plot'
3 output:
4 html_document:
5 highlight: pygments
6 ---
7
8 ```{r setup, include=FALSE, warning=FALSE, message=FALSE}
9 knitr::opts_chunk$set(error = TRUE, echo = FALSE)
10 ```
11
12
13 ```{r warning=FALSE}
14 log_fold_change = res$log2FoldChange
15 base_mean = res$baseMean
16 significant = res$padj
17 significant[significant < 0.1] = 'yes'
18 significant[significant != 'yes'] = 'no'
19
20 maplot_df = data.frame(log_fold_change, base_mean, significant)
21 maplot_df = maplot_df[!is.na(maplot_df$significant), ]
22 p = ggplot(data = maplot_df) +
23 geom_point(mapping = aes(log(base_mean), log_fold_change, color = significant),
24 size = 0.5) +
25 scale_color_manual(name = 'Significant',
26 values = c('no' = 'black', 'yes' = 'red'),
27 labels = c('No', 'Yes')) +
28 xlab('Log base mean') +
29 ylab('Log fold change') +
30 theme_classic()
31
32 plotly::ggplotly(p)
33 ```