-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvennDiagram.DriverGenes.Visual.r
28 lines (22 loc) · 1.14 KB
/
vennDiagram.DriverGenes.Visual.r
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#' This function draws venn diagramm of overlapping driver genes, derived from Neighbourhoood Sampler, Hit-and-Run sampler and Metropolish-Hasting sampler
#'
#' @param x is dataframe, where the first, second and third columns belongs to alpha-values of drivers from Neighbourhoood Sampler, Hit-and-Run sampler and Metropolish-Hasting sampler
#'
#' @return a list; firt element is venn diagramm image, and the second one is setMap (with heatmap)
#' @export
#'
#' @examples
vennDiagram.DriverGenes.Visual <- function(x){
library(purrr)
library(RVenn)
library(ggplot2)
venn.dat = list("NS" = all %>% dplyr::filter(`From NS sampling` != '--') %>% dplyr::select(geneID) %>% unlist(use.names = F),
"HAR" = all %>% dplyr::filter(`From HAR sampling` != '--') %>% dplyr::select(geneID) %>% unlist(use.names = F),
"MH" = all %>% dplyr::filter(`From MH sampling` != '--') %>% dplyr::select(geneID) %>% unlist(use.names = F))
# construct the venn object
venn.obj = Venn(venn.dat)
p <-list(ggvenn(venn.obj, slice = c(1, 2, 3)),
setmap(venn.obj))
return(p)
}
vennDiagram.DriverGenes.Visual(x = all)[[1]]