diff save_to_db.xml @ 2:81e9e1d803fa draft

planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
author tduigou
date Fri, 16 May 2025 09:34:35 +0000
parents 6854ac8c5d2b
children eca0d710bbe9
line wrap: on
line diff
--- a/save_to_db.xml	Thu Apr 24 12:02:14 2025 +0000
+++ b/save_to_db.xml	Fri May 16 09:34:35 2025 +0000
@@ -1,7 +1,7 @@
 <tool id="save_to_db" name="Save Data To DB" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="21.09">
     <description>Save data to SQL DB</description>
     <macros>
-        <token name="@VERSION_SUFFIX@">0</token>
+        <token name="@VERSION_SUFFIX@">1</token>
         <token name="@TOOL_VERSION@">0.1.0</token>
     </macros>
     <requirements>
@@ -10,9 +10,10 @@
         <requirement type="package" version="2.9.9">psycopg2</requirement>
     </requirements>
     <command detect_errors="exit_code"><![CDATA[
+        #set genbank_file_paths = ','.join([str(f) for f in $genbank_files])
         #set $file_name_mapping = ",".join(["%s:%s" % (file.file_name, file.name) for file in $genbank_files])
         python '$__tool_directory__/save_to_db.py'
-            --input '$genbank_files' 
+            --input '$genbank_file_paths' 
             --sequence_column '$sequence_column'
             --annotation_column '$annotation_column'
             --db_uri '$db_uri' 
@@ -22,7 +23,7 @@
             --file_name_mapping '$file_name_mapping'
     ]]></command>
     <inputs>
-        <param name="genbank_files" type="data" format="genbank" multiple="true" label="GenBank File(s)"/>
+        <param name="genbank_files" type="data_collection" collection_type="list" format="genbank" label="GenBank File(s)"/>
         <param name="table" type="text" label="Database Table Name" optional="false" />
         <param name="sequence_column" type="text" label="DB column contains sequence for ganbank file" optional="false" />
         <param name="annotation_column" type="text" label="DB column contains annotation for ganbank file" optional="false" />
@@ -36,7 +37,15 @@
     <!--python save_to_db.py -input 'test-data/p7_L7Ae-Weiss.gb,test-data/p6_Nt-IgKLsequence.gb,test-data/p6_Kozak-ATG.gb,test-data/p4_Kt-L7Ae-Weiss.gb,test-data/HC_Amp_ccdB.gb' -sequence_column 'sequence' -annotation_column 'annotation' -db_uri 'postgresql://postgres:RK17@localhost:5432/test_fragments_db' -table 'sample' -fragment_column 'fragment' -output 'test-data/test_raport.txt'
     but it will not work as there is an extra param '-file_name_mapping' that are generated by galaxy and contain the dict for 'file.dat:fragment name' to stock the fragment name from file name thus use planemo with debug to test -->
         <test> 
-            <param name="genbank_files" value="p7_L7Ae-Weiss.gb,p6_Nt-IgKLsequence.gb,p6_Kozak-ATG.gb,p4_Kt-L7Ae-Weiss.gb,HC_Amp_ccdB.gb" />
+            <param name="genbank_files">
+                <collection type="list">
+                    <element name="p7_L7Ae-Weiss" value="p7_L7Ae-Weiss.gb" />
+                    <element name="p7_gfp_sequence" value="p6_Nt-IgKLsequence.gb" />
+                    <element name="p14_CMVp" value="p6_Kozak-ATG.gb" />
+                    <element name="p16_bGHpolyA" value="p4_Kt-L7Ae-Weiss.gb" />
+                    <element name="p18_CMVp" value="HC_Amp_ccdB.gb" />
+                </collection>
+            </param>
             <param name="table" value="sample" />
             <param name="sequence_column" value="sequence" />
             <param name="annotation_column" value="annotation" />