changeset 17:81faa1567178 draft

Deleted selected files
author fabio
date Wed, 31 May 2017 11:06:30 -0400
parents ed9594c25fad
children 565118df598a
files iwtomics/.Rapp.history iwtomics/.Rhistory iwtomics/._.DS_Store iwtomics/._ETn_example iwtomics/._example iwtomics/._loadandplot.R iwtomics/._plotwithscale.R iwtomics/._testandplot.R iwtomics/loadandplot.R iwtomics/loadandplot.xml iwtomics/macros.xml iwtomics/plotwithscale.R iwtomics/plotwithscale.xml iwtomics/testandplot.R iwtomics/testandplot.xml
diffstat 14 files changed, 0 insertions(+), 1139 deletions(-) [+]
line wrap: on
line diff
--- a/iwtomics/.Rhistory	Wed May 31 11:06:00 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-require(IWTomics)
-require(pheatmap)
-install.packages(pheatmap)
Binary file iwtomics/._.DS_Store has changed
Binary file iwtomics/._ETn_example has changed
Binary file iwtomics/._example has changed
Binary file iwtomics/._loadandplot.R has changed
Binary file iwtomics/._plotwithscale.R has changed
Binary file iwtomics/._testandplot.R has changed
--- a/iwtomics/loadandplot.R	Wed May 31 11:06:00 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,146 +0,0 @@
-if (require("IWTomics",character.only = TRUE,quietly = FALSE)) {
-  require(tools,quietly = FALSE)
-  args=commandArgs(TRUE)
-
-  for (i in seq_along(args)) {
-    message(args[[i]])
-  }
-  
-  # get args names and values
-  args_values=strsplit(args,'=')
-  args_names=unlist(lapply(args_values,function(arg) arg[1]))
-  names(args_values)=args_names
-  args_values=lapply(args_values,function(arg) arg[2])
-  # read filenames
-  outrdata=args_values$outrdata
-  outregions=args_values$outregions
-  outfeatures=args_values$outfeatures
-  outpdf=args_values$outpdf
-  regionspaths=unlist(strsplit(args_values$regionspaths,'\\|'))
-  if("regionsheaderfile" %in% args_names){
-    # the file regionsheaderfile must contain as first column the (unique) regionsfilenames, 
-    # as second column the corresponding ids and as third column the names
-    tryCatch({
-      regionsheader=read.delim(args_values$regionsheaderfile,header=FALSE,stringsAsFactors=FALSE,row.names=1,sep="\t")
-      regionsfilenames=unlist(strsplit(args_values$regionsfilenames,'\\|'))
-      if(length(setdiff(regionsfilenames,row.names(regionsheader)))) {
-        quit(save="no", status=11)
-        stop('Not all regionsfilenames are present in the first column of regionsheader.')
-      }
-      id_regions=regionsheader[regionsfilenames,1]
-      name_regions=regionsheader[regionsfilenames,2]
-    }, error = function(err) {
-      quit(save="no", status=10) #error on header file
-      stop(err)
-    })
-  }else{
-    eval(parse(text=args[[which(args_names=='regionsgalaxyids')]]))
-    id_regions=paste0('data_',regionsgalaxyids)
-    name_regions=paste0('data_',regionsgalaxyids)
-  }
-  featurespaths=unlist(strsplit(args_values$featurespaths,'\\|'))
-  if("featuresheaderfile" %in% args_names){
-    # the file featuresheaderfile must contain as first column the (unique) featuresfilenames, 
-    # as second column the corresponding ids and as third column the names
-    tryCatch({
-      featuresheader=read.delim(args_values$featuresheaderfile,header=FALSE,stringsAsFactors=FALSE,row.names=1,sep="\t")
-      featuresfilenames=unlist(strsplit(args_values$featuresfilenames,'\\|'))
-      if(length(setdiff(featuresfilenames,row.names(featuresheader)))) {
-        quit(save="no", status=21)
-        stop('Not all featuresfilenames are present in the first column of featuresheader.')
-      }
-      id_features=featuresheader[featuresfilenames,1]
-      name_features=featuresheader[featuresfilenames,2]
-    }, error = function(err) {
-      quit(save="no", status=20) #error on header file
-      stop(err)
-    })
-  }else{
-    eval(parse(text=args[[which(args_names=='featuresgalaxyids')]]))
-    id_features=paste0('data_',featuresgalaxyids)
-    name_features=paste0('data_',featuresgalaxyids)
-  }
-  # read parameters (from smoothing on)
-  i_smoothing=which(args_names=='smoothing')
-  for(i in i_smoothing:length(args)){
-    eval(parse(text=args[[i]]))
-  }
-  
-  # load data
-  tryCatch({
-    regionsFeatures=IWTomicsData(regionspaths,featurespaths,alignment,
-                                id_regions,name_regions,id_features,name_features,start.are.0based=start.are.0based)
-  }, error = function(err) {
-    if(grepl('invalid format',err$message)){
-      quit(save="no", status=31) # error, not enough columns in input file
-    }else if(grepl('duplicated regions',err$message)){
-      quit(save="no", status=32) # error, duplicated regions in region file
-    }else if(grepl('duplicated windows',err$message)){
-      quit(save="no", status=33) # error, duplicated windows in feature file
-    }else if(grepl('overlapping windows',err$message)){
-      quit(save="no", status=34) # error, overlapping windows in feature file
-    }else if(grepl('not all regions in datasets',err$message)){
-      quit(save="no", status=35) # error, windows in feature files do not cover all regions in region files
-    }else if(grepl('ifferent size windows',err$message)){
-      quit(save="no", status=36) # error, all windows in a feature files must have the same size
-    }
-    #error loading data
-
-    stop(err)
-
-    quit(save="no", status=30)
-    
- })
-  
-  # smooth data
-  if(smoothing!='no'){
-    tryCatch({
-      if(smoothing=='locpoly'){
-        dist_knots=10
-      }else if(smoothing=='kernel'){
-        degree=3
-        dist_knots=10
-      }else if(smoothing=='splines'){
-        bandwidth=5
-      }
-      if(alignment=='scale'){
-        if(scale==0){
-          regionsFeatures=smooth(regionsFeatures,type=smoothing,fill_gaps=fill_gaps,
-                                bandwidth=bandwidth,degree=degree,dist_knots=dist_knots)
-        }else{
-          regionsFeatures=smooth(regionsFeatures,type=smoothing,fill_gaps=fill_gaps,
-                                bandwidth=bandwidth,degree=degree,dist_knots=dist_knots,scale_grid=scale)
-        }
-      }else{
-        regionsFeatures=smooth(regionsFeatures,type=smoothing,fill_gaps=fill_gaps,
-                              bandwidth=bandwidth,degree=degree,dist_knots=dist_knots)
-      }
-    }, error = function(err) {
-      quit(save="no", status=40) #error on smoothing
-      stop(err)
-    })
-  }
-  
-  # plot data
-  pdf(outpdf,width=10,height=8)
-  if(plottype=='boxplot'){
-    # fix repeated probs
-    probs=sort(unique(probs))
-  }else{
-    probs=c(0.25,0.5,0.75)
-  }
-  plot(regionsFeatures,type=plottype,probs=probs,average=average,size=size,ask=FALSE)
-  dev.off()
-  
-  # create output
-  #write.table(cbind(unlist(strsplit(args_values$regionsfilenames,'\\|')),idRegions(regionsFeatures),nameRegions(regionsFeatures)),
-              #file=outregions,quote=FALSE,sep='\t',row.names=FALSE,col.names=FALSE)
-  write.table(as.data.frame(t(idRegions(regionsFeatures))),file=outregions,quote=FALSE,sep='\t',row.names=FALSE,col.names=FALSE)
-  #write.table(cbind(unlist(strsplit(args_values$featuresfilenames,'\\|')),idFeatures(regionsFeatures),nameFeatures(regionsFeatures)),
-              #file=outfeatures,quote=FALSE,sep='\t',row.names=FALSE,col.names=FALSE)
-  write.table(as.data.frame(t(idFeatures(regionsFeatures))),file=outfeatures,quote=FALSE,sep='\t',row.names=FALSE,col.names=FALSE)
-  save(regionsFeatures,file=outrdata)
-}else{
-  quit(save="no", status=255)
-  stop("Missing IWTomics package")
-}
\ No newline at end of file
--- a/iwtomics/loadandplot.xml	Wed May 31 11:06:00 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,325 +0,0 @@
-<tool id="loadandplot" name="IWTomics Load" version="@VERSION@.0">
-  <description>Smooth and Plot</description>
-  <macros>
-    <import>macros.xml</import>
-  </macros>
-  <expand macro="requirements" />
-  <stdio>
-    <exit_code range="255" source="both" level="fatal" description="Missing IWTomics package. Please be sure to have it installed before using this tool." />
-    <exit_code range="10" source="both" level="fatal" description="An error has occurred reading the header file for regions. Please try again." />
-    <exit_code range="11" source="both" level="fatal" description="Not all region files are present in the first column of header file for regions." />
-    <exit_code range="20" source="both" level="fatal" description="An error has occurred reading the header file for features. Please try again." />
-    <exit_code range="21" source="both" level="fatal" description="Not all feature files are present in the first column of header file for features." />
-    <exit_code range="30" source="both" level="fatal" description="An error has occurred reading the data. Please try again." />
-    <exit_code range="31" source="both" level="fatal" description="Not enough columns in input file." />
-    <exit_code range="32" source="both" level="fatal" description="Duplicated regions in region file." />
-    <exit_code range="33" source="both" level="fatal" description="Duplicated windows in feature file." />
-    <exit_code range="34" source="both" level="fatal" description="Overlapping windows in feature file." />
-    <exit_code range="35" source="both" level="fatal" description="Windows in feature files do not cover all regions in region files." />
-    <exit_code range="36" source="both" level="fatal" description="All windows in a feature file must have the same size." />
-    <exit_code range="40" source="both" level="fatal" description="An error has occurred smoothing the data. Please try again." />
-    <regex match="Error" source="both" level="fatal" description="An error has occurred. Please try again." />
-  </stdio>
-
-  <command>
-<![CDATA[
-    Rscript $__tool_directory__/loadandplot.R outrdata="${outrdata}" outregions="${outregions}" outfeatures="${outfeatures}" outpdf="${outpdf}"
-
-      #set region_paths = '"\\|"'.join( [ str( $r ) for $r in $regions ] )
-      regionspaths="${region_paths}"
-      #set region_galaxyids = '","'.join( [ str( $r.hid ) for $r in $regions ] )
-      regionsgalaxyids="c(${region_galaxyids})"
-      #set region_names = '"\\|"'.join( [ str( $r.name ) for $r in $regions ] )
-      regionsfilenames="${region_names}"
-      #set region_header = '"\\|"'.join( [ str( $rh.regionsheader ) for $rh in $regionsheaderrepeat ] )
-      #if $region_header != "":
-        regionsheaderfile="${region_header}"
-      #end if
-
-      #set feature_paths = '"\\|"'.join( [ str( $f ) for $f in $features ] )
-      featurespaths="${feature_paths}"
-      #set feature_galaxyids = '","'.join( [ str( $f.hid ) for $f in $features ] )
-      featuresgalaxyids="c(${feature_galaxyids})"
-      #set feature_names = '"\\|"'.join( [ str( $f.name ) for $f in $features ] )
-      featuresfilenames="${feature_names}"
-      #set feature_header = '"\\|"'.join( [ str( $fh.featuresheader ) for $fh in $featuresheaderrepeat ] )
-      #if $feature_header != "":
-        featuresheaderfile="${feature_header}"
-      #end if
-
-      smoothing="'${conditionaltype.smoothing}'"
-      start.are.0based="${zerobased}"
-      #if $conditionaltype.smoothing == 'no':
-        alignment="'${conditionaltype.alignment}'"
-      #elif $conditionaltype.smoothing == 'locpoly':
-        alignment="'${conditionaltype.locpolyconditionalscale.alignment}'"
-        #if $conditionaltype.locpolyconditionalscale.alignment == 'scale':
-          scale="${conditionaltype.locpolyconditionalscale.scalegrid}"
-        #end if
-        bandwidth="${conditionaltype.locpolybandwidth}"
-        degree="${conditionaltype.locpolydegree}"
-        fill_gaps="${conditionaltype.fillgaps}"
-      #elif $conditionaltype.smoothing == 'kernel':
-        alignment="'${conditionaltype.kernelconditionalscale.alignment}'"
-        #if $conditionaltype.kernelconditionalscale.alignment == 'scale':
-          scale="${conditionaltype.kernelconditionalscale.scalegrid}"
-        #end if
-        bandwidth="${conditionaltype.kernelbandwidth}"
-        fill_gaps="${conditionaltype.fillgaps}"
-      #elif $conditionaltype.smoothing == 'splines':
-        alignment="'${conditionaltype.splinesconditionalscale.alignment}'"
-        #if $conditionaltype.splinesconditionalscale.alignment == 'scale':
-          scale="${conditionaltype.splinesconditionalscale.scalegrid}"
-        #end if
-        degree="${conditionaltype.splinesdegree}"
-        dist_knots="${conditionaltype.splinesdistknots}"
-        fill_gaps="${conditionaltype.fillgaps}"
-      #end if
-
-      average="${plotres.average}"
-      size="${plotres.size}"
-      plottype="'${plotres.conditionalplottype.plottype}'"
-      #if $plotres.conditionalplottype.plottype == 'boxplot':
-        #set probs = '","'.join( [ str( $p.prob ) for $p in $plotres.conditionalplottype.probabilitiessection.probabilities ] )
-        #if $probs != "":
-          probs="c(${plotres.conditionalplottype.probabilitiessection.prob0},${plotres.conditionalplottype.probabilitiessection.prob1},${plotres.conditionalplottype.probabilitiessection.prob2},${probs})"
-        #else:
-          probs="c(${plotres.conditionalplottype.probabilitiessection.prob0},${plotres.conditionalplottype.probabilitiessection.prob1},${plotres.conditionalplottype.probabilitiessection.prob2})"
-        #end if
-      #end if
-
-      >& /dev/null
-]]>
-    <!--
-    to print the stack add the following line at the end of the command and enable the corresponding entry in output
-    2> "${stackerr}"
-    -->
-  </command>
-
-  <inputs>
-    <!-- regions -->
-    <param format="tabular" name="regions" type="data" label="Select region files" multiple="true" help="" />
-    <repeat name="regionsheaderrepeat" title="Header file for regions (optional)" min="0" max="1" help="Tabular file. Column 1: names of the region files; Column 2: unique identifiers of the region datasets (spaces and special characters are not allowed); Column 3: name of the region datasets to be used in the output.">
-      <param format="tabular" name="regionsheader" type="data" label="Select header file" />
-    </repeat>
-
-    <!-- features -->
-    <param format="tabular" name="features" type="data" label="Select feature files" multiple="true" help="" />
-    <repeat name="featuresheaderrepeat" title="Header file for features (optional)" min="0" max="1" help="Tabular file. Column 1: names of the feature files; Column 2: unique identifiers of the features (spaces and special characters are not allowed); Column 3: name of the features to be used in the output.">
-      <param format="tabular" name="featuresheader" type="data" label="Select header file" />
-    </repeat>
-
-    <!-- zero-base one-base -->
-    <param name="zerobased" type="select" label="Start positions are:" multiple="false" help="">
-      <option value="TRUE">0-based</option>
-      <option value="FALSE">1-based</option>
-    </param>
-
-    <!-- conditional smoothing -->
-    <conditional name="conditionaltype">
-      <!-- smoothing -->
-      <param name="smoothing" type="select" label="Smoothing" help="Type of smoothing to be applied to the feature curves.">
-        <option value="no">No</option>
-        <option value="locpoly">Local Polynomials</option>
-        <option value="kernel">Gaussian Kernel</option>
-        <option value="splines">B-Splines</option>
-      </param>
-      <!-- conditional choice: smoothing=no -->
-      <when value="no">
-        <param name="alignment" type="select" label="Region alignment" help="">
-          <option value="center">Center - Alignment on the central position</option>
-          <option value="left">Left - Alignment on the starting position</option>
-          <option value="right">Right - Alignment on the ending position</option>
-        </param>
-      </when>
-      <!-- conditional choice: smoothing=locpoly -->
-      <when value="locpoly">
-        <!-- conditional region alignment -->
-        <conditional name="locpolyconditionalscale">
-          <param name="alignment" type="select" label="Region alignment" help="">
-            <option value="center">Center - Alignment on the central position</option>
-            <option value="left">Left - Alignment on the starting position</option>
-            <option value="right">Right - Alignment on the ending position</option>
-            <option value="scale">Scale - Scaling all regions to the same length</option>
-          </param>
-          <when value="scale">
-            <param name="scalegrid" type="integer" value="0" min="0" label="Number of grid points" help="Number of equally-spaced grid points over which the smoothed curves are evaluated." />
-          </when>
-        </conditional>
-
-        <param name="locpolybandwidth" type="integer" value="5" min="2" label="Bandwidth for smoothing" help="" />
-        <param name="locpolydegree" type="integer" value="3" min="0" label="Degree of local polynomial" help="" />
-
-        <!-- fill gaps -->
-        <param name="fillgaps" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="True" label="Use smoothing to fill gaps (NA measurements)" help="" />
-      </when>
-      <!-- conditional choice: smoothing=kernel -->
-      <when value="kernel">
-        <!-- conditional region alignment -->
-        <conditional name="kernelconditionalscale">
-          <param name="alignment" type="select" label="Region alignment" help="">
-            <option value="center">Center - Alignment on the central position</option>
-            <option value="left">Left - Alignment on the starting position</option>
-            <option value="right">Right - Alignment on the ending position</option>
-            <option value="scale">Scale - Scaling all regions to the same length</option>
-          </param>
-          <when value="scale">
-            <param name="scalegrid" type="integer" value="0" min="0" label="Number of grid points" help="Number of equally-spaced grid points over which the smoothed curves are evaluated." />
-          </when>
-        </conditional>
-
-        <param name="kernelbandwidth" type="integer" value="5" min="2" label="Bandwidth for smoothing" help="" />
-
-        <!-- fill gaps -->
-        <param name="fillgaps" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="True" label="Use smoothing to fill gaps (NA measurements)" help="" />
-      </when>
-      <!-- conditional choice: smoothing=splines -->
-      <when value="splines">
-        <!-- conditional region alignment -->
-        <conditional name="splinesconditionalscale">
-          <param name="alignment" type="select" label="Region alignment" help="">
-            <option value="center">Center - Alignment on the central position</option>
-            <option value="left">Left - Alignment on the starting position</option>
-            <option value="right">Right - Alignment on the ending position</option>
-            <option value="scale">Scale - Scaling all regions to the same length</option>
-          </param>
-          <when value="scale">
-            <param name="scalegrid" type="integer" value="0" min="0" label="Number of grid points" help="Number of equally-spaced grid points over which the smoothed curves are evaluated." />
-          </when>
-        </conditional>
-
-        <param name="splinesdegree" type="integer" value="3" min="0" label="Degree of B-splines" help="" />
-        <param name="splinesdistknots" type="integer" value="10" min="2" label="Distance between nodes (approximate)" help="" />
-
-        <!-- fill gaps -->
-        <param name="fillgaps" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="True" label="Use smoothing to fill gaps (NA measurements)" help="" />
-      </when>
-    </conditional>
-
-    <!-- plot IWTomics results -->
-    <section name="plotres" title="Plot data" expanded="True">
-      <!-- average -->
-      <param name="average" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="True" label="Plot the mean curves" help="" />
-      <!-- sample size in each position -->
-      <param name="size" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="True" label="Plot sample size in each position" help="" />
-      <!-- conditional plot type -->
-      <conditional name="conditionalplottype">
-        <!-- plot type -->
-        <param name="plottype" type="select" label="Plot type" help="">
-          <option value="boxplot">Pointwise quantile curves (boxplot)</option>
-          <option value="curves">Curves (aligned)</option>
-        </param>
-        <!-- conditional choice: plottype=boxplot -->
-        <when value="boxplot">
-          <section name="probabilitiessection" title="Probabilities" expanded="True" help="Probabilities corresponding to the quantile curves to be drawn.">
-            <param name="prob0" size="3" type="float" value="0.25" min="0.0" max="1.0" label="Probability" />
-            <param name="prob1" size="3" type="float" value="0.5" min="0.0" max="1.0" label="Probability" />
-            <param name="prob2" size="3" type="float" value="0.75" min="0.0" max="1.0" label="Probability" />
-            <repeat name="probabilities" title="Probabilities">
-              <param name="prob" size="3" type="float" value="0.5" min="0.0" max="1.0" label="Probability" />
-            </repeat>
-          </section>
-        </when>
-      </conditional>
-    </section>
-  </inputs>
-
-  <outputs>
-    <!--<data format="txt" name="stackerr" label="iwtomics.loadandplot.stackerr.txt" from_work_dir="iwtomics.loadandplot.stackerr.txt" />-->
-    <data format="rdata" name="outrdata" label="${tool.name} on ${on_string}: IWTomicsData Object" from_work_dir="iwtomics.loadandplot.RData" />
-    <data format="tabular" name="outregions" label="${tool.name} on ${on_string}: Region Dataset IDs" from_work_dir="iwtomics.loadandplot.regions.txt" />
-    <data format="tabular" name="outfeatures" label="${tool.name} on ${on_string}: Feature IDs" from_work_dir="iwtomics.loadandplot.features.txt" />
-    <data format="pdf" name="outpdf" label="${tool.name} on ${on_string}: Plotted Data" from_work_dir="iwtomics.loadandplot.pdf" />
-  </outputs>
-
-  <help>
-This tool imports a collection of genomic region datasets, and associates to each region
-multiple genomic feature measurements. It allows to align the regions in multiple ways
-(center, left, right or scale alignment), to smooth the feature curves (possibly filling gaps in the
-measurements) and to create a graphical representation of the feature measurements in each
-region datasets (aligned curves or pointwise quantile curves).
-
------
-
-**Region datasets**
-
-Each region dataset can be provided as a BED or Tabular file with tab delimited columns chr
-start end (extra columns present in the input file are ignored). Regions can be of different
-length::
-
-    chr2  49960150  50060150
-    chr2  55912445  56012445
-    ...
-
------
-
-**Feature measurements**
-
-Feature measurements corresponding to all the regions can be provided as a BED or Tabular
-file with tab delimited columns chr start end value::
-
-    chr2  49960150  49962150  0.9426
-    chr2  49962150  49964150  0.7816
-    ...
-
-Each feature must be measured in windows of a fixed size inside all the regions (missing
-values must be indicated as NA). Another way to import feature measurements is from a
-Tabular file with the first three columns chr start end corresponding to the different genomic
-regions, followed on the same row by all the measurements in fixed-size windows::
-
-    chr2  49960150  50060150  0.9426  0.7816  0.8921  ...  ...  1.2063
-    chr2  55912445  56012445  0.8719  0.9975  1.1619  ...  ...  0.9601
-    ...
-
------
-
-**Output**
-
-The tool returns:
-
-1. RData with the IWTomicsData object, that stores the aligned genomic region datasets, and their associated feature measurements;
-2. Region dataset identifiers;
-3. Feature identifiers;
-4. PDF file with the plotted data.
-
-1-3 can be used as input of the tool *IWTomics Test and Plot*
-
------
-
-.. class:: infomark
-
-**Notes**
-
-This Galaxy tool has been developed by Fabio Cumbo (Third University of Rome, Italy) and Marzia A. Cremona (The Pennsylvania State University, USA).
-
-It implements a simplified version of the methods *smooth* and *plot* for *IWTomicsData* objects.
-The complete version can be found in the *R/Bioconductor* package *IWTomics* (see vignette_).
-
-.. _vignette: https://bioconductor.org/packages/release/bioc/vignettes/IWTomics/inst/doc/IWTomics.pdf
-  </help>
-
-  <citations>
-    <citation type="bibtex">
-      @ARTICLE{
-               iwt-functional-data,
-               author = {Pini, Alessia and Vantini, Simone},
-               title = {Interval-Wise Testing for functional data},
-               journal = {Journal of Nonparametric Statistics},
-               year = {2017},
-               volume = {29},
-               number = {2},
-               pages = {407-424}
-      }
-    </citation>
-    <citation type="bibtex">
-      @MANUAL{
-               iwtomics,
-               author = {Cremona, Marzia A and Pini, Alessia and Chiaromonte, Francesca and Vantini, Simone},
-               title = {IWTomics: Interval-Wise Testing for Omics Data},
-               note = {R package version 0.99.12},
-               year = {2017}
-      }
-    </citation>
-  </citations>
-
-</tool>
--- a/iwtomics/macros.xml	Wed May 31 11:06:00 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-<macros>
-    <token name="@VERSION@">1.0.0</token>
-    <xml name="requirements">
-        <requirements>
-            <requirement type="package" version="3.3.1">R</requirement>
-            <requirement type="package" version="@VERSION">bioconductor-iwtomics</requirement>
-        </requirements>
-    </xml>
-</macros>
\ No newline at end of file
--- a/iwtomics/plotwithscale.R	Wed May 31 11:06:00 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,117 +0,0 @@
-if (require("IWTomics",character.only = TRUE,quietly = FALSE)) {
-  args=commandArgs(TRUE)
-  
-  # get args names and values
-  args_values=strsplit(args,'=')
-  args_names=unlist(lapply(args_values,function(arg) arg[1]))
-  names(args_values)=args_names
-  args_values=lapply(args_values,function(arg) arg[2])
-  # read filenames
-  adjustedpvalue=args_values$adjustedpvalue
-  iwtomicsrespdf=args_values$iwtomicsrespdf
-  iwtomicssumpdf=args_values$iwtomicssumpdf
-  iwtomicsrdata=args_values$iwtomicsrdata
-  iwtomicstests=args_values$iwtomicstests
-  iwtomicsselectedfeatures=args_values$iwtomicsselectedfeatures
-  test_subset=paste0('c(',strsplit(args_values$test_subset,'\\|')[[1]],')')
-  feature_subset=paste0('c(',strsplit(args_values$feature_subset,'\\|')[[1]],')')
-  # read parameters (from test_subset on)
-  i_scale_subset=which(args_names=='scale_subset')
-  for(i in i_scale_subset:length(args)){
-    eval(parse(text=args[[i]]))
-  }
-  
-  # load RData
-  load(iwtomicsrdata)
-  # read testids and featureids and check them
-  unlisted=lapply(seq_along(test_subset),
-                   function(i){
-                     test_subset_i=eval(parse(text=test_subset[i]))
-                     feature_subset_i=eval(parse(text=feature_subset[i]))
-                     test_subset_i=rep(test_subset_i,each=length(feature_subset_i))
-                     feature_subset_i=rep(feature_subset_i,length.out=length(test_subset_i))
-                     scale_subset_i=rep(scale_subset[i],length(test_subset_i))
-                     return(list(test_subset=test_subset_i,feature_subset=feature_subset_i,scale_subset=scale_subset_i))
-                   })
-  test_subset=unlist(lapply(unlisted,function(l) l$test_subset))
-  feature_subset=unlist(lapply(unlisted,function(l) l$feature_subset))
-  scale_subset=unlist(lapply(unlisted,function(l) l$scale_subset))
-  testids=as.character(read.delim(iwtomicstests,header=FALSE,sep='\t',stringsAsFactors=FALSE))
-  featureids=as.character(read.delim(iwtomicsselectedfeatures,header=FALSE,sep='\t',stringsAsFactors=FALSE))
-  id_features_subset=featureids[feature_subset]
-  if(sum(testids!=paste(testInput(regionsFeatures_test)$id_region1,'vs',testInput(regionsFeatures_test)$id_region2))){
-    quit(save="no", status=10)
-    stop('Wrong test ids')
-  }
-  if(sum(featureids!=idFeatures(regionsFeatures_test))){
-    quit(save="no", status=20)
-    stop('Wrong feature ids')
-  }
-  # retrieve test and features_subset ids
-  id_features_subset=featureids[feature_subset]
-  if(sum(duplicated(paste0(test_subset,id_features_subset)))){
-    quit(save="no", status=30)
-    stop('Two scale thresholds selected for the same test and feature.')
-  }
-  # If scale_subset=0, do not change the threshold
-  default=(scale_subset==0)
-  scale_subset=scale_subset[!default]
-  test_subset=test_subset[!default]
-  id_features_subset=id_features_subset[!default]
-  
-  # get scale threshold
-  scale_threshold=lapply(regionsFeatures_test@test$result,
-                         function(result) unlist(lapply(result,function(feature) feature$max_scale)))
-  for(i in seq_along(test_subset)){
-    if(scale_threshold[[test_subset[i]]][id_features_subset[i]]<scale_subset[i]){
-      quit(save="no", status=40)
-      stop('Scale threshold too high.')
-    }
-    scale_threshold[[test_subset[i]]][id_features_subset[i]]=scale_subset[i]
-  }
-  
-  # create adjustedvalue output
-  pval=adjusted_pval(regionsFeatures_test,scale_threshold=scale_threshold)
-  for(test in seq_along(pval)){
-    for(id_feature in idFeatures(regionsFeatures_test)){
-      write(paste0('Test: ',testids[test],', on feature ',id_feature),
-              file=adjustedpvalue,append=TRUE,sep='\t')
-        pval_i=as.data.frame(t(pval[[test]][[id_feature]]))
-        row.names(pval_i)=paste('Scale',scale_threshold[[test]][[id_feature]])
-        write.table(pval_i,file=adjustedpvalue,append=TRUE,sep='\t',quote=FALSE,row.names=TRUE,col.names=FALSE)
-        write('',file=adjustedpvalue,append=TRUE,sep='\t')
-      }
-    }
-  
-  
-  # plot test results
-  pdf(iwtomicsrespdf,width=5,height=7)
-  if(plottype=='boxplot'){
-    # fix repeated probs
-    probs=sort(unique(probs))
-  }else{
-    probs=c(0.25,0.5,0.75)
-  }
-  plotTest(regionsFeatures_test,alpha=testalpha,type=plottype,probs=probs,average=average,size=size,scale_threshold=scale_threshold,ask=FALSE)
-  dev.off()
-  
-  # plot summary results
-  if(groupby!='none'){
-    tryCatch({
-      pdf(iwtomicssumpdf,width=15,height=10)
-      plotSummary(regionsFeatures_test,alpha=summaryalpha,only_significant=only_significant,groupby=groupby,scale_threshold=scale_threshold,ask=FALSE,append=TRUE)
-      dev.off()
-    }, error = function(err) {
-      if (grepl('selected features with different resolution',err$message)) {
-        quit(save="no", status=50) #error: groupby 'test' but selected features with different resolution.
-        stop(err)
-      }
-      quit(save="no", status=60) #error 
-      stop(err)
-    })
-  }
-  
-}else{
-  quit(save="no", status=255)
-  stop("Missing IWTomics package")
-}
\ No newline at end of file
--- a/iwtomics/plotwithscale.xml	Wed May 31 11:06:00 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,201 +0,0 @@
-<tool id="plotwithscale" name="IWTomics Plot with Threshold" version="@VERSION@.0">
-  <description>on Test Scale</description>
-  <macros>
-    <import>macros.xml</import>
-  </macros>
-  <expand macro="requirements" />
-  <stdio>
-    <exit_code range="-1" source="both" level="fatal" description="Missing IWTomics package. Please be sure to have it installed before using this tool." />
-    <exit_code range="10" source="both" level="fatal" description="Wrong test ids." />
-    <exit_code range="20" source="both" level="fatal" description="Wrong feature ids." />
-    <exit_code range="30" source="both" level="fatal" description="Two scale thresholds selected for the same test and feature." />
-    <exit_code range="40" source="both" level="fatal" description="Scale threshold too high." />
-    <exit_code range="50" source="both" level="fatal" description="Group by 'test' but selected features with different resolution." />
-    <exit_code range="60" source="both" level="fatal" description="Summary plot error. Please try again." />
-    <regex match="Error" source="both" level="fatal" description="An error has occurred. Please try again." />
-  </stdio>
-
-  <command>
-<![CDATA[
-    Rscript $__tool_directory__/plotwithscale.R adjustedpvalue="${adjustedpvalue}" iwtomicsrespdf="${iwtomicsrespdf}" iwtomicssumpdf="${iwtomicssumpdf}"
-      iwtomicsrdata="${rdata}"
-      iwtomicstests="${testids}"
-      iwtomicsselectedfeatures="${featureids}"
-
-      #set test_subset = '"\\|"'.join( [ str( $e.test ) for $e in $scalesection.thresholdontestscale ] )
-      test_subset="${test_subset}"
-      #set feature_subset = '"\\|"'.join( [ str( $e.feature ) for $e in $scalesection.thresholdontestscale ] )
-      feature_subset="${feature_subset}"
-      #set scale_subset = '","'.join( [ str( $e.scale ) for $e in $scalesection.thresholdontestscale ] )
-      scale_subset="c(${scale_subset})"
-
-      testalpha="${plotres.alpha}"
-      average="${plotres.average}"
-      size="${plotres.size}"
-      plottype="'${plotres.conditionalplottype.plottype}'"
-      #if $plotres.conditionalplottype.plottype == 'boxplot':
-        #set probs = '","'.join( [ str( $p.prob ) for $p in $plotres.conditionalplottype.probabilitiessection.probabilities ] )
-        #if $probs != "":
-          probs="c(${plotres.conditionalplottype.probabilitiessection.prob0},${plotres.conditionalplottype.probabilitiessection.prob1},${plotres.conditionalplottype.probabilitiessection.prob2},${probs})"
-        #else:
-          probs="c(${plotres.conditionalplottype.probabilitiessection.prob0},${plotres.conditionalplottype.probabilitiessection.prob1},${plotres.conditionalplottype.probabilitiessection.prob2})"
-        #end if
-      #end if
-
-      groupby="'${plotsum.conditionalgroupby.groupby}'"
-      #if $plotsum.conditionalgroupby.groupby == "test":
-        summaryalpha="${plotsum.conditionalgroupby.testalphaplot}"
-        only_significant="${plotsum.conditionalgroupby.testonlysig}"
-      #elif $plotsum.conditionalgroupby.groupby == "feature":
-        summaryalpha="${plotsum.conditionalgroupby.featurealphaplot}"
-        only_significant="${plotsum.conditionalgroupby.featureonlysig}"
-      #end if
-
-      >& /dev/null
-]]>
-    <!--
-    to print the stack add the following line at the end of the command and enable the corresponding entry in output
-    2> "${stackerr}"
-    -->
-  </command>
-
-  <inputs>
-    <help>
-    ...
-    </help>
-
-    <!-- RData -->
-    <param format="rdata" name="rdata" type="data" label="Select IWTomicsData object with test results" help="File created by 'IWTomics Test and Plot'." />
-    <!-- test IDs -->
-    <param format="tabular" name="testids" type="data" label="Select test IDs" help="File created by 'IWTomics Test and Plot'." />
-    <!-- feature IDs -->
-    <param format="tabular" name="featureids" type="data" label="Select feature IDs" help="File created by 'IWTomics Test and Plot'." />
-
-    <!-- repeat threshold on test scale -->
-    <section name="scalesection" title="Select scale for Interval-Wise Testing and plot" expanded="True" help="Maximum interval length for the p-value adjustment. If 0 the maximum possible scale is used.">
-      <repeat name="thresholdontestscale" title="Threshold on test scale" min="1">
-        <param name="test" type="data_column" data_ref="testids" numerical="False" label="Test ID" multiple="True" use_header_names="True" />
-        <param name="feature" type="data_column" data_ref="featureids" numerical="False" label="Feature ID" multiple="True" use_header_names="True" />
-        <param name="scale" type="integer" value="0" min="0" label="Scale" />
-      </repeat>
-    </section>
-
-    <!-- plot IWTomics results -->
-    <section name="plotres" title="Plot IWTomics test results" expanded="True">
-      <!-- alpha -->
-      <param name="alpha" size="3" type="float" value="0.05" min="0.0" max="1.0" label="Level of the test (alpha)" />
-      <!-- average -->
-      <param name="average" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="True" label="Plot the mean curves" />
-      <!-- average -->
-      <param name="size" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="True" label="Plot sample size in each position" />
-      <!-- conditional plot type -->
-      <conditional name="conditionalplottype">
-        <!-- plot type -->
-        <param name="plottype" type="select" label="Plot type">
-          <option value="boxplot">Pointwise quantile curves (boxplot)</option>
-          <option value="curves">Curves (aligned)</option>
-        </param>
-        <!-- conditional choice: plottype=boxplot -->
-        <when value="boxplot">
-          <section name="probabilitiessection" title="Probabilities" expanded="True" help="Probabilities corresponding to the quantile curves to be drawn.">
-            <param name="prob0" size="3" type="float" value="0.25" min="0.0" max="1.0" label="Probability" />
-            <param name="prob1" size="3" type="float" value="0.5" min="0.0" max="1.0" label="Probability" />
-            <param name="prob2" size="3" type="float" value="0.75" min="0.0" max="1.0" label="Probability" />
-            <repeat name="probabilities" title="Probabilities">
-              <param name="prob" size="3" type="float" value="0.5" min="0.0" max="1.0" label="Probability" />
-            </repeat>
-          </section>
-        </when>
-      </conditional>
-    </section>
-
-    <!-- summary plot -->
-    <section name="plotsum" title="Summary plot" expanded="True">
-      <!-- conditional group by -->
-      <conditional name="conditionalgroupby">
-        <!-- group by -->
-        <param name="groupby" type="select" label="Group by" help="How tests should be grouped.">
-          <option value="none">No plot</option>
-          <option value="test">Group by test</option>
-          <option value="feature">Group by feature</option>
-        </param>
-        <when value="test">
-          <param name="testalphaplot" size="3" type="float" value="0.05" min="0.0" max="1.0" label="Level of the test (alpha)" />
-          <param name="testonlysig" type="boolean" truevalue="TRUE" falsevalue="FALSE" label="Plot only significant tests" />
-        </when>
-        <when value="feature">
-          <param name="featurealphaplot" size="3" type="float" value="0.05" min="0.0" max="1.0" label="Level of the test (alpha)" />
-          <param name="featureonlysig" type="boolean" truevalue="TRUE" falsevalue="FALSE" label="Plot only significant tests" />
-        </when>
-      </conditional>
-    </section>
-  </inputs>
-
-  <outputs>
-    <!--<data format="txt" name="stackerr" label="iwtomics.testandplot.stackerr.txt" from_work_dir="iwtomics.testandplot.stackerr.txt" />-->
-    <data format="txt" name="adjustedpvalue" label="${tool.name} on ${on_string}: Adjusted p-value" from_work_dir="iwtomics.testandplot.adjustedpvalue.txt" />
-    <data format="pdf" name="iwtomicsrespdf" label="${tool.name} on ${on_string}: Plotted Test Results" from_work_dir="iwtomics.testandplot.iwtomicstestresults.pdf" />
-    <data format="pdf" name="iwtomicssumpdf" label="${tool.name} on ${on_string}: Summary Plot" from_work_dir="iwtomics.testandplot.summaryplot.pdf" />
-  </outputs>
-
-  <help>
-This tool allows to select the scale for the Interval-Wise Testing results. In particular, it returns the p-value curves
-for the different tests performed at the selected scale, and it creates a graphical representation of the
-Interval-Wise Testing results and a summary plot (optional) at the selected scale.
-
------
-
-**Input files**
-
-RData file with the IWTomicsData object with test results, tabular files with test IDs and feature IDs.
-These files are created by the tool *IWTomics Test and Plot*.
-
------
-
-**Output**
-
-The tool returns:
-
-1. TXT file with an adjusted p-value curve for every test performed at the selected scale;
-2. PDF file with the plotted test results;
-3. PDF file with the summary plot.
-
------
-
-.. class:: infomark
-
-**Notes**
-
-This Galaxy tool has been developed by Fabio Cumbo (Third University of Rome, Italy) and Marzia A. Cremona (The Pennsylvania State University, USA).
-
-It implements a simplified version of the function *IWTomicsTest*, *plotTest* and *plotSummary* for *IWTomicsData* objects.
-The complete version can be found in the *R/Bioconductor* package *IWTomics* (see vignette_).
-
-.. _vignette: https://bioconductor.org/packages/release/bioc/vignettes/IWTomics/inst/doc/IWTomics.pdf
-  </help>
-
-  <citations>
-    <citation type="bibtex">
-      @ARTICLE{
-               iwt-functional-data,
-               author = {A Pini and S. Vantini},
-               title = {Interval-Wise Testing for functional data},
-               journal = {Journal of Nonparametric Statistics},
-               year = {2017},
-               volume = {29},
-               number = {2},
-               pages = {407-424}
-      }
-    </citation>
-    <citation type="bibtex">
-      @MANUAL{
-               iwtomics,
-               author = {Cremona, Marzia A and Pini, Alessia and Chiaromonte, Francesca and Vantini, Simone},
-               title = {IWTomics: Interval-Wise Testing for Omics Data},
-               note = {R package version 0.99.12},
-               year = {2017}
-      }
-    </citation>
-  </citations>
-
-</tool>
--- a/iwtomics/testandplot.R	Wed May 31 11:06:00 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,99 +0,0 @@
-if (require("IWTomics",character.only = TRUE,quietly = FALSE)) {
-  args=commandArgs(TRUE)
-  
-  # get args names and values
-  args_values=strsplit(args,'=')
-  args_names=unlist(lapply(args_values,function(arg) arg[1]))
-  names(args_values)=args_names
-  args_values=lapply(args_values,function(arg) arg[2])
-  # read filenames
-  adjustedpvaluematrix=args_values$adjustedpvaluematrix
-  iwtomicsrespdf=args_values$iwtomicsrespdf
-  iwtomicssumpdf=args_values$iwtomicssumpdf
-  regionids=args_values$regionids
-  featureids=args_values$featureids
-  rdatafile=args_values$rdatafile
-  iwtomicsrdata=args_values$iwtomicsrdata
-  iwtomicstests=args_values$iwtomicstests
-  iwtomicsselectedfeatures=args_values$iwtomicsselectedfeatures
-  # read parameters (from region1 on)
-  i_region1=which(args_names=='region1')
-  for(i in i_region1:length(args)){
-    eval(parse(text=args[[i]]))
-  }
-  
-  # load RData
-  load(rdatafile)
-  # read regionids and featureids
-  regionids=as.character(read.delim(regionids,header=FALSE,sep='\t',stringsAsFactors=FALSE))
-  featureids=as.character(read.delim(featureids,header=FALSE,sep='\t',stringsAsFactors=FALSE))
-  # retrieve region1, region2 and features_subset ids and check they are in the RData
-  id_region1=regionids[region1]
-  id_region2=regionids[region2]
-  id_features_subset=featureids[features_subset]
-  if(length(setdiff(c(id_region1,id_region2),idRegions(regionsFeatures)))!=0){
-    quit(save="no", status=10)
-    stop('Wrong region ids')
-  }
-  if(length(setdiff(id_features_subset,idFeatures(regionsFeatures)))!=0){
-    quit(save="no", status=20)
-    stop('Wrong feature ids')
-  }
-  if(sum(duplicated(paste0(id_region1,id_region2)))){
-    quit(save="no", status=30)
-    stop('Same test repeated multiple times.')
-  }
-  
-  # perform test
-  tryCatch({
-    # fix repeated probs
-    if(statistics=='quantile'){
-      # fix repeated probs
-      testprobs=sort(unique(testprobs))
-    }else{
-      testprobs=0.5
-    }
-    regionsFeatures_test=IWTomicsTest(regionsFeatures,id_region1,id_region2,id_features_subset,
-                                      statistics=statistics,probs=testprobs,B=B)
-    # create adjustedvaluematrix output
-    for(test in seq_along(id_region1)){
-      for(id_feature in id_features_subset){
-        write(paste0('Test: ',id_region1[test],' vs ',id_region2[test],', on feature ',id_feature),
-              file=adjustedpvaluematrix,append=TRUE,sep='\t')
-        pval=regionsFeatures_test@test$result[[test]][[id_feature]]$adjusted_pval_matrix
-        row.names(pval)=paste('Scale',rev(seq_len(nrow(pval))))
-        write.table(pval,file=adjustedpvaluematrix,append=TRUE,sep='\t',quote=FALSE,row.names=TRUE,col.names=FALSE)
-        write('',file=adjustedpvaluematrix,append=TRUE,sep='\t')
-      }
-    }
-  }, error = function(err) {
-    quit(save="no", status=40) #error testing
-    stop(err)
-  })
-  
-  # plot test results
-  pdf(iwtomicsrespdf,width=5,height=7)
-  if(plottype=='boxplot'){
-    # fix repeated probs
-    probs=sort(unique(probs))
-  }else{
-    probs=c(0.25,0.5,0.75)
-  }
-  plotTest(regionsFeatures_test,alpha=testalpha,type=plottype,probs=probs,average=average,size=size,ask=FALSE)
-  dev.off()
-  
-  # plot summary results
-  if(groupby!='none'){
-    pdf(iwtomicssumpdf,width=15,height=10)
-    plotSummary(regionsFeatures_test,alpha=summaryalpha,only_significant=only_significant,groupby=groupby,ask=FALSE,append=TRUE)
-    dev.off()
-  }
-  
-  # create output
-  write.table(as.data.frame(t(paste(id_region1,'vs',id_region2))),file=iwtomicstests,quote=FALSE,sep='\t',row.names=FALSE,col.names=FALSE)
-  write.table(as.data.frame(t(idFeatures(regionsFeatures_test))),file=iwtomicsselectedfeatures,quote=FALSE,sep='\t',row.names=FALSE,col.names=FALSE)
-  save(regionsFeatures_test,file=iwtomicsrdata)
-}else{
-  quit(save="no", status=255)
-  stop("Missing IWTomics package")
-}
\ No newline at end of file
--- a/iwtomics/testandplot.xml	Wed May 31 11:06:00 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,239 +0,0 @@
-<tool id="testandplot" name="IWTomics Test" version="@VERSION@.0">
-  <description>and Plot</description>
-  <macros>
-    <import>macros.xml</import>
-  </macros>
-  <expand macro="requirements" />
-  <stdio>
-    <exit_code range="-1" source="both" level="fatal" description="Missing IWTomics package. Please be sure to have it installed before using this tool." />
-    <exit_code range="10" source="both" level="fatal" description="Wrong region ids." />
-    <exit_code range="20" source="both" level="fatal" description="Wrong feature ids." />
-    <exit_code range="30" source="both" level="fatal" description="Same test repeated multiple times." />
-    <exit_code range="40" source="both" level="fatal" description="Testing error." />
-    <regex match="Error" source="both" level="fatal" description="An error has occurred. Please try again." />
-  </stdio>
-
-  <command>
-<![CDATA[
-    Rscript $__tool_directory__/testandplot.R adjustedpvaluematrix="${adjustedpvaluematrix}" iwtomicsrespdf="${iwtomicsrespdf}" iwtomicssumpdf="${iwtomicssumpdf}" iwtomicsrdata="${iwtomicsrdata}" iwtomicstests="${iwtomicstests}" iwtomicsselectedfeatures="${iwtomicsselectedfeatures}"
-      regionids="${regionids}"
-      featureids="${featureids}"
-      rdatafile="${rdata}"
-
-      #set region1 = '","'.join( [ str( $r.region0 ) for $r in $regionssection.regions ] )
-      #set region2 = '","'.join( [ str( $r.region1 ) for $r in $regionssection.regions ] )
-      region1="c(${region1})"
-      region2="c(${region2})"
-
-      features_subset="c(${featureslist})"
-
-      statistics="'${conditionalstatistics.statistics}'"
-      #if $conditionalstatistics.statistics == "quantile":
-        #set probabilities = '","'.join( [ str( $p.qprob ) for $p in $conditionalstatistics.quantilesection.qprobabilities ] )
-        testprobs="c(${probabilities})"
-      #end if
-
-      B="${permutations}"
-
-      testalpha="${plotres.alpha}"
-      average="${plotres.average}"
-      size="${plotres.size}"
-      plottype="'${plotres.conditionalplottype.plottype}'"
-      #if $plotres.conditionalplottype.plottype == 'boxplot':
-        #set probs = '","'.join( [ str( $p.prob ) for $p in $plotres.conditionalplottype.probabilitiessection.probabilities ] )
-        #if $probs != "":
-          probs="c(${plotres.conditionalplottype.probabilitiessection.prob0},${plotres.conditionalplottype.probabilitiessection.prob1},${plotres.conditionalplottype.probabilitiessection.prob2},${probs})"
-        #else:
-          probs="c(${plotres.conditionalplottype.probabilitiessection.prob0},${plotres.conditionalplottype.probabilitiessection.prob1},${plotres.conditionalplottype.probabilitiessection.prob2})"
-        #end if
-      #end if
-
-      groupby="'${plotsum.conditionalgroupby.groupby}'"
-      #if $plotsum.conditionalgroupby.groupby == "test":
-        summaryalpha="${plotsum.conditionalgroupby.testalphaplot}"
-        only_significant="${plotsum.conditionalgroupby.testonlysig}"
-      #elif $plotsum.conditionalgroupby.groupby == "feature":
-        summaryalpha="${plotsum.conditionalgroupby.featurealphaplot}"
-        only_significant="${plotsum.conditionalgroupby.featureonlysig}"
-      #end if
-
-     >& /dev/null
-]]>
-    <!--
-    to print the stack add the following line at the end of the command and enable the corresponding entry in output
-    2> "${stackerr}"
-    -->
-  </command>
-
-  <inputs>
-    <!-- RData -->
-    <param format="rdata" name="rdata" type="data" label="Select IWTomicsData object" help="File created by 'IWTomics Load Smooth and Plot'." />
-    <!-- region IDs -->
-    <param format="tabular" name="regionids" type="data" label="Select region dataset IDs" help="File created by 'IWTomics Load Smooth and Plot'." />
-    <!-- feature IDs -->
-    <param format="tabular" name="featureids" type="data" label="Select feature IDs" help="File created by 'IWTomics Load Smooth and Plot'." />
-
-    <!-- repeat region ids -->
-    <section name="regionssection" title="Select regions for Interval-Wise Testing" expanded="True" help="IDs of the region datasets to be tested.">
-      <repeat name="regions" title="Two-sample test" min="1">
-        <param name="region0" type="data_column" data_ref="regionids" numerical="False" label="Region 1" multiple="False" use_header_names="True" />
-        <param name="region1" type="data_column" data_ref="regionids" numerical="False" label="Region 2" multiple="False" use_header_names="True" />
-      </repeat>
-    </section>
-
-    <!-- feature ids list -->
-    <param name="featureslist" type="data_column" data_ref="featureids" numerical="False" label="Select features" multiple="True" use_header_names="True" help="IDs of the features to be tested." />
-
-    <!-- conditional statistics -->
-    <conditional name="conditionalstatistics">
-      <!-- statistics -->
-      <param name="statistics" type="select" label="Test statistics">
-        <option value="mean">Mean difference</option>
-        <option value="median">Median difference</option>
-        <option value="variance">Variance ratio</option>
-        <option value="quantile">Quantile difference(s)</option>
-      </param>
-      <!-- conditional choice: statistics=quantile -->
-      <when value="quantile">
-        <section name="quantilesection" title="Probabilities" expanded="True" help="Probabilities corresponding to the quantiles in test statistics.">
-          <repeat name="qprobabilities" title="Probabilities" min="1">
-            <param name="qprob" size="4" type="float" value="0.5" min="0.0" max="1.0" label="Probability" />
-          </repeat>
-        </section>
-      </when>
-    </conditional>
-
-    <!-- permutations -->
-    <param name="permutations" type="integer" value="1000" min="1" label="Number of permutations" />
-
-    <!-- plot IWTomics results -->
-    <section name="plotres" title="Plot IWTomics test results" expanded="True">
-      <!-- alpha -->
-      <param name="alpha" size="3" type="float" value="0.05" min="0.0" max="1.0" label="Level of the test (alpha)" />
-      <!-- average -->
-      <param name="average" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="True" label="Plot the mean curves" />
-      <!-- average -->
-      <param name="size" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="True" label="Plot sample size in each position" />
-      <!-- conditional plot type -->
-      <conditional name="conditionalplottype">
-        <!-- plot type -->
-        <param name="plottype" type="select" label="Plot type">
-          <option value="boxplot">Pointwise quantile curves (boxplot)</option>
-          <option value="curves">Curves (aligned)</option>
-        </param>
-        <!-- conditional choice: plottype=boxplot -->
-        <when value="boxplot">
-          <section name="probabilitiessection" title="Probabilities" expanded="True" help="Probabilities corresponding to the quantile curves to be drawn.">
-            <param name="prob0" size="3" type="float" value="0.25" min="0.0" max="1.0" label="Probability" />
-            <param name="prob1" size="3" type="float" value="0.5" min="0.0" max="1.0" label="Probability" />
-            <param name="prob2" size="3" type="float" value="0.75" min="0.0" max="1.0" label="Probability" />
-            <repeat name="probabilities" title="Probabilities">
-              <param name="prob" size="3" type="float" value="0.5" min="0.0" max="1.0" label="Probability" />
-            </repeat>
-          </section>
-        </when>
-      </conditional>
-    </section>
-
-    <!-- summary plot -->
-    <section name="plotsum" title="Summary plot" expanded="True">
-      <!-- conditional group by -->
-      <conditional name="conditionalgroupby">
-        <!-- group by -->
-        <param name="groupby" type="select" label="Group by" help="How tests should be grouped.">
-          <option value="none">No plot</option>
-          <option value="test">Group by test</option>
-          <option value="feature">Group by feature</option>
-        </param>
-        <when value="test">
-          <param name="testalphaplot" size="3" type="float" value="0.05" min="0.0" max="1.0" label="Level of the test (alpha)" />
-          <param name="testonlysig" type="boolean" truevalue="TRUE" falsevalue="FALSE" label="Plot only significant tests" />
-        </when>
-        <when value="feature">
-          <param name="featurealphaplot" size="3" type="float" value="0.05" min="0.0" max="1.0" label="Level of the test (alpha)" />
-          <param name="featureonlysig" type="boolean" truevalue="TRUE" falsevalue="FALSE" label="Plot only significant tests" />
-        </when>
-      </conditional>
-    </section>
-  </inputs>
-
-  <outputs>
-    <!--<data format="txt" name="stackerr" label="iwtomics.testandplot.stackerr.txt" from_work_dir="iwtomics.testandplot.stackerr.txt" />-->
-    <data format="txt" name="adjustedpvaluematrix" label="${tool.name} on ${on_string}: Adjusted p-value Matrix" from_work_dir="iwtomics.testandplot.adjustedpvalue.matrix.txt" />
-    <data format="pdf" name="iwtomicsrespdf" label="${tool.name} on ${on_string}: Plotted Test Results" from_work_dir="iwtomics.testandplot.iwtomicstestresults.pdf" />
-    <data format="pdf" name="iwtomicssumpdf" label="${tool.name} on ${on_string}: Summary Plot" from_work_dir="iwtomics.testandplot.summaryplot.pdf" />
-    <data format="rdata" name="iwtomicsrdata" label="${tool.name} on ${on_string}: IWTomicsData Object with Test Results" from_work_dir="iwtomics.testandplot.RData" />
-    <data format="tabular" name="iwtomicstests" label="${tool.name} on ${on_string}: Test IDs" from_work_dir="iwtomics.testandplot.tests.txt" />
-    <data format="tabular" name="iwtomicsselectedfeatures" label="${tool.name} on ${on_string}: Feature IDs" from_work_dir="iwtomics.testandplot.selectedfeatures.txt" />
-  </outputs>
-
-  <help>
-This tool statistically evaluates differences in genomic features between groups of regions along the genome.
-In particular, it implements the Interval-Wise Testing for omics data, an extended version of the Interval-Wise
-Testing for functional data presented in Pini and Vantini (2017). It allows to perform multiple two sample permutation
-tests between pairs of region datasets, on several features. It returns the adjusted p-value curves for every test
-and all possible scales. Moreover, it creates a graphical representation of the Interval-Wise Testing results
-and a summary plot (optional) with p-values at the maximum scale. The tool *IWTomics Plot with Threshold on Test Scale*
-permits to select the scale to be used in the plots.
-
------
-
-**Input files**
-
-RData file with the IWTomicsData object, tabular files with region dataset IDs and feature IDs.
-These files are created by the tool *IWTomics Load Smooth and Plot*.
-
------
-
-**Output**
-
-The tool returns:
-
-1. TXT file with an adjusted p-value matrix for every test performed. Each matrix contains a p-value curve (row) for every scale considered in the test;
-2. PDF file with the plotted test results;
-3. PDF file with the summary plot;
-4. RData with the IWTomicsData object with the test results;
-5. Test identifiers;
-6. Feature identifiers.
-
-4-6 can be used as input of the tool *IWTomics Plot with Threshold on Test Scale*
-
------
-
-.. class:: infomark
-
-**Notes**
-
-This Galaxy tool has been developed by Fabio Cumbo (Third University of Rome, Italy) and Marzia A. Cremona (The Pennsylvania State University, USA).
-
-It implements a simplified version of the function *IWTomicsTest*, *plotTest* and *plotSummary* for *IWTomicsData* objects.
-The complete version can be found in the *R/Bioconductor* package *IWTomics* (see vignette_).
-
-.. _vignette: https://bioconductor.org/packages/release/bioc/vignettes/IWTomics/inst/doc/IWTomics.pdf
-  </help>
-
-  <citations>
-    <citation type="bibtex">
-      @ARTICLE{
-               iwt-functional-data,
-               author = {A Pini and S. Vantini},
-               title = {Interval-Wise Testing for functional data},
-               journal = {Journal of Nonparametric Statistics},
-               year = {2017},
-               volume = {29},
-               number = {2},
-               pages = {407-424}
-      }
-    </citation>
-    <citation type="bibtex">
-      @MANUAL{
-               iwtomics,
-               author = {Cremona, Marzia A and Pini, Alessia and Chiaromonte, Francesca and Vantini, Simone},
-               title = {IWTomics: Interval-Wise Testing for Omics Data},
-               note = {R package version 0.99.12},
-               year = {2017}
-      }
-    </citation>
-  </citations>
-
-</tool>