comparison seq_to_db.xml @ 1:5db1c2b9edb8 draft

planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools commit fa4c85dd6ad48d404a28e21667f18b628bbdc702-dirty
author tduigou
date Fri, 11 Jul 2025 14:16:33 +0000
parents 178d068648f4
children
comparison
equal deleted inserted replaced
0:178d068648f4 1:5db1c2b9edb8
1 <tool id="seq_to_db" name="Save Sequence Data In DB" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="21.09"> 1 <tool id="seq_to_db" name="Save Sequence Data In DB" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="21.09">
2 <description>Save fragment's sequence in an accessible database and import it from .gb files</description> 2 <description>Save fragment's sequence in an accessible database and import it from .gb files</description>
3 <macros> 3 <macros>
4 <token name="@VERSION_SUFFIX@">1</token> 4 <token name="@VERSION_SUFFIX@">2</token>
5 <token name="@TOOL_VERSION@">0.2.0</token> 5 <token name="@TOOL_VERSION@">0.3.0</token>
6 </macros> 6 </macros>
7 <requirements> 7 <requirements>
8 <requirement type="package" version="2.2.3">pandas</requirement> 8 <requirement type="package" version="2.2.3">pandas</requirement>
9 <requirement type="package" version="2.0.40">sqlalchemy</requirement> 9 <requirement type="package" version="2.0.40">sqlalchemy</requirement>
10 <requirement type="package" version="2.9.9">psycopg2</requirement> 10 <requirement type="package" version="2.9.9">psycopg2</requirement>
11 </requirements> 11 </requirements>
12 <command detect_errors="exit_code"><![CDATA[ 12 <command detect_errors="exit_code"><![CDATA[
13 #set genbank_file_paths = ','.join([str(f) for f in $genbank_files]) 13 #set genbank_file_paths = ','.join([str(f) for f in $genbank_files])
14 #set $file_name_mapping = ",".join(["%s:%s" % (file.file_name, file.name) for file in $genbank_files]) 14 #set file_name_mapping = ",".join(["%s:%s" % (file.file_name, file.name) for file in $genbank_files])
15 python '$__tool_directory__/save_to_db.py' 15 python '$__tool_directory__/save_to_db.py'
16 --input '$genbank_file_paths' 16 --input '$genbank_file_paths'
17 --sequence_column '$sequence_column' 17 --use_json_paramers '$json_use.use_json_paramers'
18 --annotation_column '$annotation_column' 18 #if not $json_use.use_json_paramers:
19 --db_uri '$db_uri' 19 --sequence_column '$json_use.sequence_column'
20 --table '$table' 20 --annotation_column '$json_use.annotation_column'
21 --fragment_column '$fragment_column' 21 --db_uri '$json_use.db_uri'
22 --table '$json_use.table'
23 --fragment_column '$json_use.fragment_column'
24 --execution_enable '$json_use.execution_enable'
25 #else:
26 --json_conf '$json_use.json_conf'
27 #end if
22 --output '$output' 28 --output '$output'
23 --file_name_mapping '$file_name_mapping' 29 --file_name_mapping '$file_name_mapping'
24 --json_conf '$json_conf' 30 --json_generating '$json_generating'
25 --execution_enable '$execution_enable' 31 --json_output '$json_output'
26 ]]></command> 32 ]]></command>
27 <inputs> 33 <inputs>
28 <param name="genbank_files" type="data_collection" collection_type="list" format="genbank" label="GenBank File(s)"/> 34 <param name="genbank_files" type="data_collection" collection_type="list" format="genbank" label="GenBank File(s)"/>
29 <param name="table" type="text" label="DB Table Name" optional="true" help="It can be extracted from JSON file -key:'JSON_table'-" /> 35 <conditional name="json_use">
30 <param name="sequence_column" type="text" label="DB Column Contains Sequence For ganbank File" optional="true" help="It can be extracted from JSON file -key:'JSON_sequence_column'-" /> 36 <param name="use_json_paramers" type="boolean" checked='false' label="Use parameters from JSON" help="extract parameters from json file" />
31 <param name="annotation_column" type="text" label="DB Column Contains Annotation For Ganbank File" optional="true" help="It can be extracted from JSON file -key:'JSON_annotation_column'-" /> 37 <when value="false">
32 <param name="fragment_column" type="text" label="DB IDs Column Name" optional="true" help="It can be extracted from JSON file -key:'JSON_fragment_column'-" /> 38 <param name="execution_enable" type="boolean" checked='true' label="Send Requenst to DB" help="enable or desable the interaction with the DB (can be usefull in workflows)" />
33 <param name="db_uri" type="text" label="DB Connection URI" help="postgresql://(user_name or container_name):password@host:port/path/to/database (It can be extracted from JSON file -key:'JSON_db_uri'-)" optional="true" /> 39 <param name="table" type="text" label="DB Table Name" optional="true" help="It can be extracted from JSON file -key:'table'-" />
34 <section name='adv' title='Advance' expanded='false'> 40 <param name="sequence_column" type="text" label="DB Column Contains Sequence For ganbank File" optional="true" help="It can be extracted from JSON file -key:'sequence_column'-" />
35 <param name="execution_enable" type="boolean" checked='true' label="Send Requenst to DB" help="enable or desable the interaction with the DB (can be usefull in workflows)" /> 41 <param name="annotation_column" type="text" label="DB Column Contains Annotation For Ganbank File" optional="true" help="It can be extracted from JSON file -key:'annotation_column'-" />
36 <param name="json_conf" type="data" format='json' label="DB config as a json file" help="JSON file specifying the database URI, table name and the column names for annotation and sequence data" optional="true" /> 42 <param name="fragment_column" type="text" label="DB IDs Column Name" optional="true" help="It can be extracted from JSON file -key:'fragment_column'-" />
37 </section> 43 <param name="db_uri" type="text" label="DB Connection URI" help="postgresql://user_name:password@host:port/path/to/database (It can be extracted from JSON file -key:'db_uri'-)" optional="true" />
44 </when>
45 <when value="true">
46 <param name="json_conf" type="data" format='json' label="DB config as a json file" help="JSON file specifying the database URI, table name and the column names for annotation and sequence data" optional="false" />
47 </when>
48 </conditional>
49 <param name="json_generating" type="boolean" checked='true' label="Generat Parameters in JSON" help="generat parameters in json file" />
38 </inputs> 50 </inputs>
39 <outputs> 51 <outputs>
40 <data name="output" format="txt" label="saving report" /> 52 <data name="output" format="txt" label="saving report" />
53 <data name="json_output" format="json" label="seq_to_db_param">
54 <filter>json_generating == True</filter>
55 </data>
41 </outputs> 56 </outputs>
42 <tests> 57 <tests>
43 <!--test tool blocking from galaxy. It is commented because it should faild as it is a test to validate that the tool can be blocked from json file --> 58 <!--test tool blocking from galaxy. It is commented because it should faild as it is a test to validate that the tool can be blocked from json file -->
44 <test> 59 <test expect_num_outputs="2">
60 <param name="genbank_files">
61 <conditional type="list">
62 <element name="p7_L7Ae-Weiss" value="p7_L7Ae-Weiss.gb" />
63 <element name="p7_gfp_sequence" value="p6_Nt-IgKLsequence.gb" />
64 <element name="p14_CMVp" value="p6_Kozak-ATG.gb" />
65 <element name="p16_bGHpolyA" value="p4_Kt-L7Ae-Weiss.gb" />
66 <element name="p18_CMVp" value="HC_Amp_ccdB.gb" />
67 </conditional>
68 </param>
69 <conditional name="json_use">
70 <param name='use_json_paramers' value='false' />
71 <param name="table" value="sample" />
72 <param name="sequence_column" value="sequence" />
73 <param name="annotation_column" value="annotation" />
74 <param name="fragment_column" value="fragment" />
75 <param name="db_uri" value="postgresql://postgres:RK17@localhost:5432/test_fragments_db" />
76 <param name="execution_enable" value="false" />
77 </conditional>
78 <param name="use_json_paramers" value='true'/>
79 <output name="output" file="test_raport.txt" ftype="txt" >
80 <assert_contents>
81 <has_n_lines n="0" />
82 </assert_contents>
83 </output>
84 <output name="json_output">
85 <assert_contents>
86 <has_n_lines n="8" />
87 </assert_contents>
88 </output>
89 </test>
90 <!--test tool blocking from JSON. It is commented because it should faild as it is a test to validate that the tool can be blocked from json file -->
91 <test expect_num_outputs="1">
45 <param name="genbank_files"> 92 <param name="genbank_files">
46 <collection type="list"> 93 <collection type="list">
47 <element name="p7_L7Ae-Weiss" value="p7_L7Ae-Weiss.gb" /> 94 <element name="p7_L7Ae-Weiss" value="p7_L7Ae-Weiss.gb" />
48 <element name="p7_gfp_sequence" value="p6_Nt-IgKLsequence.gb" /> 95 <element name="p7_gfp_sequence" value="p6_Nt-IgKLsequence.gb" />
49 <element name="p14_CMVp" value="p6_Kozak-ATG.gb" /> 96 <element name="p14_CMVp" value="p6_Kozak-ATG.gb" />
50 <element name="p16_bGHpolyA" value="p4_Kt-L7Ae-Weiss.gb" /> 97 <element name="p16_bGHpolyA" value="p4_Kt-L7Ae-Weiss.gb" />
51 <element name="p18_CMVp" value="HC_Amp_ccdB.gb" /> 98 <element name="p18_CMVp" value="HC_Amp_ccdB.gb" />
52 </collection> 99 </collection>
53 </param> 100 </param>
54 <param name="table" value="sample" /> 101 <conditional name="json_use">
55 <param name="sequence_column" value="sequence" /> 102 <param name="use_json_paramers" value='true'/>
56 <param name="annotation_column" value="annotation" /> 103 <param name="json_conf" value="test-JSON_arg_block.json" />
57 <param name="fragment_column" value="fragment" /> 104 </conditional>
58 <param name="db_uri" value="postgresql://postgres:RK17@localhost:5432/test_fragments_db" /> 105 <param name="json_generating" value='false'/>
59 <param name="adv|execution_enable" value="false" /> 106 <param name="json_conf" value="test-JSON_arg_block.json" />
107 <output name="output" file="test_raport.txt" ftype="txt" >
108 <assert_contents>
109 <has_n_lines n="0" />
110 </assert_contents>
111 </output>
112 </test>
113 <!--Only 1 test can be execute because the fragment will be already saved for the second test and it will return error as the fragments are present in the DB (execut ../get_db_data/testMock.py to regenerate initial DB)-->
114 <!--test DB config in the tool -->
115 <test expect_num_outputs="2">
116 <param name="genbank_files">
117 <collection type="list">
118 <element name="p7_L7Ae-Weiss" value="p7_L7Ae-Weiss.gb" />
119 <element name="p7_gfp_sequence" value="p6_Nt-IgKLsequence.gb" />
120 <element name="p14_CMVp" value="p6_Kozak-ATG.gb" />
121 <element name="p16_bGHpolyA" value="p4_Kt-L7Ae-Weiss.gb" />
122 <element name="p18_CMVp" value="HC_Amp_ccdB.gb" />
123 </collection>
124 </param>
125 <conditional name="json_use">
126 <param name="use_json_paramers" value='false'/>
127 <param name="table" value="sample" />
128 <param name="sequence_column" value="sequence" />
129 <param name="annotation_column" value="annotation" />
130 <param name="fragment_column" value="fragment" />
131 <param name="db_uri" value="postgresql://postgres:RK17@localhost:5432/test_fragments_db" />
132 <param name="execution_enable" value="true" />
133 </conditional>
134 <param name="use_json_paramers" value='true'/>
60 <output name="output" file="test_raport.txt" ftype="txt" > 135 <output name="output" file="test_raport.txt" ftype="txt" >
61 <assert_contents> 136 <assert_contents>
62 <has_n_lines n="5" /> 137 <has_n_lines n="5" />
63 <has_line_matching expression="p7_L7Ae-Weiss" /> 138 <has_line_matching expression="p7_L7Ae-Weiss" />
64 <has_line_matching expression="p6_Nt-IgKLsequence" /> 139 <has_line_matching expression="p6_Nt-IgKLsequence" />
65 <has_line_matching expression="p6_Kozak-ATG" /> 140 <has_line_matching expression="p6_Kozak-ATG" />
66 <has_line_matching expression="p4_Kt-L7Ae-Weiss" /> 141 <has_line_matching expression="p4_Kt-L7Ae-Weiss" />
67 <has_line_matching expression="HC_Amp_ccdB" /> 142 <has_line_matching expression="HC_Amp_ccdB" />
68 </assert_contents> 143 </assert_contents>
69 </output> 144 </output>
70 </test> 145 <output name="json_output">
71 <!--test tool blocking from JSON. It is commented because it should faild as it is a test to validate that the tool can be blocked from json file --> 146 <assert_contents>
72 <test> 147 <has_n_lines n="8" />
148 </assert_contents>
149 </output>
150 </test>
151 <!--test DB config from JSON. It is commented because the save can be done only on time then the fragment willl be in the DB and it will return a failure. to run the test comment the test above (one saving test in the run)-->
152 <test expect_num_outputs="1">
73 <param name="genbank_files"> 153 <param name="genbank_files">
74 <collection type="list"> 154 <collection type="list">
75 <element name="p7_L7Ae-Weiss" value="p7_L7Ae-Weiss.gb" /> 155 <element name="p7_L7Ae-Weiss" value="p7_L7Ae-Weiss.gb" />
76 <element name="p7_gfp_sequence" value="p6_Nt-IgKLsequence.gb" /> 156 <element name="p7_gfp_sequence" value="p6_Nt-IgKLsequence.gb" />
77 <element name="p14_CMVp" value="p6_Kozak-ATG.gb" /> 157 <element name="p14_CMVp" value="p6_Kozak-ATG.gb" />
78 <element name="p16_bGHpolyA" value="p4_Kt-L7Ae-Weiss.gb" /> 158 <element name="p16_bGHpolyA" value="p4_Kt-L7Ae-Weiss.gb" />
79 <element name="p18_CMVp" value="HC_Amp_ccdB.gb" /> 159 <element name="p18_CMVp" value="HC_Amp_ccdB.gb" />
80 </collection> 160 </collection>
81 </param> 161 </param>
82 <param name="adv|json_conf" value="test-JSON_arg_block.json" /> 162 <conditional name="json_use">
83 <output name="output" file="test_raport.txt" ftype="txt" > 163 <param name="use_json_paramers" value='true'/>
84 <assert_contents> 164 <param name="json_conf" value="test-JSON_arg.json" />
85 <has_n_lines n="5" /> 165 </conditional>
86 <has_line_matching expression="p7_L7Ae-Weiss" /> 166 <param name="json_generating" value='false'/>
87 <has_line_matching expression="p6_Nt-IgKLsequence" />
88 <has_line_matching expression="p6_Kozak-ATG" />
89 <has_line_matching expression="p4_Kt-L7Ae-Weiss" />
90 <has_line_matching expression="HC_Amp_ccdB" />
91 </assert_contents>
92 </output>
93 </test>
94 <!--Only 1 test can be execute because the fragment will be already saved for the second test and it will return error as the fragments are present in the DB (execut ../get_db_data/testMock.py to regenerate initial DB)-->
95 <!--test DB config in the tool -->
96 <test>
97 <param name="genbank_files">
98 <collection type="list">
99 <element name="p7_L7Ae-Weiss" value="p7_L7Ae-Weiss.gb" />
100 <element name="p7_gfp_sequence" value="p6_Nt-IgKLsequence.gb" />
101 <element name="p14_CMVp" value="p6_Kozak-ATG.gb" />
102 <element name="p16_bGHpolyA" value="p4_Kt-L7Ae-Weiss.gb" />
103 <element name="p18_CMVp" value="HC_Amp_ccdB.gb" />
104 </collection>
105 </param>
106 <param name="table" value="sample" />
107 <param name="sequence_column" value="sequence" />
108 <param name="annotation_column" value="annotation" />
109 <param name="fragment_column" value="fragment" />
110 <param name="db_uri" value="postgresql://postgres:RK17@localhost:5432/test_fragments_db" />
111 <output name="output" file="test_raport.txt" ftype="txt" >
112 <assert_contents>
113 <has_n_lines n="5" />
114 <has_line_matching expression="p7_L7Ae-Weiss" />
115 <has_line_matching expression="p6_Nt-IgKLsequence" />
116 <has_line_matching expression="p6_Kozak-ATG" />
117 <has_line_matching expression="p4_Kt-L7Ae-Weiss" />
118 <has_line_matching expression="HC_Amp_ccdB" />
119 </assert_contents>
120 </output>
121 </test>
122 <!--test DB config from JSON. It is commented because the save can be done only on time then the fragment willl be in the DB and it will return a failure. to run the test comment the test above (one saving test in the run)-->
123 <test>
124 <param name="genbank_files">
125 <collection type="list">
126 <element name="p7_L7Ae-Weiss" value="p7_L7Ae-Weiss.gb" />
127 <element name="p7_gfp_sequence" value="p6_Nt-IgKLsequence.gb" />
128 <element name="p14_CMVp" value="p6_Kozak-ATG.gb" />
129 <element name="p16_bGHpolyA" value="p4_Kt-L7Ae-Weiss.gb" />
130 <element name="p18_CMVp" value="HC_Amp_ccdB.gb" />
131 </collection>
132 </param>
133 <param name="adv|json_conf" value="test-JSON_arg.json" />
134 <output name="output" file="test_raport.txt" ftype="txt" > 167 <output name="output" file="test_raport.txt" ftype="txt" >
135 <assert_contents> 168 <assert_contents>
136 <has_n_lines n="5" /> 169 <has_n_lines n="5" />
137 <has_line_matching expression="p7_L7Ae-Weiss" /> 170 <has_line_matching expression="p7_L7Ae-Weiss" />
138 <has_line_matching expression="p6_Nt-IgKLsequence" /> 171 <has_line_matching expression="p6_Nt-IgKLsequence" />
158 * **DB Column Contains Annotation For Ganbank File**: Column containing annotation data, to save al part before "ORIGIN" in the .gb file. 191 * **DB Column Contains Annotation For Ganbank File**: Column containing annotation data, to save al part before "ORIGIN" in the .gb file.
159 * **DB IDs Column Name**: Column holding the unique fragment IDs. 192 * **DB IDs Column Name**: Column holding the unique fragment IDs.
160 * **DB Connection URI**: URI used to connect to the database (e.g., postgresql://postgres:pass@localhost:5432/test_fragments_db). 193 * **DB Connection URI**: URI used to connect to the database (e.g., postgresql://postgres:pass@localhost:5432/test_fragments_db).
161 * **Send Requenst to DB**: Enable or Desable the interaction with the DB (can be usefull in workflows). 194 * **Send Requenst to DB**: Enable or Desable the interaction with the DB (can be usefull in workflows).
162 * **DB config as a json file**: JSON file contains the DB configuration: 195 * **DB config as a json file**: JSON file contains the DB configuration:
163 - "JSON_table": will be the key to the table name. 196 - "table": will be the key to the table name.
164 - "JSON_sequence_column": will be the key to the sequence column. 197 - "sequence_column": will be the key to the sequence column.
165 - "JSON_annotation_column": will be the key to the annotation column. 198 - "annotation_column": will be the key to the annotation column.
166 - "JSON_fragment_column": will be the key to the fragment column. 199 - "fragment_column": will be the key to the fragment column.
167 - "JSON_db_uri": will be the key to the URI. 200 - "db_uri": will be the key to the URI.
168 - "execution": It is the key to execute or block the tool during a workflow ("True" or "False"). 201 - "execution": It is the key to execute or block the tool during a workflow ("True" or "False").
169 ]]></help> 202 ]]></help>
170 <citations> 203 <citations>
171 <citation type="bibtex"> 204 <citation type="bibtex">
172 @unpublished{seq_to_db 205 @unpublished{seq_to_db