Skip to content
Snippets Groups Projects
Verified Commit cb6f4067 authored by Mia Croiset's avatar Mia Croiset
Browse files

Merge branch 'master' of gitbio.ens-lyon.fr:LBMC/hub/hic

parents 776f5128 de0ac1b8
No related branches found
No related tags found
No related merge requests found
library(tidyverse)
library(LaF)
#######################################
# #
# PLOTS ON NUMBER OF CONTACTS #
# #
#######################################
path_root = "/Users/laurent/projects/physbio/hic/results/"
count_contact <- function(x) {
read_log(x, col_names = F)$X5[1]
}
data <- tibble(
file = paste0(path_root, "/", list.files(path = path_root, pattern =".*matrix_sparse\\.log", recursive = T))
) %>%
mutate(
name = str_extract(file, ".*\\/(.*_.*_[^\\/]*)\\/", group = 1),
correction = map(name, function(x){str_split(x, "_")[[1]][2]}),
counts = map(file, count_contact)
) %>%
unnest(c(correction, counts)) %>%
mutate(
algorithm = ifelse(str_detect(correction, ".*cutsite.*"), "cutsite", ifelse(str_detect(correction, ".*parasplit.*"), "parasplit", NA)),
option = ifelse(str_detect(correction, ".*fr.*"), "forward-backward", ifelse(str_detect(correction, ".*cutsite.*"), "forward-backward", "all")),
option = ifelse(str_detect(correction, ".*seed0.*"), paste0(option, ", seed=0"), paste0(option, ", seed=20")),
name = paste(algorithm, option)
)
save(data, file = "number_of_contacts.Rdata")
ggplot(data, aes(x = reorder(name,counts), y = counts, color = algorithm, shape = option)) +
geom_point(size = 5) +
scale_y_log10() +
theme_bw() +
theme(axis.title.x=element_blank(),
axis.text.x=element_blank(),
axis.ticks.x=element_blank()) +
ggtitle("Number of contacts")
ggsave("number_of_contacts.pdf")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment