Mercurial > repos > tduigou > save_to_db
comparison seq_to_db.xml @ 0:7ff266aecf01 draft default tip
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools commit 3401816c949b538bd9c67e61cbe92badff6a4007-dirty
| author | tduigou |
|---|---|
| date | Wed, 11 Jun 2025 09:42:24 +0000 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:7ff266aecf01 |
|---|---|
| 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@">0</token> | |
| 5 <token name="@TOOL_VERSION@">0.1.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 ]]></command> | |
| 26 <inputs> | |
| 27 <param name="genbank_files" type="data_collection" collection_type="list" format="genbank" label="GenBank File(s)"/> | |
| 28 <param name="table" type="text" label="DB Table Name" optional="true" help="It can be extracted from JSON file -key:'JSON_table'-" /> | |
| 29 <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'-" /> | |
| 30 <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'-" /> | |
| 31 <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'-" /> | |
| 32 <param name="db_uri" type="text" label="DB Connection URI" help="postgresql://container_name:password@host:port/path/to/database (It can be extracted from JSON file -key:'JSON_db_uri'-)" optional="true" /> | |
| 33 <section name='adv' title='Advance' expanded='false'> | |
| 34 <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" /> | |
| 35 </section> | |
| 36 </inputs> | |
| 37 <outputs> | |
| 38 <data name="output" format="txt" label="saving report" /> | |
| 39 </outputs> | |
| 40 <tests> | |
| 41 <!--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)--> | |
| 42 <!--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 --> | |
| 43 <test> | |
| 44 <param name="genbank_files"> | |
| 45 <collection type="list"> | |
| 46 <element name="p7_L7Ae-Weiss" value="p7_L7Ae-Weiss.gb" /> | |
| 47 <element name="p7_gfp_sequence" value="p6_Nt-IgKLsequence.gb" /> | |
| 48 <element name="p14_CMVp" value="p6_Kozak-ATG.gb" /> | |
| 49 <element name="p16_bGHpolyA" value="p4_Kt-L7Ae-Weiss.gb" /> | |
| 50 <element name="p18_CMVp" value="HC_Amp_ccdB.gb" /> | |
| 51 </collection> | |
| 52 </param> | |
| 53 <param name="adv|json_conf" value="test-JSON_arg_block.json" /> | |
| 54 <output name="output" file="test_raport.txt" ftype="txt" > | |
| 55 <assert_contents> | |
| 56 <has_n_lines n="5" /> | |
| 57 <has_line_matching expression="p7_L7Ae-Weiss" /> | |
| 58 <has_line_matching expression="p6_Nt-IgKLsequence" /> | |
| 59 <has_line_matching expression="p6_Kozak-ATG" /> | |
| 60 <has_line_matching expression="p4_Kt-L7Ae-Weiss" /> | |
| 61 <has_line_matching expression="HC_Amp_ccdB" /> | |
| 62 </assert_contents> | |
| 63 </output> | |
| 64 </test> | |
| 65 <!--test DB config in the tool --> | |
| 66 <test> | |
| 67 <param name="genbank_files"> | |
| 68 <collection type="list"> | |
| 69 <element name="p7_L7Ae-Weiss" value="p7_L7Ae-Weiss.gb" /> | |
| 70 <element name="p7_gfp_sequence" value="p6_Nt-IgKLsequence.gb" /> | |
| 71 <element name="p14_CMVp" value="p6_Kozak-ATG.gb" /> | |
| 72 <element name="p16_bGHpolyA" value="p4_Kt-L7Ae-Weiss.gb" /> | |
| 73 <element name="p18_CMVp" value="HC_Amp_ccdB.gb" /> | |
| 74 </collection> | |
| 75 </param> | |
| 76 <param name="table" value="sample" /> | |
| 77 <param name="sequence_column" value="sequence" /> | |
| 78 <param name="annotation_column" value="annotation" /> | |
| 79 <param name="fragment_column" value="fragment" /> | |
| 80 <param name="db_uri" value="postgresql://postgres:RK17@localhost:5432/test_fragments_db" /> | |
| 81 <output name="output" file="test_raport.txt" ftype="txt" > | |
| 82 <assert_contents> | |
| 83 <has_n_lines n="5" /> | |
| 84 <has_line_matching expression="p7_L7Ae-Weiss" /> | |
| 85 <has_line_matching expression="p6_Nt-IgKLsequence" /> | |
| 86 <has_line_matching expression="p6_Kozak-ATG" /> | |
| 87 <has_line_matching expression="p4_Kt-L7Ae-Weiss" /> | |
| 88 <has_line_matching expression="HC_Amp_ccdB" /> | |
| 89 </assert_contents> | |
| 90 </output> | |
| 91 </test> | |
| 92 <!--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)--> | |
| 93 <test> | |
| 94 <param name="genbank_files"> | |
| 95 <collection type="list"> | |
| 96 <element name="p7_L7Ae-Weiss" value="p7_L7Ae-Weiss.gb" /> | |
| 97 <element name="p7_gfp_sequence" value="p6_Nt-IgKLsequence.gb" /> | |
| 98 <element name="p14_CMVp" value="p6_Kozak-ATG.gb" /> | |
| 99 <element name="p16_bGHpolyA" value="p4_Kt-L7Ae-Weiss.gb" /> | |
| 100 <element name="p18_CMVp" value="HC_Amp_ccdB.gb" /> | |
| 101 </collection> | |
| 102 </param> | |
| 103 <param name="adv|json_conf" value="test-JSON_arg.json" /> | |
| 104 <output name="output" file="test_raport.txt" ftype="txt" > | |
| 105 <assert_contents> | |
| 106 <has_n_lines n="5" /> | |
| 107 <has_line_matching expression="p7_L7Ae-Weiss" /> | |
| 108 <has_line_matching expression="p6_Nt-IgKLsequence" /> | |
| 109 <has_line_matching expression="p6_Kozak-ATG" /> | |
| 110 <has_line_matching expression="p4_Kt-L7Ae-Weiss" /> | |
| 111 <has_line_matching expression="HC_Amp_ccdB" /> | |
| 112 </assert_contents> | |
| 113 </output> | |
| 114 </test> | |
| 115 </tests> | |
| 116 | |
| 117 <help><![CDATA[ | |
| 118 Save Sequence Data In DB | |
| 119 ======================== | |
| 120 | |
| 121 Implemented a system to save GenBank (.gb) files in an accessible DB, based on a connection via URI requests. | |
| 122 | |
| 123 **Parameters**: | |
| 124 --------------- | |
| 125 * **GenBank File(s)**: List of GenBaks files. | |
| 126 * **DB Table Name**: Name of the target table in the PostgreSQL database. | |
| 127 * **DB Column Contains Sequence For ganbank File**: Column storing sequence data, expected to start with "ORIGIN". | |
| 128 * **DB Column Contains Annotation For Ganbank File**: Column containing annotation data, to save al part before "ORIGIN" in the .gb file. | |
| 129 * **DB IDs Column Name**: Column holding the unique fragment IDs. | |
| 130 * **DB Connection URI**: URI used to connect to the database (e.g., postgresql://postgres:pass@localhost:5432/test_fragments_db). | |
| 131 * **DB config as a json file**: JSON file contains the DB configuration: | |
| 132 - "JSON_table": will be the key to the table name. | |
| 133 - "JSON_sequence_column": will be the key to the sequence column. | |
| 134 - "JSON_annotation_column": will be the key to the annotation column. | |
| 135 - "JSON_fragment_column": will be the key to the fragment column. | |
| 136 - "JSON_db_uri": will be the key to the URI. | |
| 137 - "execution": It is the key to execute or block the tool during a workflow ("True" or "False"). | |
| 138 ]]></help> | |
| 139 <citations> | |
| 140 <citation type="bibtex"> | |
| 141 @unpublished{seq_to_db | |
| 142 author = {Ramiz Khaled}, | |
| 143 title = {{seq_to_db}}, | |
| 144 url = {https://github.com/brsynth/}, | |
| 145 } | |
| 146 </citation> | |
| 147 </citations> | |
| 148 </tool> |
