Skip to content

Commit

Permalink
Fix issues with handling table input in Reactome analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
moosa-r committed Mar 30, 2024
1 parent 3312992 commit 8f6c955
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions R/reactome_analysis.R
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 8f6c955

Please sign in to comment.