diff gmap.xml @ 5:14561eb803a5 draft

Uploaded v3.0.1b (still working on this prior to main Tool Shed release)
author peterjc
date Fri, 21 Oct 2016 10:55:40 -0400
parents 488e9d642566
children
line wrap: on
line diff
--- a/gmap.xml	Wed Sep 28 10:49:02 2016 -0400
+++ b/gmap.xml	Fri Oct 21 10:55:40 2016 -0400
@@ -4,19 +4,19 @@
     <requirement type="package" version="2013-05-09">gmap</requirement>
   </requirements>
   <version_command>gmap --version</version_command>
-  <command>
+  <command detect_errors="exit_code"><![CDATA[
     #import os,os.path
     gmap
-    --nthreads=4 --ordered
+    --nthreads=\${GALAXY_SLOTS:-4} --ordered
     #if $refGenomeSource.genomeSource == "history":
       --gseg=$refGenomeSource.ownFile
     #elif $refGenomeSource.genomeSource == "gmapdb":
-      --dir=$refGenomeSource.gmapdb.extra_files_path --db=$refGenomeSource.gmapdb.metadata.db_name
+      --dir='$refGenomeSource.gmapdb.extra_files_path' --db='$refGenomeSource.gmapdb.metadata.db_name'
       #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)
+      --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
@@ -45,11 +45,6 @@
       $result.sam_use_0M
       $result.force_xs_dir
       $result.md_lowercase_snp
-      #* Removed in gmap version 2011-11-30
-      #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
@@ -116,9 +111,7 @@
         --wraplength=$advanced.wraplength
       #end if
     #end if
-    #if $split_output == True
-      $split_output
-    #end if
+    $split_output
     #if len($quality_protocol.__str__) > 0:
       --quality-protocol=$quality_protocol
     #end if
@@ -126,15 +119,15 @@
     #for $i in $inputs:
       ${i.added_input}
     #end for
-    #if $split_output == True
+    #if $split_output
       2> $gmap_stderr
     #else
       2> $gmap_stderr > $output
     #end if
-  </command>
+  ]]></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" />
+    <param name="input" type="data" format="fasta,fastqsanger,fastqillumina" label="Input Sequences" help="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>
@@ -146,14 +139,14 @@
 
     <!-- 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">
+     <param name="genomeSource" type="select" label="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">
+          <options from_data_table="gmap_indices">
             <column name="uid" index="0" />
             <column name="dbkey" index="1" />
             <column name="name" index="2" />
@@ -164,7 +157,7 @@
           </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">
+          <options from_data_table="gmap_indices">
             <column name="name" index="3"/>
             <column name="value" index="3"/>
             <filter type="param_value" ref="gmapindex" column="6"/>
@@ -182,8 +175,9 @@
                                    within selected basesize and k-mer size
 
         -->
-        <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">
+        <!-- Not currently used in the command tag,
+        <param name="map" type="select" data_ref="gmapindex" label="Look for splicing involving known sites or known introns" >
+          <options from_data_table="gmap_indices">
             <column name="name" index="4"/>
             <column name="value" index="4"/>
             <filter type="param_value" ref="gmapindex" column="6"/>
@@ -192,6 +186,7 @@
             <filter type="sort_by" column="4"/>
           </options>
         </param>
+        -->
       </when>
       <when value="gmapdb">
         <param name="gmapdb" type="data" format="gmapdb" label="Select a gmapdb"
@@ -201,11 +196,13 @@
             <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="">
+        <!-- Not currently used in the command tag,
+        <param name="map" type="select"  data_ref="gmapdb" label="Use map for splicing involving known sites or known introns" >
           <options>
             <filter type="data_meta" ref="gmapdb" key="maps" multiple="True"/>
           </options>
         </param>
+        -->
       </when>
       <when value="history">
         <param name="ownFile" type="data" format="fasta" label="Select the reference genome"
@@ -216,7 +213,7 @@
 
     <!-- Computation options -->
     <conditional name="computation">
-      <param name="options" type="select" label="&lt;HR&gt;Computational Settings" help="">
+      <param name="options" type="select" label="Computational Settings" >
         <option value="default">Use default settings</option>
         <option value="advanced">Set Computation Options</option>
       </param>
