Commit 87e61139 authored by Leon-Charles Tranchevent's avatar Leon-Charles Tranchevent
Browse files

Added back the support for Fisher enrichment.

parent 31f6e4e4
...@@ -353,177 +353,43 @@ for (m in seq_len(length(datasets))) { ...@@ -353,177 +353,43 @@ for (m in seq_len(length(datasets))) {
} # End for each dataset. } # End for each dataset.
rm(m) rm(m)
# Actual plotting of the selected genes (from the local configuration file). # Actual plotting of the selected genes.
##gene <- "DENR" common_datasets <- c("GSE20159", "GSE20163", "GSE20292", "GSE26927", "GSE49036", "GSE8397", "NBB")
##gene_datasets <- c("GSE20163", "GSE20292", "GSE26927", "GSE49036", "GSE8397", "Moreira", "NBB") top_genes <- c("H2AC6", "GDPD5", "POGK", "CA2", "SALL1", "SGSH", "CX3CL1", "CXCR4", "TMEM61",
#gene <- "ABCA8" "SOD2", "DENR", "TH", "NR4A2", "NELL2", "SDC1", "CBLN1", "VAV3", "LMO3",
#gene_datasets <- c("GSE20159", "GSE20163", "GSE20164", "GSE20292", "GSE26927", "GSE49036", "GSE8397", "NBB") "FAM189A1", "DYNC1LI1", "EFNA1", "NDUFA10", "MCM3AP", "IFITM2", "MAPK1",
#gene <- "NLRC5" "ID3", "ECE1", "GRHL3", "RGS2", "YBX3")
#gene_datasets <- c("ALL", "GSE20159", "GSE26927", "GSE49036", "NBB") for (gene in top_genes) {
#for (gene in config$genes_to_plot) {#} plotfilename <- paste0(output_data_dir, "SNage_VSN_PDVsControl_females_max-avg_", gene, ".png")
png(plotfilename)
plot_gene(gene = gene,
gene <- "XIST" gene_datasets = common_datasets,
gene_datasets <- c("GSE20159", "GSE20163", "GSE20292", "GSE26927", "GSE49036", "GSE8397", "NBB") output_data_dir = output_data_dir,
integration_name = integration$name,
plot_gene(gene = gene, limma_analysis = config$limma_analyses[[5]],
gene_datasets = gene_datasets, selection_name = selection$name,
output_data_dir = output_data_dir, palette = current_plt,
integration_name = integration$name, clin_data_all, exp_data_all, zexp_data_all, m_indx_map, config,
limma_analysis = config$limma_analyses[[5]], plot_all = FALSE, plot_datasets = TRUE)
selection_name = selection$name, dev.off()
palette = current_plt, plotfilename <- paste0(output_data_dir, "SNage_VSN_PDVsControl_males_max-avg_", gene, ".png")
clin_data_all, exp_data_all, zexp_data_all, m_indx_map, config, png(plotfilename)
plot_all = FALSE, plot_datasets = TRUE) plot_gene(gene = gene,
plot_gene(gene = gene, gene_datasets = common_datasets,
gene_datasets = gene_datasets, output_data_dir = output_data_dir,
output_data_dir = output_data_dir, integration_name = integration$name,
integration_name = integration$name, limma_analysis = config$limma_analyses[[6]],
limma_analysis = config$limma_analyses[[6]], selection_name = selection$name,
selection_name = selection$name, palette = current_plt,
palette = current_plt, clin_data_all, exp_data_all, zexp_data_all, m_indx_map, config,
clin_data_all, exp_data_all, zexp_data_all, m_indx_map, config, plot_all = FALSE, plot_datasets = TRUE)
plot_all = FALSE, plot_datasets = TRUE) dev.off()
plot_gene(gene = gene, rm(plotfilename)
gene_datasets = gene_datasets, message(paste0("[",gene, "] plotted."))
output_data_dir = output_data_dir, }
integration_name = integration$name, rm(gene, top_genes, common_datasets)
limma_analysis = config$limma_analyses[[7]],
selection_name = selection$name,
palette = current_plt,
clin_data_all, exp_data_all, zexp_data_all, m_indx_map, config,
plot_all = FALSE, plot_datasets = TRUE)
# FEMALE ANALYSIS
k <- 5
limma_analysis <- config$limma_analyses[[k]]
# gene <- "GRHL3"
# gene_datasets <- c("GSE26927", "GSE49036", "NBB")
# gene <- "SGSH"
# gene_datasets <- c("GSE20159", "GSE20163", "GSE20164", "GSE26927", "GSE49036", "GSE8397", "NBB")
# gene <- "CX3CL1"
# gene_datasets <- c("GSE20163", "GSE20164", "GSE26927", "GSE49036", "GSE8397", "NBB")
# gene <- "ABCA8"
# gene_datasets <- c("GSE20159", "GSE20163", "GSE20164", "GSE20292", "GSE26927", "GSE49036", "GSE8397", "NBB")
# gene <- "H2AC6"
# gene_datasets <- c("GSE20163", "GSE20164", "GSE20292", "GSE49036", "GSE8397")
# gene <- "TMEM61"
# gene_datasets <- c("GSE26927", "GSE49036", "NBB")
# gene <- "SOD2"
# gene_datasets <- c("GSE26927", "GSE49036", "NBB")
gene <- "CA2"
gene_datasets <- c("GSE20163", "GSE20164", "GSE20292", "GSE26927", "GSE49036", "GSE8397", "NBB")
plot_gene(gene = gene,
gene_datasets = gene_datasets,
output_data_dir = output_data_dir,
integration_name = integration$name,
limma_analysis = limma_analysis,
selection_name = selection$name,
palette = current_plt,
clin_data_all, exp_data_all, zexp_data_all, m_indx_map, config,
plot_all = FALSE, plot_datasets = TRUE)
#plot_all = TRUE, plot_datasets = FALSE)
gene_datasets <- c("GSE20292", "GSE8397", "GSE49036")
plot_gene(gene = gene,
gene_datasets = gene_datasets,
output_data_dir = output_data_dir,
integration_name = integration$name,
limma_analysis = limma_analysis,
selection_name = selection$name,
palette = current_plt,
clin_data_all, exp_data_all, zexp_data_all, m_indx_map, config,
plot_all = FALSE, plot_datasets = TRUE)
#plot_all = TRUE, plot_datasets = FALSE)
# MALE ANALYSIS
k <- 6
limma_analysis <- config$limma_analyses[[k]]
# gene <- "DENR"
# gene_datasets <- c("GSE20163", "GSE20292", "GSE26927", "GSE49036", "GSE8397", "Moreira", "NBB")
# gene <- "SDC1"
# gene_datasets <- c("GSE20163", "GSE20292", "GSE26927", "GSE49036", "GSE8397", "Moreira", "NBB")
# gene <- "LMO3"
# gene_datasets <- c("GSE20159", "GSE20163", "GSE20292", "GSE26927", "GSE49036", "GSE8397", "Moreira", "NBB")
# gene <- "CBLN1"
# gene_datasets <- c("GSE20163", "GSE20292", "GSE26927", "GSE49036", "GSE8397", "Moreira", "NBB")
# gene <- "SLITRK5"
# gene_datasets <- c("GSE20163", "GSE20292", "GSE26927", "GSE49036", "GSE8397", "Moreira", "NBB")
# gene <- "OSBPL10"
# gene_datasets <- c("GSE20159", "GSE20163", "GSE20292", "GSE26927", "GSE49036", "GSE8397", "Moreira", "NBB")
# gene <- "NELL2"
# gene_datasets <- c("GSE20159", "GSE20163", "GSE20292", "GSE26927", "GSE49036", "GSE8397", "Moreira", "NBB")
# gene <- "RAP1GDS1"
# gene_datasets <- c("GSE20159", "GSE20163", "GSE20292", "GSE26927", "GSE49036", "GSE8397", "Moreira", "NBB")
gene <- "NR4A2"
gene_datasets <- c("GSE20159", "GSE20163", "GSE20292", "GSE26927", "GSE49036", "GSE8397", "Moreira", "NBB")
plot_gene(gene = gene,
gene_datasets = gene_datasets,
output_data_dir = output_data_dir,
integration_name = integration$name,
limma_analysis = limma_analysis,
selection_name = selection$name,
palette = current_plt,
clin_data_all, exp_data_all, zexp_data_all, m_indx_map, config,
plot_all = FALSE, plot_datasets = TRUE)
#plot_all = TRUE, plot_datasets = FALSE)
gene_datasets <- c("GSE20292", "GSE8397", "GSE49036")
plot_gene(gene = gene,
gene_datasets = gene_datasets,
output_data_dir = output_data_dir,
integration_name = integration$name,
limma_analysis = limma_analysis,
selection_name = selection$name,
palette = current_plt,
clin_data_all, exp_data_all, zexp_data_all, m_indx_map, config,
plot_all = FALSE, plot_datasets = TRUE)
#plot_all = TRUE, plot_datasets = FALSE)
# GDS ANALYSIS
k <- 7
limma_analysis <- config$limma_analyses[[k]]
#gene <- "EFNA1"
#gene_datasets <- c("GSE20159", "GSE26927", "GSE49036", "GSE8397", "NBB")
#gene <- "TP53"
#gene_datasets <- c("GSE20163", "GSE20292", "GSE26927", "GSE49036", "GSE8397", "NBB")
#gene <- "CD93"
#gene_datasets <- c("GSE20159", "GSE20163", "GSE26927", "GSE49036", "GSE8397", "NBB")
gene <- "RFC5"
gene_datasets <- c("GSE20159", "GSE20163", "GSE20292", "GSE26927", "GSE49036", "GSE8397", "NBB")
gene <- "EFNA1"
gene_datasets <- c("GSE20159", "GSE26927", "GSE49036", "GSE8397", "NBB")
plot_gene(gene = gene,
gene_datasets = gene_datasets,
output_data_dir = output_data_dir,
integration_name = integration$name,
limma_analysis = limma_analysis,
selection_name = selection$name,
palette = current_plt,
clin_data_all, exp_data_all, zexp_data_all, m_indx_map, config,
plot_all = FALSE, plot_datasets = TRUE)
#plot_all = TRUE, plot_datasets = FALSE)
gene_datasets <- c("GSE49036", "NBB", "GSE26927")
plot_gene(gene = gene,
gene_datasets = gene_datasets,
output_data_dir = output_data_dir,
integration_name = integration$name,
limma_analysis = limma_analysis,
selection_name = selection$name,
palette = current_plt,
clin_data_all, exp_data_all, zexp_data_all, m_indx_map, config,
plot_all = FALSE, plot_datasets = TRUE)
#plot_all = TRUE, plot_datasets = FALSE)
rm(selection, exp_data_all, zexp_data_all, clin_data_all, m_indx, m_indx_map) rm(selection, exp_data_all, zexp_data_all, clin_data_all, m_indx, m_indx_map)
rm(l, limma_analysis, current_plt) rm(l, current_plt, vsn)
rm(k, vsn)
rm(j, integration, int_criteria) rm(j, integration, int_criteria)
rm(i, datasets) rm(i, datasets)
......
...@@ -190,12 +190,12 @@ for (i in seq_len(length(config$integrations))) { ...@@ -190,12 +190,12 @@ for (i in seq_len(length(config$integrations))) {
common_females_potGS <- merge(common_potGS, common_females_potGS <- merge(common_potGS,
spec_females %>% select(Gene, gender_specific_score), spec_females %>% select(Gene, gender_specific_score),
by = "Gene", all.x = TRUE) %>% by = "Gene", all.x = TRUE) %>%
filter(gender_specific_score >= specificity_threshold) %>% filter(gender_specific_score >= specificity_threshold) %>%
filter(abs(log_fold_change.F) >= abs(log_fold_change.M)) filter(abs(log_fold_change.F) >= abs(log_fold_change.M))
common_males_potGS <- merge(common_potGS, common_males_potGS <- merge(common_potGS,
spec_males %>% select(Gene, gender_specific_score), spec_males %>% select(Gene, gender_specific_score),
by = "Gene", all.x = TRUE) %>% by = "Gene", all.x = TRUE) %>%
filter(gender_specific_score >= specificity_threshold) %>% filter(gender_specific_score >= specificity_threshold) %>%
filter(abs(log_fold_change.M) >= abs(log_fold_change.F)) filter(abs(log_fold_change.M) >= abs(log_fold_change.F))
rm(common_potGS) rm(common_potGS)
...@@ -285,7 +285,7 @@ for (i in seq_len(length(config$integrations))) { ...@@ -285,7 +285,7 @@ for (i in seq_len(length(config$integrations))) {
"_", selection$name, "_all_pivalue_rankings.tsv") "_", selection$name, "_all_pivalue_rankings.tsv")
write.table(res_females %>% write.table(res_females %>%
mutate(ranking_value = pi_value) %>% mutate(ranking_value = pi_value) %>%
select(Gene, log_fold_change, P_value, pi_value, ranking_value) %>% select(Gene, log_fold_change, P_value, adj_P_value, pi_value, ranking_value) %>%
arrange(desc(ranking_value)), arrange(desc(ranking_value)),
res_females_fn, res_females_fn,
quote = FALSE, quote = FALSE,
...@@ -298,7 +298,7 @@ for (i in seq_len(length(config$integrations))) { ...@@ -298,7 +298,7 @@ for (i in seq_len(length(config$integrations))) {
"_", selection$name, "_all_pivalue_rankings.tsv") "_", selection$name, "_all_pivalue_rankings.tsv")
write.table(res_males %>% write.table(res_males %>%
mutate(ranking_value = pi_value) %>% mutate(ranking_value = pi_value) %>%
select(Gene, log_fold_change, P_value, pi_value, ranking_value) %>% select(Gene, log_fold_change, P_value, adj_P_value, pi_value, ranking_value) %>%
arrange(desc(ranking_value)), arrange(desc(ranking_value)),
res_males_fn, res_males_fn,
quote = FALSE, quote = FALSE,
...@@ -311,7 +311,7 @@ for (i in seq_len(length(config$integrations))) { ...@@ -311,7 +311,7 @@ for (i in seq_len(length(config$integrations))) {
limma_analysis <- config$limma_analyses[[k]] limma_analysis <- config$limma_analyses[[k]]
res_females_fn <- paste0(output_data_dir, integration$name, "_", vsn$name, "_", limma_analysis$name, res_females_fn <- paste0(output_data_dir, integration$name, "_", vsn$name, "_", limma_analysis$name,
"_", selection$name, "_all_gdrscore_rankings.tsv") "_", selection$name, "_all_gdrscore_rankings.tsv")
write.table(merge(res_females %>% select(Gene, log_fold_change, P_value, pi_value), write.table(merge(res_females %>% select(Gene, log_fold_change, P_value, adj_P_value, pi_value),
spec_females %>% mutate(ranking_value = gender_specific_score) %>% spec_females %>% mutate(ranking_value = gender_specific_score) %>%
select(Gene, ranking_value), select(Gene, ranking_value),
by = "Gene") %>% arrange(desc(ranking_value)), by = "Gene") %>% arrange(desc(ranking_value)),
...@@ -324,7 +324,7 @@ for (i in seq_len(length(config$integrations))) { ...@@ -324,7 +324,7 @@ for (i in seq_len(length(config$integrations))) {
limma_analysis <- config$limma_analyses[[k]] limma_analysis <- config$limma_analyses[[k]]
res_males_fn <- paste0(output_data_dir, integration$name, "_", vsn$name, "_", limma_analysis$name, res_males_fn <- paste0(output_data_dir, integration$name, "_", vsn$name, "_", limma_analysis$name,
"_", selection$name, "_all_gdrscore_rankings.tsv") "_", selection$name, "_all_gdrscore_rankings.tsv")
write.table(merge(res_males %>% select(Gene, log_fold_change, P_value, pi_value), write.table(merge(res_males %>% select(Gene, log_fold_change, P_value, adj_P_value, pi_value),
spec_males %>% mutate(ranking_value = gender_specific_score) %>% spec_males %>% mutate(ranking_value = gender_specific_score) %>%
select(Gene, ranking_value), select(Gene, ranking_value),
by = "Gene") %>% arrange(desc(ranking_value)), by = "Gene") %>% arrange(desc(ranking_value)),
...@@ -340,10 +340,10 @@ for (i in seq_len(length(config$integrations))) { ...@@ -340,10 +340,10 @@ for (i in seq_len(length(config$integrations))) {
res_females_fn <- paste0(output_data_dir, integration$name, "_", vsn$name, "_", limma_analysis$name, res_females_fn <- paste0(output_data_dir, integration$name, "_", vsn$name, "_", limma_analysis$name,
"_", selection$name, "_all_combinedscores_rankings.tsv") "_", selection$name, "_all_combinedscores_rankings.tsv")
n <- dim(res_females)[1] n <- dim(res_females)[1]
write.table(merge(res_females %>% select(Gene, log_fold_change, P_value, pi_value), write.table(merge(res_females %>% select(Gene, log_fold_change, P_value, adj_P_value, pi_value),
spec_females %>% select(Gene, gender_specific_score), spec_females %>% select(Gene, gender_specific_score),
by = "Gene") %>% mutate(ranking_value = ((rank(pi_value) / n) + (rank(gender_specific_score) / n))) %>% by = "Gene") %>% mutate(ranking_value = ((rank(pi_value) / n) + (rank(gender_specific_score) / n))) %>%
select(Gene, log_fold_change, P_value, pi_value, ranking_value) %>% select(Gene, log_fold_change, P_value, adj_P_value, pi_value, ranking_value) %>%
arrange(desc(ranking_value)), arrange(desc(ranking_value)),
res_females_fn, res_females_fn,
quote = FALSE, quote = FALSE,
...@@ -355,10 +355,10 @@ for (i in seq_len(length(config$integrations))) { ...@@ -355,10 +355,10 @@ for (i in seq_len(length(config$integrations))) {
res_males_fn <- paste0(output_data_dir, integration$name, "_", vsn$name, "_", limma_analysis$name, res_males_fn <- paste0(output_data_dir, integration$name, "_", vsn$name, "_", limma_analysis$name,
"_", selection$name, "_all_combinedscores_rankings.tsv") "_", selection$name, "_all_combinedscores_rankings.tsv")
n <- dim(res_males)[1] n <- dim(res_males)[1]
write.table(merge(res_males %>% select(Gene, log_fold_change, P_value, pi_value), write.table(merge(res_males %>% select(Gene, log_fold_change, P_value, adj_P_value, pi_value),
spec_males %>% select(Gene, gender_specific_score), spec_males %>% select(Gene, gender_specific_score),
by = "Gene") %>% mutate(ranking_value = ((rank(pi_value) / n) + (rank(gender_specific_score) / n))) %>% by = "Gene") %>% mutate(ranking_value = ((rank(pi_value) / n) + (rank(gender_specific_score) / n))) %>%
select(Gene, log_fold_change, P_value, pi_value, ranking_value) %>% select(Gene, log_fold_change, P_value, adj_P_value, pi_value, ranking_value) %>%
arrange(desc(ranking_value)), arrange(desc(ranking_value)),
res_males_fn, res_males_fn,
quote = FALSE, quote = FALSE,
...@@ -372,8 +372,8 @@ for (i in seq_len(length(config$integrations))) { ...@@ -372,8 +372,8 @@ for (i in seq_len(length(config$integrations))) {
res_females_fn <- paste0(output_data_dir, integration$name, "_", vsn$name, "_", limma_analysis$name, res_females_fn <- paste0(output_data_dir, integration$name, "_", vsn$name, "_", limma_analysis$name,
"_", selection$name, "_gs_pivalue_rankings.tsv") "_", selection$name, "_gs_pivalue_rankings.tsv")
write.table(GS_females %>% write.table(GS_females %>%
mutate(log_fold_change = log_fold_change.F, P_value = P_value.F, pi_value = pi_value.F) %>% mutate(log_fold_change = log_fold_change.F, P_value = P_value.F, adj_P_value = adj_P_value.F, pi_value = pi_value.F) %>%
select(Gene, log_fold_change, P_value, pi_value) %>% select(Gene, log_fold_change, P_value, adj_P_value, pi_value) %>%
mutate(ranking_value = pi_value) %>% mutate(ranking_value = pi_value) %>%
filter(!Gene %in% potGD$Gene) %>% filter(!Gene %in% potGD$Gene) %>%
arrange(desc(ranking_value)), arrange(desc(ranking_value)),
...@@ -387,8 +387,8 @@ for (i in seq_len(length(config$integrations))) { ...@@ -387,8 +387,8 @@ for (i in seq_len(length(config$integrations))) {
res_males_fn <- paste0(output_data_dir, integration$name, "_", vsn$name, "_", limma_analysis$name, res_males_fn <- paste0(output_data_dir, integration$name, "_", vsn$name, "_", limma_analysis$name,
"_", selection$name, "_gs_pivalue_rankings.tsv") "_", selection$name, "_gs_pivalue_rankings.tsv")
write.table(GS_males %>% write.table(GS_males %>%
mutate(log_fold_change = log_fold_change.M, P_value = P_value.M, pi_value = pi_value.M) %>% mutate(log_fold_change = log_fold_change.M, P_value = P_value.M, adj_P_value = adj_P_value.M, pi_value = pi_value.M) %>%
select(Gene, log_fold_change, P_value, pi_value) %>% select(Gene, log_fold_change, P_value, adj_P_value, pi_value) %>%
mutate(ranking_value = pi_value) %>% mutate(ranking_value = pi_value) %>%
filter(!Gene %in% potGD$Gene) %>% filter(!Gene %in% potGD$Gene) %>%
arrange(desc(ranking_value)), arrange(desc(ranking_value)),
...@@ -405,8 +405,8 @@ for (i in seq_len(length(config$integrations))) { ...@@ -405,8 +405,8 @@ for (i in seq_len(length(config$integrations))) {
res_females_fn <- paste0(output_data_dir, integration$name, "_", vsn$name, "_", limma_analysis$name, res_females_fn <- paste0(output_data_dir, integration$name, "_", vsn$name, "_", limma_analysis$name,
"_", selection$name, "_gs_gdrscore_rankings.tsv") "_", selection$name, "_gs_gdrscore_rankings.tsv")
write.table(merge(GS_females %>% write.table(merge(GS_females %>%
mutate(log_fold_change = log_fold_change.F, P_value = P_value.F, pi_value = pi_value.F) %>% mutate(log_fold_change = log_fold_change.F, P_value = P_value.F, adj_P_value = adj_P_value.F, pi_value = pi_value.F) %>%
select(Gene, log_fold_change, P_value, pi_value), select(Gene, log_fold_change, P_value, adj_P_value, pi_value),
spec_females %>% mutate(ranking_value = gender_specific_score) %>% spec_females %>% mutate(ranking_value = gender_specific_score) %>%
select(Gene, ranking_value), select(Gene, ranking_value),
by = "Gene") %>% by = "Gene") %>%
...@@ -422,8 +422,8 @@ for (i in seq_len(length(config$integrations))) { ...@@ -422,8 +422,8 @@ for (i in seq_len(length(config$integrations))) {
res_males_fn <- paste0(output_data_dir, integration$name, "_", vsn$name, "_", limma_analysis$name, res_males_fn <- paste0(output_data_dir, integration$name, "_", vsn$name, "_", limma_analysis$name,
"_", selection$name, "_gs_gdrscore_rankings.tsv") "_", selection$name, "_gs_gdrscore_rankings.tsv")
write.table(merge(GS_males %>% write.table(merge(GS_males %>%
mutate(log_fold_change = log_fold_change.M, P_value = P_value.M, pi_value = pi_value.M) %>% mutate(log_fold_change = log_fold_change.M, P_value = P_value.M, adj_P_value = adj_P_value.M, pi_value = pi_value.M) %>%
select(Gene, log_fold_change, P_value, pi_value), select(Gene, log_fold_change, P_value, adj_P_value, pi_value),
spec_males %>% mutate(ranking_value = gender_specific_score) %>% spec_males %>% mutate(ranking_value = gender_specific_score) %>%
select(Gene, ranking_value), select(Gene, ranking_value),
by = "Gene") %>% by = "Gene") %>%
...@@ -443,11 +443,11 @@ for (i in seq_len(length(config$integrations))) { ...@@ -443,11 +443,11 @@ for (i in seq_len(length(config$integrations))) {
"_", selection$name, "_gs_combinedscores_rankings.tsv") "_", selection$name, "_gs_combinedscores_rankings.tsv")
n <- dim(GS_females)[1] n <- dim(GS_females)[1]
write.table(merge(GS_females %>% write.table(merge(GS_females %>%
mutate(log_fold_change = log_fold_change.F, P_value = P_value.F, pi_value = pi_value.F) %>% mutate(log_fold_change = log_fold_change.F, P_value = P_value.F, adj_P_value = adj_P_value.F, pi_value = pi_value.F) %>%
select(Gene, log_fold_change, P_value, pi_value), select(Gene, log_fold_change, P_value, adj_P_value, pi_value),
spec_females %>% select(Gene, gender_specific_score), spec_females %>% select(Gene, gender_specific_score),
by = "Gene") %>% mutate(ranking_value = ((rank(pi_value) / n) + (rank(gender_specific_score) / n))) %>% by = "Gene") %>% mutate(ranking_value = ((rank(pi_value) / n) + (rank(gender_specific_score) / n))) %>%
select(Gene, log_fold_change, P_value, pi_value, ranking_value) %>% select(Gene, log_fold_change, P_value, adj_P_value, pi_value, ranking_value) %>%
filter(!Gene %in% potGD$Gene) %>% filter(!Gene %in% potGD$Gene) %>%
arrange(desc(ranking_value)), arrange(desc(ranking_value)),
res_females_fn, res_females_fn,
...@@ -461,11 +461,11 @@ for (i in seq_len(length(config$integrations))) { ...@@ -461,11 +461,11 @@ for (i in seq_len(length(config$integrations))) {
"_", selection$name, "_gs_combinedscores_rankings.tsv") "_", selection$name, "_gs_combinedscores_rankings.tsv")
n <- dim(GS_males)[1] n <- dim(GS_males)[1]
write.table(merge(GS_males %>% write.table(merge(GS_males %>%
mutate(log_fold_change = log_fold_change.M, P_value = P_value.M, pi_value = pi_value.M) %>% mutate(log_fold_change = log_fold_change.M, P_value = P_value.M, adj_P_value = adj_P_value.M, pi_value = pi_value.M) %>%
select(Gene, log_fold_change, P_value, pi_value), select(Gene, log_fold_change, P_value, adj_P_value, pi_value),
spec_males %>% select(Gene, gender_specific_score), spec_males %>% select(Gene, gender_specific_score),
by = "Gene") %>% mutate(ranking_value = ((rank(pi_value) / n) + (rank(gender_specific_score) / n))) %>% by = "Gene") %>% mutate(ranking_value = ((rank(pi_value) / n) + (rank(gender_specific_score) / n))) %>%
select(Gene, log_fold_change, P_value, pi_value, ranking_value) %>% select(Gene, log_fold_change, P_value, adj_P_value, pi_value, ranking_value) %>%
filter(!Gene %in% potGD$Gene) %>% filter(!Gene %in% potGD$Gene) %>%
arrange(desc(ranking_value)), arrange(desc(ranking_value)),
res_males_fn, res_males_fn,
...@@ -480,7 +480,7 @@ for (i in seq_len(length(config$integrations))) { ...@@ -480,7 +480,7 @@ for (i in seq_len(length(config$integrations))) {
res_females_fn <- paste0(output_data_dir, integration$name, "_", vsn$name, "_", limma_analysis$name, res_females_fn <- paste0(output_data_dir, integration$name, "_", vsn$name, "_", limma_analysis$name,
"_", selection$name, "_gd_pivalue_rankings.tsv") "_", selection$name, "_gd_pivalue_rankings.tsv")
write.table(res_females %>% write.table(res_females %>%
select(Gene, log_fold_change, P_value, pi_value) %>% select(Gene, log_fold_change, P_value, adj_P_value, pi_value) %>%
mutate(ranking_value = pi_value) %>% mutate(ranking_value = pi_value) %>%
filter(Gene %in% potGD$Gene) %>% filter(Gene %in% potGD$Gene) %>%
arrange(desc(ranking_value)), arrange(desc(ranking_value)),
...@@ -494,7 +494,7 @@ for (i in seq_len(length(config$integrations))) { ...@@ -494,7 +494,7 @@ for (i in seq_len(length(config$integrations))) {
res_males_fn <- paste0(output_data_dir, integration$name, "_", vsn$name, "_", limma_analysis$name, res_males_fn <- paste0(output_data_dir, integration$name, "_", vsn$name, "_", limma_analysis$name,
"_", selection$name, "_gd_pivalue_rankings.tsv") "_", selection$name, "_gd_pivalue_rankings.tsv")
write.table(res_males %>% write.table(res_males %>%
select(Gene, log_fold_change, P_value, pi_value) %>% select(Gene, log_fold_change, P_value, adj_P_value, pi_value) %>%
mutate(ranking_value = pi_value) %>% mutate(ranking_value = pi_value) %>%
filter(Gene %in% potGD$Gene) %>% filter(Gene %in% potGD$Gene) %>%
arrange(desc(ranking_value)), arrange(desc(ranking_value)),
...@@ -510,7 +510,7 @@ for (i in seq_len(length(config$integrations))) { ...@@ -510,7 +510,7 @@ for (i in seq_len(length(config$integrations))) {
limma_analysis <- config$limma_analyses[[k]] limma_analysis <- config$limma_analyses[[k]]
res_females_fn <- paste0(output_data_dir, integration$name, "_", vsn$name, "_", limma_analysis$name, res_females_fn <- paste0(output_data_dir, integration$name, "_", vsn$name, "_", limma_analysis$name,
"_", selection$name, "_gd_gdrscore_rankings.tsv") "_", selection$name, "_gd_gdrscore_rankings.tsv")
write.table(merge(res_females %>% select(Gene, log_fold_change, P_value, pi_value), write.table(merge(res_females %>% select(Gene, log_fold_change, P_value, adj_P_value, pi_value),
spec_females %>% mutate(ranking_value = gender_specific_score) %>% spec_females %>% mutate(ranking_value = gender_specific_score) %>%
select(Gene, ranking_value), select(Gene, ranking_value),
by = "Gene") %>% by = "Gene") %>%
...@@ -525,7 +525,7 @@ for (i in seq_len(length(config$integrations))) { ...@@ -525,7 +525,7 @@ for (i in seq_len(length(config$integrations))) {
limma_analysis <- config$limma_analyses[[k]] limma_analysis <- config$limma_analyses[[k]]
res_males_fn <- paste0(output_data_dir, integration$name, "_", vsn$name, "_", limma_analysis$name, res_males_fn <- paste0(output_data_dir, integration$name, "_", vsn$name, "_", limma_analysis$name,
"_", selection$name, "_gd_gdrscore_rankings.tsv") "_", selection$name, "_gd_gdrscore_rankings.tsv")
write.table(merge(res_males %>% select(Gene, log_fold_change, P_value, pi_value), write.table(merge(res_males %>% select(Gene, log_fold_change, P_value, adj_P_value, pi_value),
spec_males %>% mutate(ranking_value = gender_specific_score) %>% spec_males %>% mutate(ranking_value = gender_specific_score) %>%
select(Gene, ranking_value), select(Gene, ranking_value),
by = "Gene") %>% by = "Gene") %>%
...@@ -544,10 +544,10 @@ for (i in seq_len(length(config$integrations))) { ...@@ -544,10 +544,10 @@ for (i in seq_len(length(config$integrations))) {
res_females_fn <- paste0(output_data_dir, integration$name, "_", vsn$name, "_", limma_analysis$name, res_females_fn <- paste0(output_data_dir, integration$name, "_", vsn$name, "_", limma_analysis$name,
"_", selection$name, "_gd_combinedscores_rankings.tsv") "_", selection$name, "_gd_combinedscores_rankings.tsv")
n <- dim(res_females)[1] n <- dim(res_females)[1]
write.table(merge(res_females %>% select(Gene, log_fold_change, P_value, pi_value), write.table(merge(res_females %>% select(Gene, log_fold_change, P_value, adj_P_value, pi_value),
spec_females %>% select(Gene, gender_specific_score), spec_females %>% select(Gene, gender_specific_score),
by = "Gene") %>% mutate(ranking_value = ((rank(pi_value) / n) + (rank(gender_specific_score) / n))) %>% by = "Gene") %>% mutate(ranking_value = ((rank(pi_value) / n) + (rank(gender_specific_score) / n))) %>%
select(Gene, log_fold_change, P_value, pi_value, ranking_value) %>% select(Gene, log_fold_change, P_value, adj_P_value, pi_value, ranking_value) %>%
filter(Gene %in% potGD$Gene) %>% filter(Gene %in% potGD$Gene) %>%
arrange(desc(ranking_value)), arrange(desc(ranking_value)),
res_females_fn, res_females_fn,
...@@ -560,10 +560,10 @@ for (i in seq_len(length(config$integrations))) { ...@@ -560,10 +560,10 @@ for (i in seq_len(length(config$integrations))) {
res_males_fn <- paste0(output_data_dir, integration$name, "_", vsn$name, "_", limma_analysis$name, res_males_fn <- paste0(output_data_dir, integration$name, "_", vsn$name, "_", limma_analysis$name,
"_", selection$name, "_gd_combinedscores_rankings.tsv") "_", selection$name, "_gd_combinedscores_rankings.tsv")
n <- dim(res_males)[1] n <- dim(res_males)[1]
write.table(merge(res_males %>% select(Gene, log_fold_change, P_value, pi_value), write.table(merge(res_males %>% select(Gene, log_fold_change, P_value, adj_P_value, pi_value),
spec_males %>% select(Gene, gender_specific_score), spec_males %>% select(Gene, gender_specific_score),
by = "Gene") %>% mutate(ranking_value = ((rank(pi_value) / n) + (rank(gender_specific_score) / n))) %>% by = "Gene") %>% mutate(ranking_value = ((rank(pi_value) / n) + (rank(gender_specific_score) / n))) %>%
select(Gene, log_fold_change, P_value, pi_value, ranking_value) %>% select(Gene, log_fold_change, P_value, adj_P_value, pi_value, ranking_value) %>%
filter(Gene %in% potGD$Gene) %>% filter(Gene %in% potGD$Gene) %>%
arrange(desc(ranking_value)), arrange(desc(ranking_value)),
res_males_fn, res_males_fn,
...@@ -579,7 +579,7 @@ for (i in seq_len(length(config$integrations))) { ...@@ -579,7 +579,7 @@ for (i in seq_len(length(config$integrations))) {
res_females_fn <- paste0(output_data_dir, integration$name, "_", vsn$name, "_", limma_analysis$name, res_females_fn <- paste0(output_data_dir, integration$name, "_", vsn$name, "_", limma_analysis$name,
"_", selection$name, "_gsgd_pivalue_rankings.tsv") "_", selection$name, "_gsgd_pivalue_rankings.tsv")
write.table(res_females %>% write.table(res_females %>%
select(Gene, log_fold_change, P_value, pi_value) %>% select(Gene, log_fold_change, P_value, adj_P_value, pi_value) %>%
mutate(ranking_value = pi_value) %>% mutate(ranking_value = pi_value) %>%
filter(Gene %in% c(potGD$Gene, GS_females$Gene)) %>%