changeset 2:5fe20c915fa6 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_metaphlan_database_downloader commit 57df6e8a0ffd145e560f7c7e20cfedbbe2ce01d2
author iuc
date Tue, 28 Mar 2023 18:54:12 +0000
parents 9c43baa60906
children 4ba60cb14cb0
files data_manager/data_manager_metaphlan_download.py data_manager/data_manager_metaphlan_download.xml data_manager_conf.xml test-data/metaphlan_database.loc test-data/metaphlan_database_versioned.loc tool-data/metaphlan_database.loc.sample tool-data/metaphlan_database_versioned.loc.sample tool_data_table_conf.xml.sample tool_data_table_conf.xml.test
diffstat 9 files changed, 43 insertions(+), 38 deletions(-) [+]
line wrap: on
line diff
--- a/data_manager/data_manager_metaphlan_download.py	Wed Apr 21 21:37:49 2021 +0000
+++ b/data_manager/data_manager_metaphlan_download.py	Tue Mar 28 18:54:12 2023 +0000
@@ -106,7 +106,8 @@
             dbkey=index,
             value='%s-%s' % (index, date.today().strftime("%d%m%Y")),
             name="MetaPhlAn clade-specific marker genes (%s)" % index,
-            path=str(db_dp)))
+            path=str(db_dp),
+            db_version='SGB' if 'SGB' in index else 'legacy'))
 
 
 if __name__ == "__main__":
@@ -129,14 +130,14 @@
 
     # Set up data tables dictionary
     data_tables = create_data_tables_dict()
-    add_data_table(data_tables, "metaphlan_database")
+    add_data_table(data_tables, "metaphlan_database_versioned")
 
     # Fetch data from specified data sources
     print("Download and build database")
     download_metaphlan_db(
         data_tables,
         args.index,
-        "metaphlan_database",
+        "metaphlan_database_versioned",
         target_dp)
 
     # Write output JSON
--- a/data_manager/data_manager_metaphlan_download.xml	Wed Apr 21 21:37:49 2021 +0000
+++ b/data_manager/data_manager_metaphlan_download.xml	Tue Mar 28 18:54:12 2023 +0000
@@ -1,15 +1,15 @@
-<tool id="data_manager_metaphlan_download" name="Download and build MetaPhlAn database" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" tool_type="manage_data" profile="20.01">
+<tool id="data_manager_metaphlan_download" name="Download and build MetaPhlAn database" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" tool_type="manage_data" profile="22.05">
     <description></description>
     <requirements>
         <requirement type="package" version="@TOOL_VERSION@">metaphlan</requirement>
     </requirements>
     <macros>
-        <token name="@TOOL_VERSION@">3.0.7</token>
+        <token name="@TOOL_VERSION@">4.0.6</token>
         <token name="@VERSION_SUFFIX@">0</token>
     </macros>
     <stdio>
-        <exit_code range=":-1" level="fatal" description="Error: Cannot open file" />
-        <exit_code range="1:" level="fatal" description="Error" />
+        <exit_code range=":-1" level="fatal" description="Error: Cannot open file"/>
+        <exit_code range="1:" level="fatal" description="Error"/>
     </stdio>
     <command><![CDATA[
 python '$__tool_directory__/data_manager_metaphlan_download.py'
@@ -18,22 +18,25 @@
     ]]></command>
     <inputs>
         <param name="index" type="select" label="Version">
-            <option value="mpa_v30_CHOCOPhlAn_201901" selected="true">mpa_v30_CHOCOPhlAn_201901</option>
+            <option value="mpa_vOct22_CHOCOPhlAnSGB_202212" selected="true">mpa_vOct22_CHOCOPhlAnSGB_202212</option>
+            <option value="mpa_vJan21_CHOCOPhlAnSGB_202103">mpa_vJan21_CHOCOPhlAnSGB_202103</option>
         </param>
     </inputs>
     <outputs>
         <data name="out_file" format="data_manager_json" label="${tool.name}"/>
     </outputs>
     <tests>
