changeset 37:4da2d7f0128e draft

Exposed more options for fastq_dump and sam_dump
author Matt Shirley <mdshw5@gmail.com>
date Thu, 01 Aug 2013 13:57:27 -0400
parents b5274b0e61bc
children a0925f507352
files fastq_dump.xml sam_dump.xml sra_fetch.xml
diffstat 3 files changed, 128 insertions(+), 50 deletions(-) [+]
line wrap: on
line diff
--- a/fastq_dump.xml	Sun Jun 30 19:50:44 2013 -0400
+++ b/fastq_dump.xml	Thu Aug 01 13:57:27 2013 -0400
@@ -1,5 +1,5 @@
-<tool id="fastq_dump" name="Extract fastq" version="1.0.3">
-  <description> format reads from NCBI sra.</description>
+<tool id="fastq_dump" name="Extract reads" version="1.1.0">
+  <description> from NCBI SRA.</description>
   <command>
     fastq-dump --log-level fatal 
     #if $input.input_select == "file":
@@ -7,24 +7,44 @@
     #else:
       --accession $input.accession 
     #end if
+    --defline-seq '@\$sn[_\$rn]/\$ri' 
     --stdout 
-    $split 
-    $aligned 
+    #if $split == "yes":
+      --split-spot
+    #end if
+    #if str( $alignments ) == "aligned":
+      --aligned
+    #end if
+    #if str( $alignments ) == "unaligned":
+      --unaligned
+    #end if
     #if str( $minID ) != "":
-      --minSpotId $minID
+      --minSpotId $minID 
     #end if
     #if str( $maxID ) != "":
-      --minSpotId $maxID
+      --maxSpotId $maxID 
     #end if
     #if str( $minlen ) != "":
-      --minReadLen $minlen
+      --minReadLen $minlen 
     #end if
     #if str( $readfilter ) != "":
-      --read-filter $readfilter
+      --read-filter $readfilter 
     #end if
     #if str( $region ) != "":
       --aligned-region $region
     #end if
+    #if str( $spotgroups ) != "":
+      --spot-groups $spotgroups
+    #end if
+    #if str( $matepairDist ) != "":
+      --matepair-distance $matepairDist
+    #end if
+    #if $clip == "yes":
+      --clip
+    #end if
+    #if str( $outputformat ) == "fasta":
+      --fasta
+    #end if
     #if $input.input_select=="file":
       $input.file
     #else:
@@ -35,52 +55,67 @@
   <version_string>fastq-dump --version</version_string>
   <inputs>
     <conditional name="input">
-      <param name="input_select" type="select" label="Select input type">
+      <param name="input_select" type="select" label="select input type">
         <option value="accession_number">SRR accession</option>
         <option value="file">SRA archive in current history</option>
       </param>
       <when value="file">
-	<param format="sra" name="file" type="data" label="sra archive"/>
+    <param format="sra" name="file" type="data" label="sra archive"/>
       </when>
       <when value="accession_number">
-	<param format="text" name="accession" type="text" label="accession"/>
+    <param format="text" name="accession" type="text" label="accession"/>
       </when>
     </conditional>
-    <param format="text" name="minID" type="text" label="Minimum spot ID"/>
-    <param format="text" name="maxID" type="text" label="Maximum spot ID"/>
-    <param format="text" name="minlen" type="text" label="Minimum read length"/>
-    <param format="text" name="split" type="select" value="">
-      <label>Split read pairs</label>
-      <option value="">No</option>
-      <option value="--split-spot">Yes</option>
+    <param format="text" name="minID" type="text" label="minimum spot ID"/>
+    <param format="text" name="maxID" type="text" label="maximum spot ID"/>
+    <param format="text" name="minlen" type="text" label="minimum read length"/>
+    <param format="text" name="split" type="select" value="yes">
+      <label>split spot by read pairs</label>
+      <option value="yes">Yes</option>
+      <option value="no">No</option>
     </param>
-    <param format="text" name="aligned" type="select" value="">
-      <label>Specify alignment</label>
-      <option value="">All</option>
-      <option value="--aligned">Only aligned</option>
-      <option value="--unaligned">Only unaligned</option>
+    <param format="text" name="alignments" type="select" value="both">
+      <label>aligned or unaligned reads</label>
+      <option value="both">both</option>
+      <option value="aligned">aligned only</option>
+        <option value="unaligned">unaligned only</option>
     </param>
-    <param format="text" name="region" type="text" label="Aligned region"/>
+    <param format="text" name="region" type="text" label="aligned region"/>
+    <param format="text" name="matepairDist" type="text" label="mate-pair distance (from-to|unknown)"/>
     <param format="text" name="readfilter" type="select" value="">
-      <label>Filter by value</label>
+      <label>filter by value</label>
       <option value="">None</option>
       <option value="pass">pass</option>
       <option value="reject">reject</option>
       <option value="criteria">criteria</option>
       <option value="redacted">redacted</option>
     </param>
+    <param name="outputformat" type="select" label="select output format">
+      <option value="fastqsanger">fastq</option>
+      <option value="fasta">fasta</option>
+    </param>
+    <param format="text" name="spotgroups" type="text" label="filter by spot-groups"/>
+    <param format="text" name="clip" type="select" value="no">
+      <label>apply left and right clips</label>
+      <option value="no">No</option>
+      <option value="yes">Yes</option>
+    </param>
   </inputs>
   <outputs>
-    <data format="fastqsanger" name="output"/>
+    <data format="fastq" name="output">
+        <change_format>
+            <when input="outputformat" value="fasta" format="fasta" />
+        </change_format>
+    </data>
   </outputs>
   <stdio>
