comparison seq_to_db.xml @ 0:178d068648f4 draft

planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools commit 3401816c949b538bd9c67e61cbe92badff6a4007-dirty
author tduigou
date Thu, 12 Jun 2025 08:27:18 +0000
parents
children 5db1c2b9edb8
comparison
equal deleted inserted replaced
-1:000000000000 0:178d068648f4
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>
3 <macros>
4 <token name="@VERSION_SUFFIX@">1</token>
5 <token name="@TOOL_VERSION@">0.2.0</token>
6 </macros>
7 <requirements>
8 <requirement type="package" version="2.2.3">pandas</requirement>
9 <requirement type="package" version="2.0.40">sqlalchemy</requirement>
10 <requirement type="package" version="2.9.9">psycopg2</requirement>
11 </requirements>
12 <command detect_errors="exit_code"><![CDATA[
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])
15 python '$__tool_directory__/save_to_db.py'
16 --input '$genbank_file_paths'
17 --sequence_column '$sequence_column'
18 --annotation_column '$annotation_column'
19 --db_uri '$db_uri'
20 --table '$table'
21 --fragment_column '$fragment_column'
22 --output '$output'
23 --file_name_mapping '$file_name_mapping'
24 --json_conf '$json_conf'
25 --execution_enable '$execution_enable'
26 ]]></command>
27 <inputs>
28 <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'-" />
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'-" />
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'-" />
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'-" />
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" />
34 <section name='adv' title='Advance' expanded='false'>
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)" />
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" />
37 </section>
38 </inputs>
39 <outputs>
40 <data name="output" format="txt" label="saving report" />
41 </outputs>
42 <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 -->
44 <test>
45 <param name="genbank_files">
46 <collection type="list">
47 <element name="p7_L7Ae-Weiss" value="p7_L7Ae-Weiss.gb" />
48 <element name="p7_gfp_sequence" value="p6_Nt-IgKLsequence.gb" />
49 <element name="p14_CMVp" value="p6_Kozak-ATG.gb" />
50 <element name="p16_bGHpolyA" value="p4_Kt-L7Ae-Weiss.gb" />
51 <element name="p18_CMVp" value="HC_Amp_ccdB.gb" />
52 </collection>
53 </param>
54 <param name="table" value="sample" />
55 <param name="sequence_column" value="sequence" />
56 <param name="annotation_column" value="annotation" />
57 <param name="fragment_column" value="fragment" />
58 <param name="db_uri" value="postgresql://postgres:RK17@localhost:5432/test_fragments_db" />
59 <param name="adv|execution_enable" value="false" />
60 <output name="output" file="test_raport.txt" ftype="txt" >
61 <assert_contents>
62 <has_n_lines n="5" />
63 <has_line_matching expression="p7_L7Ae-Weiss" />
64 <has_line_matching expression="p6_Nt-IgKLsequence" />
65 <has_line_matching expression="p6_Kozak-ATG" />
66 <has_line_matching expression="p4_Kt-L7Ae-Weiss" />
67 <has_line_matching expression="HC_Amp_ccdB" />
68 </assert_contents>
69 </output>
70 </test>
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 -->
72 <test>
73 <param name="genbank_files">
74 <collection type="list">
75 <element name="p7_L7Ae-Weiss" value="p7_L7Ae-Weiss.gb" />
76 <element name="p7_gfp_sequence" value="p6_Nt-IgKLsequence.gb" />
77 <element name="p14_CMVp" value="p6_Kozak-ATG.gb" />
78 <element name="p16_bGHpolyA" value="p4_Kt-L7Ae-Weiss.gb" />
79 <element name="p18_CMVp" value="HC_Amp_ccdB.gb" />
80 </collection>
81 </param>
82 <param name="adv|json_conf" value="test-JSON_arg_block.json" />
83 <output name="output" file="test_raport.txt" ftype="txt" >
84 <assert_contents>
85 <has_n_lines n="5" />
86 <has_line_matching expression="p7_L7Ae-Weiss" />
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" >
135 <assert_contents>
136 <has_n_lines n="5" />
137 <has_line_matching expression="p7_L7Ae-Weiss" />
138 <has_line_matching expression="p6_Nt-IgKLsequence" />
139 <has_line_matching expression="p6_Kozak-ATG" />
140 <has_line_matching expression="p4_Kt-L7Ae-Weiss" />
141 <has_line_matching expression="HC_Amp_ccdB" />
142 </assert_contents>
143 </output>
144 </test>
145 </tests>
146
147 <help><![CDATA[
148 Save Sequence Data In DB
149 ========================
150
151 Implemented a system to save GenBank (.gb) files in an accessible DB, based on a connection via URI requests.
152
153 **Parameters**:
154 ---------------
155 * **GenBank File(s)**: List of GenBaks files.
156 * **DB Table Name**: Name of the target table in the PostgreSQL database.
157 * **DB Column Contains Sequence For ganbank File**: Column storing sequence data, expected to start with "ORIGIN".
158 * **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.
160 * **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).
162 * **DB config as a json file**: JSON file contains the DB configuration:
163 - "JSON_table": will be the key to the table name.
164 - "JSON_sequence_column": will be the key to the sequence column.
165 - "JSON_annotation_column": will be the key to the annotation column.
166 - "JSON_fragment_column": will be the key to the fragment column.
167 - "JSON_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").
169 ]]></help>
170 <citations>
171 <citation type="bibtex">
172 @unpublished{seq_to_db
173 author = {Ramiz Khaled},
174 title = {{seq_to_db}},
175 url = {https://github.com/brsynth/},
176 }
177 </citation>
178 </citations>
179 </tool>