-    <test expect_num_outputs="1">
-        <param name="index" value="mpa_v30_CHOCOPhlAn_201901"/>
-        <output name="out_file">
-            <assert_contents>
-                <has_text text="mpa_v30_CHOCOPhlAn_201901-"/>
-                <has_text text="MetaPhlAn clade-specific marker genes (mpa_v30_CHOCOPhlAn_201901)"/>
-            </assert_contents>
-        </output>
-    </test>
+        <!--
+        <test expect_num_outputs="1">
+            <param name="index" value="mpa_vOct22_CHOCOPhlAnSGB_202212"/>
+            <output name="out_file">
+                <assert_contents>
+                    <has_text text="mpa_vOct22_CHOCOPhlAnSGB_202212"/>
+                    <has_text text="MetaPhlAn clade-specific marker genes (mpa_vOct22_CHOCOPhlAnSGB_202212)"/>
+                </assert_contents>
+            </output>
+        </test>
+        -->
     </tests>
     <help><![CDATA[
 This tool downloads and builds the MetaPhlAn databases.
--- a/data_manager_conf.xml	Wed Apr 21 21:37:49 2021 +0000
+++ b/data_manager_conf.xml	Tue Mar 28 18:54:12 2023 +0000
@@ -1,12 +1,12 @@
 <?xml version="1.0"?>
 <data_managers>
-    <data_manager tool_file="data_manager/data_manager_metaphlan_download.xml" id="data_manager_metaphlan_download" >
-        <data_table name="metaphlan_database">  <!-- Defines a Data Table to be modified. -->
+    <data_manager tool_file="data_manager/data_manager_metaphlan_download.xml" id="data_manager_metaphlan_download">
+        <data_table name="metaphlan_database_versioned">  <!-- 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="dbkey" /> <!-- columns that are going to be specified by the Data Manager Tool -->
-                <column name="path" output_ref="out_file" >
+                <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="dbkey"/> <!-- 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}">metaphlan/data/${dbkey}</target>
@@ -14,6 +14,7 @@
                     <value_translation>${GALAXY_DATA_MANAGER_DATA_PATH}/metaphlan/data/${dbkey}</value_translation>
                     <value_translation type="function">abspath</value_translation>
                 </column>
+                <column name="db_version"/> <!-- columns that are going to be specified by the Data Manager Tool -->
             </output>
         </data_table>
     </data_manager>
--- a/test-data/metaphlan_database.loc	Wed Apr 21 21:37:49 2021 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-#This is a sample file distributed with Galaxy that enables tools
-#to use a directory of metagenomics files.  
-#file has this format (white space characters are TAB characters)
-mpa_v30_CHOCOPhlAn_201901-20210420	MetaPhlAn clade-specific marker genes (mpa_v30_CHOCOPhlAn_201901)	mpa_v30_CHOCOPhlAn_201901	/path/to/data
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/metaphlan_database_versioned.loc	Tue Mar 28 18:54:12 2023 +0000
@@ -0,0 +1,4 @@
+#This is a sample file distributed with Galaxy that enables tools
+#to use a directory of metagenomics files.  
+#file has this format (white space characters are TAB characters)
+#mpa_v30_CHOCOPhlAn_201901-20210420	MetaPhlAn clade-specific marker genes (mpa_v30_CHOCOPhlAn_201901)	mpa_v30_CHOCOPhlAn_201901	/path/to/data	SGB_or_legacy
--- a/tool-data/metaphlan_database.loc.sample	Wed Apr 21 21:37:49 2021 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-#This is a sample file distributed with Galaxy that enables tools
-#to use a directory of metagenomics files.  
-#file has this format (white space characters are TAB characters)
-#02_16_2014	MetaPhlAn2 clade-specific marker genes	db_v20	/path/to/data
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tool-data/metaphlan_database_versioned.loc.sample	Tue Mar 28 18:54:12 2023 +0000
@@ -0,0 +1,4 @@
+#This is a sample file distributed with Galaxy that enables tools
+#to use a directory of metagenomics files.  
+#file has this format (white space characters are TAB characters)
+#02_16_2014	MetaPhlAn2 clade-specific marker genes	db_v20	/path/to/data	SGB_or_legacy
--- a/tool_data_table_conf.xml.sample	Wed Apr 21 21:37:49 2021 +0000
+++ b/tool_data_table_conf.xml.sample	Tue Mar 28 18:54:12 2023 +0000
@@ -1,6 +1,6 @@
 <tables>
-    <table name="metaphlan_database" comment_char="#">
-        <columns>value, name, dbkey, path</columns>
-        <file path="tool-data/metaphlan_database.loc" />
+    <table name="metaphlan_database_versioned" comment_char="#">
+        <columns>value, name, dbkey, path, db_version</columns>
+        <file path="tool-data/metaphlan_database_versioned.loc"/>
     </table>
 </tables>
--- a/tool_data_table_conf.xml.test	Wed Apr 21 21:37:49 2021 +0000
+++ b/tool_data_table_conf.xml.test	Tue Mar 28 18:54:12 2023 +0000
@@ -1,6 +1,6 @@
 <tables>
-    <table name="metaphlan_database" comment_char="#">
-        <columns>value, name, dbkey, path</columns>
-        <file path="${__HERE__}/test-data/metaphlan_database.loc" />
+    <table name="metaphlan_database_versioned" comment_char="#">
+        <columns>value, name, dbkey, path, db_version</columns>
+        <file path="${__HERE__}/test-data/metaphlan_database_versioned.loc"/>
     </table>
-</tables>
\ No newline at end of file
+</tables>