diff blat_wrapper.xml @ 2:6265acc179ff draft

Uploaded
author crs4
date Mon, 04 Nov 2013 06:35:53 -0500
parents c4ad58c4bc7d
children d78b8fe7ca83
line wrap: on
line diff
--- a/blat_wrapper.xml	Mon Oct 28 12:40:29 2013 -0400
+++ b/blat_wrapper.xml	Mon Nov 04 06:35:53 2013 -0500
@@ -1,11 +1,23 @@
-<tool id="blat_wrapper" name="BLAT" version="0.2">
+<tool id="blat_wrapper" name="BLAT" version="0.3">
   <description></description>
   <requirements>
     <requirement type="package" version="35">blat</requirement>
   </requirements>
   <version_command>blat|head -n 1</version_command>
   <command>
-    blat $database $query -t=$databaseType.databaseType_select -q=$databaseType.queryType
+    blat
+    #if $database_source.database_source_select == 'fasta_db'
+      $database_source.database.fields.path
+    #else if $database_source.database_source_select == 'twobit_db'
+      #if $database_source.range
+        $database_source.database.fields.path:$database_source.range
+      #else
+        $database_source.database.fields.path
+      #end if
+    #else
+      $database_source.database
+    #end if
+    $query -t=$databaseType.databaseType_select -q=$databaseType.queryType
     #if str($databaseType.tileSize)
       -tileSize=$databaseType.tileSize
     #end if
@@ -67,9 +79,35 @@
   </command>
 
   <inputs>
-    <param name="database" type="data" format="fasta,twobit" label="Database" help="FASTA or 2bit format" />
-    <param name="query" type="data" format="fasta,twobit" label="Query" help="FASTA or 2bit format" />
-
+    <conditional name="database_source">
+      <param name="database_source_select" type="select" label="Database source">
+        <option value="fasta_db">Locally installed FASTA database</option>
+        <option value="twobit_db">Locally installed 2bit database</option>
+        <option value="file">FASTA or 2bit file from your history</option>
+      </param>
+      <when value="fasta_db">
+        <param name="database" type="select" label="Select a FASTA database">
+          <options from_data_table="all_fasta">
+            <filter type="sort_by" column="name" />
+            <validator type="no_options" message="No FASTA database available" />
+          </options>
+        </param>
+      </when>
+      <when value="twobit_db">
+        <param name="database" type="select" label="Select a 2bit database">
+          <options from_data_table="lastz_seqs">
+            <filter type="sort_by" column="name" />
+            <validator type="no_options" message="No 2bit database available" />
+          </options>
+        </param>
+        <param name="range" type="text" optional="true" value="" label="Restrict the search space to this genomic range in the sequence database" help="Format = 'chr1:250000-260000' (i.e. name:startposition-endposition)">
+          <validator type="regex" message="Invalid range">\w+:\d+-\d+</validator>
+        </param>
+      </when>
+      <when value="file">
+        <param name="database" type="data" format="fasta,twobit" label="Database file" help="FASTA or 2bit format" />
+      </when>
+    </conditional>
     <conditional name="databaseType">
       <param name="databaseType_select" type="select" label="Database type (-t)">
         <option value="dna" selected="true">DNA sequence (dna)</option>
@@ -110,7 +148,7 @@
         <param name="minIdentity" type="integer" value="25" optional="true" label="Minimum sequence identity (%) (-minIdentity)" />
       </when>
     </conditional>
-
+    <param name="query" type="data" format="fasta,twobit" label="Query" help="FASTA or 2bit format" />
 <!--    <param name="ooc" type="data" format="ooc" optional="true" label="Over-occuring N-mers file (-ooc) produced with blat -makeOoc" help="Use N as tileSize below." /> This should wait for a makeOoc wrapper -->
 
     <param name="stepSize" type="integer" value="" optional="true" label="Spacing between tiles (-stepSize)" help="Default is tileSize">
@@ -198,10 +236,11 @@
   </outputs>
   <tests>
     <test>
+      <param name="database_source_select" value="file" />
       <param name="database" value="databasetest1.fasta" ftype="fasta" />
-      <param name="query" value="input83.fasta" ftype="fasta" />
       <param name="databaseType_select" value="dna" />
       <param name="queryType" value="dna" />
+      <param name="query" value="input83.fasta" ftype="fasta" />
       <param name="tileSize" value="11" />
       <param name="minMatch" value="2" />
       <param name="stepSize" value="11" />