annotate save_to_db.xml @ 0:034686b5bc15 draft

planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
author tduigou
date Thu, 24 Apr 2025 09:56:36 +0000
parents
children 6854ac8c5d2b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
1 <tool id="save_to_db" name="Save Data To DB" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="21.09">
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
2 <description>Save data to SQL DB</description>
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
3 <macros>
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
4 <token name="@VERSION_SUFFIX@">0</token>
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
5 <token name="@TOOL_VERSION@">0.1.0</token>
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
6 </macros>
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
7 <requirements>
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
8 <requirement type="package" version="2.2.3">pandas</requirement>
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
9 <requirement type="package" version="2.0.40">sqlalchemy</requirement>
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
10 <requirement type="package" version="2.9.9">psycopg2</requirement>
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
11 </requirements>
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
12 <command detect_errors="exit_code"><![CDATA[
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
13 #set $file_name_mapping = ",".join(["%s:%s" % (file.file_name, file.name) for file in $genbank_files])
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
14 python '$__tool_directory__/save_to_db.py'
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
15 --input '$genbank_files'
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
16 --sequence_column '$sequence_column'
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
17 --annotation_column '$annotation_column'
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
18 --db_uri '$db_uri'
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
19 --table '$table'
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
20 --fragment_column '$fragment_column'
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
21 --output '$output'
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
22 --file_name_mapping '$file_name_mapping'
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
23 ]]></command>
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
24 <inputs>
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
25 <param name="genbank_files" type="data" format="genbank" multiple="true" label="GenBank File(s)"/>
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
26 <param name="table" type="text" label="Database Table Name" optional="false" />
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
27 <param name="sequence_column" type="text" label="DB column contains sequence for ganbank file" optional="false" />
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
28 <param name="annotation_column" type="text" label="DB column contains annotation for ganbank file" optional="false" />
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
29 <param name="fragment_column" type="text" label="Database Fragments Column Name" optional="false" />
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
30 <param name="db_uri" type="text" label="Database Connection URI" help="postgresql+psycopg2://username:password@db_container_name:port/database" optional="false" />
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
31 </inputs>
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
32 <outputs>
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
33 <data name="output" format="txt" label="text raport" />
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
34 </outputs>
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
35 <tests>
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
36 <!--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'
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
37 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 -->
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
38 <test>
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
39 <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" />
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
40 <param name="table" value="sample" />
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
41 <param name="sequence_column" value="sequence" />
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
42 <param name="annotation_column" value="annotation" />
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
43 <param name="fragment_column" value="fragment" />
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
44 <param name="db_uri" value="postgresql://postgres:RK17@localhost:5432/test_fragments_db" />
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
45 <output name="output" file="test_raport.txt" ftype="txt" >
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
46 <assert_contents>
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
47 <has_n_lines n="5" />
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
48 <has_line_matching expression="p7_L7Ae-Weiss" />
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
49 <has_line_matching expression="p6_Nt-IgKLsequence" />
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
50 <has_line_matching expression="p6_Kozak-ATG" />
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
51 <has_line_matching expression="p4_Kt-L7Ae-Weiss" />
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
52 <has_line_matching expression="HC_Amp_ccdB" />
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
53 </assert_contents>
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
54 </output>
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
55 </test>
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
56 </tests>
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
57
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
58 <help><![CDATA[
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
59 Save Data To DB
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
60 ===================
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
61
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
62 Save GanDank data in SQL DB.
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
63 ]]></help>
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
64 <citations>
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
65 <citation type="bibtex">
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
66 @unpublished{save_to_db
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
67 author = {Ramiz Khaled},
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
68 title = {{save_to_db}},
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
69 url = {https://github.com/brsynth/},
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
70 }
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
71 </citation>
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
72 </citations>
034686b5bc15 planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
tduigou
parents:
diff changeset
73 </tool>