... | ... |
@@ -22,5 +22,13 @@ A data.frame to be used in \code{ComplexUpset::upset()} |
22 | 22 |
Create a data frame that can be fed to the upset function |
23 | 23 |
} |
24 | 24 |
\examples{ |
25 |
-# TODO |
|
25 |
+# res_enrich object |
|
26 |
+data(res_enrich_macrophage, package = "GeneTonic") |
|
27 |
+res_enrich <- shake_topGOtableResult(topgoDE_macrophage_IFNg_vs_naive) |
|
28 |
+res_enrich <- get_aggrscores(res_enrich, res_de, anno_df) |
|
29 |
+ |
|
30 |
+create_upsetdata(res_enrich[1:20, ]) |
|
31 |
+dim(create_upsetdata(res_enrich[1:20, ])) |
|
32 |
+ |
|
33 |
+create_upsetdata(res_enrich[1:5, ], use_ids = TRUE) |
|
26 | 34 |
} |
... | ... |
@@ -6,7 +6,7 @@ |
6 | 6 |
\usage{ |
7 | 7 |
gs_upset( |
8 | 8 |
res_enrich, |
9 |
- res_de, |
|
9 |
+ res_de = NULL, |
|
10 | 10 |
annotation_obj = NULL, |
11 | 11 |
n_gs = 10, |
12 | 12 |
gtl = NULL, |
... | ... |
@@ -67,5 +67,53 @@ A \code{ggplot} object (if plotting), or alternatively a data.frame |
67 | 67 |
Create an upset plot for genesets |
68 | 68 |
} |
69 | 69 |
\examples{ |
70 |
-# TODO |
|
70 |
+library("macrophage") |
|
71 |
+library("DESeq2") |
|
72 |
+library("org.Hs.eg.db") |
|
73 |
+library("AnnotationDbi") |
|
74 |
+ |
|
75 |
+# dds object |
|
76 |
+data("gse", package = "macrophage") |
|
77 |
+dds_macrophage <- DESeqDataSet(gse, design = ~ line + condition) |
|
78 |
+rownames(dds_macrophage) <- substr(rownames(dds_macrophage), 1, 15) |
|
79 |
+dds_macrophage <- estimateSizeFactors(dds_macrophage) |
|
80 |
+ |
|
81 |
+# annotation object |
|
82 |
+anno_df <- data.frame( |
|
83 |
+ gene_id = rownames(dds_macrophage), |
|
84 |
+ gene_name = mapIds(org.Hs.eg.db, |
|
85 |
+ keys = rownames(dds_macrophage), |
|
86 |
+ column = "SYMBOL", |
|
87 |
+ keytype = "ENSEMBL" |
|
88 |
+ ), |
|
89 |
+ stringsAsFactors = FALSE, |
|
90 |
+ row.names = rownames(dds_macrophage) |
|
91 |
+) |
|
92 |
+ |
|
93 |
+# res object |
|
94 |
+data(res_de_macrophage, package = "GeneTonic") |
|
95 |
+res_de <- res_macrophage_IFNg_vs_naive |
|
96 |
+ |
|
97 |
+# res_enrich object |
|
98 |
+data(res_enrich_macrophage, package = "GeneTonic") |
|
99 |
+res_enrich <- shake_topGOtableResult(topgoDE_macrophage_IFNg_vs_naive) |
|
100 |
+res_enrich <- get_aggrscores(res_enrich, res_de, anno_df) |
|
101 |
+gs_upset(res_enrich, |
|
102 |
+ n_gs = 10) |
|
103 |
+ |
|
104 |
+gs_upset(res_enrich, res_de = res_de, annotation_obj = anno_df, |
|
105 |
+ n_gs = 8, |
|
106 |
+ add_de_direction = TRUE, add_de_gsgenes = TRUE) |
|
107 |
+ |
|
108 |
+# or using the practical gtl (GeneTonicList) |
|
109 |
+gtl_macrophage <- GeneTonic_list( |
|
110 |
+ dds = dds_macrophage, |
|
111 |
+ res_de = res_de, |
|
112 |
+ res_enrich = res_enrich, |
|
113 |
+ annotation_obj = anno_df |
|
114 |
+) |
|
115 |
+ |
|
116 |
+gs_upset(gtl = gtl_macrophage, |
|
117 |
+ n_gs = 15, |
|
118 |
+ add_de_direction = TRUE, add_de_gsgenes = TRUE) |
|
71 | 119 |
} |