Mercurial > repos > tduigou > json_db_config_generating
diff json_db_config_generating.xml @ 0:95757ea6c333 draft
planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
| author | tduigou |
|---|---|
| date | Mon, 02 Jun 2025 13:39:41 +0000 |
| parents | |
| children | 2909e53fac5b |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/json_db_config_generating.xml Mon Jun 02 13:39:41 2025 +0000 @@ -0,0 +1,95 @@ +<tool id="json_db_config_generating" name="JSON DB_Config Generating" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="21.09"> + <description>Genarate a JSON file used as DB config</description> + <macros> + <token name="@VERSION_SUFFIX@">1</token> + <token name="@TOOL_VERSION@">0.1.0</token> + </macros> + <command detect_errors="exit_code"><![CDATA[ + python3 -c "import json; params = { + 'execution': '$execution', + 'JSON_db_uri': '$db_uri', + 'JSON_table': '$table_name', + 'JSON_fragment_column': '$fragment_column', + 'JSON_sequence_column': '$sequence_column', + 'JSON_annotation_column': '$annotation_column' + }; f = open('$output_json', 'w'); json.dump(params, f, indent=4); f.close()" + ]]></command> + <inputs> + <param name="execution" type="boolean" label="execution key" checked="False" help="If True the execution key in the json file will be true" optional="true" /> + <param name="db_uri" type="text" label="DB Connection URI" optional="true" /> + <param name="table_name" type="text" label="DB Table Name" optional="true" /> + <param name="fragment_column" type="text" label="DB IDs Column Name" optional="true" /> + <param name="sequence_column" type="text" label="DB Column Contains Sequence For ganbank File" optional="true" /> + <param name="annotation_column" type="text" label="DB Column Contains Annotation For Ganbank File" optional="true" /> + </inputs> + <outputs> + <data name="output_json" format="json" label="JSON Conf" /> + </outputs> + <tests> + <!--test execution is true --> + <test> + <param name="execution" value="True" /> + <param name="db_uri" value="postgresql://postgres:RK17@localhost:5432/test_fragments_db" /> + <param name="table_name" value="sample" /> + <param name="fragment_column" value="fragment" /> + <param name="sequence_column" value="sequence" /> + <param name="annotation_column" value="annotation" /> + <output name="output_json"> + <assert_contents> + <has_json_property_with_text property="execution" text="true" /> + <has_json_property_with_text property="JSON_db_uri" text="postgresql://postgres:RK17__at__localhost:5432/test_fragments_db" /> + <has_json_property_with_text property="JSON_table" text="sample" /> + <has_json_property_with_text property="JSON_fragment_column" text="fragment" /> + <has_json_property_with_text property="JSON_sequence_column" text="sequence" /> + <has_json_property_with_text property="JSON_annotation_column" text="annotation" /> + </assert_contents> + </output> + </test> + <!--test execution is false --> + <test> + <param name="execution" value="False" /> + <param name="db_uri" value="postgresql://postgres:RK17@localhost:5432/test_fragments_db" /> + <param name="table_name" value="sample" /> + <param name="fragment_column" value="fragment" /> + <param name="sequence_column" value="sequence" /> + <param name="annotation_column" value="annotation" /> + <output name="output_json"> + <assert_contents> + <has_json_property_with_text property="execution" text="false" /> + <has_json_property_with_text property="JSON_db_uri" text="postgresql://postgres:RK17__at__localhost:5432/test_fragments_db" /> + <has_json_property_with_text property="JSON_table" text="sample" /> + <has_json_property_with_text property="JSON_fragment_column" text="fragment" /> + <has_json_property_with_text property="JSON_sequence_column" text="sequence" /> + <has_json_property_with_text property="JSON_annotation_column" text="annotation" /> + </assert_contents> + </output> + </test> + </tests> + + <help><![CDATA[ +JSON DB_Config Generating +========================= + +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. +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. + +**Parameters**: +--------------- +* **execution key**: The value of execution key in the JSON (true or false) +* **DB Table Name**: Name of the target table in the PostgreSQL database. +* **DB Column Contains Sequence For ganbank File**: Column storing sequence data, expected to start with "ORIGIN". +* **DB Column Contains Annotation For Ganbank File**: Column containing annotation data, to save al part before "ORIGIN" in the .gb file. +* **DB IDs Column Name**: Column holding the unique fragment IDs. +* **DB Connection URI**: URI used to connect to the database (e.g., postgresql://user:password@host:port/DB_name). +* 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. + ]]></help> + <citations> + <citation type="bibtex"> + @unpublished{json_db_config_generating + author = {Ramiz Khaled}, + title = {{json_db_config_generating}}, + url = {https://github.com/brsynth/}, + } + </citation> + </citations> +</tool> \ No newline at end of file
