diff fastq_dump.xml @ 0:68527898a9ea draft

planemo upload for repository https://bitbucket.org/drosofff/gedtools/ commit 92d32947393757598262fbaed175b2c6fd84c181
author mvdbeek
date Fri, 25 Sep 2015 09:28:56 -0400
parents
children 6f68b86da01a
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fastq_dump.xml	Fri Sep 25 09:28:56 2015 -0400
@@ -0,0 +1,140 @@
+<tool id="fastq_dump" name="Extract reads" version="1.2.4">
+    <description>in FASTQ/A format from NCBI SRA.</description>
+    <macros>
+        <import>sra_macros.xml</import>
+    </macros>
+    <expand macro="requirements"/>
+    <command>
+        <![CDATA[
+    ## Need to set the home directory to the current working directory,
+    ## else the tool tries to write to home/.ncbi and fails when used 
+    ## with a cluster manager. 
+    export HOME=\$PWD;
+    vdb-config --restore-defaults;
+    #if $input.input_select == "file":
+        fastq-dump --log-level fatal --accession '${input.file.name}'
+    #else:
+        vdb-config -s "/repository/user/main/public/root=\$PWD";
+        ## Do not use prefetch if region is specified, to avoid downloading
+        ## the complete sra file.
+        #if ( str( $region ) == "" ) and ( str( $minID ) == "" ) and ( str( $maxID ) == "" ):
+            ASCP_PATH=`which ascp`;
+            ASCP_KEY=`dirname \$ASCP_PATH`/asperaweb_id_dsa.openssh;
+            prefetch --ascp-path "\$ASCP_PATH|\$ASCP_KEY" $input.accession;
+        #end if
+        ## Duplicate vdb-config, in case settings changed between prefetch and
+        ## dump command.
+        vdb-config -s "/repository/user/main/public/root=\$PWD";
+        fastq-dump --accession "$input.accession"
+    #end if
+    --defline-seq '@\$sn[_\$rn]/\$ri'
+    --stdout
+    #if str( $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"
+    #end if
+    #if str( $maxID ) != "":
+        --maxSpotId "$maxID"
+    #end if
+    #if str( $minlen ) != "":
+        --minReadLen "$minlen"
+    #end if
+    #if str( $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" > "$output_file"
+    #else:
+        "$input.accession" > "$output_accession"
+    #end if
+    ]]>
+    </command>
+    <version_string>fastq-dump --version</version_string>
+    <inputs>
+        <expand macro="input_conditional"/>
+        <param name="minID" type="integer" label="minimum spot ID" optional="true"/>
+        <param name="maxID" type="integer" label="maximum spot ID" optional="true"/>
+        <param name="minlen" type="integer" label="minimum read length" optional="true"/>
+        <param name="split" type="select" value="yes">
+            <label>split spot by read pairs</label>
+            <option value="yes">Yes</option>
+            <option value="no">No</option>
+        </param>
+        <expand macro="alignments"/>
+        <expand macro="region"/>
+        <expand macro="matepairDist"/>
+        <param name="readfilter" type="select" value="">
+            <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 name="spotgroups" type="text" label="filter by spot-groups" optional="true"/>
+        <param 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="fastq" name="output_accession" label="${input.accession}.${outputformat}">
+            <filter>input['input_select'] == "accession_number"</filter>
+            <change_format>
+                <when input="outputformat" value="fasta" format="fasta"/>
+            </change_format>
+        </data>
+        <data format="fastq" name="output_file" label="${input.file.name}.${outputformat}">
+            <filter>input['input_select'] == "file"</filter>
+            <change_format>
+                <when input="outputformat" value="fasta" format="fasta"/>
+            </change_format>
+        </data>
+    </outputs>
+    <stdio>
+        <exit_code range="127" level="fatal" description="Could not locate fastq-dump binary"/>
+    </stdio>
+    <tests>
+        <test>
+            <param name="input_select" value="accession_number"/>
+            <param name="outputformat" value="fastqsanger"/>
+            <param name="accession" value="SRR925743"/>
+            <param name="maxID" value="5"/>
+            <output name="output_accession" file="fastq_dump_result.fastq" ftype="fastq"/>
+        </test>
+    </tests>
+    <help>
+        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.
+        @SRATOOLS_ATTRRIBUTION@
+    </help>
+</tool>