changeset 2:6265acc179ff draft

Uploaded
author crs4
date Mon, 04 Nov 2013 06:35:53 -0500
parents c4ad58c4bc7d
children d78b8fe7ca83
files blat_wrapper.xml tool-data/lastz_seqs.loc.sample tool_data_table_conf.xml.sample
diffstat 3 files changed, 84 insertions(+), 7 deletions(-) [+]
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" />
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tool-data/lastz_seqs.loc.sample	Mon Nov 04 06:35:53 2013 -0500
@@ -0,0 +1,30 @@
+#This is a sample file distributed with Galaxy that enables tools
+#to use a directory of 2bit genome files for use with Lastz. You will
+#need to supply these files and then create a lastz_seqs.loc file
+#similar to this one (store it in this directory) that points to
+#the directories in which those files are stored. The lastz_seqs.loc
+#file has this format (white space characters are TAB characters):
+#
+#<unique_build_id>	<display_name>		<file_path>
+#
+#So, for example, if your lastz_seqs.loc began like this:
+#
+#hg18	Human (Homo sapiens): hg18		/depot/data2/galaxy/twobit/hg18.2bit
+#hg19	Human (Homo sapiens): hg19		/depot/data2/galaxy/twobit/hg19.2bit
+#mm9	Mouse (Mus musculus): mm9		/depot/data2/galaxy/twobit/mm9.2bit
+#
+#then your /depot/data2/galaxy/twobit/ directory
+#would need to contain the following 2bit files:
+#
+#-rw-r--r--  1 james    universe 830134 2005-09-13 10:12 hg18.2bit
+#-rw-r--r--  1 james    universe 527388 2005-09-13 10:12 hg19.2bit
+#-rw-r--r--  1 james    universe 269808 2005-09-13 10:12 mm9.2bit
+#
+#Your lastz_seqs.loc file should include an entry per line for 
+#each file you have stored that you want to be available. Note that 
+#your files should all have the extension '2bit'.
+#
+#Note that for backwards compatibility with workflows, the unique ID of
+#an entry must be the path that was in the original loc file, because that
+#is the value stored in the workflow for that parameter. 
+#
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tool_data_table_conf.xml.sample	Mon Nov 04 06:35:53 2013 -0500
@@ -0,0 +1,8 @@
+<!-- Use the file tool_data_table_conf.xml.oldlocstyle if you don't want to update your loc files as changed in revision 4550:535d276c92bc-->
+<tables>
+    <!-- Locations of 2bit sequence files for use in Lastz -->
+    <table name="lastz_seqs" comment_char="#">
+        <columns>value, name, path</columns>
+        <file path="tool-data/lastz_seqs.loc" />
+    </table>
+</tables>