Previous changeset 15:5bf899c13979 (2023-11-22) |
Commit message:
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/edger commit 4b17306763bc8eb92c8967c7b4b57abcc514e670 |
modified:
edger.R edger.xml |
b |
diff -r 5bf899c13979 -r ae2aad0a6d50 edger.R --- a/edger.R Wed Nov 22 03:57:37 2023 +0000 +++ b/edger.R Wed Sep 04 15:50:01 2024 +0000 |
[ |
b'@@ -42,8 +42,8 @@\n \n # setup R error handling to go to stderr\n options(show.error.messages = FALSE, error = function() {\n- cat(geterrmessage(), file = stderr())\n- q("no", 1, FALSE)\n+ cat(geterrmessage(), file = stderr())\n+ q("no", 1, FALSE)\n })\n \n # we need that to not crash galaxy with an UTF8 error on German LC settings.\n@@ -64,41 +64,41 @@\n # Function to sanitise contrast equations so there are no whitespaces\n # surrounding the arithmetic operators, leading or trailing whitespace\n sanitise_equation <- function(equation) {\n- equation <- gsub(" *[+] *", "+", equation)\n- equation <- gsub(" *[-] *", "-", equation)\n- equation <- gsub(" *[/] *", "/", equation)\n- equation <- gsub(" *[*] *", "*", equation)\n- equation <- gsub("^\\\\s+|\\\\s+$", "", equation)\n- return(equation)\n+ equation <- gsub(" *[+] *", "+", equation)\n+ equation <- gsub(" *[-] *", "-", equation)\n+ equation <- gsub(" *[/] *", "/", equation)\n+ equation <- gsub(" *[*] *", "*", equation)\n+ equation <- gsub("^\\\\s+|\\\\s+$", "", equation)\n+ return(equation)\n }\n \n # Function to sanitise group information\n sanitise_groups <- function(string) {\n- string <- gsub(" *[,] *", ",", string)\n- string <- gsub("^\\\\s+|\\\\s+$", "", string)\n- return(string)\n+ string <- gsub(" *[,] *", ",", string)\n+ string <- gsub("^\\\\s+|\\\\s+$", "", string)\n+ return(string)\n }\n \n # Function to change periods to whitespace in a string\n unmake_names <- function(string) {\n- string <- gsub(".", " ", string, fixed = TRUE)\n- return(string)\n+ string <- gsub(".", " ", string, fixed = TRUE)\n+ return(string)\n }\n \n # Sanitise file base names coming from factors or contrasts\n sanitise_basename <- function(string) {\n- string <- gsub("[/^]", "_", string)\n- return(string)\n+ string <- gsub("[/^]", "_", string)\n+ return(string)\n }\n \n # Generate output folder and paths\n make_out <- function(filename) {\n- return(paste0(out_path, "/", filename))\n+ return(paste0(out_path, "/", filename))\n }\n \n # Generating design information\n paste_listname <- function(string) {\n- return(paste0("factors$", string))\n+ return(paste0("factors$", string))\n }\n \n # Create cata function: default path set, default seperator empty and appending\n@@ -106,49 +106,49 @@\n # defaults)\n cata <- function(..., file = opt$htmlPath, sep = "", fill = FALSE, labels = NULL,\n append = TRUE) {\n- if (is.character(file)) {\n- if (file == "") {\n- file <- stdout()\n- } else if (substring(file, 1L, 1L) == "|") {\n- file <- pipe(substring(file, 2L), "w")\n- on.exit(close(file))\n- } else {\n- file <- file(file, ifelse(append, "a", "w"))\n- on.exit(close(file))\n+ if (is.character(file)) {\n+ if (file == "") {\n+ file <- stdout()\n+ } else if (substring(file, 1L, 1L) == "|") {\n+ file <- pipe(substring(file, 2L), "w")\n+ on.exit(close(file))\n+ } else {\n+ file <- file(file, ifelse(append, "a", "w"))\n+ on.exit(close(file))\n+ }\n }\n- }\n- .Internal(cat(list(...), file, sep, fill, labels, append))\n+ .Internal(cat(list(...), file, sep, fill, labels, append))\n }\n \n # Function to write code for html head and title\n html_head <- function(title) {\n- cata("<head>\\n")\n- cata("<title>", title, "</title>\\n")\n- cata("</head>\\n")\n+ cata("<head>\\n")\n+ cata("<title>", title, "</title>\\n")\n+ cata("</head>\\n")\n }\n \n # Function to write code for html links\n html_link <- function(address, label = address) {\n- cata("<a href=\\"", address, "\\" target=\\"_blank\\">", label, "</a><br />\\n")\n+ cata("<a href=\\"", address, "\\" target=\\"_blank\\">", label, "</a><br />\\n")\n }\n \n # Function to write code for html images\n html_image <- function(source, label = source, height = 600, width = 600) {\n- cata("<img src=\\"", source, "\\" alt=\\"", label, "\\" height=\\"", height)\n- cata("\\" width=\\"", width, "\\"/>\\n")\n+ cata("<img src=\\"", source, "\\" alt=\\"", label, "\\" height=\\"", height)\n+ cata("\\"'..b'e filtered out for low expression."\n )\n- } else if (filt_totcount) {\n- temp_str <- paste(\n- "Genes without more than", opt$cntReq,\n- "counts, after summing counts for all samples, are insignificant",\n- "and filtered out."\n- )\n- }\n-\n- list_item(temp_str)\n- filter_prop <- round(filtered_count / prefilter_count * 100, digits = 2)\n- temp_str <- paste0(\n- filtered_count, " of ", prefilter_count, " (", filter_prop,\n- "%) genes were filtered out for low expression."\n- )\n- list_item(temp_str)\n+ list_item(temp_str)\n }\n list_item(opt$normOpt, " was the method used to normalise library sizes.")\n if (want_lrt) {\n- list_item("The edgeR likelihood ratio test was used.")\n+ list_item("The edgeR likelihood ratio test was used.")\n } else {\n- if (want_robust) {\n- list_item("The edgeR quasi-likelihood test was used with robust settings (robust=TRUE with estimateDisp and glmQLFit).")\n- } else {\n- list_item("The edgeR quasi-likelihood test was used.")\n- }\n+ if (want_robust) {\n+ list_item("The edgeR quasi-likelihood test was used with robust settings (robust=TRUE with estimateDisp and glmQLFit).")\n+ } else {\n+ list_item("The edgeR quasi-likelihood test was used.")\n+ }\n }\n if (opt$pAdjOpt != "none") {\n- if (opt$pAdjOpt == "BH" || opt$pAdjOpt == "BY") {\n+ if (opt$pAdjOpt == "BH" || opt$pAdjOpt == "BY") {\n+ temp_str <- paste0(\n+ "MD-Plot highlighted genes are significant at FDR ",\n+ "of ", opt$pValReq, " and exhibit log2-fold-change of at ",\n+ "least ", opt$lfcReq, "."\n+ )\n+ list_item(temp_str)\n+ } else if (opt$pAdjOpt == "holm") {\n+ temp_str <- paste0(\n+ "MD-Plot highlighted genes are significant at adjusted ",\n+ "p-value of ", opt$pValReq, " by the Holm(1979) ",\n+ "method, and exhibit log2-fold-change of at least ",\n+ opt$lfcReq, "."\n+ )\n+ list_item(temp_str)\n+ }\n+} else {\n temp_str <- paste0(\n- "MD-Plot highlighted genes are significant at FDR ",\n- "of ", opt$pValReq, " and exhibit log2-fold-change of at ",\n- "least ", opt$lfcReq, "."\n+ "MD-Plot highlighted genes are significant at p-value ",\n+ "of ", opt$pValReq, " and exhibit log2-fold-change of at ",\n+ "least ", opt$lfcReq, "."\n )\n list_item(temp_str)\n- } else if (opt$pAdjOpt == "holm") {\n- temp_str <- paste0(\n- "MD-Plot highlighted genes are significant at adjusted ",\n- "p-value of ", opt$pValReq, " by the Holm(1979) ",\n- "method, and exhibit log2-fold-change of at least ",\n- opt$lfcReq, "."\n- )\n- list_item(temp_str)\n- }\n-} else {\n- temp_str <- paste0(\n- "MD-Plot highlighted genes are significant at p-value ",\n- "of ", opt$pValReq, " and exhibit log2-fold-change of at ",\n- "least ", opt$lfcReq, "."\n- )\n- list_item(temp_str)\n }\n cata("</ul>\\n")\n \n@@ -761,26 +762,26 @@\n table_head_item(names(factors)[1], " (Primary Factor)")\n \n if (ncol(factors) > 1) {\n- for (i in names(factors)[2:length(names(factors))]) {\n- table_head_item(i)\n- }\n- cata("</tr>\\n")\n+ for (i in names(factors)[2:length(names(factors))]) {\n+ table_head_item(i)\n+ }\n+ cata("</tr>\\n")\n }\n \n for (i in seq_len(nrow((factors)))) {\n- cata("<tr>\\n")\n- table_head_item(row.names(factors)[i])\n- for (j in seq_len(ncol(factors))) {\n- table_item(as.character(unmake_names(factors[i, j])))\n- }\n- cata("</tr>\\n")\n+ cata("<tr>\\n")\n+ table_head_item(row.names(factors)[i])\n+ for (j in seq_len(ncol(factors))) {\n+ table_item(as.character(unmake_names(factors[i, j])))\n+ }\n+ cata("</tr>\\n")\n }\n cata("</table>")\n \n for (i in seq_len(nrow(link_data))) {\n- if (grepl("session_info", link_data$Link[i])) {\n- html_link(link_data$Link[i], link_data$Label[i])\n- }\n+ if (grepl("session_info", link_data$Link[i])) {\n+ html_link(link_data$Link[i], link_data$Label[i])\n+ }\n }\n \n cata("<table border=\\"0\\">\\n")\n' |
b |
diff -r 5bf899c13979 -r ae2aad0a6d50 edger.xml --- a/edger.xml Wed Nov 22 03:57:37 2023 +0000 +++ b/edger.xml Wed Sep 04 15:50:01 2024 +0000 |
[ |
@@ -4,7 +4,7 @@ </description> <macros> <token name="@TOOL_VERSION@">3.36.0</token> - <token name="@VERSION_SUFFIX@">4</token> + <token name="@VERSION_SUFFIX@">5</token> </macros> <edam_topics> <edam_topic>topic_3308</edam_topic> @@ -130,11 +130,8 @@ <when value="files"> <repeat name="rep_factor" title="Factor" min="1"> <param name="factorName" type="text" label="Name" help="Name of experiment factor of interest (e.g. Genotype). One factor must be entered and there must be two or more groups per factor. Optional additional factors (e.g. Batch) can be entered using the Insert Factor button below, see Help section for more information. NOTE: Please only use letters, numbers or underscores, and the first character of each factor must be a letter"> - <sanitizer> - <valid initial="string.letters,string.digits"> - <add value="_"/> - </valid> - </sanitizer> + <validator type="empty_field"/> + <validator type="regex" message="Please only use letters, numbers or underscores">^[\w]+$</validator> </param> <repeat name="rep_group" title="Group" min="2" default="2"> <param name="groupName" type="text" label="Name" help="Name of group that the counts files belong to (e.g. WT or Mut). NOTE: Please only use letters, numbers or underscores (case sensitive), and the first character of each group must be a letter"> |