@@ -249,7 +246,7 @@
        <param name="trimendexons"  type="integer" value="" optional="true" label="Trim end exons with fewer than given number of matches (in nt, default 12)" >
          <validator type="in_range" message="trimendexons must be positive" min="1" />
        </param>
-       <param name="find_shifted_canonical" type="boolean" truevalue="--find-shifted-canonical-species" falsevalue="" checked="false" label="find-shifted-canonical Use a more sensitive search for canonical splicing" help=""/>
+       <param name="find_shifted_canonical" type="boolean" truevalue="--find-shifted-canonical-species" falsevalue="" checked="false" label="find-shifted-canonical Use a more sensitive search for canonical splicing" />
        <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">
@@ -281,14 +278,14 @@
 
     <!-- Advanced Settings -->
     <conditional name="advanced">
-      <param name="options" type="select" label="&lt;HR&gt;Advanced Settings" help="">
+      <param name="options" type="select" label="Advanced Settings" >
         <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="">
+       <param name="invertmode" type="select" label=" Mode for alignments to genomic (-) strand" >
         <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>
@@ -313,7 +310,7 @@
        </param>
        <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="">
+       <param name="protein" type="select" label="Protein alignment" >
         <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>
@@ -323,7 +320,7 @@
 
     <!-- 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="">
+    <param name="format" type="select" label="Output" help="Select the output format" >
       <option value="gmap">GMAP default output</option>
       <option value="summary">Summary of alignments</option>
       <option value="align">Alignment</option>
@@ -345,15 +342,11 @@
       <option value="coords">coords in table format</option>
       <option value="sam" selected="true">SAM format</option>
     </param>
-      <when value="gmap">
-      </when>
+      <when value="gmap"/>
       <when value="summary"/>
-      <when value="align">
-      </when>
-      <when value="continuous">
-      </when>
-      <when value="continuous-by-exon">
-      </when>
+      <when value="align"/>
+      <when value="continuous"/>
+      <when value="continuous-by-exon"/>
       <when value="compress"/>
       <when value="exons_dna"/>
       <when value="exons_gen"/>
@@ -369,15 +362,8 @@
       <when value="map_ranges"/>
       <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 '@'"/>
-        <!--  Removed in gmap version 2011-11-30
-        <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="sam_paired_read" type="boolean" truevalue="sampe" falsevalue="samse" checked="false" label="SAM paired reads" help="The sampe option will generate SAM flags to indicate whether the read is the first or second end of a pair"/>
+        <param name="no_sam_headers" type="boolean" truevalue="--no-sam-headers" falsevalue="" checked="false" label="Do not print SAM headers (lines beginning with '@')"/>
         <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"/>
@@ -484,18 +470,50 @@
     </data>
   </outputs>
   <tests>
+    <test>
+      <!-- 
+      mimic first test from GMAP source code, mapping Human ERBB2 onto fragment of chr17
+      $ gmap -A -g ss.chr17test ss.her2
+      -->
+      <param name="input" value="ss.her2.fasta" ftype="fasta"/>
+      <!-- <param name="quality_protocol" value=""/> -->
+      <param name="genomeSource" value="history"/>
+      <param name="ownFile" value="ss.chr17.fasta" ftype="fasta"/>
+      <param name="format" value="align"/>
+      <param name="computation" value="default"/>
+      <param name="options" value="default"/>
+      <output name="output" file="ss.her2.chr17.txt" ftype="txt"/>
+    </test>
   </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.
+GMAP (Genomic Mapping and Alignment Program)
+
+The functionality provided by gmap allows a user to:
 
-Publication_ citation: Thomas D. Wu, Colin K. Watanabe  Bioinformatics 2005 21(9):1859-1875; doi:10.1093/bioinformatics/bti310
+    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.
 
-.. _GMAP: http://research-pub.gene.com/gmap/
-.. _Publication: http://bioinformatics.oxfordjournals.org/cgi/content/full/21/9/1859
+It is developed by Thomas D. Wu of Genentech, Inc.
 
 ------