diff fastq_dump.xml @ 6:30775c836c77 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sra-tools commit ee50324111351323cc294e051a6fab1733a89ec1
author iuc
date Wed, 22 Mar 2017 05:23:31 -0400
parents 62e4d56ebb6f
children c7620aa7e1f0
line wrap: on
line diff
--- a/fastq_dump.xml	Wed Dec 07 09:10:29 2016 -0500
+++ b/fastq_dump.xml	Wed Mar 22 05:23:31 2017 -0400
@@ -1,4 +1,4 @@
-<tool id="fastq_dump" name="Extract reads" version="@VERSION@">
+<tool id="fastq_dump" name="Extract reads" version="@VERSION@.1">
     <description>in FASTQ/A format from NCBI SRA.</description>
     <macros>
         <import>sra_macros.xml</import>
@@ -93,20 +93,19 @@
     ;
 
 
-    #if str( $outputformat ) == "fasta":
-
-        for f in *_2.fasta ; do   mv "\$f" "`basename \$f _2.fasta`_reverse.fasta" ;  mv "`basename \$f _2.fasta`_1.fasta" "`basename \$f _2.fasta`_forward.fasta"  ; done &&
-        for f in *_1.fasta; do mv "\$f" "`basename \$f _1.fasta`__single.fasta"; done
-
-    #else:
-
-        for f in *_2.fastq ; do   mv "\$f" "`basename \$f _2.fastq`_reverse.fastq" ;  mv "`basename \$f _2.fastq`_1.fastq" "`basename \$f _2.fastq`_forward.fastq"  ; done &&
-        for f in *_1.fastq; do mv "\$f" "`basename \$f _1.fastq`__single.fastq"; done
-
-    #end if
 
 
 
+    for i in `ls *.fast* | cut -f 1 -d '_' | uniq` ; do
+      count=`ls \$i* | wc -l` ;
+      data=(\$(ls -d \$i*));
+      
+      if [ "\$count" -eq 2 ]; then
+         mv "\${data[0]}" "\${data[0]}"_forward.$outputformat;  mv "\${data[1]}" "\${data[1]}"_reverse.$outputformat ;
+      elif [ "\$count" -eq 1 ]; then
+         mv "\${data[0]}" "\${data[0]}"__single.$outputformat ;
+      fi;
+    done
 
 
     #end if
@@ -153,13 +152,13 @@
              identifier in the nested collection and identifier_1 is either
              forward or reverse (for instance samp1_forward.fq).
         -->
-        <discover_datasets pattern="(?P&lt;identifier_0&gt;[^_]+)_(?P&lt;identifier_1&gt;[^_]+)\.fastq" ext="fastqsanger" visible="false" />
-        <discover_datasets pattern="(?P&lt;identifier_0&gt;[^_]+)_(?P&lt;identifier_1&gt;[^_]+)\.fasta" ext="fasta" visible="false" />
+        <discover_datasets pattern="(?P&lt;identifier_0&gt;[^_]+)_\d+.fastq_(?P&lt;identifier_1&gt;[^_]+)\.fastq" ext="fastqsanger" visible="false" />
+        <discover_datasets pattern="(?P&lt;identifier_0&gt;[^_]+)_\d+.fasta_(?P&lt;identifier_1&gt;[^_]+)\.fasta" ext="fasta" visible="false" />
       </collection>
       <collection name="output_collection" type='list' label="Single-end Fast(q|a)">
         <filter>input['input_select'] == "file_list"</filter>
-        <discover_datasets pattern="(?P&lt;designation&gt;.+)__single\.fastq" directory="." ext='fastqsanger'/>
-        <discover_datasets pattern="(?P&lt;designation&gt;.+)__single\.fasta" directory="." ext='fasta'/>
+        <discover_datasets pattern="(?P&lt;designation&gt;.+)_\d+.fastq__single\.fastq" directory="." ext='fastqsanger'/>
+        <discover_datasets pattern="(?P&lt;designation&gt;.+)_\d+.fasta__single\.fasta" directory="." ext='fasta'/>
       </collection>
       <data format="fastqsanger" name="output_accession" >
         <filter>input['input_select'] == "accession_number"</filter>
@@ -194,6 +193,43 @@
         <param name="maxID" value="5"/>
         <output name="output_accession" file="fastq_dump_result.fastq" ftype="fastqsanger"/>
       </test>
+      <test>
+        <param name="input_select" value="file_list"/>
+        <param name="outputformat" value="fastqsanger"/>
+        <param name="file_list" value="list_pe"/>
+        <param name="maxID" value="5"/>
+        <output_collection name="list_paired" type="list:paired">
+          <element name="DRR015708">
+            <element name="forward" file="DRR015708_forward.fastqsanger">
+            </element>
+            <element name="reverse" file="DRR015708_reverse.fastqsanger">
+            </element>
+          </element>
+        </output_collection>
+      </test>
+      <test>
+        <param name="input_select" value="file_list"/>
+        <param name="outputformat" value="fastqsanger"/>
+        <param name="file_list" value="list_pe2"/>
+        <param name="maxID" value="5"/>
+        <output_collection name="list_paired" type="list:paired">
+          <element name="ERR027433">
+            <element name="forward" file="ERR027433_forward.fastqsanger">
+            </element>
+            <element name="reverse" file="ERR027433_reverse.fastqsanger">
+            </element>
+          </element>
+        </output_collection>
+      </test>      
+      <test>
+        <param name="input_select" value="file_list"/>
+        <param name="outputformat" value="fastqsanger"/>
+        <param name="file_list" value="list_se"/>
+        <param name="maxID" value="5"/>
+        <output_collection name="output_collection" type="list">
+          <element name="SRR1993644" file="SRR1993644.fastqsanger"/>
+        </output_collection>
+      </test>            
     </tests>
     <help>
         This tool extracts reads from SRA archives using fastq-dump.