From 8f6c9552045820ded9e5f314ace59fa125c02ab0 Mon Sep 17 00:00:00 2001 From: Moosa Rezwani Date: Sat, 30 Mar 2024 01:40:07 +0100 Subject: [PATCH] Fix issues with handling table input in Reactome analysis --- R/reactome_analysis.R | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/R/reactome_analysis.R b/R/reactome_analysis.R index af9d9e09..8591c14b 100644 --- a/R/reactome_analysis.R +++ b/R/reactome_analysis.R @@ -70,20 +70,21 @@ input <- as.data.frame(input, stringsAsFactors = FALSE) #make sure that every column name starts with # - inproper_colnames <- !grepl("^#", colnames(input)) + inproper_colnames <- !grepl("^#", colnames(input)[[1]]) if (any(inproper_colnames)) { - colnames(input)[inproper_colnames] <- paste0("#", - colnames(input)[inproper_colnames]) + colnames(input)[[1]] <- paste0("#", + colnames(input)[[1]]) } - utils::write.table(x = as.character(input), + utils::write.table(x = input, file = temp_file, sep = "\t", + quote = FALSE, row.names = FALSE, col.names = TRUE) return(list(type = "file", file = temp_file)) } else if (type == "vector") { - writeLines(text = input, + writeLines(text = c("#Gene names", input), con = temp_file, sep = "\n") return(list(type = "file",