diff sam_dump.xml @ 1:462ee06c9358 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sra-tools commit 4defaa3ff1c21e2ec39033bfe63ee69471104ede
author iuc
date Tue, 17 May 2016 14:14:50 -0400
parents b723c120161a
children f256cb398262
line wrap: on
line diff
--- a/sam_dump.xml	Sun Dec 06 09:04:37 2015 -0500
+++ b/sam_dump.xml	Tue May 17 14:14:50 2016 -0400
@@ -1,4 +1,4 @@
-<tool id="sam_dump" name="Extract reads" version="1.2.5">
+<tool id="sam_dump" name="Extract reads" version="1.3.0">
     <description>in SAM or BAM format from NCBI SRA.</description>
     <macros>
         <import>sra_macros.xml</import>
@@ -7,6 +7,19 @@
     <version_command>sam-dump --version</version_command>
     <command>
         <![CDATA[
+    #if $input.input_select=="file_list":
+      for acc in `cat $input.file_list` ;
+      do
+    #elif $input.input_select=="accession_number":
+      acc="$input.accession" &&
+    #end if
+
+    #if $input.input_select=="file_list" or $input.input_select=="accession_number":
+          [ ""\$acc" =~ ^[E|S|D]RR[0-9]{1,}$" ] && (
+    #end if
+
+
+
         ## 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. 
@@ -18,7 +31,7 @@
         #if ( str( $adv.region ) == "" ):
             ASCP_PATH=`command -v ascp` &&
             ASCP_KEY=`dirname \$ASCP_PATH`/asperaweb_id_dsa.openssh || true &&
-            prefetch --ascp-path "\$ASCP_PATH|\$ASCP_KEY" "$input.accession" &&
+            prefetch --ascp-path "\$ASCP_PATH|\$ASCP_KEY" "\$acc" &&
             ## Duplicate vdb-config, in case settings changed between prefetch and
             ## dump command.
             vdb-config -s "/repository/user/main/public/root=\$PWD" &&
@@ -50,16 +63,30 @@
         #if $input.input_select == "file":
             "$input.file"
         #elif $input.input_select == "accession_number":
-            "$input.accession"
+            "\$acc"
+        #elif $input.input_select=="file_list":
+            "\$acc"
         #end if
+        
         #if str( $outputformat ) == "bam":
             | samtools view -Sb - 2> /dev/null
         #end if
         #if $input.input_select == "file":
             > "$output_file"
         #elif $input.input_select == "accession_number":
-            > "$output_accession"
+            > "$output_accession" )
         #end if
+
+        #if $input.input_select=="file_list":
+                 #if str( $outputformat ) == "bam":
+                      > "\$acc.bam"
+                 #elif str( $outputformat ) == "sam":
+                      > "\$acc.sam"
+                 #end if
+        ) ; done
+        #end if
+
+
         ]]>
     </command>
     <inputs>
@@ -86,6 +113,11 @@
         </section>
     </inputs>
     <outputs>
+        <collection name="output_collection" type='list'>
+          <filter>input['input_select'] == "file_list"</filter>
+          <discover_datasets pattern="(?P&lt;designation&gt;.+)\.bam" directory="." ext='bam'/>
+          <discover_datasets pattern="(?P&lt;designation&gt;.+)\.sam" directory="." ext='sam'/>
+        </collection>      
         <data name="output_accession" format="bam" label="${input.accession}.${outputformat}">
             <filter>input['input_select'] == "accession_number"</filter>
             <change_format>