-    <exit_code range="127" level="fatal" description="Cannot find fastq-dump binary"/>
+    <exit_code range="127" level="fatal" description="Could not locate fastq-dump binary"/>
   </stdio>
   <requirements>
     <requirement type="package" version="2.3.2-4">sra_toolkit</requirement>
   </requirements>
   <help>
-    This tool extracts fastq format reads from sra archives using fastq-dump. 
+    This tool extracts reads from SRA archives using fastq-dump. 
     The fastq-dump program is developed at NCBI, and is available at: http://www.ncbi.nlm.nih.gov/Traces/sra/sra.cgi?view=software.
     Contact Matt Shirley at mdshw5@gmail.com for support and bug reports.
   </help>
--- a/sam_dump.xml	Sun Jun 30 19:50:44 2013 -0400
+++ b/sam_dump.xml	Thu Aug 01 13:57:27 2013 -0400
@@ -1,24 +1,67 @@
-<tool id="sam_dump" name="Extract SAM" version="1.0.2">
-  <description> format reads from NCBI sra.</description>
-  <command>sam-dump $header $aligned $primary '$input' > $output</command>
+<tool id="sam_dump" name="Extract reads" version="1.1.0">
+  <description> in SAM format from NCBI SRA.</description>
+  <command>
+    sam-dump --log-level fatal 
+    #if str( $region ) != "":
+      --aligned-region $region
+    #end if
+    #if str( $matepairDist ) != "":
+      --matepair-distance $matepairDist
+    #end if
+    #if $header == "yes":
+      --header
+    #else:
+      --no-header 
+    #end if
+    #if str( $alignments ) == "both":
+      --unaligned
+    #end if
+    #if str( $alignments ) == "unaligned":
+      --unaligned-spots-only
+    #end if
+    #if (str( $primary ) == "yes") and (str ( $alignments != "unaligned") ):
+      --primary
+    #end if
+    #if $input.input_select == "file":
+      $input.file
+    #else:
+      $input.accession 
+    #end if
+    > $output
+  </command>  
   <version_string>sam-dump --version</version_string>
   <inputs>
-    <param format="SRA" name="input" type="data" label="sra archive"/>
-    <param format="text" name="header" type="select" value="">
-      <label>Output SAM header</label>
-      <option value="--header">Yes</option>
-      <option value="--no-header">No</option>
+    <conditional name="input">
+      <param name="input_select" type="select" label="select input type">
+        <option value="accession_number">SRR accession</option>
+        <option value="file">SRA archive in current history</option>
+      </param>
+      <when value="file">
+    <param format="sra" name="file" type="data" label="sra archive"/>
+      </when>
+      <when value="accession_number">
+    <param format="text" name="accession" type="text" label="accession"/>
+      </when>
+    </conditional>
+    <param format="text" name="region" type="text" label="aligned region"/>
+    <param format="text" name="matepairDist" type="text" label="mate-pair distance (from-to|unknown)"/>
+    <param format="text" name="header" type="select" value="yes">
+      <label>output SAM header</label>
+      <option value="yes">Yes</option>
+      <option value="no">No</option>
     </param>
-    <param format="text" name="aligned" type="select" value="">
-      <label>Output unaligned reads as well as aligned reads</label>
-      <option value="">No</option>
-      <option value="--unaligned">Yes</option>
+    <param format="text" name="alignments" type="select" value="both">
+      <label>aligned or unaligned reads</label>
+      <option value="both">both</option>
+      <option value="aligned">aligned only</option>
+        <option value="unaligned">unaligned only</option>
     </param>
-    <param format="text" name="primary" type="select" value="">
-      <label>Output only primary aligments</label>
-      <option value="">No</option>
-      <option value="--primary">Yes</option>
+    <param format="text" name="primary" type="select" value="no">
+      <label>only primary aligments</label>
+      <option value="no">No</option>
+      <option value="yes">Yes</option>
     </param>
+    <param format="text" name="minMapq" type="text" label="minimum mapping quality"/>
   </inputs>
   <outputs>
     <data format="sam" name="output"/>
@@ -27,8 +70,8 @@
     <requirement type="package" version="2.3.2-4">sra_toolkit</requirement>
   </requirements>
   <help>
-    This tool extracts sam format reads from sra archives using sam-dump. 
+    This tool extracts reads from sra archives using sam-dump. 
     The sam-dump program is developed at NCBI, and is available at: http://www.ncbi.nlm.nih.gov/Traces/sra/sra.cgi?view=software.
     Contact Matt Shirley at mdshw5@gmail.com for support and bug reports.
   </help>
-</tool>
+</tool>
\ No newline at end of file
--- a/sra_fetch.xml	Sun Jun 30 19:50:44 2013 -0400
+++ b/sra_fetch.xml	Thu Aug 01 13:57:27 2013 -0400
@@ -1,13 +1,13 @@
-<tool id="sra_fetch" name="Fetch sra run" version="1.0.3">
-  <description> by accession from NCBI sra.</description>
+<tool id="sra_fetch" name="Fetch SRA archive" version="1.0.3">
+  <description> by accession from NCBI SRA.</description>
   <command interpreter="python">sra_fetch.py --accession '$accession' --out '$output'</command>
   <inputs>
     <param name="accession" size="13" type="text" value="SRR000001" label="sra run accession"/>
   </inputs>
   <outputs>
-    <data format="sra" name="output" label="Fetch sra ${accession.value}"/>
+    <data format="sra" name="output" label="${accession.value}"/>
   </outputs>
   <help>
-    This tool fetches sra archives by accession from NCBI over ftp.
+    This tool fetches sra archives by accession from NCBI over FTP.
   </help>
 </tool>