changeset 7:561503a442f0

refactor
author Jim Johnson <jj@umn.edu>
date Tue, 08 Nov 2011 13:26:41 -0600
parents 3be0e0a858fe
children a89fec682254
files gmap.xml gmap/gmap.xml gmap/gmap_build.xml gmap/gsnap.xml gmap/iit_store.xml gmap/snpindex.xml gmap_build.xml gsnap.xml iit_store.xml snpindex.xml
diffstat 10 files changed, 1782 insertions(+), 1782 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gmap.xml	Tue Nov 08 13:26:41 2011 -0600
@@ -0,0 +1,442 @@
+<tool id="gmap" name="GMAP" version="2.0.0">
+  <description>Genomic Mapping and Alignment Program for mRNA and EST sequences</description>
+  <requirements>
+    <requirement type="binary">gmap</requirement>
+    <!-- proposed tag for added datatype dependencies -->
+    <requirement type="datatype">gmapdb</requirement>
+    <requirement type="datatype">gmap_annotation</requirement>
+    <requirement type="datatype">gmap_splicesites</requirement>
+    <requirement type="datatype">gmap_introns</requirement>
+    <requirement type="datatype">gmap_snps</requirement>
+  </requirements>
+  <version_string>gmap --version</version_string>
+  <command>
+    #import os,os.path
+    gmap
+    --nthreads=4 --ordered
+    #if $refGenomeSource.genomeSource == "history":
+      --gseg=$refGenomeSource.ownFile
+    #elif $refGenomeSource.genomeSource == "gmapdb":
+      #set $gmapdb = $os.listdir($refGenomeSource.gmapdb.extra_files_path)[0]
+      --dir=$refGenomeSource.gmapdb.extra_files_path --db=$gmapdb
+      #if $refGenomeSource.kmer != None and len($refGenomeSource.kmer.__str__) == 2:
+        --kmer=$refGenomeSource.kmer
+      #end if
+    #else:
+      --dir=$os.path.dirname($refGenomeSource.gmapindex.value) --db=$os.path.basename($refGenomeSource.gmapindex.value)
+      #if $refGenomeSource.kmer != None and len($refGenomeSource.kmer.__str__) == 2:
+        --kmer=$refGenomeSource.kmer
+      #end if
+    #end if
+    #if $result.format == "summary":
+      --summary
+    #elif $result.format == "align":
+      --align
+    #elif $result.format == "continuous":
+      --continuous
+    #elif $result.format == "continuous-by-exon":
+      --continuous-by-exon
+    #elif $result.format == "compress":
+      --compress
+    #elif $result.format == "exons_dna":
+      --exons=cdna
+    #elif $result.format == "exons_gen":
+      --exons=genomic
+    #elif $result.format == "protein_dna":
+      --protein_dna
+    #elif $result.format == "protein_gen":
+      --protein_gen
+    #elif $result.format == "sam":
+      --format=$result.sam_paired_read
+      $result.no_sam_headers 
+      #if len($result.noncanonical_splices.__str__) > 0
+         --noncanonical-splices=$result.noncanonical_splices
+      #end if
+      #if len($result.read_group_id.__str__) > 0
+         --read-group-id=$result.read_group_id
+      #end if
+      #if len($result.read_group_name.__str__) > 0
+         --read-group-name=$result.read_group_name
+      #end if
+      #if len($result.read_group_library.__str__) > 0
+         --read-group-library=$result.read_group_library
+      #end if
+      #if len($result.read_group_platform.__str__) > 0
+         --read-group-platform=$result.read_group_platform
+      #end if
+    #elif $result.format != "gmap":
+      --format=$result.format
+    #end if
+    #if $computation.options == "advanced":
+      $computation.nosplicing
+      $computation.cross_species
+      --min-intronlength=$computation.min_intronlength
+      --intronlength=$computation.intronlength
+      --localsplicedist=$computation.localsplicedist
+      --totallength=$computation.totallength
+      --trimendexons=$computation.trimendexons
+      --direction=$computation.direction
+      --canonical-mode=$computation.canonical
+      --prunelevel=$computation.prunelevel
+      --allow-close-indels=$computation.allow_close_indels
+      --microexon-spliceprob=$computation.microexon_spliceprob
+      #if int($computation.chimera_margin) >= 0:
+        --chimera-margin=$computation.chimera_margin
+      #end if
+    #end if
+    #if $advanced.options == "used":
+      #if int($advanced.npaths) >= 0:
+        --npaths=$advanced.npaths
+      #end if
+      #if int($advanced.chimera_overlap) > 0:
+        --chimera_overlap=$advanced.chimera_overlap
+      #end if
+      $advanced.protein
+      $advanced.tolerant
+      $advanced.nolengths
+      $advanced.invertmode
+      #if int($advanced.introngap) > 0:
+        --introngap=$advanced.introngap
+      #end if
+      #if int($advanced.wraplength) > 0:
+        --wraplength=$advanced.wraplength
+      #end if
+    #end if
+    #if $split_output == True
+      $split_output
+    #end if
+    #if len($quality_protocol.__str__) > 0:
+      --quality-protocol=$quality_protocol
+    #end if
+    $input
+    #for $i in $inputs:
+      ${i.added_input}
+    #end for
+    #if $split_output == True
+      2> $gmap_stderr 
+    #else
+      2> $gmap_stderr > $output
+    #end if
+  </command>
+  <inputs>
+    <!-- Input data -->
+    <param name="input" type="data" format="fasta,fastqsanger,fastqillumina" label="&lt;H2&gt;Input Sequences&lt;/H2&gt;Select an mRNA or EST dataset to map" />
+    <repeat name="inputs" title="addtional mRNA or EST dataset to map">
+      <param name="added_input" type="data" format="fasta,fastqsanger,fastqillumina" label=""/>
+    </repeat>
+    <param name="quality_protocol" type="select" label="Protocol for input quality scores">
+      <option value="">No quality scores</option>
+      <option value="sanger">Sanger quality scores</option>
+      <option value="illumina">Illumina quality scores</option>
+    </param>
+
+    <!-- GMAPDB for mapping -->
+    <conditional name="refGenomeSource">
+     <param name="genomeSource" type="select" label="&lt;HR&gt;&lt;H2&gt;Map To&lt;/H2&gt;Will you map to a reference genome from your history or use a built-in index?" help="Built-ins were indexed using default options">
+        <option value="indexed">Use a built-in index</option>
+        <option value="gmapdb">Use gmapdb from the history</option>
+        <option value="history">Use a fasta reference sequence from the history</option>
+      </param>
+      <when value="indexed">
+        <param name="gmapindex" type="select" label="Select a reference genome" help="if your genome of interest is not listed - contact Galaxy team">
+          <options from_file="gmap_indices.loc">
+            <column name="uid" index="0" />
+            <column name="dbkey" index="1" />
+            <column name="name" index="2" />
+            <column name="kmers" index="3" />
+            <column name="maps" index="4" />
+            <column name="snps" index="5" />
+            <column name="value" index="6" />
+          </options>
+        </param>
+        <param name="kmer" type="select" data_ref="gmapindex" label="kmer size" help="Defaults to highest available kmer size">
+          <options from_file="gmap_indices.loc">
+            <column name="name" index="3"/>
+            <column name="value" index="3"/>
+            <filter type="param_value" ref="gmapindex" column="6"/>
+            <filter type="multiple_splitter" column="3" separator=","/>
+            <filter type="add_value" name="" value=""/>
+            <filter type="sort_by" column="3"/>
+          </options>
+        </param>
+        <param name="map" type="select" data_ref="gmapindex" label="Look for splicing involving known sites or known introns" help="">
+          <options from_file="gmap_indices.loc">
+            <column name="name" index="4"/>
+            <column name="value" index="4"/>
+            <filter type="param_value" ref="gmapindex" column="6"/>
+            <filter type="multiple_splitter" column="4" separator=","/>
+            <filter type="add_value" name="" value=""/>
+            <filter type="sort_by" column="4"/>
+          </options>
+        </param>
+      </when>
+      <when value="gmapdb">
+        <param name="gmapdb" type="data" format="gmapdb" metadata_name="dbkey" label="Select a gmapdb" 
+              help="A GMAP database built with GMAP Build"/>
+        <param name="kmer" type="select" data_ref="gmapdb" label="kmer size" help="Defaults to highest available kmer size">
+          <options>
+            <filter type="data_meta" ref="gmapdb" key="kmers" multiple="True" separator=","/>
+          </options>
+        </param>
+        <param name="map" type="select"  data_ref="gmapdb" label="Use map for splicing involving known sites or known introns" help="">
+          <options>
+            <filter type="data_meta" ref="gmapdb" key="maps" multiple="True"/>
+          </options>
+        </param>
+      </when>
+      <when value="history">
+        <param name="ownFile" type="data" format="fasta" metadata_name="dbkey" label="Select the reference genome" 
+              help="Fasta containing genomic DNA sequence"/>
+      </when>
+    </conditional>
+
+    
+    <!-- Computation options -->
+    <conditional name="computation">
+      <param name="options" type="select" label="&lt;HR&gt;Computational Settings" help="">
+        <option value="default">Use default settings</option>
+        <option value="advanced">Set Computation Options</option>
+      </param>
+      <when value="default"/>
+      <when value="advanced">
+       <param name="nosplicing" type="boolean" truevalue="--nosplicing" falsevalue="" checked="false" label="Turn off splicing" help="(useful for aligning genomic sequences onto a genome)"/>
+       <param name="min_intronlength" type="integer" value="9" label="Min length for one internal intron (default 9)." help="Below this size, a genomic gap will be considered a deletion rather than an intron." />	
+       <param name="intronlength" type="integer" value="1000000" label="Max length for one intron (default 1000000)" />	
+       <param name="localsplicedist" type="integer" value="200000" label="Max length for known splice sites at ends of sequence (default 200000)" />	
+       <param name="totallength"  type="integer" value="2400000" label="Max total intron length (default 2400000)" />	
+       <param name="chimera_margin" type="integer" value="40" label="Amount of unaligned sequence that triggers search for a chimera (default is 40, 0 is off)" />	
+       <param name="direction"  type="select" label="cDNA direction">	
+         <option value="auto">auto</option>
+         <option value="sense_force">sense_force</option>
+         <option value="antisense_force">antisense_force</option>
+         <option value="sense_filter">sense_filter</option>
+         <option value="antisense_filter">antisense_filter</option>
+       </param>
+       <param name="trimendexons"  type="integer" value="12" label="Trim end exons with fewer than given number of matches (in nt, default 12)" />	
+       <param name="cross_species" type="boolean" truevalue="--cross-species" falsevalue="" checked="false" label="Cross-species alignment" help="For cross-species alignments, use a more sensitive search for canonical splicing"/>
+       
+       <param name="canonical"  type="select" label="Reward for canonical and semi-canonical introns">	
+         <option value="1">high reward (default)</option>
+         <option value="0">low reward</option>
+         <option value="2">low reward for high-identity sequences</option>
+       </param>
+       <param name="allow_close_indels"  type="select" label="Allow an insertion and deletion close to each other">	
+         <option value="1" selected="true">yes (default)</option>
+         <option value="0">no</option>
+         <option value="2">only for high-quality alignments</option>
+       </param>
+       <param name="microexon_spliceprob" type="float" value="0.90" label="Allow microexons only if one of the splice site probabilities is greater than this value (default 0.90)" >	
+         <validator type="in_range" message="slice probability between 0.00 and 1.00" min="0" max="1"/> 
+       </param>
+       <param name="prunelevel"  type="select" label="Pruning level">	
+         <option value="0">no pruning (default)</option>
+         <option value="1">poor sequences</option>
+         <option value="2">repetitive sequences</option>
+         <option value="3">poor and repetitive sequences</option>
+       </param>
+       <!--  could do this as a config file 
+       <param name="chrsubsetfile" type="data" format="fasta" label="User-supplied chromosome subset file" />
+       <param name="chrsubset" type="text" label="Chromosome subset to search" />
+       -->
+      </when>
+    </conditional>
+
+    <!-- Advanced Settings -->
+    <conditional name="advanced">
+      <param name="options" type="select" label="&lt;HR&gt;Advanced Settings" help="">
+        <option value="default">Use default settings</option>
+        <option value="used">Set Options</option>
+      </param>
+      <when value="default"/>
+      <when value="used">
+       <param name="nolengths" type="boolean" checked="false" truevalue="--nolengths=true" falsevalue="" label="No intron lengths in alignment"/>
+       <param name="invertmode" type="select" label=" Mode for alignments to genomic (-) strand" help="">
+        <option value="">Don't invert the cDNA (default)</option>
+        <option value="--invertmode=1">Invert cDNA and print genomic (-) strand</option>
+        <option value="--invertmode=2">Invert cDNA and print genomic (+) strand</option>
+       </param>
+       <param name="introngap" type="integer" value="3" label="Nucleotides to show on each end of intron (default=3)" />	
+       <param name="wraplength" type="integer" value="50" label="Line Wrap length for alignment (default=50)" />	
+       <param name="npaths" type="integer" value="-1" optional="true"
+              label="Maximum number of paths to show.  Ignored if negative.  If 0, prints two paths if chimera detected, else one." />	
+       <param name="chimera_overlap" type="integer" value="0" label="Overlap to show, if any, at chimera breakpoint" />	
+       <param name="tolerant" type="boolean" checked="false" truevalue="--tolerant=true" falsevalue="" 
+              label="Translates cDNA with corrections for frameshifts"/>
+       <param name="protein" type="select" label="Protein alignment" help="">
+        <option value="">default</option>
+        <option value="--fulllength=true">Assume full-length protein, starting with Met</option>
+        <option value="--truncate=true">Truncate alignment around full-length protein, Met to Stop</option>
+       </param>
+      </when>
+    </conditional>
+
+    <!-- Output data -->
+    <conditional name="result">
+    <param name="format" type="select" label="&lt;HR&gt;&lt;H2&gt;Output&lt;/H2&gt;Select the output format" help="">
+      <option value="gmap">GMAP default output</option>
+      <option value="summary">Summary of alignments</option>
+      <option value="align">Alignment</option>
+      <option value="continuous">Alignment in three continuous lines</option>
+      <option value="continuous-by-exon">Alignment in three lines per exon</option>
+      <option value="compress">Print output in compressed format</option>
+      <option value="exons_dna">Print exons cDNA</option>
+      <option value="exons_gen">Print exons genomic</option>
+      <option value="protein_dna">Print protein sequence (cDNA)</option>
+      <option value="protein_gen">Print protein sequence (genomic)</option>
+      <option value="psl">PSL (BLAT) format</option>
+      <option value="gff3_gene">GFF3 gene format</option>
+      <option value="gff3_match_cdna">GFF3 match cDNA format</option>
+      <option value="gff3_match_est">GFF3 match EST format</option>
+      <option value="splicesites">splicesites output (for GSNAP)</option>
+      <option value="introns">introns output (for GSNAP)</option>
+      <option value="map_exons">IIT FASTA exon map format</option>
+      <option value="map_genes">IIT FASTA map format</option>
+      <option value="coords">coords in table format</option>
+      <option value="sam" selected="true">SAM format</option>
+    </param>
+      <when value="gmap"/>
+      <when value="summary"/>
+      <when value="align">
+
+      </when>
+      <when value="continuous">
+      </when>
+      <when value="continuous-by-exon">
+      </when>
+      <when value="compress"/>
+      <when value="exons_dna"/>
+      <when value="exons_gen"/>
+      <when value="protein_dna"/>
+      <when value="protein_gen"/>
+      <when value="psl"/>
+      <when value="gff3_gene"/>
+      <when value="gff3_match_cdna"/>
+      <when value="gff3_match_est"/>
+      <when value="splicesites"/>
+      <when value="introns"/>
+      <when value="map_exons"/>
+      <when value="map_genes"/>
+      <when value="coords"/>
+      <when value="sam">
+        <param name="sam_paired_read" type="boolean" truevalue="sampe" falsevalue="samse" checked="false" label="SAM paired reads"/>
+        <param name="no_sam_headers" type="boolean" truevalue="--no-sam-headers" falsevalue="" checked="false" label="Do not print headers beginning with '@'"/>
+        <param name="noncanonical_splices" type="select" label="Print non-canonical genomic gaps greater than 20 nt in CIGAR string as STRING.">
+          <option value="">Use default</option>
+          <option value="N">N</option>
+          <option value="D">D</option>
+        </param>
+        <param name="read_group_id" type="text" value="" label="Value to put into read-group id (RG-ID) field"/>
+        <param name="read_group_name" type="text" value="" label="Value to put into read-group name (RG-SM) field"/>
+        <param name="read_group_library" type="text" value="" label="Value to put into read-group library (RG-LB) field"/>
+        <param name="read_group_platform" type="text" value="" label="Value to put into read-group library platform (RG-PL) field"/>
+      </when>
+    </conditional> <!-- name="result" -->
+
+    <param name="split_output" type="boolean" truevalue="--split-output=gmap_out" falsevalue="" checked="false" label="Separate outputs for nomapping, uniq, mult, and chimera" help="(chimera only when chimera-margin is selected)"/>
+
+
+    <!-- 
+      map=iitfile      Map file.  If argument is '?' (with the quotes), this lists available map files.
+      mapexons         Map each exon separately
+      mapboth          Report hits from both strands of genome
+      flanking=INT     Show flanking hits (default 0)
+      print-comment    Show comment line for each hit
+    -->
+
+
+  </inputs>
+  <outputs>
+    <data format="txt" name="gmap_stderr" label="${tool.name} on ${on_string}: stderr"/>
+    <data format="txt" name="output" label="${tool.name} on ${on_string} ${result.format}" >
+      <filter>(split_output == False)</filter>
+      <change_format>
+        <when input="result['format']" value="gff3_gene" format="gff3"/>
+        <when input="result['format']" value="gff3_match_cdna" format="gff3"/>
+        <when input="result['format']" value="gff3_match_est" format="gff3"/>
+        <when input="result['format']" value="sam" format="sam"/>
+        <when input="result['format']" value="splicesites" format="gmap_splicesites"/>
+        <when input="result['format']" value="introns" format="gmap_introns"/>
+        <when input="result['format']" value="map_genes" format="gmap_annotation"/>
+        <when input="result['format']" value="map_exons" format="gmap_annotation"/>
+      </change_format>
+    </data>
+    <data format="txt" name="uniq" label="${tool.name} on ${on_string} uniq.${result.format}"  from_work_dir="gmap_out.uniq">
+      <filter>(split_output == True)</filter>
+      <change_format>
+        <when input="result['format']" value="gff3_gene" format="gff3"/>
+        <when input="result['format']" value="gff3_match_cdna" format="gff3"/>
+        <when input="result['format']" value="gff3_match_est" format="gff3"/>
+        <when input="result['format']" value="sam" format="sam"/>
+        <when input="result['format']" value="splicesites" format="gmap_splicesites"/>
+        <when input="result['format']" value="introns" format="gmap_introns"/>
+        <when input="result['format']" value="map_genes" format="gmap_annotation"/>
+        <when input="result['format']" value="map_exons" format="gmap_annotation"/>
+      </change_format>
+    </data>
+    <data format="txt" name="transloc" label="${tool.name} on ${on_string} transloc.${result.format}"  from_work_dir="gmap_out.transloc">
+      <filter>(split_output == True)</filter>
+      <change_format>
+        <when input="result['format']" value="gff3_gene" format="gff3"/>
+        <when input="result['format']" value="gff3_match_cdna" format="gff3"/>
+        <when input="result['format']" value="gff3_match_est" format="gff3"/>
+        <when input="result['format']" value="sam" format="sam"/>
+        <when input="result['format']" value="splicesites" format="gmap_splicesites"/>
+        <when input="result['format']" value="introns" format="gmap_introns"/>
+        <when input="result['format']" value="map_genes" format="gmap_annotation"/>
+        <when input="result['format']" value="map_exons" format="gmap_annotation"/>
+      </change_format>
+    </data>
+    <data format="txt" name="nomapping" label="${tool.name} on ${on_string} nomapping.${result.format}"  from_work_dir="gmap_out.nomapping">
+      <filter>(split_output == True)</filter>
+      <change_format>
+        <when input="result['format']" value="gff3_gene" format="gff3"/>
+        <when input="result['format']" value="gff3_match_cdna" format="gff3"/>
+        <when input="result['format']" value="gff3_match_est" format="gff3"/>
+        <when input="result['format']" value="sam" format="sam"/>
+        <when input="result['format']" value="splicesites" format="gmap_splicesites"/>
+        <when input="result['format']" value="introns" format="gmap_introns"/>
+        <when input="result['format']" value="map_genes" format="gmap_annotation"/>
+        <when input="result['format']" value="map_exons" format="gmap_annotation"/>
+      </change_format>
+    </data>
+    <data format="txt" name="mult" label="${tool.name} on ${on_string} mult.${result.format}"  from_work_dir="gmap_out.mult">
+      <filter>(split_output == True)</filter>
+      <change_format>
+        <when input="result['format']" value="gff3_gene" format="gff3"/>
+        <when input="result['format']" value="gff3_match_cdna" format="gff3"/>
+        <when input="result['format']" value="gff3_match_est" format="gff3"/>
+        <when input="result['format']" value="sam" format="sam"/>
+        <when input="result['format']" value="splicesites" format="gmap_splicesites"/>
+        <when input="result['format']" value="introns" format="gmap_introns"/>
+        <when input="result['format']" value="map_genes" format="gmap_annotation"/>
+        <when input="result['format']" value="map_exons" format="gmap_annotation"/>
+      </change_format>
+    </data>
+  </outputs>
+  <tests>
+  </tests> 
+
+  <help>
+
+**What it does**
+
+GMAP_ (Genomic Mapping and Alignment Program)  The functionality provided by gmap allows a user to: (1) map and align a single cDNA interactively against a large genome in about a second, without the startup time of several minutes typically needed by existing mapping programs; (2) switch arbitrarily among different genomes, without the need for a preloaded server dedicated to each genome; (3) run the program on computers with as little as 128 MB of RAM (random access memory); (4) perform high-throughput batch processing of cDNAs by using memory mapping and multithreading when appropriate memory and hardware are available; (5) generate accurate gene models, even in the presence of substantial polymorphisms and sequence errors; (6) locate splice sites accurately without the use of probabilistic splice site models, allowing generalized use of the program across species; (7) detect statistically significant microexons and incorporate them into the alignment; and (8) handle mapping and alignment tasks on genomes having alternate assemblies, linkage groups or strains.  It is developed by Thomas D. Wu of Genentech, Inc.  
+
+Publication_ citation: Thomas D. Wu, Colin K. Watanabe  Bioinformatics 2005 21(9):1859-1875; doi:10.1093/bioinformatics/bti310
+
+.. _GMAP: http://research-pub.gene.com/gmap/
+.. _Publication: http://bioinformatics.oxfordjournals.org/cgi/content/full/21/9/1859
+
+------
+
+**Know what you are doing**
+
+.. class:: warningmark
+
+You will want to read the README_
+
+.. _README: http://research-pub.gene.com/gmap/src/README
+
+  </help>
+</tool>
+
--- a/gmap/gmap.xml	Tue Nov 08 13:22:34 2011 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,442 +0,0 @@
-<tool id="gmap" name="GMAP" version="2.0.0">
-  <description>Genomic Mapping and Alignment Program for mRNA and EST sequences</description>
-  <requirements>
-    <requirement type="binary">gmap</requirement>
-    <!-- proposed tag for added datatype dependencies -->
-    <requirement type="datatype">gmapdb</requirement>
-    <requirement type="datatype">gmap_annotation</requirement>
-    <requirement type="datatype">gmap_splicesites</requirement>
-    <requirement type="datatype">gmap_introns</requirement>
-    <requirement type="datatype">gmap_snps</requirement>
-  </requirements>
-  <version_string>gmap --version</version_string>
-  <command>
-    #import os,os.path
-    gmap
-    --nthreads=4 --ordered
-    #if $refGenomeSource.genomeSource == "history":
-      --gseg=$refGenomeSource.ownFile
-    #elif $refGenomeSource.genomeSource == "gmapdb":
-      #set $gmapdb = $os.listdir($refGenomeSource.gmapdb.extra_files_path)[0]
-      --dir=$refGenomeSource.gmapdb.extra_files_path --db=$gmapdb
-      #if $refGenomeSource.kmer != None and len($refGenomeSource.kmer.__str__) == 2:
-        --kmer=$refGenomeSource.kmer
-      #end if
-    #else:
-      --dir=$os.path.dirname($refGenomeSource.gmapindex.value) --db=$os.path.basename($refGenomeSource.gmapindex.value)
-      #if $refGenomeSource.kmer != None and len($refGenomeSource.kmer.__str__) == 2:
-        --kmer=$refGenomeSource.kmer
-      #end if
-    #end if
-    #if $result.format == "summary":
-      --summary
-    #elif $result.format == "align":
-      --align
-    #elif $result.format == "continuous":
-      --continuous
-    #elif $result.format == "continuous-by-exon":
-      --continuous-by-exon
-    #elif $result.format == "compress":
-      --compress
-    #elif $result.format == "exons_dna":
-      --exons=cdna
-    #elif $result.format == "exons_gen":
-      --exons=genomic
-    #elif $result.format == "protein_dna":
-      --protein_dna
-    #elif $result.format == "protein_gen":
-      --protein_gen
-    #elif $result.format == "sam":
-      --format=$result.sam_paired_read
-      $result.no_sam_headers 
-      #if len($result.noncanonical_splices.__str__) > 0
-         --noncanonical-splices=$result.noncanonical_splices
-      #end if
-      #if len($result.read_group_id.__str__) > 0
-         --read-group-id=$result.read_group_id
-      #end if
-      #if len($result.read_group_name.__str__) > 0
-         --read-group-name=$result.read_group_name
-      #end if
-      #if len($result.read_group_library.__str__) > 0
-         --read-group-library=$result.read_group_library
-      #end if
-      #if len($result.read_group_platform.__str__) > 0
-         --read-group-platform=$result.read_group_platform
-      #end if
-    #elif $result.format != "gmap":
-      --format=$result.format
-    #end if
-    #if $computation.options == "advanced":
-      $computation.nosplicing
-      $computation.cross_species
-      --min-intronlength=$computation.min_intronlength
-      --intronlength=$computation.intronlength
-      --localsplicedist=$computation.localsplicedist
-      --totallength=$computation.totallength
-      --trimendexons=$computation.trimendexons
-      --direction=$computation.direction
-      --canonical-mode=$computation.canonical
-      --prunelevel=$computation.prunelevel
-      --allow-close-indels=$computation.allow_close_indels
-      --microexon-spliceprob=$computation.microexon_spliceprob
-      #if int($computation.chimera_margin) >= 0:
-        --chimera-margin=$computation.chimera_margin
-      #end if
-    #end if
-    #if $advanced.options == "used":
-      #if int($advanced.npaths) >= 0:
-        --npaths=$advanced.npaths
-      #end if
-      #if int($advanced.chimera_overlap) > 0:
-        --chimera_overlap=$advanced.chimera_overlap
-      #end if
-      $advanced.protein
-      $advanced.tolerant
-      $advanced.nolengths
-      $advanced.invertmode
-      #if int($advanced.introngap) > 0:
-        --introngap=$advanced.introngap
-      #end if
-      #if int($advanced.wraplength) > 0:
-        --wraplength=$advanced.wraplength
-      #end if
-    #end if
-    #if $split_output == True
-      $split_output
-    #end if
-    #if len($quality_protocol.__str__) > 0:
-      --quality-protocol=$quality_protocol
-    #end if
-    $input
-    #for $i in $inputs:
-      ${i.added_input}
-    #end for
-    #if $split_output == True
-      2> $gmap_stderr 
-    #else
-      2> $gmap_stderr > $output
-    #end if
-  </command>
-  <inputs>
-    <!-- Input data -->
-    <param name="input" type="data" format="fasta,fastqsanger,fastqillumina" label="&lt;H2&gt;Input Sequences&lt;/H2&gt;Select an mRNA or EST dataset to map" />
-    <repeat name="inputs" title="addtional mRNA or EST dataset to map">
-      <param name="added_input" type="data" format="fasta,fastqsanger,fastqillumina" label=""/>
-    </repeat>
-    <param name="quality_protocol" type="select" label="Protocol for input quality scores">
-      <option value="">No quality scores</option>
-      <option value="sanger">Sanger quality scores</option>
-      <option value="illumina">Illumina quality scores</option>
-    </param>
-
-    <!-- GMAPDB for mapping -->
-    <conditional name="refGenomeSource">
-     <param name="genomeSource" type="select" label="&lt;HR&gt;&lt;H2&gt;Map To&lt;/H2&gt;Will you map to a reference genome from your history or use a built-in index?" help="Built-ins were indexed using default options">
-        <option value="indexed">Use a built-in index</option>
-        <option value="gmapdb">Use gmapdb from the history</option>
-        <option value="history">Use a fasta reference sequence from the history</option>
-      </param>
-      <when value="indexed">
-        <param name="gmapindex" type="select" label="Select a reference genome" help="if your genome of interest is not listed - contact Galaxy team">
-          <options from_file="gmap_indices.loc">
-            <column name="uid" index="0" />
-            <column name="dbkey" index="1" />
-            <column name="name" index="2" />
-            <column name="kmers" index="3" />
-            <column name="maps" index="4" />
-            <column name="snps" index="5" />
-            <column name="value" index="6" />
-          </options>
-        </param>
-        <param name="kmer" type="select" data_ref="gmapindex" label="kmer size" help="Defaults to highest available kmer size">
-          <options from_file="gmap_indices.loc">
-            <column name="name" index="3"/>
-            <column name="value" index="3"/>
-            <filter type="param_value" ref="gmapindex" column="6"/>
-            <filter type="multiple_splitter" column="3" separator=","/>
-            <filter type="add_value" name="" value=""/>
-            <filter type="sort_by" column="3"/>
-          </options>
-        </param>
-        <param name="map" type="select" data_ref="gmapindex" label="Look for splicing involving known sites or known introns" help="">
-          <options from_file="gmap_indices.loc">
-            <column name="name" index="4"/>
-            <column name="value" index="4"/>
-            <filter type="param_value" ref="gmapindex" column="6"/>
-            <filter type="multiple_splitter" column="4" separator=","/>
-            <filter type="add_value" name="" value=""/>
-            <filter type="sort_by" column="4"/>
-          </options>
-        </param>
-      </when>
-      <when value="gmapdb">
-        <param name="gmapdb" type="data" format="gmapdb" metadata_name="dbkey" label="Select a gmapdb" 
-              help="A GMAP database built with GMAP Build"/>
-        <param name="kmer" type="select" data_ref="gmapdb" label="kmer size" help="Defaults to highest available kmer size">
-          <options>
-            <filter type="data_meta" ref="gmapdb" key="kmers" multiple="True" separator=","/>
-          </options>
-        </param>
-        <param name="map" type="select"  data_ref="gmapdb" label="Use map for splicing involving known sites or known introns" help="">
-          <options>
-            <filter type="data_meta" ref="gmapdb" key="maps" multiple="True"/>
-          </options>
-        </param>
-      </when>
-      <when value="history">
-        <param name="ownFile" type="data" format="fasta" metadata_name="dbkey" label="Select the reference genome" 
-              help="Fasta containing genomic DNA sequence"/>
-      </when>
-    </conditional>
-
-    
-    <!-- Computation options -->
-    <conditional name="computation">
-      <param name="options" type="select" label="&lt;HR&gt;Computational Settings" help="">
-        <option value="default">Use default settings</option>
-        <option value="advanced">Set Computation Options</option>
-      </param>
-      <when value="default"/>
-      <when value="advanced">
-       <param name="nosplicing" type="boolean" truevalue="--nosplicing" falsevalue="" checked="false" label="Turn off splicing" help="(useful for aligning genomic sequences onto a genome)"/>
-       <param name="min_intronlength" type="integer" value="9" label="Min length for one internal intron (default 9)." help="Below this size, a genomic gap will be considered a deletion rather than an intron." />	
-       <param name="intronlength" type="integer" value="1000000" label="Max length for one intron (default 1000000)" />	
-       <param name="localsplicedist" type="integer" value="200000" label="Max length for known splice sites at ends of sequence (default 200000)" />	
-       <param name="totallength"  type="integer" value="2400000" label="Max total intron length (default 2400000)" />	
-       <param name="chimera_margin" type="integer" value="40" label="Amount of unaligned sequence that triggers search for a chimera (default is 40, 0 is off)" />	
-       <param name="direction"  type="select" label="cDNA direction">	
-         <option value="auto">auto</option>
-         <option value="sense_force">sense_force</option>
-         <option value="antisense_force">antisense_force</option>
-         <option value="sense_filter">sense_filter</option>
-         <option value="antisense_filter">antisense_filter</option>
-       </param>
-       <param name="trimendexons"  type="integer" value="12" label="Trim end exons with fewer than given number of matches (in nt, default 12)" />	
-       <param name="cross_species" type="boolean" truevalue="--cross-species" falsevalue="" checked="false" label="Cross-species alignment" help="For cross-species alignments, use a more sensitive search for canonical splicing"/>
-       
-       <param name="canonical"  type="select" label="Reward for canonical and semi-canonical introns">	
-         <option value="1">high reward (default)</option>
-         <option value="0">low reward</option>
-         <option value="2">low reward for high-identity sequences</option>
-       </param>
-       <param name="allow_close_indels"  type="select" label="Allow an insertion and deletion close to each other">	
-         <option value="1" selected="true">yes (default)</option>
-         <option value="0">no</option>
-         <option value="2">only for high-quality alignments</option>
-       </param>
-       <param name="microexon_spliceprob" type="float" value="0.90" label="Allow microexons only if one of the splice site probabilities is greater than this value (default 0.90)" >	
-         <validator type="in_range" message="slice probability between 0.00 and 1.00" min="0" max="1"/> 
-       </param>
-       <param name="prunelevel"  type="select" label="Pruning level">	
-         <option value="0">no pruning (default)</option>
-         <option value="1">poor sequences</option>
-         <option value="2">repetitive sequences</option>
-         <option value="3">poor and repetitive sequences</option>
-       </param>
-       <!--  could do this as a config file 
-       <param name="chrsubsetfile" type="data" format="fasta" label="User-supplied chromosome subset file" />
-       <param name="chrsubset" type="text" label="Chromosome subset to search" />
-       -->
-      </when>
-    </conditional>
-
-    <!-- Advanced Settings -->
-    <conditional name="advanced">
-      <param name="options" type="select" label="&lt;HR&gt;Advanced Settings" help="">
-        <option value="default">Use default settings</option>
-        <option value="used">Set Options</option>
-      </param>
-      <when value="default"/>
-      <when value="used">
-       <param name="nolengths" type="boolean" checked="false" truevalue="--nolengths=true" falsevalue="" label="No intron lengths in alignment"/>
-       <param name="invertmode" type="select" label=" Mode for alignments to genomic (-) strand" help="">
-        <option value="">Don't invert the cDNA (default)</option>
-        <option value="--invertmode=1">Invert cDNA and print genomic (-) strand</option>
-        <option value="--invertmode=2">Invert cDNA and print genomic (+) strand</option>
-       </param>
-       <param name="introngap" type="integer" value="3" label="Nucleotides to show on each end of intron (default=3)" />	
-       <param name="wraplength" type="integer" value="50" label="Line Wrap length for alignment (default=50)" />	
-       <param name="npaths" type="integer" value="-1" optional="true"
-              label="Maximum number of paths to show.  Ignored if negative.  If 0, prints two paths if chimera detected, else one." />	
-       <param name="chimera_overlap" type="integer" value="0" label="Overlap to show, if any, at chimera breakpoint" />	
-       <param name="tolerant" type="boolean" checked="false" truevalue="--tolerant=true" falsevalue="" 
-              label="Translates cDNA with corrections for frameshifts"/>
-       <param name="protein" type="select" label="Protein alignment" help="">
-        <option value="">default</option>
-        <option value="--fulllength=true">Assume full-length protein, starting with Met</option>
-        <option value="--truncate=true">Truncate alignment around full-length protein, Met to Stop</option>
-       </param>
-      </when>
-    </conditional>
-
-    <!-- Output data -->
-    <conditional name="result">
-    <param name="format" type="select" label="&lt;HR&gt;&lt;H2&gt;Output&lt;/H2&gt;Select the output format" help="">
-      <option value="gmap">GMAP default output</option>
-      <option value="summary">Summary of alignments</option>
-      <option value="align">Alignment</option>
-      <option value="continuous">Alignment in three continuous lines</option>
-      <option value="continuous-by-exon">Alignment in three lines per exon</option>
-      <option value="compress">Print output in compressed format</option>
-      <option value="exons_dna">Print exons cDNA</option>
-      <option value="exons_gen">Print exons genomic</option>
-      <option value="protein_dna">Print protein sequence (cDNA)</option>
-      <option value="protein_gen">Print protein sequence (genomic)</option>
-      <option value="psl">PSL (BLAT) format</option>
-      <option value="gff3_gene">GFF3 gene format</option>
-      <option value="gff3_match_cdna">GFF3 match cDNA format</option>
-      <option value="gff3_match_est">GFF3 match EST format</option>
-      <option value="splicesites">splicesites output (for GSNAP)</option>
-      <option value="introns">introns output (for GSNAP)</option>
-      <option value="map_exons">IIT FASTA exon map format</option>
-      <option value="map_genes">IIT FASTA map format</option>
-      <option value="coords">coords in table format</option>
-      <option value="sam" selected="true">SAM format</option>
-    </param>
-      <when value="gmap"/>
-      <when value="summary"/>
-      <when value="align">
-
-      </when>
-      <when value="continuous">
-      </when>
-      <when value="continuous-by-exon">
-      </when>
-      <when value="compress"/>
-      <when value="exons_dna"/>
-      <when value="exons_gen"/>
-      <when value="protein_dna"/>
-      <when value="protein_gen"/>
-      <when value="psl"/>
-      <when value="gff3_gene"/>
-      <when value="gff3_match_cdna"/>
-      <when value="gff3_match_est"/>
-      <when value="splicesites"/>
-      <when value="introns"/>
-      <when value="map_exons"/>
-      <when value="map_genes"/>
-      <when value="coords"/>
-      <when value="sam">
-        <param name="sam_paired_read" type="boolean" truevalue="sampe" falsevalue="samse" checked="false" label="SAM paired reads"/>
-        <param name="no_sam_headers" type="boolean" truevalue="--no-sam-headers" falsevalue="" checked="false" label="Do not print headers beginning with '@'"/>
-        <param name="noncanonical_splices" type="select" label="Print non-canonical genomic gaps greater than 20 nt in CIGAR string as STRING.">
-          <option value="">Use default</option>
-          <option value="N">N</option>
-          <option value="D">D</option>
-        </param>
-        <param name="read_group_id" type="text" value="" label="Value to put into read-group id (RG-ID) field"/>
-        <param name="read_group_name" type="text" value="" label="Value to put into read-group name (RG-SM) field"/>
-        <param name="read_group_library" type="text" value="" label="Value to put into read-group library (RG-LB) field"/>
-        <param name="read_group_platform" type="text" value="" label="Value to put into read-group library platform (RG-PL) field"/>
-      </when>
-    </conditional> <!-- name="result" -->
-
-    <param name="split_output" type="boolean" truevalue="--split-output=gmap_out" falsevalue="" checked="false" label="Separate outputs for nomapping, uniq, mult, and chimera" help="(chimera only when chimera-margin is selected)"/>
-
-
-    <!-- 
-      map=iitfile      Map file.  If argument is '?' (with the quotes), this lists available map files.
-      mapexons         Map each exon separately
-      mapboth          Report hits from both strands of genome
-      flanking=INT     Show flanking hits (default 0)
-      print-comment    Show comment line for each hit
-    -->
-
-
-  </inputs>
-  <outputs>
-    <data format="txt" name="gmap_stderr" label="${tool.name} on ${on_string}: stderr"/>
-    <data format="txt" name="output" label="${tool.name} on ${on_string} ${result.format}" >
-      <filter>(split_output == False)</filter>
-      <change_format>
-        <when input="result['format']" value="gff3_gene" format="gff3"/>
-        <when input="result['format']" value="gff3_match_cdna" format="gff3"/>
-        <when input="result['format']" value="gff3_match_est" format="gff3"/>
-        <when input="result['format']" value="sam" format="sam"/>
-        <when input="result['format']" value="splicesites" format="gmap_splicesites"/>
-        <when input="result['format']" value="introns" format="gmap_introns"/>
-        <when input="result['format']" value="map_genes" format="gmap_annotation"/>
-        <when input="result['format']" value="map_exons" format="gmap_annotation"/>
-      </change_format>
-    </data>
-    <data format="txt" name="uniq" label="${tool.name} on ${on_string} uniq.${result.format}"  from_work_dir="gmap_out.uniq">
-      <filter>(split_output == True)</filter>
-      <change_format>
-        <when input="result['format']" value="gff3_gene" format="gff3"/>
-        <when input="result['format']" value="gff3_match_cdna" format="gff3"/>
-        <when input="result['format']" value="gff3_match_est" format="gff3"/>
-        <when input="result['format']" value="sam" format="sam"/>
-        <when input="result['format']" value="splicesites" format="gmap_splicesites"/>
-        <when input="result['format']" value="introns" format="gmap_introns"/>
-        <when input="result['format']" value="map_genes" format="gmap_annotation"/>
-        <when input="result['format']" value="map_exons" format="gmap_annotation"/>
-      </change_format>
-    </data>
-    <data format="txt" name="transloc" label="${tool.name} on ${on_string} transloc.${result.format}"  from_work_dir="gmap_out.transloc">
-      <filter>(split_output == True)</filter>
-      <change_format>
-        <when input="result['format']" value="gff3_gene" format="gff3"/>
-        <when input="result['format']" value="gff3_match_cdna" format="gff3"/>
-        <when input="result['format']" value="gff3_match_est" format="gff3"/>
-        <when input="result['format']" value="sam" format="sam"/>
-        <when input="result['format']" value="splicesites" format="gmap_splicesites"/>
-        <when input="result['format']" value="introns" format="gmap_introns"/>
-        <when input="result['format']" value="map_genes" format="gmap_annotation"/>
-        <when input="result['format']" value="map_exons" format="gmap_annotation"/>
-      </change_format>
-    </data>
-    <data format="txt" name="nomapping" label="${tool.name} on ${on_string} nomapping.${result.format}"  from_work_dir="gmap_out.nomapping">
-      <filter>(split_output == True)</filter>
-      <change_format>
-        <when input="result['format']" value="gff3_gene" format="gff3"/>
-        <when input="result['format']" value="gff3_match_cdna" format="gff3"/>
-        <when input="result['format']" value="gff3_match_est" format="gff3"/>
-        <when input="result['format']" value="sam" format="sam"/>
-        <when input="result['format']" value="splicesites" format="gmap_splicesites"/>
-        <when input="result['format']" value="introns" format="gmap_introns"/>
-        <when input="result['format']" value="map_genes" format="gmap_annotation"/>
-        <when input="result['format']" value="map_exons" format="gmap_annotation"/>
-      </change_format>
-    </data>
-    <data format="txt" name="mult" label="${tool.name} on ${on_string} mult.${result.format}"  from_work_dir="gmap_out.mult">
-      <filter>(split_output == True)</filter>
-      <change_format>
-        <when input="result['format']" value="gff3_gene" format="gff3"/>
-        <when input="result['format']" value="gff3_match_cdna" format="gff3"/>
-        <when input="result['format']" value="gff3_match_est" format="gff3"/>
-        <when input="result['format']" value="sam" format="sam"/>
-        <when input="result['format']" value="splicesites" format="gmap_splicesites"/>
-        <when input="result['format']" value="introns" format="gmap_introns"/>
-        <when input="result['format']" value="map_genes" format="gmap_annotation"/>
-        <when input="result['format']" value="map_exons" format="gmap_annotation"/>
-      </change_format>
-    </data>
-  </outputs>
-  <tests>
-  </tests> 
-
-  <help>
-
-**What it does**
-
-GMAP_ (Genomic Mapping and Alignment Program)  The functionality provided by gmap allows a user to: (1) map and align a single cDNA interactively against a large genome in about a second, without the startup time of several minutes typically needed by existing mapping programs; (2) switch arbitrarily among different genomes, without the need for a preloaded server dedicated to each genome; (3) run the program on computers with as little as 128 MB of RAM (random access memory); (4) perform high-throughput batch processing of cDNAs by using memory mapping and multithreading when appropriate memory and hardware are available; (5) generate accurate gene models, even in the presence of substantial polymorphisms and sequence errors; (6) locate splice sites accurately without the use of probabilistic splice site models, allowing generalized use of the program across species; (7) detect statistically significant microexons and incorporate them into the alignment; and (8) handle mapping and alignment tasks on genomes having alternate assemblies, linkage groups or strains.  It is developed by Thomas D. Wu of Genentech, Inc.  
-
-Publication_ citation: Thomas D. Wu, Colin K. Watanabe  Bioinformatics 2005 21(9):1859-1875; doi:10.1093/bioinformatics/bti310
-
-.. _GMAP: http://research-pub.gene.com/gmap/
-.. _Publication: http://bioinformatics.oxfordjournals.org/cgi/content/full/21/9/1859
-
-------
-
-**Know what you are doing**
-
-.. class:: warningmark
-
-You will want to read the README_
-
-.. _README: http://research-pub.gene.com/gmap/src/README
-
-  </help>
-</tool>
-
--- a/gmap/gmap_build.xml	Tue Nov 08 13:22:34 2011 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,177 +0,0 @@
-<tool id="gmap_build" name="GMAP Build" version="2.0.0">
-  <description>a database genome index for GMAP and GSNAP</description>
-  <requirements>
-      <requirement type="binary">gmap_build</requirement>
-      <!-- proposed tag for added datatype dependencies -->
-      <requirement type="datatype">gmapdb</requirement>
-      <requirement type="datatype">gmap_snps</requirement>
-  </requirements>
-  <version_string>gmap --version</version_string>
-  <command interpreter="command"> /bin/bash $shscript 2>1 1> $output </command>
-  <inputs>
-    <!-- Name for this gmapdb -->
-    <param name="refname" type="text" label="Name you want to give this gmap database" help="">
-      <validator type="empty_field" message="A database name is required."/>
-    </param>
-    <!-- Input data -->
-    <repeat name="inputs" title="Reference Sequence" min="1">
-      <param name="input" type="data" format="fasta" label="reference sequence fasta" />
-    </repeat>
-
-    <param name="kmer" type="select" multiple="true" force_select="true" label="kmer size" help="">
-      <option value="12">12</option>
-      <option value="13">13</option>
-      <option value="14">14</option>
-      <option value="15" selected="true">15</option>
-    </param>  
-    <param name="cmetindex" type="boolean" checked="true" truevalue="yes" falsevalue="no" label="Create cmetindex to process reads from bisulfite-treated DNA"/>
-    <param name="atoiindex" type="boolean" checked="true" truevalue="yes" falsevalue="no" label="Create atoiindex to process reads under RNA-editing tolerance"/>
-    <conditional name="splicesite">
-      <param name="splice_source" type="select" label="Add splice and intron info from" >
-        <option value="none"></option>
-        <option value="refGeneTable">refGenes table from UCSC table browser</option>
-        <option value="gtf">GTF</option>
-        <option value="gff3">GFF3</option>
-      </param>
-      <when value="none"/>
-      <when value="refGeneTable">
-        <param name="refGenes" type="data" format="tabular" optional="true" label="UCSC refGenes table" help="Example: ftp://hgdownload.cse.ucsc.edu/goldenPath/hg18/database/refGene.txt.gz" />
-        <param name="col_skip" type="integer" value="1" label="Columns to skip before the id/name column (default 1)" 
-               help="Note that alignment tracks in UCSC sometimes have an extra column on the left.">
-          <validator type="in_range" message="The number of colmumns to skip must >= 0." min="0."/>
-        </param>
- 
-      </when>
-      <when value="gtf">
-        <param name="gtfGenes" type="data" format="gtf" optional="true" label="Genes as GTF" help="" />
-      </when>
-      <when value="gff3">
-        <param name="gff3Genes" type="data" format="gff3" optional="true" label="Genes in GFF3 format" help="" />
-      </when>
-    </conditional> 
-    <conditional name="dbsnp">
-      <param name="snp_source" type="select" label="Add SNP info from" >
-        <option value="none"></option>
-        <option value="snpTable">UCSC SNP Table</option>
-        <option value="snpFile">GMAP SNP File</option>
-      </param>
-      <when value="none"/>
-      <when value="snpTable">
-        <param name="snps" type="data" format="tabular" optional="true" label="UCSC SNPs table" help="Example: ftp://hgdownload.cse.ucsc.edu/goldenPath/hg18/database/snp130.txt.gz" />
-        <param name="snpsex" type="data" format="tabular" optional="true" label="UCSC SNP Exceptions table" help="Example: ftp://hgdownload.cse.ucsc.edu/goldenPath/hg18/database/snp130Exceptions.txt.gz" />
-        <param name="weight" type="select" label="Include SNPs with at least Confidence Level" help="">
-          <option value="1" selected="true">1 (High)</option>
-          <option value="2">2 (Medium)</option>
-          <option value="3">3 (All)</option>
-        </param>
-      </when>
-      <when value="snpFile">
-        <param name="snps" type="data" format="gmap_snps" optional="true" label="GMAP SNPs file" 
-           help="Format (3 columns):
-                &lt;br&gt;>rs62211261 21:14379270 CG
-                &lt;br&gt;>rs62211262 21:14379281 CG
-                &lt;br&gt;Each line must start with a &gt; character, then be followed by an
-                identifier (which may have duplicates).  Then there should be the
-                chromosomal coordinate of the SNP.  (Coordinates are all 1-based, so
-                the first character of a chromosome is number 1.)  Finally, there
-                should be the two possible alleles: ( AC AG AT CG CT GT or AN CN GN TN)
-                &lt;br&gt;These alleles must correspond to the possible nucleotides on the plus strand of the genome.  
-                If the one of these two letters does not match the allele in the reference
-                sequence, that SNP will be ignored in subsequent processing as a probable error.
-                The N stands for any other allele." />
-      </when>
-    </conditional> 
-  </inputs>
-  <outputs>
-    <!--
-    <data format="txt" name="log" label="${tool.name} on ${on_string}: log"/>
-    -->
-    <data format="gmapdb" name="output" label="${tool.name} on ${on_string} gmapdb ${refname}" />
-  </outputs>
-  <configfiles>
-    <configfile name="shscript">
-#!/bin/bash
-#set $ds = chr(36)
-#set $gt = chr(62)
-#set $lt = chr(60)
-#set $ad = chr(38)
-## #set $ref_files = ''
-## #for $i in $inputs:
-  ## #set $ref_files = $ref_files $i.input
-## #end for
-## echo $ref_files
-#import os.path
-#set $gmapdb = $output.extra_files_path
-#set $mapsdir = $os.path.join($os.path.join($gmapdb,str($refname)), str($refname) + '.maps')
-mkdir -p $gmapdb
-## export GMAPDB required for cmetindex  and atoiindex
-export GMAPDB=$gmapdb
-#for $k in $kmer.__str__.split(','):
-gmap_build -D $gmapdb -d $refname -s numeric-alpha -k $k #for i in $inputs# ${i.input}#end for#
-#end for
-get-genome -D $gmapdb -d '?' | sed 's/^Available .*/gmap db: /' 
-echo "kmers: " $kmer 
-#if $splicesite.splice_source == 'refGeneTable':
-#if $splicesite.refGenes.__str__ != 'None':
-cat $splicesite.refGenes | psl_splicesites -s $splicesite.col_skip | iit_store -o  $os.path.join($mapsdir,'splicesites')
-cat $splicesite.refGenes | psl_introns -s $splicesite.col_skip | iit_store -o  $os.path.join($mapsdir,'introns')
-#end if
-#elif $splicesite.splice_source == 'gtf':
-#if $splicesite.gtfGenes.__str__ != 'None':
-cat $splicesite.gtfGenes | gtf_splicesites | iit_store -o  $os.path.join($mapsdir,'splicesites')
-cat $splicesite.gtfGenes | gtf_introns | iit_store -o  $os.path.join($mapsdir,'introns')
-#end if
-#elif $splicesite.splice_source == 'gff3':
-#if $splicesite.gff3Genes.__str__ != 'None':
-cat $splicesite.gff3Genes | gff3_splicesites | iit_store -o  $os.path.join($mapsdir,'splicesites')
-cat $splicesite.gff3Genes | gff3_introns | iit_store -o  $os.path.join($mapsdir,'introns')
-#end if
-#end if
-#if $dbsnp.snp_source != 'none' and $dbsnp.snps.__str__ != 'None':
-#if $dbsnp.snp_source == 'snpTable':
-#if $dbsnp.snpsex.__str__ != 'None':
-cat $dbsnp.snps | dbsnp_iit -w $dbsnp.weight -e $dbsnp.snpsex | iit_store -o  $os.path.join($mapsdir,'snps')
-#else:
-cat $dbsnp.snps | dbsnp_iit -w $dbsnp.weight | iit_store -o  $os.path.join($mapsdir,'snps')
-#end if
-#else:
-cat $dbsnp.snps | iit_store -o  $os.path.join($mapsdir,'snps')
-#end if
-snpindex -d $refname -v snps
-echo "snpindex" -d  $refname -v snps
-#end if
-#if $cmetindex.__str__ == 'yes':
-cmetindex -d $refname
-echo "cmetindex" -d $refname
-#end if
-#if $atoiindex.__str__ == 'yes':
-atoiindex -d $refname
-echo "atoiindex" -d $refname
-#end if
-get-genome -D $gmapdb -d $refname -m '?' | sed 's/^Available maps .*/maps: /' 
-    </configfile>
-  </configfiles>
-
-  <tests>
-  </tests> 
-
-  <help>
-
-
-**GMAP Build**
-
-GMAP Build creates an index of a genomic sequence for mapping and alignment using GMAP_ (Genomic Mapping and Alignment Program for mRNA and EST sequences) and GSNAP_ (Genomic Short-read Nucleotide Alignment Program).  (GMAP Build uses GMSP commands: gmap_build, iit_store, psl_splicesites, psl_introns, gtf_splicesites, gtf_introns, gff3_splicesites, gff3_introns, dbsnp_iit, snpindex, cmetindex, and atoiindex.)
-
-You will want to read the README_
-
-Publication_ citation: Thomas D. Wu, Colin K. Watanabe  Bioinformatics 2005 21(9):1859-1875; doi:10.1093/bioinformatics/bti310
-
-.. _GMAP: http://research-pub.gene.com/gmap/
-.. _GSNAP: http://research-pub.gene.com/gmap/
-.. _README: http://research-pub.gene.com/gmap/src/README
-.. _Publication: http://bioinformatics.oxfordjournals.org/cgi/content/full/21/9/1859
-
-
-  </help>
-</tool>
-
--- a/gmap/gsnap.xml	Tue Nov 08 13:22:34 2011 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,834 +0,0 @@
-<tool id="gsnap" name="GSNAP" version="2.0.0">
-  <description>Genomic Short-read Nucleotide Alignment Program</description>
-  <requirements>
-      <requirement type="binary">gsnap</requirement>
-      <!-- proposed tag for added datatype dependencies -->
-      <requirement type="datatype">gmapdb</requirement>
-      <requirement type="datatype">gmapsnpindex</requirement>
-      <requirement type="datatype">splicesites.iit</requirement>
-      <requirement type="datatype">introns.iit</requirement>
-  </requirements>
-  <version_string>gsnap --version</version_string>
-  <command>
-    #import os.path, re
-    gsnap
-    --nthreads="4" --ordered
-    #if $refGenomeSource.genomeSource == "gmapdb":
-      #set $gmapdb = $os.listdir($refGenomeSource.gmapdb.extra_files_path)[0]
-      --dir=$refGenomeSource.gmapdb.extra_files_path --db=$refGenomeSource.gmapdb.metadata.db_name
-    #else:
-      --dir=$os.path.dirname($refGenomeSource.gmapindex.value) --db=$os.path.basename($refGenomeSource.gmapindex.value)
-    #end if
-    #if $refGenomeSource.kmer != None and len($refGenomeSource.kmer.__str__) == 2:
-      --kmer=$refGenomeSource.kmer
-    #end if
-    #if $refGenomeSource.use_splicing.src == 'gmapdb':
-      #if $refGenomeSource.use_splicing.splicemap != None and len($refGenomeSource.use_splicing.splicemap.__str__) > 0:
-        -s $refGenomeSource.use_splicing.splicemap.value
-      #end if
-    #elif $refGenomeSource.use_splicing.src == 'history':
-      #if $refGenomeSource.use_splicing.splicemap != None and len($refGenomeSource.use_splicing.splicemap.__str__) > 0:
-        -S $os.path.dirname($refGenomeSource.use_splicing.splicemap) -s $os.path.basename($refGenomeSource.use_splicing.splicemap)
-      #end if
-    #end if
-    #if $refGenomeSource.use_snps.src == 'gmapdb':
-       #if $refGenomeSource.use_snps.snpindex != None and len($refGenomeSource.use_snps.snpindex.__str__) > 0:
-        -v $refGenomeSource.use_snps.snpindex.value
-       #end if
-    #elif $refGenomeSource.use_snps.src == 'history':
-       #if $refGenomeSource.use_snps.snpindex != None and len($refGenomeSource.use_snps.snpindex.__str__) > 0:
-         -V $refGenomeSource.use_snps.snpindex.extra_files_path -v $refGenomeSource.use_snps.snpindex.metadata.snps_name
-       #end if
-    #end if
-    #if $refGenomeSource.mode.__str__ != '':
-      --mode=$refGenomeSource.mode
-    #end if
-    #if $mapq_unique_score.__str__ != '':
-      --mapq-unique-score=$mapq_unique_score
-    #end if
-    #if $computation.options == "advanced":
-      #if $computation.max_mismatches.__str__ != '':
-        --max-mismatches=$computation.max_mismatches
-      #end if
-      $computation.query_unk_mismatch
-      $computation.genome_unk_mismatch
-      #if $computation.terminal_threshold.__str__ != '':
-        --terminal-threshold=$computation.terminal_threshold
-      #end if
-      #if $computation.indel_penalty.__str__ != '':
-        --indel-penalty=$computation.indel_penalty
-      #end if
-      #if $computation.indel_endlength.__str__ != '':
-        --indel-endlength=$computation.indel_endlength
-      #end if
-      #if $computation.max_middle_insertions.__str__ != '':
-        --max-middle-insertions=$computation.max_middle_insertions
-      #end if
-      #if $computation.max_middle_deletions.__str__ != '':
-        --max-middle-deletions=$computation.max_middle_deletions
-      #end if
-      #if $computation.max_end_insertions.__str__ != '':
-        --max-end-insertions=$computation.max_end_insertions
-      #end if
-      #if $computation.max_end_deletions.__str__ != '':
-        --max-end-deletions=$computation.max_end_deletions
-      #end if
-      #if $computation.suboptimal_levels.__str__ != '':
-        --suboptimal-levels=$computation.suboptimal_levels
-      #end if
-      #if $computation.adapter_strip.__str__ != '':
-        --adapter-strip=$computation.adapter_strip
-      #end if
-      #if $computation.trim_mismatch_score.__str__ != '':
-        --trim-mismatch-score=$computation.trim_mismatch_score
-      #end if
-      ## TODO - do we need these options (Is it tally XOR runlength?):
-      ## --tallydir=  --use-tally=tally
-      ## --runlengthdir  --use-runlength=runlength
-      #if $computation.use_tally != None and len($computation.use_tally.__str__) > 0:
-        ##--tallydir $os.path.dirname($computation.use_tally) --use-tally $os.path.basename($computation.use_tally)
-        --use-tally=$computation.use_tally
-      #end if
-      ## gmap options
-      #if $computation.gmap_mode.__str__ != '' and  $computation.gmap_mode.__str__ != 'None':
-        --gmap-mode='$computation.gmap_mode'
-      #end if
-      #if $computation.trigger_score_for_gmap.__str__ != '':
-        --trigger-score-for-gmap=$computation.trigger_score_for_gmap
-      #end if
-      #if $computation.max_gmap_pairsearch.__str__ != '' and $re.search("pairsearch",$computation.gmap_mode):
-        --max-gmap-pairsearch=$computation.max_gmap_pairsearch
-      #end if
-      #if $computation.max_gmap_terminal.__str__ != '' and $re.search("terminal",$computation.gmap_mode):
-        --max-gmap-terminal=$computation.max_gmap_terminal
-      #end if
-      #if $computation.max_gmap_improvement.__str__ != '' and $re.search("improv",$computation.gmap_mode):
-        --max-gmap-improvement=$computation.max_gmap_improvement
-      #end if
-      #if $computation.microexon_spliceprob.__str__ != '':
-        --microexon-spliceprob=$computation.microexon_spliceprob
-      #end if
-    #end if
-    #if $splicing.options == "advanced":
-      $splicing.novelsplicing
-      #if $splicing.localsplicedist.__str__ != '':
-        --localsplicedist=$splicing.localsplicedist
-      #end if
-      #if $splicing.local_splice_penalty.__str__ != '':
-        --local-splice-penalty=$splicing.local_splice_penalty
-      #end if
-      #if $splicing.distant_splice_penalty.__str__ != '':
-        --distant-splice-penalty=$splicing.distant_splice_penalty
-      #end if
-      #if $splicing.local_splice_endlength.__str__ != '':
-        --local-splice-endlength=$splicing.local_splice_endlength
-      #end if
-      #if $splicing.distant_splice_endlength.__str__ != '':
-        --distant-splice-endlength=$splicing.distant_splice_endlength
-      #end if
-      #if $splicing.distant_splice_identity.__str__ != '':
-        --distant-splice-identity=$splicing.distant_splice_identity
-      #end if
-    #end if
-    #if $output.options == "advanced":
-      #if $output.npath.__str__ != '':
-        --npath=$output.npath
-      #end if
-      $output.quiet_if_excessive
-      $output.show_refdiff
-      $output.clip_overlap
-    #end if
-    #if $result.format == "sam":
-      --format=sam
-      $result.no_sam_headers
-      #if $result.read_group_id.__str__.strip != '':
-         --read-group-id='$result.read_group_id'
-      #end if
-      #if $result.read_group_name.__str__ != '':
-         --read-group-name='$result.read_group_name'
-      #end if
-      #if $result.read_group_library.__str__ != '':
-         --read-group-library='$result.read_group_library'
-      #end if
-      #if $result.read_group_platform.__str__ != '':
-         --read-group-platform='$result.read_group_platform'
-      #end if
-      #if $result.quality_shift.__str__ != '':
-        --quality-shift=$result.quality_shift
-      #end if
-    #elif $result.format == "goby":
-      #if $result.goby_output.__str__ != '':
-        --goby-output='$result.goby_output'
-      #end if
-      #if $result.creads_window_start.__str__ != '':
-        --creads-window-start=$result.creads_window_start
-      #end if
-      #if $result.creads_window_end.__str__ != '':
-        --creads-window-end=$result.creads_window_end
-      #end if
-      $result.creads_complement
-    #end if
-    #if $results.split_output == 'yes':
-      --split-output=gsnap_out
-      #if $results.fails.choice == 'nofails':
-        --nofails
-      #elif $results.fails.choice == 'failsonly':
-        --failsonly
-      #end if
-      $results.fails_as_input
-    #else
-      #if $results.fails.choice == 'nofails':
-        --nofails
-      #elif $results.fails.choice == 'failsonly':
-        --failsonly
-        $results.fails.fails_as_input
-      #end if
-    #end if
-    #if $seq.format == "gsnap_fasta":
-      $seq.circularinput $seq.gsnap
-    #else if $seq.format == "fastq":
-      #if $seq.barcode_length.__str__ != '':
-        --barcode-length=$seq.barcode_length
-      #end if
-      #if $seq.fastq_id_start.__str__ != '':
-        --fastq-id-start=$seq.fastq_id_start
-      #end if
-      #if $seq.fastq_id_end.__str__ != '':
-        --fastq-id-end=$seq.fastq_id_end
-      #end if
-      #if $seq.filter_chastity.__str__ != 'off':
-        --filter-chastity=$seq.filter_chastity
-      #end if
-      #if $seq.paired.ispaired.__str__ == 'yes':
-        #if $seq.paired.pairmax_dna.__str__ != '':
-          --pairmax-dna=$seq.paired.pairmax_dna
-        #end if
-        #if $seq.paired.pairmax_rna.__str__ != '':
-          --pairmax-rna=$seq.paired.pairmax_rna
-        #end if
-        $seq.fastq $seq.paired.fastq
-      #else
-        $seq.fastq
-      #end if
-    #end if
-    #if $results.split_output == 'yes':
-      2> $gsnap_stderr
-    #else:
-      #if $results.fails.choice.__str__ == 'failsonly' and $results.fails.fails_as_input.__str__ != '':
-        2> $gsnap_stderr > $gsnap_fq
-      #else
-        2> $gsnap_stderr > $gsnap_out
-      #end if
-    #end if
-
-  </command>
-  <inputs>
-    <!-- Input data -->
-    <conditional name="seq">
-      <param name="format" type="select" label="&lt;H2&gt;Input Sequences&lt;/H2&gt;Select the input format" help="">
-        <option value="fastq">Fastq</option>
-        <!--
-        <option value="goby">Goby compact-reads</option>
-        -->
-        <option value="gsnap_fasta">GNSAP fasta</option>
-      </param>
-      <when value="fastq">
-        <param name="fastq" type="data" format="fastq" label="Select a fastq dataset" />
-        <conditional name="paired">
-          <param name="ispaired" type="boolean" truevalue="yes" falsevalue="no" checked="false" label="Use Paired Reads?"/>
-          <when value="no"/>
-          <when value="yes">
-            <param name="fastq" type="data" format="fastq" label="Select the paired reads reverse dataset" />
-            <param name="orientation" type="select" label="Orientation of paired-end reads" help="">
-              <option value="FR">fwd-rev, typical Illumina default</option>
-              <option value="RF">rev-fwd, for circularized inserts</option>
-              <option value="FF">fwd-fwd, same strand</option>
-            </param>
-            <param name="pairmax_dna"  type="integer" value="" optional="true" label="Max total genomic length for DNA-Seq paired reads, or other reads without splicing (default 1000)." help="Used if no splice file is provided and novelsplicing is off."/>
-            <param name="pairmax_rna"  type="integer" value="" optional="true" label="Max total genomic length for RNA-Seq paired reads, or other reads that could have a splice (default 200000)." help="Used novelspliceing is specified or a splice file is provided.  Should probably match the value for localsplicedist."/>
-          </when>
-        </conditional>
-        <param name="barcode_length" type="integer" value="" optional="true"  label="Amount of barcode to remove from start of read (default 0)" />
-        <param name="fastq_id_start" type="integer" value="" optional="true"  label="Starting field  of identifier in FASTQ header, whitespace-delimited, starting from 1" />
-        <param name="fastq_id_end" type="integer" value="" optional="true"  label="Ending field  of identifier in FASTQ header, whitespace-delimited, starting from 1" 
-             help="Examples:
-                  &lt;br&gt;@HWUSI-EAS100R:6:73:941:1973#0/1
-                  &lt;br&gt; . start=1, end=1 (default)  => identifier is HWUSI-EAS100R:6:73:941:1973#0/1
-                  &lt;br&gt;@SRR001666.1 071112_SLXA-EAS1_s_7:5:1:817:345 length=36
-                  &lt;br&gt; . start=1, end=1  => identifier is SRR001666.1
-                  &lt;br&gt; . start=2, end=2  => identifier is 071112_SLXA-EAS1_s_7:5:1:817:345
-                  &lt;br&gt; . start=1, end=2  => identifier is SRR001666.1 071112_SLXA-EAS1_s_7:5:1:817:345"
-        />
-        <param name="filter_chastity" type="select" label="Skip reads marked by the Illumina chastity program" 
-               help="String after the accession having a  'Y'  after the first colon, like this:  
-                    &lt;br&gt;@accession 1:Y:0:CTTGTA
-                    &lt;br&gt;where the  'Y'  signifies filtering by chastity.
-                    &lt;br&gt; For 'either', a  'Y'  on either end of a paired-end read will be filtered.
-                    &lt;br&gt;  For 'both', a  'Y'  is required on both ends of a paired-end read (or on the only end of a single-end read)"
-          >
-          <option value="off">off - no filtering</option>
-          <option value="either">either - a 'Y' on either end of a paired-end read</option>
-          <option value="both">both - a 'Y' is required on both ends of a paired-end read or the only end of a single-end read</option>
-        </param>
-      </when>
-      <!--
-      <when value="goby">
-      </when>
-      -->
-      <when value="gsnap_fasta">
-        <param name="gsnap" type="data" format="fasta" label="Select a single-end dataset" help="GSNAP fasta must have the sequence entirely on one line, a second line is interpreted as the paired-end sequence"/>
-        <param name="circularinput" type="boolean" checked="false" truevalue="--circular-input=true" falsevalue="" label="Circular-end data (paired reads are on same strand)"/>
-      </when>
-      
-    </conditional>
-    <param name="mapq_unique_score"  type="integer" value="" optional="true" label="MAPQ score threshold" 
-                help="For multiple results, consider as a unique result if only one of the results has a MAPQ score equal or greater than this
-                      (if not selected, then reports all multiple results, up to npaths)" />
-
-    <!-- GMAPDB for alignment -->
-    <conditional name="refGenomeSource">
-     <param name="genomeSource" type="select" label="&lt;HR&gt;&lt;H2&gt;Align To&lt;/H2&gt;Will you select a reference genome from your history or use a built-in index?" help="Built-ins were indexed using default options">
-        <option value="indexed">Use a built-in index</option>
-        <option value="gmapdb">Use a gmapdb from your history</option>
-      </param>
-      <when value="indexed">
-        <param name="gmapindex" type="select" label="Select a reference genome" help="if your genome of interest is not listed - contact Galaxy team">
-          <options from_file="gmap_indices.loc">
-            <column name="uid" index="0" />
-            <column name="dbkey" index="1" />
-            <column name="name" index="2" />
-            <column name="kmers" index="3" />
-            <column name="maps" index="4" />
-            <column name="snps" index="5" />
-            <column name="value" index="6" />
-          </options>
-        </param>
-
-        <param name="kmer" type="select" data_ref="gmapindex" label="kmer size" help="Defaults to highest available kmer size">
-          <options from_file="gmap_indices.loc">
-            <column name="name" index="3"/>
-            <column name="value" index="3"/>
-            <filter type="param_value" ref="gmapindex" column="6"/>
-            <filter type="multiple_splitter" column="3" separator=","/>
-            <filter type="add_value" name="" value=""/>
-            <filter type="sort_by" column="3"/>
-          </options>
-        </param>
-
-        <param name="mode" type="select" label="Alignment mode" help="Assumes cmetindex and atoiindex were run on the gmap datatbase.">
-            <option value="">standard</option>
-            <option value="cmet-stranded">cmet-stranded   for bisulfite-treated DNA reads (tolerance to C-to-T changes)</option>
-            <option value="cmet-nonstranded">cmet-nonstranded   for bisulfite-treated DNA reads (tolerance to C-to-T changes)</option>
-            <option value="atoi-stranded">atoi-stranded   for RNA-editing tolerance (A-to-G changes)</option>
-            <option value="atoi-nonstranded">atoi-nonstranded   for RNA-editing tolerance (A-to-G changes)</option>
-        </param>
-
-        <conditional name="use_splicing">
-          <param name="src" type="select" label="&lt;HR&gt;Known Splicesite and Introns" 
-                 help="Look for splicing involving known sites or known introns at short or long distances 
-                  See README instructions for the distinction between known sites and known introns">
-            <option value="none" selected="true">None</option>
-            <option value="gmapdb">From the GMAP Database</option>
-            <option value="history">A Map in your history</option>
-          </param>
-          <when value="none"/>
-          <when value="history">
-            <param name="splicemap" type="data" format="splicesites.iit,introns.iit" metadata_name="dbkey" label="Select a splicesite map" 
-              help="built with GMAP IIT"/>
-          </when>
-          <when value="gmapdb">
-            <param name="splicemap" type="select" data_ref="gmapindex" label="Use map for splicing involving known sites or known introns" help="">
-              <options from_file="gmap_indices.loc">
-                <column name="name" index="4"/>
-                <column name="value" index="4"/>
-                <filter type="param_value" ref="gmapindex" column="6"/>
-                <filter type="multiple_splitter" column="4" separator=","/>
-                <filter type="add_value" name="" value=""/>
-                <filter type="sort_by" column="4"/>
-              </options>
-            </param>
-          </when>
-        </conditional>
-
-        <conditional name="use_snps">
-          <param name="src" type="select" label="&lt;HR&gt;Known SNPs" help="for SNP tolerant alignments">
-            <option value="none" selected="true">None</option>
-            <option value="gmapdb">From the GMAP Database</option>
-            <option value="history">A SNP Index in your history</option>
-          </param>
-          <when value="none"/>
-          <when value="history">
-            <param name="snpindex" type="data" format="gmapsnpindex" metadata_name="dbkey" label="Select a snpindex" 
-              help="built with GMAP SNP Index"/>
-          </when>
-          <when value="gmapdb">
-            <param name="snpindex" type="select" data_ref="gmapindex" label="Use database containing known SNPs" help="">
-              <options from_file="gmap_indices.loc">
-                <column name="name" index="5"/>
-                <column name="value" index="5"/>
-                <filter type="param_value" ref="gmapindex" column="6"/>
-                <filter type="multiple_splitter" column="5" separator=","/>
-                <filter type="add_value" name="" value=""/>
-                <filter type="sort_by" column="5"/>
-              </options>
-            </param>
-          </when>
-        </conditional>
-
-      </when>
-      <when value="gmapdb">
-        <param name="gmapdb" type="data" format="gmapdb" metadata_name="dbkey" label="Select a gmapdb" 
-              help="A GMAP database built with GMAP Build"/>
-        <param name="kmer" type="select" data_ref="gmapdb" label="kmer size" help="Defaults to highest available kmer size">
-          <options>
-            <filter type="data_meta" ref="gmapdb" key="kmers" multiple="True" separator=","/>
-          </options>
-        </param>
-
-        <param name="mode" type="select" label="Alignment mode" help="Assumes cmetindex and atoiindex were run on the gmap datatbase.">
-            <option value="">standard</option>
-            <option value="cmet-stranded">cmet-stranded   for bisulfite-treated DNA reads (tolerance to C-to-T changes)</option>
-            <option value="cmet-nonstranded">cmet-nonstranded   for bisulfite-treated DNA reads (tolerance to C-to-T changes)</option>
-            <option value="atoi-stranded">atoi-stranded   for RNA-editing tolerance (A-to-G changes)</option>
-            <option value="atoi-nonstranded">atoi-nonstranded   for RNA-editing tolerance (A-to-G changes)</option>
-        </param>
-
-        <conditional name="use_splicing">
-          <param name="src" type="select" label="&lt;HR&gt;Known Splicesite and Introns" 
-                 help="Look for splicing involving known sites or known introns at short or long distances 
-                  See README instructions for the distinction between known sites and known introns">
-            <option value="none" selected="true">None</option>
-            <option value="gmapdb">From the GMAP Database</option>
-            <option value="history">A Map in your history</option>
-          </param>
-          <when value="none"/>
-          <when value="history">
-            <param name="splicemap" type="data" format="splicesites.iit,introns.iit" metadata_name="dbkey" label="Select a splicesite map" 
-              help="built with GMAP IIT"/>
-          </when>
-          <when value="gmapdb">
-            <param name="splicemap" type="select"  data_ref="gmapdb" label="Use map for splicing involving known sites or known introns" help="">
-              <options>
-                <filter type="data_meta" ref="gmapdb" key="maps" multiple="True"/>
-              </options>
-            </param>
-          </when>
-        </conditional>
-
-        <conditional name="use_snps">
-          <param name="src" type="select" label="&lt;HR&gt;Known SNPs" help="for SNP tolerant alignments">
-            <option value="none" selected="true">None</option>
-            <option value="gmapdb">From the GMAP Database</option>
-            <option value="history">A SNP Index in your history</option>
-          </param>
-          <when value="none"/>
-          <when value="history">
-            <param name="snpindex" type="data" format="gmapsnpindex" metadata_name="dbkey" label="Select a snpindex" 
-              help="built with GMAP SNP Index"/>
-          </when>
-          <when value="gmapdb">
-            <param name="snpindex" type="select"  data_ref="gmapdb" label="Use database containing known SNPs" help="">
-              <options>
-                <filter type="data_meta" ref="gmapdb" key="snps" multiple="True" separator=","/>
-              </options>
-            </param>
-          </when>
-        </conditional>
-
-      </when>
-    </conditional>
-
-    <!-- Computation options -->
-    <conditional name="computation">
-      <param name="options" type="select" label="&lt;HR&gt;Computational Settings" help="">
-        <option value="default">Use default settings</option>
-        <option value="advanced">Set Computation Options</option>
-      </param>
-      <when value="default"/>
-      <when value="advanced">
-         <param name="max_mismatches" type="float" value="" optional="true" label="Maximum number of mismatches allowed (uses default when negative)" 
-              help="Defaults to the ultrafast level of ((readlength+2)/12 - 2)).
-                    If specified between 0.0 and 1.0, then treated as a fraction
-                    of each read length.  Otherwise, treated as an integral number
-                    of mismatches (including indel and splicing penalties)
-                    For RNA-Seq, you may need to increase this value slightly
-                    to align reads extending past the ends of an exon.">
-            <validator type="in_range" message="The mismatches must >= 0." min="0."/>
-         </param>
-         <param name="query_unk_mismatch" type="boolean" checked="false" truevalue="--query-unk-mismatch=1" falsevalue="" label="Count unknown (N) characters in the query as a mismatch"/>
-         <param name="genome_unk_mismatch" type="boolean" checked="true" truevalue="" falsevalue="--genome-unk-mismatch=0" label="Count unknown (N) characters in the genome as a mismatch"/>
-         <param name="terminal_threshold"  type="integer" value="" optional="true" label="Threshold for searching for a terminal alignment (default 3)" 
-                help="(from one end of the read to the best possible position at the other end).  To turn off terminal alignments, set this to a high value." />
-         <param name="indel_penalty"  type="integer" value="" optional="true" label="Penalty for an indel (default 2)" 
-                help="Counts against mismatches allowed.  To find indels, make indel-penalty less than or equal to max-mismatches.  A value &lt; 2 can lead to false positives at read ends" />
-         <param name="indel_endlength"  type="integer" value="" optional="true" label="Minimum length at end required for indel alignments (default 4)" />
-         <param name="max_middle_insertions"  type="integer" value="" optional="true" label="Maximum number of middle insertions allowed (default 9)" />
-         <param name="max_middle_deletions"  type="integer" value="" optional="true" label="Maximum number of middle deletions allowed (default 30)" />
-         <param name="max_end_insertions"  type="integer" value="" optional="true" label="Maximum number of end insertions allowed (default 3)" />
-         <param name="max_end_deletions"  type="integer" value="" optional="true" label="Maximum number of end deletions allowed (default 6)" />
-         <param name="suboptimal_levels"  type="integer" value="" optional="true" label="Report suboptimal hits beyond best hit (default 0)"
-                help="All hits with best score plus suboptimal-levels are reported" />
-         <param name="adapter_strip"  type="select" label="Method for removing adapters from reads" 
-                help="paired removes adapters from paired-end reads if a concordant or paired alignment cannot be found from the original read">
-           <option value="paired" selected="true">paired</option>
-           <option value="off">off</option>
-         </param>
-         <param name="trim_mismatch_score" type="integer" value="" optional="true" label="Score to use for mismatches when trimming at ends (default is -3)" 
-                help="to turn off trimming, specify 0"/>
-         <param name="use_tally" type="data" format="tally.iit" optional="true" metadata_name="dbkey" label="Select a tally IIT file to resolve concordant multiple results" 
-              help="generated by gsnap_tally and iit_store"/>
-
-         <!--
-           tallydir=STRING              Directory for tally IIT file to resolve concordant multiple results (default is
-                                              location of genome index files specified using -D and -d).  Note: can
-                                              just give full path name to use-tally instead.
-           use-tally=STRING             Use this tally IIT file to resolve concordant multiple results
-           runlengthdir=STRING          Directory for runlength IIT file to resolve concordant multiple results (default is
-                                              location of genome index files specified using -D and -d).  Note: can
-                                              just give full path name to use-runlength instead.
-           use-runlength=STRING         Use this runlength IIT file to resolve concordant multiple results
-         -->
-         
-         <!-- Options for GMAP alignment within GSNAP -->
-          <param name="gmap_mode" type="select" multiple="true" optional="true" display="checkboxes" label="Cases to use GMAP for complex alignments containing multiple splices or indels" 
-                 help="Default: pairsearch,terminal,improve">
-            <option value="pairsearch" selected="true">pairsearch</option>
-            <option value="terminal" selected="true">terminal</option>
-            <option value="improve" selected="true">improve</option>
-          </param>
-          <param name="trigger_score_for_gmap" type="integer" value="" optional="true" label="GMAP pairsearch threshold (default 5)" 
-                 help="Try GMAP pairsearch on nearby genomic regions if best score (the total of both ends if paired-end) exceeds this value (default 5)" />
-          <param name="max_gmap_pairsearch" type="integer" value="" optional="true" label="GMAP pairsearch threshold (default 3)" 
-                 help="Perform GMAP pairsearch on nearby genomic regions up to this many candidate ends (default 3)." />
-          <param name="max_gmap_terminal" type="integer" value="" optional="true" label="GMAP terminal threshold (default 3)" 
-                 help="Perform GMAP terminal on nearby genomic regions up to this many candidate ends (default 3)." />
-          <param name="max_gmap_improvement" type="integer" value="" optional="true" label="GMAP improvement threshold (default 3)" 
-                 help="Perform GMAP improvement on nearby genomic regions up to this many candidate ends (default 3)." />
-          <param name="microexon_spliceprob"  type="float" value="" optional="true" label="GMAP microexons threshold (default .90)" 
-                 help="Allow microexons only if one of the splice site probabilities is greater than this value." >
-            <validator type="in_range" message="The microexons  probability must be between 0. and 1." min="0." max="1."/>
-          </param>
-      </when>
-    </conditional>
-
-    <conditional name="splicing">
-      <param name="options" type="select" label="&lt;HR&gt;Splicing options for RNA-Seq" help="">
-        <option value="default">Use default settings</option>
-        <option value="advanced">Set Splicing Options</option>
-      </param>
-      <when value="default"/>
-      <when value="advanced">
-         <!-- Splicing options for RNA-Seq -->
-         <!-- use-splicing This should be either a select list from the gmapdb maps or a data type using splicesdir and use-splicing --> 
-         <!-- Neither novel splicing (-N) nor known splicing (-s) turned on => assume reads are DNA-Seq (genomic) -->
-         <param name="novelsplicing" type="boolean" checked="false" truevalue="--novelsplicing=1" falsevalue="" label="Look for novel splicing "/>
-         <param name="localsplicedist"  type="integer" value="" optional="true" label="Definition of local novel splicing event (default 200000)"/>
-         <param name="local_splice_penalty"  type="integer" value="" optional="true" label="Penalty for a local splice (default 0).  Counts against mismatches allowed"/>
-         <param name="distant_splice_penalty"  type="integer" value="" optional="true" label="Penalty for a distant splice (default 3).  Counts against mismatches allowed"
-                help="A distant splice is one where the intron length exceeds the value of localsplicedist or is an
-                     inversion, scramble, or translocation between two different chromosomes. Counts against mismatches allowed"/>
-         <param name="distant_splice_endlength"  type="integer" value="" optional="true" label="Minimum length at end required for distant spliced alignments"
-                help="(default 16, min is the kmer length)"/>
-         <param name="shortend_splice_endlength"  type="integer" value="" optional="true" label="Minimum length at end required for short-end spliced alignments"
-                help="(default 2, but unless known splice sites are provided,  GSNAP may still need the end length to be the value of kmer size to find a given splice"/>
-         <param name="distant_splice_identity"  type="float" value="" optional="true" label="Minimum identity at end required for distant spliced alignments (default 0.95)"/>
-         <param name="antistranded_penalty"  type="integer" value="" optional="true" label="Penalty for antistranded splicing when using stranded RNA-Seq protocols" 
-                help="A positive value, such as 1, expects antisense on the first read and sense on the second read.  
-                      Default is 0, which treats sense and antisense equally well"/>
-      </when>
-    </conditional>
-
-    <!-- Output data -->
-    <conditional name="output">
-      <param name="options" type="select" label="&lt;HR&gt;&lt;H2&gt;Output&lt;/H2&gt;Output options for RNA-Seq" help="">
-        <option value="default">Use default settings</option>
-        <option value="advanced">Set Output Options</option>
-      </param>
-      <when value="default"/>
-      <when value="advanced">
-        <param name="npath"  type="integer" value="" optional="true" label="Maximum number of paths to print (default 100)"/>
-        <param name="quiet_if_excessive" type="boolean" checked="false" truevalue="--quiet-if-excessive" falsevalue="" label="Quiet if Excessive" 
-               help="If more than maximum number of paths are found, then nothing is printed."/>
-        <param name="show_refdiff" type="boolean" checked="false" truevalue="--show-refdiff" falsevalue="" label="Show SNP-tolerant alignment" 
-               help="For GSNAP output in SNP-tolerant alignment, shows all differences relative to the reference genome as lower case (otherwise, it shows all differences relative to both the reference and alternate genome)"/>
-        <param name="clip_overlap" type="boolean" checked="false" truevalue="--clip-overlap" falsevalue="" label="Clip Overlap" 
-               help="For paired-end reads whose alignments overlap, clip the overlapping region."/>
-      </when>
-    </conditional>
-    <conditional name="result">
-      <param name="format" type="select" label="Select the output format" help="">
-        <option value="sam">SAM</option>
-        <!--  goby should only be an option if the input is in goby format
-        <option value="goby">Goby</option>
-        -->
-        <option value="gsnap">GSNAP default output</option>
-      </param>
-      <when value="gsnap">
-      </when>
-      <when value="sam">
-        <param name="no_sam_headers" type="boolean" truevalue="--no-sam-headers" falsevalue="" checked="false" label="Do not print headers beginning with '@'"/>
-        <param name="read_group_id" type="text" value="" optional="true" label="Value to put into read-group id (RG-ID) field"/>
-        <param name="read_group_name" type="text" value="" optional="true" label="Value to put into read-group name (RG-SM) field"/>
-        <param name="read_group_library" type="text" value="" optional="true" label="Value to put into read-group library (RG-LB) field"/>
-        <param name="read_group_platform" type="text" value="" optional="true" label="Value to put into read-group library platform (RG-PL) field"/>
-        <param name="quality_shift"  type="integer" value="" optional="true" label="Shift FASTQ quality scores by this amount in SAM output (default -31)"/>
-      </when>
-      <!--
-      <when value="goby">
-        <param name="goby_output" type="text" value="" label="Basename for Goby output files"/>
-        <param name="creads_window_start"  type="integer" value="" optional="true" label="Compact reads window start (default: 0=start of file)"/>
-        <param name="creads_window_end"  type="integer" value="" optional="true" label="Compact reads window end (default: 0=end of file)"/>
-        <param name="creads_complement" type="boolean" truevalue="-\-creads-complement" falsevalue="" checked="false" label="Complement read sequences (without reversing)"/>
-      </when>
-      -->
-    </conditional>
-    <!-- TODO combine fails and split_output -->
-
-    <conditional name="results">
-      <param name="split_output" type="select" label="&lt;HR&gt;Split outputs" 
-       help="Separate outputs for: nomapping, halfmapping_uniq, halfmapping_mult, unpaired_uniq, unpaired_mult, paired_uniq, paired_mult, concordant_uniq, and concordant_mult results"> 
-        <option value="no">no</option>
-        <option value="yes">yes</option>
-      </param>
-      <when value="no">
-        <conditional name="fails">
-          <param name="choice" type="select" label="How to deal with fails" help="">
-            <option value="default">default - include them in results</option>
-            <option value="nofails">nofails - exclude fails from results</option>
-            <option value="failsonly">failsonly - only output failing results</option>
-          </param>
-          <when value="default"/>
-          <when value="nofails"/>
-          <when value="failsonly">
-            <param name="fails_as_input" type="boolean" truevalue="--fails-as-input" falsevalue="" checked="false" label="Print completely failed alignments as input FASTA or FASTQ format" 
-              help=""/> 
-          </when>
-        </conditional>
-      </when>
-      <when value="yes">
-        <conditional name="fails">
-          <param name="choice" type="select" label="How to deal with fails" help="">
-            <option value="default">default - include them in results</option>
-            <option value="nofails">nofails - exclude fails from results</option>
-            <option value="failsonly">failsonly - only output failing results</option>
-          </param>
-          <when value="default"/>
-          <when value="nofails"/>
-          <when value="failsonly"/>
-        </conditional>
-        <param name="fails_as_input" type="boolean" truevalue="--fails-as-input" falsevalue="" checked="false" label="Print completely failed alignments as input FASTA or FASTQ format" 
-              help=""/> 
-      </when>
-    </conditional>
-
-  </inputs>
-  <outputs>
-    <data format="txt" name="gsnap_stderr" label="${tool.name} on ${on_string}: gsnap.log"/>
-
-    <data format="txt" name="gsnap_out" label="${tool.name} on ${on_string} ${result.format}" >
-      <filter>(results['split_output'] == 'no' and (results['fails']['choice'] != 'failsonly' or results['fails']['fails_as_input'] == False))</filter>
-      <change_format>
-        <when input="result['format']" value="sam" format="sam"/>
-        <when input="result['format']" value="gsnap" format="gsnap"/>
-      </change_format>
-    </data>
-
-    <data format="fastq" name="gsnap_fq" label="${tool.name} on ${on_string} fails.fq" >
-      <filter>(results['split_output'] == 'no' and results['fails']['choice'] == 'failsonly' and results['fails']['fails_as_input'] == True)</filter>
-    </data>
-
-    <!-- nomapping, halfmapping_uniq, halfmapping_mult, unpaired_uniq, unpaired_mult, paired_uniq, paired_mult, concordant_uniq, concordant_mult -->
-
-    <data format="txt" name="unpaired_mult" label="${tool.name} on ${on_string} unpaired_mult.${result.format}"  from_work_dir="gsnap_out.unpaired_mult">
-      <filter>(results['split_output'] == 'yes')</filter>
-      <change_format>
-        <when input="result['format']" value="sam" format="sam"/>
-        <when input="result['format']" value="gsnap" format="gsnap"/>
-      </change_format>
-    </data>
-    <data format="txt" name="unpaired_uniq" label="${tool.name} on ${on_string} unpaired_uniq.${result.format}"  from_work_dir="gsnap_out.unpaired_uniq">
-      <filter>(results['split_output'] == 'yes')</filter>
-      <change_format>
-        <when input="result['format']" value="sam" format="sam"/>
-        <when input="result['format']" value="gsnap" format="gsnap"/>
-      </change_format>
-    </data>
-    <data format="txt" name="unpaired_transloc" label="${tool.name} on ${on_string} unpaired_transloc.${result.format}"  from_work_dir="gsnap_out.unpaired_transloc">
-      <filter>(results['split_output'] == 'yes')</filter>
-      <change_format>
-        <when input="result['format']" value="sam" format="sam"/>
-        <when input="result['format']" value="gsnap" format="gsnap"/>
-      </change_format>
-    </data>
-    <data format="txt" name="halfmapping_mult" label="${tool.name} on ${on_string} halfmapping_mult.${result.format}"  from_work_dir="gsnap_out.halfmapping_mult">
-      <filter>(results['split_output'] == 'yes' and seq['format'] == 'fastq' and seq['paired']['ispaired'] == True)</filter>
-      <change_format>
-        <when input="result['format']" value="sam" format="sam"/>
-        <when input="result['format']" value="gsnap" format="gsnap"/>
-      </change_format>
-    </data>
-    <data format="txt" name="halfmapping_uniq" label="${tool.name} on ${on_string} halfmapping_uniq.${result.format}"  from_work_dir="gsnap_out.halfmapping_uniq">
-      <filter>(results['split_output'] == 'yes' and seq['format'] == 'fastq' and seq['paired']['ispaired'] == True)</filter>
-      <change_format>
-        <when input="result['format']" value="sam" format="sam"/>
-        <when input="result['format']" value="gsnap" format="gsnap"/>
-      </change_format>
-    </data>
-    <data format="txt" name="halfmapping_transloc" label="${tool.name} on ${on_string} halfmapping_transloc.${result.format}"  from_work_dir="gsnap_out.halfmapping_transloc">
-      <filter>(results['split_output'] == 'yes' and seq['format'] == 'fastq' and seq['paired']['ispaired'] == True)</filter>
-      <change_format>
-        <when input="result['format']" value="sam" format="sam"/>
-        <when input="result['format']" value="gsnap" format="gsnap"/>
-      </change_format>
-    </data>
-    <data format="txt" name="paired_mult" label="${tool.name} on ${on_string} paired_mult.${result.format}"  from_work_dir="gsnap_out.paired_mult">
-      <filter>(results['split_output'] == 'yes' and seq['format'] == 'fastq' and seq['paired']['ispaired'] == True)</filter>
-      <change_format>
-        <when input="result['format']" value="sam" format="sam"/>
-        <when input="result['format']" value="gsnap" format="gsnap"/>
-      </change_format>
-    </data>
-    <data format="txt" name="paired_uniq" label="${tool.name} on ${on_string} paired_uniq.${result.format}"  from_work_dir="gsnap_out.paired_uniq">
-      <filter>(results['split_output'] == 'yes' and seq['format'] == 'fastq' and seq['paired']['ispaired'] == True)</filter>
-      <change_format>
-        <when input="result['format']" value="sam" format="sam"/>
-        <when input="result['format']" value="gsnap" format="gsnap"/>
-      </change_format>
-    </data>
-    <data format="txt" name="paired_transloc" label="${tool.name} on ${on_string} paired_transloc.${result.format}"  from_work_dir="gsnap_out.paired_transloc">
-      <filter>(results['split_output'] == 'yes' and seq['format'] == 'fastq' and seq['paired']['ispaired'] == True)</filter>
-      <change_format>
-        <when input="result['format']" value="sam" format="sam"/>
-        <when input="result['format']" value="gsnap" format="gsnap"/>
-      </change_format>
-    </data>
-
-    <data format="txt" name="concordant_mult" label="${tool.name} on ${on_string} concordant_mult.${result.format}"  from_work_dir="gsnap_out.concordant_mult">
-      <filter>(results['split_output'] == 'yes' and seq['format'] == 'fastq' and seq['paired']['ispaired'] == True)</filter>
-      <change_format>
-        <when input="result['format']" value="sam" format="sam"/>
-        <when input="result['format']" value="gsnap" format="gsnap"/>
-      </change_format>
-    </data>
-    <data format="txt" name="concordant_uniq" label="${tool.name} on ${on_string} concordant_uniq.${result.format}"  from_work_dir="gsnap_out.concordant_uniq">
-      <filter>(results['split_output'] == 'yes' and seq['format'] == 'fastq' and seq['paired']['ispaired'] == True)</filter>
-      <change_format>
-        <when input="result['format']" value="sam" format="sam"/>
-        <when input="result['format']" value="gsnap" format="gsnap"/>
-      </change_format>
-    </data>
-    <data format="txt" name="concordant_transloc" label="${tool.name} on ${on_string} concordant_transloc.${result.format}"  from_work_dir="gsnap_out.concordant_transloc">
-      <filter>(results['split_output'] == 'yes' and seq['format'] == 'fastq' and seq['paired']['ispaired'] == True)</filter>
-      <change_format>
-        <when input="result['format']" value="sam" format="sam"/>
-        <when input="result['format']" value="gsnap" format="gsnap"/>
-      </change_format>
-    </data>
-
-    <data format="txt" name="nomapping" label="${tool.name} on ${on_string} nomapping.${result.format}"  from_work_dir="gsnap_out.nomapping">
-      <filter>(results['split_output'] == 'yes' and results['fails_as_input'] == False)</filter>
-      <change_format>
-        <when input="result['format']" value="sam" format="sam"/>
-        <when input="result['format']" value="gsnap" format="gsnap"/>
-      </change_format>
-    </data>
-
-    <data format="fastq" name="nomapping_fq" label="${tool.name} on ${on_string} nomapping.fq"  from_work_dir="gsnap_out.nomapping.fq">
-      <filter>(results['split_output'] == 'yes' and seq['format'] == 'fastq' and seq['paired']['ispaired'] == False)</filter>
-    </data>
-
-    <data format="fastq" name="nomapping_1_fq" label="${tool.name} on ${on_string} nomapping.1.fq"  from_work_dir="gsnap_out.nomapping.1.fq">
-      <filter>(results['split_output'] == 'yes' and seq['format'] == 'fastq' and seq['paired']['ispaired'] == True)</filter>
-    </data>
-
-    <data format="fastq" name="nomapping_2_fq" label="${tool.name} on ${on_string} nomapping.2.fq"  from_work_dir="gsnap_out.nomapping.2.fq">
-      <filter>(results['split_output'] == 'yes' and seq['format'] == 'fastq' and seq['paired']['ispaired'] == True)</filter>
-    </data>
-
-    <!-- Will problay need wrapper code to generate composite datatype for goby alignment
-    <data format="gobyalignment" name="goby_alignment" label="${tool.name} on ${on_string} uniq.${result.format}"  from_work_dir="gsnap_out.nomapping">
-      <filter>result['format'] == 'goby'</filter>
-    </data>
-    -->
-
-  </outputs>
-  <tests>
-  </tests> 
-
-  <help>
-
-**What it does**
-
-GSNAP_ (Genomic Short-read Nucleotide Alignment Program) is a short read aligner which can align both single- and paired-end reads as short as 14nt and of arbitrarily long length. It can detect short- and long-distance splicing, including interchromosomal splicing, in individual reads, using probabilistic models or a database of known splice sites. Our program also permits SNP-tolerant alignment to a reference space of all possible combinations of major and minor alleles, and can align reads from bisulfite-treated DNA for the study of methylation state. It is developed by Thomas D. Wu of Genentech, Inc.  
-Publication_ citation: Thomas D. Wu, Serban Nacu "Fast and SNP-tolerant detection of complex variants and splicing in short reads. Bioinformatics. 2010 Apr 1;26(7):873-81. Epub 2010 Feb 10.
-
-.. _GSNAP: http://research-pub.gene.com/gmap/
-.. _Publication: http://bioinformatics.oupjournals.org/cgi/content/full/26/7/873
-http://www.ncbi.nlm.nih.gov/pmc/articles/PMC2844994/?tool=pubmed
-
-------
-
-**Know what you are doing**
-
-.. class:: warningmark
-
-You will want to read the README_
-
-.. _README: http://research-pub.gene.com/gmap/src/README
-
-------
-
-**Input formats**
-
-Input to GSNAP should be either in FASTQ or FASTA format.  
-
-The FASTQ input may include quality scores, which will then be included in SAM
-output, if that output format is selected. 
-
-For FASTA format, you should include one line per read (or end of a
-paired-end read).  The same FASTA file can have a mixture of
-single-end and paired-end reads of varying lengths, if desired.
-
-Single-end reads:
-
-Each FASTA entry should contain one short read per line, like this
-
->Header information
-AAAACATTCTCCTCCGCATAAGCCTGCGTCAGATTA
-
-Each short read can have a different length.  However, the entire read
-needs to be on a single line, and may not wrap around multiple lines.
-If it extends to a second line, GSNAP will think that the read is
-paired-end.
-
-
-Paired-end reads:
-
-Each FASTA entry should contain two short reads, one per line, like
-this
-
->Header information
-AAAACATTCTCCTCCGCATAAGCCTAGTAGATTA
-GGCGTAGGTAGAAGTAGAGGTTAAGGCGCGTCAG
-
-By default, the program assumes that the second end is in the reverse
-complement direction compared with the first end.  If they are in the
-same direction, you may need to use the --circular-input (or -c) flag.
-
-( The Galaxy tool: "FASTA Width formatter"  can be used to reformat fasta files to have single line sequences. )
-
-------
-
-**Output formats in GSNAP**
-
-SAM output format
-
-Default GSNAP format
-  See the README_
-
-
-
-
-  </help>
-</tool>
-
--- a/gmap/iit_store.xml	Tue Nov 08 13:22:34 2011 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,188 +0,0 @@
-<tool id="gmap_iit_store" name="GMAP IIT" version="2.0.0">
-  <description>Create a map store for known genes or SNPs</description>
-  <requirements>
-      <requirement type="binary">iit_store</requirement>
-      <!-- proposed tag for added datatype dependencies -->
-      <requirement type="datatype">gmap_annotation</requirement>
-      <requirement type="datatype">gmap_snps</requirement>
-      <requirement type="datatype">iit</requirement>
-      <requirement type="datatype">splicesites.iit</requirement>
-      <requirement type="datatype">introns.iit</requirement>
-      <requirement type="datatype">snps.iit</requirement>
-  </requirements>
-  <version_string>iit_store --version</version_string>
-  <command interpreter="command"> /bin/bash $shscript 2> $log </command>
-  <inputs>
-    <!-- Input data -->
-    <conditional name="map">
-      <param name="type" type="select" label="Make map for" >
-        <option value="genes">Introns and Splice sites</option>
-        <option value="snps">SNPs</option>
-        <option value="gmap">GMAP Annotation</option>
-      </param>
-      <when value="genes">
-        <conditional name="src">
-          <param name="src_format" type="select" label="Add splice and intron info from" >
-            <option value="refGeneTable">refGenes table from UCSC table browser</option>
-            <option value="gtf">GTF</option>
-            <option value="gff3">GFF3</option>
-          </param>
-          <when value="refGeneTable">
-            <param name="genes" type="data" format="tabular" label="UCSC refGenes table" help="Example: ftp://hgdownload.cse.ucsc.edu/goldenPath/hg18/database/refGene.txt.gz" />
-            <param name="col_skip" type="integer" value="1" label="Columns to skip before the id/name column (default 1)" 
-                   help="Note that alignment tracks in UCSC sometimes have an extra column on the left.">
-              <validator type="in_range" message="The number of colmumns to skip must >= 0." min="0."/>
-            </param>
-          </when>
-          <when value="gtf">
-            <param name="genes" type="data" format="gtf" label="Genes as GTF" help="" />
-          </when>
-          <when value="gff3">
-            <param name="genes" type="data" format="gff3" label="Genes in GFF3 format" help="" />
-          </when>
-        </conditional> 
-        <param name="maps" type="select" display="checkboxes" multiple="true" force_select="true" label="Add splice and intron info from" >
-          <option value="splicesites" selected="true">splicesites.iit</option>
-          <option value="introns" selected="false">introns.iit</option>
-        </param>
-      </when>
-      <when value="snps">
-        <conditional name="src">
-          <param name="src_format" type="select" label="Add SNP info from" >
-            <option value="snpTable">UCSC SNP Table</option>
-            <option value="snpFile">GMAP SNP File</option>
-          </param>
-          <when value="snpTable">
-            <param name="snps" type="data" format="tabular" label="UCSC SNPs table" help="Example: ftp://hgdownload.cse.ucsc.edu/goldenPath/hg18/database/snp130.txt.gz" />
-            <param name="snpsex" type="data" format="tabular" optional="true" label="UCSC SNP Exceptions table" help="Example: ftp://hgdownload.cse.ucsc.edu/goldenPath/hg18/database/snp130Exceptions.txt.gz" />
-            <param name="weight" type="select" label="Include SNPs with at least Confidence Level" help="">
-              <option value="1" selected="true">1 (High)</option>
-              <option value="2">2 (Medium)</option>
-              <option value="3">3 (All)</option>
-            </param>
-          </when>
-          <when value="snpFile">
-            <param name="snps" type="data" format="gmap_snps" optional="true" label="GMAP SNPs file" 
-               help="Format (3 columns):&lt;B&gt;
-                    &lt;br&gt;>rs62211261 21:14379270 CG
-                    &lt;br&gt;>rs62211262 21:14379281 CG
-                    &lt;/B&gt;
-                    &lt;br&gt;Each line must start with a &gt; character, then be followed by an
-                    identifier (which may have duplicates).  Then there should be the
-                    chromosomal coordinate of the SNP.  (Coordinates are all 1-based, so
-                    the first character of a chromosome is number 1.)  Finally, there
-                    should be the two possible alleles: ( AC AG AT CG CT GT or AN CN GN TN)
-                    &lt;br&gt;These alleles must correspond to the possible nucleotides on the plus strand of the genome.  
-                    If the one of these two letters does not match the allele in the reference
-                    sequence, that SNP will be ignored in subsequent processing as a probable error.
-                    The N stands for any other allele." />
-          </when>
-        </conditional> 
-      </when>
-      <when value="gmap">
-        <param name="annotation" type="data" format="gmap_annotation" label="GMAP mapfile" 
-          help="Format (2 or columns): &lt;B&gt;
-                &lt;br&gt;>label coords optional_tag
-                &lt;br&gt;optional_annotation (which may be zero, one, or multiple lines)
-                &lt;/B&gt;
-                &lt;br&gt;Each line must start with a &gt; character, then be followed by an identifier (which may have duplicates).  
-                &lt;br&gt;Then there should be the chromosomal coordinate range.  (Coordinates are all 1-based, so the first character of a chromosome is number 1.)  
-                &lt;br&gt;The coords should be of the form
-                &lt;br&gt; chr:position
-                &lt;br&gt;  chr:startposition..endposition
-                &lt;br&gt;The term chr:position is equivalent to chr:position..position.  
-                &lt;br&gt;If you want to indicate that the interval is on the minus strand or reverse direction, then endposition may be less than startposition.  
-                " />
-      </when>
-    </conditional> 
-  </inputs>
-  <outputs>
-    <data format="txt" name="log" label="${tool.name} on ${on_string}: log"/>
-    <data format="splicesites.iit" name="splicesites_iit" label="${tool.name} on ${on_string} splicesites.iit">
-      <filter>(map['type'] == 'genes' and 'splicesites' in map['maps'])</filter>
-    </data>
-    <data format="introns.iit" name="introns_iit" label="${tool.name} on ${on_string} introns.iit">
-      <filter>(map['type'] == 'genes' and 'introns' in map['maps'])</filter>
-    </data>
-    <data format="snps.iit" name="snps_iit" label="${tool.name} on ${on_string} snps.iit">
-      <filter>(map['type'] == 'snps')</filter>
-    </data>
-    <data format="iit" name="map_iit" label="${tool.name} on ${on_string} map.iit">
-      <filter>(map['type'] == 'gmap')</filter>
-    </data>
-  </outputs>
-  <configfiles>
-    <configfile name="shscript">
-#!/bin/bash
-#set $catcmd = 'gzcat -f'
-#set $catcmd = 'cat'
-#set $ds = chr(36)
-#set $gt = chr(62)
-#set $lt = chr(60)
-#set $ad = chr(38)
-#set $ep = chr(33)
-#set $toerr = ''.join([$gt,$ad,'2'])
-#import os.path
-#if $map.type == 'genes':
-if [ $ep -e $map.src.genes ]; then echo "$map.src.genes does not exist" $toerr; exit 1; fi
-if [ $ep -s $map.src.genes ]; then echo "$map.src.genes is empty" $toerr; exit 2; fi
- #if $map.src.src_format == 'refGeneTable':
-  #if 'splicesites' in [ $map.maps.__str__ ]:
-   $catcmd $map.src.genes | psl_splicesites -s $map.src.col_skip | iit_store -o  $splicesites_iit
-  #end if
-  #if 'introns' in [ $map.maps.__str__ ]:
-   $catcmd  $map.src.genes | psl_introns -s $map.src.col_skip | iit_store -o  $introns_iit
-  #end if
- #elif $map.src.src_format == 'gtf':
-  #if 'splicesites' in [ $map.maps.__str__ ]:
-   $catcmd $map.src.genes | gtf_splicesites | iit_store -o  $splicesites_iit
-  #end if
-  #if 'introns' in [ $map.maps.__str__ ]:
-   $catcmd $map.src.genes | gtf_introns | iit_store -o  $introns_iit
-  #end if
- #elif $map.src.src_format == 'gff3':
-  #if 'splicesites' in [ $map.maps.__str__ ]:
-   $catcmd $map.src.genes | gff3_splicesites | iit_store -o  $splicesites_iit
-  #end if
-  #if 'introns' in [ $map.maps.__str__ ]:
-   $catcmd $map.src.genes | gff3_introns | iit_store -o  $introns_iit
-  #end if
- #end if
-#elif $map.type == 'snps':
-if [ $ep -s $map.src.snps ]; then echo "$map.src.snps is empty" $toerr; exit 2; fi
- #if $map.src.snpsex.__str__ != 'None':
-  $catcmd $map.src.snps | dbsnp_iit -w $map.src.weight -e $map.src.snpsex | iit_store -o  $snps_iit
- #else:
-  $catcmd $map.src.snps | dbsnp_iit -w $map.src.weight | iit_store -o $snps_iit 
- #end if
-#else:
-  $catcmd $map.src.snps | iit_store -o $map_iit 
-#end if
-    </configfile>
-  </configfiles>
-
-  <tests>
-  </tests> 
-
-  <help>
-
-
-**iit_store**
-
-GMAP IIT creates an Interval Index Tree map of known splice sites, introns, or SNPs (it uses iit_store described in the GMAP documentation).  The maps can be used in GMAP_ (Genomic Mapping and Alignment Program for mRNA and EST sequences) and GSNAP_ (Genomic Short-read Nucleotide Alignment Program).  Maps are typically used for known splice sites, introns, or SNPs.  
-
-You will want to read the README_
-
-Publication_ citation: Thomas D. Wu, Colin K. Watanabe  Bioinformatics 2005 21(9):1859-1875; doi:10.1093/bioinformatics/bti310
-
-.. _GMAP: http://research-pub.gene.com/gmap/
-.. _GSNAP: http://research-pub.gene.com/gmap/
-.. _README: http://research-pub.gene.com/gmap/src/README
-.. _Publication: http://bioinformatics.oxfordjournals.org/cgi/content/full/21/9/1859
-
-
-**inputs**
-
-  </help>
-</tool>
-
--- a/gmap/snpindex.xml	Tue Nov 08 13:22:34 2011 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,141 +0,0 @@
-<tool id="gmap_snpindex" name="GMAP SNP Index" version="2.0.0">
-  <description>build index files for known SNPs</description>
-  <requirements>
-      <requirement type="binary">snpindex</requirement>
-      <!-- proposed tag for added datatype dependencies -->
-      <requirement type="datatype">gmapsnpindex</requirement>
-      <requirement type="datatype">gmapdb</requirement>
-      <requirement type="datatype">gmap_snps</requirement>
-      <requirement type="datatype">snps.iit</requirement>
-  </requirements>
-  <version_string>snpindex --version</version_string>
-  <command interpreter="command"> /bin/bash $shscript 2>1 1> $output </command>
-  <inputs>
-    <conditional name="refGenomeSource">
-     <param name="genomeSource" type="select" label="Will you map to a reference genome from your history or use a built-in index?" help="Built-ins were indexed using default options">
-        <option value="indexed">Use a built-in index</option>
-        <option value="gmapdb">Use gmapdb from the history</option>
-      </param>
-      <when value="indexed">
-        <param name="gmapindex" type="select" label="Select a reference genome" help="if your genome of interest is not listed - contact Galaxy team">
-          <options from_file="gmap_indices.loc">
-            <column name="uid" index="0" />
-            <column name="dbkey" index="1" />
-            <column name="name" index="2" />
-            <column name="kmers" index="3" />
-            <column name="maps" index="4" />
-            <column name="snps" index="5" />
-            <column name="value" index="6" />
-          </options>
-        </param>
-      </when>
-      <when value="gmapdb">
-        <param name="gmapdb" type="data" format="gmapdb" metadata_name="dbkey" label="Select a gmapdb" 
-              help="A GMAP database built with GMAP Build"/>
-      </when>
-    </conditional>
-    <conditional name="dbsnp">
-      <param name="snp_source" type="select" label="Add SNP info from" >
-        <option value="snpTable">UCSC SNP Table</option>
-        <option value="snpFile">GMAP SNP File</option>
-        <option value="snpIIT">"GMAP SNPs map from GMAP iit store</option>
-      </param>
-      <when value="snpTable">
-        <param name="snps" type="data" format="tabular" label="UCSC SNPs table" help="Example: ftp://hgdownload.cse.ucsc.edu/goldenPath/hg18/database/snp130.txt.gz" />
-        <param name="snpsex" type="data" format="tabular" optional="true" label="UCSC SNP Exceptions table" help="Example: ftp://hgdownload.cse.ucsc.edu/goldenPath/hg18/database/snp130Exceptions.txt.gz" />
-        <param name="weight" type="select" label="Include SNPs with at least Confidence Level" help="">
-          <option value="1" selected="true">1 (High)</option>
-          <option value="2">2 (Medium)</option>
-          <option value="3">3 (All)</option>
-        </param>
-      </when>
-      <when value="snpFile">
-        <param name="snps" type="data" format="gmap_snps" label="GMAP SNPs file" 
-           help="Format (3 columns):
-                &lt;br&gt;>rs62211261 21:14379270 CG
-                &lt;br&gt;>rs62211262 21:14379281 CG
-                &lt;br&gt;Each line must start with a &gt; character, then be followed by an
-                identifier (which may have duplicates).  Then there should be the
-                chromosomal coordinate of the SNP.  (Coordinates are all 1-based, so
-                the first character of a chromosome is number 1.)  Finally, there
-                should be the two possible alleles: ( AC AG AT CG CT GT or AN CN GN TN)
-                &lt;br&gt;These alleles must correspond to the possible nucleotides on the plus strand of the genome.  
-                If the one of these two letters does not match the allele in the reference
-                sequence, that SNP will be ignored in subsequent processing as a probable error.
-                The N stands for any other allele." />
-      </when>
-      <when value="snpIIT">
-        <param name="snpIIT" type="data" format="snps.iit" label="GMAP SNPs map" help="Created by: GMAP iit store" />
-      </when>
-    </conditional> 
-    <param name="snps_name" type="text" value="snps" label="Name for this SNP index" help="no white space characters">
-    </param>
-  </inputs>
-  <outputs>
-    <!--
-    <data format="txt" name="log" label="${tool.name} on ${on_string}: log"/>
-    -->
-    <data format="gmapsnpindex" name="output" label="${tool.name} on ${on_string} snpindex" />
-  </outputs>
-  <configfiles>
-    <configfile name="shscript">
-#!/bin/bash
-#set $ds = chr(36)
-#set $gt = chr(62)
-#set $lt = chr(60)
-#set $ad = chr(38)
-#import os.path
-#if $refGenomeSource.genomeSource == "gmapdb":
-#set $gmapdb = $refGenomeSource.gmapdb.extra_files_path
-#set $refname = $refGenomeSource.gmapdb.metadata.db_name
-#else:
-#set $gmapdb = $os.path.dirname($refGenomeSource.gmapindex.value) 
-$refname = $os.path.basename($refGenomeSource.gmapindex.value)
-#end if
-#set $gmapsnpdir = $output.extra_files_path
-mkdir -p $gmapsnpdir
-#set $snpsname = $snps_name.__str__
-#set $snpsiit = '.'.join([$snpsname,'iit'])
-#set $pathsnps = $os.path.join($gmapsnpdir,$snpsname)
-#set $pathsnpsiit = $os.path.join($gmapsnpdir,$snpsiit)
-#if $dbsnp.snp_source != 'none' and $dbsnp.snps.__str__ != 'None':
-#if $dbsnp.snp_source == 'snpTable':
-#if $dbsnp.snpsex.__str__ != 'None':
-cat $dbsnp.snps | dbsnp_iit -w $dbsnp.weight -e $dbsnp.snpsex | iit_store -o $pathsnps
-#else:
-cat $dbsnp.snps | dbsnp_iit -w $dbsnp.weight | iit_store -o $pathsnps
-#end if
-#elif $dbsnp.snp_source == 'snpFile':
-cat $dbsnp.snps | iit_store -o $pathsnps
-#elif $dbsnp.snp_source == 'snpIIT':
-cat $dbsnp.snps  > $pathsnpsiit
-#end if
-snpindex -D $gmapdb -d $refname -V $output.extra_files_path -v $snpsname $pathsnpsiit
-echo snpindex -D  $gmapdb -d $refname -V $output.extra_files_path -v $snpsname $pathsnpsiit
-#end if
-    </configfile>
-  </configfiles>
-
-  <tests>
-  </tests> 
-
-  <help>
-
-
-**GMAP SNP Index**
-
-GMAP SNP Index (snpindex in the GMAP documentaion) creates an index for known SNPs allowing for SNP tolerant mapping and alignment when using GMAP_ (Genomic Mapping and Alignment Program for mRNA and EST sequences) and GSNAP_ (Genomic Short-read Nucleotide Alignment Program).  
-
-You will want to read the README_
-
-Publication_ citation: Thomas D. Wu, Colin K. Watanabe  Bioinformatics 2005 21(9):1859-1875; doi:10.1093/bioinformatics/bti310
-
-.. _GMAP: http://research-pub.gene.com/gmap/
-.. _GSNAP: http://research-pub.gene.com/gmap/
-.. _README: http://research-pub.gene.com/gmap/src/README
-.. _Publication: http://bioinformatics.oxfordjournals.org/cgi/content/full/21/9/1859
-
-
-  </help>
-</tool>
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gmap_build.xml	Tue Nov 08 13:26:41 2011 -0600
@@ -0,0 +1,177 @@
+<tool id="gmap_build" name="GMAP Build" version="2.0.0">
+  <description>a database genome index for GMAP and GSNAP</description>
+  <requirements>
+      <requirement type="binary">gmap_build</requirement>
+      <!-- proposed tag for added datatype dependencies -->
+      <requirement type="datatype">gmapdb</requirement>
+      <requirement type="datatype">gmap_snps</requirement>
+  </requirements>
+  <version_string>gmap --version</version_string>
+  <command interpreter="command"> /bin/bash $shscript 2>1 1> $output </command>
+  <inputs>
+    <!-- Name for this gmapdb -->
+    <param name="refname" type="text" label="Name you want to give this gmap database" help="">
+      <validator type="empty_field" message="A database name is required."/>
+    </param>
+    <!-- Input data -->
+    <repeat name="inputs" title="Reference Sequence" min="1">
+      <param name="input" type="data" format="fasta" label="reference sequence fasta" />
+    </repeat>
+
+    <param name="kmer" type="select" multiple="true" force_select="true" label="kmer size" help="">
+      <option value="12">12</option>
+      <option value="13">13</option>
+      <option value="14">14</option>
+      <option value="15" selected="true">15</option>
+    </param>  
+    <param name="cmetindex" type="boolean" checked="true" truevalue="yes" falsevalue="no" label="Create cmetindex to process reads from bisulfite-treated DNA"/>
+    <param name="atoiindex" type="boolean" checked="true" truevalue="yes" falsevalue="no" label="Create atoiindex to process reads under RNA-editing tolerance"/>
+    <conditional name="splicesite">
+      <param name="splice_source" type="select" label="Add splice and intron info from" >
+        <option value="none"></option>
+        <option value="refGeneTable">refGenes table from UCSC table browser</option>
+        <option value="gtf">GTF</option>
+        <option value="gff3">GFF3</option>
+      </param>
+      <when value="none"/>
+      <when value="refGeneTable">
+        <param name="refGenes" type="data" format="tabular" optional="true" label="UCSC refGenes table" help="Example: ftp://hgdownload.cse.ucsc.edu/goldenPath/hg18/database/refGene.txt.gz" />
+        <param name="col_skip" type="integer" value="1" label="Columns to skip before the id/name column (default 1)" 
+               help="Note that alignment tracks in UCSC sometimes have an extra column on the left.">
+          <validator type="in_range" message="The number of colmumns to skip must >= 0." min="0."/>
+        </param>
+ 
+      </when>
+      <when value="gtf">
+        <param name="gtfGenes" type="data" format="gtf" optional="true" label="Genes as GTF" help="" />
+      </when>
+      <when value="gff3">
+        <param name="gff3Genes" type="data" format="gff3" optional="true" label="Genes in GFF3 format" help="" />
+      </when>
+    </conditional> 
+    <conditional name="dbsnp">
+      <param name="snp_source" type="select" label="Add SNP info from" >
+        <option value="none"></option>
+        <option value="snpTable">UCSC SNP Table</option>
+        <option value="snpFile">GMAP SNP File</option>
+      </param>
+      <when value="none"/>
+      <when value="snpTable">
+        <param name="snps" type="data" format="tabular" optional="true" label="UCSC SNPs table" help="Example: ftp://hgdownload.cse.ucsc.edu/goldenPath/hg18/database/snp130.txt.gz" />
+        <param name="snpsex" type="data" format="tabular" optional="true" label="UCSC SNP Exceptions table" help="Example: ftp://hgdownload.cse.ucsc.edu/goldenPath/hg18/database/snp130Exceptions.txt.gz" />
+        <param name="weight" type="select" label="Include SNPs with at least Confidence Level" help="">
+          <option value="1" selected="true">1 (High)</option>
+          <option value="2">2 (Medium)</option>
+          <option value="3">3 (All)</option>
+        </param>
+      </when>
+      <when value="snpFile">
+        <param name="snps" type="data" format="gmap_snps" optional="true" label="GMAP SNPs file" 
+           help="Format (3 columns):
+                &lt;br&gt;>rs62211261 21:14379270 CG
+                &lt;br&gt;>rs62211262 21:14379281 CG
+                &lt;br&gt;Each line must start with a &gt; character, then be followed by an
+                identifier (which may have duplicates).  Then there should be the
+                chromosomal coordinate of the SNP.  (Coordinates are all 1-based, so
+                the first character of a chromosome is number 1.)  Finally, there
+                should be the two possible alleles: ( AC AG AT CG CT GT or AN CN GN TN)
+                &lt;br&gt;These alleles must correspond to the possible nucleotides on the plus strand of the genome.  
+                If the one of these two letters does not match the allele in the reference
+                sequence, that SNP will be ignored in subsequent processing as a probable error.
+                The N stands for any other allele." />
+      </when>
+    </conditional> 
+  </inputs>
+  <outputs>
+    <!--
+    <data format="txt" name="log" label="${tool.name} on ${on_string}: log"/>
+    -->
+    <data format="gmapdb" name="output" label="${tool.name} on ${on_string} gmapdb ${refname}" />
+  </outputs>
+  <configfiles>
+    <configfile name="shscript">
+#!/bin/bash
+#set $ds = chr(36)
+#set $gt = chr(62)
+#set $lt = chr(60)
+#set $ad = chr(38)
+## #set $ref_files = ''
+## #for $i in $inputs:
+  ## #set $ref_files = $ref_files $i.input
+## #end for
+## echo $ref_files
+#import os.path
+#set $gmapdb = $output.extra_files_path
+#set $mapsdir = $os.path.join($os.path.join($gmapdb,str($refname)), str($refname) + '.maps')
+mkdir -p $gmapdb
+## export GMAPDB required for cmetindex  and atoiindex
+export GMAPDB=$gmapdb
+#for $k in $kmer.__str__.split(','):
+gmap_build -D $gmapdb -d $refname -s numeric-alpha -k $k #for i in $inputs# ${i.input}#end for#
+#end for
+get-genome -D $gmapdb -d '?' | sed 's/^Available .*/gmap db: /' 
+echo "kmers: " $kmer 
+#if $splicesite.splice_source == 'refGeneTable':
+#if $splicesite.refGenes.__str__ != 'None':
+cat $splicesite.refGenes | psl_splicesites -s $splicesite.col_skip | iit_store -o  $os.path.join($mapsdir,'splicesites')
+cat $splicesite.refGenes | psl_introns -s $splicesite.col_skip | iit_store -o  $os.path.join($mapsdir,'introns')
+#end if
+#elif $splicesite.splice_source == 'gtf':
+#if $splicesite.gtfGenes.__str__ != 'None':
+cat $splicesite.gtfGenes | gtf_splicesites | iit_store -o  $os.path.join($mapsdir,'splicesites')
+cat $splicesite.gtfGenes | gtf_introns | iit_store -o  $os.path.join($mapsdir,'introns')
+#end if
+#elif $splicesite.splice_source == 'gff3':
+#if $splicesite.gff3Genes.__str__ != 'None':
+cat $splicesite.gff3Genes | gff3_splicesites | iit_store -o  $os.path.join($mapsdir,'splicesites')
+cat $splicesite.gff3Genes | gff3_introns | iit_store -o  $os.path.join($mapsdir,'introns')
+#end if
+#end if
+#if $dbsnp.snp_source != 'none' and $dbsnp.snps.__str__ != 'None':
+#if $dbsnp.snp_source == 'snpTable':
+#if $dbsnp.snpsex.__str__ != 'None':
+cat $dbsnp.snps | dbsnp_iit -w $dbsnp.weight -e $dbsnp.snpsex | iit_store -o  $os.path.join($mapsdir,'snps')
+#else:
+cat $dbsnp.snps | dbsnp_iit -w $dbsnp.weight | iit_store -o  $os.path.join($mapsdir,'snps')
+#end if
+#else:
+cat $dbsnp.snps | iit_store -o  $os.path.join($mapsdir,'snps')
+#end if
+snpindex -d $refname -v snps
+echo "snpindex" -d  $refname -v snps
+#end if
+#if $cmetindex.__str__ == 'yes':
+cmetindex -d $refname
+echo "cmetindex" -d $refname
+#end if
+#if $atoiindex.__str__ == 'yes':
+atoiindex -d $refname
+echo "atoiindex" -d $refname
+#end if
+get-genome -D $gmapdb -d $refname -m '?' | sed 's/^Available maps .*/maps: /' 
+    </configfile>
+  </configfiles>
+
+  <tests>
+  </tests> 
+
+  <help>
+
+
+**GMAP Build**
+
+GMAP Build creates an index of a genomic sequence for mapping and alignment using GMAP_ (Genomic Mapping and Alignment Program for mRNA and EST sequences) and GSNAP_ (Genomic Short-read Nucleotide Alignment Program).  (GMAP Build uses GMSP commands: gmap_build, iit_store, psl_splicesites, psl_introns, gtf_splicesites, gtf_introns, gff3_splicesites, gff3_introns, dbsnp_iit, snpindex, cmetindex, and atoiindex.)
+
+You will want to read the README_
+
+Publication_ citation: Thomas D. Wu, Colin K. Watanabe  Bioinformatics 2005 21(9):1859-1875; doi:10.1093/bioinformatics/bti310
+
+.. _GMAP: http://research-pub.gene.com/gmap/
+.. _GSNAP: http://research-pub.gene.com/gmap/
+.. _README: http://research-pub.gene.com/gmap/src/README
+.. _Publication: http://bioinformatics.oxfordjournals.org/cgi/content/full/21/9/1859
+
+
+  </help>
+</tool>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsnap.xml	Tue Nov 08 13:26:41 2011 -0600
@@ -0,0 +1,834 @@
+<tool id="gsnap" name="GSNAP" version="2.0.0">
+  <description>Genomic Short-read Nucleotide Alignment Program</description>
+  <requirements>
+      <requirement type="binary">gsnap</requirement>
+      <!-- proposed tag for added datatype dependencies -->
+      <requirement type="datatype">gmapdb</requirement>
+      <requirement type="datatype">gmapsnpindex</requirement>
+      <requirement type="datatype">splicesites.iit</requirement>
+      <requirement type="datatype">introns.iit</requirement>
+  </requirements>
+  <version_string>gsnap --version</version_string>
+  <command>
+    #import os.path, re
+    gsnap
+    --nthreads="4" --ordered
+    #if $refGenomeSource.genomeSource == "gmapdb":
+      #set $gmapdb = $os.listdir($refGenomeSource.gmapdb.extra_files_path)[0]
+      --dir=$refGenomeSource.gmapdb.extra_files_path --db=$refGenomeSource.gmapdb.metadata.db_name
+    #else:
+      --dir=$os.path.dirname($refGenomeSource.gmapindex.value) --db=$os.path.basename($refGenomeSource.gmapindex.value)
+    #end if
+    #if $refGenomeSource.kmer != None and len($refGenomeSource.kmer.__str__) == 2:
+      --kmer=$refGenomeSource.kmer
+    #end if
+    #if $refGenomeSource.use_splicing.src == 'gmapdb':
+      #if $refGenomeSource.use_splicing.splicemap != None and len($refGenomeSource.use_splicing.splicemap.__str__) > 0:
+        -s $refGenomeSource.use_splicing.splicemap.value
+      #end if
+    #elif $refGenomeSource.use_splicing.src == 'history':
+      #if $refGenomeSource.use_splicing.splicemap != None and len($refGenomeSource.use_splicing.splicemap.__str__) > 0:
+        -S $os.path.dirname($refGenomeSource.use_splicing.splicemap) -s $os.path.basename($refGenomeSource.use_splicing.splicemap)
+      #end if
+    #end if
+    #if $refGenomeSource.use_snps.src == 'gmapdb':
+       #if $refGenomeSource.use_snps.snpindex != None and len($refGenomeSource.use_snps.snpindex.__str__) > 0:
+        -v $refGenomeSource.use_snps.snpindex.value
+       #end if
+    #elif $refGenomeSource.use_snps.src == 'history':
+       #if $refGenomeSource.use_snps.snpindex != None and len($refGenomeSource.use_snps.snpindex.__str__) > 0:
+         -V $refGenomeSource.use_snps.snpindex.extra_files_path -v $refGenomeSource.use_snps.snpindex.metadata.snps_name
+       #end if
+    #end if
+    #if $refGenomeSource.mode.__str__ != '':
+      --mode=$refGenomeSource.mode
+    #end if
+    #if $mapq_unique_score.__str__ != '':
+      --mapq-unique-score=$mapq_unique_score
+    #end if
+    #if $computation.options == "advanced":
+      #if $computation.max_mismatches.__str__ != '':
+        --max-mismatches=$computation.max_mismatches
+      #end if
+      $computation.query_unk_mismatch
+      $computation.genome_unk_mismatch
+      #if $computation.terminal_threshold.__str__ != '':
+        --terminal-threshold=$computation.terminal_threshold
+      #end if
+      #if $computation.indel_penalty.__str__ != '':
+        --indel-penalty=$computation.indel_penalty
+      #end if
+      #if $computation.indel_endlength.__str__ != '':
+        --indel-endlength=$computation.indel_endlength
+      #end if
+      #if $computation.max_middle_insertions.__str__ != '':
+        --max-middle-insertions=$computation.max_middle_insertions
+      #end if
+      #if $computation.max_middle_deletions.__str__ != '':
+        --max-middle-deletions=$computation.max_middle_deletions
+      #end if
+      #if $computation.max_end_insertions.__str__ != '':
+        --max-end-insertions=$computation.max_end_insertions
+      #end if
+      #if $computation.max_end_deletions.__str__ != '':
+        --max-end-deletions=$computation.max_end_deletions
+      #end if
+      #if $computation.suboptimal_levels.__str__ != '':
+        --suboptimal-levels=$computation.suboptimal_levels
+      #end if
+      #if $computation.adapter_strip.__str__ != '':
+        --adapter-strip=$computation.adapter_strip
+      #end if
+      #if $computation.trim_mismatch_score.__str__ != '':
+        --trim-mismatch-score=$computation.trim_mismatch_score
+      #end if
+      ## TODO - do we need these options (Is it tally XOR runlength?):
+      ## --tallydir=  --use-tally=tally
+      ## --runlengthdir  --use-runlength=runlength
+      #if $computation.use_tally != None and len($computation.use_tally.__str__) > 0:
+        ##--tallydir $os.path.dirname($computation.use_tally) --use-tally $os.path.basename($computation.use_tally)
+        --use-tally=$computation.use_tally
+      #end if
+      ## gmap options
+      #if $computation.gmap_mode.__str__ != '' and  $computation.gmap_mode.__str__ != 'None':
+        --gmap-mode='$computation.gmap_mode'
+      #end if
+      #if $computation.trigger_score_for_gmap.__str__ != '':
+        --trigger-score-for-gmap=$computation.trigger_score_for_gmap
+      #end if
+      #if $computation.max_gmap_pairsearch.__str__ != '' and $re.search("pairsearch",$computation.gmap_mode):
+        --max-gmap-pairsearch=$computation.max_gmap_pairsearch
+      #end if
+      #if $computation.max_gmap_terminal.__str__ != '' and $re.search("terminal",$computation.gmap_mode):
+        --max-gmap-terminal=$computation.max_gmap_terminal
+      #end if
+      #if $computation.max_gmap_improvement.__str__ != '' and $re.search("improv",$computation.gmap_mode):
+        --max-gmap-improvement=$computation.max_gmap_improvement
+      #end if
+      #if $computation.microexon_spliceprob.__str__ != '':
+        --microexon-spliceprob=$computation.microexon_spliceprob
+      #end if
+    #end if
+    #if $splicing.options == "advanced":
+      $splicing.novelsplicing
+      #if $splicing.localsplicedist.__str__ != '':
+        --localsplicedist=$splicing.localsplicedist
+      #end if
+      #if $splicing.local_splice_penalty.__str__ != '':
+        --local-splice-penalty=$splicing.local_splice_penalty
+      #end if
+      #if $splicing.distant_splice_penalty.__str__ != '':
+        --distant-splice-penalty=$splicing.distant_splice_penalty
+      #end if
+      #if $splicing.local_splice_endlength.__str__ != '':
+        --local-splice-endlength=$splicing.local_splice_endlength
+      #end if
+      #if $splicing.distant_splice_endlength.__str__ != '':
+        --distant-splice-endlength=$splicing.distant_splice_endlength
+      #end if
+      #if $splicing.distant_splice_identity.__str__ != '':
+        --distant-splice-identity=$splicing.distant_splice_identity
+      #end if
+    #end if
+    #if $output.options == "advanced":
+      #if $output.npath.__str__ != '':
+        --npath=$output.npath
+      #end if
+      $output.quiet_if_excessive
+      $output.show_refdiff
+      $output.clip_overlap
+    #end if
+    #if $result.format == "sam":
+      --format=sam
+      $result.no_sam_headers
+      #if $result.read_group_id.__str__.strip != '':
+         --read-group-id='$result.read_group_id'
+      #end if
+      #if $result.read_group_name.__str__ != '':
+         --read-group-name='$result.read_group_name'
+      #end if
+      #if $result.read_group_library.__str__ != '':
+         --read-group-library='$result.read_group_library'
+      #end if
+      #if $result.read_group_platform.__str__ != '':
+         --read-group-platform='$result.read_group_platform'
+      #end if
+      #if $result.quality_shift.__str__ != '':
+        --quality-shift=$result.quality_shift
+      #end if
+    #elif $result.format == "goby":
+      #if $result.goby_output.__str__ != '':
+        --goby-output='$result.goby_output'
+      #end if
+      #if $result.creads_window_start.__str__ != '':
+        --creads-window-start=$result.creads_window_start
+      #end if
+      #if $result.creads_window_end.__str__ != '':
+        --creads-window-end=$result.creads_window_end
+      #end if
+      $result.creads_complement
+    #end if
+    #if $results.split_output == 'yes':
+      --split-output=gsnap_out
+      #if $results.fails.choice == 'nofails':
+        --nofails
+      #elif $results.fails.choice == 'failsonly':
+        --failsonly
+      #end if
+      $results.fails_as_input
+    #else
+      #if $results.fails.choice == 'nofails':
+        --nofails
+      #elif $results.fails.choice == 'failsonly':
+        --failsonly
+        $results.fails.fails_as_input
+      #end if
+    #end if
+    #if $seq.format == "gsnap_fasta":
+      $seq.circularinput $seq.gsnap
+    #else if $seq.format == "fastq":
+      #if $seq.barcode_length.__str__ != '':
+        --barcode-length=$seq.barcode_length
+      #end if
+      #if $seq.fastq_id_start.__str__ != '':
+        --fastq-id-start=$seq.fastq_id_start
+      #end if
+      #if $seq.fastq_id_end.__str__ != '':
+        --fastq-id-end=$seq.fastq_id_end
+      #end if
+      #if $seq.filter_chastity.__str__ != 'off':
+        --filter-chastity=$seq.filter_chastity
+      #end if
+      #if $seq.paired.ispaired.__str__ == 'yes':
+        #if $seq.paired.pairmax_dna.__str__ != '':
+          --pairmax-dna=$seq.paired.pairmax_dna
+        #end if
+        #if $seq.paired.pairmax_rna.__str__ != '':
+          --pairmax-rna=$seq.paired.pairmax_rna
+        #end if
+        $seq.fastq $seq.paired.fastq
+      #else
+        $seq.fastq
+      #end if
+    #end if
+    #if $results.split_output == 'yes':
+      2> $gsnap_stderr
+    #else:
+      #if $results.fails.choice.__str__ == 'failsonly' and $results.fails.fails_as_input.__str__ != '':
+        2> $gsnap_stderr > $gsnap_fq
+      #else
+        2> $gsnap_stderr > $gsnap_out
+      #end if
+    #end if
+
+  </command>
+  <inputs>
+    <!-- Input data -->
+    <conditional name="seq">
+      <param name="format" type="select" label="&lt;H2&gt;Input Sequences&lt;/H2&gt;Select the input format" help="">
+        <option value="fastq">Fastq</option>
+        <!--
+        <option value="goby">Goby compact-reads</option>
+        -->
+        <option value="gsnap_fasta">GNSAP fasta</option>
+      </param>
+      <when value="fastq">
+        <param name="fastq" type="data" format="fastq" label="Select a fastq dataset" />
+        <conditional name="paired">
+          <param name="ispaired" type="boolean" truevalue="yes" falsevalue="no" checked="false" label="Use Paired Reads?"/>
+          <when value="no"/>
+          <when value="yes">
+            <param name="fastq" type="data" format="fastq" label="Select the paired reads reverse dataset" />
+            <param name="orientation" type="select" label="Orientation of paired-end reads" help="">
+              <option value="FR">fwd-rev, typical Illumina default</option>
+              <option value="RF">rev-fwd, for circularized inserts</option>
+              <option value="FF">fwd-fwd, same strand</option>
+            </param>
+            <param name="pairmax_dna"  type="integer" value="" optional="true" label="Max total genomic length for DNA-Seq paired reads, or other reads without splicing (default 1000)." help="Used if no splice file is provided and novelsplicing is off."/>
+            <param name="pairmax_rna"  type="integer" value="" optional="true" label="Max total genomic length for RNA-Seq paired reads, or other reads that could have a splice (default 200000)." help="Used novelspliceing is specified or a splice file is provided.  Should probably match the value for localsplicedist."/>
+          </when>
+        </conditional>
+        <param name="barcode_length" type="integer" value="" optional="true"  label="Amount of barcode to remove from start of read (default 0)" />
+        <param name="fastq_id_start" type="integer" value="" optional="true"  label="Starting field  of identifier in FASTQ header, whitespace-delimited, starting from 1" />
+        <param name="fastq_id_end" type="integer" value="" optional="true"  label="Ending field  of identifier in FASTQ header, whitespace-delimited, starting from 1" 
+             help="Examples:
+                  &lt;br&gt;@HWUSI-EAS100R:6:73:941:1973#0/1
+                  &lt;br&gt; . start=1, end=1 (default)  => identifier is HWUSI-EAS100R:6:73:941:1973#0/1
+                  &lt;br&gt;@SRR001666.1 071112_SLXA-EAS1_s_7:5:1:817:345 length=36
+                  &lt;br&gt; . start=1, end=1  => identifier is SRR001666.1
+                  &lt;br&gt; . start=2, end=2  => identifier is 071112_SLXA-EAS1_s_7:5:1:817:345
+                  &lt;br&gt; . start=1, end=2  => identifier is SRR001666.1 071112_SLXA-EAS1_s_7:5:1:817:345"
+        />
+        <param name="filter_chastity" type="select" label="Skip reads marked by the Illumina chastity program" 
+               help="String after the accession having a  'Y'  after the first colon, like this:  
+                    &lt;br&gt;@accession 1:Y:0:CTTGTA
+                    &lt;br&gt;where the  'Y'  signifies filtering by chastity.
+                    &lt;br&gt; For 'either', a  'Y'  on either end of a paired-end read will be filtered.
+                    &lt;br&gt;  For 'both', a  'Y'  is required on both ends of a paired-end read (or on the only end of a single-end read)"
+          >
+          <option value="off">off - no filtering</option>
+          <option value="either">either - a 'Y' on either end of a paired-end read</option>
+          <option value="both">both - a 'Y' is required on both ends of a paired-end read or the only end of a single-end read</option>
+        </param>
+      </when>
+      <!--
+      <when value="goby">
+      </when>
+      -->
+      <when value="gsnap_fasta">
+        <param name="gsnap" type="data" format="fasta" label="Select a single-end dataset" help="GSNAP fasta must have the sequence entirely on one line, a second line is interpreted as the paired-end sequence"/>
+        <param name="circularinput" type="boolean" checked="false" truevalue="--circular-input=true" falsevalue="" label="Circular-end data (paired reads are on same strand)"/>
+      </when>
+      
+    </conditional>
+    <param name="mapq_unique_score"  type="integer" value="" optional="true" label="MAPQ score threshold" 
+                help="For multiple results, consider as a unique result if only one of the results has a MAPQ score equal or greater than this
+                      (if not selected, then reports all multiple results, up to npaths)" />
+
+    <!-- GMAPDB for alignment -->
+    <conditional name="refGenomeSource">
+     <param name="genomeSource" type="select" label="&lt;HR&gt;&lt;H2&gt;Align To&lt;/H2&gt;Will you select a reference genome from your history or use a built-in index?" help="Built-ins were indexed using default options">
+        <option value="indexed">Use a built-in index</option>
+        <option value="gmapdb">Use a gmapdb from your history</option>
+      </param>
+      <when value="indexed">
+        <param name="gmapindex" type="select" label="Select a reference genome" help="if your genome of interest is not listed - contact Galaxy team">
+          <options from_file="gmap_indices.loc">
+            <column name="uid" index="0" />
+            <column name="dbkey" index="1" />
+            <column name="name" index="2" />
+            <column name="kmers" index="3" />
+            <column name="maps" index="4" />
+            <column name="snps" index="5" />
+            <column name="value" index="6" />
+          </options>
+        </param>
+
+        <param name="kmer" type="select" data_ref="gmapindex" label="kmer size" help="Defaults to highest available kmer size">
+          <options from_file="gmap_indices.loc">
+            <column name="name" index="3"/>
+            <column name="value" index="3"/>
+            <filter type="param_value" ref="gmapindex" column="6"/>
+            <filter type="multiple_splitter" column="3" separator=","/>
+            <filter type="add_value" name="" value=""/>
+            <filter type="sort_by" column="3"/>
+          </options>
+        </param>
+
+        <param name="mode" type="select" label="Alignment mode" help="Assumes cmetindex and atoiindex were run on the gmap datatbase.">
+            <option value="">standard</option>
+            <option value="cmet-stranded">cmet-stranded   for bisulfite-treated DNA reads (tolerance to C-to-T changes)</option>
+            <option value="cmet-nonstranded">cmet-nonstranded   for bisulfite-treated DNA reads (tolerance to C-to-T changes)</option>
+            <option value="atoi-stranded">atoi-stranded   for RNA-editing tolerance (A-to-G changes)</option>
+            <option value="atoi-nonstranded">atoi-nonstranded   for RNA-editing tolerance (A-to-G changes)</option>
+        </param>
+
+        <conditional name="use_splicing">
+          <param name="src" type="select" label="&lt;HR&gt;Known Splicesite and Introns" 
+                 help="Look for splicing involving known sites or known introns at short or long distances 
+                  See README instructions for the distinction between known sites and known introns">
+            <option value="none" selected="true">None</option>
+            <option value="gmapdb">From the GMAP Database</option>
+            <option value="history">A Map in your history</option>
+          </param>
+          <when value="none"/>
+          <when value="history">
+            <param name="splicemap" type="data" format="splicesites.iit,introns.iit" metadata_name="dbkey" label="Select a splicesite map" 
+              help="built with GMAP IIT"/>
+          </when>
+          <when value="gmapdb">
+            <param name="splicemap" type="select" data_ref="gmapindex" label="Use map for splicing involving known sites or known introns" help="">
+              <options from_file="gmap_indices.loc">
+                <column name="name" index="4"/>
+                <column name="value" index="4"/>
+                <filter type="param_value" ref="gmapindex" column="6"/>
+                <filter type="multiple_splitter" column="4" separator=","/>
+                <filter type="add_value" name="" value=""/>
+                <filter type="sort_by" column="4"/>
+              </options>
+            </param>
+          </when>
+        </conditional>
+
+        <conditional name="use_snps">
+          <param name="src" type="select" label="&lt;HR&gt;Known SNPs" help="for SNP tolerant alignments">
+            <option value="none" selected="true">None</option>
+            <option value="gmapdb">From the GMAP Database</option>
+            <option value="history">A SNP Index in your history</option>
+          </param>
+          <when value="none"/>
+          <when value="history">
+            <param name="snpindex" type="data" format="gmapsnpindex" metadata_name="dbkey" label="Select a snpindex" 
+              help="built with GMAP SNP Index"/>
+          </when>
+          <when value="gmapdb">
+            <param name="snpindex" type="select" data_ref="gmapindex" label="Use database containing known SNPs" help="">
+              <options from_file="gmap_indices.loc">
+                <column name="name" index="5"/>
+                <column name="value" index="5"/>
+                <filter type="param_value" ref="gmapindex" column="6"/>
+                <filter type="multiple_splitter" column="5" separator=","/>
+                <filter type="add_value" name="" value=""/>
+                <filter type="sort_by" column="5"/>
+              </options>
+            </param>
+          </when>
+        </conditional>
+
+      </when>
+      <when value="gmapdb">
+        <param name="gmapdb" type="data" format="gmapdb" metadata_name="dbkey" label="Select a gmapdb" 
+              help="A GMAP database built with GMAP Build"/>
+        <param name="kmer" type="select" data_ref="gmapdb" label="kmer size" help="Defaults to highest available kmer size">
+          <options>
+            <filter type="data_meta" ref="gmapdb" key="kmers" multiple="True" separator=","/>
+          </options>
+        </param>
+
+        <param name="mode" type="select" label="Alignment mode" help="Assumes cmetindex and atoiindex were run on the gmap datatbase.">
+            <option value="">standard</option>
+            <option value="cmet-stranded">cmet-stranded   for bisulfite-treated DNA reads (tolerance to C-to-T changes)</option>
+            <option value="cmet-nonstranded">cmet-nonstranded   for bisulfite-treated DNA reads (tolerance to C-to-T changes)</option>
+            <option value="atoi-stranded">atoi-stranded   for RNA-editing tolerance (A-to-G changes)</option>
+            <option value="atoi-nonstranded">atoi-nonstranded   for RNA-editing tolerance (A-to-G changes)</option>
+        </param>
+
+        <conditional name="use_splicing">
+          <param name="src" type="select" label="&lt;HR&gt;Known Splicesite and Introns" 
+                 help="Look for splicing involving known sites or known introns at short or long distances 
+                  See README instructions for the distinction between known sites and known introns">
+            <option value="none" selected="true">None</option>
+            <option value="gmapdb">From the GMAP Database</option>
+            <option value="history">A Map in your history</option>
+          </param>
+          <when value="none"/>
+          <when value="history">
+            <param name="splicemap" type="data" format="splicesites.iit,introns.iit" metadata_name="dbkey" label="Select a splicesite map" 
+              help="built with GMAP IIT"/>
+          </when>
+          <when value="gmapdb">
+            <param name="splicemap" type="select"  data_ref="gmapdb" label="Use map for splicing involving known sites or known introns" help="">
+              <options>
+                <filter type="data_meta" ref="gmapdb" key="maps" multiple="True"/>
+              </options>
+            </param>
+          </when>
+        </conditional>
+
+        <conditional name="use_snps">
+          <param name="src" type="select" label="&lt;HR&gt;Known SNPs" help="for SNP tolerant alignments">
+            <option value="none" selected="true">None</option>
+            <option value="gmapdb">From the GMAP Database</option>
+            <option value="history">A SNP Index in your history</option>
+          </param>
+          <when value="none"/>
+          <when value="history">
+            <param name="snpindex" type="data" format="gmapsnpindex" metadata_name="dbkey" label="Select a snpindex" 
+              help="built with GMAP SNP Index"/>
+          </when>
+          <when value="gmapdb">
+            <param name="snpindex" type="select"  data_ref="gmapdb" label="Use database containing known SNPs" help="">
+              <options>
+                <filter type="data_meta" ref="gmapdb" key="snps" multiple="True" separator=","/>
+              </options>
+            </param>
+          </when>
+        </conditional>
+
+      </when>
+    </conditional>
+
+    <!-- Computation options -->
+    <conditional name="computation">
+      <param name="options" type="select" label="&lt;HR&gt;Computational Settings" help="">
+        <option value="default">Use default settings</option>
+        <option value="advanced">Set Computation Options</option>
+      </param>
+      <when value="default"/>
+      <when value="advanced">
+         <param name="max_mismatches" type="float" value="" optional="true" label="Maximum number of mismatches allowed (uses default when negative)" 
+              help="Defaults to the ultrafast level of ((readlength+2)/12 - 2)).
+                    If specified between 0.0 and 1.0, then treated as a fraction
+                    of each read length.  Otherwise, treated as an integral number
+                    of mismatches (including indel and splicing penalties)
+                    For RNA-Seq, you may need to increase this value slightly
+                    to align reads extending past the ends of an exon.">
+            <validator type="in_range" message="The mismatches must >= 0." min="0."/>
+         </param>
+         <param name="query_unk_mismatch" type="boolean" checked="false" truevalue="--query-unk-mismatch=1" falsevalue="" label="Count unknown (N) characters in the query as a mismatch"/>
+         <param name="genome_unk_mismatch" type="boolean" checked="true" truevalue="" falsevalue="--genome-unk-mismatch=0" label="Count unknown (N) characters in the genome as a mismatch"/>
+         <param name="terminal_threshold"  type="integer" value="" optional="true" label="Threshold for searching for a terminal alignment (default 3)" 
+                help="(from one end of the read to the best possible position at the other end).  To turn off terminal alignments, set this to a high value." />
+         <param name="indel_penalty"  type="integer" value="" optional="true" label="Penalty for an indel (default 2)" 
+                help="Counts against mismatches allowed.  To find indels, make indel-penalty less than or equal to max-mismatches.  A value &lt; 2 can lead to false positives at read ends" />
+         <param name="indel_endlength"  type="integer" value="" optional="true" label="Minimum length at end required for indel alignments (default 4)" />
+         <param name="max_middle_insertions"  type="integer" value="" optional="true" label="Maximum number of middle insertions allowed (default 9)" />
+         <param name="max_middle_deletions"  type="integer" value="" optional="true" label="Maximum number of middle deletions allowed (default 30)" />
+         <param name="max_end_insertions"  type="integer" value="" optional="true" label="Maximum number of end insertions allowed (default 3)" />
+         <param name="max_end_deletions"  type="integer" value="" optional="true" label="Maximum number of end deletions allowed (default 6)" />
+         <param name="suboptimal_levels"  type="integer" value="" optional="true" label="Report suboptimal hits beyond best hit (default 0)"
+                help="All hits with best score plus suboptimal-levels are reported" />
+         <param name="adapter_strip"  type="select" label="Method for removing adapters from reads" 
+                help="paired removes adapters from paired-end reads if a concordant or paired alignment cannot be found from the original read">
+           <option value="paired" selected="true">paired</option>
+           <option value="off">off</option>
+         </param>
+         <param name="trim_mismatch_score" type="integer" value="" optional="true" label="Score to use for mismatches when trimming at ends (default is -3)" 
+                help="to turn off trimming, specify 0"/>
+         <param name="use_tally" type="data" format="tally.iit" optional="true" metadata_name="dbkey" label="Select a tally IIT file to resolve concordant multiple results" 
+              help="generated by gsnap_tally and iit_store"/>
+
+         <!--
+           tallydir=STRING              Directory for tally IIT file to resolve concordant multiple results (default is
+                                              location of genome index files specified using -D and -d).  Note: can
+                                              just give full path name to use-tally instead.
+           use-tally=STRING             Use this tally IIT file to resolve concordant multiple results
+           runlengthdir=STRING          Directory for runlength IIT file to resolve concordant multiple results (default is
+                                              location of genome index files specified using -D and -d).  Note: can
+                                              just give full path name to use-runlength instead.
+           use-runlength=STRING         Use this runlength IIT file to resolve concordant multiple results
+         -->
+         
+         <!-- Options for GMAP alignment within GSNAP -->
+          <param name="gmap_mode" type="select" multiple="true" optional="true" display="checkboxes" label="Cases to use GMAP for complex alignments containing multiple splices or indels" 
+                 help="Default: pairsearch,terminal,improve">
+            <option value="pairsearch" selected="true">pairsearch</option>
+            <option value="terminal" selected="true">terminal</option>
+            <option value="improve" selected="true">improve</option>
+          </param>
+          <param name="trigger_score_for_gmap" type="integer" value="" optional="true" label="GMAP pairsearch threshold (default 5)" 
+                 help="Try GMAP pairsearch on nearby genomic regions if best score (the total of both ends if paired-end) exceeds this value (default 5)" />
+          <param name="max_gmap_pairsearch" type="integer" value="" optional="true" label="GMAP pairsearch threshold (default 3)" 
+                 help="Perform GMAP pairsearch on nearby genomic regions up to this many candidate ends (default 3)." />
+          <param name="max_gmap_terminal" type="integer" value="" optional="true" label="GMAP terminal threshold (default 3)" 
+                 help="Perform GMAP terminal on nearby genomic regions up to this many candidate ends (default 3)." />
+          <param name="max_gmap_improvement" type="integer" value="" optional="true" label="GMAP improvement threshold (default 3)" 
+                 help="Perform GMAP improvement on nearby genomic regions up to this many candidate ends (default 3)." />
+          <param name="microexon_spliceprob"  type="float" value="" optional="true" label="GMAP microexons threshold (default .90)" 
+                 help="Allow microexons only if one of the splice site probabilities is greater than this value." >
+            <validator type="in_range" message="The microexons  probability must be between 0. and 1." min="0." max="1."/>
+          </param>
+      </when>
+    </conditional>
+
+    <conditional name="splicing">
+      <param name="options" type="select" label="&lt;HR&gt;Splicing options for RNA-Seq" help="">
+        <option value="default">Use default settings</option>
+        <option value="advanced">Set Splicing Options</option>
+      </param>
+      <when value="default"/>
+      <when value="advanced">
+         <!-- Splicing options for RNA-Seq -->
+         <!-- use-splicing This should be either a select list from the gmapdb maps or a data type using splicesdir and use-splicing --> 
+         <!-- Neither novel splicing (-N) nor known splicing (-s) turned on => assume reads are DNA-Seq (genomic) -->
+         <param name="novelsplicing" type="boolean" checked="false" truevalue="--novelsplicing=1" falsevalue="" label="Look for novel splicing "/>
+         <param name="localsplicedist"  type="integer" value="" optional="true" label="Definition of local novel splicing event (default 200000)"/>
+         <param name="local_splice_penalty"  type="integer" value="" optional="true" label="Penalty for a local splice (default 0).  Counts against mismatches allowed"/>
+         <param name="distant_splice_penalty"  type="integer" value="" optional="true" label="Penalty for a distant splice (default 3).  Counts against mismatches allowed"
+                help="A distant splice is one where the intron length exceeds the value of localsplicedist or is an
+                     inversion, scramble, or translocation between two different chromosomes. Counts against mismatches allowed"/>
+         <param name="distant_splice_endlength"  type="integer" value="" optional="true" label="Minimum length at end required for distant spliced alignments"
+                help="(default 16, min is the kmer length)"/>
+         <param name="shortend_splice_endlength"  type="integer" value="" optional="true" label="Minimum length at end required for short-end spliced alignments"
+                help="(default 2, but unless known splice sites are provided,  GSNAP may still need the end length to be the value of kmer size to find a given splice"/>
+         <param name="distant_splice_identity"  type="float" value="" optional="true" label="Minimum identity at end required for distant spliced alignments (default 0.95)"/>
+         <param name="antistranded_penalty"  type="integer" value="" optional="true" label="Penalty for antistranded splicing when using stranded RNA-Seq protocols" 
+                help="A positive value, such as 1, expects antisense on the first read and sense on the second read.  
+                      Default is 0, which treats sense and antisense equally well"/>
+      </when>
+    </conditional>
+
+    <!-- Output data -->
+    <conditional name="output">
+      <param name="options" type="select" label="&lt;HR&gt;&lt;H2&gt;Output&lt;/H2&gt;Output options for RNA-Seq" help="">
+        <option value="default">Use default settings</option>
+        <option value="advanced">Set Output Options</option>
+      </param>
+      <when value="default"/>
+      <when value="advanced">
+        <param name="npath"  type="integer" value="" optional="true" label="Maximum number of paths to print (default 100)"/>
+        <param name="quiet_if_excessive" type="boolean" checked="false" truevalue="--quiet-if-excessive" falsevalue="" label="Quiet if Excessive" 
+               help="If more than maximum number of paths are found, then nothing is printed."/>
+        <param name="show_refdiff" type="boolean" checked="false" truevalue="--show-refdiff" falsevalue="" label="Show SNP-tolerant alignment" 
+               help="For GSNAP output in SNP-tolerant alignment, shows all differences relative to the reference genome as lower case (otherwise, it shows all differences relative to both the reference and alternate genome)"/>
+        <param name="clip_overlap" type="boolean" checked="false" truevalue="--clip-overlap" falsevalue="" label="Clip Overlap" 
+               help="For paired-end reads whose alignments overlap, clip the overlapping region."/>
+      </when>
+    </conditional>
+    <conditional name="result">
+      <param name="format" type="select" label="Select the output format" help="">
+        <option value="sam">SAM</option>
+        <!--  goby should only be an option if the input is in goby format
+        <option value="goby">Goby</option>
+        -->
+        <option value="gsnap">GSNAP default output</option>
+      </param>
+      <when value="gsnap">
+      </when>
+      <when value="sam">
+        <param name="no_sam_headers" type="boolean" truevalue="--no-sam-headers" falsevalue="" checked="false" label="Do not print headers beginning with '@'"/>
+        <param name="read_group_id" type="text" value="" optional="true" label="Value to put into read-group id (RG-ID) field"/>
+        <param name="read_group_name" type="text" value="" optional="true" label="Value to put into read-group name (RG-SM) field"/>
+        <param name="read_group_library" type="text" value="" optional="true" label="Value to put into read-group library (RG-LB) field"/>
+        <param name="read_group_platform" type="text" value="" optional="true" label="Value to put into read-group library platform (RG-PL) field"/>
+        <param name="quality_shift"  type="integer" value="" optional="true" label="Shift FASTQ quality scores by this amount in SAM output (default -31)"/>
+      </when>
+      <!--
+      <when value="goby">
+        <param name="goby_output" type="text" value="" label="Basename for Goby output files"/>
+        <param name="creads_window_start"  type="integer" value="" optional="true" label="Compact reads window start (default: 0=start of file)"/>
+        <param name="creads_window_end"  type="integer" value="" optional="true" label="Compact reads window end (default: 0=end of file)"/>
+        <param name="creads_complement" type="boolean" truevalue="-\-creads-complement" falsevalue="" checked="false" label="Complement read sequences (without reversing)"/>
+      </when>
+      -->
+    </conditional>
+    <!-- TODO combine fails and split_output -->
+
+    <conditional name="results">
+      <param name="split_output" type="select" label="&lt;HR&gt;Split outputs" 
+       help="Separate outputs for: nomapping, halfmapping_uniq, halfmapping_mult, unpaired_uniq, unpaired_mult, paired_uniq, paired_mult, concordant_uniq, and concordant_mult results"> 
+        <option value="no">no</option>
+        <option value="yes">yes</option>
+      </param>
+      <when value="no">
+        <conditional name="fails">
+          <param name="choice" type="select" label="How to deal with fails" help="">
+            <option value="default">default - include them in results</option>
+            <option value="nofails">nofails - exclude fails from results</option>
+            <option value="failsonly">failsonly - only output failing results</option>
+          </param>
+          <when value="default"/>
+          <when value="nofails"/>
+          <when value="failsonly">
+            <param name="fails_as_input" type="boolean" truevalue="--fails-as-input" falsevalue="" checked="false" label="Print completely failed alignments as input FASTA or FASTQ format" 
+              help=""/> 
+          </when>
+        </conditional>
+      </when>
+      <when value="yes">
+        <conditional name="fails">
+          <param name="choice" type="select" label="How to deal with fails" help="">
+            <option value="default">default - include them in results</option>
+            <option value="nofails">nofails - exclude fails from results</option>
+            <option value="failsonly">failsonly - only output failing results</option>
+          </param>
+          <when value="default"/>
+          <when value="nofails"/>
+          <when value="failsonly"/>
+        </conditional>
+        <param name="fails_as_input" type="boolean" truevalue="--fails-as-input" falsevalue="" checked="false" label="Print completely failed alignments as input FASTA or FASTQ format" 
+              help=""/> 
+      </when>
+    </conditional>
+
+  </inputs>
+  <outputs>
+    <data format="txt" name="gsnap_stderr" label="${tool.name} on ${on_string}: gsnap.log"/>
+
+    <data format="txt" name="gsnap_out" label="${tool.name} on ${on_string} ${result.format}" >
+      <filter>(results['split_output'] == 'no' and (results['fails']['choice'] != 'failsonly' or results['fails']['fails_as_input'] == False))</filter>
+      <change_format>
+        <when input="result['format']" value="sam" format="sam"/>
+        <when input="result['format']" value="gsnap" format="gsnap"/>
+      </change_format>
+    </data>
+
+    <data format="fastq" name="gsnap_fq" label="${tool.name} on ${on_string} fails.fq" >
+      <filter>(results['split_output'] == 'no' and results['fails']['choice'] == 'failsonly' and results['fails']['fails_as_input'] == True)</filter>
+    </data>
+
+    <!-- nomapping, halfmapping_uniq, halfmapping_mult, unpaired_uniq, unpaired_mult, paired_uniq, paired_mult, concordant_uniq, concordant_mult -->
+
+    <data format="txt" name="unpaired_mult" label="${tool.name} on ${on_string} unpaired_mult.${result.format}"  from_work_dir="gsnap_out.unpaired_mult">
+      <filter>(results['split_output'] == 'yes')</filter>
+      <change_format>
+        <when input="result['format']" value="sam" format="sam"/>
+        <when input="result['format']" value="gsnap" format="gsnap"/>
+      </change_format>
+    </data>
+    <data format="txt" name="unpaired_uniq" label="${tool.name} on ${on_string} unpaired_uniq.${result.format}"  from_work_dir="gsnap_out.unpaired_uniq">
+      <filter>(results['split_output'] == 'yes')</filter>
+      <change_format>
+        <when input="result['format']" value="sam" format="sam"/>
+        <when input="result['format']" value="gsnap" format="gsnap"/>
+      </change_format>
+    </data>
+    <data format="txt" name="unpaired_transloc" label="${tool.name} on ${on_string} unpaired_transloc.${result.format}"  from_work_dir="gsnap_out.unpaired_transloc">
+      <filter>(results['split_output'] == 'yes')</filter>
+      <change_format>
+        <when input="result['format']" value="sam" format="sam"/>
+        <when input="result['format']" value="gsnap" format="gsnap"/>
+      </change_format>
+    </data>
+    <data format="txt" name="halfmapping_mult" label="${tool.name} on ${on_string} halfmapping_mult.${result.format}"  from_work_dir="gsnap_out.halfmapping_mult">
+      <filter>(results['split_output'] == 'yes' and seq['format'] == 'fastq' and seq['paired']['ispaired'] == True)</filter>
+      <change_format>
+        <when input="result['format']" value="sam" format="sam"/>
+        <when input="result['format']" value="gsnap" format="gsnap"/>
+      </change_format>
+    </data>
+    <data format="txt" name="halfmapping_uniq" label="${tool.name} on ${on_string} halfmapping_uniq.${result.format}"  from_work_dir="gsnap_out.halfmapping_uniq">
+      <filter>(results['split_output'] == 'yes' and seq['format'] == 'fastq' and seq['paired']['ispaired'] == True)</filter>
+      <change_format>
+        <when input="result['format']" value="sam" format="sam"/>
+        <when input="result['format']" value="gsnap" format="gsnap"/>
+      </change_format>
+    </data>
+    <data format="txt" name="halfmapping_transloc" label="${tool.name} on ${on_string} halfmapping_transloc.${result.format}"  from_work_dir="gsnap_out.halfmapping_transloc">
+      <filter>(results['split_output'] == 'yes' and seq['format'] == 'fastq' and seq['paired']['ispaired'] == True)</filter>
+      <change_format>
+        <when input="result['format']" value="sam" format="sam"/>
+        <when input="result['format']" value="gsnap" format="gsnap"/>
+      </change_format>
+    </data>
+    <data format="txt" name="paired_mult" label="${tool.name} on ${on_string} paired_mult.${result.format}"  from_work_dir="gsnap_out.paired_mult">
+      <filter>(results['split_output'] == 'yes' and seq['format'] == 'fastq' and seq['paired']['ispaired'] == True)</filter>
+      <change_format>
+        <when input="result['format']" value="sam" format="sam"/>
+        <when input="result['format']" value="gsnap" format="gsnap"/>
+      </change_format>
+    </data>
+    <data format="txt" name="paired_uniq" label="${tool.name} on ${on_string} paired_uniq.${result.format}"  from_work_dir="gsnap_out.paired_uniq">
+      <filter>(results['split_output'] == 'yes' and seq['format'] == 'fastq' and seq['paired']['ispaired'] == True)</filter>
+      <change_format>
+        <when input="result['format']" value="sam" format="sam"/>
+        <when input="result['format']" value="gsnap" format="gsnap"/>
+      </change_format>
+    </data>
+    <data format="txt" name="paired_transloc" label="${tool.name} on ${on_string} paired_transloc.${result.format}"  from_work_dir="gsnap_out.paired_transloc">
+      <filter>(results['split_output'] == 'yes' and seq['format'] == 'fastq' and seq['paired']['ispaired'] == True)</filter>
+      <change_format>
+        <when input="result['format']" value="sam" format="sam"/>
+        <when input="result['format']" value="gsnap" format="gsnap"/>
+      </change_format>
+    </data>
+
+    <data format="txt" name="concordant_mult" label="${tool.name} on ${on_string} concordant_mult.${result.format}"  from_work_dir="gsnap_out.concordant_mult">
+      <filter>(results['split_output'] == 'yes' and seq['format'] == 'fastq' and seq['paired']['ispaired'] == True)</filter>
+      <change_format>
+        <when input="result['format']" value="sam" format="sam"/>
+        <when input="result['format']" value="gsnap" format="gsnap"/>
+      </change_format>
+    </data>
+    <data format="txt" name="concordant_uniq" label="${tool.name} on ${on_string} concordant_uniq.${result.format}"  from_work_dir="gsnap_out.concordant_uniq">
+      <filter>(results['split_output'] == 'yes' and seq['format'] == 'fastq' and seq['paired']['ispaired'] == True)</filter>
+      <change_format>
+        <when input="result['format']" value="sam" format="sam"/>
+        <when input="result['format']" value="gsnap" format="gsnap"/>
+      </change_format>
+    </data>
+    <data format="txt" name="concordant_transloc" label="${tool.name} on ${on_string} concordant_transloc.${result.format}"  from_work_dir="gsnap_out.concordant_transloc">
+      <filter>(results['split_output'] == 'yes' and seq['format'] == 'fastq' and seq['paired']['ispaired'] == True)</filter>
+      <change_format>
+        <when input="result['format']" value="sam" format="sam"/>
+        <when input="result['format']" value="gsnap" format="gsnap"/>
+      </change_format>
+    </data>
+
+    <data format="txt" name="nomapping" label="${tool.name} on ${on_string} nomapping.${result.format}"  from_work_dir="gsnap_out.nomapping">
+      <filter>(results['split_output'] == 'yes' and results['fails_as_input'] == False)</filter>
+      <change_format>
+        <when input="result['format']" value="sam" format="sam"/>
+        <when input="result['format']" value="gsnap" format="gsnap"/>
+      </change_format>
+    </data>
+
+    <data format="fastq" name="nomapping_fq" label="${tool.name} on ${on_string} nomapping.fq"  from_work_dir="gsnap_out.nomapping.fq">
+      <filter>(results['split_output'] == 'yes' and seq['format'] == 'fastq' and seq['paired']['ispaired'] == False)</filter>
+    </data>
+
+    <data format="fastq" name="nomapping_1_fq" label="${tool.name} on ${on_string} nomapping.1.fq"  from_work_dir="gsnap_out.nomapping.1.fq">
+      <filter>(results['split_output'] == 'yes' and seq['format'] == 'fastq' and seq['paired']['ispaired'] == True)</filter>
+    </data>
+
+    <data format="fastq" name="nomapping_2_fq" label="${tool.name} on ${on_string} nomapping.2.fq"  from_work_dir="gsnap_out.nomapping.2.fq">
+      <filter>(results['split_output'] == 'yes' and seq['format'] == 'fastq' and seq['paired']['ispaired'] == True)</filter>
+    </data>
+
+    <!-- Will problay need wrapper code to generate composite datatype for goby alignment
+    <data format="gobyalignment" name="goby_alignment" label="${tool.name} on ${on_string} uniq.${result.format}"  from_work_dir="gsnap_out.nomapping">
+      <filter>result['format'] == 'goby'</filter>
+    </data>
+    -->
+
+  </outputs>
+  <tests>
+  </tests> 
+
+  <help>
+
+**What it does**
+
+GSNAP_ (Genomic Short-read Nucleotide Alignment Program) is a short read aligner which can align both single- and paired-end reads as short as 14nt and of arbitrarily long length. It can detect short- and long-distance splicing, including interchromosomal splicing, in individual reads, using probabilistic models or a database of known splice sites. Our program also permits SNP-tolerant alignment to a reference space of all possible combinations of major and minor alleles, and can align reads from bisulfite-treated DNA for the study of methylation state. It is developed by Thomas D. Wu of Genentech, Inc.  
+Publication_ citation: Thomas D. Wu, Serban Nacu "Fast and SNP-tolerant detection of complex variants and splicing in short reads. Bioinformatics. 2010 Apr 1;26(7):873-81. Epub 2010 Feb 10.
+
+.. _GSNAP: http://research-pub.gene.com/gmap/
+.. _Publication: http://bioinformatics.oupjournals.org/cgi/content/full/26/7/873
+http://www.ncbi.nlm.nih.gov/pmc/articles/PMC2844994/?tool=pubmed
+
+------
+
+**Know what you are doing**
+
+.. class:: warningmark
+
+You will want to read the README_
+
+.. _README: http://research-pub.gene.com/gmap/src/README
+
+------
+
+**Input formats**
+
+Input to GSNAP should be either in FASTQ or FASTA format.  
+
+The FASTQ input may include quality scores, which will then be included in SAM
+output, if that output format is selected. 
+
+For FASTA format, you should include one line per read (or end of a
+paired-end read).  The same FASTA file can have a mixture of
+single-end and paired-end reads of varying lengths, if desired.
+
+Single-end reads:
+
+Each FASTA entry should contain one short read per line, like this
+
+>Header information
+AAAACATTCTCCTCCGCATAAGCCTGCGTCAGATTA
+
+Each short read can have a different length.  However, the entire read
+needs to be on a single line, and may not wrap around multiple lines.
+If it extends to a second line, GSNAP will think that the read is
+paired-end.
+
+
+Paired-end reads:
+
+Each FASTA entry should contain two short reads, one per line, like
+this
+
+>Header information
+AAAACATTCTCCTCCGCATAAGCCTAGTAGATTA
+GGCGTAGGTAGAAGTAGAGGTTAAGGCGCGTCAG
+
+By default, the program assumes that the second end is in the reverse
+complement direction compared with the first end.  If they are in the
+same direction, you may need to use the --circular-input (or -c) flag.
+
+( The Galaxy tool: "FASTA Width formatter"  can be used to reformat fasta files to have single line sequences. )
+
+------
+
+**Output formats in GSNAP**
+
+SAM output format
+
+Default GSNAP format
+  See the README_
+
+
+
+
+  </help>
+</tool>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/iit_store.xml	Tue Nov 08 13:26:41 2011 -0600
@@ -0,0 +1,188 @@
+<tool id="gmap_iit_store" name="GMAP IIT" version="2.0.0">
+  <description>Create a map store for known genes or SNPs</description>
+  <requirements>
+      <requirement type="binary">iit_store</requirement>
+      <!-- proposed tag for added datatype dependencies -->
+      <requirement type="datatype">gmap_annotation</requirement>
+      <requirement type="datatype">gmap_snps</requirement>
+      <requirement type="datatype">iit</requirement>
+      <requirement type="datatype">splicesites.iit</requirement>
+      <requirement type="datatype">introns.iit</requirement>
+      <requirement type="datatype">snps.iit</requirement>
+  </requirements>
+  <version_string>iit_store --version</version_string>
+  <command interpreter="command"> /bin/bash $shscript 2> $log </command>
+  <inputs>
+    <!-- Input data -->
+    <conditional name="map">
+      <param name="type" type="select" label="Make map for" >
+        <option value="genes">Introns and Splice sites</option>
+        <option value="snps">SNPs</option>
+        <option value="gmap">GMAP Annotation</option>
+      </param>
+      <when value="genes">
+        <conditional name="src">
+          <param name="src_format" type="select" label="Add splice and intron info from" >
+            <option value="refGeneTable">refGenes table from UCSC table browser</option>
+            <option value="gtf">GTF</option>
+            <option value="gff3">GFF3</option>
+          </param>
+          <when value="refGeneTable">
+            <param name="genes" type="data" format="tabular" label="UCSC refGenes table" help="Example: ftp://hgdownload.cse.ucsc.edu/goldenPath/hg18/database/refGene.txt.gz" />
+            <param name="col_skip" type="integer" value="1" label="Columns to skip before the id/name column (default 1)" 
+                   help="Note that alignment tracks in UCSC sometimes have an extra column on the left.">
+              <validator type="in_range" message="The number of colmumns to skip must >= 0." min="0."/>
+            </param>
+          </when>
+          <when value="gtf">
+            <param name="genes" type="data" format="gtf" label="Genes as GTF" help="" />
+          </when>
+          <when value="gff3">
+            <param name="genes" type="data" format="gff3" label="Genes in GFF3 format" help="" />
+          </when>
+        </conditional> 
+        <param name="maps" type="select" display="checkboxes" multiple="true" force_select="true" label="Add splice and intron info from" >
+          <option value="splicesites" selected="true">splicesites.iit</option>
+          <option value="introns" selected="false">introns.iit</option>
+        </param>
+      </when>
+      <when value="snps">
+        <conditional name="src">
+          <param name="src_format" type="select" label="Add SNP info from" >
+            <option value="snpTable">UCSC SNP Table</option>
+            <option value="snpFile">GMAP SNP File</option>
+          </param>
+          <when value="snpTable">
+            <param name="snps" type="data" format="tabular" label="UCSC SNPs table" help="Example: ftp://hgdownload.cse.ucsc.edu/goldenPath/hg18/database/snp130.txt.gz" />
+            <param name="snpsex" type="data" format="tabular" optional="true" label="UCSC SNP Exceptions table" help="Example: ftp://hgdownload.cse.ucsc.edu/goldenPath/hg18/database/snp130Exceptions.txt.gz" />
+            <param name="weight" type="select" label="Include SNPs with at least Confidence Level" help="">
+              <option value="1" selected="true">1 (High)</option>
+              <option value="2">2 (Medium)</option>
+              <option value="3">3 (All)</option>
+            </param>
+          </when>
+          <when value="snpFile">
+            <param name="snps" type="data" format="gmap_snps" optional="true" label="GMAP SNPs file" 
+               help="Format (3 columns):&lt;B&gt;
+                    &lt;br&gt;>rs62211261 21:14379270 CG
+                    &lt;br&gt;>rs62211262 21:14379281 CG
+                    &lt;/B&gt;
+                    &lt;br&gt;Each line must start with a &gt; character, then be followed by an
+                    identifier (which may have duplicates).  Then there should be the
+                    chromosomal coordinate of the SNP.  (Coordinates are all 1-based, so
+                    the first character of a chromosome is number 1.)  Finally, there
+                    should be the two possible alleles: ( AC AG AT CG CT GT or AN CN GN TN)
+                    &lt;br&gt;These alleles must correspond to the possible nucleotides on the plus strand of the genome.  
+                    If the one of these two letters does not match the allele in the reference
+                    sequence, that SNP will be ignored in subsequent processing as a probable error.
+                    The N stands for any other allele." />
+          </when>
+        </conditional> 
+      </when>
+      <when value="gmap">
+        <param name="annotation" type="data" format="gmap_annotation" label="GMAP mapfile" 
+          help="Format (2 or columns): &lt;B&gt;
+                &lt;br&gt;>label coords optional_tag
+                &lt;br&gt;optional_annotation (which may be zero, one, or multiple lines)
+                &lt;/B&gt;
+                &lt;br&gt;Each line must start with a &gt; character, then be followed by an identifier (which may have duplicates).  
+                &lt;br&gt;Then there should be the chromosomal coordinate range.  (Coordinates are all 1-based, so the first character of a chromosome is number 1.)  
+                &lt;br&gt;The coords should be of the form
+                &lt;br&gt; chr:position
+                &lt;br&gt;  chr:startposition..endposition
+                &lt;br&gt;The term chr:position is equivalent to chr:position..position.  
+                &lt;br&gt;If you want to indicate that the interval is on the minus strand or reverse direction, then endposition may be less than startposition.  
+                " />
+      </when>
+    </conditional> 
+  </inputs>
+  <outputs>
+    <data format="txt" name="log" label="${tool.name} on ${on_string}: log"/>
+    <data format="splicesites.iit" name="splicesites_iit" label="${tool.name} on ${on_string} splicesites.iit">
+      <filter>(map['type'] == 'genes' and 'splicesites' in map['maps'])</filter>
+    </data>
+    <data format="introns.iit" name="introns_iit" label="${tool.name} on ${on_string} introns.iit">
+      <filter>(map['type'] == 'genes' and 'introns' in map['maps'])</filter>
+    </data>
+    <data format="snps.iit" name="snps_iit" label="${tool.name} on ${on_string} snps.iit">
+      <filter>(map['type'] == 'snps')</filter>
+    </data>
+    <data format="iit" name="map_iit" label="${tool.name} on ${on_string} map.iit">
+      <filter>(map['type'] == 'gmap')</filter>
+    </data>
+  </outputs>
+  <configfiles>
+    <configfile name="shscript">
+#!/bin/bash
+#set $catcmd = 'gzcat -f'
+#set $catcmd = 'cat'
+#set $ds = chr(36)
+#set $gt = chr(62)
+#set $lt = chr(60)
+#set $ad = chr(38)
+#set $ep = chr(33)
+#set $toerr = ''.join([$gt,$ad,'2'])
+#import os.path
+#if $map.type == 'genes':
+if [ $ep -e $map.src.genes ]; then echo "$map.src.genes does not exist" $toerr; exit 1; fi
+if [ $ep -s $map.src.genes ]; then echo "$map.src.genes is empty" $toerr; exit 2; fi
+ #if $map.src.src_format == 'refGeneTable':
+  #if 'splicesites' in [ $map.maps.__str__ ]:
+   $catcmd $map.src.genes | psl_splicesites -s $map.src.col_skip | iit_store -o  $splicesites_iit
+  #end if
+  #if 'introns' in [ $map.maps.__str__ ]:
+   $catcmd  $map.src.genes | psl_introns -s $map.src.col_skip | iit_store -o  $introns_iit
+  #end if
+ #elif $map.src.src_format == 'gtf':
+  #if 'splicesites' in [ $map.maps.__str__ ]:
+   $catcmd $map.src.genes | gtf_splicesites | iit_store -o  $splicesites_iit
+  #end if
+  #if 'introns' in [ $map.maps.__str__ ]:
+   $catcmd $map.src.genes | gtf_introns | iit_store -o  $introns_iit
+  #end if
+ #elif $map.src.src_format == 'gff3':
+  #if 'splicesites' in [ $map.maps.__str__ ]:
+   $catcmd $map.src.genes | gff3_splicesites | iit_store -o  $splicesites_iit
+  #end if
+  #if 'introns' in [ $map.maps.__str__ ]:
+   $catcmd $map.src.genes | gff3_introns | iit_store -o  $introns_iit
+  #end if
+ #end if
+#elif $map.type == 'snps':
+if [ $ep -s $map.src.snps ]; then echo "$map.src.snps is empty" $toerr; exit 2; fi
+ #if $map.src.snpsex.__str__ != 'None':
+  $catcmd $map.src.snps | dbsnp_iit -w $map.src.weight -e $map.src.snpsex | iit_store -o  $snps_iit
+ #else:
+  $catcmd $map.src.snps | dbsnp_iit -w $map.src.weight | iit_store -o $snps_iit 
+ #end if
+#else:
+  $catcmd $map.src.snps | iit_store -o $map_iit 
+#end if
+    </configfile>
+  </configfiles>
+
+  <tests>
+  </tests> 
+
+  <help>
+
+
+**iit_store**
+
+GMAP IIT creates an Interval Index Tree map of known splice sites, introns, or SNPs (it uses iit_store described in the GMAP documentation).  The maps can be used in GMAP_ (Genomic Mapping and Alignment Program for mRNA and EST sequences) and GSNAP_ (Genomic Short-read Nucleotide Alignment Program).  Maps are typically used for known splice sites, introns, or SNPs.  
+
+You will want to read the README_
+
+Publication_ citation: Thomas D. Wu, Colin K. Watanabe  Bioinformatics 2005 21(9):1859-1875; doi:10.1093/bioinformatics/bti310
+
+.. _GMAP: http://research-pub.gene.com/gmap/
+.. _GSNAP: http://research-pub.gene.com/gmap/
+.. _README: http://research-pub.gene.com/gmap/src/README
+.. _Publication: http://bioinformatics.oxfordjournals.org/cgi/content/full/21/9/1859
+
+
+**inputs**
+
+  </help>
+</tool>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/snpindex.xml	Tue Nov 08 13:26:41 2011 -0600
@@ -0,0 +1,141 @@
+<tool id="gmap_snpindex" name="GMAP SNP Index" version="2.0.0">
+  <description>build index files for known SNPs</description>
+  <requirements>
+      <requirement type="binary">snpindex</requirement>
+      <!-- proposed tag for added datatype dependencies -->
+      <requirement type="datatype">gmapsnpindex</requirement>
+      <requirement type="datatype">gmapdb</requirement>
+      <requirement type="datatype">gmap_snps</requirement>
+      <requirement type="datatype">snps.iit</requirement>
+  </requirements>
+  <version_string>snpindex --version</version_string>
+  <command interpreter="command"> /bin/bash $shscript 2>1 1> $output </command>
+  <inputs>
+    <conditional name="refGenomeSource">
+     <param name="genomeSource" type="select" label="Will you map to a reference genome from your history or use a built-in index?" help="Built-ins were indexed using default options">
+        <option value="indexed">Use a built-in index</option>
+        <option value="gmapdb">Use gmapdb from the history</option>
+      </param>
+      <when value="indexed">
+        <param name="gmapindex" type="select" label="Select a reference genome" help="if your genome of interest is not listed - contact Galaxy team">
+          <options from_file="gmap_indices.loc">
+            <column name="uid" index="0" />
+            <column name="dbkey" index="1" />
+            <column name="name" index="2" />
+            <column name="kmers" index="3" />
+            <column name="maps" index="4" />
+            <column name="snps" index="5" />
+            <column name="value" index="6" />
+          </options>
+        </param>
+      </when>
+      <when value="gmapdb">
+        <param name="gmapdb" type="data" format="gmapdb" metadata_name="dbkey" label="Select a gmapdb" 
+              help="A GMAP database built with GMAP Build"/>
+      </when>
+    </conditional>
+    <conditional name="dbsnp">
+      <param name="snp_source" type="select" label="Add SNP info from" >
+        <option value="snpTable">UCSC SNP Table</option>
+        <option value="snpFile">GMAP SNP File</option>
+        <option value="snpIIT">"GMAP SNPs map from GMAP iit store</option>
+      </param>
+      <when value="snpTable">
+        <param name="snps" type="data" format="tabular" label="UCSC SNPs table" help="Example: ftp://hgdownload.cse.ucsc.edu/goldenPath/hg18/database/snp130.txt.gz" />
+        <param name="snpsex" type="data" format="tabular" optional="true" label="UCSC SNP Exceptions table" help="Example: ftp://hgdownload.cse.ucsc.edu/goldenPath/hg18/database/snp130Exceptions.txt.gz" />
+        <param name="weight" type="select" label="Include SNPs with at least Confidence Level" help="">
+          <option value="1" selected="true">1 (High)</option>
+          <option value="2">2 (Medium)</option>
+          <option value="3">3 (All)</option>
+        </param>
+      </when>
+      <when value="snpFile">
+        <param name="snps" type="data" format="gmap_snps" label="GMAP SNPs file" 
+           help="Format (3 columns):
+                &lt;br&gt;>rs62211261 21:14379270 CG
+                &lt;br&gt;>rs62211262 21:14379281 CG
+                &lt;br&gt;Each line must start with a &gt; character, then be followed by an
+                identifier (which may have duplicates).  Then there should be the
+                chromosomal coordinate of the SNP.  (Coordinates are all 1-based, so
+                the first character of a chromosome is number 1.)  Finally, there
+                should be the two possible alleles: ( AC AG AT CG CT GT or AN CN GN TN)
+                &lt;br&gt;These alleles must correspond to the possible nucleotides on the plus strand of the genome.  
+                If the one of these two letters does not match the allele in the reference
+                sequence, that SNP will be ignored in subsequent processing as a probable error.
+                The N stands for any other allele." />
+      </when>
+      <when value="snpIIT">
+        <param name="snpIIT" type="data" format="snps.iit" label="GMAP SNPs map" help="Created by: GMAP iit store" />
+      </when>
+    </conditional> 
+    <param name="snps_name" type="text" value="snps" label="Name for this SNP index" help="no white space characters">
+    </param>
+  </inputs>
+  <outputs>
+    <!--
+    <data format="txt" name="log" label="${tool.name} on ${on_string}: log"/>
+    -->
+    <data format="gmapsnpindex" name="output" label="${tool.name} on ${on_string} snpindex" />
+  </outputs>
+  <configfiles>
+    <configfile name="shscript">
+#!/bin/bash
+#set $ds = chr(36)
+#set $gt = chr(62)
+#set $lt = chr(60)
+#set $ad = chr(38)
+#import os.path
+#if $refGenomeSource.genomeSource == "gmapdb":
+#set $gmapdb = $refGenomeSource.gmapdb.extra_files_path
+#set $refname = $refGenomeSource.gmapdb.metadata.db_name
+#else:
+#set $gmapdb = $os.path.dirname($refGenomeSource.gmapindex.value) 
+$refname = $os.path.basename($refGenomeSource.gmapindex.value)
+#end if
+#set $gmapsnpdir = $output.extra_files_path
+mkdir -p $gmapsnpdir
+#set $snpsname = $snps_name.__str__
+#set $snpsiit = '.'.join([$snpsname,'iit'])
+#set $pathsnps = $os.path.join($gmapsnpdir,$snpsname)
+#set $pathsnpsiit = $os.path.join($gmapsnpdir,$snpsiit)
+#if $dbsnp.snp_source != 'none' and $dbsnp.snps.__str__ != 'None':
+#if $dbsnp.snp_source == 'snpTable':
+#if $dbsnp.snpsex.__str__ != 'None':
+cat $dbsnp.snps | dbsnp_iit -w $dbsnp.weight -e $dbsnp.snpsex | iit_store -o $pathsnps
+#else:
+cat $dbsnp.snps | dbsnp_iit -w $dbsnp.weight | iit_store -o $pathsnps
+#end if
+#elif $dbsnp.snp_source == 'snpFile':
+cat $dbsnp.snps | iit_store -o $pathsnps
+#elif $dbsnp.snp_source == 'snpIIT':
+cat $dbsnp.snps  > $pathsnpsiit
+#end if
+snpindex -D $gmapdb -d $refname -V $output.extra_files_path -v $snpsname $pathsnpsiit
+echo snpindex -D  $gmapdb -d $refname -V $output.extra_files_path -v $snpsname $pathsnpsiit
+#end if
+    </configfile>
+  </configfiles>
+
+  <tests>
+  </tests> 
+
+  <help>
+
+
+**GMAP SNP Index**
+
+GMAP SNP Index (snpindex in the GMAP documentaion) creates an index for known SNPs allowing for SNP tolerant mapping and alignment when using GMAP_ (Genomic Mapping and Alignment Program for mRNA and EST sequences) and GSNAP_ (Genomic Short-read Nucleotide Alignment Program).  
+
+You will want to read the README_
+
+Publication_ citation: Thomas D. Wu, Colin K. Watanabe  Bioinformatics 2005 21(9):1859-1875; doi:10.1093/bioinformatics/bti310
+
+.. _GMAP: http://research-pub.gene.com/gmap/
+.. _GSNAP: http://research-pub.gene.com/gmap/
+.. _README: http://research-pub.gene.com/gmap/src/README
+.. _Publication: http://bioinformatics.oxfordjournals.org/cgi/content/full/21/9/1859
+
+
+  </help>
+</tool>
+