... | ... |
@@ -51,8 +51,11 @@ importFrom(DESeq2,estimateSizeFactors) |
51 | 51 |
importFrom(DESeq2,normalizationFactors) |
52 | 52 |
importFrom(DESeq2,sizeFactors) |
53 | 53 |
importFrom(DESeq2,vst) |
54 |
+importFrom(DT,JS) |
|
54 | 55 |
importFrom(DT,dataTableOutput) |
55 | 56 |
importFrom(DT,datatable) |
57 |
+importFrom(DT,formatRound) |
|
58 |
+importFrom(DT,formatStyle) |
|
56 | 59 |
importFrom(DT,renderDataTable) |
57 | 60 |
importFrom(RColorBrewer,brewer.pal) |
58 | 61 |
importFrom(S4Vectors,mcols) |
... | ... |
@@ -16,7 +16,8 @@ |
16 | 16 |
#' @importFrom dendextend branches_attr_by_clusters set |
17 | 17 |
#' @importFrom DESeq2 vst counts estimateSizeFactors normalizationFactors sizeFactors |
18 | 18 |
#' @importFrom dplyr arrange desc group_by mutate pull "%>%" |
19 |
-#' @importFrom DT datatable dataTableOutput renderDataTable |
|
19 |
+#' @importFrom DT datatable dataTableOutput renderDataTable formatRound |
|
20 |
+#' formatStyle JS |
|
20 | 21 |
#' @importFrom dynamicTreeCut cutreeDynamic |
21 | 22 |
#' @importFrom ggforce geom_sina |
22 | 23 |
#' @import ggplot2 |
... | ... |
@@ -640,7 +640,7 @@ GeneTonic <- function(dds, |
640 | 640 |
formatRound(columns = c("log2FoldChange"), digits = 3) %>% |
641 | 641 |
formatStyle( |
642 | 642 |
"log2FoldChange", |
643 |
- background = styleColorBar_divergent(myde$log2FoldChange, |
|
643 |
+ background = styleColorBar_divergent(as.data.frame(res_de)$log2FoldChange, |
|
644 | 644 |
scales::alpha("navyblue", 0.4), |
645 | 645 |
scales::alpha("darkred", 0.4)), |
646 | 646 |
backgroundSize = "100% 90%", |
... | ... |
@@ -41,19 +41,21 @@ https://stackoverflow.com/questions/33521828/stylecolorbar-center-and-shift-left |
41 | 41 |
|
42 | 42 |
data(res_de_macrophage, package = "GeneTonic") |
43 | 43 |
res_df <- deseqresult2df(res_macrophage_IFNg_vs_naive) |
44 |
-DT::datatable(res_df, |
|
45 |
- options = list( |
|
46 |
- columnDefs = list( |
|
47 |
- list(className = "dt-center", targets = "_all") |
|
48 |
- ) |
|
49 |
- ) |
|
44 |
+DT::datatable(res_df [1:50, ], |
|
45 |
+ options = list( |
|
46 |
+ pageLength = 25, |
|
47 |
+ columnDefs = list( |
|
48 |
+ list(className = "dt-center", targets = "_all") |
|
49 |
+ ) |
|
50 |
+ ) |
|
50 | 51 |
) \%>\% |
51 | 52 |
formatRound(columns = c("log2FoldChange"), digits = 3) \%>\% |
52 | 53 |
formatStyle( |
53 | 54 |
"log2FoldChange", |
54 |
- background = styleColorBar_divergent(myde$log2FoldChange, |
|
55 |
+ background = styleColorBar_divergent(res_df$log2FoldChange, |
|
55 | 56 |
scales::alpha("navyblue", 0.4), |
56 | 57 |
scales::alpha("darkred", 0.4)), |
58 |
+ backgroundSize = "100\% 90\%", |
|
57 | 59 |
backgroundRepeat = "no-repeat", |
58 | 60 |
backgroundPosition = "center" |
59 | 61 |
) |
... | ... |
@@ -64,13 +66,13 @@ simplest_df <- data.frame( |
64 | 66 |
value = c(-4, -3, -2, -1, 0, 1, 2, 3, 4) |
65 | 67 |
) |
66 | 68 |
|
67 |
- |
|
69 |
+# or with a very simple data frame |
|
68 | 70 |
DT::datatable(simplest_df) \%>\% |
69 | 71 |
formatStyle( |
70 | 72 |
'value', |
71 | 73 |
background = styleColorBar_divergent(simplest_df$value, |
72 | 74 |
scales::alpha("forestgreen", 0.4), |
73 |
- scales::alpha("darkred", 0.4)), |
|
75 |
+ scales::alpha("gold", 0.4)), |
|
74 | 76 |
backgroundSize = "100\% 90\%", |
75 | 77 |
backgroundRepeat = "no-repeat", |
76 | 78 |
backgroundPosition = "center" |