changeset 4:05320ceddead draft

Uploaded
author sauria
date Thu, 16 Apr 2015 15:13:44 -0400
parents a25d79b443ab
children a1ab64129a04
files hifive/complete_fivec_project.xml hifive/complete_hic_project.xml hifive/create_fivec_dataset.xml hifive/create_fivec_fragmentset.xml hifive/create_fivec_heatmap.xml hifive/create_fivec_project.xml hifive/create_hic_dataset.xml hifive/create_hic_fendset.xml hifive/create_hic_heatmap.xml hifive/create_hic_project.xml hifive/get_interval_fivec_data.xml hifive/get_interval_hic_data.xml hifive/hifive/complete_fivec_project.xml hifive/hifive/complete_hic_project.xml hifive/hifive/create_fivec_dataset.xml hifive/hifive/create_fivec_fragmentset.xml hifive/hifive/create_fivec_heatmap.xml hifive/hifive/create_fivec_project.xml hifive/hifive/create_hic_dataset.xml hifive/hifive/create_hic_fendset.xml hifive/hifive/create_hic_heatmap.xml hifive/hifive/create_hic_project.xml hifive/hifive/get_interval_fivec_data.xml hifive/hifive/get_interval_hic_data.xml hifive/hifive/learn_fivec_normalization.xml hifive/hifive/learn_hic_normalization.xml hifive/hifive/readme.rst hifive/hifive/tool_dependencies.xml hifive/learn_fivec_normalization.xml hifive/learn_hic_normalization.xml hifive/readme.rst hifive/tool_dependencies.xml
diffstat 32 files changed, 1756 insertions(+), 1671 deletions(-) [+]
line wrap: on
line diff
--- a/hifive/complete_fivec_project.xml	Thu Apr 16 12:41:30 2015 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,302 +0,0 @@
-<tool id="complete_fivec_project" name="analyze_5C_data">
-    <requirements><requirement type='package'>hifive</requirement></requirements>
-    <description>from start to finish, including creating a fragmentset, dataset, and corrected HiFive 5C project</description>
-    <command>
-        hifive 5c-complete $analysis.algorithm -q
-        -m $mindist -x $maxdist
-
-        #if str( $datafile.format ) == "bam":
-            #for $bam_file in $datafile.paired_bam:
-                -B "${bam_file.readend1}" "${bam_file.readend2}"
-            #end for
-        #else:
-            #for $count_file in $datafile.count_files:
-                -C "${count_file.count}"
-            #end for
-        #end if
-        #if str( $regions ) != "":
-            -r $regions
-        #end if
-        #if str( $analysis.algorithm ) == "probability" or str( $analysis.algorithm ) == "binning-probability" or str( $analysis.algorithm ) == "probability-binning":
-            -b $analysis.probiter  -l $analysis.step -g $analysis.change $analysis.precalc
-        #end if
-        #if str( $analysis.algorithm ) == "express" or str( $analysis.algorithm ) == "binning-express" or str( $analysis.algorithm ) == "probability-express":
-            -e $analysis.expiter $analysis.removedist -w $analysis.expreads
-        #end if
-        #if str( $analysis.algorithm ) == "binning" or str( $analysis.algorithm ) == "binning-express" or str( $analysis.algorithm ) == "binning-probability" or str( $analysis.algorithm ) == "express-binning" or str( $analysis.algorithm ) == "probability-binning":
-            -i $analysis.biniter -t $analysis.threshold -y $analysis.binreads
-            -v $analysis.model -n $analysis.modelbins -u $analysis.modeltypes
-        #end if
-
-        -o $frags $data $project $bed</command>
-    <inputs>
-        <param format="bed" name="bed" type="data" label="Probed RE fragment boundary BED File" optional="False"/>
-        <conditional name="datafile">
-            <param name="format" type="select" label="Data Format">
-                <option value="bam">bam</option>
-                <option value="count">count</option>
-            </param>
-            <when value="bam">
-                <repeat name="paired_bam" title="Sequencing lane" min="1">
-                    <param format="bam" name="readend1" label="First read end" type="data"/>
-                    <param format="bam" name="readend2" label="Second read end" type="data"/>
-                </repeat>
-            </when>
-            <when value="count">
-                <repeat name="count_files" title="Counts file" min="1">
-                    <param format="tabular" name="count" type="data" label="Counts file" optional="False"/>
-                </repeat>
-            </when>
-        </conditional>
-        <param type="integer" name="mindist" value="0" label="Minimum interaction distance" optional="False" help="The minimum interaction distance included for filtering fragments and learning correction values.">
-            <validator type="in_range" min="0"/>
-        </param>
-        <param type="integer" name="maxdist" value="0" label="Maximum interaction distance" optional="False" help="The maximum interaction distance included for filtering fragments and learning correction values. A value of zero indicates no upper limit.">
-            <validator type="in_range" min="0"/>
-        </param>
-        <param type="integer" name="minint" value="20" label="Minimum interactions per fragment" optional="False">
-            <validator type="in_range" min="1"/>
-        </param>
-        <param type="text" size="60" name="regions" value="" label="Included regions" optional="False" help="If a subset of regions are to be used, enter a comma-separated list of region indices."/>
-        <conditional name='analysis'>
-            <param name="algorithm" type="select" label="Learning Algorithm">
-                <option value="probability">Probability</option>
-                <option value="express">Express</option>
-                <option value="binning">Binning</option>
-                <option value="binning-probability">Binning-Probability</option>
-                <option value="binning-express">Binning-Express</option>
-                <option value="probability-binning">Probability-Binning</option>
-                <option value="express-binning">Express-Binning</option>
-            </param>
-
-            <when value="probability">
-                <param type="integer" name="probiter" value="1000" label="Maximum number of iterations" optional="False">
-                    <validator type="in_range" min="1"/>
-                </param>
-                <param type="float" name="change" value="0.0005" label="Parameter change cutoff" optional="False" help="The cutoff for the absolute gradient values such that learning will cease if all values fall below this threshold.">
-                    <validator type="in_range" min="0.00000001"/>
-                </param>
-                <param type="float" name="step" value="0.5" label="Learning rate scaling factor" optional="False">
-                    <validator type="in_range" min="0.000001" max="1.0"/>
-                </param>
-                <param type="select" name="precalc" label="Precalculate probability corrections from fragment means">
-                    <option value="-p">yes</option>
-                    <option value="">no</option>
-                </param>
-            </when>
-
-            <when value="express">
-                <param type="integer" name="expiter" value="1000" label="Number of express iterations" optional="False">
-                    <validator type="in_range" min="1"/>
-                </param>
-                <param type="select" name="removedist" label="Remove estimated distance-dependence prior to learning express corrections.">
-                    <option value="-d">yes</option>
-                    <option value="">no</option>
-                </param>
-                <param type="select" name="expreads" label="Reads to use for learning express corrections.">
-                    <option value="cis">cis</option>
-                    <option value="trans">trans</option>
-                    <option value="all">all</option>
-                </param>
-            </when>
-
-            <when value="binning">
-                <param type="integer" name="biniter" value="1000" label="Maximum number of binning iterations" optional="False">
-                    <validator type="in_range" min="1"/>
-                </param>
-                <param type="float" name="threshold" value="1.0" label="Learning threshold" optional="False"
-                    help="The minimum change needed in the log-likelihood to continue learning binning corrections.">
-                    <validator type="in_range" min="0.000001" max="1.0"/>
-                </param>
-                <param type="select" name="binreads" label="Reads to use for learning binning corrections.">
-                    <option value="cis">cis</option>
-                    <option value="trans">trans</option>
-                    <option value="all">all</option>
-                </param>
-                <param type="text" size="60" name="model" value="len" label="Model parameters" optional="False" help="A comma-separated list of fragment characteristics to learn corrections for. These can include 'len' and any characteristics included in the fragment bed file.">
-                    <validator type="empty_field" />
-                </param>
-                <param type="text" size="60" name="modelbins" value="10" label="Number of parameter bins" optional="False" help="A comma-separated list of bins to divide each model parameter into.">
-                    <validator type="empty_field" />
-                </param>
-                <param type="text" size="60" name="modeltypes" value="even" label="Parameter types" optional="False" help="A comma-separated list of model parameter types. These can be 'even', 'fixed', 'even-const', and 'fixed-const'.">
-                    <validator type="empty_field" />
-                </param>
-            </when>
-
-            <when value="binning-probability">
-                <param type="integer" name="biniter" value="1000" label="Maximum number of binning iterations" optional="False">
-                    <validator type="in_range" min="1"/>
-                </param>
-                <param type="float" name="threshold" value="1.0" label="Learning threshold" optional="False"
-                    help="The minimum change needed in the log-likelihood to continue learning binning corrections.">
-                    <validator type="in_range" min="0.000001" max="1.0"/>
-                </param>
-                <param type="select" name="binreads" label="Reads to use for learning binning corrections.">
-                    <option value="cis">cis</option>
-                    <option value="trans">trans</option>
-                    <option value="all">all</option>
-                </param>
-                <param type="text" size="60" name="model" value="len" label="Model parameters" optional="False" help="A comma-separated list of fragment characteristics to learn corrections for. These can include 'len' and any characteristics included in the fragment bed file.">
-                    <validator type="empty_field" />
-                </param>
-                <param type="text" size="60" name="modelbins" value="10" label="Number of parameter bins" optional="False" help="A comma-separated list of bins to divide each model parameter into.">
-                    <validator type="empty_field" />
-                </param>
-                <param type="text" size="60" name="modeltypes" value="even" label="Parameter types" optional="False" help="A comma-separated list of model parameter types. These can be 'even', 'fixed', 'even-const', and 'fixed-const'.">
-                    <validator type="empty_field" />
-                </param>
-                <param type="integer" name="probiter" value="1000" label="Maximum number of iterations" optional="False">
-                    <validator type="in_range" min="1"/>
-                </param>
-                <param type="float" name="change" value="0.0005" label="Parameter change cutoff" optional="False" help="The cutoff for the absolute gradient values such that learning will cease if all values fall below this threshold.">
-                    <validator type="in_range" min="0.00000001"/>
-                </param>
-                <param type="float" name="step" value="0.5" label="Learning rate scaling factor" optional="False">
-                    <validator type="in_range" min="0.000001" max="1.0"/>
-                </param>
-                <param type="select" name="precalc" label="Precalculate probability corrections from fragment means">
-                    <option value="-p">yes</option>
-                    <option value="">no</option>
-                </param>
-            </when>
-
-            <when value="binning-express">
-                <param type="integer" name="biniter" value="1000" label="Maximum number of binning iterations" optional="False">
-                    <validator type="in_range" min="1"/>
-                </param>
-                <param type="float" name="threshold" value="1.0" label="Learning threshold" optional="False"
-                    help="The minimum change needed in the log-likelihood to continue learning binning corrections.">
-                    <validator type="in_range" min="0.000001" max="1.0"/>
-                </param>
-                <param type="select" name="binreads" label="Reads to use for learning binning corrections.">
-                    <option value="cis">cis</option>
-                    <option value="trans">trans</option>
-                    <option value="all">all</option>
-                </param>
-                <param type="text" size="60" name="model" value="len" label="Model parameters" optional="False" help="A comma-separated list of fragment characteristics to learn corrections for. These can include 'len' and any characteristics included in the fragment bed file.">
-                    <validator type="empty_field" />
-                </param>
-                <param type="text" size="60" name="modelbins" value="10" label="Number of parameter bins" optional="False" help="A comma-separated list of bins to divide each model parameter into.">
-                    <validator type="empty_field" />
-                </param>
-                <param type="text" size="60" name="modeltypes" value="even" label="Parameter types" optional="False" help="A comma-separated list of model parameter types. These can be 'even', 'fixed', 'even-const', and 'fixed-const'.">
-                    <validator type="empty_field" />
-                </param>
-                <param type="integer" name="expiter" value="1000" label="Number of express iterations" optional="False">
-                    <validator type="in_range" min="1"/>
-                </param>
-                <param type="select" name="removedist" label="Remove estimated distance-dependence prior to learning express corrections.">
-                    <option value="-d">yes</option>
-                    <option value="">no</option>
-                </param>
-                <param type="select" name="expreads" label="Reads to use for learning express corrections.">
-                    <option value="cis">cis</option>
-                    <option value="trans">trans</option>
-                    <option value="all">all</option>
-                </param>
-            </when>
-
-            <when value="probability-binning">
-                <param type="integer" name="probiter" value="1000" label="Maximum number of iterations" optional="False">
-                    <validator type="in_range" min="1"/>
-                </param>
-                <param type="float" name="change" value="0.0005" label="Parameter change cutoff" optional="False" help="The cutoff for the absolute gradient values such that learning will cease if all values fall below this threshold.">
-                    <validator type="in_range" min="0.00000001"/>
-                </param>
-                <param type="float" name="step" value="0.5" label="Learning rate scaling factor" optional="False">
-                    <validator type="in_range" min="0.000001" max="1.0"/>
-                </param>
-                <param type="select" name="precalc" label="Precalculate probability corrections from fragment means">
-                    <option value="-p">yes</option>
-                    <option value="">no</option>
-                </param>
-                <param type="select" name="precalc" label="Precalculate probability corrections from fragment means">
-                    <option value="-p">yes</option>
-                    <option value="">no</option>
-                </param>
-                <param type="integer" name="biniter" value="1000" label="Maximum number of binning iterations" optional="False">
-                    <validator type="in_range" min="1"/>
-                </param>
-                <param type="float" name="threshold" value="1.0" label="Learning threshold" optional="False"
-                    help="The minimum change needed in the log-likelihood to continue learning binning corrections.">
-                    <validator type="in_range" min="0.000001" max="1.0"/>
-                </param>
-                <param type="select" name="binreads" label="Reads to use for learning binning corrections.">
-                    <option value="cis">cis</option>
-                    <option value="trans">trans</option>
-                    <option value="all">all</option>
-                </param>
-                <param type="text" size="60" name="model" value="len" label="Model parameters" optional="False" help="A comma-separated list of fragment characteristics to learn corrections for. These can include 'len' and any characteristics included in the fragment bed file.">
-                    <validator type="empty_field" />
-                </param>
-                <param type="text" size="60" name="modelbins" value="10" label="Number of parameter bins" optional="False" help="A comma-separated list of bins to divide each model parameter into.">
-                    <validator type="empty_field" />
-                </param>
-                <param type="text" size="60" name="modeltypes" value="even" label="Parameter types" optional="False" help="A comma-separated list of model parameter types. These can be 'even', 'fixed', 'even-const', and 'fixed-const'.">
-                    <validator type="empty_field" />
-                </param>
-            </when>
-
-            <when value="express-binning">
-                <param type="integer" name="expiter" value="1000" label="Number of express iterations" optional="False">
-                    <validator type="in_range" min="1"/>
-                </param>
-                <param type="select" name="removedist" label="Remove estimated distance-dependence prior to learning express corrections.">
-                    <option value="-d">yes</option>
-                    <option value="">no</option>
-                </param>
-                <param type="select" name="expreads" label="Reads to use for learning express corrections.">
-                    <option value="cis">cis</option>
-                    <option value="trans">trans</option>
-                    <option value="all">all</option>
-                </param>
-                <param type="integer" name="biniter" value="1000" label="Maximum number of binning iterations" optional="False">
-                    <validator type="in_range" min="1"/>
-                </param>
-                <param type="float" name="threshold" value="1.0" label="Learning threshold" optional="False"
-                    help="The minimum change needed in the log-likelihood to continue learning binning corrections.">
-                    <validator type="in_range" min="0.000001" max="1.0"/>
-                </param>
-                <param type="select" name="binreads" label="Reads to use for learning binning corrections.">
-                    <option value="cis">cis</option>
-                    <option value="trans">trans</option>
-                    <option value="all">all</option>
-                </param>
-                <param type="text" size="60" name="model" value="len" label="Model parameters" optional="False" help="A comma-separated list of fragment characteristics to learn corrections for. These can include 'len' and any characteristics included in the fragment bed file.">
-                    <validator type="empty_field" />
-                </param>
-                <param type="text" size="60" name="modelbins" value="10" label="Number of parameter bins" optional="False" help="A comma-separated list of bins to divide each model parameter into.">
-                    <validator type="empty_field" />
-                </param>
-                <param type="text" size="60" name="modeltypes" value="even" label="Parameter types" optional="False" help="A comma-separated list of model parameter types. These can be 'even', 'fixed', 'even-const', and 'fixed-const'.">
-                    <validator type="empty_field" />
-                </param>
-            </when>
-        </conditional>
-    </inputs>
-    <outputs>
-        <data format="frags" name="frags" label="${tool.name} on ${on_string}: 5C frags"/>
-        <data format="fcd" name="data" label="${tool.name} on ${on_string}: 5C data"/>
-        <data format="fcp" name="project" label="${tool.name} on ${on_string}: 5C project ${analysis.algorithm}"/>
-    </outputs>
-
-    <help>
-This tool takes a BED file containing probed restriction enzyme fragment boundaries and either a set of paired-end BAM files or a set of tabular counts files containing pairs of fragments and associated counts and creates and analyzes a HiFive 5C project.
-
-The bed file containing targeted restriction enzyme fragment boundaries is converted into an hdf5-type fragment file of fragment characteristics. In addition to coordinates, strand, and chromosome information, additional columns can be included containing other fragment characteristics, such as GC content. If additional columns are included, they must be labeled in the header with a label containing no spaces or commas. These names can be used with the binning algorithm to include the fragment characteristic in the model to be learned.
-
-Reads are then loaded and paired with the specified fragment file, creating a HiFive dataset object. Data can be a series of paired-end bam files or a tabular format list of paired fragments and their observed read count (fragment1 fragment2 count).
-
-Next, fends are filtered in an iterative manner using the minimum interaction cutoff and interaction size parameters specified to ensure that all valid fends have at least the minimum number of interactions with other valid fends. Subsequently, a distance dependence approximation curve is calculated piecewise using the number of bins specified. The first bin encompasses all interactions less than or equal to the minimum bin cutoff value. The remaining bins are evenly sized between log(minimum cutoff) and log(max possible interaction size).
-
-Finally, corrections values are learned for either each valid fragment, ranges of fragment characteristics, or both. The 'probability' and 'express' algorithms learn correction values associated with each fragment while the 'binning' algorithm learns fragment characteristic corrections. These can be chained together in either order to produce more robust corrections.
-
-The probability algorithm assumes non-zero counts to distributed according to a log-normal distribution with each interaction having a mean equal to the distance-depedence predicted signal times each of the interaction fragment correction parameters and a universal sigma value. Using the probability algorithm, learning is done using a backtracking line gradient descent approach. Learning proceeds for up to the maximum number of iterations but is terminated early if all of the absolute gradient values fall below the cutoff threshold. At each step, the learning rate is scaled down by the step value if the current learning rate does not produce sufficient improvement as measured by the Arjimo criterion.
-
-The express algorithm is a variant of matrix balancing and approximates the corrections through an iterative norm-2 adjustment to given all fragments a mean ratio of one for valid counts versus predicted signal from distance-dependence. This can be done using intra-regional interactions, inter-regional interactions, or all interactions.
-
-The binning algorithm divides each model parameter into some number of bins and based on a log-normal distribution, correction values for each bin are learned, maximizing the log-likelihood of the data. Model parameters can be the fragment lengths ('len') and any other characteristics passed as additional columns (with header labels) in the bed file used to create the HiFive fragment file. Each parameter has a number of bins specified to divide it into and can be partitioned according to its type to contain approximately equal numbers of fragments ('even'), or to cover equal portions of the range of parameter values ('fixed'). In addition, parameter types can include the '-const' suffix to denote a parameter that should not be optimized after seeding.
-    </help>
-
-</tool>
\ No newline at end of file
--- a/hifive/complete_hic_project.xml	Thu Apr 16 12:41:30 2015 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,236 +0,0 @@
-<tool id="complete_hic_project" name="analyze_HiC_data">
-    <description>from start to finish, including creating a fendset, dataset, and corrected HiFive HiC project</description>
-    <command>
-        hifive hic-complete $analysis.algorithm -q
-        -f $minint -m $filtermin -x $filtermax -j $minbin -n $numbin -B $bed
-
-        #if str( $datafile.format ) == "bam":
-            #for $bam_file in $datafile.paired_bam:
-                --bam ${bam_file.readend1} ${bam_file.readend2}
-            #end for
-        #elif str( $datafile.format ) == "mat":
-            --mat ${datafile.mat}
-        #else:
-            #for raw_file in $datafile.raw_files:
-                --raw ${raw_file.raw}
-            #end for
-        #end if
-        #if str( $chroms ) != "":
-            -c $chroms
-        #end if
-        #if str( $analysis.algorithm ) == "probability" or str( $analysis.algorithm ) == "binning-probability":
-            -b $analysis.probiter -l $analysis.step -g $analysis.change $analysis.precalc
-        #end if
-        #if str( $analysis.algorithm ) == "express" or str( $analysis.algorithm ) == "binning-express" :
-            -e $analysis.expiter $analysis.removedist -w $analysis.expreads
-        #end if
-        #if str( $analysis.algorithm ) == "binning" or str( $analysis.algorithm ) == "binning-express" or str( $analysis.algorithm ) == "binning-probability":
-            -r $analysis.biniter -t $analysis.threshold -y $analysis.binreads
-            -v $analysis.model -z $analysis.modelbins -u $analysis.modeltypes
-        #end if
-
-    -o $fends $data $project
-    </command>
-    <inputs>
-        <param format="bed" name="bed" type="data" label="RE Cutsite BED File" optional="False"/>
-        <param type="integer" name="insert" value="500" label="Maximum insert size" optional="False">
-            <validator type="in_range" min="1"/>
-        </param>
-        <conditional name="datafile">
-            <param name="format" type="select" label="Data Format">
-                <option value="bam">bam</option>
-                <option value="mat">mat</option>
-                <option value="raw">raw</option>
-            </param>
-            <when value="bam">
-                <repeat name="paired_bam" title="Sequencing lane" min="1">
-                    <param format="bam" name="readend1" label="First read end" type="data"/>
-                    <param format="bam" name="readend2" label="Second read end" type="data"/>
-                </repeat>
-            </when>
-            <when value="mat">
-                <param format="tabular" name="mat" type="data" label="Mat file" optional="False"/>
-            </when>
-            <when value="raw">
-                <repeat name="raw_files" title="Raw file" min="1">
-                    <param format="tabular" name="raw" type="data" label="Raw file" optional="False"/>
-                </repeat>
-            </when>
-        </conditional>
-        <param type="integer" name="minint" value="20" label="Minimum interactions per fend" optional="False">
-            <validator type="in_range" min="1"/>
-        </param>
-        <param type="integer" name="filtermin" value="1000000" label="Minimum interaction distance" optional="False" help="The minimum interaction distance included for filtering fends and learning correction values.">
-            <validator type="in_range" min="0"/>
-        </param>
-        <param type="integer" name="filtermax" value="0" label="Maximum interaction distance" optional="False" help="The maximum interaction distance included for filtering fends and learning correction values.">
-            <validator type="in_range" min="0"/>
-        </param>
-        <param type="integer" name="minbin" value="1000" label="Minimum distance bin cutoff" optional="False">
-            <validator type="in_range" min="1"/>
-        </param>
-        <param type="integer" name="numbin" value="100" label="Number of distance bins" optional="False">
-            <validator type="in_range" min="1"/>
-        </param>
-        <param type="text" size="60" name="chroms" value="" label="Included chromosomes" optional="False" help="If a subset of chromosomes are to be used, enter a comma-separated list of chromosome names."/>
-        <conditional name='analysis'>
-            <param name="algorithm" type="select" label="Learning Algorithm">
-                <option value="probability">Probability</option>
-                <option value="express">Express</option>
-                <option value="binning">Binning</option>
-                <option value="binning-probability">Binning-Probability</option>
-                <option value="binning-express">Binning-Express</option>
-            </param>
-
-            <when value="probability">
-                <param type="integer" name="probiter" value="1000" label="Maximum number of iterations" optional="False">
-                    <validator type="in_range" min="1"/>
-                </param>
-                <param type="float" name="change" value="0.0005" label="Parameter change cutoff" optional="False" help="The cutoff for the absolute gradient values such that learning will cease if all values fall below this threshold.">
-                    <validator type="in_range" min="0.00000001"/>
-                </param>
-                <param type="float" name="step" value="0.5" label="Learning rate scaling factor" optional="False">
-                    <validator type="in_range" min="0.000001" max="1.0"/>
-                </param>
-                <param type="select" name="precalc" label="Precalculate probability corrections from fragment means">
-                    <option value="-p">yes</option>
-                    <option value="">no</option>
-                </param>
-            </when>
-
-            <when value="express">
-                <param type="integer" name="expiter" value="1000" label="Number of express iterations" optional="False">
-                    <validator type="in_range" min="1"/>
-                </param>
-                <param type="select" name="removedist" label="Remove estimated distance-dependence prior to learning express corrections.">
-                    <option value="-d">yes</option>
-                    <option value="">no</option>
-                </param>
-                <param type="select" name="expreads" label="Reads to use for learning express corrections.">
-                    <option value="cis">cis</option>
-                    <option value="trans">trans</option>
-                    <option value="all">all</option>
-                </param>
-            </when>
-
-            <when value="binning">
-                <param type="integer" name="biniter" value="1000" label="Maximum number of binning iterations" optional="False">
-                    <validator type="in_range" min="1"/>
-                </param>
-                <param type="float" name="threshold" value="1.0" label="Learning threshold" optional="False"
-                    help="The minimum change needed in the log-likelihood to continue learning binning corrections.">
-                    <validator type="in_range" min="0.000001" max="1.0"/>
-                </param>
-                <param type="select" name="binreads" label="Reads to use for learning binning corrections.">
-                    <option value="cis">cis</option>
-                    <option value="trans">trans</option>
-                    <option value="all">all</option>
-                </param>
-                <param type="text" size="60" name="model" value="len,distance" label="Model parameters" optional="False" help="A comma-separated list of fragment characteristics to learn corrections for. These can include 'len' and any characteristics included in the fragment bed file.">
-                    <validator type="empty_field" />
-                </param>
-                <param type="text" size="60" name="modelbins" value="20,20" label="Number of parameter bins" optional="False" help="A comma-separated list of bins to divide each model parameter into.">
-                    <validator type="empty_field" />
-                </param>
-                <param type="text" size="60" name="modeltypes" value="even,even" label="Parameter types" optional="False" help="A comma-separated list of model parameter types. These can be 'even', 'fixed', 'even-const', and 'fixed-const'.">
-                    <validator type="empty_field" />
-                </param>
-            </when>
-
-            <when value="binning-probability">
-                <param type="integer" name="biniter" value="1000" label="Maximum number of binning iterations" optional="False">
-                    <validator type="in_range" min="1"/>
-                </param>
-                <param type="float" name="threshold" value="1.0" label="Learning threshold" optional="False"
-                    help="The minimum change needed in the log-likelihood to continue learning binning corrections.">
-                    <validator type="in_range" min="0.000001" max="1.0"/>
-                </param>
-                <param type="select" name="binreads" label="Reads to use for learning binning corrections.">
-                    <option value="cis">cis</option>
-                    <option value="trans">trans</option>
-                    <option value="all">all</option>
-                </param>
-                <param type="text" size="60" name="model" value="len,distance" label="Model parameters" optional="False" help="A comma-separated list of fragment characteristics to learn corrections for. These can include 'len' and any characteristics included in the fragment bed file.">
-                    <validator type="empty_field" />
-                </param>
-                <param type="text" size="60" name="modelbins" value="20,20" label="Number of parameter bins" optional="False" help="A comma-separated list of bins to divide each model parameter into.">
-                    <validator type="empty_field" />
-                </param>
-                <param type="text" size="60" name="modeltypes" value="even,even" label="Parameter types" optional="False" help="A comma-separated list of model parameter types. These can be 'even', 'fixed', 'even-const', and 'fixed-const'.">
-                    <validator type="empty_field" />
-                </param>
-                <param type="integer" name="probiter" value="1000" label="Maximum number of iterations" optional="False">
-                    <validator type="in_range" min="1"/>
-                </param>
-                <param type="float" name="change" value="0.0005" label="Parameter change cutoff" optional="False" help="The cutoff for the absolute gradient values such that learning will cease if all values fall below this threshold.">
-                    <validator type="in_range" min="0.00000001"/>
-                </param>
-                <param type="float" name="step" value="0.5" label="Learning rate scaling factor" optional="False">
-                    <validator type="in_range" min="0.000001" max="1.0"/>
-                </param>
-                <param type="select" name="precalc" label="Precalculate probability corrections from fragment means">
-                    <option value="-p">yes</option>
-                    <option value="">no</option>
-                </param>
-            </when>
-
-            <when value="binning-express">
-                <param type="integer" name="biniter" value="1000" label="Maximum number of binning iterations" optional="False">
-                    <validator type="in_range" min="1"/>
-                </param>
-                <param type="float" name="threshold" value="1.0" label="Learning threshold" optional="False"
-                    help="The minimum change needed in the log-likelihood to continue learning binning corrections.">
-                    <validator type="in_range" min="0.000001" max="1.0"/>
-                </param>
-                <param type="select" name="binreads" label="Reads to use for learning binning corrections.">
-                    <option value="cis">cis</option>
-                    <option value="trans">trans</option>
-                    <option value="all">all</option>
-                </param>
-                <param type="text" size="60" name="model" value="len,distance" label="Model parameters" optional="False" help="A comma-separated list of fragment characteristics to learn corrections for. These can include 'len' and any characteristics included in the fragment bed file.">
-                    <validator type="empty_field" />
-                </param>
-                <param type="text" size="60" name="modelbins" value="20,20" label="Number of parameter bins" optional="False" help="A comma-separated list of bins to divide each model parameter into.">
-                    <validator type="empty_field" />
-                </param>
-                <param type="text" size="60" name="modeltypes" value="even,even" label="Parameter types" optional="False" help="A comma-separated list of model parameter types. These can be 'even', 'fixed', 'even-const', and 'fixed-const'.">
-                    <validator type="empty_field" />
-                </param>
-                <param type="integer" name="expiter" value="1000" label="Number of express iterations" optional="False">
-                    <validator type="in_range" min="1"/>
-                </param>
-                <param type="select" name="removedist" label="Remove estimated distance-dependence prior to learning express corrections.">
-                    <option value="-d">yes</option>
-                    <option value="">no</option>
-                </param>
-                <param type="select" name="expreads" label="Reads to use for learning express corrections.">
-                    <option value="cis">cis</option>
-                    <option value="trans">trans</option>
-                    <option value="all">all</option>
-                </param>
-            </when>
-        </conditional>
-    </inputs>
-    <outputs>
-        <data format="fends" name="fends" label="${tool.name} on ${on_string}: HiC fends"/>
-        <data format="hcd" name="data" label="${tool.name} on ${on_string}: HiC data"/>
-        <data format="hcp" name="project" label="${tool.name} on ${on_string}: HiC project"/>
-    </outputs>
-
-    <help>
-This tool takes a BED file containing restriction enzyme fragment boundaries or cutsites and a set of paired-end BAM files, a tabular counts file containing pairs of fend indices and associated counts, or a set of tabular raw files containing mapping coordinate pairs for each mapped read and creates and analyzes a HiFive HiC project.
-
-The bed file containing either restriction enzyme cutopoints or fragment bounds is converted into an hdf5-type fragment file of fragment characteristics. In addition to coordinates, strand, and chromosome information, additional columns can be included containing other fragment characteristics, such as GC content. If additional columns are included, they must be labeled in the header with a label containing no spaces or commas. These names can be used with the binning algorithm to include the fragment characteristic in the model to be learned. Additional characteristics should be comma-separated pairs of values corresponding to the upstream and downstream sides of the cutsite or ends of the fragment, depending on the whether the bed file contains cutsites or fragment coordinates, respectively.
-
-Reads are then paired with the specified fend file, creating a HiFive dataset object. Data can be a series of paired-end bam files, a tabular format list of paired genomic positions (chromosome1 coordinate1 strand1 chromosome2 coordinate2 strand2), or a HiCPipe-style mat-formatted list of fend-pairs and observed read counts.
-
-Finally, corrections values are learned for either each valid fend, ranges of fend characteristics, or both. The 'probability' and 'express' algorithms learn correction values associated with each fend while the 'binning' algorithm learns fend characteristic corrections. These can be chained together in either order to produce more robust corrections.
-
-Using the probability algorithm, observation of counts are assumed to be distributed according to a binomial distribution with an observation probability for each interaction equal to the product of the distance-dependence signal and the two fend correction parameters. Using the probability algorithm, learning is done using a backtracking line gradient descent approach. Learning proceeds for up to the maximum number of iterations but is terminated early if all of the absolute gradient values fall below the cutoff threshold. At each step, the learning rate is scaled down by the step value if the current learning rate does not produce sufficient improvement as measured by the Arjimo criterion.
-
-The express algorithm is a variant of matrix balancing and approximates the corrections through an iterative norm-2 adjustment to given all fragments a mean ratio of one for valid counts versus signal predicted from distance-dependence. This can be done using intra-regional interactions, inter-regional interactions, or all interactions.
-
-The binning algorithm divides each model parameter into some number of bins and based on a binomial distribution, correction values for each bin are learned, maximizing the log-likelihood of the data. Model parameters can be the fend lengths ('len'), fend GC content ('gc'), and any other characteristics passed as additional columns (with header labels) in the bed file used to create the HiFive fend file. Each parameter has a number of bins specified to divide it into and can be partitioned according to its type to contain approximately equal numbers of fends ('even'), or to cover equal portions of the range of parameter values ('fixed'). In addition, parameter types can include the '-const' suffix to denote a parameter that should not be optimized after seeding.
-    </help>
-
-</tool>
\ No newline at end of file
--- a/hifive/create_fivec_dataset.xml	Thu Apr 16 12:41:30 2015 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-<tool id="create_fivec_dataset" name="create_5C_dataset">
-    <requirements><requirement type='package'>hifive</requirement></requirements>
-    <description>create a HiFive 5C data object</description>
-    <command>
-        hifive 5c-data -q 
-
-        #if str( $datafile.format ) == "bam":
-            #for $bam_file in $datafile.paired_bam:
-                -B "${bam_file.readend1}" "${bam_file.readend2}"
-            #end for
-        #else:
-            #for $count_file in $datafile.count_files:
-                -C "${count_file.count}"
-            #end for
-        #end if
-
-        $frags $output</command>
-    <inputs>
-        <param format="frags" name="frags" type="data" label="HiFive fragment file" optional="False"/>
-        <conditional name="datafile">
-            <param name="format" type="select" label="Data Format">
-                <option value="bam">bam</option>
-                <option value="count">count</option>
-            </param>
-            <when value="bam">
-                <repeat name="paired_bam" title="Sequencing lane" min="1">
-                    <param format="bam" name="readend1" label="First read end" type="data"/>
-                    <param format="bam" name="readend2" label="Second read end" type="data"/>
-                </repeat>
-            </when>
-            <when value="count">
-                <repeat name="count_files" title="Count file" min="1">
-                    <param format="tabular" name="count" type="data" label="Count file" optional="False"/>
-                </repeat>
-            </when>
-        </conditional>
-    </inputs>
-    <outputs>
-        <data format="fcd" name="output" label="${tool.name} on ${on_string}: 5C data"/>
-    </outputs>
-
-    <help>
-This tool reads 5C data, pairs it with the specified fragment file, and creates a HiFive dataset object. Data can be a series of paired-end bam files or a tabular format list of paired fragments and their observed read count (fragment1 fragment2 count).
-    </help>
-
-</tool>
\ No newline at end of file
--- a/hifive/create_fivec_fragmentset.xml	Thu Apr 16 12:41:30 2015 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-<tool id="create_fragmentset" name="create_fragments">
-    <requirements><requirement type='package'>hifive</requirement></requirements>
-    <description>create a HiFive fragment object</description>
-    <command>hifive fragments -q $input $output</command>
-    <inputs>
-        <param format="bed" name="input" type="data" label="RE fragment BED File" optional="False"/>
-    </inputs>
-    <outputs>
-        <data format="frags" name="output" label="${tool.name} on ${on_string}: 5C frags"/>
-    </outputs>
-
-    <help>
-This tool converts a bed file containing targeted restriction enzyme fragment boundaries into an hdf5-type fragment file of fragment characteristics. In addition to coordinates, strand, and chromosome information, additional columns can be included containing other fragment characteristics, such as GC content. If additional columns are included, they must be labeled in the header with a label containing no spaces or commas. These names can be used with the binning algorithm to include the fragment characteristic in the model to be learned.
-    </help>
-
-</tool>
\ No newline at end of file
--- a/hifive/create_fivec_heatmap.xml	Thu Apr 16 12:41:30 2015 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,113 +0,0 @@
-<tool id="create_fivec_heatmap" name="generate_5C_heatmaps">
-    <requirements><requirement type='package'>hifive</requirement></requirements>
-    <description>create an hdf5 dictionary of heatmaps for a HiFive 5C project</description>
-    <command>
-        hifive 5c-heatmap -q
-        -d $datatype $trans1
-
-        #if str( $binning.binned ) == "unbinned":
-            -b 0 -a $binning.array
-        #else:
-            -b $binning.binsize
-        #end if
-        #if str( $regions ) != "":
-            -r $regions
-        #end if
-        #if str( $dynamic.binning ) == "yes":
-            -y -x $dynamic.expbinsize -f $dynamic.minobs -g $dynamic.search $dynamic.failed
-        #end if
-        #if str( $image.generate ) == "yes":
-            -k min_color=$image.mincolor -k mid_color=$image.midcolor -k max_color=$image.maxcolor
-            -i $image_file -k logged=$image.logged
-            #if $image.minscore:
-                -k minscore=$image.minscore
-            #end if
-            #if $image.maxscore:
-                -k maxscore=$image.maxscore
-            #end if
-        #end if
-
-        $data $output</command>
-    <inputs>
-        <param format="fcp" name="data" type="data" label="HiFive 5C project file" optional="False"/>
-        <conditional name="binning">
-            <param type="select" name="binned" label="Binning">
-                <option value="unbinned">unbinned</option>
-                <option value="binned">binned</option>
-            </param>
-            <when value="unbinned">
-                <param type="select" name="array" label="Array type" help="A full array is n by n (n = total # of fragments) while a compact array is n by m (n = forward fragments, m = reverse fragments).">
-                    <option value="full">full</option>
-                    <option value="compact">compact</option>
-                </param>
-            </when>
-            <when value="binned">
-                <param type="integer" name="binsize" label="Binning size (bp)" value="10000" >
-                    <validator type="in_range" min="0"/>
-                </param>
-            </when>
-        </conditional>
-        <param type="select" name="trans1" label="Calculate and include trans interactions">
-            <option value="-t">yes</option>
-            <option value="">no</option>
-        </param>
-        <param type="select" name="datatype" label="Type of data to return">
-            <option value="raw">raw</option>
-            <option value="fragment">fragment-corrected</option>
-            <option value="distance">distance-removed</option>
-            <option value="enrichment">enrichment</option>
-        </param>
-        <param type="text" size="60" name="regions" value="" label="Included regions" optional="False" help="If a subset of regions are to be used, enter a comma-separated list of region numbers."/>
-        <conditional name="dynamic">
-            <param name="binning" type="select" label="Dynamically bin data">
-                <option value="yes">yes</option>
-                <option value="no">no</option>
-            </param>
-            <when value="yes">
-                <param name="expbinsize" type="integer" label="Expansion binning size (bp)" value="10000" help="The size of bins to use when expanding heatmap bins. A zero indicates unbinned expansion." >
-                    <validator type="in_range" min="0"/>
-                </param>
-                <param name="minobs" type="integer" label="Minimum observations" value="20" help="The number of observations needed to stop expanding a bin." >
-                    <validator type="in_range" min="1"/>
-                </param>
-                <param name="search" type="integer" label="Maximum search distance" value="0" help="The maximum distance a bin can be expanded. A value of zero indicates no maximum." >
-                    <validator type="in_range" min="0"/>
-                </param>
-                <param name="failed" type="select" label="Remove failed bins">
-                    <option value="">no</option>
-                    <option value="-v">yes</option>
-                </param>
-            </when>
-            <when value="no"/>
-        </conditional>
-        <conditional name="image">
-            <param name="generate" type="select" label="Generate image">
-                <option value="yes">yes</option>
-                <option value="no">no</option>
-            </param>
-            <when value="yes">
-                <param name="mincolor" type="color" value="#0000ff" label="Minimum value color"/>
-                <param name="midcolor" type="color" value="#ffffff" label="Middle value color"/>
-                <param name="maxcolor" type="color" value="#ff0000" label="Maximum value color"/>
-                <param name="logged" type="select" label="Logged values">
-                    <option value="true">yes</option>
-                    <option value="false">no</option>
-                </param>
-                <param name="minscore" type="float" optional="true" label="Minimum score limit"/>
-                <param name="maxscore" type="float" optional="true" label="Maximum score limit"/>
-            </when>
-            <when value="no"/>
-        </conditional>
-    </inputs>
-    <outputs>
-        <data format="h5" name="output" label="${tool.name} on ${on_string}: 5C heatmap"/>
-        <data format="png" name="image_file" label="${tool.name} on ${on_string}: 5C PNG">
-            <filter>(image['generate'] == "yes")</filter>
-        </data>
-    </outputs>
-
-    <help>
-This tool takes a HiFive 5C project and calculates expected and observed interaction signals for all requested regions (and inter-region pairs, if requested). All signals, along with bin boundaries, are stored in an hdf5 dictionary.
-    </help>
-
-</tool>
\ No newline at end of file
--- a/hifive/create_fivec_project.xml	Thu Apr 16 12:41:30 2015 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-<tool id="create_fivec_project" name="create_5C_project">
-    <requirements><requirement type='package'>hifive</requirement></requirements>
-    <description>create a HiFive 5C project object</description>
-    <command>
-        hifive 5c-project -q
-        -f $minint -m $filtermin -x $filtermax
-        $data $output</command>
-    <inputs>
-        <param format="fcd" name="data" type="data" label="HiFive 5C data file" optional="False"/>
-        <param type="integer" name="filtermin" value="100000" label="Minimum interaction distance for filtering" optional="False">
-            <validator type="in_range" min="0"/>
-        </param>
-        <param type="integer" name="filtermax" value="0" label="Maximum interaction distance for filtering" optional="False">
-            <validator type="in_range" min="0"/>
-        </param>
-        <param type="integer" name="minint" value="20" label="Minimum interactions per fragment" optional="False">
-            <validator type="in_range" min="1"/>
-        </param>
-    </inputs>
-    <outputs>
-        <data format="fcp" name="output" label="${tool.name} on ${on_string}: 5C project"/>
-    </outputs>
-
-    <help>
-This tool creates a HiFive 5C project object and pairs a 5C data file with it. Fragments are filtered in an iterative manner using the minimum interaction cutoff parameter specified to ensure that all valid fends have at least the minimum number of interactions with other valid fends. Subsequently, a distance dependence approximation line is calculated using a regression line to approximate the linear relationship between log(# reads) and log(distance).
-    </help>
-
-</tool>
\ No newline at end of file
--- a/hifive/create_hic_dataset.xml	Thu Apr 16 12:41:30 2015 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-<tool id="create_hic_dataset" name="create_HiC_dataset">
-    <requirements><requirement type='package'>hifive</requirement></requirements>
-    <description>create a HiFive HiC data object</description>
-    <command>
-        hifive hic-data -q
-
-        #if str( $datafile.format ) == "bam":
-            #for $bam_file in $datafile.paired_bam:
-                --bam ${bam_file.readend1} ${bam_file.readend2}
-            #end for
-        #elif str( $datafile.format ) == "mat":
-            --mat ${datafile.mat}
-        #else:
-            #for raw_file in $datafile.raw_files:
-                --raw ${raw_file.raw}
-            #end for
-        #end if
-
-        -i $insert $fends $output</command>
-    <inputs>
-        <param format="fends" name="fends" type="data" label="HiFive fend file" optional="False"/>
-        <param type="integer" name="insert" value="500" label="Maximum insert size" optional="False">
-            <validator type="in_range" min="1"/>
-        </param>
-        <conditional name="datafile">
-            <param name="format" type="select" label="Data Format">
-                <option value="bam">bam</option>
-                <option value="mat">mat</option>
-                <option value="raw">raw</option>
-            </param>
-            <when value="bam">
-                <repeat name="paired_bam" title="Sequencing lane" min="1">
-                    <param format="bam" name="readend1" label="First read end" type="data"/>
-                    <param format="bam" name="readend2" label="Second read end" type="data"/>
-                </repeat>
-            </when>
-            <when value="mat">
-                <param format="tabular" name="mat" type="data" label="Mat file" optional="False"/>
-            </when>
-            <when value="raw">
-                <repeat name="raw_files" title="Raw file" min="1">
-                    <param format="tabular" name="raw" type="data" label="Raw file" optional="False"/>
-                </repeat>
-            </when>
-        </conditional>
-    </inputs>
-    <outputs>
-        <data format="hcd" name="output" label="${tool.name} on ${on_string}: HiC data"/>
-    </outputs>
-
-    <help>
-This tool reads HiC data, pairs it with the specified fend file, and creates a HiFive dataset object. Data can be a series of paired-end bam files, a tabular format list of paired genomic positions (chromosome1 coordinate1 strand1 chromosome2 coordinate2 strand2), or a HiCPipe-style mat-formatted list of fend-pairs and observed read counts.
-    </help>
-
-</tool>
\ No newline at end of file
--- a/hifive/create_hic_fendset.xml	Thu Apr 16 12:41:30 2015 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-<tool id="create_fendset" name="create_fends">
-    <requirements><requirement type='package'>hifive</requirement></requirements>
-    <description>create a HiFive fend object</description>
-    <command>hifive fends -q --bed $input $output</command>
-    <inputs>
-        <param format="bed" name="input" type="data" label="RE Cutsite BED File" optional="False"/>
-    </inputs>
-    <outputs>
-        <data format="fends" name="output" label="${tool.name} on ${on_string}: HiC fends"/>
-    </outputs>
-
-    <help>
-This tool converts a bed file containing either restriction enzyme cutopoints or fragment bounds into an hdf5-type fragment file of fragment characteristics. In addition to coordinates, strand, and chromosome information, additional columns can be included containing other fragment characteristics, such as GC content. If additional columns are included, they must be labeled in the header with a label containing no spaces or commas. These names can be used with the binning algorithm to include the fragment characteristic in the model to be learned. Additional characteristics should be comma-separated pairs of values corresponding to the upstream and downstream sides of the cutsite or ends of the fragment, depending on the whether the bed file contains cutsites or fragment coordinates, respectively.
-    </help>
-
-</tool>
\ No newline at end of file
--- a/hifive/create_hic_heatmap.xml	Thu Apr 16 12:41:30 2015 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,97 +0,0 @@
-<tool id="create_hic_heatmap" name="generate_HiC_heatmaps">
-    <requirements><requirement type='package'>hifive</requirement></requirements>
-    <description>create an hdf5 dictionary of heatmaps for a HiFive HiC project</description>
-    <command>
-        hifive hic-heatmap -q 
-        -b $binsize -d $datatype $trans1
-
-        #if str( $chroms ) != "":
-            -c $chroms
-        #end if
-        #if str( $dynamic.binning ) == "yes":
-            -y -x $dynamic.expbinsize -f $dynamic.minobs -a $dynamic.search $dynamic.failed
-        #end if
-        #if str( $image.generate ) == "yes":
-            -k min_color=$image.mincolor -k mid_color=$image.midcolor -k max_color=$image.maxcolor
-            -i $image_file -k logged=$image.logged
-            #if $image.minscore:
-                -k minscore=$image.minscore
-            #end if
-            #if $image.maxscore:
-                -k maxscore=$image.maxscore
-            #end if
-        #end if
-
-        $data $output</command>
-    <inputs>
-        <param format="hcp" name="data" type="data" label="HiFive HiC project file" optional="False"/>
-        <param type="integer" name="binsize" value="10000" label="Binning size (bp)" optional="False">
-            <validator type="in_range" min="0"/>
-        </param>
-        <param type="select" name="trans1" label="Calculate and include trans interactions">
-            <option value="-t">yes</option>
-            <option value="">no</option>
-        </param>
-        <param type="select" name="datatype" label="Type of data to return">
-            <option value="raw">raw</option>
-            <option value="fend">fend-corrected</option>
-            <option value="distance">distance-removed</option>
-            <option value="enrichment">enrichment</option>
-        </param>
-        <param type="text" size="60" name="chroms" value="" label="Included chromosomes" optional="False" help="If a subset of chromosomes are to be used, enter a comma-separated list of chromosome names."/>
-        <conditional name="dynamic">
-            <param name="binning" type="select" label="Dynamically bin data">
-                <option value="yes">yes</option>
-                <option value="no">no</option>
-            </param>
-            <when value="yes">
-                <param name="expbinsize" type="integer" label="Expansion binning size (bp)" value="10000" help="The size of bins to use when expanding heatmap bins. A zero indicates unbinned expansion." >
-                    <validator type="in_range" min="0"/>
-                </param>
-                <param name="minobs" type="integer" label="Minimum observations" value="20" help="The number of observations needed to stop expanding a bin." >
-                    <validator type="in_range" min="1"/>
-                </param>
-                <param name="search" type="integer" label="Maximum search distance" value="0" help="The maximum distance a bin can be expanded. A value of zero indicates no maximum." >
-                    <validator type="in_range" min="0"/>
-                </param>
-                <param name="failed" type="select" label="Remove failed bins">
-                    <option value="">no</option>
-                    <option value="-v">yes</option>
-                </param>
-            </when>
-            <when value="no"/>
-        </conditional>
-        <conditional name="image">
-            <param name="generate" type="select" label="Generate image">
-                <option value="yes">yes</option>
-                <option value="no">no</option>
-            </param>
-            <when value="yes">
-                <param name="mincolor" type="color" value="#0000ff" label="Minimum value color"/>
-                <param name="midcolor" type="color" value="#ffffff" label="Middle value color"/>
-                <param name="maxcolor" type="color" value="#ff0000" label="Maximum value color"/>
-                <param name="logged" type="select" label="Logged values">
-                    <option value="true">yes</option>
-                    <option value="false">no</option>
-                </param>
-                <param name="minscore" type="float" optional="True" label="Minimum score limit"/>
-                <param name="maxscore" type="float" optional="True" label="Maximum score limit"/>
-            </when>
-            <when value="no"/>
-        </conditional>
-    </inputs>
-    <outputs>
-        <data format="h5" name="output" label="${tool.name} on ${on_string}: HiC hdf5"/>
-        <data format="png" name="image_file" label="${tool.name} on ${on_string}: HiC PNG">
-            <filter>(image['generate'] == "yes")</filter>
-            <change_format>
-                <when input="image.format.type" value="pdf" format="pdf"/>
-            </change_format>
-        </data>
-    </outputs>
-
-    <help>
-This tool takes a HiFive HiC project and calculates expected and observed interaction signals for all requested chromosomes (and inter-chromosome pairs, if requested). All signals, along with bin boundaries, are stored in an hdf5 dictionary.
-    </help>
-
-</tool>
\ No newline at end of file
--- a/hifive/create_hic_project.xml	Thu Apr 16 12:41:30 2015 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-<tool id="create_hic_project" name="create_HiC_project">
-    <requirements><requirement type='package'>hifive</requirement></requirements>
-    <description>create a HiFive HiC project object</description>
-    <command>
-        hifive hic-project -q 
-        -f $minint -m $filtermin -x $filtermax -j $minbin -n $numbin
-        $data $output</command>
-    <inputs>
-        <param format="hcd" name="data" type="data" label="HiFive HiC data file" optional="False"/>
-        <param type="integer" name="minint" value="20" label="Minimum interactions per fend" optional="False">
-            <validator type="in_range" min="1"/>
-        </param>
-        <param type="integer" name="filtermin" value="1000000" label="Minimum interaction distance for filtering" optional="False">
-            <validator type="in_range" min="0"/>
-        </param>
-        <param type="integer" name="filtermax" value="0" label="Maximum interaction distance for filtering" optional="False">
-            <validator type="in_range" min="0"/>
-        </param>
-        <param type="integer" name="minbin" value="1000" label="Minimum distance bin cutoff" optional="False">
-            <validator type="in_range" min="1"/>
-        </param>
-        <param type="integer" name="numbin" value="100" label="Number of distance bins" optional="False">
-            <validator type="in_range" min="1"/>
-        </param>
-    </inputs>
-    <outputs>
-        <data format="hcp" name="output" label="${tool.name} on ${on_string}: HiC project"/>
-    </outputs>
-
-    <help>
-This tool creates a HiFive HiC project object and pairs a HiC data file with it. Fends are filtered in an iterative manner using the minimum interaction cutoff and interaction size parameters specified to ensure that all valid fends have at least the minimum number of interactions with other valid fends. Subsequently, a distance dependence approximation curve is calculated piecewise using the number of bins specified. The first bin encompasses all interactions less than or equal to the minimum bin cutoff value. The remaining bins are evenly sized between log(minimum cutoff) and log(max possible interaction size).
-    </help>
-
-</tool>
\ No newline at end of file
--- a/hifive/get_interval_fivec_data.xml	Thu Apr 16 12:41:30 2015 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,108 +0,0 @@
-<tool id="get_interval_fivec_data" name="get_interval_5C_data">
-    <requirements><requirement type='package'>hifive</requirement></requirements>
-    <description>create an interval file containing 5C data</description>
-    <command>
-        hifive 5c-interval -q
-        -c $region -d $datatype -b $binsize
-
-        #if $start:
-            -s $start
-        #end if
-        #if $stop:
-            -e $stop
-        #end if
-        #if str( $dynamic.binning ) == "yes":
-            -y -x $dynamic.expbinsize -f $dynamic.minobs -g $dynamic.search $dynamic.failed
-        #end if
-        #if str( $image.generate ) == "yes":
-            -k min_color=$image.mincolor -k mid_color=$image.midcolor -k max_color=$image.maxcolor
-            -i $image_file -k logged=$image.logged
-            #if str( $binsize ) != "0":
-                $image.rotate
-            #end if
-            #if $image.minscore:
-                -k minscore=$image.minscore
-            #end if
-            #if $image.maxscore:
-                -k maxscore=$image.maxscore
-            #end if
-        #end if
-
-        -q $project $output</command>
-    <inputs>
-        <param name="project" type="data" format="fcp" label="HiFive 5C project file" optional="False"/>
-        <param type="integer" name="region" value="" label="Region" optional="False">
-            <validator type="empty_field" />
-        </param>
-        <param type="integer" name="start" value="0" label="Starting coordinate" optional="True">
-            <validator type="in_range" min="0"/>
-        </param>
-        <param type="integer" name="stop" value="0" label="Stopping coordinate" optional="True">
-            <validator type="in_range" min="0"/>
-        </param>
-        <param type="integer" name="binsize" value="10000" label="Binsize" optional="False" help="A value of zero will return unbinned data.">
-            <validator type="in_range" min="0"/>
-        </param>
-        <param name="datatype" type="select" label="Datatype">
-            <option value="raw">raw</option>
-            <option value="distance">distance-corrected</option>
-            <option value="fragment">fragment-corrected</option>
-            <option value="enrichment">enrichment</option>
-        </param>
-        <conditional name="dynamic">
-            <param name="binning" type="select" label="Dynamically bin data">
-                <option value="yes">yes</option>
-                <option value="no">no</option>
-            </param>
-            <when value="yes">
-                <param name="expbinsize" type="integer" label="Expansion binning size (bp)" value="10000" help="The size of bins to use when expanding heatmap bins. A zero indicates unbinned expansion." >
-                    <validator type="in_range" min="0"/>
-                </param>
-                <param name="minobs" type="integer" label="Minimum observations" value="20" help="The number of observations needed to stop expanding a bin." >
-                    <validator type="in_range" min="1"/>
-                </param>
-                <param name="search" type="integer" label="Maximum search distance" value="0" help="The maximum distance a bin can be expanded. A value of zero indicates no maximum." >
-                    <validator type="in_range" min="0"/>
-                </param>
-                <param name="failed" type="select" label="Remove failed bins">
-                    <option value="">no</option>
-                    <option value="-v">yes</option>
-                </param>
-            </when>
-            <when value="no"/>
-        </conditional>
-        <conditional name="image">
-            <param name="generate" type="select" label="Generate image">
-                <option value="yes">yes</option>
-                <option value="no">no</option>
-            </param>
-            <when value="yes">
-                <param name="mincolor" type="color" value="#0000ff" label="Minimum value color"/>
-                <param name="midcolor" type="color" value="#ffffff" label="Middle value color"/>
-                <param name="maxcolor" type="color" value="#ff0000" label="Maximum value color"/>
-                <param name="rotate" type="select" label="Rotate image 45 degrees (horizontal axis, binned array only)">
-                    <option value="">no</option>
-                    <option value="-r">yes</option>
-                </param>
-                <param name="logged" type="select" label="Logged values">
-                    <option value="true">yes</option>
-                    <option value="false">no</option>
-                </param>
-                <param name="minscore" type="float" optional="True" label="Minimum score limit"/>
-                <param name="maxscore" type="float" optional="True" label="Maximum score limit"/>
-            </when>
-            <when value="no"/>
-        </conditional>
-    </inputs>
-    <outputs>
-        <data format="chrint" name="output" label="${tool.name} on ${on_string}: 5C chrint"/>
-        <data format="png" name="image_file" label="${tool.name} on ${on_string}: 5C PNG">
-            <filter>(image['generate'] == "yes")</filter>
-        </data>
-    </outputs>
-
-    <help>
-This tool pulls data from a HiFive 5C project file for a specified region and returns a chromatin interaction interval file. Data can be either uncorrected, corrected for distance dependence or fragment bias only, or fully corrected (enrichment).
-    </help>
-
-</tool>
\ No newline at end of file
--- a/hifive/get_interval_hic_data.xml	Thu Apr 16 12:41:30 2015 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,111 +0,0 @@
-<tool id="get_interval_hic_data" name="get_interval_HiC_data">
-    <requirements><requirement type='package'>hifive</requirement></requirements>
-    <description>create an interval file containing HiC data</description>
-    <command>
-        hifive hic-interval -q
-        -c $chrom -d $datatype -b $binsize
-
-        #if $start:
-            -s $start
-        #end if
-        #if $stop:
-            -e $stop
-        #end if
-        #if $maxdist:
-            -m $maxdist
-        #end if
-        #if str( $dynamic.binning ) == "yes":
-            -y -x $dynamic.expbinsize -f $dynamic.minobs -a $dynamic.search $dynamic.failed
-        #end if
-        #if str( $image.generate ) == "yes":
-            -k min_color=$image.mincolor -k mid_color=$image.midcolor -k max_color=$image.maxcolor
-            -i $image_file -k logged=$image.logged $image.rotate
-            #if $image.minscore:
-                -k minscore=$image.minscore
-            #end if
-            #if $image.maxscore:
-                -k maxscore=$image.maxscore
-            #end if
-        #end if
-
-        $project $output</command>
-    <inputs>
-        <param name="project" type="data" format="hcp" label="HiFive HiC project file" optional="False"/>
-        <param type="text" name="chrom" size="10" label="Chromosome" optional="False">
-            <validator type="empty_field" />
-        </param>
-        <param type="integer" name="start" value="0" label="Starting coordinate" optional="True">
-            <validator type="in_range" min="0"/>
-        </param>
-        <param type="integer" name="stop" value="0" label="Stopping coordinate" optional="True">
-            <validator type="in_range" min="0"/>
-        </param>
-        <param type="integer" name="binsize" value="10000" label="Binsize" optional="False" help="A value of zero will return unbinned data.">
-            <validator type="in_range" min="0"/>
-        </param>
-        <param type="integer" name="maxdist" value="0" label="Maximum interaction distance" optional="True" help="A value of zero will include all interaction distances that fall between the start and stop coordinates.">
-            <validator type="in_range" min="0"/>
-        </param>
-        <param name="datatype" type="select" label="Datatype">
-            <option value="raw">raw</option>
-            <option value="distance">distance-corrected</option>
-            <option value="fend">fend-corrected</option>
-            <option value="enrichment">enrichment</option>
-        </param>
-        <conditional name="dynamic">
-            <param name="binning" type="select" label="Dynamically bin data">
-                <option value="yes">yes</option>
-                <option value="no">no</option>
-            </param>
-            <when value="yes">
-                <param name="expbinsize" type="integer" label="Expansion binning size (bp)" value="10000" help="The size of bins to use when expanding heatmap bins. A zero indicates unbinned expansion." >
-                    <validator type="in_range" min="0"/>
-                </param>
-                <param name="minobs" type="integer" label="Minimum observations" value="20" help="The number of observations needed to stop expanding a bin." >
-                    <validator type="in_range" min="1"/>
-                </param>
-                <param name="search" type="integer" label="Maximum search distance" value="0" help="The maximum distance a bin can be expanded. A value of zero indicates no maximum." >
-                    <validator type="in_range" min="0"/>
-                </param>
-                <param name="failed" type="select" label="Remove failed bins">
-                    <option value="">no</option>
-                    <option value="-v">yes</option>
-                </param>
-            </when>
-            <when value="no"/>
-        </conditional>
-        <conditional name="image">
-            <param name="generate" type="select" label="Generate image">
-                <option value="yes">yes</option>
-                <option value="no">no</option>
-            </param>
-            <when value="yes">
-                <param name="mincolor" type="color" value="#0000ff" label="Minimum value color"/>
-                <param name="midcolor" type="color" value="#ffffff" label="Middle value color"/>
-                <param name="maxcolor" type="color" value="#ff0000" label="Maximum value color"/>
-                <param name="rotate" type="select" label="Rotate image 45 degrees (horizontal axis)">
-                    <option value="">no</option>
-                    <option value="-r">yes</option>
-                </param>
-                <param name="logged" type="select" label="Logged values">
-                    <option value="true">yes</option>
-                    <option value="false">no</option>
-                </param>
-                <param name="minscore" type="float" optional="True" label="Minimum score limit"/>
-                <param name="maxscore" type="float" optional="True" label="Maximum score limit"/>
-            </when>
-            <when value="no"/>
-        </conditional>
-    </inputs>
-    <outputs>
-        <data format="chrint" name="output" label="${tool.name} on ${on_string}: HiC chrint"/>
-        <data format="png" name="image_file" label="${tool.name} on ${on_string}: HiC PNG">
-            <filter>(image['generate'] == "yes")</filter>
-        </data>
-    </outputs>
-
-    <help>
-This tool pulls data from a HiFive HiC project file for a specified region of a chromosome and returns a chromatin interaction interval file. Data can be either uncorrected, corrected for distance dependence or fend bias only, or fully corrected (enrichment).
-    </help>
-
-</tool>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hifive/hifive/complete_fivec_project.xml	Thu Apr 16 15:13:44 2015 -0400
@@ -0,0 +1,308 @@
+<tool id="complete_fivec_project" name="analyze_5C_data">
+    <requirements>
+        <requirement type='package' name="hifive"/>
+        <requirement type='package' name="numpy"/>
+        <requirement type='package' name="scipy"/>
+        <requirement type='package' name="h5py"/>
+        <requirement type='package' name="cython"/>
+    </requirements>
+    <description>from start to finish, including creating a fragmentset, dataset, and corrected HiFive 5C project</description>
+    <command>
+        hifive 5c-complete $analysis.algorithm -q
+        -m $mindist -x $maxdist
+
+        #if str( $datafile.format ) == "bam":
+            #for $bam_file in $datafile.paired_bam:
+                -B "${bam_file.readend1}" "${bam_file.readend2}"
+            #end for
+        #else:
+            #for $count_file in $datafile.count_files:
+                -C "${count_file.count}"
+            #end for
+        #end if
+        #if str( $regions ) != "":
+            -r $regions
+        #end if
+        #if str( $analysis.algorithm ) == "probability" or str( $analysis.algorithm ) == "binning-probability" or str( $analysis.algorithm ) == "probability-binning":
+            -b $analysis.probiter  -l $analysis.step -g $analysis.change $analysis.precalc
+        #end if
+        #if str( $analysis.algorithm ) == "express" or str( $analysis.algorithm ) == "binning-express" or str( $analysis.algorithm ) == "probability-express":
+            -e $analysis.expiter $analysis.removedist -w $analysis.expreads
+        #end if
+        #if str( $analysis.algorithm ) == "binning" or str( $analysis.algorithm ) == "binning-express" or str( $analysis.algorithm ) == "binning-probability" or str( $analysis.algorithm ) == "express-binning" or str( $analysis.algorithm ) == "probability-binning":
+            -i $analysis.biniter -t $analysis.threshold -y $analysis.binreads
+            -v $analysis.model -n $analysis.modelbins -u $analysis.modeltypes
+        #end if
+
+        -o $frags $data $project $bed</command>
+    <inputs>
+        <param format="bed" name="bed" type="data" label="Probed RE fragment boundary BED File" optional="False"/>
+        <conditional name="datafile">
+            <param name="format" type="select" label="Data Format">
+                <option value="bam">bam</option>
+                <option value="count">count</option>
+            </param>
+            <when value="bam">
+                <repeat name="paired_bam" title="Sequencing lane" min="1">
+                    <param format="bam" name="readend1" label="First read end" type="data"/>
+                    <param format="bam" name="readend2" label="Second read end" type="data"/>
+                </repeat>
+            </when>
+            <when value="count">
+                <repeat name="count_files" title="Counts file" min="1">
+                    <param format="tabular" name="count" type="data" label="Counts file" optional="False"/>
+                </repeat>
+            </when>
+        </conditional>
+        <param type="integer" name="mindist" value="0" label="Minimum interaction distance" optional="False" help="The minimum interaction distance included for filtering fragments and learning correction values.">
+            <validator type="in_range" min="0"/>
+        </param>
+        <param type="integer" name="maxdist" value="0" label="Maximum interaction distance" optional="False" help="The maximum interaction distance included for filtering fragments and learning correction values. A value of zero indicates no upper limit.">
+            <validator type="in_range" min="0"/>
+        </param>
+        <param type="integer" name="minint" value="20" label="Minimum interactions per fragment" optional="False">
+            <validator type="in_range" min="1"/>
+        </param>
+        <param type="text" size="60" name="regions" value="" label="Included regions" optional="False" help="If a subset of regions are to be used, enter a comma-separated list of region indices."/>
+        <conditional name='analysis'>
+            <param name="algorithm" type="select" label="Learning Algorithm">
+                <option value="probability">Probability</option>
+                <option value="express">Express</option>
+                <option value="binning">Binning</option>
+                <option value="binning-probability">Binning-Probability</option>
+                <option value="binning-express">Binning-Express</option>
+                <option value="probability-binning">Probability-Binning</option>
+                <option value="express-binning">Express-Binning</option>
+            </param>
+
+            <when value="probability">
+                <param type="integer" name="probiter" value="1000" label="Maximum number of iterations" optional="False">
+                    <validator type="in_range" min="1"/>
+                </param>
+                <param type="float" name="change" value="0.0005" label="Parameter change cutoff" optional="False" help="The cutoff for the absolute gradient values such that learning will cease if all values fall below this threshold.">
+                    <validator type="in_range" min="0.00000001"/>
+                </param>
+                <param type="float" name="step" value="0.5" label="Learning rate scaling factor" optional="False">
+                    <validator type="in_range" min="0.000001" max="1.0"/>
+                </param>
+                <param type="select" name="precalc" label="Precalculate probability corrections from fragment means">
+                    <option value="-p">yes</option>
+                    <option value="">no</option>
+                </param>
+            </when>
+
+            <when value="express">
+                <param type="integer" name="expiter" value="1000" label="Number of express iterations" optional="False">
+                    <validator type="in_range" min="1"/>
+                </param>
+                <param type="select" name="removedist" label="Remove estimated distance-dependence prior to learning express corrections.">
+                    <option value="-d">yes</option>
+                    <option value="">no</option>
+                </param>
+                <param type="select" name="expreads" label="Reads to use for learning express corrections.">
+                    <option value="cis">cis</option>
+                    <option value="trans">trans</option>
+                    <option value="all">all</option>
+                </param>
+            </when>
+
+            <when value="binning">
+                <param type="integer" name="biniter" value="1000" label="Maximum number of binning iterations" optional="False">
+                    <validator type="in_range" min="1"/>
+                </param>
+                <param type="float" name="threshold" value="1.0" label="Learning threshold" optional="False"
+                    help="The minimum change needed in the log-likelihood to continue learning binning corrections.">
+                    <validator type="in_range" min="0.000001" max="1.0"/>
+                </param>
+                <param type="select" name="binreads" label="Reads to use for learning binning corrections.">
+                    <option value="cis">cis</option>
+                    <option value="trans">trans</option>
+                    <option value="all">all</option>
+                </param>
+                <param type="text" size="60" name="model" value="len" label="Model parameters" optional="False" help="A comma-separated list of fragment characteristics to learn corrections for. These can include 'len' and any characteristics included in the fragment bed file.">
+                    <validator type="empty_field" />
+                </param>
+                <param type="text" size="60" name="modelbins" value="10" label="Number of parameter bins" optional="False" help="A comma-separated list of bins to divide each model parameter into.">
+                    <validator type="empty_field" />
+                </param>
+                <param type="text" size="60" name="modeltypes" value="even" label="Parameter types" optional="False" help="A comma-separated list of model parameter types. These can be 'even', 'fixed', 'even-const', and 'fixed-const'.">
+                    <validator type="empty_field" />
+                </param>
+            </when>
+
+            <when value="binning-probability">
+                <param type="integer" name="biniter" value="1000" label="Maximum number of binning iterations" optional="False">
+                    <validator type="in_range" min="1"/>
+                </param>
+                <param type="float" name="threshold" value="1.0" label="Learning threshold" optional="False"
+                    help="The minimum change needed in the log-likelihood to continue learning binning corrections.">
+                    <validator type="in_range" min="0.000001" max="1.0"/>
+                </param>
+                <param type="select" name="binreads" label="Reads to use for learning binning corrections.">
+                    <option value="cis">cis</option>
+                    <option value="trans">trans</option>
+                    <option value="all">all</option>
+                </param>
+                <param type="text" size="60" name="model" value="len" label="Model parameters" optional="False" help="A comma-separated list of fragment characteristics to learn corrections for. These can include 'len' and any characteristics included in the fragment bed file.">
+                    <validator type="empty_field" />
+                </param>
+                <param type="text" size="60" name="modelbins" value="10" label="Number of parameter bins" optional="False" help="A comma-separated list of bins to divide each model parameter into.">
+                    <validator type="empty_field" />
+                </param>
+                <param type="text" size="60" name="modeltypes" value="even" label="Parameter types" optional="False" help="A comma-separated list of model parameter types. These can be 'even', 'fixed', 'even-const', and 'fixed-const'.">
+                    <validator type="empty_field" />
+                </param>
+                <param type="integer" name="probiter" value="1000" label="Maximum number of iterations" optional="False">
+                    <validator type="in_range" min="1"/>
+                </param>
+                <param type="float" name="change" value="0.0005" label="Parameter change cutoff" optional="False" help="The cutoff for the absolute gradient values such that learning will cease if all values fall below this threshold.">
+                    <validator type="in_range" min="0.00000001"/>
+                </param>
+                <param type="float" name="step" value="0.5" label="Learning rate scaling factor" optional="False">
+                    <validator type="in_range" min="0.000001" max="1.0"/>
+                </param>
+                <param type="select" name="precalc" label="Precalculate probability corrections from fragment means">
+                    <option value="-p">yes</option>
+                    <option value="">no</option>
+                </param>
+            </when>
+
+            <when value="binning-express">
+                <param type="integer" name="biniter" value="1000" label="Maximum number of binning iterations" optional="False">
+                    <validator type="in_range" min="1"/>
+                </param>
+                <param type="float" name="threshold" value="1.0" label="Learning threshold" optional="False"
+                    help="The minimum change needed in the log-likelihood to continue learning binning corrections.">
+                    <validator type="in_range" min="0.000001" max="1.0"/>
+                </param>
+                <param type="select" name="binreads" label="Reads to use for learning binning corrections.">
+                    <option value="cis">cis</option>
+                    <option value="trans">trans</option>
+                    <option value="all">all</option>
+                </param>
+                <param type="text" size="60" name="model" value="len" label="Model parameters" optional="False" help="A comma-separated list of fragment characteristics to learn corrections for. These can include 'len' and any characteristics included in the fragment bed file.">
+                    <validator type="empty_field" />
+                </param>
+                <param type="text" size="60" name="modelbins" value="10" label="Number of parameter bins" optional="False" help="A comma-separated list of bins to divide each model parameter into.">
+                    <validator type="empty_field" />
+                </param>
+                <param type="text" size="60" name="modeltypes" value="even" label="Parameter types" optional="False" help="A comma-separated list of model parameter types. These can be 'even', 'fixed', 'even-const', and 'fixed-const'.">
+                    <validator type="empty_field" />
+                </param>
+                <param type="integer" name="expiter" value="1000" label="Number of express iterations" optional="False">
+                    <validator type="in_range" min="1"/>
+                </param>
+                <param type="select" name="removedist" label="Remove estimated distance-dependence prior to learning express corrections.">
+                    <option value="-d">yes</option>
+                    <option value="">no</option>
+                </param>
+                <param type="select" name="expreads" label="Reads to use for learning express corrections.">
+                    <option value="cis">cis</option>
+                    <option value="trans">trans</option>
+                    <option value="all">all</option>
+                </param>
+            </when>
+
+            <when value="probability-binning">
+                <param type="integer" name="probiter" value="1000" label="Maximum number of iterations" optional="False">
+                    <validator type="in_range" min="1"/>
+                </param>
+                <param type="float" name="change" value="0.0005" label="Parameter change cutoff" optional="False" help="The cutoff for the absolute gradient values such that learning will cease if all values fall below this threshold.">
+                    <validator type="in_range" min="0.00000001"/>
+                </param>
+                <param type="float" name="step" value="0.5" label="Learning rate scaling factor" optional="False">
+                    <validator type="in_range" min="0.000001" max="1.0"/>
+                </param>
+                <param type="select" name="precalc" label="Precalculate probability corrections from fragment means">
+                    <option value="-p">yes</option>
+                    <option value="">no</option>
+                </param>
+                <param type="select" name="precalc" label="Precalculate probability corrections from fragment means">
+                    <option value="-p">yes</option>
+                    <option value="">no</option>
+                </param>
+                <param type="integer" name="biniter" value="1000" label="Maximum number of binning iterations" optional="False">
+                    <validator type="in_range" min="1"/>
+                </param>
+                <param type="float" name="threshold" value="1.0" label="Learning threshold" optional="False"
+                    help="The minimum change needed in the log-likelihood to continue learning binning corrections.">
+                    <validator type="in_range" min="0.000001" max="1.0"/>
+                </param>
+                <param type="select" name="binreads" label="Reads to use for learning binning corrections.">
+                    <option value="cis">cis</option>
+                    <option value="trans">trans</option>
+                    <option value="all">all</option>
+                </param>
+                <param type="text" size="60" name="model" value="len" label="Model parameters" optional="False" help="A comma-separated list of fragment characteristics to learn corrections for. These can include 'len' and any characteristics included in the fragment bed file.">
+                    <validator type="empty_field" />
+                </param>
+                <param type="text" size="60" name="modelbins" value="10" label="Number of parameter bins" optional="False" help="A comma-separated list of bins to divide each model parameter into.">
+                    <validator type="empty_field" />
+                </param>
+                <param type="text" size="60" name="modeltypes" value="even" label="Parameter types" optional="False" help="A comma-separated list of model parameter types. These can be 'even', 'fixed', 'even-const', and 'fixed-const'.">
+                    <validator type="empty_field" />
+                </param>
+            </when>
+
+            <when value="express-binning">
+                <param type="integer" name="expiter" value="1000" label="Number of express iterations" optional="False">
+                    <validator type="in_range" min="1"/>
+                </param>
+                <param type="select" name="removedist" label="Remove estimated distance-dependence prior to learning express corrections.">
+                    <option value="-d">yes</option>
+                    <option value="">no</option>
+                </param>
+                <param type="select" name="expreads" label="Reads to use for learning express corrections.">
+                    <option value="cis">cis</option>
+                    <option value="trans">trans</option>
+                    <option value="all">all</option>
+                </param>
+                <param type="integer" name="biniter" value="1000" label="Maximum number of binning iterations" optional="False">
+                    <validator type="in_range" min="1"/>
+                </param>
+                <param type="float" name="threshold" value="1.0" label="Learning threshold" optional="False"
+                    help="The minimum change needed in the log-likelihood to continue learning binning corrections.">
+                    <validator type="in_range" min="0.000001" max="1.0"/>
+                </param>
+                <param type="select" name="binreads" label="Reads to use for learning binning corrections.">
+                    <option value="cis">cis</option>
+                    <option value="trans">trans</option>
+                    <option value="all">all</option>
+                </param>
+                <param type="text" size="60" name="model" value="len" label="Model parameters" optional="False" help="A comma-separated list of fragment characteristics to learn corrections for. These can include 'len' and any characteristics included in the fragment bed file.">
+                    <validator type="empty_field" />
+                </param>
+                <param type="text" size="60" name="modelbins" value="10" label="Number of parameter bins" optional="False" help="A comma-separated list of bins to divide each model parameter into.">
+                    <validator type="empty_field" />
+                </param>
+                <param type="text" size="60" name="modeltypes" value="even" label="Parameter types" optional="False" help="A comma-separated list of model parameter types. These can be 'even', 'fixed', 'even-const', and 'fixed-const'.">
+                    <validator type="empty_field" />
+                </param>
+            </when>
+        </conditional>
+    </inputs>
+    <outputs>
+        <data format="frags" name="frags" label="${tool.name} on ${on_string}: 5C frags"/>
+        <data format="fcd" name="data" label="${tool.name} on ${on_string}: 5C data"/>
+        <data format="fcp" name="project" label="${tool.name} on ${on_string}: 5C project ${analysis.algorithm}"/>
+    </outputs>
+
+    <help>
+This tool takes a BED file containing probed restriction enzyme fragment boundaries and either a set of paired-end BAM files or a set of tabular counts files containing pairs of fragments and associated counts and creates and analyzes a HiFive 5C project.
+
+The bed file containing targeted restriction enzyme fragment boundaries is converted into an hdf5-type fragment file of fragment characteristics. In addition to coordinates, strand, and chromosome information, additional columns can be included containing other fragment characteristics, such as GC content. If additional columns are included, they must be labeled in the header with a label containing no spaces or commas. These names can be used with the binning algorithm to include the fragment characteristic in the model to be learned.
+
+Reads are then loaded and paired with the specified fragment file, creating a HiFive dataset object. Data can be a series of paired-end bam files or a tabular format list of paired fragments and their observed read count (fragment1 fragment2 count).
+
+Next, fends are filtered in an iterative manner using the minimum interaction cutoff and interaction size parameters specified to ensure that all valid fends have at least the minimum number of interactions with other valid fends. Subsequently, a distance dependence approximation curve is calculated piecewise using the number of bins specified. The first bin encompasses all interactions less than or equal to the minimum bin cutoff value. The remaining bins are evenly sized between log(minimum cutoff) and log(max possible interaction size).
+
+Finally, corrections values are learned for either each valid fragment, ranges of fragment characteristics, or both. The 'probability' and 'express' algorithms learn correction values associated with each fragment while the 'binning' algorithm learns fragment characteristic corrections. These can be chained together in either order to produce more robust corrections.
+
+The probability algorithm assumes non-zero counts to distributed according to a log-normal distribution with each interaction having a mean equal to the distance-depedence predicted signal times each of the interaction fragment correction parameters and a universal sigma value. Using the probability algorithm, learning is done using a backtracking line gradient descent approach. Learning proceeds for up to the maximum number of iterations but is terminated early if all of the absolute gradient values fall below the cutoff threshold. At each step, the learning rate is scaled down by the step value if the current learning rate does not produce sufficient improvement as measured by the Arjimo criterion.
+
+The express algorithm is a variant of matrix balancing and approximates the corrections through an iterative norm-2 adjustment to given all fragments a mean ratio of one for valid counts versus predicted signal from distance-dependence. This can be done using intra-regional interactions, inter-regional interactions, or all interactions.
+
+The binning algorithm divides each model parameter into some number of bins and based on a log-normal distribution, correction values for each bin are learned, maximizing the log-likelihood of the data. Model parameters can be the fragment lengths ('len') and any other characteristics passed as additional columns (with header labels) in the bed file used to create the HiFive fragment file. Each parameter has a number of bins specified to divide it into and can be partitioned according to its type to contain approximately equal numbers of fragments ('even'), or to cover equal portions of the range of parameter values ('fixed'). In addition, parameter types can include the '-const' suffix to denote a parameter that should not be optimized after seeding.
+    </help>
+
+</tool>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hifive/hifive/complete_hic_project.xml	Thu Apr 16 15:13:44 2015 -0400
@@ -0,0 +1,243 @@
+<tool id="complete_hic_project" name="analyze_HiC_data">
+    <requirements>
+        <requirement type='package' name="hifive"/>
+        <requirement type='package' name="numpy"/>
+        <requirement type='package' name="scipy"/>
+        <requirement type='package' name="h5py"/>
+        <requirement type='package' name="cython"/>
+    </requirements>
+    <description>from start to finish, including creating a fendset, dataset, and corrected HiFive HiC project</description>
+    <command>
+        hifive hic-complete $analysis.algorithm -q
+        -f $minint -m $filtermin -x $filtermax -j $minbin -n $numbin -B $bed
+
+        #if str( $datafile.format ) == "bam":
+            #for $bam_file in $datafile.paired_bam:
+                --bam ${bam_file.readend1} ${bam_file.readend2}
+            #end for
+        #elif str( $datafile.format ) == "mat":
+            --mat ${datafile.mat}
+        #else:
+            #for raw_file in $datafile.raw_files:
+                --raw ${raw_file.raw}
+            #end for
+        #end if
+        #if str( $chroms ) != "":
+            -c $chroms
+        #end if
+        #if str( $analysis.algorithm ) == "probability" or str( $analysis.algorithm ) == "binning-probability":
+            -b $analysis.probiter -l $analysis.step -g $analysis.change $analysis.precalc
+        #end if
+        #if str( $analysis.algorithm ) == "express" or str( $analysis.algorithm ) == "binning-express" :
+            -e $analysis.expiter $analysis.removedist -w $analysis.expreads
+        #end if
+        #if str( $analysis.algorithm ) == "binning" or str( $analysis.algorithm ) == "binning-express" or str( $analysis.algorithm ) == "binning-probability":
+            -r $analysis.biniter -t $analysis.threshold -y $analysis.binreads
+            -v $analysis.model -z $analysis.modelbins -u $analysis.modeltypes
+        #end if
+
+    -o $fends $data $project
+    </command>
+    <inputs>
+        <param format="bed" name="bed" type="data" label="RE Cutsite BED File" optional="False"/>
+        <param type="integer" name="insert" value="500" label="Maximum insert size" optional="False">
+            <validator type="in_range" min="1"/>
+        </param>
+        <conditional name="datafile">
+            <param name="format" type="select" label="Data Format">
+                <option value="bam">bam</option>
+                <option value="mat">mat</option>
+                <option value="raw">raw</option>
+            </param>
+            <when value="bam">
+                <repeat name="paired_bam" title="Sequencing lane" min="1">
+                    <param format="bam" name="readend1" label="First read end" type="data"/>
+                    <param format="bam" name="readend2" label="Second read end" type="data"/>
+                </repeat>
+            </when>
+            <when value="mat">
+                <param format="tabular" name="mat" type="data" label="Mat file" optional="False"/>
+            </when>
+            <when value="raw">
+                <repeat name="raw_files" title="Raw file" min="1">
+                    <param format="tabular" name="raw" type="data" label="Raw file" optional="False"/>
+                </repeat>
+            </when>
+        </conditional>
+        <param type="integer" name="minint" value="20" label="Minimum interactions per fend" optional="False">
+            <validator type="in_range" min="1"/>
+        </param>
+        <param type="integer" name="filtermin" value="1000000" label="Minimum interaction distance" optional="False" help="The minimum interaction distance included for filtering fends and learning correction values.">
+            <validator type="in_range" min="0"/>
+        </param>
+        <param type="integer" name="filtermax" value="0" label="Maximum interaction distance" optional="False" help="The maximum interaction distance included for filtering fends and learning correction values.">
+            <validator type="in_range" min="0"/>
+        </param>
+        <param type="integer" name="minbin" value="1000" label="Minimum distance bin cutoff" optional="False">
+            <validator type="in_range" min="1"/>
+        </param>
+        <param type="integer" name="numbin" value="100" label="Number of distance bins" optional="False">
+            <validator type="in_range" min="1"/>
+        </param>
+        <param type="text" size="60" name="chroms" value="" label="Included chromosomes" optional="False" help="If a subset of chromosomes are to be used, enter a comma-separated list of chromosome names."/>
+        <conditional name='analysis'>
+            <param name="algorithm" type="select" label="Learning Algorithm">
+                <option value="probability">Probability</option>
+                <option value="express">Express</option>
+                <option value="binning">Binning</option>
+                <option value="binning-probability">Binning-Probability</option>
+                <option value="binning-express">Binning-Express</option>
+            </param>
+
+            <when value="probability">
+                <param type="integer" name="probiter" value="1000" label="Maximum number of iterations" optional="False">
+                    <validator type="in_range" min="1"/>
+                </param>
+                <param type="float" name="change" value="0.0005" label="Parameter change cutoff" optional="False" help="The cutoff for the absolute gradient values such that learning will cease if all values fall below this threshold.">
+                    <validator type="in_range" min="0.00000001"/>
+                </param>
+                <param type="float" name="step" value="0.5" label="Learning rate scaling factor" optional="False">
+                    <validator type="in_range" min="0.000001" max="1.0"/>
+                </param>
+                <param type="select" name="precalc" label="Precalculate probability corrections from fragment means">
+                    <option value="-p">yes</option>
+                    <option value="">no</option>
+                </param>
+            </when>
+
+            <when value="express">
+                <param type="integer" name="expiter" value="1000" label="Number of express iterations" optional="False">
+                    <validator type="in_range" min="1"/>
+                </param>
+                <param type="select" name="removedist" label="Remove estimated distance-dependence prior to learning express corrections.">
+                    <option value="-d">yes</option>
+                    <option value="">no</option>
+                </param>
+                <param type="select" name="expreads" label="Reads to use for learning express corrections.">
+                    <option value="cis">cis</option>
+                    <option value="trans">trans</option>
+                    <option value="all">all</option>
+                </param>
+            </when>
+
+            <when value="binning">
+                <param type="integer" name="biniter" value="1000" label="Maximum number of binning iterations" optional="False">
+                    <validator type="in_range" min="1"/>
+                </param>
+                <param type="float" name="threshold" value="1.0" label="Learning threshold" optional="False"
+                    help="The minimum change needed in the log-likelihood to continue learning binning corrections.">
+                    <validator type="in_range" min="0.000001" max="1.0"/>
+                </param>
+                <param type="select" name="binreads" label="Reads to use for learning binning corrections.">
+                    <option value="cis">cis</option>
+                    <option value="trans">trans</option>
+                    <option value="all">all</option>
+                </param>
+                <param type="text" size="60" name="model" value="len,distance" label="Model parameters" optional="False" help="A comma-separated list of fragment characteristics to learn corrections for. These can include 'len' and any characteristics included in the fragment bed file.">
+                    <validator type="empty_field" />
+                </param>
+                <param type="text" size="60" name="modelbins" value="20,20" label="Number of parameter bins" optional="False" help="A comma-separated list of bins to divide each model parameter into.">
+                    <validator type="empty_field" />
+                </param>
+                <param type="text" size="60" name="modeltypes" value="even,even" label="Parameter types" optional="False" help="A comma-separated list of model parameter types. These can be 'even', 'fixed', 'even-const', and 'fixed-const'.">
+                    <validator type="empty_field" />
+                </param>
+            </when>
+
+            <when value="binning-probability">
+                <param type="integer" name="biniter" value="1000" label="Maximum number of binning iterations" optional="False">
+                    <validator type="in_range" min="1"/>
+                </param>
+                <param type="float" name="threshold" value="1.0" label="Learning threshold" optional="False"
+                    help="The minimum change needed in the log-likelihood to continue learning binning corrections.">
+                    <validator type="in_range" min="0.000001" max="1.0"/>
+                </param>
+                <param type="select" name="binreads" label="Reads to use for learning binning corrections.">
+                    <option value="cis">cis</option>
+                    <option value="trans">trans</option>
+                    <option value="all">all</option>
+                </param>
+                <param type="text" size="60" name="model" value="len,distance" label="Model parameters" optional="False" help="A comma-separated list of fragment characteristics to learn corrections for. These can include 'len' and any characteristics included in the fragment bed file.">
+                    <validator type="empty_field" />
+                </param>
+                <param type="text" size="60" name="modelbins" value="20,20" label="Number of parameter bins" optional="False" help="A comma-separated list of bins to divide each model parameter into.">
+                    <validator type="empty_field" />
+                </param>
+                <param type="text" size="60" name="modeltypes" value="even,even" label="Parameter types" optional="False" help="A comma-separated list of model parameter types. These can be 'even', 'fixed', 'even-const', and 'fixed-const'.">
+                    <validator type="empty_field" />
+                </param>
+                <param type="integer" name="probiter" value="1000" label="Maximum number of iterations" optional="False">
+                    <validator type="in_range" min="1"/>
+                </param>
+                <param type="float" name="change" value="0.0005" label="Parameter change cutoff" optional="False" help="The cutoff for the absolute gradient values such that learning will cease if all values fall below this threshold.">
+                    <validator type="in_range" min="0.00000001"/>
+                </param>
+                <param type="float" name="step" value="0.5" label="Learning rate scaling factor" optional="False">
+                    <validator type="in_range" min="0.000001" max="1.0"/>
+                </param>
+                <param type="select" name="precalc" label="Precalculate probability corrections from fragment means">
+                    <option value="-p">yes</option>
+                    <option value="">no</option>
+                </param>
+            </when>
+
+            <when value="binning-express">
+                <param type="integer" name="biniter" value="1000" label="Maximum number of binning iterations" optional="False">
+                    <validator type="in_range" min="1"/>
+                </param>
+                <param type="float" name="threshold" value="1.0" label="Learning threshold" optional="False"
+                    help="The minimum change needed in the log-likelihood to continue learning binning corrections.">
+                    <validator type="in_range" min="0.000001" max="1.0"/>
+                </param>
+                <param type="select" name="binreads" label="Reads to use for learning binning corrections.">
+                    <option value="cis">cis</option>
+                    <option value="trans">trans</option>
+                    <option value="all">all</option>
+                </param>
+                <param type="text" size="60" name="model" value="len,distance" label="Model parameters" optional="False" help="A comma-separated list of fragment characteristics to learn corrections for. These can include 'len' and any characteristics included in the fragment bed file.">
+                    <validator type="empty_field" />
+                </param>
+                <param type="text" size="60" name="modelbins" value="20,20" label="Number of parameter bins" optional="False" help="A comma-separated list of bins to divide each model parameter into.">
+                    <validator type="empty_field" />
+                </param>
+                <param type="text" size="60" name="modeltypes" value="even,even" label="Parameter types" optional="False" help="A comma-separated list of model parameter types. These can be 'even', 'fixed', 'even-const', and 'fixed-const'.">
+                    <validator type="empty_field" />
+                </param>
+                <param type="integer" name="expiter" value="1000" label="Number of express iterations" optional="False">
+                    <validator type="in_range" min="1"/>
+                </param>
+                <param type="select" name="removedist" label="Remove estimated distance-dependence prior to learning express corrections.">
+                    <option value="-d">yes</option>
+                    <option value="">no</option>
+                </param>
+                <param type="select" name="expreads" label="Reads to use for learning express corrections.">
+                    <option value="cis">cis</option>
+                    <option value="trans">trans</option>
+                    <option value="all">all</option>
+                </param>
+            </when>
+        </conditional>
+    </inputs>
+    <outputs>
+        <data format="fends" name="fends" label="${tool.name} on ${on_string}: HiC fends"/>
+        <data format="hcd" name="data" label="${tool.name} on ${on_string}: HiC data"/>
+        <data format="hcp" name="project" label="${tool.name} on ${on_string}: HiC project"/>
+    </outputs>
+
+    <help>
+This tool takes a BED file containing restriction enzyme fragment boundaries or cutsites and a set of paired-end BAM files, a tabular counts file containing pairs of fend indices and associated counts, or a set of tabular raw files containing mapping coordinate pairs for each mapped read and creates and analyzes a HiFive HiC project.
+
+The bed file containing either restriction enzyme cutopoints or fragment bounds is converted into an hdf5-type fragment file of fragment characteristics. In addition to coordinates, strand, and chromosome information, additional columns can be included containing other fragment characteristics, such as GC content. If additional columns are included, they must be labeled in the header with a label containing no spaces or commas. These names can be used with the binning algorithm to include the fragment characteristic in the model to be learned. Additional characteristics should be comma-separated pairs of values corresponding to the upstream and downstream sides of the cutsite or ends of the fragment, depending on the whether the bed file contains cutsites or fragment coordinates, respectively.
+
+Reads are then paired with the specified fend file, creating a HiFive dataset object. Data can be a series of paired-end bam files, a tabular format list of paired genomic positions (chromosome1 coordinate1 strand1 chromosome2 coordinate2 strand2), or a HiCPipe-style mat-formatted list of fend-pairs and observed read counts.
+
+Finally, corrections values are learned for either each valid fend, ranges of fend characteristics, or both. The 'probability' and 'express' algorithms learn correction values associated with each fend while the 'binning' algorithm learns fend characteristic corrections. These can be chained together in either order to produce more robust corrections.
+
+Using the probability algorithm, observation of counts are assumed to be distributed according to a binomial distribution with an observation probability for each interaction equal to the product of the distance-dependence signal and the two fend correction parameters. Using the probability algorithm, learning is done using a backtracking line gradient descent approach. Learning proceeds for up to the maximum number of iterations but is terminated early if all of the absolute gradient values fall below the cutoff threshold. At each step, the learning rate is scaled down by the step value if the current learning rate does not produce sufficient improvement as measured by the Arjimo criterion.
+
+The express algorithm is a variant of matrix balancing and approximates the corrections through an iterative norm-2 adjustment to given all fragments a mean ratio of one for valid counts versus signal predicted from distance-dependence. This can be done using intra-regional interactions, inter-regional interactions, or all interactions.
+
+The binning algorithm divides each model parameter into some number of bins and based on a binomial distribution, correction values for each bin are learned, maximizing the log-likelihood of the data. Model parameters can be the fend lengths ('len'), fend GC content ('gc'), and any other characteristics passed as additional columns (with header labels) in the bed file used to create the HiFive fend file. Each parameter has a number of bins specified to divide it into and can be partitioned according to its type to contain approximately equal numbers of fends ('even'), or to cover equal portions of the range of parameter values ('fixed'). In addition, parameter types can include the '-const' suffix to denote a parameter that should not be optimized after seeding.
+    </help>
+
+</tool>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hifive/hifive/create_fivec_dataset.xml	Thu Apr 16 15:13:44 2015 -0400
@@ -0,0 +1,52 @@
+<tool id="create_fivec_dataset" name="create_5C_dataset">
+    <requirements>
+        <requirement type='package' name="hifive"/>
+        <requirement type='package' name="numpy"/>
+        <requirement type='package' name="scipy"/>
+        <requirement type='package' name="h5py"/>
+        <requirement type='package' name="cython"/>
+    </requirements>
+    <description>create a HiFive 5C data object</description>
+    <command>
+        hifive 5c-data -q 
+
+        #if str( $datafile.format ) == "bam":
+            #for $bam_file in $datafile.paired_bam:
+                -B "${bam_file.readend1}" "${bam_file.readend2}"
+            #end for
+        #else:
+            #for $count_file in $datafile.count_files:
+                -C "${count_file.count}"
+            #end for
+        #end if
+
+        $frags $output</command>
+    <inputs>
+        <param format="frags" name="frags" type="data" label="HiFive fragment file" optional="False"/>
+        <conditional name="datafile">
+            <param name="format" type="select" label="Data Format">
+                <option value="bam">bam</option>
+                <option value="count">count</option>
+            </param>
+            <when value="bam">
+                <repeat name="paired_bam" title="Sequencing lane" min="1">
+                    <param format="bam" name="readend1" label="First read end" type="data"/>
+                    <param format="bam" name="readend2" label="Second read end" type="data"/>
+                </repeat>
+            </when>
+            <when value="count">
+                <repeat name="count_files" title="Count file" min="1">
+                    <param format="tabular" name="count" type="data" label="Count file" optional="False"/>
+                </repeat>
+            </when>
+        </conditional>
+    </inputs>
+    <outputs>
+        <data format="fcd" name="output" label="${tool.name} on ${on_string}: 5C data"/>
+    </outputs>
+
+    <help>
+This tool reads 5C data, pairs it with the specified fragment file, and creates a HiFive dataset object. Data can be a series of paired-end bam files or a tabular format list of paired fragments and their observed read count (fragment1 fragment2 count).
+    </help>
+
+</tool>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hifive/hifive/create_fivec_fragmentset.xml	Thu Apr 16 15:13:44 2015 -0400
@@ -0,0 +1,22 @@
+<tool id="create_fragmentset" name="create_fragments">
+    <requirements>
+        <requirement type='package' name="hifive"/>
+        <requirement type='package' name="numpy"/>
+        <requirement type='package' name="scipy"/>
+        <requirement type='package' name="h5py"/>
+        <requirement type='package' name="cython"/>
+    </requirements>
+    <description>create a HiFive fragment object</description>
+    <command>hifive fragments -q $input $output</command>
+    <inputs>
+        <param format="bed" name="input" type="data" label="RE fragment BED File" optional="False"/>
+    </inputs>
+    <outputs>
+        <data format="frags" name="output" label="${tool.name} on ${on_string}: 5C frags"/>
+    </outputs>
+
+    <help>
+This tool converts a bed file containing targeted restriction enzyme fragment boundaries into an hdf5-type fragment file of fragment characteristics. In addition to coordinates, strand, and chromosome information, additional columns can be included containing other fragment characteristics, such as GC content. If additional columns are included, they must be labeled in the header with a label containing no spaces or commas. These names can be used with the binning algorithm to include the fragment characteristic in the model to be learned.
+    </help>
+
+</tool>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hifive/hifive/create_fivec_heatmap.xml	Thu Apr 16 15:13:44 2015 -0400
@@ -0,0 +1,119 @@
+<tool id="create_fivec_heatmap" name="generate_5C_heatmaps">
+    <requirements>
+        <requirement type='package' name="hifive"/>
+        <requirement type='package' name="numpy"/>
+        <requirement type='package' name="scipy"/>
+        <requirement type='package' name="h5py"/>
+        <requirement type='package' name="cython"/>
+    </requirements>
+    <description>create an hdf5 dictionary of heatmaps for a HiFive 5C project</description>
+    <command>
+        hifive 5c-heatmap -q
+        -d $datatype $trans1
+
+        #if str( $binning.binned ) == "unbinned":
+            -b 0 -a $binning.array
+        #else:
+            -b $binning.binsize
+        #end if
+        #if str( $regions ) != "":
+            -r $regions
+        #end if
+        #if str( $dynamic.binning ) == "yes":
+            -y -x $dynamic.expbinsize -f $dynamic.minobs -g $dynamic.search $dynamic.failed
+        #end if
+        #if str( $image.generate ) == "yes":
+            -k min_color=$image.mincolor -k mid_color=$image.midcolor -k max_color=$image.maxcolor
+            -i $image_file -k logged=$image.logged
+            #if $image.minscore:
+                -k minscore=$image.minscore
+            #end if
+            #if $image.maxscore:
+                -k maxscore=$image.maxscore
+            #end if
+        #end if
+
+        $data $output</command>
+    <inputs>
+        <param format="fcp" name="data" type="data" label="HiFive 5C project file" optional="False"/>
+        <conditional name="binning">
+            <param type="select" name="binned" label="Binning">
+                <option value="unbinned">unbinned</option>
+                <option value="binned">binned</option>
+            </param>
+            <when value="unbinned">
+                <param type="select" name="array" label="Array type" help="A full array is n by n (n = total # of fragments) while a compact array is n by m (n = forward fragments, m = reverse fragments).">
+                    <option value="full">full</option>
+                    <option value="compact">compact</option>
+                </param>
+            </when>
+            <when value="binned">
+                <param type="integer" name="binsize" label="Binning size (bp)" value="10000" >
+                    <validator type="in_range" min="0"/>
+                </param>
+            </when>
+        </conditional>
+        <param type="select" name="trans1" label="Calculate and include trans interactions">
+            <option value="-t">yes</option>
+            <option value="">no</option>
+        </param>
+        <param type="select" name="datatype" label="Type of data to return">
+            <option value="raw">raw</option>
+            <option value="fragment">fragment-corrected</option>
+            <option value="distance">distance-removed</option>
+            <option value="enrichment">enrichment</option>
+        </param>
+        <param type="text" size="60" name="regions" value="" label="Included regions" optional="False" help="If a subset of regions are to be used, enter a comma-separated list of region numbers."/>
+        <conditional name="dynamic">
+            <param name="binning" type="select" label="Dynamically bin data">
+                <option value="yes">yes</option>
+                <option value="no">no</option>
+            </param>
+            <when value="yes">
+                <param name="expbinsize" type="integer" label="Expansion binning size (bp)" value="10000" help="The size of bins to use when expanding heatmap bins. A zero indicates unbinned expansion." >
+                    <validator type="in_range" min="0"/>
+                </param>
+                <param name="minobs" type="integer" label="Minimum observations" value="20" help="The number of observations needed to stop expanding a bin." >
+                    <validator type="in_range" min="1"/>
+                </param>
+                <param name="search" type="integer" label="Maximum search distance" value="0" help="The maximum distance a bin can be expanded. A value of zero indicates no maximum." >
+                    <validator type="in_range" min="0"/>
+                </param>
+                <param name="failed" type="select" label="Remove failed bins">
+                    <option value="">no</option>
+                    <option value="-v">yes</option>
+                </param>
+            </when>
+            <when value="no"/>
+        </conditional>
+        <conditional name="image">
+            <param name="generate" type="select" label="Generate image">
+                <option value="yes">yes</option>
+                <option value="no">no</option>
+            </param>
+            <when value="yes">
+                <param name="mincolor" type="color" value="#0000ff" label="Minimum value color"/>
+                <param name="midcolor" type="color" value="#ffffff" label="Middle value color"/>
+                <param name="maxcolor" type="color" value="#ff0000" label="Maximum value color"/>
+                <param name="logged" type="select" label="Logged values">
+                    <option value="true">yes</option>
+                    <option value="false">no</option>
+                </param>
+                <param name="minscore" type="float" optional="true" label="Minimum score limit"/>
+                <param name="maxscore" type="float" optional="true" label="Maximum score limit"/>
+            </when>
+            <when value="no"/>
+        </conditional>
+    </inputs>
+    <outputs>
+        <data format="h5" name="output" label="${tool.name} on ${on_string}: 5C heatmap"/>
+        <data format="png" name="image_file" label="${tool.name} on ${on_string}: 5C PNG">
+            <filter>(image['generate'] == "yes")</filter>
+        </data>
+    </outputs>
+
+    <help>
+This tool takes a HiFive 5C project and calculates expected and observed interaction signals for all requested regions (and inter-region pairs, if requested). All signals, along with bin boundaries, are stored in an hdf5 dictionary.
+    </help>
+
+</tool>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hifive/hifive/create_fivec_project.xml	Thu Apr 16 15:13:44 2015 -0400
@@ -0,0 +1,34 @@
+<tool id="create_fivec_project" name="create_5C_project">
+    <requirements>
+        <requirement type='package' name="hifive"/>
+        <requirement type='package' name="numpy"/>
+        <requirement type='package' name="scipy"/>
+        <requirement type='package' name="h5py"/>
+        <requirement type='package' name="cython"/>
+    </requirements>
+    <description>create a HiFive 5C project object</description>
+    <command>
+        hifive 5c-project -q
+        -f $minint -m $filtermin -x $filtermax
+        $data $output</command>
+    <inputs>
+        <param format="fcd" name="data" type="data" label="HiFive 5C data file" optional="False"/>
+        <param type="integer" name="filtermin" value="100000" label="Minimum interaction distance for filtering" optional="False">
+            <validator type="in_range" min="0"/>
+        </param>
+        <param type="integer" name="filtermax" value="0" label="Maximum interaction distance for filtering" optional="False">
+            <validator type="in_range" min="0"/>
+        </param>
+        <param type="integer" name="minint" value="20" label="Minimum interactions per fragment" optional="False">
+            <validator type="in_range" min="1"/>
+        </param>
+    </inputs>
+    <outputs>
+        <data format="fcp" name="output" label="${tool.name} on ${on_string}: 5C project"/>
+    </outputs>
+
+    <help>
+This tool creates a HiFive 5C project object and pairs a 5C data file with it. Fragments are filtered in an iterative manner using the minimum interaction cutoff parameter specified to ensure that all valid fends have at least the minimum number of interactions with other valid fends. Subsequently, a distance dependence approximation line is calculated using a regression line to approximate the linear relationship between log(# reads) and log(distance).
+    </help>
+
+</tool>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hifive/hifive/create_hic_dataset.xml	Thu Apr 16 15:13:44 2015 -0400
@@ -0,0 +1,61 @@
+<tool id="create_hic_dataset" name="create_HiC_dataset">
+    <requirements>
+        <requirement type='package' name="hifive"/>
+        <requirement type='package' name="numpy"/>
+        <requirement type='package' name="scipy"/>
+        <requirement type='package' name="h5py"/>
+        <requirement type='package' name="cython"/>
+    </requirements>
+    <description>create a HiFive HiC data object</description>
+    <command>
+        hifive hic-data -q
+
+        #if str( $datafile.format ) == "bam":
+            #for $bam_file in $datafile.paired_bam:
+                --bam ${bam_file.readend1} ${bam_file.readend2}
+            #end for
+        #elif str( $datafile.format ) == "mat":
+            --mat ${datafile.mat}
+        #else:
+            #for raw_file in $datafile.raw_files:
+                --raw ${raw_file.raw}
+            #end for
+        #end if
+
+        -i $insert $fends $output</command>
+    <inputs>
+        <param format="fends" name="fends" type="data" label="HiFive fend file" optional="False"/>
+        <param type="integer" name="insert" value="500" label="Maximum insert size" optional="False">
+            <validator type="in_range" min="1"/>
+        </param>
+        <conditional name="datafile">
+            <param name="format" type="select" label="Data Format">
+                <option value="bam">bam</option>
+                <option value="mat">mat</option>
+                <option value="raw">raw</option>
+            </param>
+            <when value="bam">
+                <repeat name="paired_bam" title="Sequencing lane" min="1">
+                    <param format="bam" name="readend1" label="First read end" type="data"/>
+                    <param format="bam" name="readend2" label="Second read end" type="data"/>
+                </repeat>
+            </when>
+            <when value="mat">
+                <param format="tabular" name="mat" type="data" label="Mat file" optional="False"/>
+            </when>
+            <when value="raw">
+                <repeat name="raw_files" title="Raw file" min="1">
+                    <param format="tabular" name="raw" type="data" label="Raw file" optional="False"/>
+                </repeat>
+            </when>
+        </conditional>
+    </inputs>
+    <outputs>
+        <data format="hcd" name="output" label="${tool.name} on ${on_string}: HiC data"/>
+    </outputs>
+
+    <help>
+This tool reads HiC data, pairs it with the specified fend file, and creates a HiFive dataset object. Data can be a series of paired-end bam files, a tabular format list of paired genomic positions (chromosome1 coordinate1 strand1 chromosome2 coordinate2 strand2), or a HiCPipe-style mat-formatted list of fend-pairs and observed read counts.
+    </help>
+
+</tool>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hifive/hifive/create_hic_fendset.xml	Thu Apr 16 15:13:44 2015 -0400
@@ -0,0 +1,22 @@
+<tool id="create_fendset" name="create_fends">
+    <requirements>
+        <requirement type='package' name="hifive"/>
+        <requirement type='package' name="numpy"/>
+        <requirement type='package' name="scipy"/>
+        <requirement type='package' name="h5py"/>
+        <requirement type='package' name="cython"/>
+    </requirements>
+    <description>create a HiFive fend object</description>
+    <command>hifive fends -q --bed $input $output</command>
+    <inputs>
+        <param format="bed" name="input" type="data" label="RE Cutsite BED File" optional="False"/>
+    </inputs>
+    <outputs>
+        <data format="fends" name="output" label="${tool.name} on ${on_string}: HiC fends"/>
+    </outputs>
+
+    <help>
+This tool converts a bed file containing either restriction enzyme cutopoints or fragment bounds into an hdf5-type fragment file of fragment characteristics. In addition to coordinates, strand, and chromosome information, additional columns can be included containing other fragment characteristics, such as GC content. If additional columns are included, they must be labeled in the header with a label containing no spaces or commas. These names can be used with the binning algorithm to include the fragment characteristic in the model to be learned. Additional characteristics should be comma-separated pairs of values corresponding to the upstream and downstream sides of the cutsite or ends of the fragment, depending on the whether the bed file contains cutsites or fragment coordinates, respectively.
+    </help>
+
+</tool>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hifive/hifive/create_hic_heatmap.xml	Thu Apr 16 15:13:44 2015 -0400
@@ -0,0 +1,103 @@
+<tool id="create_hic_heatmap" name="generate_HiC_heatmaps">
+    <requirements>
+        <requirement type='package' name="hifive"/>
+        <requirement type='package' name="numpy"/>
+        <requirement type='package' name="scipy"/>
+        <requirement type='package' name="h5py"/>
+        <requirement type='package' name="cython"/>
+    </requirements>
+    <description>create an hdf5 dictionary of heatmaps for a HiFive HiC project</description>
+    <command>
+        hifive hic-heatmap -q 
+        -b $binsize -d $datatype $trans1
+
+        #if str( $chroms ) != "":
+            -c $chroms
+        #end if
+        #if str( $dynamic.binning ) == "yes":
+            -y -x $dynamic.expbinsize -f $dynamic.minobs -a $dynamic.search $dynamic.failed
+        #end if
+        #if str( $image.generate ) == "yes":
+            -k min_color=$image.mincolor -k mid_color=$image.midcolor -k max_color=$image.maxcolor
+            -i $image_file -k logged=$image.logged
+            #if $image.minscore:
+                -k minscore=$image.minscore
+            #end if
+            #if $image.maxscore:
+                -k maxscore=$image.maxscore
+            #end if
+        #end if
+
+        $data $output</command>
+    <inputs>
+        <param format="hcp" name="data" type="data" label="HiFive HiC project file" optional="False"/>
+        <param type="integer" name="binsize" value="10000" label="Binning size (bp)" optional="False">
+            <validator type="in_range" min="0"/>
+        </param>
+        <param type="select" name="trans1" label="Calculate and include trans interactions">
+            <option value="-t">yes</option>
+            <option value="">no</option>
+        </param>
+        <param type="select" name="datatype" label="Type of data to return">
+            <option value="raw">raw</option>
+            <option value="fend">fend-corrected</option>
+            <option value="distance">distance-removed</option>
+            <option value="enrichment">enrichment</option>
+        </param>
+        <param type="text" size="60" name="chroms" value="" label="Included chromosomes" optional="False" help="If a subset of chromosomes are to be used, enter a comma-separated list of chromosome names."/>
+        <conditional name="dynamic">
+            <param name="binning" type="select" label="Dynamically bin data">
+                <option value="yes">yes</option>
+                <option value="no">no</option>
+            </param>
+            <when value="yes">
+                <param name="expbinsize" type="integer" label="Expansion binning size (bp)" value="10000" help="The size of bins to use when expanding heatmap bins. A zero indicates unbinned expansion." >
+                    <validator type="in_range" min="0"/>
+                </param>
+                <param name="minobs" type="integer" label="Minimum observations" value="20" help="The number of observations needed to stop expanding a bin." >
+                    <validator type="in_range" min="1"/>
+                </param>
+                <param name="search" type="integer" label="Maximum search distance" value="0" help="The maximum distance a bin can be expanded. A value of zero indicates no maximum." >
+                    <validator type="in_range" min="0"/>
+                </param>
+                <param name="failed" type="select" label="Remove failed bins">
+                    <option value="">no</option>
+                    <option value="-v">yes</option>
+                </param>
+            </when>
+            <when value="no"/>
+        </conditional>
+        <conditional name="image">
+            <param name="generate" type="select" label="Generate image">
+                <option value="yes">yes</option>
+                <option value="no">no</option>
+            </param>
+            <when value="yes">
+                <param name="mincolor" type="color" value="#0000ff" label="Minimum value color"/>
+                <param name="midcolor" type="color" value="#ffffff" label="Middle value color"/>
+                <param name="maxcolor" type="color" value="#ff0000" label="Maximum value color"/>
+                <param name="logged" type="select" label="Logged values">
+                    <option value="true">yes</option>
+                    <option value="false">no</option>
+                </param>
+                <param name="minscore" type="float" optional="True" label="Minimum score limit"/>
+                <param name="maxscore" type="float" optional="True" label="Maximum score limit"/>
+            </when>
+            <when value="no"/>
+        </conditional>
+    </inputs>
+    <outputs>
+        <data format="h5" name="output" label="${tool.name} on ${on_string}: HiC hdf5"/>
+        <data format="png" name="image_file" label="${tool.name} on ${on_string}: HiC PNG">
+            <filter>(image['generate'] == "yes")</filter>
+            <change_format>
+                <when input="image.format.type" value="pdf" format="pdf"/>
+            </change_format>
+        </data>
+    </outputs>
+
+    <help>
+This tool takes a HiFive HiC project and calculates expected and observed interaction signals for all requested chromosomes (and inter-chromosome pairs, if requested). All signals, along with bin boundaries, are stored in an hdf5 dictionary.
+    </help>
+
+</tool>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hifive/hifive/create_hic_project.xml	Thu Apr 16 15:13:44 2015 -0400
@@ -0,0 +1,40 @@
+<tool id="create_hic_project" name="create_HiC_project">
+    <requirements>
+        <requirement type='package' name="hifive"/>
+        <requirement type='package' name="numpy"/>
+        <requirement type='package' name="scipy"/>
+        <requirement type='package' name="h5py"/>
+        <requirement type='package' name="cython"/>
+    </requirements>
+    <description>create a HiFive HiC project object</description>
+    <command>
+        hifive hic-project -q 
+        -f $minint -m $filtermin -x $filtermax -j $minbin -n $numbin
+        $data $output</command>
+    <inputs>
+        <param format="hcd" name="data" type="data" label="HiFive HiC data file" optional="False"/>
+        <param type="integer" name="minint" value="20" label="Minimum interactions per fend" optional="False">
+            <validator type="in_range" min="1"/>
+        </param>
+        <param type="integer" name="filtermin" value="1000000" label="Minimum interaction distance for filtering" optional="False">
+            <validator type="in_range" min="0"/>
+        </param>
+        <param type="integer" name="filtermax" value="0" label="Maximum interaction distance for filtering" optional="False">
+            <validator type="in_range" min="0"/>
+        </param>
+        <param type="integer" name="minbin" value="1000" label="Minimum distance bin cutoff" optional="False">
+            <validator type="in_range" min="1"/>
+        </param>
+        <param type="integer" name="numbin" value="100" label="Number of distance bins" optional="False">
+            <validator type="in_range" min="1"/>
+        </param>
+    </inputs>
+    <outputs>
+        <data format="hcp" name="output" label="${tool.name} on ${on_string}: HiC project"/>
+    </outputs>
+
+    <help>
+This tool creates a HiFive HiC project object and pairs a HiC data file with it. Fends are filtered in an iterative manner using the minimum interaction cutoff and interaction size parameters specified to ensure that all valid fends have at least the minimum number of interactions with other valid fends. Subsequently, a distance dependence approximation curve is calculated piecewise using the number of bins specified. The first bin encompasses all interactions less than or equal to the minimum bin cutoff value. The remaining bins are evenly sized between log(minimum cutoff) and log(max possible interaction size).
+    </help>
+
+</tool>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hifive/hifive/get_interval_fivec_data.xml	Thu Apr 16 15:13:44 2015 -0400
@@ -0,0 +1,114 @@
+<tool id="get_interval_fivec_data" name="get_interval_5C_data">
+    <requirements>
+        <requirement type='package' name="hifive"/>
+        <requirement type='package' name="numpy"/>
+        <requirement type='package' name="scipy"/>
+        <requirement type='package' name="h5py"/>
+        <requirement type='package' name="cython"/>
+    </requirements>
+    <description>create an interval file containing 5C data</description>
+    <command>
+        hifive 5c-interval -q
+        -c $region -d $datatype -b $binsize
+
+        #if $start:
+            -s $start
+        #end if
+        #if $stop:
+            -e $stop
+        #end if
+        #if str( $dynamic.binning ) == "yes":
+            -y -x $dynamic.expbinsize -f $dynamic.minobs -g $dynamic.search $dynamic.failed
+        #end if
+        #if str( $image.generate ) == "yes":
+            -k min_color=$image.mincolor -k mid_color=$image.midcolor -k max_color=$image.maxcolor
+            -i $image_file -k logged=$image.logged
+            #if str( $binsize ) != "0":
+                $image.rotate
+            #end if
+            #if $image.minscore:
+                -k minscore=$image.minscore
+            #end if
+            #if $image.maxscore:
+                -k maxscore=$image.maxscore
+            #end if
+        #end if
+
+        -q $project $output</command>
+    <inputs>
+        <param name="project" type="data" format="fcp" label="HiFive 5C project file" optional="False"/>
+        <param type="integer" name="region" value="" label="Region" optional="False">
+            <validator type="empty_field" />
+        </param>
+        <param type="integer" name="start" value="0" label="Starting coordinate" optional="True">
+            <validator type="in_range" min="0"/>
+        </param>
+        <param type="integer" name="stop" value="0" label="Stopping coordinate" optional="True">
+            <validator type="in_range" min="0"/>
+        </param>
+        <param type="integer" name="binsize" value="10000" label="Binsize" optional="False" help="A value of zero will return unbinned data.">
+            <validator type="in_range" min="0"/>
+        </param>
+        <param name="datatype" type="select" label="Datatype">
+            <option value="raw">raw</option>
+            <option value="distance">distance-corrected</option>
+            <option value="fragment">fragment-corrected</option>
+            <option value="enrichment">enrichment</option>
+        </param>
+        <conditional name="dynamic">
+            <param name="binning" type="select" label="Dynamically bin data">
+                <option value="yes">yes</option>
+                <option value="no">no</option>
+            </param>
+            <when value="yes">
+                <param name="expbinsize" type="integer" label="Expansion binning size (bp)" value="10000" help="The size of bins to use when expanding heatmap bins. A zero indicates unbinned expansion." >
+                    <validator type="in_range" min="0"/>
+                </param>
+                <param name="minobs" type="integer" label="Minimum observations" value="20" help="The number of observations needed to stop expanding a bin." >
+                    <validator type="in_range" min="1"/>
+                </param>
+                <param name="search" type="integer" label="Maximum search distance" value="0" help="The maximum distance a bin can be expanded. A value of zero indicates no maximum." >
+                    <validator type="in_range" min="0"/>
+                </param>
+                <param name="failed" type="select" label="Remove failed bins">
+                    <option value="">no</option>
+                    <option value="-v">yes</option>
+                </param>
+            </when>
+            <when value="no"/>
+        </conditional>
+        <conditional name="image">
+            <param name="generate" type="select" label="Generate image">
+                <option value="yes">yes</option>
+                <option value="no">no</option>
+            </param>
+            <when value="yes">
+                <param name="mincolor" type="color" value="#0000ff" label="Minimum value color"/>
+                <param name="midcolor" type="color" value="#ffffff" label="Middle value color"/>
+                <param name="maxcolor" type="color" value="#ff0000" label="Maximum value color"/>
+                <param name="rotate" type="select" label="Rotate image 45 degrees (horizontal axis, binned array only)">
+                    <option value="">no</option>
+                    <option value="-r">yes</option>
+                </param>
+                <param name="logged" type="select" label="Logged values">
+                    <option value="true">yes</option>
+                    <option value="false">no</option>
+                </param>
+                <param name="minscore" type="float" optional="True" label="Minimum score limit"/>
+                <param name="maxscore" type="float" optional="True" label="Maximum score limit"/>
+            </when>
+            <when value="no"/>
+        </conditional>
+    </inputs>
+    <outputs>
+        <data format="chrint" name="output" label="${tool.name} on ${on_string}: 5C chrint"/>
+        <data format="png" name="image_file" label="${tool.name} on ${on_string}: 5C PNG">
+            <filter>(image['generate'] == "yes")</filter>
+        </data>
+    </outputs>
+
+    <help>
+This tool pulls data from a HiFive 5C project file for a specified region and returns a chromatin interaction interval file. Data can be either uncorrected, corrected for distance dependence or fragment bias only, or fully corrected (enrichment).
+    </help>
+
+</tool>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hifive/hifive/get_interval_hic_data.xml	Thu Apr 16 15:13:44 2015 -0400
@@ -0,0 +1,117 @@
+<tool id="get_interval_hic_data" name="get_interval_HiC_data">
+    <requirements>
+        <requirement type='package' name="hifive"/>
+        <requirement type='package' name="numpy"/>
+        <requirement type='package' name="scipy"/>
+        <requirement type='package' name="h5py"/>
+        <requirement type='package' name="cython"/>
+    </requirements>
+    <description>create an interval file containing HiC data</description>
+    <command>
+        hifive hic-interval -q
+        -c $chrom -d $datatype -b $binsize
+
+        #if $start:
+            -s $start
+        #end if
+        #if $stop:
+            -e $stop
+        #end if
+        #if $maxdist:
+            -m $maxdist
+        #end if
+        #if str( $dynamic.binning ) == "yes":
+            -y -x $dynamic.expbinsize -f $dynamic.minobs -a $dynamic.search $dynamic.failed
+        #end if
+        #if str( $image.generate ) == "yes":
+            -k min_color=$image.mincolor -k mid_color=$image.midcolor -k max_color=$image.maxcolor
+            -i $image_file -k logged=$image.logged $image.rotate
+            #if $image.minscore:
+                -k minscore=$image.minscore
+            #end if
+            #if $image.maxscore:
+                -k maxscore=$image.maxscore
+            #end if
+        #end if
+
+        $project $output</command>
+    <inputs>
+        <param name="project" type="data" format="hcp" label="HiFive HiC project file" optional="False"/>
+        <param type="text" name="chrom" size="10" label="Chromosome" optional="False">
+            <validator type="empty_field" />
+        </param>
+        <param type="integer" name="start" value="0" label="Starting coordinate" optional="True">
+            <validator type="in_range" min="0"/>
+        </param>
+        <param type="integer" name="stop" value="0" label="Stopping coordinate" optional="True">
+            <validator type="in_range" min="0"/>
+        </param>
+        <param type="integer" name="binsize" value="10000" label="Binsize" optional="False" help="A value of zero will return unbinned data.">
+            <validator type="in_range" min="0"/>
+        </param>
+        <param type="integer" name="maxdist" value="0" label="Maximum interaction distance" optional="True" help="A value of zero will include all interaction distances that fall between the start and stop coordinates.">
+            <validator type="in_range" min="0"/>
+        </param>
+        <param name="datatype" type="select" label="Datatype">
+            <option value="raw">raw</option>
+            <option value="distance">distance-corrected</option>
+            <option value="fend">fend-corrected</option>
+            <option value="enrichment">enrichment</option>
+        </param>
+        <conditional name="dynamic">
+            <param name="binning" type="select" label="Dynamically bin data">
+                <option value="yes">yes</option>
+                <option value="no">no</option>
+            </param>
+            <when value="yes">
+                <param name="expbinsize" type="integer" label="Expansion binning size (bp)" value="10000" help="The size of bins to use when expanding heatmap bins. A zero indicates unbinned expansion." >
+                    <validator type="in_range" min="0"/>
+                </param>
+                <param name="minobs" type="integer" label="Minimum observations" value="20" help="The number of observations needed to stop expanding a bin." >
+                    <validator type="in_range" min="1"/>
+                </param>
+                <param name="search" type="integer" label="Maximum search distance" value="0" help="The maximum distance a bin can be expanded. A value of zero indicates no maximum." >
+                    <validator type="in_range" min="0"/>
+                </param>
+                <param name="failed" type="select" label="Remove failed bins">
+                    <option value="">no</option>
+                    <option value="-v">yes</option>
+                </param>
+            </when>
+            <when value="no"/>
+        </conditional>
+        <conditional name="image">
+            <param name="generate" type="select" label="Generate image">
+                <option value="yes">yes</option>
+                <option value="no">no</option>
+            </param>
+            <when value="yes">
+                <param name="mincolor" type="color" value="#0000ff" label="Minimum value color"/>
+                <param name="midcolor" type="color" value="#ffffff" label="Middle value color"/>
+                <param name="maxcolor" type="color" value="#ff0000" label="Maximum value color"/>
+                <param name="rotate" type="select" label="Rotate image 45 degrees (horizontal axis)">
+                    <option value="">no</option>
+                    <option value="-r">yes</option>
+                </param>
+                <param name="logged" type="select" label="Logged values">
+                    <option value="true">yes</option>
+                    <option value="false">no</option>
+                </param>
+                <param name="minscore" type="float" optional="True" label="Minimum score limit"/>
+                <param name="maxscore" type="float" optional="True" label="Maximum score limit"/>
+            </when>
+            <when value="no"/>
+        </conditional>
+    </inputs>
+    <outputs>
+        <data format="chrint" name="output" label="${tool.name} on ${on_string}: HiC chrint"/>
+        <data format="png" name="image_file" label="${tool.name} on ${on_string}: HiC PNG">
+            <filter>(image['generate'] == "yes")</filter>
+        </data>
+    </outputs>
+
+    <help>
+This tool pulls data from a HiFive HiC project file for a specified region of a chromosome and returns a chromatin interaction interval file. Data can be either uncorrected, corrected for distance dependence or fend bias only, or fully corrected (enrichment).
+    </help>
+
+</tool>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hifive/hifive/learn_fivec_normalization.xml	Thu Apr 16 15:13:44 2015 -0400
@@ -0,0 +1,265 @@
+<tool id="learn_fivec_normalization" name="normalize_5C_project">
+    <requirements>
+        <requirement type='package' name="hifive"/>
+        <requirement type='package' name="numpy"/>
+        <requirement type='package' name="scipy"/>
+        <requirement type='package' name="h5py"/>
+        <requirement type='package' name="cython"/>
+    </requirements>
+    <description>learn fragment normalization values using probablistic approach</description>
+    <command>
+        hifive 5c-normalize $analysis.algorithm -q
+        -m $mindist -x $maxdist -o $output
+
+        #if str( $regions ) != "":
+            -r $regions
+        #end if
+        #if str( $analysis.algorithm ) == "probability" or str( $analysis.algorithm ) == "binning-probability" or str( $analysis.algorithm ) == "probability-binning":
+            -b $analysis.probiter -l $analysis.step -g $analysis.change $analysis.precalc
+        #end if
+        #if str( $analysis.algorithm ) == "express" or str( $analysis.algorithm ) == "binning-express" or str( $analysis.algorithm ) == "express-binning":
+            -e $analysis.expiter $analysis.removedist -w $analysis.expreads
+        #end if
+        #if str( $analysis.algorithm ) == "binning" or str( $analysis.algorithm ) == "binning-express" or str( $analysis.algorithm ) == "binning-probability" or str( $analysis.algorithm ) == "express-binning" or str( $analysis.algorithm ) == "probability-binning":
+            -i $analysis.biniter -t $analysis.threshold -y $analysis.binreads
+            -v $analysis.model -n $analysis.modelbins -u $analysis.modeltypes
+        #end if
+
+        $data</command>
+    <inputs>
+        <param format="fcp" name="data" type="data" label="HiFive 5C project file" optional="False"/>
+        <param type="integer" name="mindist" value="0" label="Minimum interaction distance" optional="False">
+            <validator type="in_range" min="0"/>
+        </param>
+        <param type="integer" name="maxdist" value="0" label="Maximum interaction distance" optional="False" help="A value of zero indicates no upper limit.">
+            <validator type="in_range" min="0"/>
+        </param>
+        <param type="text" size="60" name="regions" value="" label="Included regions" optional="False" help="If a subset of regions are to be used, enter a comma-separated list of region indices."/>
+        <conditional name='analysis'>
+            <param name="algorithm" type="select" label="Learning Algorithm">
+                <option value="probability">Probability</option>
+                <option value="express">Express</option>
+                <option value="binning">Binning</option>
+                <option value="binning-probability">Binning-Probability</option>
+                <option value="binning-express">Binning-Express</option>
+                <option value="probability-binning">Probability-Binning</option>
+                <option value="express-binning">Express-Binning</option>
+            </param>
+
+            <when value="probability">
+                <param type="integer" name="probiter" value="1000" label="Maximum number of iterations" optional="False">
+                    <validator type="in_range" min="1"/>
+                </param>
+                <param type="float" name="change" value="0.0005" label="Parameter change cutoff" optional="False" help="The cutoff for the absolute gradient values such that learning will cease if all values fall below this threshold.">
+                    <validator type="in_range" min="0.00000001"/>
+                </param>
+                <param type="float" name="step" value="0.5" label="Learning rate scaling factor" optional="False">
+                    <validator type="in_range" min="0.000001" max="1.0"/>
+                </param>
+                <param type="select" name="precalc" label="Precalculate probability corrections from fragment means">
+                    <option value="-p">yes</option>
+                    <option value="">no</option>
+                </param>
+            </when>
+
+            <when value="express">
+                <param type="integer" name="expiter" value="1000" label="Number of express iterations" optional="False">
+                    <validator type="in_range" min="1"/>
+                </param>
+                <param type="select" name="removedist" label="Remove estimated distance-dependence prior to learning express corrections.">
+                    <option value="-d">yes</option>
+                    <option value="">no</option>
+                </param>
+                <param type="select" name="expreads" label="Reads to use for learning express corrections.">
+                    <option value="cis">cis</option>
+                    <option value="trans">trans</option>
+                    <option value="all">all</option>
+                </param>
+            </when>
+
+            <when value="binning">
+                <param type="integer" name="biniter" value="1000" label="Maximum number of binning iterations" optional="False">
+                    <validator type="in_range" min="1"/>
+                </param>
+                <param type="float" name="threshold" value="1.0" label="Learning threshold" optional="False"
+                    help="The minimum change needed in the log-likelihood to continue learning binning corrections.">
+                    <validator type="in_range" min="0.000001" max="1.0"/>
+                </param>
+                <param type="select" name="binreads" label="Reads to use for learning binning corrections.">
+                    <option value="cis">cis</option>
+                    <option value="trans">trans</option>
+                    <option value="all">all</option>
+                </param>
+                <param type="text" size="60" name="model" value="len" label="Model parameters" optional="False" help="A comma-separated list of fragment characteristics to learn corrections for. These can include 'len' and any characteristics included in the fragment bed file.">
+                    <validator type="empty_field" />
+                </param>
+                <param type="text" size="60" name="modelbins" value="10" label="Number of parameter bins" optional="False" help="A comma-separated list of bins to divide each model parameter into.">
+                    <validator type="empty_field" />
+                </param>
+                <param type="text" size="60" name="modeltypes" value="even" label="Parameter types" optional="False" help="A comma-separated list of model parameter types. These can be 'even', 'fixed', 'even-const', and 'fixed-const'.">
+                    <validator type="empty_field" />
+                </param>
+            </when>
+
+            <when value="binning-probability">
+                <param type="integer" name="biniter" value="1000" label="Maximum number of binning iterations" optional="False">
+                    <validator type="in_range" min="1"/>
+                </param>
+                <param type="float" name="threshold" value="1.0" label="Learning threshold" optional="False"
+                    help="The minimum change needed in the log-likelihood to continue learning binning corrections.">
+                    <validator type="in_range" min="0.000001" max="1.0"/>
+                </param>
+                <param type="select" name="binreads" label="Reads to use for learning binning corrections.">
+                    <option value="cis">cis</option>
+                    <option value="trans">trans</option>
+                    <option value="all">all</option>
+                </param>
+                <param type="text" size="60" name="model" value="len" label="Model parameters" optional="False" help="A comma-separated list of fragment characteristics to learn corrections for. These can include 'len' and any characteristics included in the fragment bed file.">
+                    <validator type="empty_field" />
+                </param>
+                <param type="text" size="60" name="modelbins" value="10" label="Number of parameter bins" optional="False" help="A comma-separated list of bins to divide each model parameter into.">
+                    <validator type="empty_field" />
+                </param>
+                <param type="text" size="60" name="modeltypes" value="even" label="Parameter types" optional="False" help="A comma-separated list of model parameter types. These can be 'even', 'fixed', 'even-const', and 'fixed-const'.">
+                    <validator type="empty_field" />
+                </param>
+                <param type="integer" name="probiter" value="1000" label="Maximum number of iterations" optional="False">
+                    <validator type="in_range" min="1"/>
+                </param>
+                <param type="float" name="change" value="0.0005" label="Parameter change cutoff" optional="False" help="The cutoff for the absolute gradient values such that learning will cease if all values fall below this threshold.">
+                    <validator type="in_range" min="0.00000001"/>
+                </param>
+                <param type="float" name="step" value="0.5" label="Learning rate scaling factor" optional="False">
+                    <validator type="in_range" min="0.000001" max="1.0"/>
+                </param>
+                <param type="select" name="precalc" label="Precalculate probability corrections from fragment means">
+                    <option value="-p">yes</option>
+                    <option value="">no</option>
+                </param>
+            </when>
+
+            <when value="binning-express">
+                <param type="integer" name="biniter" value="1000" label="Maximum number of binning iterations" optional="False">
+                    <validator type="in_range" min="1"/>
+                </param>
+                <param type="float" name="threshold" value="1.0" label="Learning threshold" optional="False"
+                    help="The minimum change needed in the log-likelihood to continue learning binning corrections.">
+                    <validator type="in_range" min="0.000001" max="1.0"/>
+                </param>
+                <param type="select" name="binreads" label="Reads to use for learning binning corrections.">
+                    <option value="cis">cis</option>
+                    <option value="trans">trans</option>
+                    <option value="all">all</option>
+                </param>
+                <param type="text" size="60" name="model" value="len" label="Model parameters" optional="False" help="A comma-separated list of fragment characteristics to learn corrections for. These can include 'len' and any characteristics included in the fragment bed file.">
+                    <validator type="empty_field" />
+                </param>
+                <param type="text" size="60" name="modelbins" value="10" label="Number of parameter bins" optional="False" help="A comma-separated list of bins to divide each model parameter into.">
+                    <validator type="empty_field" />
+                </param>
+                <param type="text" size="60" name="modeltypes" value="even" label="Parameter types" optional="False" help="A comma-separated list of model parameter types. These can be 'even', 'fixed', 'even-const', and 'fixed-const'.">
+                    <validator type="empty_field" />
+                </param>
+                <param type="integer" name="expiter" value="1000" label="Number of express iterations" optional="False">
+                    <validator type="in_range" min="1"/>
+                </param>
+                <param type="select" name="removedist" label="Remove estimated distance-dependence prior to learning express corrections.">
+                    <option value="-d">yes</option>
+                    <option value="">no</option>
+                </param>
+                <param type="select" name="expreads" label="Reads to use for learning express corrections.">
+                    <option value="cis">cis</option>
+                    <option value="trans">trans</option>
+                    <option value="all">all</option>
+                </param>
+            </when>
+
+            <when value="probability-binning">
+                <param type="integer" name="probiter" value="1000" label="Maximum number of iterations" optional="False">
+                    <validator type="in_range" min="1"/>
+                </param>
+                <param type="float" name="change" value="0.0005" label="Parameter change cutoff" optional="False" help="The cutoff for the absolute gradient values such that learning will cease if all values fall below this threshold.">
+                    <validator type="in_range" min="0.00000001"/>
+                </param>
+                <param type="float" name="step" value="0.5" label="Learning rate scaling factor" optional="False">
+                    <validator type="in_range" min="0.000001" max="1.0"/>
+                </param>
+                <param type="select" name="precalc" label="Precalculate probability corrections from fragment means">
+                    <option value="-p">yes</option>
+                    <option value="">no</option>
+                </param>
+                <param type="integer" name="biniter" value="1000" label="Maximum number of binning iterations" optional="False">
+                    <validator type="in_range" min="1"/>
+                </param>
+                <param type="float" name="threshold" value="1.0" label="Learning threshold" optional="False"
+                    help="The minimum change needed in the log-likelihood to continue learning binning corrections.">
+                    <validator type="in_range" min="0.000001" max="1.0"/>
+                </param>
+                <param type="select" name="binreads" label="Reads to use for learning binning corrections.">
+                    <option value="cis">cis</option>
+                    <option value="trans">trans</option>
+                    <option value="all">all</option>
+                </param>
+                <param type="text" size="60" name="model" value="len" label="Model parameters" optional="False" help="A comma-separated list of fragment characteristics to learn corrections for. These can include 'len' and any characteristics included in the fragment bed file.">
+                    <validator type="empty_field" />
+                </param>
+                <param type="text" size="60" name="modelbins" value="10" label="Number of parameter bins" optional="False" help="A comma-separated list of bins to divide each model parameter into.">
+                    <validator type="empty_field" />
+                </param>
+                <param type="text" size="60" name="modeltypes" value="even" label="Parameter types" optional="False" help="A comma-separated list of model parameter types. These can be 'even', 'fixed', 'even-const', and 'fixed-const'.">
+                    <validator type="empty_field" />
+                </param>
+            </when>
+
+            <when value="express-binning">
+                <param type="integer" name="expiter" value="1000" label="Number of express iterations" optional="False">
+                    <validator type="in_range" min="1"/>
+                </param>
+                <param type="select" name="removedist" label="Remove estimated distance-dependence prior to learning express corrections.">
+                    <option value="-d">yes</option>
+                    <option value="">no</option>
+                </param>
+                <param type="select" name="expreads" label="Reads to use for learning express corrections.">
+                    <option value="cis">cis</option>
+                    <option value="trans">trans</option>
+                    <option value="all">all</option>
+                </param>
+                <param type="integer" name="biniter" value="1000" label="Maximum number of binning iterations" optional="False">
+                    <validator type="in_range" min="1"/>
+                </param>
+                <param type="float" name="threshold" value="1.0" label="Learning threshold" optional="False"
+                    help="The minimum change needed in the log-likelihood to continue learning binning corrections.">
+                    <validator type="in_range" min="0.000001" max="1.0"/>
+                </param>
+                <param type="select" name="binreads" label="Reads to use for learning binning corrections.">
+                    <option value="cis">cis</option>
+                    <option value="trans">trans</option>
+                    <option value="all">all</option>
+                </param>
+                <param type="text" size="60" name="model" value="len" label="Model parameters" optional="False" help="A comma-separated list of fragment characteristics to learn corrections for. These can include 'len' and any characteristics included in the fragment bed file.">
+                    <validator type="empty_field" />
+                </param>
+                <param type="text" size="60" name="modelbins" value="10" label="Number of parameter bins" optional="False" help="A comma-separated list of bins to divide each model parameter into.">
+                    <validator type="empty_field" />
+                </param>
+                <param type="text" size="60" name="modeltypes" value="even" label="Parameter types" optional="False" help="A comma-separated list of model parameter types. These can be 'even', 'fixed', 'even-const', and 'fixed-const'.">
+                    <validator type="empty_field" />
+                </param>
+            </when>
+        </conditional>
+    </inputs>
+    <outputs>
+        <data format="fcp" name="output" label="${tool.name} on ${on_string}: 5C project ${analysis.algorithm}"/>
+    </outputs>
+
+    <help>
+This tool takes a HiFive 5C project and learns corrections values for either each valid fragment, ranges of fragment characteristics, or both. The 'probability' and 'express' algorithms learn correction values associated with each fragment while the 'binning' algorithm learns fragment characteristic corrections. These can be chained together in either order to produce more robust corrections.
+
+The probability algorithm assumes non-zero counts to distributed according to a log-normal distribution with each interaction having a mean equal to the distance-depedence predicted signal times each of the interaction fragment correction parameters and a universal sigma value. Using the probability algorithm, learning is done using a backtracking line gradient descent approach. Learning proceeds for up to the maximum number of iterations but is terminated early if all of the absolute gradient values fall below the cutoff threshold. At each step, the learning rate is scaled down by the step value if the current learning rate does not produce sufficient improvement as measured by the Arjimo criterion.
+
+The express algorithm is a variant of matrix balancing and approximates the corrections through an iterative norm-2 adjustment to given all fragments a mean ratio of one for valid counts versus signal predicted from distance-dependence. This can be done using intra-regional interactions, inter-regional interactions, or all interactions.
+
+The binning algorithm divides each model parameter into some number of bins and based on a log-normal distribution, correction values for each bin are learned, maximizing the log-likelihood of the data. Model parameters can be the fragment lengths ('len') and any other characteristics passed as additional columns (with header labels) in the bed file used to create the HiFive fragment file. Each parameter has a number of bins specified to divide it into and can be partitioned according to its type to contain approximately equal numbers of fragments ('even'), or to cover equal portions of the range of parameter values ('fixed'). In addition, parameter types can include the '-const' suffix to denote a parameter that should not be optimized after seeding.
+    </help>
+
+</tool>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hifive/hifive/learn_hic_normalization.xml	Thu Apr 16 15:13:44 2015 -0400
@@ -0,0 +1,190 @@
+<tool id="learn_hic_normalization" name="normalize_HiC_project">
+    <requirements>
+        <requirement type='package' name="hifive"/>
+        <requirement type='package' name="numpy"/>
+        <requirement type='package' name="scipy"/>
+        <requirement type='package' name="h5py"/>
+        <requirement type='package' name="cython"/>
+    </requirements>
+    <description>learn fend normalization values using probablistic approach</description>
+    <command>
+        hifive hic-normalize $analysis.algorithm -q
+        -m $mindist -x $maxdist -o $output
+
+        #if str( $chroms ) != "":
+            -c $chroms
+        #end if
+        #if str( $analysis.algorithm ) == "probability" or str( $analysis.algorithm ) == "binning-probability":
+            -b $analysis.probiter -l $analysis.step -g $analysis.change $analysis.precalc
+        #end if
+        #if str( $analysis.algorithm ) == "express" or str( $analysis.algorithm ) == "binning-express" :
+            -e $analysis.expiter $analysis.removedist -w $analysis.expreads
+        #end if
+        #if str( $analysis.algorithm ) == "binning" or str( $analysis.algorithm ) == "binning-express" or str( $analysis.algorithm ) == "binning-probability":
+            -r $analysis.biniter -t $analysis.threshold -y $analysis.binreads
+            -v $analysis.model -z $analysis.modelbins -u $analysis.modeltypes
+        #end if
+
+    $data</command>
+    <inputs>
+        <param format="hcp" name="data" type="data" label="HiFive HiC project file" optional="False"/>
+        <param type="integer" name="mindist" value="0" label="Minimum interaction distance" optional="False">
+            <validator type="in_range" min="0"/>
+        </param>
+        <param type="integer" name="maxdist" value="0" label="Maximum interaction distance" optional="False" help="A value of zero indicates no upper limit.">
+            <validator type="in_range" min="0"/>
+        </param>
+        <param type="text" size="60" name="chroms" value="" label="Included chromosomes" optional="False" help="If a subset of chromosomes are to be used, enter a comma-separated list of chromosome names."/>
+        <conditional name='analysis'>
+            <param name="algorithm" type="select" label="Learning Algorithm">
+                <option value="probability">Probability</option>
+                <option value="express">Express</option>
+                <option value="binning">Binning</option>
+                <option value="binning-probability">Binning-Probability</option>
+                <option value="binning-express">Binning-Express</option>
+            </param>
+
+            <when value="probability">
+                <param type="integer" name="probiter" value="1000" label="Maximum number of iterations" optional="False">
+                    <validator type="in_range" min="1"/>
+                </param>
+                <param type="float" name="change" value="0.0005" label="Parameter change cutoff" optional="False" help="The cutoff for the absolute gradient values such that learning will cease if all values fall below this threshold.">
+                    <validator type="in_range" min="0.00000001"/>
+                </param>
+                <param type="float" name="step" value="0.5" label="Learning rate scaling factor" optional="False">
+                    <validator type="in_range" min="0.000001" max="1.0"/>
+                </param>
+                <param type="select" name="precalc" label="Precalculate probability corrections from fragment means">
+                    <option value="-p">yes</option>
+                    <option value="">no</option>
+                </param>
+            </when>
+
+            <when value="express">
+                <param type="integer" name="expiter" value="1000" label="Number of express iterations" optional="False">
+                    <validator type="in_range" min="1"/>
+                </param>
+                <param type="select" name="removedist" label="Remove estimated distance-dependence prior to learning express corrections.">
+                    <option value="-d">yes</option>
+                    <option value="">no</option>
+                </param>
+                <param type="select" name="expreads" label="Reads to use for learning express corrections.">
+                    <option value="cis">cis</option>
+                    <option value="trans">trans</option>
+                    <option value="all">all</option>
+                </param>
+            </when>
+
+            <when value="binning">
+                <param type="integer" name="biniter" value="1000" label="Maximum number of binning iterations" optional="False">
+                    <validator type="in_range" min="1"/>
+                </param>
+                <param type="float" name="threshold" value="1.0" label="Learning threshold" optional="False"
+                    help="The minimum change needed in the log-likelihood to continue learning binning corrections.">
+                    <validator type="in_range" min="0.000001" max="1.0"/>
+                </param>
+                <param type="select" name="binreads" label="Reads to use for learning binning corrections.">
+                    <option value="cis">cis</option>
+                    <option value="trans">trans</option>
+                    <option value="all">all</option>
+                </param>
+                <param type="text" size="60" name="model" value="len,gc" label="Model parameters" optional="False" help="A comma-separated list of fragment characteristics to learn corrections for. These can include 'len' and any characteristics included in the fragment bed file.">
+                    <validator type="empty_field" />
+                </param>
+                <param type="text" size="60" name="modelbins" value="20,20" label="Number of parameter bins" optional="False" help="A comma-separated list of bins to divide each model parameter into.">
+                    <validator type="empty_field" />
+                </param>
+                <param type="text" size="60" name="modeltypes" value="even,even" label="Parameter types" optional="False" help="A comma-separated list of model parameter types. These can be 'even', 'fixed', 'even-const', and 'fixed-const'.">
+                    <validator type="empty_field" />
+                </param>
+            </when>
+
+            <when value="binning-probability">
+                <param type="integer" name="biniter" value="1000" label="Maximum number of binning iterations" optional="False">
+                    <validator type="in_range" min="1"/>
+                </param>
+                <param type="float" name="threshold" value="1.0" label="Learning threshold" optional="False"
+                    help="The minimum change needed in the log-likelihood to continue learning binning corrections.">
+                    <validator type="in_range" min="0.000001" max="1.0"/>
+                </param>
+                <param type="select" name="binreads" label="Reads to use for learning binning corrections.">
+                    <option value="cis">cis</option>
+                    <option value="trans">trans</option>
+                    <option value="all">all</option>
+                </param>
+                <param type="text" size="60" name="model" value="len,gc" label="Model parameters" optional="False" help="A comma-separated list of fragment characteristics to learn corrections for. These can include 'len' and any characteristics included in the fragment bed file.">
+                    <validator type="empty_field" />
+                </param>
+                <param type="text" size="60" name="modelbins" value="20,20" label="Number of parameter bins" optional="False" help="A comma-separated list of bins to divide each model parameter into.">
+                    <validator type="empty_field" />
+                </param>
+                <param type="text" size="60" name="modeltypes" value="even,even" label="Parameter types" optional="False" help="A comma-separated list of model parameter types. These can be 'even', 'fixed', 'even-const', and 'fixed-const'.">
+                    <validator type="empty_field" />
+                </param>
+                <param type="integer" name="probiter" value="1000" label="Maximum number of iterations" optional="False">
+                    <validator type="in_range" min="1"/>
+                </param>
+                <param type="float" name="change" value="0.0005" label="Parameter change cutoff" optional="False" help="The cutoff for the absolute gradient values such that learning will cease if all values fall below this threshold.">
+                    <validator type="in_range" min="0.00000001"/>
+                </param>
+                <param type="float" name="step" value="0.5" label="Learning rate scaling factor" optional="False">
+                    <validator type="in_range" min="0.000001" max="1.0"/>
+                </param>
+                <param type="select" name="precalc" label="Precalculate probability corrections from fragment means">
+                    <option value="-p">yes</option>
+                    <option value="">no</option>
+                </param>
+            </when>
+
+            <when value="binning-express">
+                <param type="integer" name="biniter" value="1000" label="Maximum number of binning iterations" optional="False">
+                    <validator type="in_range" min="1"/>
+                </param>
+                <param type="float" name="threshold" value="1.0" label="Learning threshold" optional="False"
+                    help="The minimum change needed in the log-likelihood to continue learning binning corrections.">
+                    <validator type="in_range" min="0.000001" max="1.0"/>
+                </param>
+                <param type="select" name="binreads" label="Reads to use for learning binning corrections.">
+                    <option value="cis">cis</option>
+                    <option value="trans">trans</option>
+                    <option value="all">all</option>
+                </param>
+                <param type="text" size="60" name="model" value="len,gc" label="Model parameters" optional="False" help="A comma-separated list of fragment characteristics to learn corrections for. These can include 'len' and any characteristics included in the fragment bed file.">
+                    <validator type="empty_field" />
+                </param>
+                <param type="text" size="60" name="modelbins" value="20,20" label="Number of parameter bins" optional="False" help="A comma-separated list of bins to divide each model parameter into.">
+                    <validator type="empty_field" />
+                </param>
+                <param type="text" size="60" name="modeltypes" value="even,even" label="Parameter types" optional="False" help="A comma-separated list of model parameter types. These can be 'even', 'fixed', 'even-const', and 'fixed-const'.">
+                    <validator type="empty_field" />
+                </param>
+                <param type="integer" name="expiter" value="1000" label="Number of express iterations" optional="False">
+                    <validator type="in_range" min="1"/>
+                </param>
+                <param type="select" name="removedist" label="Remove estimated distance-dependence prior to learning express corrections.">
+                    <option value="-d">yes</option>
+                    <option value="">no</option>
+                </param>
+                <param type="select" name="expreads" label="Reads to use for learning express corrections.">
+                    <option value="cis">cis</option>
+                    <option value="trans">trans</option>
+                    <option value="all">all</option>
+                </param>
+            </when>
+        </conditional>
+    </inputs>
+    <outputs>
+        <data format="hcp" name="output" label="${tool.name} on ${on_string}: HiC project ${analysis.algorithm}"/>
+    </outputs>
+
+    <help>
+This tool takes a HiFive HiC project and learns corrections values for either each valid fend, ranges of fend characteristics, or both. The 'probability' and 'express' algorithms learn correction values associated with each fend while the 'binning' algorithm learns fend characteristic corrections. These can be chained together in either order to produce more robust corrections.
+
+Using the probability algorithm, observation of counts are assumed to be distributed according to a binomial distribution with an observation probability for each interaction equal to the product of the distance-dependence signal and the two fend correction parameters. Using the probability algorithm, learning is done using a backtracking line gradient descent approach. Learning proceeds for up to the maximum number of iterations but is terminated early if all of the absolute gradient values fall below the cutoff threshold. At each step, the learning rate is scaled down by the step value if the current learning rate does not produce sufficient improvement as measured by the Arjimo criterion.
+
+The express algorithm is a variant of matrix balancing and approximates the corrections through an iterative norm-2 adjustment to given all fragments a mean ratio of one for valid counts versus signal predicted from distance-dependence. This can be done using intra-regional interactions, inter-regional interactions, or all interactions.
+
+The binning algorithm divides each model parameter into some number of bins and based on a binomial distribution, correction values for each bin are learned, maximizing the log-likelihood of the data. Model parameters can be the fend lengths ('len'), fend GC content ('gc'), and any other characteristics passed as additional columns (with header labels) in the bed file used to create the HiFive fend file. Each parameter has a number of bins specified to divide it into and can be partitioned according to its type to contain approximately equal numbers of fends ('even'), or to cover equal portions of the range of parameter values ('fixed'). In addition, parameter types can include the '-const' suffix to denote a parameter that should not be optimized after seeding.
+    </help>
+
+</tool>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hifive/hifive/readme.rst	Thu Apr 16 15:13:44 2015 -0400
@@ -0,0 +1,45 @@
+=============================
+Galaxy wrapper for HiFive
+=============================
+
+This wrapper allows use of the hifive package, a set of tools for handling HiC
+and 5C data, on Galaxy. This includes managing data from mapped reads, either
+in bam, mat, or raw formats. All stages use hdf5 dictionaries for fast access
+and minimal memory and storage usage.
+
+This toolset includes methods for normalizing data from either HiC or 5C
+experiments at the fragment-end, or fragment level resolution, respectively.
+Once normalized, data can be used for plotting, binning, or other statistical
+tests within the package very quickly.
+
+Original documentation can be found `here <http://hifive.docs.taylorlab.org/en/latest/>`_.
+
+Installing HiFive
+=============================
+
+It is recommended to install this wrapper via the `Galaxy Test Tool Shed`.
+
+.. _`Galaxy Tool Shed`: http://testtoolshed.g2.bx.psu.edu/view/msauria/hifive
+
+
+================
+Wrapper Licence
+================
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hifive/hifive/tool_dependencies.xml	Thu Apr 16 15:13:44 2015 -0400
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<tool_dependency>
+    <package name="scipy" version="0.14">
+        <repository changeset_revision="2e3809844979" name="package_scipy_0_14" owner="iuc" toolshed="https://testtoolshed.g2.bx.psu.edu" />
+    </package>
+    <package name="numpy" version="1.9">
+        <repository name="package_numpy_1_9" owner="iuc" changeset_revision="266529386609" toolshed="https://testtoolshed.g2.bx.psu.edu" prior_installation_required="True" />
+    </package>
+    <package name="cython" version="0.20.1">
+        <repository name="package_cython_0_20_1" owner="iuc" changeset_revision="749f11b9358a" toolshed="https://testtoolshed.g2.bx.psu.edu" prior_installation_required="True"/>
+    </package>
+    <package name="h5py" version="2.4.0">
+        <repository changeset_revision="79b31a4c757c" name="package_h5py_2_4_0" owner="sauria" toolshed="https://testtoolshed.g2.bx.psu.edu" />
+    </package>
+    <package name="hifive" version="1.0.2">
+        <repository changeset_revision="3dfc9498f211" name="package_hifive_1_0_2" owner="sauria" toolshed="https://testtoolshed.g2.bx.psu.edu" />
+    </package>
+    <set_environment version="1.0">
+        <environment_variable action="set_to" name="HIFIVE_SCRIPT_PATH">$REPOSITORY_INSTALL_DIR</environment_variable>
+    </set_environment>
+</tool_dependency>
--- a/hifive/learn_fivec_normalization.xml	Thu Apr 16 12:41:30 2015 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,259 +0,0 @@
-<tool id="learn_fivec_normalization" name="normalize_5C_project">
-    <requirements><requirement type='package'>hifive</requirement></requirements>
-    <description>learn fragment normalization values using probablistic approach</description>
-    <command>
-        hifive 5c-normalize $analysis.algorithm -q
-        -m $mindist -x $maxdist -o $output
-
-        #if str( $regions ) != "":
-            -r $regions
-        #end if
-        #if str( $analysis.algorithm ) == "probability" or str( $analysis.algorithm ) == "binning-probability" or str( $analysis.algorithm ) == "probability-binning":
-            -b $analysis.probiter -l $analysis.step -g $analysis.change $analysis.precalc
-        #end if
-        #if str( $analysis.algorithm ) == "express" or str( $analysis.algorithm ) == "binning-express" or str( $analysis.algorithm ) == "express-binning":
-            -e $analysis.expiter $analysis.removedist -w $analysis.expreads
-        #end if
-        #if str( $analysis.algorithm ) == "binning" or str( $analysis.algorithm ) == "binning-express" or str( $analysis.algorithm ) == "binning-probability" or str( $analysis.algorithm ) == "express-binning" or str( $analysis.algorithm ) == "probability-binning":
-            -i $analysis.biniter -t $analysis.threshold -y $analysis.binreads
-            -v $analysis.model -n $analysis.modelbins -u $analysis.modeltypes
-        #end if
-
-        $data</command>
-    <inputs>
-        <param format="fcp" name="data" type="data" label="HiFive 5C project file" optional="False"/>
-        <param type="integer" name="mindist" value="0" label="Minimum interaction distance" optional="False">
-            <validator type="in_range" min="0"/>
-        </param>
-        <param type="integer" name="maxdist" value="0" label="Maximum interaction distance" optional="False" help="A value of zero indicates no upper limit.">
-            <validator type="in_range" min="0"/>
-        </param>
-        <param type="text" size="60" name="regions" value="" label="Included regions" optional="False" help="If a subset of regions are to be used, enter a comma-separated list of region indices."/>
-        <conditional name='analysis'>
-            <param name="algorithm" type="select" label="Learning Algorithm">
-                <option value="probability">Probability</option>
-                <option value="express">Express</option>
-                <option value="binning">Binning</option>
-                <option value="binning-probability">Binning-Probability</option>
-                <option value="binning-express">Binning-Express</option>
-                <option value="probability-binning">Probability-Binning</option>
-                <option value="express-binning">Express-Binning</option>
-            </param>
-
-            <when value="probability">
-                <param type="integer" name="probiter" value="1000" label="Maximum number of iterations" optional="False">
-                    <validator type="in_range" min="1"/>
-                </param>
-                <param type="float" name="change" value="0.0005" label="Parameter change cutoff" optional="False" help="The cutoff for the absolute gradient values such that learning will cease if all values fall below this threshold.">
-                    <validator type="in_range" min="0.00000001"/>
-                </param>
-                <param type="float" name="step" value="0.5" label="Learning rate scaling factor" optional="False">
-                    <validator type="in_range" min="0.000001" max="1.0"/>
-                </param>
-                <param type="select" name="precalc" label="Precalculate probability corrections from fragment means">
-                    <option value="-p">yes</option>
-                    <option value="">no</option>
-                </param>
-            </when>
-
-            <when value="express">
-                <param type="integer" name="expiter" value="1000" label="Number of express iterations" optional="False">
-                    <validator type="in_range" min="1"/>
-                </param>
-                <param type="select" name="removedist" label="Remove estimated distance-dependence prior to learning express corrections.">
-                    <option value="-d">yes</option>
-                    <option value="">no</option>
-                </param>
-                <param type="select" name="expreads" label="Reads to use for learning express corrections.">
-                    <option value="cis">cis</option>
-                    <option value="trans">trans</option>
-                    <option value="all">all</option>
-                </param>
-            </when>
-
-            <when value="binning">
-                <param type="integer" name="biniter" value="1000" label="Maximum number of binning iterations" optional="False">
-                    <validator type="in_range" min="1"/>
-                </param>
-                <param type="float" name="threshold" value="1.0" label="Learning threshold" optional="False"
-                    help="The minimum change needed in the log-likelihood to continue learning binning corrections.">
-                    <validator type="in_range" min="0.000001" max="1.0"/>
-                </param>
-                <param type="select" name="binreads" label="Reads to use for learning binning corrections.">
-                    <option value="cis">cis</option>
-                    <option value="trans">trans</option>
-                    <option value="all">all</option>
-                </param>
-                <param type="text" size="60" name="model" value="len" label="Model parameters" optional="False" help="A comma-separated list of fragment characteristics to learn corrections for. These can include 'len' and any characteristics included in the fragment bed file.">
-                    <validator type="empty_field" />
-                </param>
-                <param type="text" size="60" name="modelbins" value="10" label="Number of parameter bins" optional="False" help="A comma-separated list of bins to divide each model parameter into.">
-                    <validator type="empty_field" />
-                </param>
-                <param type="text" size="60" name="modeltypes" value="even" label="Parameter types" optional="False" help="A comma-separated list of model parameter types. These can be 'even', 'fixed', 'even-const', and 'fixed-const'.">
-                    <validator type="empty_field" />
-                </param>
-            </when>
-
-            <when value="binning-probability">
-                <param type="integer" name="biniter" value="1000" label="Maximum number of binning iterations" optional="False">
-                    <validator type="in_range" min="1"/>
-                </param>
-                <param type="float" name="threshold" value="1.0" label="Learning threshold" optional="False"
-                    help="The minimum change needed in the log-likelihood to continue learning binning corrections.">
-                    <validator type="in_range" min="0.000001" max="1.0"/>
-                </param>
-                <param type="select" name="binreads" label="Reads to use for learning binning corrections.">
-                    <option value="cis">cis</option>
-                    <option value="trans">trans</option>
-                    <option value="all">all</option>
-                </param>
-                <param type="text" size="60" name="model" value="len" label="Model parameters" optional="False" help="A comma-separated list of fragment characteristics to learn corrections for. These can include 'len' and any characteristics included in the fragment bed file.">
-                    <validator type="empty_field" />
-                </param>
-                <param type="text" size="60" name="modelbins" value="10" label="Number of parameter bins" optional="False" help="A comma-separated list of bins to divide each model parameter into.">
-                    <validator type="empty_field" />
-                </param>
-                <param type="text" size="60" name="modeltypes" value="even" label="Parameter types" optional="False" help="A comma-separated list of model parameter types. These can be 'even', 'fixed', 'even-const', and 'fixed-const'.">
-                    <validator type="empty_field" />
-                </param>
-                <param type="integer" name="probiter" value="1000" label="Maximum number of iterations" optional="False">
-                    <validator type="in_range" min="1"/>
-                </param>
-                <param type="float" name="change" value="0.0005" label="Parameter change cutoff" optional="False" help="The cutoff for the absolute gradient values such that learning will cease if all values fall below this threshold.">
-                    <validator type="in_range" min="0.00000001"/>
-                </param>
-                <param type="float" name="step" value="0.5" label="Learning rate scaling factor" optional="False">
-                    <validator type="in_range" min="0.000001" max="1.0"/>
-                </param>
-                <param type="select" name="precalc" label="Precalculate probability corrections from fragment means">
-                    <option value="-p">yes</option>
-                    <option value="">no</option>
-                </param>
-            </when>
-
-            <when value="binning-express">
-                <param type="integer" name="biniter" value="1000" label="Maximum number of binning iterations" optional="False">
-                    <validator type="in_range" min="1"/>
-                </param>
-                <param type="float" name="threshold" value="1.0" label="Learning threshold" optional="False"
-                    help="The minimum change needed in the log-likelihood to continue learning binning corrections.">
-                    <validator type="in_range" min="0.000001" max="1.0"/>
-                </param>
-                <param type="select" name="binreads" label="Reads to use for learning binning corrections.">
-                    <option value="cis">cis</option>
-                    <option value="trans">trans</option>
-                    <option value="all">all</option>
-                </param>
-                <param type="text" size="60" name="model" value="len" label="Model parameters" optional="False" help="A comma-separated list of fragment characteristics to learn corrections for. These can include 'len' and any characteristics included in the fragment bed file.">
-                    <validator type="empty_field" />
-                </param>
-                <param type="text" size="60" name="modelbins" value="10" label="Number of parameter bins" optional="False" help="A comma-separated list of bins to divide each model parameter into.">
-                    <validator type="empty_field" />
-                </param>
-                <param type="text" size="60" name="modeltypes" value="even" label="Parameter types" optional="False" help="A comma-separated list of model parameter types. These can be 'even', 'fixed', 'even-const', and 'fixed-const'.">
-                    <validator type="empty_field" />
-                </param>
-                <param type="integer" name="expiter" value="1000" label="Number of express iterations" optional="False">
-                    <validator type="in_range" min="1"/>
-                </param>
-                <param type="select" name="removedist" label="Remove estimated distance-dependence prior to learning express corrections.">
-                    <option value="-d">yes</option>
-                    <option value="">no</option>
-                </param>
-                <param type="select" name="expreads" label="Reads to use for learning express corrections.">
-                    <option value="cis">cis</option>
-                    <option value="trans">trans</option>
-                    <option value="all">all</option>
-                </param>
-            </when>
-
-            <when value="probability-binning">
-                <param type="integer" name="probiter" value="1000" label="Maximum number of iterations" optional="False">
-                    <validator type="in_range" min="1"/>
-                </param>
-                <param type="float" name="change" value="0.0005" label="Parameter change cutoff" optional="False" help="The cutoff for the absolute gradient values such that learning will cease if all values fall below this threshold.">
-                    <validator type="in_range" min="0.00000001"/>
-                </param>
-                <param type="float" name="step" value="0.5" label="Learning rate scaling factor" optional="False">
-                    <validator type="in_range" min="0.000001" max="1.0"/>
-                </param>
-                <param type="select" name="precalc" label="Precalculate probability corrections from fragment means">
-                    <option value="-p">yes</option>
-                    <option value="">no</option>
-                </param>
-                <param type="integer" name="biniter" value="1000" label="Maximum number of binning iterations" optional="False">
-                    <validator type="in_range" min="1"/>
-                </param>
-                <param type="float" name="threshold" value="1.0" label="Learning threshold" optional="False"
-                    help="The minimum change needed in the log-likelihood to continue learning binning corrections.">
-                    <validator type="in_range" min="0.000001" max="1.0"/>
-                </param>
-                <param type="select" name="binreads" label="Reads to use for learning binning corrections.">
-                    <option value="cis">cis</option>
-                    <option value="trans">trans</option>
-                    <option value="all">all</option>
-                </param>
-                <param type="text" size="60" name="model" value="len" label="Model parameters" optional="False" help="A comma-separated list of fragment characteristics to learn corrections for. These can include 'len' and any characteristics included in the fragment bed file.">
-                    <validator type="empty_field" />
-                </param>
-                <param type="text" size="60" name="modelbins" value="10" label="Number of parameter bins" optional="False" help="A comma-separated list of bins to divide each model parameter into.">
-                    <validator type="empty_field" />
-                </param>
-                <param type="text" size="60" name="modeltypes" value="even" label="Parameter types" optional="False" help="A comma-separated list of model parameter types. These can be 'even', 'fixed', 'even-const', and 'fixed-const'.">
-                    <validator type="empty_field" />
-                </param>
-            </when>
-
-            <when value="express-binning">
-                <param type="integer" name="expiter" value="1000" label="Number of express iterations" optional="False">
-                    <validator type="in_range" min="1"/>
-                </param>
-                <param type="select" name="removedist" label="Remove estimated distance-dependence prior to learning express corrections.">
-                    <option value="-d">yes</option>
-                    <option value="">no</option>
-                </param>
-                <param type="select" name="expreads" label="Reads to use for learning express corrections.">
-                    <option value="cis">cis</option>
-                    <option value="trans">trans</option>
-                    <option value="all">all</option>
-                </param>
-                <param type="integer" name="biniter" value="1000" label="Maximum number of binning iterations" optional="False">
-                    <validator type="in_range" min="1"/>
-                </param>
-                <param type="float" name="threshold" value="1.0" label="Learning threshold" optional="False"
-                    help="The minimum change needed in the log-likelihood to continue learning binning corrections.">
-                    <validator type="in_range" min="0.000001" max="1.0"/>
-                </param>
-                <param type="select" name="binreads" label="Reads to use for learning binning corrections.">
-                    <option value="cis">cis</option>
-                    <option value="trans">trans</option>
-                    <option value="all">all</option>
-                </param>
-                <param type="text" size="60" name="model" value="len" label="Model parameters" optional="False" help="A comma-separated list of fragment characteristics to learn corrections for. These can include 'len' and any characteristics included in the fragment bed file.">
-                    <validator type="empty_field" />
-                </param>
-                <param type="text" size="60" name="modelbins" value="10" label="Number of parameter bins" optional="False" help="A comma-separated list of bins to divide each model parameter into.">
-                    <validator type="empty_field" />
-                </param>
-                <param type="text" size="60" name="modeltypes" value="even" label="Parameter types" optional="False" help="A comma-separated list of model parameter types. These can be 'even', 'fixed', 'even-const', and 'fixed-const'.">
-                    <validator type="empty_field" />
-                </param>
-            </when>
-        </conditional>
-    </inputs>
-    <outputs>
-        <data format="fcp" name="output" label="${tool.name} on ${on_string}: 5C project ${analysis.algorithm}"/>
-    </outputs>
-
-    <help>
-This tool takes a HiFive 5C project and learns corrections values for either each valid fragment, ranges of fragment characteristics, or both. The 'probability' and 'express' algorithms learn correction values associated with each fragment while the 'binning' algorithm learns fragment characteristic corrections. These can be chained together in either order to produce more robust corrections.
-
-The probability algorithm assumes non-zero counts to distributed according to a log-normal distribution with each interaction having a mean equal to the distance-depedence predicted signal times each of the interaction fragment correction parameters and a universal sigma value. Using the probability algorithm, learning is done using a backtracking line gradient descent approach. Learning proceeds for up to the maximum number of iterations but is terminated early if all of the absolute gradient values fall below the cutoff threshold. At each step, the learning rate is scaled down by the step value if the current learning rate does not produce sufficient improvement as measured by the Arjimo criterion.
-
-The express algorithm is a variant of matrix balancing and approximates the corrections through an iterative norm-2 adjustment to given all fragments a mean ratio of one for valid counts versus signal predicted from distance-dependence. This can be done using intra-regional interactions, inter-regional interactions, or all interactions.
-
-The binning algorithm divides each model parameter into some number of bins and based on a log-normal distribution, correction values for each bin are learned, maximizing the log-likelihood of the data. Model parameters can be the fragment lengths ('len') and any other characteristics passed as additional columns (with header labels) in the bed file used to create the HiFive fragment file. Each parameter has a number of bins specified to divide it into and can be partitioned according to its type to contain approximately equal numbers of fragments ('even'), or to cover equal portions of the range of parameter values ('fixed'). In addition, parameter types can include the '-const' suffix to denote a parameter that should not be optimized after seeding.
-    </help>
-
-</tool>
\ No newline at end of file
--- a/hifive/learn_hic_normalization.xml	Thu Apr 16 12:41:30 2015 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,184 +0,0 @@
-<tool id="learn_hic_normalization" name="normalize_HiC_project">
-    <requirements><requirement type='package'>hifive</requirement></requirements>
-    <description>learn fend normalization values using probablistic approach</description>
-    <command>
-        hifive hic-normalize $analysis.algorithm -q
-        -m $mindist -x $maxdist -o $output
-
-        #if str( $chroms ) != "":
-            -c $chroms
-        #end if
-        #if str( $analysis.algorithm ) == "probability" or str( $analysis.algorithm ) == "binning-probability":
-            -b $analysis.probiter -l $analysis.step -g $analysis.change $analysis.precalc
-        #end if
-        #if str( $analysis.algorithm ) == "express" or str( $analysis.algorithm ) == "binning-express" :
-            -e $analysis.expiter $analysis.removedist -w $analysis.expreads
-        #end if
-        #if str( $analysis.algorithm ) == "binning" or str( $analysis.algorithm ) == "binning-express" or str( $analysis.algorithm ) == "binning-probability":
-            -r $analysis.biniter -t $analysis.threshold -y $analysis.binreads
-            -v $analysis.model -z $analysis.modelbins -u $analysis.modeltypes
-        #end if
-
-    $data</command>
-    <inputs>
-        <param format="hcp" name="data" type="data" label="HiFive HiC project file" optional="False"/>
-        <param type="integer" name="mindist" value="0" label="Minimum interaction distance" optional="False">
-            <validator type="in_range" min="0"/>
-        </param>
-        <param type="integer" name="maxdist" value="0" label="Maximum interaction distance" optional="False" help="A value of zero indicates no upper limit.">
-            <validator type="in_range" min="0"/>
-        </param>
-        <param type="text" size="60" name="chroms" value="" label="Included chromosomes" optional="False" help="If a subset of chromosomes are to be used, enter a comma-separated list of chromosome names."/>
-        <conditional name='analysis'>
-            <param name="algorithm" type="select" label="Learning Algorithm">
-                <option value="probability">Probability</option>
-                <option value="express">Express</option>
-                <option value="binning">Binning</option>
-                <option value="binning-probability">Binning-Probability</option>
-                <option value="binning-express">Binning-Express</option>
-            </param>
-
-            <when value="probability">
-                <param type="integer" name="probiter" value="1000" label="Maximum number of iterations" optional="False">
-                    <validator type="in_range" min="1"/>
-                </param>
-                <param type="float" name="change" value="0.0005" label="Parameter change cutoff" optional="False" help="The cutoff for the absolute gradient values such that learning will cease if all values fall below this threshold.">
-                    <validator type="in_range" min="0.00000001"/>
-                </param>
-                <param type="float" name="step" value="0.5" label="Learning rate scaling factor" optional="False">
-                    <validator type="in_range" min="0.000001" max="1.0"/>
-                </param>
-                <param type="select" name="precalc" label="Precalculate probability corrections from fragment means">
-                    <option value="-p">yes</option>
-                    <option value="">no</option>
-                </param>
-            </when>
-
-            <when value="express">
-                <param type="integer" name="expiter" value="1000" label="Number of express iterations" optional="False">
-                    <validator type="in_range" min="1"/>
-                </param>
-                <param type="select" name="removedist" label="Remove estimated distance-dependence prior to learning express corrections.">
-                    <option value="-d">yes</option>
-                    <option value="">no</option>
-                </param>
-                <param type="select" name="expreads" label="Reads to use for learning express corrections.">
-                    <option value="cis">cis</option>
-                    <option value="trans">trans</option>
-                    <option value="all">all</option>
-                </param>
-            </when>
-
-            <when value="binning">
-                <param type="integer" name="biniter" value="1000" label="Maximum number of binning iterations" optional="False">
-                    <validator type="in_range" min="1"/>
-                </param>
-                <param type="float" name="threshold" value="1.0" label="Learning threshold" optional="False"
-                    help="The minimum change needed in the log-likelihood to continue learning binning corrections.">
-                    <validator type="in_range" min="0.000001" max="1.0"/>
-                </param>
-                <param type="select" name="binreads" label="Reads to use for learning binning corrections.">
-                    <option value="cis">cis</option>
-                    <option value="trans">trans</option>
-                    <option value="all">all</option>
-                </param>
-                <param type="text" size="60" name="model" value="len,gc" label="Model parameters" optional="False" help="A comma-separated list of fragment characteristics to learn corrections for. These can include 'len' and any characteristics included in the fragment bed file.">
-                    <validator type="empty_field" />
-                </param>
-                <param type="text" size="60" name="modelbins" value="20,20" label="Number of parameter bins" optional="False" help="A comma-separated list of bins to divide each model parameter into.">
-                    <validator type="empty_field" />
-                </param>
-                <param type="text" size="60" name="modeltypes" value="even,even" label="Parameter types" optional="False" help="A comma-separated list of model parameter types. These can be 'even', 'fixed', 'even-const', and 'fixed-const'.">
-                    <validator type="empty_field" />
-                </param>
-            </when>
-
-            <when value="binning-probability">
-                <param type="integer" name="biniter" value="1000" label="Maximum number of binning iterations" optional="False">
-                    <validator type="in_range" min="1"/>
-                </param>
-                <param type="float" name="threshold" value="1.0" label="Learning threshold" optional="False"
-                    help="The minimum change needed in the log-likelihood to continue learning binning corrections.">
-                    <validator type="in_range" min="0.000001" max="1.0"/>
-                </param>
-                <param type="select" name="binreads" label="Reads to use for learning binning corrections.">
-                    <option value="cis">cis</option>
-                    <option value="trans">trans</option>
-                    <option value="all">all</option>
-                </param>
-                <param type="text" size="60" name="model" value="len,gc" label="Model parameters" optional="False" help="A comma-separated list of fragment characteristics to learn corrections for. These can include 'len' and any characteristics included in the fragment bed file.">
-                    <validator type="empty_field" />
-                </param>
-                <param type="text" size="60" name="modelbins" value="20,20" label="Number of parameter bins" optional="False" help="A comma-separated list of bins to divide each model parameter into.">
-                    <validator type="empty_field" />
-                </param>
-                <param type="text" size="60" name="modeltypes" value="even,even" label="Parameter types" optional="False" help="A comma-separated list of model parameter types. These can be 'even', 'fixed', 'even-const', and 'fixed-const'.">
-                    <validator type="empty_field" />
-                </param>
-                <param type="integer" name="probiter" value="1000" label="Maximum number of iterations" optional="False">
-                    <validator type="in_range" min="1"/>
-                </param>
-                <param type="float" name="change" value="0.0005" label="Parameter change cutoff" optional="False" help="The cutoff for the absolute gradient values such that learning will cease if all values fall below this threshold.">
-                    <validator type="in_range" min="0.00000001"/>
-                </param>
-                <param type="float" name="step" value="0.5" label="Learning rate scaling factor" optional="False">
-                    <validator type="in_range" min="0.000001" max="1.0"/>
-                </param>
-                <param type="select" name="precalc" label="Precalculate probability corrections from fragment means">
-                    <option value="-p">yes</option>
-                    <option value="">no</option>
-                </param>
-            </when>
-
-            <when value="binning-express">
-                <param type="integer" name="biniter" value="1000" label="Maximum number of binning iterations" optional="False">
-                    <validator type="in_range" min="1"/>
-                </param>
-                <param type="float" name="threshold" value="1.0" label="Learning threshold" optional="False"
-                    help="The minimum change needed in the log-likelihood to continue learning binning corrections.">
-                    <validator type="in_range" min="0.000001" max="1.0"/>
-                </param>
-                <param type="select" name="binreads" label="Reads to use for learning binning corrections.">
-                    <option value="cis">cis</option>
-                    <option value="trans">trans</option>
-                    <option value="all">all</option>
-                </param>
-                <param type="text" size="60" name="model" value="len,gc" label="Model parameters" optional="False" help="A comma-separated list of fragment characteristics to learn corrections for. These can include 'len' and any characteristics included in the fragment bed file.">
-                    <validator type="empty_field" />
-                </param>
-                <param type="text" size="60" name="modelbins" value="20,20" label="Number of parameter bins" optional="False" help="A comma-separated list of bins to divide each model parameter into.">
-                    <validator type="empty_field" />
-                </param>
-                <param type="text" size="60" name="modeltypes" value="even,even" label="Parameter types" optional="False" help="A comma-separated list of model parameter types. These can be 'even', 'fixed', 'even-const', and 'fixed-const'.">
-                    <validator type="empty_field" />
-                </param>
-                <param type="integer" name="expiter" value="1000" label="Number of express iterations" optional="False">
-                    <validator type="in_range" min="1"/>
-                </param>
-                <param type="select" name="removedist" label="Remove estimated distance-dependence prior to learning express corrections.">
-                    <option value="-d">yes</option>
-                    <option value="">no</option>
-                </param>
-                <param type="select" name="expreads" label="Reads to use for learning express corrections.">
-                    <option value="cis">cis</option>
-                    <option value="trans">trans</option>
-                    <option value="all">all</option>
-                </param>
-            </when>
-        </conditional>
-    </inputs>
-    <outputs>
-        <data format="hcp" name="output" label="${tool.name} on ${on_string}: HiC project ${analysis.algorithm}"/>
-    </outputs>
-
-    <help>
-This tool takes a HiFive HiC project and learns corrections values for either each valid fend, ranges of fend characteristics, or both. The 'probability' and 'express' algorithms learn correction values associated with each fend while the 'binning' algorithm learns fend characteristic corrections. These can be chained together in either order to produce more robust corrections.
-
-Using the probability algorithm, observation of counts are assumed to be distributed according to a binomial distribution with an observation probability for each interaction equal to the product of the distance-dependence signal and the two fend correction parameters. Using the probability algorithm, learning is done using a backtracking line gradient descent approach. Learning proceeds for up to the maximum number of iterations but is terminated early if all of the absolute gradient values fall below the cutoff threshold. At each step, the learning rate is scaled down by the step value if the current learning rate does not produce sufficient improvement as measured by the Arjimo criterion.
-
-The express algorithm is a variant of matrix balancing and approximates the corrections through an iterative norm-2 adjustment to given all fragments a mean ratio of one for valid counts versus signal predicted from distance-dependence. This can be done using intra-regional interactions, inter-regional interactions, or all interactions.
-
-The binning algorithm divides each model parameter into some number of bins and based on a binomial distribution, correction values for each bin are learned, maximizing the log-likelihood of the data. Model parameters can be the fend lengths ('len'), fend GC content ('gc'), and any other characteristics passed as additional columns (with header labels) in the bed file used to create the HiFive fend file. Each parameter has a number of bins specified to divide it into and can be partitioned according to its type to contain approximately equal numbers of fends ('even'), or to cover equal portions of the range of parameter values ('fixed'). In addition, parameter types can include the '-const' suffix to denote a parameter that should not be optimized after seeding.
-    </help>
-
-</tool>
\ No newline at end of file
--- a/hifive/readme.rst	Thu Apr 16 12:41:30 2015 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-=============================
-Galaxy wrapper for HiFive
-=============================
-
-This wrapper allows use of the hifive package, a set of tools for handling HiC
-and 5C data, on Galaxy. This includes managing data from mapped reads, either
-in bam, mat, or raw formats. All stages use hdf5 dictionaries for fast access
-and minimal memory and storage usage.
-
-This toolset includes methods for normalizing data from either HiC or 5C
-experiments at the fragment-end, or fragment level resolution, respectively.
-Once normalized, data can be used for plotting, binning, or other statistical
-tests within the package very quickly.
-
-Original documentation can be found `here <http://hifive.docs.taylorlab.org/en/latest/>`_.
-
-Installing HiFive
-=============================
-
-It is recommended to install this wrapper via the `Galaxy Test Tool Shed`.
-
-.. _`Galaxy Tool Shed`: http://testtoolshed.g2.bx.psu.edu/view/msauria/hifive
-
-
-================
-Wrapper Licence
-================
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
--- a/hifive/tool_dependencies.xml	Thu Apr 16 12:41:30 2015 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-<?xml version="1.0"?>
-<tool_dependency>
-    <package name="scipy" version="0.14">
-        <repository changeset_revision="2e3809844979" name="package_scipy_0_14" owner="iuc" toolshed="https://testtoolshed.g2.bx.psu.edu" />
-    </package>
-    <package name="numpy" version="1.9">
-        <repository name="package_numpy_1_9" owner="iuc" changeset_revision="266529386609" toolshed="https://testtoolshed.g2.bx.psu.edu" prior_installation_required="True" />
-    </package>
-    <package name="cython" version="0.20.1">
-        <repository name="package_cython_0_20_1" owner="iuc" changeset_revision="749f11b9358a" toolshed="https://testtoolshed.g2.bx.psu.edu" prior_installation_required="True"/>
-    </package>
-    <package name="h5py" version="2.4.0">
-        <repository changeset_revision="79b31a4c757c" name="package_h5py_2_4_0" owner="sauria" toolshed="https://testtoolshed.g2.bx.psu.edu" />
-    </package>
-    <package name="hifive" version="1.0.2">
-        <repository changeset_revision="3dfc9498f211" name="package_hifive_1_0_2" owner="sauria" toolshed="https://testtoolshed.g2.bx.psu.edu" />
-    </package>
-    <set_environment version="1.0">
-        <environment_variable action="set_to" name="HIFIVE_SCRIPT_PATH">$REPOSITORY_INSTALL_DIR</environment_variable>
-    </set_environment>
-</tool_dependency>