Skip to content
Snippets Groups Projects
Commit 82ca6e3c authored by Alice Hugues's avatar Alice Hugues
Browse files

maj base scripts

parent f563b2fd
Branches
No related tags found
No related merge requests found
......@@ -7,13 +7,24 @@ labeller <- function(l, l_names = NULL, features){
}
if ( length(l) == 3 ){
label <- as.factor(ifelse(features %in% l[[1]], 'K4-only',
ifelse(features %in% l[[2]], 'Bivalent',
ifelse(features %in% l[[3]], 'K27-only', 'Unclass.'))))
label <- as.factor(ifelse(features %in% l[[1]], l_names[1],
ifelse(features %in% l[[2]], l_names[2],
ifelse(features %in% l[[3]], l_names[3], 'Unclass.'))))
} else if ( length(l) == 1 ) {
label <- factor(ifelse(features %in% l[[1]], 'K27', 'Unmarked'))
label <- factor(ifelse(features %in% l[[1]], l_names, 'Unmarked'))
}
names(label) <- features
return(label)
}
make_pal <- function(factor, pal = 'Set1'){
if ( length(unique(factor)) < 3 ){
cols <- brewer.pal(3, pal)[c(1,3)]
} else {
cols <- brewer.pal(length(unique(factor)), pal)
}
names(cols) <- unique(factor)
return(cols)
}
\ No newline at end of file
......@@ -50,3 +50,13 @@ root_tfs <- names(which(table(df$gene) == 3))
write.table(root_tfs,
file = sprintf('%s/root_tfs.txt', output.dir),
quote = FALSE, col.names = F, row.names = F)
# Pcg
all <- union(glist, root_genes)
df <- rbind(data.frame('gene' = K27_wr, 'set' = 'K27me3 (whole root)'),
data.frame('gene' = root_genes, 'set' = 'Root genes'),
data.frame('gene' = FIE, 'set' = 'FIE'),
data.frame('gene' = c(K27_genes, K27K4_genes), 'set' = 'K27me3 (WOX5)'))
v <- venneuler(df)
plot(v)
\ No newline at end of file
......@@ -12,6 +12,8 @@ library(tibble)
library(RColorBrewer)
library(venneuler)
source('src/00_base_functions.R')
# from calculus
working.dir <- "/projects/epichromdev/ahugues/scarabi_pcg_identity"
rds.path <- "data/list_seuObj.rds"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment