changeset 0:c3553950db1b draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/data_managers/data_manager_build_coreprofiler commit 62961196b51799ddc4969f79c1aac46448390d51
author iuc
date Tue, 22 Jul 2025 09:00:12 +0000
parents
children
files data_manager/data_manager_build_coreprofiler_download.xml data_manager_conf.xml test-data/coreprofiler_scheme.loc.test tool-data/coreprofiler_scheme.loc.sample tool_data_table_conf.xml.sample tool_data_table_conf.xml.test
diffstat 6 files changed, 208 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/data_manager/data_manager_build_coreprofiler_download.xml	Tue Jul 22 09:00:12 2025 +0000
@@ -0,0 +1,154 @@
+<tool id="data_manager_build_coreprofiler" name="Download and build CoreProfiler scheme" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" tool_type="manage_data" profile="@PROFILE@">
+    <description></description>
+    <macros>
+        <token name="@TOOL_VERSION@">1.1.3</token>
+        <token name="@VERSION_SUFFIX@">0</token>
+        <token name="@PROFILE@">22.05</token>
+        <xml name="version_command">
+            <version_command><![CDATA[$ coreprofiler --version]]></version_command>
+        </xml>
+        <xml name="biotools">
+            <xrefs>
+                <xref type="bio.tools">coreprofiler</xref>
+                <xref type="bio.tools">blast</xref>
+            </xrefs>
+        </xml>
+        <xml name="element_assert" token_name="" token_text="">
+            <element name="@NAME@">
+                <assert_contents>
+                    <has_text text="@TEXT@"/>
+                    <yield/>
+                </assert_contents>
+            </element>
+        </xml>
+    </macros>
+    <requirements>
+        <requirement type="package" version="@TOOL_VERSION@">coreprofiler</requirement>
+        <requirement type="package" version="2.16.0">blast</requirement>
+    </requirements>
+    <command detect_errors="exit_code"><![CDATA[
+#set $scheme_name = str($coreprofiler_scheme_select).split('-')[0]
+
+mkdir -p '$out_file.extra_files_path' &&
+mkdir -p coreprofiler_${scheme_name}/scheme_$scheme_name/ &&
+
+coreprofiler db download 
+    -s $scheme_name
+    -o coreprofiler_${scheme_name}/scheme_$scheme_name &&
+
+coreprofiler db makeblastdb
+    -s coreprofiler_${scheme_name}/scheme_$scheme_name 
+    -n $scheme_name 
+    -p coreprofiler_${scheme_name}/db_$scheme_name &&
+
+mv coreprofiler_${scheme_name} '$out_file.extra_files_path' &&
+
+cp '$dmjson' '$out_file'
+    ]]></command>
+    <configfiles>
+        <configfile name="dmjson"><![CDATA[
+#from datetime import date
+
+#set $scheme_name = str($coreprofiler_scheme_select).split('-')[0]
+#set $scheme_desc = str($coreprofiler_scheme_select).split('-')[1]
+#set $scheme_loci = str($coreprofiler_scheme_select).split('-')[2]
+#set $scheme_db = str($coreprofiler_scheme_select).split('-')[3]
+
+{
+    "data_tables":{
+    "coreprofiler_scheme":[
+    {
+        "value": "coreprofiler_downloaded_#echo date.today().strftime('%d%m%Y')#-${scheme_name}-${scheme_desc}-${scheme_loci}-${scheme_db}",
+        "name": "${scheme_name}: ${scheme_desc} [${scheme_loci} loci] (${scheme_db})",
+        "path": "coreprofiler_${scheme_name}",
+        "database": "coreprofiler_${scheme_name}/db_${scheme_name}/${scheme_name}.fasta",
+        "scheme": "coreprofiler_${scheme_name}/scheme_${scheme_name}"
+    }
+    ]
+}
+        }]]></configfile>
+    </configfiles>
+    <inputs>
+        <param name="coreprofiler_scheme_select" type="select" label="CoreProfiler available scheme" help="Choose a schema from a reference platform supported in CoreProfiler">                   
+            <option value="bordetella_1-cgMLST_genus-1415-BIGSdb">bordetella_1: cgMLST_genus [1415 loci] (BIGSdb)</option>
+            <option value="bordetella_4-cgMLST_pertussis-2038-BIGSdb">bordetella_4: cgMLST_pertussis [2038 loci] (BIGSdb)</option>
+            <option value="diphtheria_1-cgMLST-1305-BIGSdb">diphtheria_1: cgMLST [1305 loci] (BIGSdb)</option>
+            <option value="diphtheria_5-cgMLST_ulcerans-1628-BIGSdb">diphtheria_5: cgMLST_ulcerans [1628 loci] (BIGSdb)</option>
+            <option value="klebsiella_15-cgMLST_KpI-2537-BIGSdb">klebsiella_15: cgMLST_KpI [2537 loci] (BIGSdb)</option>
+            <option value="klebsiella_10-cgMLST_ST258_ST512_ST1199-1371-BIGSdb">klebsiella_10: cgMLST_ST258_ST512_ST1199 [1371 loci] (BIGSdb)</option>
+            <option value="klebsiella_18-scgMLST629_S-629-BIGSdb">klebsiella_18: scgMLST629_S [629 loci] (BIGSdb)</option>
+            <option value="klebsiella_3-scgMLST634-632-BIGSdb">klebsiella_3: scgMLST634 [632 loci] (BIGSdb)</option>
+            <option value="leptospira_3-capture_cgMLST-545-BIGSdb">leptospira_3: capture_cgMLST [545 loci] (BIGSdb)</option>
+            <option value="leptospira_1-cgMLST-545-BIGSdb">leptospira_1: cgMLST [545 loci] (BIGSdb)</option>
+            <option value="listeria_3-cgMLST1748-1748-BIGSdb">listeria_3: cgMLST1748 [1748 loci] (BIGSdb)</option>
+            <option value="yersinia_2-Y.enterocolitica_cgMLST-1727-BIGSdb">yersinia_2: Y.enterocolitica cgMLST [1727 loci] (BIGSdb)</option>
+            <option value="yersinia_1-Yersinia_cgMLST-500-BIGSdb">yersinia_1: Yersinia cgMLST [500 loci] (BIGSdb)</option>
+            <option value="yersinia_3-Y.pseudotuberculosis_cgMLST-1921-BIGSdb">yersinia_3: Y.pseudotuberculosis cgMLST [1921 loci] (BIGSdb)</option>
+            <option value="abaumannii_3-cgMLST_v1-2133-pubmlst">abaumannii_3: cgMLST v1 [2133 loci] (pubmlst)</option>
+            <option value="bcereus_2-B._anthracis_cgMLST-3803-pubmlst">bcereus_2: B. anthracis cgMLST [3803 loci] (pubmlst)</option>
+            <option value="bcereus_5-B._cereus_cgMLST-1568-pubmlst">bcereus_5: B. cereus cgMLST [1568 loci] (pubmlst)</option>
+            <option value="borrelia_3-cgMLST-639-pubmlst">borrelia_3: cgMLST [639 loci] (pubmlst)</option>
+            <option value="brucella_3-cgMLST-1764-pubmlst">brucella_3: cgMLST [1764 loci] (pubmlst)</option>
+            <option value="bmallei_1-cgMLST-3311-pubmlst">bmallei_1: cgMLST [3311 loci] (pubmlst)</option>
+            <option value="bpseudomallei_2-cgMLST-4090-pubmlst">bpseudomallei_2: cgMLST [4090 loci] (pubmlst)</option>
+            <option value="campylobacter_4-C._jejuni_/_C._coli_cgMLST_v1-1343-pubmlst">campylobacter_4: C. jejuni / C. coli cgMLST v1 [1343 loci] (pubmlst)</option>
+            <option value="campylobacter_8-C._jejuni_/_C._coli_cgMLST_v2-1142-pubmlst">campylobacter_8: C. jejuni / C. coli cgMLST v2 [1142 loci] (pubmlst)</option>
+            <option value="chlamydiales_44-C._abortus_cgMLST_v1.0-959-pubmlst">chlamydiales_44: C. abortus cgMLST v1.0 [959 loci] (pubmlst)</option>
+            <option value="chlamydiales_42-C._trachomatis_cgMLST_v1.0-817-pubmlst">chlamydiales_42: C. trachomatis cgMLST v1.0 [817 loci] (pubmlst)</option>
+            <option value="cchauvoei_1-cgMLST-2223-pubmlst">cchauvoei_1: cgMLST [2223 loci] (pubmlst)</option>
+            <option value="cperfringens_2-cgMLST-1431-pubmlst">cperfringens_2: cgMLST [1431 loci] (pubmlst)</option>
+            <option value="dnodosus_3-cgMLST-714-pubmlst">dnodosus_3: cgMLST [714 loci] (pubmlst)</option>
+            <option value="escherichia_6-cgMLST-2513-pubmlst">escherichia_6: cgMLST [2513 loci] (pubmlst)</option>
+            <option value="hinfluenzae_56-cgMLST_v1-1037-pubmlst">hinfluenzae_56: cgMLST v1 [1037 loci] (pubmlst)</option>
+            <option value="leptospira_4-cgMLST-1565-pubmlst">leptospira_4: cgMLST [1565 loci] (pubmlst)</option>
+            <option value="mabscessus_2-cgMLST-2904-pubmlst">mabscessus_2: cgMLST [2904 loci] (pubmlst)</option>
+            <option value="neisseria_72-Human_restricted_Neisseria_cgMLST-v1.0-1441-pubmlst">neisseria_72: Human-restricted Neisseria cgMLST v1.0 [1441 loci] (pubmlst)</option>
+            <option value="neisseria_45-L3_cgMLST-1742-pubmlst">neisseria_45: L3 cgMLST [1742 loci] (pubmlst)</option>
+            <option value="neisseria_68-L44_cgMLST-1699-pubmlst">neisseria_68: L44 cgMLST [1699 loci] (pubmlst)</option>
+            <option value="neisseria_62-N._gonorrhoeae_cgMLST_v1.0-1649-pubmlst">neisseria_62: N. gonorrhoeae cgMLST v1.0 [1649 loci] (pubmlst)</option>
+            <option value="neisseria_89-N._gonorrhoeae_cgMLST_v2-1430-pubmlst">neisseria_89: N. gonorrhoeae cgMLST v2 [1430 loci] (pubmlst)</option>
+            <option value="neisseria_47-N._meningitidis_cgMLST_v1-1605-pubmlst">neisseria_47: N. meningitidis cgMLST v1 [1605 loci] (pubmlst)</option>
+            <option value="neisseria_85-N._meningitidis_cgMLST_v2-1422-pubmlst">neisseria_85: N. meningitidis cgMLST v2 [1422 loci] (pubmlst)</option>
+            <option value="neisseria_88-N._meningitidis_cgMLST_v3-1329-pubmlst">neisseria_88: N. meningitidis cgMLST v3 [1329 loci] (pubmlst)</option>
+            <option value="pmultocida_3-cgMLST_draft_1233-pubmlst">pmultocida_3: cgMLST (draft) [1233 loci] (pubmlst)</option>
+            <option value="salmonella_4-cgMLST_v2_Enterobase-3002-pubmlst">salmonella_4: cgMLST v2 (Enterobase) [3002 loci] (pubmlst)</option>
+            <option value="salmonella_3-SalmcgMLST_v1.0-2750-pubmlst">salmonella_3: SalmcgMLST v1.0 [2750 loci] (pubmlst)</option>
+            <option value="serratia_2-cgMLST-2692-pubmlst">serratia_2: cgMLST [2692 loci] (pubmlst)</option>
+            <option value="saureus_20-cgMLST-1716-pubmlst">saureus_20: cgMLST [1716 loci] (pubmlst)</option>
+            <option value="sagalactiae_38-h_S.agalactiae_cgMLST_v1.0-1405-pubmlst">sagalactiae_38: h_S.agalactiae cgMLST v1.0 [1405 loci] (pubmlst)</option>
+            <option value="spneumoniae_2-cgMLST-1222-pubmlst">spneumoniae_2: cgMLST [1222 loci] (pubmlst)</option>
+            <option value="suberis_8-cgMLST-1447-pubmlst">suberis_8: cgMLST [1447 loci] (pubmlst)</option>
+            <option value="vcholerae_3-cgMLST-2443-pubmlst">vcholerae_3: cgMLST [2443 loci] (pubmlst)</option>
+            <option value="vparahaemolyticus_3-cgMLST-2254-pubmlst">vparahaemolyticus_3: cgMLST [2254 loci] (pubmlst)</option>
+            <option value="xcitri_1-cgMLST-1618-pubmlst">xcitri_1: cgMLST [1618 loci] (pubmlst)</option>
+        </param>
+    </inputs>
+    <outputs>
+        <data name="out_file" format="data_manager_json" label="${tool.name}"/>
+    </outputs>
+    <tests>
+        <test expect_num_outputs="1">
+            <param name="coreprofiler_scheme_select" value="borrelia_3-cgMLST-639-pubmlst" />
+            <output name="out_file">
+                <assert_contents>
+                    <has_text text='"coreprofiler_scheme":'/>
+                    <has_text_matching expression='"value": "coreprofiler_downloaded_[0-9]{8}-borrelia_3-cgMLST-639-pubmlst"'/>
+                    <has_text text='"name": "borrelia_3: cgMLST [639 loci] (pubmlst)'/>
+                    <has_text text='"path": "coreprofiler_borrelia_3"'/>
+                    <has_text text='"database": "coreprofiler_borrelia_3/db_borrelia_3/borrelia_3.fasta"'/>
+                    <has_text text='"scheme": "coreprofiler_borrelia_3/scheme_borrelia_3"'/>
+                </assert_contents>
+            </output>
+        </test>
+    </tests>
+    <help><![CDATA[
+This tool downloads and builds the **CoreProfiler** scheme.
+
+You can find the list of available scheme, as well as the reference platforms supported by CoreProfiler, in the <a href="https://gitlab.com/ifb-elixirfr/abromics/coreprofiler/-/blob/main/README.md?ref_type=heads#basic-usage" target="_blank">CoreProfiler documentation</a>.
+
+Please refer to this page for details on how to use the tool and which schema options are available.
+    ]]></help>
+    <citations>
+        <citation type="doi">10.3390/microorganisms10020292</citation>
+    </citations>
+</tool>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/data_manager_conf.xml	Tue Jul 22 09:00:12 2025 +0000
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<data_managers>
+    <data_manager tool_file="data_manager/data_manager_build_coreprofiler_download.xml" id="data_manager_build_coreprofiler_download">
+        <data_table name="coreprofiler_scheme">  <!-- Defines a Data Table to be modified. -->
+            <output> <!-- Handle the output of the Data Manager Tool -->
+                <column name="value"/>  <!-- columns that are going to be specified by the Data Manager Tool -->
+                <column name="name"/>  <!-- columns that are going to be specified by the Data Manager Tool -->
+                <column name="path" output_ref="out_file">
+                    <move type="directory">
+                        <source>${path}</source>
+                        <target base="${GALAXY_DATA_MANAGER_DATA_PATH}">coreprofiler/${path}</target>
+                    </move>
+                    <value_translation>${GALAXY_DATA_MANAGER_DATA_PATH}/coreprofiler/${path}</value_translation>
+                    <value_translation type="function">abspath</value_translation>
+                </column>
+                <column name="database"/> <!-- columns that are going to be specified by the Data Manager Tool -->
+                <column name="scheme"/> <!-- columns that are going to be specified by the Data Manager Tool -->
+            </output>
+        </data_table>
+    </data_manager>
+</data_managers>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/coreprofiler_scheme.loc.test	Tue Jul 22 09:00:12 2025 +0000
@@ -0,0 +1,11 @@
+#This is a tab separated file describing the location of CoreProfiler scheme 
+#used for the CoreProfiler tool
+#
+#file has this format (white space characters are TAB characters)
+#
+#The columns are:
+#value	name	path	database	scheme
+#
+#For example
+#coreprofiler_downloaded_20250625_klebsiella_3_scgMLST634_632_loci_bigsdb	klebsiella_3: scgMLST634 [632 loci] (BIGSdb)	coreprofiler_klebsiella_3	coreprofiler_klebsiella_3/db_klebsiella_3/klebsiella_3.fasta	coreprofiler_klebsiella_3/scheme_klebsiella_3
+coreprofiler_downloaded_10072025-borrelia_3-cgMLST-639-pubmlst	borrelia_3: cgMLST [639 loci] (pubmlst)	/tmp/tmpi2v1t1zz/galaxy-dev/tool-data/coreprofiler/coreprofiler_borrelia_3	coreprofiler_borrelia_3/db_borrelia_3/borrelia_3.fasta	coreprofiler_borrelia_3/scheme_borrelia_3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tool-data/coreprofiler_scheme.loc.sample	Tue Jul 22 09:00:12 2025 +0000
@@ -0,0 +1,10 @@
+#This is a tab separated file describing the location of CoreProfiler scheme 
+#used for the CoreProfiler tool
+#
+#file has this format (white space characters are TAB characters)
+#
+#The columns are:
+#value	name	path	database	scheme
+#
+#For example
+#coreprofiler_downloaded_20250625_klebsiella_3_scgMLST634_632_loci_bigsdb	klebsiella_3: scgMLST634 [632 loci] (BIGSdb)	coreprofiler_klebsiella_3	coreprofiler_klebsiella_3/db_klebsiella_3/klebsiella_3.fasta	coreprofiler_klebsiella_3/scheme_klebsiella_3
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tool_data_table_conf.xml.sample	Tue Jul 22 09:00:12 2025 +0000
@@ -0,0 +1,6 @@
+<tables>
+    <table name="coreprofiler_scheme" comment_char="#">
+        <columns>value, name, path, database, scheme</columns>
+        <file path="tool-data/coreprofiler_scheme.loc"/>
+    </table>
+</tables>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tool_data_table_conf.xml.test	Tue Jul 22 09:00:12 2025 +0000
@@ -0,0 +1,6 @@
+<tables>
+    <table name="coreprofiler_scheme" comment_char="#">
+        <columns>value, name, path, database, scheme</columns>
+        <file path="${__HERE__}/test-data/coreprofiler_scheme.loc.test"/>
+    </table>
+</tables>
\ No newline at end of file