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

Better merging of the enriched pathways (more complete).

parent 21dcd288
......@@ -53,7 +53,7 @@ for (i in seq_len(length(config$integrations))) {
combined_fn <- paste0(output_data_dir, "COMB_", analysis_prefix, "MSIGDB.tsv")
cp_data <- read.delim(cp_filename, row.names = 1, stringsAsFactors = FALSE)
g2p_data <- read.delim(g2p_filename, stringsAsFactors = FALSE)
combined <- merge(x = cp_data, y = g2p_data, by.x = "ID", by.y = "pname")
combined <- merge(x = cp_data, y = g2p_data, by.x = "ID", by.y = "pname", all = TRUE)
write.table(combined, file = combined_fn, sep = "\t", quote = FALSE)
rm(cp_filename, g2p_filename, combined_fn, cp_data, g2p_data, combined)
......@@ -64,7 +64,7 @@ for (i in seq_len(length(config$integrations))) {
if (file.exists(pf_filename)) {
cp_data <- read.delim(cp_filename, row.names = 1, stringsAsFactors = FALSE)
pf_data <- read.delim(pf_filename, row.names = 1, stringsAsFactors = FALSE)
combined <- merge(x = cp_data, y = pf_data, by = "ID")
combined <- merge(x = cp_data, y = pf_data, by = "ID", all = TRUE)
write.table(combined, file = combined_fn, sep = "\t", quote = FALSE)
rm(cp_data, pf_data, combined)
}
......@@ -77,7 +77,7 @@ for (i in seq_len(length(config$integrations))) {
if (file.exists(pf_filename)) {
cp_data <- read.delim(cp_filename, row.names = 1, stringsAsFactors = FALSE)
pf_data <- read.delim(pf_filename, row.names = 1, stringsAsFactors = FALSE)
combined <- merge(x = cp_data, y = pf_data, by = "ID")
combined <- merge(x = cp_data, y = pf_data, by = "ID", all = TRUE)
write.table(combined, file = combined_fn, sep = "\t", quote = FALSE)
rm(cp_data, pf_data, combined)
}
......@@ -90,7 +90,7 @@ for (i in seq_len(length(config$integrations))) {
if (file.exists(pf_filename)) {
cp_data <- read.delim(cp_filename, row.names = 1, stringsAsFactors = FALSE)
pf_data <- read.delim(pf_filename, row.names = 1, stringsAsFactors = FALSE)
combined <- merge(x = cp_data, y = pf_data, by = "ID")
combined <- merge(x = cp_data, y = pf_data, by = "ID", all = TRUE)
write.table(combined, file = combined_fn, sep = "\t", quote = FALSE)
rm(cp_data, pf_data, combined)
}
......@@ -103,7 +103,7 @@ for (i in seq_len(length(config$integrations))) {
if (file.exists(pf_filename)) {
cp_data <- read.delim(cp_filename, row.names = 1, stringsAsFactors = FALSE)
pf_data <- read.delim(pf_filename, row.names = 1, stringsAsFactors = FALSE)
combined <- merge(x = cp_data, y = pf_data, by = "ID")
combined <- merge(x = cp_data, y = pf_data, by = "ID", all = TRUE)
write.table(combined, file = combined_fn, sep = "\t", quote = FALSE)
rm(cp_data, pf_data, combined)
}
......@@ -119,15 +119,15 @@ for (i in seq_len(length(config$integrations))) {
rot_data <- read.delim(rot_filename, stringsAsFactors = FALSE) %>%
mutate(ID = str_replace(X, "path:", ""))
pf_data <- read.delim(pf_filename, row.names = 1, stringsAsFactors = FALSE)
combined <- merge(x = merge(x = cp_data, y = rot_data, by = "ID"),
y = pf_data, by = "ID")
combined <- merge(x = merge(x = cp_data, y = rot_data, by = "ID", all = TRUE),
y = pf_data, by = "ID", all = TRUE)
write.table(combined, file = combined_fn, sep = "\t", quote = FALSE)
rm(cp_data, rot_data, pf_data, combined)
} else {
cp_data <- read.delim(cp_filename, row.names = 1, stringsAsFactors = FALSE)
rot_data <- read.delim(rot_filename, stringsAsFactors = FALSE) %>%
mutate(ID = str_replace(X, "path:", ""))
combined <- merge(x = cp_data, y = rot_data, by = "ID")
combined <- merge(x = cp_data, y = rot_data, by = "ID", all = TRUE)
write.table(combined, file = combined_fn, sep = "\t", quote = FALSE)
rm(cp_data, rot_data, combined)
}
......@@ -149,7 +149,7 @@ for (i in seq_len(length(config$integrations))) {
combined_fn <- paste0(output_data_dir, "COMB_", analysis_prefix, "MSIGDB.tsv")
cp_data <- read.delim(cp_filename, row.names = 1, stringsAsFactors = FALSE)
g2p_data <- read.delim(g2p_filename, stringsAsFactors = FALSE)
combined <- merge(x = cp_data, y = g2p_data, by.x = "ID", by.y = "pname")
combined <- merge(x = cp_data, y = g2p_data, by.x = "ID", by.y = "pname", all = TRUE)
write.table(combined, file = combined_fn, sep = "\t", quote = FALSE)
rm(cp_filename, g2p_filename, combined_fn, cp_data, g2p_data, combined)
......@@ -161,7 +161,7 @@ for (i in seq_len(length(config$integrations))) {
cp_data <- read.delim(cp_filename, row.names = 1, stringsAsFactors = FALSE)
rot_data <- read.delim(rot_filename, stringsAsFactors = FALSE) %>%
mutate(ID = str_replace(X, "path:", ""))
combined <- merge(x = cp_data, y = rot_data, by = "ID")
combined <- merge(x = cp_data, y = rot_data, by = "ID", all = TRUE)
write.table(combined, file = combined_fn, sep = "\t", quote = FALSE)
rm(cp_filename, rot_filename, combined_fn, cp_data, rot_data, combined)
......
Supports Markdown
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