Commit 2152e712 authored by domingue's avatar domingue

Changes to replaced scripts with corescf

parent 1c80f0af
......@@ -114,13 +114,15 @@ dir.create("figure", showWarnings = FALSE)
# ==========================================================================
# Libraries and custom functions
# =========================================================================
devtools::source_url("https://raw.githubusercontent.com/holgerbrandl/datautils/v1.45/R/core_commons.R")
devtools::source_url("https://git.mpi-cbg.de/bioinfo/ngs_tools/raw/v11/common/cp_utils.R")
# devtools::source_url("https://raw.githubusercontent.com/holgerbrandl/datautils/v1.45/R/core_commons.R")
# devtools::source_url("https://git.mpi-cbg.de/bioinfo/ngs_tools/raw/v11/common/cp_utils.R")
library("corescf")
library("clusterProfiler")
library("msigdbr")
library("fgsea")
library("data.table")
set.seed(42)
load_all()
## not present in my version of the package
## taken from: https://rdrr.io/github/ctlab/fgsea/src/R/pathways.R
......@@ -171,7 +173,7 @@ if (category == "None" & is.na(extra_sets) & is.na(gmt_file)) {
#' Run configuration was:
vec_as_df(unlist(argv)) %>%
filter(!name %in% c("opts", "help", "")) %>%
kable()
knitr::kable()
resultsBase <- if (!is.na(out)) {
paste0(out, ".")
......@@ -194,7 +196,7 @@ gene_df <- read_tsv(de_file) %>%
ensembl_gene_id,
contrast = paste(condition_1, "vs", condition_2),
logfc = c1_over_c2_logfc,
padj,
padj = ifelse(padj == 0, 1e-314, padj),
rank_score = -log10(padj)
) %>%
mutate(rank_score = ifelse(logfc < 0, rank_score * -1, rank_score))
......@@ -211,7 +213,7 @@ eg %>%
group_by(contrast) %>%
summarize(non_mappable_prop = sum(is.na(entrez_gene_id)) / n()) %>%
dplyr::rename(`Non-mappable proportion` = non_mappable_prop) %>%
kable(digits = 2)
knitr::kable(digits = 2)
gene_df <- gene_df %>%
left_join(eg, by = c("ensembl_gene_id" = "ENSEMBL"))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment