Repository 'gmap'
hg clone https://toolshed.g2.bx.psu.edu/repos/jjohnson/gmap

Changeset 2:52da588232b0 (2011-10-21)
Previous changeset 1:30d42bb409b8 (2011-10-18) Next changeset 3:72ab00e732c3 (2011-10-21)
Commit message:
Add datatypes for maps and snpindex, add iit_store and snpindex tools, update GMAP and GSNAP to use these.
modified:
gmap/README
gmap/gmap.xml
gmap/gmap_build.xml
gmap/gsnap.xml
gmap/lib/galaxy/datatypes/gmap.py
added:
gmap/iit_store.xml
gmap/snpindex.xml
b
diff -r 30d42bb409b8 -r 52da588232b0 gmap/README
--- a/gmap/README Tue Oct 18 11:51:15 2011 -0500
+++ b/gmap/README Fri Oct 21 11:38:55 2011 -0500
b
@@ -9,9 +9,16 @@
    add to datatypes_conf.xml
         <!-- Start GMAP Datatypes -->
         <datatype extension="gmapdb" type="galaxy.datatypes.gmap:GmapDB"  display_in_upload="False"/>
-        <!--
-
-
+        <datatype extension="gmapsnpindex" type="galaxy.datatypes.gmap:GmapSnpIndex"  display_in_upload="False"/>
+        <datatype extension="iit" type="galaxy.datatypes.gmap:IntervalIndexTree"  display_in_upload="True"/>
+        <datatype extension="splicesites.iit" type="galaxy.datatypes.gmap:SpliceSitesIntervalIndexTree"  display_in_upload="True"/>
+        <datatype extension="introns.iit" type="galaxy.datatypes.gmap:IntronsIntervalIndexTree"  display_in_upload="True"/>
+        <datatype extension="snps.iit" type="galaxy.datatypes.gmap:SNPsIntervalIndexTree"  display_in_upload="True"/>
+        <datatype extension="gmap_annotation" type="galaxy.datatypes.gmap:IntervalAnnotation"  display_in_upload="False"/>
+        <datatype extension="gmap_splicesites" type="galaxy.datatypes.gmap:SpliceSiteAnnotation"  display_in_upload="True"/>
+        <datatype extension="gmap_introns" type="galaxy.datatypes.gmap:IntronAnnotation"  display_in_upload="True"/>
+        <datatype extension="gmap_snps" type="galaxy.datatypes.gmap:SNPAnnotation"  display_in_upload="True"/>
+        <!-- End GMAP tools -->
 
 Tools:
   GMAP_Build - create a GmapDB set of index files for a reference sequence and optional set of annotations
@@ -19,28 +26,22 @@
   GSNAP - align sequences to a reference and detect splicing 
 
   Add to  tool_conf.xml     ( probably in the "NGS: Mapping" section )
-   <tool file="gmap/gmap_build.xml" />
    <tool file="gmap/gmap.xml" />
    <tool file="gmap/gsnap.xml" />
+   <tool file="gmap/gmap_build.xml" />
+   <tool file="gmap/snpindex.xml" />
+   <tool file="gmap/iit_store.xml" />
+
+Admin built cached gmapdb indexes defined in tool-data/gmap_indices.loc
 
 
 TODO:
   Add classes to gmap.py
-    IntervalIndexTree  -  datatype for the iit_store result
-    IntervalAnnotation  - generic class  for gmap annotation formats
-    SpliceSiteAnnotation - class  for gmap splicesite annotation format
-    IntronAnnotation - class  for gmap introns  annotation format
-    SNPAnnotation - class  for gmap snp  annotation format
-    GmapIndex - generic class for a gmap index
-    SnpIndex - an index created by  snpindex
     CmetIndex - an index created by cmetindex
     AtoiIndex - an index created by atoiindex
 
   Possibly add Tools:
-    iit_store - creates a mapping index .iit from: gtf,gff3,gmapannotation, UCSC refGene table
-    iit_get - retrieves from .iit store 
     get_genome - retrieves from a gmapdb
-    snpindex  - create a SNPIndex
     cmetindex - create methylcytosine index
     atoiindex - create  A-to-I RNA editing index
     
