diff fasterq_dump.xml @ 21:9828888fc245 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sra-tools commit a464017f4a599697101dbd26cf5eb902588359b5"
author iuc
date Tue, 27 Apr 2021 08:54:57 +0000
parents b50c21c6e6bb
children fe99dc15b7af
line wrap: on
line diff
--- a/fasterq_dump.xml	Thu Aug 20 09:05:33 2020 +0000
+++ b/fasterq_dump.xml	Tue Apr 27 08:54:57 2021 +0000
@@ -14,13 +14,16 @@
         ln -s '${input.file}' "\$acc" &&
     #end if
     @CONFIGURE_RETRY@
+    ## fetch from public s3 bucket if we can
+    export acc_or_path="\$acc" &&
+    aws s3 cp --no-sign-request "s3://sra-pub-sars-cov2/run/\$acc/\$acc" "\$acc.sra" 2>&1 | tee '$log' && export acc_or_path="\$acc.sra"|| true &&
     while [ \$SRA_PREFETCH_ATTEMPT -le \$SRA_PREFETCH_RETRIES ] ; do
-        fasterq-dump "\$acc" -e \${GALAXY_SLOTS:-1}
+        fasterq-dump "\$acc_or_path" -e \${GALAXY_SLOTS:-1}
         $adv.split
         #if str( $adv.minlen ) != "":
             --min-read-len "$adv.minlen"
         #end if
-        $adv.skip_technical 2>&1 | tee $log;
+        $adv.skip_technical 2>&1 | tee -a '$log';
         if [ \$? == 0 ] && [ \$(ls *.fastq | wc -l) -ge 1 ]; then
             break ;
         else
@@ -103,10 +106,10 @@
         </collection>
     </outputs>
     <tests>
-        <test>
+        <test expect_num_outputs="4">
             <param name="input_select" value="accession_number"/>
             <param name="accession" value="ERR086330"/>
-            <output_collection name="list_paired" type="list:paired">
+            <output_collection name="list_paired" type="list:paired" count="1">
                 <element name="ERR086330">
                     <element name="forward" file="ERR086330_1.fastq.gz" decompress="True">
                     </element>
@@ -115,22 +118,22 @@
                 </element>
             </output_collection>
         </test>
-        <test>
+        <test expect_num_outputs="4">
             <param name="input_select" value="accession_number"/>
             <param name="accession" value="SRR002702"/>
             <param name="split" value="--split-files"/>
             <param name="skip_technical" value="False"/>
-            <output_collection name="output_collection_other" type="list">
+            <output_collection name="output_collection_other" type="list" count="2">
                 <element name="SRR002702_1" file="SRR002702_1.fastq.gz" ftype="fastqsanger.gz" decompress="True"/>
                 <element name="SRR002702_2" file="SRR002702_2.fastq.gz" ftype="fastqsanger.gz" decompress="True"/>
             </output_collection>
         </test>
-        <test>
+        <test expect_num_outputs="4">
             <param name="input_select" value="file"/>
             <param name="file" value="SRR522874.sra"/>
             <param name="split" value="--split-files"/>
             <param name="skip_technical" value="True"/>
-            <output_collection name="list_paired" type="list:paired">
+            <output_collection name="list_paired" type="list:paired" count="1">
                 <element name="SRR522874.sra">
                     <element name="forward" file="SRR522874.sra_2.fastq.gz" decompress="True">
                     </element>
@@ -139,59 +142,58 @@
                 </element>
             </output_collection>
         </test>
-        <test>
+        <test expect_num_outputs="4">
             <param name="input_select" value="file"/>
             <param name="file" value="SRR522874.sra"/>
             <param name="split" value="--split-files"/>
             <param name="skip_technical" value="False"/>
