diff --git a/tool_conf.xml.main b/tool_conf.xml.main
index d2667bc3c21..5edaea28a4c 100644
--- a/tool_conf.xml.main
+++ b/tool_conf.xml.main
@@ -25,7 +25,7 @@
-
+
@@ -38,15 +38,15 @@
-
+
-
-
+
+
@@ -84,42 +84,42 @@
-->
-
-
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
+
+
+
+
diff --git a/tool_conf.xml.sample b/tool_conf.xml.sample
index 8cdbfa297f4..29f7fdbf81b 100644
--- a/tool_conf.xml.sample
+++ b/tool_conf.xml.sample
@@ -10,7 +10,7 @@
-
+
@@ -29,7 +29,7 @@
-
+
@@ -42,15 +42,15 @@
-
+
-
-
+
+
@@ -88,42 +88,42 @@
-
-
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/tools/new_operations/gops_basecoverage_1/1.0.0/basecoverage.xml b/tools/new_operations/basecoverage.xml
similarity index 96%
rename from tools/new_operations/gops_basecoverage_1/1.0.0/basecoverage.xml
rename to tools/new_operations/basecoverage.xml
index 0e3b81ece20..3cff9258a7b 100644
--- a/tools/new_operations/gops_basecoverage_1/1.0.0/basecoverage.xml
+++ b/tools/new_operations/basecoverage.xml
@@ -9,7 +9,7 @@
-
+
diff --git a/tools/new_operations/gops_cluster_1/1.0.0/cluster.xml b/tools/new_operations/cluster.xml
similarity index 98%
rename from tools/new_operations/gops_cluster_1/1.0.0/cluster.xml
rename to tools/new_operations/cluster.xml
index b985dc19450..03020674f05 100644
--- a/tools/new_operations/gops_cluster_1/1.0.0/cluster.xml
+++ b/tools/new_operations/cluster.xml
@@ -22,7 +22,7 @@
-
+
diff --git a/tools/new_operations/gops_complement_1/1.0.0/complement.xml b/tools/new_operations/complement.xml
similarity index 97%
rename from tools/new_operations/gops_complement_1/1.0.0/complement.xml
rename to tools/new_operations/complement.xml
index c3ea07e769c..cd5350a0d04 100644
--- a/tools/new_operations/gops_complement_1/1.0.0/complement.xml
+++ b/tools/new_operations/complement.xml
@@ -11,7 +11,7 @@
-
+
diff --git a/tools/new_operations/gops_concat_1/1.0.0/concat.xml b/tools/new_operations/concat.xml
similarity index 97%
rename from tools/new_operations/gops_concat_1/1.0.0/concat.xml
rename to tools/new_operations/concat.xml
index 010bb5d6c85..e859117522d 100644
--- a/tools/new_operations/gops_concat_1/1.0.0/concat.xml
+++ b/tools/new_operations/concat.xml
@@ -14,7 +14,7 @@
-
+
diff --git a/tools/new_operations/gops_coverage_1/1.0.0/coverage.xml b/tools/new_operations/coverage.xml
similarity index 98%
rename from tools/new_operations/gops_coverage_1/1.0.0/coverage.xml
rename to tools/new_operations/coverage.xml
index 420b4d99b8d..3c72c99c357 100644
--- a/tools/new_operations/gops_coverage_1/1.0.0/coverage.xml
+++ b/tools/new_operations/coverage.xml
@@ -12,7 +12,7 @@
-
+
diff --git a/tools/new_operations/get_flanks1/1.0.0/get_flanks.py b/tools/new_operations/get_flanks.py
similarity index 100%
rename from tools/new_operations/get_flanks1/1.0.0/get_flanks.py
rename to tools/new_operations/get_flanks.py
diff --git a/tools/new_operations/get_flanks1/1.0.0/get_flanks.xml b/tools/new_operations/get_flanks.xml
similarity index 100%
rename from tools/new_operations/get_flanks1/1.0.0/get_flanks.xml
rename to tools/new_operations/get_flanks.xml
diff --git a/tools/new_operations/gops_basecoverage_1/1.0.0/gops_basecoverage.py b/tools/new_operations/gops_basecoverage.py
similarity index 100%
rename from tools/new_operations/gops_basecoverage_1/1.0.0/gops_basecoverage.py
rename to tools/new_operations/gops_basecoverage.py
diff --git a/tools/new_operations/gops_cluster_1/1.0.0/gops_cluster.py b/tools/new_operations/gops_cluster.py
similarity index 100%
rename from tools/new_operations/gops_cluster_1/1.0.0/gops_cluster.py
rename to tools/new_operations/gops_cluster.py
diff --git a/tools/new_operations/gops_complement_1/1.0.0/gops_complement.py b/tools/new_operations/gops_complement.py
similarity index 100%
rename from tools/new_operations/gops_complement_1/1.0.0/gops_complement.py
rename to tools/new_operations/gops_complement.py
diff --git a/tools/new_operations/gops_concat_1/1.0.0/gops_concat.py b/tools/new_operations/gops_concat.py
similarity index 100%
rename from tools/new_operations/gops_concat_1/1.0.0/gops_concat.py
rename to tools/new_operations/gops_concat.py
diff --git a/tools/new_operations/gops_coverage_1/1.0.0/gops_coverage.py b/tools/new_operations/gops_coverage.py
similarity index 100%
rename from tools/new_operations/gops_coverage_1/1.0.0/gops_coverage.py
rename to tools/new_operations/gops_coverage.py
diff --git a/tools/new_operations/gops_intersect_1/1.0.0/gops_intersect.py b/tools/new_operations/gops_intersect.py
similarity index 100%
rename from tools/new_operations/gops_intersect_1/1.0.0/gops_intersect.py
rename to tools/new_operations/gops_intersect.py
diff --git a/tools/new_operations/gops_join_1/1.0.0/gops_join.py b/tools/new_operations/gops_join.py
similarity index 100%
rename from tools/new_operations/gops_join_1/1.0.0/gops_join.py
rename to tools/new_operations/gops_join.py
diff --git a/tools/new_operations/gops_merge_1/1.0.0/gops_merge.py b/tools/new_operations/gops_merge.py
similarity index 100%
rename from tools/new_operations/gops_merge_1/1.0.0/gops_merge.py
rename to tools/new_operations/gops_merge.py
diff --git a/tools/new_operations/gops_subtract_1/1.0.0/gops_subtract.py b/tools/new_operations/gops_subtract.py
similarity index 100%
rename from tools/new_operations/gops_subtract_1/1.0.0/gops_subtract.py
rename to tools/new_operations/gops_subtract.py
diff --git a/tools/new_operations/gops_intersect_1/1.0.0/intersect.xml b/tools/new_operations/intersect.xml
similarity index 96%
rename from tools/new_operations/gops_intersect_1/1.0.0/intersect.xml
rename to tools/new_operations/intersect.xml
index ad71c779b5c..4a012f03443 100644
--- a/tools/new_operations/gops_intersect_1/1.0.0/intersect.xml
+++ b/tools/new_operations/intersect.xml
@@ -20,7 +20,7 @@
-
+
diff --git a/tools/new_operations/gops_join_1/1.0.0/join.xml b/tools/new_operations/join.xml
similarity index 99%
rename from tools/new_operations/gops_join_1/1.0.0/join.xml
rename to tools/new_operations/join.xml
index e54a9884bb0..c801b20ca7e 100644
--- a/tools/new_operations/gops_join_1/1.0.0/join.xml
+++ b/tools/new_operations/join.xml
@@ -21,7 +21,7 @@
-
+
diff --git a/tools/new_operations/gops_merge_1/1.0.0/merge.xml b/tools/new_operations/merge.xml
similarity index 97%
rename from tools/new_operations/gops_merge_1/1.0.0/merge.xml
rename to tools/new_operations/merge.xml
index 918fd1779f4..b842d10ecfd 100644
--- a/tools/new_operations/gops_merge_1/1.0.0/merge.xml
+++ b/tools/new_operations/merge.xml
@@ -12,7 +12,7 @@
-
+
diff --git a/tools/new_operations/gops_subtract_1/1.0.0/subtract.xml b/tools/new_operations/subtract.xml
similarity index 98%
rename from tools/new_operations/gops_subtract_1/1.0.0/subtract.xml
rename to tools/new_operations/subtract.xml
index 9af4649e212..dd12648738c 100644
--- a/tools/new_operations/gops_subtract_1/1.0.0/subtract.xml
+++ b/tools/new_operations/subtract.xml
@@ -23,7 +23,7 @@
-
+
diff --git a/tools/new_operations/subtract_query1/1.0.0/subtract_query.py b/tools/new_operations/subtract_query.py
similarity index 100%
rename from tools/new_operations/subtract_query1/1.0.0/subtract_query.py
rename to tools/new_operations/subtract_query.py
diff --git a/tools/new_operations/subtract_query1/1.0.0/subtract_query.xml b/tools/new_operations/subtract_query.xml
similarity index 100%
rename from tools/new_operations/subtract_query1/1.0.0/subtract_query.xml
rename to tools/new_operations/subtract_query.xml
diff --git a/tools/plotting/histogram_rpy/1.0.0/histogram.py b/tools/plotting/histogram.py
similarity index 100%
rename from tools/plotting/histogram_rpy/1.0.0/histogram.py
rename to tools/plotting/histogram.py
diff --git a/tools/plotting/histogram_rpy/1.0.0/histogram2.xml b/tools/plotting/histogram2.xml
similarity index 100%
rename from tools/plotting/histogram_rpy/1.0.0/histogram2.xml
rename to tools/plotting/histogram2.xml
diff --git a/tools/plotting/XY_Plot_1/1.0.0/r_wrapper.sh b/tools/plotting/r_wrapper.sh
similarity index 100%
rename from tools/plotting/XY_Plot_1/1.0.0/r_wrapper.sh
rename to tools/plotting/r_wrapper.sh
diff --git a/tools/plotting/scatterplot_rpy/1.0.0/scatterplot.py b/tools/plotting/scatterplot.py
similarity index 100%
rename from tools/plotting/scatterplot_rpy/1.0.0/scatterplot.py
rename to tools/plotting/scatterplot.py
diff --git a/tools/plotting/scatterplot_rpy/1.0.0/scatterplot.xml b/tools/plotting/scatterplot.xml
similarity index 100%
rename from tools/plotting/scatterplot_rpy/1.0.0/scatterplot.xml
rename to tools/plotting/scatterplot.xml
diff --git a/tools/plotting/XY_Plot_1/1.0.0/xy_plot.xml b/tools/plotting/xy_plot.xml
similarity index 100%
rename from tools/plotting/XY_Plot_1/1.0.0/xy_plot.xml
rename to tools/plotting/xy_plot.xml
diff --git a/tools/regVariation/featureCoverage1/1.0.0/featureCounter.py b/tools/regVariation/featureCounter.py
similarity index 100%
rename from tools/regVariation/featureCoverage1/1.0.0/featureCounter.py
rename to tools/regVariation/featureCounter.py
diff --git a/tools/regVariation/featureCoverage1/1.0.0/featureCounter.xml b/tools/regVariation/featureCounter.xml
similarity index 100%
rename from tools/regVariation/featureCoverage1/1.0.0/featureCounter.xml
rename to tools/regVariation/featureCounter.xml
diff --git a/tools/regVariation/getIndels_2way/1.0.0/getIndels.py b/tools/regVariation/getIndels.py
similarity index 100%
rename from tools/regVariation/getIndels_2way/1.0.0/getIndels.py
rename to tools/regVariation/getIndels.py
diff --git a/tools/regVariation/getIndels_2way/1.0.0/getIndels_2way.xml b/tools/regVariation/getIndels_2way.xml
similarity index 100%
rename from tools/regVariation/getIndels_2way/1.0.0/getIndels_2way.xml
rename to tools/regVariation/getIndels_2way.xml
diff --git a/tools/regVariation/getIndels_3way/1.0.0/getIndels_3way.xml b/tools/regVariation/getIndels_3way.xml
similarity index 100%
rename from tools/regVariation/getIndels_3way/1.0.0/getIndels_3way.xml
rename to tools/regVariation/getIndels_3way.xml
diff --git a/tools/regVariation/cpgFilter/1.0.0/maf_cpg_filter.py b/tools/regVariation/maf_cpg_filter.py
similarity index 100%
rename from tools/regVariation/cpgFilter/1.0.0/maf_cpg_filter.py
rename to tools/regVariation/maf_cpg_filter.py
diff --git a/tools/regVariation/cpgFilter/1.0.0/maf_cpg_filter.xml b/tools/regVariation/maf_cpg_filter.xml
similarity index 100%
rename from tools/regVariation/cpgFilter/1.0.0/maf_cpg_filter.xml
rename to tools/regVariation/maf_cpg_filter.xml
diff --git a/tools/regVariation/getIndels_3way/1.0.0/parseMAF_smallIndels.pl b/tools/regVariation/parseMAF_smallIndels.pl
similarity index 100%
rename from tools/regVariation/getIndels_3way/1.0.0/parseMAF_smallIndels.pl
rename to tools/regVariation/parseMAF_smallIndels.pl
diff --git a/tools/regVariation/qualityFilter/1.0.0/quality_filter.py b/tools/regVariation/quality_filter.py
similarity index 100%
rename from tools/regVariation/qualityFilter/1.0.0/quality_filter.py
rename to tools/regVariation/quality_filter.py
diff --git a/tools/regVariation/qualityFilter/1.0.0/quality_filter.xml b/tools/regVariation/quality_filter.xml
similarity index 100%
rename from tools/regVariation/qualityFilter/1.0.0/quality_filter.xml
rename to tools/regVariation/quality_filter.xml
diff --git a/tools/regVariation/qv2bqv/1.0.0/qv_to_bqv.py b/tools/regVariation/qv_to_bqv.py
similarity index 100%
rename from tools/regVariation/qv2bqv/1.0.0/qv_to_bqv.py
rename to tools/regVariation/qv_to_bqv.py
diff --git a/tools/regVariation/qv2bqv/1.0.0/qv_to_bqv.xml b/tools/regVariation/qv_to_bqv.xml
similarity index 92%
rename from tools/regVariation/qv2bqv/1.0.0/qv_to_bqv.xml
rename to tools/regVariation/qv_to_bqv.xml
index 2eb3c4c07ea..f59c00f8510 100644
--- a/tools/regVariation/qv2bqv/1.0.0/qv_to_bqv.xml
+++ b/tools/regVariation/qv_to_bqv.xml
@@ -7,7 +7,6 @@
-
diff --git a/tools/regVariation/winSplitter/1.0.0/windowSplitter.py b/tools/regVariation/windowSplitter.py
similarity index 100%
rename from tools/regVariation/winSplitter/1.0.0/windowSplitter.py
rename to tools/regVariation/windowSplitter.py
diff --git a/tools/regVariation/winSplitter/1.0.0/windowSplitter.xml b/tools/regVariation/windowSplitter.xml
similarity index 100%
rename from tools/regVariation/winSplitter/1.0.0/windowSplitter.xml
rename to tools/regVariation/windowSplitter.xml
diff --git a/tools/stats/aggregate_scores_in_intervals2/1.1.1/aggregate_binned_scores_in_intervals.xml b/tools/stats/aggregate_binned_scores_in_intervals.xml
similarity index 100%
rename from tools/stats/aggregate_scores_in_intervals2/1.1.1/aggregate_binned_scores_in_intervals.xml
rename to tools/stats/aggregate_binned_scores_in_intervals.xml
diff --git a/tools/stats/aggregate_scores_in_intervals2/1.1.1/aggregate_scores_in_intervals.py b/tools/stats/aggregate_scores_in_intervals.py
similarity index 100%
rename from tools/stats/aggregate_scores_in_intervals2/1.1.1/aggregate_scores_in_intervals.py
rename to tools/stats/aggregate_scores_in_intervals.py
diff --git a/tools/stats/aggregate_scores_in_intervals2/1.0.0/aggregate_binned_scores_in_intervals.xml b/tools/stats/aggregate_scores_in_intervals2/1.0.0/aggregate_binned_scores_in_intervals.xml
deleted file mode 100644
index e930e7e8867..00000000000
--- a/tools/stats/aggregate_scores_in_intervals2/1.0.0/aggregate_binned_scores_in_intervals.xml
+++ /dev/null
@@ -1,86 +0,0 @@
-
- Appends the average, min, max of datapoints per interval
- aggregate_scores_in_intervals.py $datasets $input1 $input1_chromCol $input1_startCol $input1_endCol $out_file1 -b
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-.. class:: warningmark
-
-This tool currently only works with data from genome builds hg16, hg17 or hg18.
-
-.. class:: warningmark
-
-This tool assumes that the input dataset is in interval format and contains at least a chrom column, a start column and an end column. These 3 columns can be dispersed throughout any number of other data columns.
-
------
-
-.. class:: infomark
-
-**TIP:** Computing summary information may throw exceptions if the data type (e.g., string, integer) in every line of the columns is not appropriate for the computation (e.g., attempting numerical calculations on strings). If an exception is thrown when computing summary information for a line, that line is skipped as invalid for the computation. The number of invalid skipped lines is documented in the resulting history item as a "Data issue".
-
------
-
-**Syntax**
-
-This tool appends columns of summary information for each interval matched against a selected dataset. For each interval, the average, minimum and maximum for the data falling within the interval is computed.
-
-- Several quantitative scores are provided for the ENCODE regions.
-
- - Various Scores
- - Regulatory Potential
- - Neutral rate (Ancestral Repeats)
- - GC fraction
- - Conservation Scores
- - PhastCons
- - binCons
- - GERP
-
------
-
-**Example**
-
-If your original data has the following format:
-
-+------+-----+-----+---+------+
-|other1|chrom|start|end|other2|
-+------+-----+-----+---+------+
-
-and you choose to aggregate phastCons scores, your output will look like this:
-
-+------+-----+-----+---+------+---+---+---+
-|other1|chrom|start|end|other2|avg|min|max|
-+------+-----+-----+---+------+---+---+---+
-
-where:
-
-* **avg** - average phastCons score for each region
-* **min** - minimum phastCons score for each region
-* **max** - maximum phastCons score for each region
-
-
-
diff --git a/tools/stats/aggregate_scores_in_intervals2/1.0.0/aggregate_scores_in_intervals.py b/tools/stats/aggregate_scores_in_intervals2/1.0.0/aggregate_scores_in_intervals.py
deleted file mode 100644
index d07850df507..00000000000
--- a/tools/stats/aggregate_scores_in_intervals2/1.0.0/aggregate_scores_in_intervals.py
+++ /dev/null
@@ -1,199 +0,0 @@
-#!/usr/bin/env python2.4
-# Greg Von Kuster
-"""
-usage: %prog score_file interval_file chrom start stop [out_file] [options]
- -b, --binned: 'score_file' is actually a directory of binned array files
- -m, --mask=FILE: bed file containing regions not to consider valid
-"""
-
-from __future__ import division
-import pkg_resources
-pkg_resources.require( "bx-python" )
-pkg_resources.require( "lrucache" )
-try:
- pkg_resources.require( "python-lzo" )
-except:
- pass
-
-import psyco_full
-import sys
-import os, os.path
-from UserDict import DictMixin
-import bx.wiggle
-from bx.binned_array import BinnedArray, FileBinnedArray
-from bx.bitset import *
-from bx.bitset_builders import *
-from fpconst import isNaN
-from bx.cookbook import doc_optparse
-from galaxy.tools.exception_handling import *
-
-class FileBinnedArrayDir( DictMixin ):
- """
- Adapter that makes a directory of FileBinnedArray files look like
- a regular dict of BinnedArray objects.
- """
- def __init__( self, dir ):
- self.dir = dir
- self.cache = dict()
- def __getitem__( self, key ):
- value = None
- if key in self.cache:
- value = self.cache[key]
- else:
- fname = os.path.join( self.dir, "%s.ba" % key )
- if os.path.exists( fname ):
- value = FileBinnedArray( open( fname ) )
- self.cache[key] = value
- if value is None:
- raise KeyError( "File does not exist: " + fname )
- return value
-
-def stop_err(msg):
- sys.stderr.write(msg)
- sys.exit()
-
-def load_scores_wiggle( fname ):
- """
- Read a wiggle file and return a dict of BinnedArray objects keyed
- by chromosome.
- """
- scores_by_chrom = dict()
- try:
- for chrom, pos, val in bx.wiggle.Reader( UCSCOutWrapper(open( fname ) ) ):
- if chrom not in scores_by_chrom:
- scores_by_chrom[chrom] = BinnedArray()
- scores_by_chrom[chrom][pos] = val
- except UCSCLimitException:
- # Wiggle data was truncated, at the very least need to warn the user.
- print 'Encountered message from UCSC: "Reached output limit of 100000 data values", so be aware your data was truncated.'
- except IndexError:
- stop_err('Data error: one or more column data values is missing in "%s"' %fname)
- except ValueError:
- stop_err('Data error: invalid data type for one or more values in "%s".' %fname)
- return scores_by_chrom
-
-def load_scores_ba_dir( dir ):
- """
- Return a dict-like object (keyed by chromosome) that returns
- FileBinnedArray objects created from "key.ba" files in `dir`
- """
- return FileBinnedArrayDir( dir )
-
-def main():
-
- # Parse command line
- options, args = doc_optparse.parse( __doc__ )
-
- try:
- score_fname = args[0]
- interval_fname = args[1]
- chrom_col = args[2]
- start_col = args[3]
- stop_col = args[4]
- if len( args ) > 5:
- out_file = open( args[5], 'w' )
- else:
- out_file = sys.stdout
- binned = bool( options.binned )
- mask_fname = options.mask
- except:
- doc_optparse.exit()
-
- if score_fname == 'None':
- stop_err( 'This tool works with data from genome builds hg16, hg17 or hg18. Click the pencil icon in your history item to set the genome build if appropriate.' )
-
- try:
- chrom_col = int(chrom_col) - 1
- start_col = int(start_col) - 1
- stop_col = int(stop_col) - 1
- except:
- stop_err( 'Chrom, start & end column not properly set, click the pencil icon in your history item to set these values.' )
-
- if chrom_col < 0 or start_col < 0 or stop_col < 0:
- stop_err( 'Chrom, start & end column not properly set, click the pencil icon in your history item to set these values.' )
-
- if binned:
- scores_by_chrom = load_scores_ba_dir( score_fname )
- else:
- scores_by_chrom = load_scores_wiggle( score_fname )
-
- if mask_fname:
- masks = binned_bitsets_from_file( open( mask_fname ) )
- else:
- masks = None
-
- skipped_lines = 0
- first_invalid_line = 0
- invalid_line = ''
-
- for i, line in enumerate( open( interval_fname )):
- valid = True
- line = line.rstrip('\r\n')
- if line and not line.startswith( '#' ):
- fields = line.split()
-
- try:
- chrom, start, stop = fields[chrom_col], int( fields[start_col] ), int( fields[stop_col] )
- except:
- valid = False
- skipped_lines += 1
- if not invalid_line:
- first_invalid_line = i + 1
- invalid_line = line
- if valid:
- total = 0
- count = 0
- min_score = 100000000
- max_score = -100000000
- for j in range( start, stop ):
- valid2 = True
- if chrom in scores_by_chrom:
- try:
- scores_by_chrom[chrom][j]
- except:
- valid2 = False
- if valid2:
- # Skip if base is masked
- if masks and chrom in masks:
- if masks[chrom][j]:
- continue
- # Get the score, only count if not 'nan'
- score = scores_by_chrom[chrom][j]
- if not isNaN( score ):
- total += score
- count += 1
- max_score = max( score, max_score )
- min_score = min( score, min_score )
- if count > 0:
- avg = total/count
- else:
- avg = "nan"
- min_score = "nan"
- max_score = "nan"
-
- # Build the resulting line of data
- out_line = []
- for k in range(0, len(fields)):
- out_line.append(fields[k])
- out_line.append(avg)
- out_line.append(min_score)
- out_line.append(max_score)
-
- print >> out_file, "\t".join( map( str, out_line ) )
- else:
- skipped_lines += 1
- if not invalid_line:
- first_invalid_line = i + 1
- invalid_line = line
- elif line.startswith( '#' ):
- # We'll save the original comments
- print >> out_file, line
-
- out_file.close()
-
- if skipped_lines > 0:
- print 'Data issue: skipped %d invalid lines starting at line #%d which is "%s"' % ( skipped_lines, first_invalid_line, invalid_line )
- if skipped_lines == i:
- print 'Consider changing the metadata for the input dataset by clicking on the pencil icon in the history item.'
-
-if __name__ == "__main__": main()
diff --git a/tools/stats/aggregate_scores_in_intervals2/1.1.0/aggregate_binned_scores_in_intervals.xml b/tools/stats/aggregate_scores_in_intervals2/1.1.0/aggregate_binned_scores_in_intervals.xml
deleted file mode 100644
index 221c551d988..00000000000
--- a/tools/stats/aggregate_scores_in_intervals2/1.1.0/aggregate_binned_scores_in_intervals.xml
+++ /dev/null
@@ -1,113 +0,0 @@
-
- Appends the average, min, max of datapoints per interval
-
- #if $score_source_type.score_source == "user":#aggregate_scores_in_intervals.py $score_source_type.input2 $input1 $input1_chromCol $input1_startCol $input1_endCol $out_file1
- #else:#aggregate_scores_in_intervals.py $score_source_type.datasets $input1 $input1_chromCol $input1_startCol $input1_endCol $out_file1 -b
- #end if
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-.. class:: warningmark
-
-This tool currently only has cached data for genome builds hg16, hg17 and hg18. However, you may use your own data point (wiggle) data, such as is available from UCSC. If you are trying to use your own data point file and it is not appearing as an option, make sure that the builds for your history items are the same.
-
-.. class:: warningmark
-
-This tool assumes that the input dataset is in interval format and contains at least a chrom column, a start column and an end column. These 3 columns can be dispersed throughout any number of other data columns.
-
------
-
-.. class:: infomark
-
-**TIP:** Computing summary information may throw exceptions if the data type (e.g., string, integer) in every line of the columns is not appropriate for the computation (e.g., attempting numerical calculations on strings). If an exception is thrown when computing summary information for a line, that line is skipped as invalid for the computation. The number of invalid skipped lines is documented in the resulting history item as a "Data issue".
-
------
-
-**Syntax**
-
-This tool appends columns of summary information for each interval matched against a selected dataset. For each interval, the average, minimum and maximum for the data falling within the interval is computed.
-
-- Several quantitative scores are provided for the ENCODE regions.
-
- - Various Scores
- - Regulatory Potential
- - Neutral rate (Ancestral Repeats)
- - GC fraction
- - Conservation Scores
- - PhastCons
- - binCons
- - GERP
-
------
-
-**Example**
-
-If your original data has the following format:
-
-+------+-----+-----+---+------+
-|other1|chrom|start|end|other2|
-+------+-----+-----+---+------+
-
-and you choose to aggregate phastCons scores, your output will look like this:
-
-+------+-----+-----+---+------+---+---+---+
-|other1|chrom|start|end|other2|avg|min|max|
-+------+-----+-----+---+------+---+---+---+
-
-where:
-
-* **avg** - average phastCons score for each region
-* **min** - minimum phastCons score for each region
-* **max** - maximum phastCons score for each region
-
-
-
diff --git a/tools/stats/aggregate_scores_in_intervals2/1.1.0/aggregate_scores_in_intervals.py b/tools/stats/aggregate_scores_in_intervals2/1.1.0/aggregate_scores_in_intervals.py
deleted file mode 100755
index 49514c33f80..00000000000
--- a/tools/stats/aggregate_scores_in_intervals2/1.1.0/aggregate_scores_in_intervals.py
+++ /dev/null
@@ -1,196 +0,0 @@
-#!/usr/bin/env python2.4
-# Greg Von Kuster
-"""
-usage: %prog score_file interval_file chrom start stop [out_file] [options]
- -b, --binned: 'score_file' is actually a directory of binned array files
- -m, --mask=FILE: bed file containing regions not to consider valid
-"""
-
-from __future__ import division
-import pkg_resources
-pkg_resources.require( "bx-python" )
-pkg_resources.require( "lrucache" )
-try:
- pkg_resources.require( "python-lzo" )
-except:
- pass
-
-import psyco_full
-import sys
-import os, os.path
-from UserDict import DictMixin
-import bx.wiggle
-from bx.binned_array import BinnedArray, FileBinnedArray
-from bx.bitset import *
-from bx.bitset_builders import *
-from fpconst import isNaN
-from bx.cookbook import doc_optparse
-from galaxy.tools.exception_handling import *
-
-class FileBinnedArrayDir( DictMixin ):
- """
- Adapter that makes a directory of FileBinnedArray files look like
- a regular dict of BinnedArray objects.
- """
- def __init__( self, dir ):
- self.dir = dir
- self.cache = dict()
- def __getitem__( self, key ):
- value = None
- if key in self.cache:
- value = self.cache[key]
- else:
- fname = os.path.join( self.dir, "%s.ba" % key )
- if os.path.exists( fname ):
- value = FileBinnedArray( open( fname ) )
- self.cache[key] = value
- if value is None:
- raise KeyError( "File does not exist: " + fname )
- return value
-
-def stop_err(msg):
- sys.stderr.write(msg)
- sys.exit()
-
-def load_scores_wiggle( fname ):
- """
- Read a wiggle file and return a dict of BinnedArray objects keyed
- by chromosome.
- """
- scores_by_chrom = dict()
- try:
- for chrom, pos, val in bx.wiggle.Reader( UCSCOutWrapper(open( fname ) ) ):
- if chrom not in scores_by_chrom:
- scores_by_chrom[chrom] = BinnedArray()
- scores_by_chrom[chrom][pos] = val
- except UCSCLimitException:
- # Wiggle data was truncated, at the very least need to warn the user.
- print 'Encountered message from UCSC: "Reached output limit of 100000 data values", so be aware your data was truncated.'
- except IndexError:
- stop_err('Data error: one or more column data values is missing in "%s"' %fname)
- except ValueError:
- stop_err('Data error: invalid data type for one or more values in "%s".' %fname)
- return scores_by_chrom
-
-def load_scores_ba_dir( dir ):
- """
- Return a dict-like object (keyed by chromosome) that returns
- FileBinnedArray objects created from "key.ba" files in `dir`
- """
- return FileBinnedArrayDir( dir )
-
-def main():
-
- # Parse command line
- options, args = doc_optparse.parse( __doc__ )
-
- try:
- score_fname = args[0]
- interval_fname = args[1]
- chrom_col = args[2]
- start_col = args[3]
- stop_col = args[4]
- if len( args ) > 5:
- out_file = open( args[5], 'w' )
- else:
- out_file = sys.stdout
- binned = bool( options.binned )
- mask_fname = options.mask
- except:
- doc_optparse.exit()
-
- if score_fname == 'None':
- stop_err( 'This tool works with data from genome builds hg16, hg17 or hg18. Click the pencil icon in your history item to set the genome build if appropriate.' )
-
- try:
- chrom_col = int(chrom_col) - 1
- start_col = int(start_col) - 1
- stop_col = int(stop_col) - 1
- except:
- stop_err( 'Chrom, start & end column not properly set, click the pencil icon in your history item to set these values.' )
-
- if chrom_col < 0 or start_col < 0 or stop_col < 0:
- stop_err( 'Chrom, start & end column not properly set, click the pencil icon in your history item to set these values.' )
-
- if binned:
- scores_by_chrom = load_scores_ba_dir( score_fname )
- else:
- scores_by_chrom = load_scores_wiggle( score_fname )
-
- if mask_fname:
- masks = binned_bitsets_from_file( open( mask_fname ) )
- else:
- masks = None
-
- skipped_lines = 0
- first_invalid_line = 0
- invalid_line = ''
-
- for i, line in enumerate( open( interval_fname )):
- valid = True
- line = line.rstrip('\r\n')
- if line and not line.startswith( '#' ):
- fields = line.split()
-
- try:
- chrom, start, stop = fields[chrom_col], int( fields[start_col] ), int( fields[stop_col] )
- except:
- valid = False
- skipped_lines += 1
- if not invalid_line:
- first_invalid_line = i + 1
- invalid_line = line
- if valid:
- total = 0
- count = 0
- min_score = 100000000
- max_score = -100000000
- for j in range( start, stop ):
- if chrom in scores_by_chrom:
- try:
- # Skip if base is masked
- if masks and chrom in masks:
- if masks[chrom][j]:
- continue
- # Get the score, only count if not 'nan'
- score = scores_by_chrom[chrom][j]
- if not isNaN( score ):
- total += score
- count += 1
- max_score = max( score, max_score )
- min_score = min( score, min_score )
- except:
- continue
- if count > 0:
- avg = total/count
- else:
- avg = "nan"
- min_score = "nan"
- max_score = "nan"
-
- # Build the resulting line of data
- out_line = []
- for k in range(0, len(fields)):
- out_line.append(fields[k])
- out_line.append(avg)
- out_line.append(min_score)
- out_line.append(max_score)
-
- print >> out_file, "\t".join( map( str, out_line ) )
- else:
- skipped_lines += 1
- if not invalid_line:
- first_invalid_line = i + 1
- invalid_line = line
- elif line.startswith( '#' ):
- # We'll save the original comments
- print >> out_file, line
-
- out_file.close()
-
- if skipped_lines > 0:
- print 'Data issue: skipped %d invalid lines starting at line #%d which is "%s"' % ( skipped_lines, first_invalid_line, invalid_line )
- if skipped_lines == i:
- print 'Consider changing the metadata for the input dataset by clicking on the pencil icon in the history item.'
-
-if __name__ == "__main__": main()
diff --git a/tools/stats/Add_a_column1/1.0.0/column_maker.py b/tools/stats/column_maker.py
similarity index 100%
rename from tools/stats/Add_a_column1/1.0.0/column_maker.py
rename to tools/stats/column_maker.py
diff --git a/tools/stats/Add_a_column1/1.0.0/column_maker.xml b/tools/stats/column_maker.xml
similarity index 100%
rename from tools/stats/Add_a_column1/1.0.0/column_maker.xml
rename to tools/stats/column_maker.xml
diff --git a/tools/stats/cor2/1.0.0/cor.py b/tools/stats/cor.py
similarity index 100%
rename from tools/stats/cor2/1.0.0/cor.py
rename to tools/stats/cor.py
diff --git a/tools/stats/cor2/1.0.0/cor.xml b/tools/stats/cor.xml
similarity index 100%
rename from tools/stats/cor2/1.0.0/cor.xml
rename to tools/stats/cor.xml
diff --git a/tools/stats/Pearson_and_apos_Correlation1/1.0.0/correlation.pl b/tools/stats/correlation.pl
similarity index 100%
rename from tools/stats/Pearson_and_apos_Correlation1/1.0.0/correlation.pl
rename to tools/stats/correlation.pl
diff --git a/tools/stats/Pearson_and_apos_Correlation1/1.0.0/correlation.xml b/tools/stats/correlation.xml
similarity index 100%
rename from tools/stats/Pearson_and_apos_Correlation1/1.0.0/correlation.xml
rename to tools/stats/correlation.xml
diff --git a/tools/stats/Filter1/1.0.0/filtering.py b/tools/stats/filtering.py
similarity index 100%
rename from tools/stats/Filter1/1.0.0/filtering.py
rename to tools/stats/filtering.py
diff --git a/tools/stats/Filter1/1.0.0/filtering.xml b/tools/stats/filtering.xml
similarity index 100%
rename from tools/stats/Filter1/1.0.0/filtering.xml
rename to tools/stats/filtering.xml
diff --git a/tools/stats/Grouping1/1.0.0/grouping.py b/tools/stats/grouping.py
similarity index 100%
rename from tools/stats/Grouping1/1.0.0/grouping.py
rename to tools/stats/grouping.py
diff --git a/tools/stats/Grouping1/1.0.0/grouping.xml b/tools/stats/grouping.xml
similarity index 100%
rename from tools/stats/Grouping1/1.0.0/grouping.xml
rename to tools/stats/grouping.xml
diff --git a/tools/stats/Summary_Statistics1/1.0.0/gsummary.py b/tools/stats/gsummary.py
similarity index 100%
rename from tools/stats/Summary_Statistics1/1.0.0/gsummary.py
rename to tools/stats/gsummary.py
diff --git a/tools/stats/Summary_Statistics1/1.0.0/gsummary.xml b/tools/stats/gsummary.xml
similarity index 100%
rename from tools/stats/Summary_Statistics1/1.0.0/gsummary.xml
rename to tools/stats/gsummary.xml
diff --git a/tools/stats/wiggle2simple1/1.0.0/wiggle_to_simple.py b/tools/stats/wiggle_to_simple.py
similarity index 100%
rename from tools/stats/wiggle2simple1/1.0.0/wiggle_to_simple.py
rename to tools/stats/wiggle_to_simple.py
diff --git a/tools/stats/wiggle2simple1/1.0.0/wiggle_to_simple.xml b/tools/stats/wiggle_to_simple.xml
similarity index 100%
rename from tools/stats/wiggle2simple1/1.0.0/wiggle_to_simple.xml
rename to tools/stats/wiggle_to_simple.xml
diff --git a/tools/validation/fix_errors/1.0.0/fix_errors.py b/tools/validation/fix_errors.py
similarity index 100%
rename from tools/validation/fix_errors/1.0.0/fix_errors.py
rename to tools/validation/fix_errors.py
diff --git a/tools/validation/fix_errors/1.0.0/fix_errors.xml b/tools/validation/fix_errors.xml
similarity index 100%
rename from tools/validation/fix_errors/1.0.0/fix_errors.xml
rename to tools/validation/fix_errors.xml
diff --git a/tools/validation/fix_errors/1.0.0/fix_errors_code.py b/tools/validation/fix_errors_code.py
similarity index 100%
rename from tools/validation/fix_errors/1.0.0/fix_errors_code.py
rename to tools/validation/fix_errors_code.py
diff --git a/tools/validation/fix_errors/1.0.0/validate.py b/tools/validation/validate.py
similarity index 100%
rename from tools/validation/fix_errors/1.0.0/validate.py
rename to tools/validation/validate.py
diff --git a/tools/visualization/gmaj_1/1.0.0/GMAJ.py b/tools/visualization/GMAJ.py
similarity index 100%
rename from tools/visualization/gmaj_1/1.0.0/GMAJ.py
rename to tools/visualization/GMAJ.py
diff --git a/tools/visualization/gmaj_1/1.0.0/GMAJ.xml b/tools/visualization/GMAJ.xml
similarity index 100%
rename from tools/visualization/gmaj_1/1.0.0/GMAJ.xml
rename to tools/visualization/GMAJ.xml
diff --git a/tools/visualization/laj_1/1.0.0/LAJ.py b/tools/visualization/LAJ.py
similarity index 100%
rename from tools/visualization/laj_1/1.0.0/LAJ.py
rename to tools/visualization/LAJ.py
diff --git a/tools/visualization/laj_1/1.0.0/LAJ.xml b/tools/visualization/LAJ.xml
similarity index 100%
rename from tools/visualization/laj_1/1.0.0/LAJ.xml
rename to tools/visualization/LAJ.xml
diff --git a/tools/visualization/laj_1/1.0.0/LAJ_code.py b/tools/visualization/LAJ_code.py
similarity index 100%
rename from tools/visualization/laj_1/1.0.0/LAJ_code.py
rename to tools/visualization/LAJ_code.py
diff --git a/tools/visualization/build_ucsc_custom_track_1/1.0.0/build_ucsc_custom_track.py b/tools/visualization/build_ucsc_custom_track.py
similarity index 100%
rename from tools/visualization/build_ucsc_custom_track_1/1.0.0/build_ucsc_custom_track.py
rename to tools/visualization/build_ucsc_custom_track.py
diff --git a/tools/visualization/build_ucsc_custom_track_1/1.0.0/build_ucsc_custom_track.xml b/tools/visualization/build_ucsc_custom_track.xml
similarity index 100%
rename from tools/visualization/build_ucsc_custom_track_1/1.0.0/build_ucsc_custom_track.xml
rename to tools/visualization/build_ucsc_custom_track.xml
diff --git a/tools/visualization/build_ucsc_custom_track_1/1.0.0/build_ucsc_custom_track_code.py b/tools/visualization/build_ucsc_custom_track_code.py
similarity index 100%
rename from tools/visualization/build_ucsc_custom_track_1/1.0.0/build_ucsc_custom_track_code.py
rename to tools/visualization/build_ucsc_custom_track_code.py