b
diff -r 30d42bb409b8 -r 52da588232b0 gmap/gmap.xml
--- a/gmap/gmap.xml Tue Oct 18 11:51:15 2011 -0500
+++ b/gmap/gmap.xml Fri Oct 21 11:38:55 2011 -0500
[
b'@@ -1,7 +1,13 @@\n <tool id="gmap" name="GMAP" version="2.0.0">\n   <description>Genomic Mapping and Alignment Program for mRNA and EST sequences</description>\n   <requirements>\n-      <requirement type="binary">gmap</requirement>\n+    <requirement type="binary">gmap</requirement>\n+    <!-- proposed tag for added datatype dependencies -->\n+    <requirement type="datatype">gmapdb</requirement>\n+    <requirement type="datatype">gmap_annotation</requirement>\n+    <requirement type="datatype">gmap_splicesites</requirement>\n+    <requirement type="datatype">gmap_introns</requirement>\n+    <requirement type="datatype">gmap_snps</requirement>\n   </requirements>\n   <version_string>gmap --version</version_string>\n   <command>\n@@ -113,8 +119,20 @@\n     #end if\n   </command>\n   <inputs>\n+    <!-- Input data -->\n+    <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" />\n+    <repeat name="inputs" title="addtional mRNA or EST dataset to map">\n+      <param name="added_input" type="data" format="fasta,fastqsanger,fastqillumina" label=""/>\n+    </repeat>\n+    <param name="quality_protocol" type="select" label="Protocol for input quality scores">\n+      <option value="">No quality scores</option>\n+      <option value="sanger">Sanger quality scores</option>\n+      <option value="illumina">Illumina quality scores</option>\n+    </param>\n+\n+    <!-- GMAPDB for mapping -->\n     <conditional name="refGenomeSource">\n-     <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">\n+     <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">\n         <option value="indexed">Use a built-in index</option>\n         <option value="gmapdb">Use gmapdb from the history</option>\n         <option value="history">Use a fasta reference sequence from the history</option>\n@@ -155,8 +173,6 @@\n       <when value="gmapdb">\n         <param name="gmapdb" type="data" format="gmapdb" metadata_name="dbkey" label="Select a gmapdb" \n               help="A GMAP database built with GMAP Build"/>\n-        <param name="gmapdb" type="data" format="gmapdb" metadata_name="dbkey" label="Select a gmapdb" \n-              help="A GMAP database built with GMAP Build"/>\n         <param name="kmer" type="select" data_ref="gmapdb" label="kmer size" help="Defaults to highest available kmer size">\n           <options>\n             <filter type="data_meta" ref="gmapdb" key="kmers" multiple="True" separator=","/>\n@@ -174,18 +190,89 @@\n       </when>\n     </conditional>\n \n-    <!-- Input data -->\n-    <param name="input" type="data" format="fasta,fastqsanger,fastqillumina" label="Select an mRNA or EST dataset to map" />\n-    <repeat name="inputs" title="addtional mRNA or EST dataset to map">\n-      <param name="added_input" type="data" format="fasta,fastqsanger,fastqillumina" label=""/>\n-    </repeat>\n-    <param name="quality_protocol" type="select" label="Protocol for input quality scores">\n-      <option value="">No quality scores</option>\n-      <option value="sanger">Sanger quality scores</option>\n-      <option value="illumina">Illumina quality scores</option>\n-    </param>\n+    \n+    <!-- Computation options -->\n+    <conditional name="computation">\n+      <param name="options" type="select" label="&lt;HR&gt;Computational Settings" help="">\n+        <option value="default">Use default settings</option>\n+        <option value="advanced">Set Computation Options</option>\n+      </param>\n+      <when value="default"/>\n+      <when value="advanced">\n+       <param name="nosplicing" type="boolean" truevalue="--nosplicing" falsevalue="" checked="false" label="Turn off splicing" help="(useful for aligning genomic seq'..b'gmap_stderr" label="${tool.name} on ${on_string}: log"/>\n+    <data format="txt" name="gmap_stderr" label="${tool.name} on ${on_string}: stderr"/>\n     <data format="txt" name="output" label="${tool.name} on ${on_string} ${result.format}" >\n       <filter>(split_output == False)</filter>\n       <change_format>\n@@ -339,10 +354,10 @@\n         <when input="result[\'format\']" value="gff3_match_cdna" format="gff3"/>\n         <when input="result[\'format\']" value="gff3_match_est" format="gff3"/>\n         <when input="result[\'format\']" value="sam" format="sam"/>\n-        <!--\n         <when input="result[\'format\']" value="splicesites" format="gmap_splicesites"/>\n         <when input="result[\'format\']" value="introns" format="gmap_introns"/>\n-        -->\n+        <when input="result[\'format\']" value="map_genes" format="gmap_annotation"/>\n+        <when input="result[\'format\']" value="map_exons" format="gmap_annotation"/>\n       </change_format>\n     </data>\n     <data format="txt" name="uniq" label="${tool.name} on ${on_string} uniq.${result.format}"  from_work_dir="gmap_out.uniq">\n@@ -352,6 +367,10 @@\n         <when input="result[\'format\']" value="gff3_match_cdna" format="gff3"/>\n         <when input="result[\'format\']" value="gff3_match_est" format="gff3"/>\n         <when input="result[\'format\']" value="sam" format="sam"/>\n+        <when input="result[\'format\']" value="splicesites" format="gmap_splicesites"/>\n+        <when input="result[\'format\']" value="introns" format="gmap_introns"/>\n+        <when input="result[\'format\']" value="map_genes" format="gmap_annotation"/>\n+        <when input="result[\'format\']" value="map_exons" format="gmap_annotation"/>\n       </change_format>\n     </data>\n     <data format="txt" name="transloc" label="${tool.name} on ${on_string} transloc.${result.format}"  from_work_dir="gmap_out.transloc">\n@@ -361,6 +380,10 @@\n         <when input="result[\'format\']" value="gff3_match_cdna" format="gff3"/>\n         <when input="result[\'format\']" value="gff3_match_est" format="gff3"/>\n         <when input="result[\'format\']" value="sam" format="sam"/>\n+        <when input="result[\'format\']" value="splicesites" format="gmap_splicesites"/>\n+        <when input="result[\'format\']" value="introns" format="gmap_introns"/>\n+        <when input="result[\'format\']" value="map_genes" format="gmap_annotation"/>\n+        <when input="result[\'format\']" value="map_exons" format="gmap_annotation"/>\n       </change_format>\n     </data>\n     <data format="txt" name="nomapping" label="${tool.name} on ${on_string} nomapping.${result.format}"  from_work_dir="gmap_out.nomapping">\n@@ -370,6 +393,10 @@\n         <when input="result[\'format\']" value="gff3_match_cdna" format="gff3"/>\n         <when input="result[\'format\']" value="gff3_match_est" format="gff3"/>\n         <when input="result[\'format\']" value="sam" format="sam"/>\n+        <when input="result[\'format\']" value="splicesites" format="gmap_splicesites"/>\n+        <when input="result[\'format\']" value="introns" format="gmap_introns"/>\n+        <when input="result[\'format\']" value="map_genes" format="gmap_annotation"/>\n+        <when input="result[\'format\']" value="map_exons" format="gmap_annotation"/>\n       </change_format>\n     </data>\n     <data format="txt" name="mult" label="${tool.name} on ${on_string} mult.${result.format}"  from_work_dir="gmap_out.mult">\n@@ -379,6 +406,10 @@\n         <when input="result[\'format\']" value="gff3_match_cdna" format="gff3"/>\n         <when input="result[\'format\']" value="gff3_match_est" format="gff3"/>\n         <when input="result[\'format\']" value="sam" format="sam"/>\n+        <when input="result[\'format\']" value="splicesites" format="gmap_splicesites"/>\n+        <when input="result[\'format\']" value="introns" format="gmap_introns"/>\n+        <when input="result[\'format\']" value="map_genes" format="gmap_annotation"/>\n+        <when input="result[\'format\']" value="map_exons" format="gmap_annotation"/>\n       </change_format>\n     </data>\n   </outputs>\n'
b
diff -r 30d42bb409b8 -r 52da588232b0 gmap/gmap_build.xml
--- a/gmap/gmap_build.xml Tue Oct 18 11:51:15 2011 -0500
+++ b/gmap/gmap_build.xml Fri Oct 21 11:38:55 2011 -0500
b
@@ -1,16 +1,23 @@
 <tool id="gmap_build" name="GMAP Build" version="2.0.0">
-  <description>a GMAP DB Index</description>
+  <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>
-    <!-- Input data -->
-    <param name="input" type="data" format="fasta" label="reference sequence fasta" />
-    <param name="refname" type="text" label="reference name" help="">
+    <!-- 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>
@@ -79,7 +86,6 @@
     <!--
     <data format="txt" name="log" label="${tool.name} on ${on_string}: log"/>
     -->
-    <!-- this should have its own datatype: gmapdb -->
     <data format="gmapdb" name="output" label="${tool.name} on ${on_string} gmapdb ${refname}" />
   </outputs>
   <configfiles>
@@ -89,6 +95,11 @@
 #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')
@@ -96,7 +107,7 @@
 ## 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 $input
+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 
@@ -116,23 +127,26 @@
 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.snps.__str__ != 'None':
 #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
-#end if
+echo "snpindex" -d  $refname -v snps
 #end if
 #if $cmetindex.__str__ == 'yes':
 cmetindex -d $refname
-echo "cmetindex" 
+echo "cmetindex" -d $refname
 #end if
 #if $atoiindex.__str__ == 'yes':
 atoiindex -d $refname
-echo "atoiindex" 
+echo "atoiindex" -d $refname
 #end if
 get-genome -D $gmapdb -d $refname -m '?' | sed 's/^Available maps .*/maps: /' 
     </configfile>
@@ -146,7 +160,7 @@
 
 **GMAP Build**
 
-GMAP Build creates an index of a genomic sequence for alignments using GMAP_ (Genomic Mapping and Alignment Program for mRNA and EST sequences) and GSNAP_ (Genomic Short-read Nucleotide Alignment Program).  
+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_
 
b
diff -r 30d42bb409b8 -r 52da588232b0 gmap/gsnap.xml
--- a/gmap/gsnap.xml Tue Oct 18 11:51:15 2011 -0500
+++ b/gmap/gsnap.xml Fri Oct 21 11:38:55 2011 -0500
[
b'@@ -2,31 +2,43 @@\n   <description>Genomic Short-read Nucleotide Alignment Program</description>\n   <requirements>\n       <requirement type="binary">gsnap</requirement>\n+      <!-- proposed tag for added datatype dependencies -->\n+      <requirement type="datatype">gmapdb</requirement>\n+      <requirement type="datatype">gmapsnpindex</requirement>\n+      <requirement type="datatype">splicesites.iit</requirement>\n+      <requirement type="datatype">introns.iit</requirement>\n   </requirements>\n   <version_string>gsnap --version</version_string>\n   <command>\n     #import os.path, re\n     gsnap\n     --nthreads="4" --ordered\n-    #if $refGenomeSource.genomeSource == "history":\n-      --gseg=$refGenomeSource.ownFile\n-    #elif $refGenomeSource.genomeSource == "gmapdb":\n+    #if $refGenomeSource.genomeSource == "gmapdb":\n       #set $gmapdb = $os.listdir($refGenomeSource.gmapdb.extra_files_path)[0]\n-      --dir=$refGenomeSource.gmapdb.extra_files_path --db=$gmapdb\n-      #if $refGenomeSource.kmer != None and len($refGenomeSource.kmer.__str__) == 2:\n-        --kmer=$refGenomeSource.kmer\n-      #end if\n-      #if $refGenomeSource.splicemap != None and len($refGenomeSource.splicemap.__str__) == 2:\n-        --use-splices=$refGenomeSource.splicemap\n-      #end if\n-      #if $refGenomeSource.snpindex != None and len($refGenomeSource.snpindex.__str__) == 2:\n-        --use-snps=$refGenomeSource.snpindex\n-      #end if\n+      --dir=$refGenomeSource.gmapdb.extra_files_path --db=$refGenomeSource.gmapdb.metadata.db_name\n     #else:\n       --dir=$os.path.dirname($refGenomeSource.gmapindex.value) --db=$os.path.basename($refGenomeSource.gmapindex.value)\n-      #if $refGenomeSource.kmer != None and len($refGenomeSource.kmer.__str__) == 2:\n-        --kmer=$refGenomeSource.kmer\n+    #end if\n+    #if $refGenomeSource.kmer != None and len($refGenomeSource.kmer.__str__) == 2:\n+      --kmer=$refGenomeSource.kmer\n+    #end if\n+    #if $refGenomeSource.use_splicing.src == \'gmapdb\':\n+      #if $refGenomeSource.use_splicing.splicemap != None and len($refGenomeSource.use_splicing.splicemap.__str__) > 0:\n+        -s $refGenomeSource.use_splicing.splicemap.value\n       #end if\n+    #elif $refGenomeSource.use_splicing.src == \'history\':\n+      #if $refGenomeSource.use_splicing.splicemap != None and len($refGenomeSource.use_splicing.splicemap.__str__) > 0:\n+        -S $os.path.dirname($refGenomeSource.use_splicing.splicemap) -s $os.path.basename($refGenomeSource.use_splicing.splicemap)\n+      #end if\n+    #end if\n+    #if $refGenomeSource.use_snps.src == \'gmapdb\':\n+       #if $refGenomeSource.use_snps.snpindex != None and len($refGenomeSource.use_snps.snpindex.__str__) > 0:\n+        -v $refGenomeSource.use_snps.snpindex.value\n+       #end if\n+    #elif $refGenomeSource.use_snps.src == \'history\':\n+       #if $refGenomeSource.use_snps.snpindex != None and len($refGenomeSource.use_snps.snpindex.__str__) > 0:\n+         -V $refGenomeSource.use_snps.snpindex.extra_files_path -v $refGenomeSource.use_snps.snpindex.metadata.snps_name\n+       #end if\n     #end if\n     #if $mode.__str__ != \'\':\n       --mode=$mode\n@@ -181,86 +193,9 @@\n \n   </command>\n   <inputs>\n-    <conditional name="refGenomeSource">\n-     <param name="genomeSource" type="select" label="Will you select a reference genome from your history or use a built-in index?" help="Built-ins were indexed using default options">\n-        <option value="indexed">Use a built-in index</option>\n-        <option value="gmapdb">Use gmapdb from the history</option>\n-        <option value="history">Use one from the history</option>\n-      </param>\n-      <when value="indexed">\n-        <param name="gmapindex" type="select" label="Select a reference genome" help="if your genome of interest is not listed - contact Galaxy team">\n-          <options from_file="gmap_indices.loc">\n-            <column name="uid" index="0" />\n-            <column name="dbkey" index="1" />\n-            <column name="name" index="2" />\n-            <col'..b'ey="snps" multiple="True" separator=","/>\n+              </options>\n+            </param>\n+          </when>\n+        </conditional>\n+\n+      </when>\n+    </conditional>\n+\n     <!-- Computation options -->\n     <conditional name="computation">\n-      <param name="options" type="select" label="Computational Settings" help="">\n+      <param name="options" type="select" label="&lt;HR&gt;Computational Settings" help="">\n         <option value="default">Use default settings</option>\n         <option value="advanced">Set Computation Options</option>\n       </param>\n@@ -352,8 +426,7 @@\n          </param>\n          <param name="trim_mismatch_score" type="integer" value="" optional="true" label="Score to use for mismatches when trimming at ends (default is -3)" \n                 help="to turn off trimming, specify 0"/>\n-         <!-- use-snps This should be either a select list from the gmapdb maps or a data type using snpsdir and use-snps --> \n-         <param name="use_snps" type="text" value="" optional="true" label="SNP database Name for SNP tolearnce" help="Use database containing known SNPs (built previously using snpindex) for tolerance to SNPs"/>\n+         \n          <!-- Options for GMAP alignment within GSNAP -->\n           <param name="gmap_mode" type="select" multiple="true" optional="true" label="Cases to use GMAP for complex alignments containing multiple splices or indels" help="">\n             <option value="pairsearch">pairsearch</option>\n@@ -376,7 +449,7 @@\n     </conditional>\n \n     <conditional name="splicing">\n-      <param name="options" type="select" label="Splicing options for RNA-Seq" help="">\n+      <param name="options" type="select" label="&lt;HR&gt;Splicing options for RNA-Seq" help="">\n         <option value="default">Use default settings</option>\n         <option value="advanced">Set Splicing Options</option>\n       </param>\n@@ -384,7 +457,7 @@\n       <when value="advanced">\n          <!-- Splicing options for RNA-Seq -->\n          <!-- use-splices This should be either a select list from the gmapdb maps or a data type using splicesdir and use-splices --> \n-         <param name="use_splices" type="text" value="" optional="true" label="Known splicesites or 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"/>\n+         <!-- Neither novel splicing (-N) nor known splicing (-s) turned on => assume reads are DNA-Seq (genomic) -->\n          <param name="novelsplicing" type="boolean" checked="false" truevalue="--novelsplicing=1" falsevalue="" label="Look for novel splicing "/>\n          <param name="localsplicedist"  type="integer" value="" optional="true" label="Definition of local novel splicing event (default 200000)"/>\n          <param name="local_splice_penalty"  type="integer" value="" optional="true" label="Penalty for a local splice (default 0).  Counts against mismatches allowed"/>\n@@ -398,7 +471,7 @@\n \n     <!-- Output data -->\n     <conditional name="output">\n-      <param name="options" type="select" label="Output options for RNA-Seq" help="">\n+      <param name="options" type="select" label="&lt;HR&gt;&lt;H2&gt;Output&lt;/H2&gt;Output options for RNA-Seq" help="">\n         <option value="default">Use default settings</option>\n         <option value="advanced">Set Output Options</option>\n       </param>\n@@ -439,7 +512,7 @@\n        help="Separate outputs for: nomapping, halfmapping_uniq, halfmapping_mult, unpaired_uniq, unpaired_mult, paired_uniq, paired_mult, concordant_uniq, and concordant_mult results"/> \n   </inputs>\n   <outputs>\n-    <data format="txt" name="gsnap_stderr" label="${tool.name} on ${on_string}: log"/>\n+    <data format="txt" name="gsnap_stderr" label="${tool.name} on ${on_string}: stderr"/>\n     <data format="txt" name="results" label="${tool.name} on ${on_string} ${result.format}" >\n       <filter>(split_output == False)</filter>\n       <change_format>\n'
b
diff -r 30d42bb409b8 -r 52da588232b0 gmap/iit_store.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gmap/iit_store.xml Fri Oct 21 11:38:55 2011 -0500
[
b'@@ -0,0 +1,188 @@\n+<tool id="gmap_iit_store" name="GMAP IIT" version="2.0.0">\n+  <description>Create a map store for known genes or SNPs</description>\n+  <requirements>\n+      <requirement type="binary">iit_store</requirement>\n+      <!-- proposed tag for added datatype dependencies -->\n+      <requirement type="datatype">gmap_annotation</requirement>\n+      <requirement type="datatype">gmap_snps</requirement>\n+      <requirement type="datatype">iit</requirement>\n+      <requirement type="datatype">splicesites.iit</requirement>\n+      <requirement type="datatype">introns.iit</requirement>\n+      <requirement type="datatype">snps.iit</requirement>\n+  </requirements>\n+  <version_string>iit_store --version</version_string>\n+  <command interpreter="command"> /bin/bash $shscript 2> $log </command>\n+  <inputs>\n+    <!-- Input data -->\n+    <conditional name="map">\n+      <param name="type" type="select" label="Make map for" >\n+        <option value="genes">Introns and Splice sites</option>\n+        <option value="snps">SNPs</option>\n+        <option value="gmap">GMAP Annotation</option>\n+      </param>\n+      <when value="genes">\n+        <conditional name="src">\n+          <param name="src_format" type="select" label="Add splice and intron info from" >\n+            <option value="refGeneTable">refGenes table from UCSC table browser</option>\n+            <option value="gtf">GTF</option>\n+            <option value="gff3">GFF3</option>\n+          </param>\n+          <when value="refGeneTable">\n+            <param name="genes" type="data" format="tabular" label="UCSC refGenes table" help="Example: ftp://hgdownload.cse.ucsc.edu/goldenPath/hg18/database/refGene.txt.gz" />\n+            <param name="col_skip" type="integer" value="1" label="Columns to skip before the id/name column (default 1)" \n+                   help="Note that alignment tracks in UCSC sometimes have an extra column on the left.">\n+              <validator type="in_range" message="The number of colmumns to skip must >= 0." min="0."/>\n+            </param>\n+          </when>\n+          <when value="gtf">\n+            <param name="genes" type="data" format="gtf" label="Genes as GTF" help="" />\n+          </when>\n+          <when value="gff3">\n+            <param name="genes" type="data" format="gff3" label="Genes in GFF3 format" help="" />\n+          </when>\n+        </conditional> \n+        <param name="maps" type="select" display="checkboxes" multiple="true" force_select="true" label="Add splice and intron info from" >\n+          <option value="splicesites" selected="true">splicesites.iit</option>\n+          <option value="introns" selected="false">introns.iit</option>\n+        </param>\n+      </when>\n+      <when value="snps">\n+        <conditional name="src">\n+          <param name="src_format" type="select" label="Add SNP info from" >\n+            <option value="snpTable">UCSC SNP Table</option>\n+            <option value="snpFile">GMAP SNP File</option>\n+          </param>\n+          <when value="snpTable">\n+            <param name="snps" type="data" format="tabular" label="UCSC SNPs table" help="Example: ftp://hgdownload.cse.ucsc.edu/goldenPath/hg18/database/snp130.txt.gz" />\n+            <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" />\n+            <param name="weight" type="select" label="Include SNPs with at least Confidence Level" help="">\n+              <option value="1" selected="true">1 (High)</option>\n+              <option value="2">2 (Medium)</option>\n+              <option value="3">3 (All)</option>\n+            </param>\n+          </when>\n+          <when value="snpFile">\n+            <param name="snps" type="data" format="gmap_snps" optional="true" label="GMAP SNPs file" \n+               help="Format (3 columns):&lt;B&gt;\n+                    &lt;br&gt;>rs62211261 21:14379270 CG\n+                    &lt;b'..b'+                &lt;br&gt; chr:position\n+                &lt;br&gt;  chr:startposition..endposition\n+                &lt;br&gt;The term chr:position is equivalent to chr:position..position.  \n+                &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.  \n+                " />\n+      </when>\n+    </conditional> \n+  </inputs>\n+  <outputs>\n+    <data format="txt" name="log" label="${tool.name} on ${on_string}: log"/>\n+    <data format="splicesites.iit" name="splicesites_iit" label="${tool.name} on ${on_string} splicesites.iit">\n+      <filter>(map[\'type\'] == \'genes\' and \'splicesites\' in map[\'maps\'])</filter>\n+    </data>\n+    <data format="introns.iit" name="introns_iit" label="${tool.name} on ${on_string} introns.iit">\n+      <filter>(map[\'type\'] == \'genes\' and \'introns\' in map[\'maps\'])</filter>\n+    </data>\n+    <data format="snps.iit" name="snps_iit" label="${tool.name} on ${on_string} snps.iit">\n+      <filter>(map[\'type\'] == \'snps\')</filter>\n+    </data>\n+    <data format="iit" name="map_iit" label="${tool.name} on ${on_string} map.iit">\n+      <filter>(map[\'type\'] == \'gmap\')</filter>\n+    </data>\n+  </outputs>\n+  <configfiles>\n+    <configfile name="shscript">\n+#!/bin/bash\n+#set $catcmd = \'gzcat -f\'\n+#set $catcmd = \'cat\'\n+#set $ds = chr(36)\n+#set $gt = chr(62)\n+#set $lt = chr(60)\n+#set $ad = chr(38)\n+#set $ep = chr(33)\n+#set $toerr = \'\'.join([$gt,$ad,\'2\'])\n+#import os.path\n+#if $map.type == \'genes\':\n+if [ $ep -e $map.src.genes ]; then echo "$map.src.genes does not exist" $toerr; exit 1; fi\n+if [ $ep -s $map.src.genes ]; then echo "$map.src.genes is empty" $toerr; exit 2; fi\n+ #if $map.src.src_format == \'refGeneTable\':\n+  #if \'splicesites\' in [ $map.maps.__str__ ]:\n+   $catcmd $map.src.genes | psl_splicesites -s $map.src.col_skip | iit_store -o  $splicesites_iit\n+  #end if\n+  #if \'introns\' in [ $map.maps.__str__ ]:\n+   $catcmd  $map.src.genes | psl_introns -s $map.src.col_skip | iit_store -o  $introns_iit\n+  #end if\n+ #elif $map.src.src_format == \'gtf\':\n+  #if \'splicesites\' in [ $map.maps.__str__ ]:\n+   $catcmd $map.src.genes | gtf_splicesites | iit_store -o  $splicesites_iit\n+  #end if\n+  #if \'introns\' in [ $map.maps.__str__ ]:\n+   $catcmd $map.src.genes | gtf_introns | iit_store -o  $introns_iit\n+  #end if\n+ #elif $map.src.src_format == \'gff3\':\n+  #if \'splicesites\' in [ $map.maps.__str__ ]:\n+   $catcmd $map.src.genes | gff3_splicesites | iit_store -o  $splicesites_iit\n+  #end if\n+  #if \'introns\' in [ $map.maps.__str__ ]:\n+   $catcmd $map.src.genes | gff3_introns | iit_store -o  $introns_iit\n+  #end if\n+ #end if\n+#elif $map.type == \'snps\':\n+if [ $ep -s $map.src.snps ]; then echo "$map.src.snps is empty" $toerr; exit 2; fi\n+ #if $map.src.snpsex.__str__ != \'None\':\n+  $catcmd $map.src.snps | dbsnp_iit -w $map.src.weight -e $map.src.snpsex | iit_store -o  $snps_iit\n+ #else:\n+  $catcmd $map.src.snps | dbsnp_iit -w $map.src.weight | iit_store -o $snps_iit \n+ #end if\n+#else:\n+  $catcmd $map.src.snps | iit_store -o $map_iit \n+#end if\n+    </configfile>\n+  </configfiles>\n+\n+  <tests>\n+  </tests> \n+\n+  <help>\n+\n+\n+**iit_store**\n+\n+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.  \n+\n+You will want to read the README_\n+\n+Publication_ citation: Thomas D. Wu, Colin K. Watanabe  Bioinformatics 2005 21(9):1859-1875; doi:10.1093/bioinformatics/bti310\n+\n+.. _GMAP: http://research-pub.gene.com/gmap/\n+.. _GSNAP: http://research-pub.gene.com/gmap/\n+.. _README: http://research-pub.gene.com/gmap/src/README\n+.. _Publication: http://bioinformatics.oxfordjournals.org/cgi/content/full/21/9/1859\n+\n+\n+**inputs**\n+\n+  </help>\n+</tool>\n+\n'
b
diff -r 30d42bb409b8 -r 52da588232b0 gmap/lib/galaxy/datatypes/gmap.py
--- a/gmap/lib/galaxy/datatypes/gmap.py Tue Oct 18 11:51:15 2011 -0500
+++ b/gmap/lib/galaxy/datatypes/gmap.py Fri Oct 21 11:38:55 2011 -0500
[
b'@@ -3,7 +3,9 @@\n """\n import logging\n import os,os.path,re\n+import data\n from data import Text\n+from galaxy import util\n from metadata import MetadataElement\n \n log = logging.getLogger(__name__)\n@@ -61,6 +63,7 @@\n             return dataset.peek\n         except:\n             return "GMAP index file"\n+\n     def sniff( self, filename ):\n         return False\n     def set_meta( self, dataset, overwrite = True, **kwd ):\n@@ -113,57 +116,309 @@\n                                 dataset.metadata.atoi = True\n                 dataset.metadata.kmers = kmers.keys()\n \n-##  class IntervalIndexTree( Text ):\n-##      """\n-##      A GMAP Interval Index Tree Map\n-##      created by iit_store\n-##      (/path/to/map)/(mapname).iit\n-##      """\n-##      MetadataElement( name="map_name", desc="The map name for this index set", default=\'unknown\', set_in_upload=True, readonly=False )\n-##      file_ext = \'iit\'\n-##      is_binary = True\n-##      composite_type = \'auto_primary_file\'\n-##      allow_datatype_change = False\n-##  \n-##  class IntervalAnnotation(data.Text):\n-##      """\n-##      Class describing a GMAP Interval format:\n-##          >label coords optional_tag\n-##          optional_annotation (which may be zero, one, or multiple lines)\n-##      The coords should be of the form:\n-##          chr:position\n-##          chr:startposition..endposition\n-##      """\n-##      file_ext = \'gmapannotation\'\n-##  \n-##  class SpliceSiteAnnotation(IntervalAnnotation):\n-##      file_ext = \'gmapsplicesites\'\n-##      """\n-##      Example:\n-##          >NM_004448.ERBB2.exon1 17:35110090..35110091 donor 6678\n-##          >NM_004448.ERBB2.exon2 17:35116768..35116769 acceptor 6678\n-##          >NM_004448.ERBB2.exon2 17:35116920..35116921 donor 1179\n-##          >NM_004448.ERBB2.exon3 17:35118099..35118100 acceptor 1179\n-##          >NM_004449.ERG.exon1 21:38955452..38955451 donor 783\n-##          >NM_004449.ERG.exon2 21:38878740..38878739 acceptor 783\n-##          >NM_004449.ERG.exon2 21:38878638..38878637 donor 360\n-##          >NM_004449.ERG.exon3 21:38869542..38869541 acceptor 360\n-##      """\n-##  \n-##  class IntronAnnotation(IntervalAnnotation):\n-##      file_ext = \'gmapintrons\'\n-##      """\n-##      Example:\n-##          >NM_004448.ERBB2.intron1 17:35110090..35116769\n-##          >NM_004448.ERBB2.intron2 17:35116920..35118100\n-##          >NM_004449.ERG.intron1 21:38955452..38878739\n-##          >NM_004449.ERG.intron2 21:38878638..38869541\n-##      """\n-##  \n-##  class SNPAnnotation(IntervalAnnotation):\n-##      file_ext = \'gmapsnps\'\n-##      """\n-##      Example:\n-##          >rs62211261 21:14379270 CG\n-##          >rs62211262 21:14379281 CG\n-##      """\n+class GmapSnpIndex( Text ):\n+    """\n+    A GMAP SNP index created by snpindex\n+    """\n+    MetadataElement( name="db_name", desc="The db name for this index set", default=\'unknown\', set_in_upload=True, readonly=True )\n+    MetadataElement( name="snps_name", default=\'snps\', desc="The name of SNP index", visible=True, no_value=\'\', readonly=True )\n+    \n+    file_ext = \'gmapsnpindex\'\n+    is_binary = True\n+    composite_type = \'auto_primary_file\'\n+    allow_datatype_change = False\n+\n+    def generate_primary_file( self, dataset = None ):\n+        """ \n+        This is called only at upload to write the html file\n+        cannot rename the datasets here - they come with the default unfortunately\n+        """\n+        return \'<html><head></head><body>AutoGenerated Primary File for Composite Dataset</body></html>\'\n+    \n+    def regenerate_primary_file(self,dataset):\n+        """\n+        cannot do this until we are setting metadata \n+        """\n+        bn = dataset.metadata.db_name\n+        log.info( "GmapDB regenerate_primary_file %s" % (bn))\n+        rval = [\'<html><head><title>GMAPDB %s</title></head><p/><H3>GMAPDB %s</H3><p/>cmet %s<br>atoi %s<H4>Maps:</H4><ul>\' % (bn,bn,dataset.metadata.cmet,dataset.metadata.atoi)]\n+        for i,name in enumerate(dataset.metadata.maps):\n+            rval.append( \'<li>%'..b'ine()\n+                if not line:\n+                    break #EOF\n+                line = line.strip()\n+                if line: #first non-empty line\n+                    count += 1\n+                    if re.match(pat,line) == None: # Failed to match \n+                        return False\n+        finally:\n+            fh.close()\n+        return False\n+\n+class IntronAnnotation(IntervalAnnotation):\n+    file_ext = \'gmap_introns\'\n+    """\n+    Example:\n+        >NM_004448.ERBB2.intron1 17:35110090..35116769\n+        >NM_004448.ERBB2.intron2 17:35116920..35118100\n+        >NM_004449.ERG.intron1 21:38955452..38878739\n+        >NM_004449.ERG.intron2 21:38878638..38869541\n+     The coordinates are 1-based, and specify the exon coordinates\n+     surrounding the intron, with the first coordinate being from the donor\n+     exon and the second one being from the acceptor exon.\n+    """\n+    def sniff( self, filename ): # TODO\n+        """\n+        Determines whether the file is a gmap Intron annotation file\n+        """\n+        try:\n+            pat = \'>(\\S+\\.intron\\d+)\\s((\\S+):(\\d+)\\.\\.(\\d+)(\\s(.)+)?$\' #>label chr:position\n+            fh = open( filename )\n+            count = 0\n+            while True and count < 10:\n+                line = fh.readline()\n+                if not line:\n+                    break #EOF\n+                line = line.strip()\n+                if line: #first non-empty line\n+                    count += 1\n+                    if re.match(pat,line) == None: # Failed to match \n+                        return False\n+        finally:\n+            fh.close()\n+        return False\n+\n+class SNPAnnotation(IntervalAnnotation):\n+    file_ext = \'gmap_snps\'\n+    """\n+    Example:\n+        >rs62211261 21:14379270 CG\n+        >rs62211262 21:14379281 AT\n+        >rs62211263 21:14379298 WN\n+    Each line must start with a ">" character, then be followed by an\n+    identifier (which may have duplicates).  Then there should be the\n+    chromosomal coordinate of the SNP.  (Coordinates are all 1-based, so\n+    the first character of a chromosome is number 1.)  Finally, there\n+    should be the two possible alleles.  (Previous versions required that\n+    these be in alphabetical order: "AC", "AG", "AT", "CG", "CT", or "GT",\n+    but that is no longer a requirement.)  These alleles must correspond\n+    to the possible nucleotides on the plus strand of the genome.  If the\n+    one of these two letters does not match the allele in the reference\n+    sequence, that SNP will be ignored in subsequent processing as a\n+    probable error.\n+    \n+    GSNAP also supports the idea of a wildcard SNP.  A wildcard SNP allows\n+    all nucleotides to match at that position, not just a given reference\n+    and alternate allele.  It is essentially as if an "N" were recorded at\n+    that genomic location, although the index files still keep track of\n+    the reference allele.  To indicate that a position has a wildcard SNP,\n+    you can indicate the genotype as "WN", where "W" is the reference\n+    allele.  Another indication of a wildcard SNP is to provide two\n+    separate lines at that position with the genotypes "WX" and "WY",\n+    where "W" is the reference allele and "X" and "Y" are two different\n+    alternate alleles.\n+    """\n+    def sniff( self, filename ):\n+        """\n+        Determines whether the file is a gmap SNP annotation file\n+        """\n+        try:\n+            pat = \'>(\\S+)\\s((\\S+):(\\d+)\\s([TACGW][TACGN])$\' #>label chr:position ATCG \n+            fh = open( filename )\n+            count = 0\n+            while True and count < 10:\n+                line = fh.readline()\n+                if not line:\n+                    break #EOF\n+                line = line.strip()\n+                if line: #first non-empty line\n+                    count += 1\n+                    if re.match(pat,line) == None: # Failed to match \n+                        return False\n+        finally:\n+            fh.close()\n+        return False\n+\n+\n'
b
diff -r 30d42bb409b8 -r 52da588232b0 gmap/snpindex.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gmap/snpindex.xml Fri Oct 21 11:38:55 2011 -0500
[
@@ -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>
+