changeset 6:eb140217a9f1 draft default tip

"planemo upload commit 1f9a98db2496834cc38a281cbe3d4b11de2bc3d2-dirty"
author proteore
date Thu, 05 Mar 2020 10:10:20 -0500
parents 4a3056be0774
children
files kegg_maps_visualization.R kegg_maps_visualization.xml
diffstat 2 files changed, 19 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/kegg_maps_visualization.R	Fri Jan 24 05:20:10 2020 -0500
+++ b/kegg_maps_visualization.R	Thu Mar 05 10:10:20 2020 -0500
@@ -172,11 +172,20 @@
 }
 
 get_limit <- function(mat) {
-  min = min(apply(mat,2,min))
-  max = max(apply(mat,2,max))
+  min = min(apply(mat,2,min,na.rm=TRUE))
+  max = max(apply(mat,2,max,na.rm=TRUE))
   return(c(min,max))
 }
 
+check_pathway_ids<- function(pathways_ids) {
+  problematic_pathways <- c("04215","04723")
+  to_remove <- intersect(pathways_ids,problematic_pathways)
+  if (length(to_remove) > 0){ print(paste("Pathway(s)",to_remove,"have been remove from input")) }
+  pathways_ids <- pathways_ids[which(!pathways_ids %in% problematic_pathways)]
+  if (length(pathways_ids) == 0){stop("No pathways ids to process")}
+  return (pathways_ids)
+}
+
 get_args <- function(){
   
   ## Collect arguments
@@ -238,7 +247,7 @@
     pathways_file = read_file(args$pathways_input,header2)
     ids <- sapply(rapply(strsplit(clean_bad_character(pathways_file[,pathway_col]),","),c), function(x) remove_kegg_prefix(x),USE.NAMES = FALSE)
   }
-  if (args$native_kegg) { ids <- ids[ids != "04215"] }
+  if (args$native_kegg) {ids = check_pathway_ids(ids)} #remove problematic pathways
   pathways_list <- read_file(args$pathways_list,F)
   if (!is.null(args$id_list)) {
     id_list <- get_list_from_cp(args$id_list)
--- a/kegg_maps_visualization.xml	Fri Jan 24 05:20:10 2020 -0500
+++ b/kegg_maps_visualization.xml	Thu Mar 05 10:10:20 2020 -0500
@@ -1,9 +1,10 @@
-<tool id="kegg_maps_visualization" name="KEGG pathways mapping and visualization" version="2020.01.23">
+<tool id="kegg_maps_visualization" name="KEGG pathways mapping and visualization" version="2020.03.05">
     <description>[PathView]</description>
     <requirements>
         <requirement type="package" version="3.6.2" >R</requirement>
         <requirement type="package" version="1.26.0">bioconductor-pathview</requirement>
         <requirement type="package" version="1.26.0">bioconductor-keggrest</requirement>
+        <requirement type="package" version="1.30.10">r-biocmanager</requirement>
     </requirements>
     <command detect_errors="exit_code"><![CDATA[
         Rscript $__tool_directory__/kegg_maps_visualization.R 
@@ -261,6 +262,11 @@
 2. "Select ID type for genes to map on the pathway(s)": Identifiers to map can be either a list of Entrez genes IDs, KEGG genes ID or Uniprot accession number. IDs to be mapped can be either provided by copy/paste or a file (tabular, tsv, txt) with a column containing the IDs. 
 3. "Map quantitative data on the pathway ?": Yes/No (default is No). Fold change values (up to three columns) from a dataset (same file as identifiers to map) can be graphically represented on the final figure (using a range of color representing the fold-change values).
 
+.. class:: warningmark 
+
+Some pathway ids causes error with the KEGG API: **hsa04215**, **mmu04723**. These ids will not be used if present in input.
+
+
 Below is an example of an input file with identifiers (uniprot_AC) and fold_change values.
 
 .. csv-table:: Simulated data