Mercurial > repos > tduigou > json_db_config_generating
comparison json_db_config_generating_boolean.xml @ 4:f103f5253a93 draft
planemo upload for repository https://github.com/brsynth commit 3401816c949b538bd9c67e61cbe92badff6a4007-dirty
| author | tduigou |
|---|---|
| date | Wed, 11 Jun 2025 15:25:55 +0000 |
| parents | |
| children | 40aa268ce07f |
comparison
equal
deleted
inserted
replaced
| 3:8eb6c417d4f5 | 4:f103f5253a93 |
|---|---|
| 1 <tool id="json_db_config_generating" name="JSON DB_Config Generating" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="21.09"> | |
| 2 <description>Genarate a JSON file used as DB config</description> | |
| 3 <macros> | |
| 4 <token name="@VERSION_SUFFIX@">2</token> | |
| 5 <token name="@TOOL_VERSION@">0.1.0</token> | |
| 6 </macros> | |
| 7 <command detect_errors="exit_code"><![CDATA[ | |
| 8 python3 -c "import json; params = { | |
| 9 'execution': '$execution', | |
| 10 'JSON_db_uri': '$db_uri', | |
| 11 'JSON_table': '$table_name', | |
| 12 'JSON_fragment_column': '$fragment_column', | |
| 13 'JSON_sequence_column': '$sequence_column', | |
| 14 'JSON_annotation_column': '$annotation_column' | |
| 15 }; f = open('$output_json', 'w'); json.dump(params, f, indent=4); f.close()" | |
| 16 ]]></command> | |
| 17 <inputs> | |
| 18 <conditional name="db_request"> | |
| 19 <param name="execution" type="boolean" label="Save To DB ?" checked ='false' help="If True the execution key in the json file will be true" /> | |
| 20 <when value='true'> | |
| 21 <section name='db_config' title='DB config' expanded='true'> | |
| 22 <param name="db_uri" type="text" label="DB Connection URI" optional="true" /> | |
| 23 <param name="table_name" type="text" label="DB Table Name" optional="true" /> | |
| 24 <param name="fragment_column" type="text" label="DB IDs Column Name" optional="true" /> | |
| 25 <param name="sequence_column" type="text" label="DB Column Contains Sequence For ganbank File" optional="true" /> | |
| 26 <param name="annotation_column" type="text" label="DB Column Contains Annotation For Ganbank File" optional="true" /> | |
| 27 </section> | |
| 28 </when> | |
| 29 <when value='false'> | |
| 30 <section name='db_config' title='DB config' expanded='false'> | |
| 31 <param name="db_uri" type="text" label="DB Connection URI" optional="true" /> | |
| 32 <param name="table_name" type="text" label="DB Table Name" optional="true" /> | |
| 33 <param name="fragment_column" type="text" label="DB IDs Column Name" optional="true" /> | |
| 34 <param name="sequence_column" type="text" label="DB Column Contains Sequence For ganbank File" optional="true" /> | |
| 35 <param name="annotation_column" type="text" label="DB Column Contains Annotation For Ganbank File" optional="true" /> | |
| 36 </section> | |
| 37 </when> | |
| 38 </conditional> | |
| 39 </inputs> | |
| 40 <outputs> | |
| 41 <data name="output_json" format="json" label="JSON Conf" /> | |
| 42 </outputs> | |
| 43 <tests> | |
| 44 <!--test execution is true --> | |
| 45 <test> | |
| 46 <conditional name="db_request"> | |
| 47 <param name="execution" value="true" /> | |
| 48 <param name="db_config|db_uri" value="postgresql://postgres:RK17@localhost:5432/test_fragments_db" /> | |
| 49 <param name="db_config|table_name" value="sample" /> | |
| 50 <param name="db_config|fragment_column" value="fragment" /> | |
| 51 <param name="db_config|sequence_column" value="sequence" /> | |
| 52 <param name="db_config|annotation_column" value="annotation" /> | |
| 53 </conditional> | |
| 54 <output name="output_json"> | |
| 55 <assert_contents> | |
| 56 <has_json_property_with_text property="execution" text="true" /> | |
| 57 <has_json_property_with_text property="JSON_db_uri" text="postgresql://postgres:RK17__at__localhost:5432/test_fragments_db" /> | |
| 58 <has_json_property_with_text property="JSON_table" text="sample" /> | |
| 59 <has_json_property_with_text property="JSON_fragment_column" text="fragment" /> | |
| 60 <has_json_property_with_text property="JSON_sequence_column" text="sequence" /> | |
| 61 <has_json_property_with_text property="JSON_annotation_column" text="annotation" /> | |
| 62 </assert_contents> | |
| 63 </output> | |
| 64 </test> | |
| 65 <!--test execution is false --> | |
| 66 <test> | |
| 67 <conditional name="db_request"> | |
| 68 <param name="execution" value="false" /> | |
| 69 </conditional> | |
| 70 <output name="output_json"> | |
| 71 <assert_contents> | |
| 72 <has_json_property_with_text property="execution" text="false" /> | |
| 73 <has_json_property_with_text property="JSON_db_uri" text="" /> | |
| 74 <has_json_property_with_text property="JSON_table" text="" /> | |
| 75 <has_json_property_with_text property="JSON_fragment_column" text="" /> | |
| 76 <has_json_property_with_text property="JSON_sequence_column" text="" /> | |
| 77 <has_json_property_with_text property="JSON_annotation_column" text="" /> | |
| 78 </assert_contents> | |
| 79 </output> | |
| 80 </test> | |
| 81 </tests> | |
| 82 | |
| 83 <help><![CDATA[ | |
| 84 JSON DB_Config Generating | |
| 85 ========================= | |
| 86 | |
| 87 Generate a JSON file to be used as a DB configuration. This JSON file can later be used to access the database via the specified URI, as well as the defined table and column names. | |
| 88 This tool is primarily designed to control the execution of the save_to_db tool by enabling or disabling its execution and by providing the database configuration through a JSON file. | |
| 89 | |
| 90 **Parameters**: | |
| 91 --------------- | |
| 92 * **execution key**: The value of execution key in the JSON (true or false) | |
| 93 * **DB Table Name**: Name of the target table in the PostgreSQL database. | |
| 94 * **DB Column Contains Sequence For ganbank File**: Column storing sequence data, expected to start with "ORIGIN". | |
| 95 * **DB Column Contains Annotation For Ganbank File**: Column containing annotation data, to save al part before "ORIGIN" in the .gb file. | |
| 96 * **DB IDs Column Name**: Column holding the unique fragment IDs. | |
| 97 * **DB Connection URI**: URI used to connect to the database (e.g., postgresql://user:password@host:port/DB_name). | |
| 98 * NOTE: This tool is designed to manage the execution of save_to_db within a workflow. If parameters are set directly in save_to_db via the user interface, the JSON file data will be ignored. | |
| 99 ]]></help> | |
| 100 <citations> | |
| 101 <citation type="bibtex"> | |
| 102 @unpublished{json_db_config_generating | |
| 103 author = {Ramiz Khaled}, | |
| 104 title = {{json_db_config_generating}}, | |
| 105 url = {https://github.com/brsynth/}, | |
| 106 } | |
| 107 </citation> | |
| 108 </citations> | |
| 109 </tool> |