-            <output_collection name="output_collection_other" type="list">
-                <element name="SRR522874.sra_1" file="SRR522874.sra_1.fastq.gz" ftype="fastqsanger.gz" decompress="True"/>
-                <element name="SRR522874.sra_2" file="SRR522874.sra_2.fastq.gz" ftype="fastqsanger.gz" decompress="True"/>
-                <element name="SRR522874.sra_3" file="SRR522874.sra_3.fastq.gz" ftype="fastqsanger.gz" decompress="True"/>
-                <element name="SRR522874.sra_4" file="SRR522874.sra_4.fastq.gz" ftype="fastqsanger.gz" decompress="True"/>
+            <output_collection name="output_collection_other" type="list" count="4">
+                <element name="SRR522874_1" file="SRR522874.sra_1.fastq.gz" ftype="fastqsanger.gz" decompress="True"/>
+                <element name="SRR522874_2" file="SRR522874.sra_2.fastq.gz" ftype="fastqsanger.gz" decompress="True"/>
+                <element name="SRR522874_3" file="SRR522874.sra_3.fastq.gz" ftype="fastqsanger.gz" decompress="True"/>
+                <element name="SRR522874_4" file="SRR522874.sra_4.fastq.gz" ftype="fastqsanger.gz" decompress="True"/>
             </output_collection>
         </test>
-        <test>
+        <test expect_num_outputs="4">
             <param name="input_select" value="file_list"/>
             <param name="file_list" value="list_sra"/>
             <param name="minlen" value="21"/>
             <output_collection name="output_collection_other" type="list">
                 <element name="SRR522874__single" file="SRR522874.fastq.gz" ftype="fastqsanger.gz" decompress="True"/>
             </output_collection>
-            <output_collection name="list_paired" type="list:paired">
+            <output_collection name="list_paired" type="list:paired" count="1">
                 <element name="SRR522874">
-                    <element name="forward" file="SRR522874_1.fastq.gz" decompress="True">
-                    </element>
-                    <element name="reverse" file="SRR522874_2.fastq.gz" decompress="True">
-                    </element>
+                    <element name="forward" file="SRR522874_1.fastq.gz" decompress="True"/>
+                    <element name="reverse" file="SRR522874_2.fastq.gz" decompress="True"/>
                 </element>
             </output_collection>
             <output_collection name="output_collection" type="list">
                 <element name="SRR002702" file="SRR002702_2.fastq.gz" ftype="fastqsanger.gz" decompress="True"/>
             </output_collection>
         </test>
-        <test>
+        <test expect_num_outputs="4">
             <param name="input_select" value="file_list"/>
             <param name="file_list" value="sra_manifest.tabular" ftype="sra_manifest.tabular"/>
-            <output_collection name="list_paired" type="list:paired">
-                <element name="SRR11857975">
-                    <element name="forward" file="SRR11857975_1.fastq.gz" decompress="True">
-                    </element>
-                    <element name="reverse" file="SRR11857975_2.fastq.gz" decompress="True">
-                    </element>
-                </element>
-            </output_collection>
-        </test>
-        <test>
-            <param name="input_select" value="file_list"/>
-            <param name="file_list" value="sra_manifest.tabular" ftype="sra_manifest.tabular"/>
-            <output_collection name="list_paired" type="list:paired">
+            <output_collection name="list_paired" type="list:paired" count="1">
                 <element name="SRR11953971">
                     <element name="forward" file="SRR11953971_1.fastq.gz" decompress="True"/>
                     <element name="reverse" file="SRR11953971_2.fastq.gz" decompress="True"/>
                 </element>
             </output_collection>
         </test>
+        <test expect_num_outputs="4">
+             <!-- test accession downloaded from public bucket -->
+            <param name="input_select" value="accession_number"/>
+            <param name="accession" value="SRR11859153"/>
+            <output_collection name="output_collection" type="list" count="1">
+                <element name="SRR11859153" file="SRR11859153.fastq.gz" decompress="True"/>
+            </output_collection>
+            <output name="log">
+                <assert_contents>
+                    <has_text text="download: s3://sra-pub-sars-cov2/"/>
+                </assert_contents>
+            </output>
+        </test>
     </tests>
     <help><![CDATA[
 **What it does?**