changeset 2:3d82020b1e3b draft

"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/eggnog_mapper/eggnog_mapper_data_manager commit fd234f7532b34a1b6ced0d3ac53a8f42348e23f7"
author galaxyp
date Fri, 19 Feb 2021 18:53:40 +0000
parents 077cf0a99144
children 5a2ffc486246
files data_manager/data_manager_eggnog.py data_manager/data_manager_eggnog.xml data_manager/eggnog_macros.xml data_manager_conf.xml test-data/cached_locally/eggnog_mapper_db.loc test-data/cached_locally/eggnog_mapper_db_versioned.loc tool-data/eggnog_mapper_db.loc.sample tool-data/eggnog_mapper_db_versioned.loc.sample tool_data_table_conf.xml.sample tool_data_table_conf.xml.test
diffstat 10 files changed, 53 insertions(+), 38 deletions(-) [+]
line wrap: on
line diff
--- a/data_manager/data_manager_eggnog.py	Fri Sep 04 21:38:59 2020 +0000
+++ b/data_manager/data_manager_eggnog.py	Fri Feb 19 18:53:40 2021 +0000
@@ -39,11 +39,18 @@
     # params = json.loads(open(args.config_file).read())
     dm_dict = {}
     dm_dict['data_tables'] = dm_dict.get('data_tables', {})
-    data_table = 'eggnog_mapper_db'
+    data_table = 'eggnog_mapper_db_versioned'
     dm_dict['data_tables'][data_table]\
         = dm_dict['data_tables'].get(data_table, [])
+    # Versionning is super confusing:
+    # eggnog-mapper 1.* needed a db v4.5 (based on eggnog v4.5)
+    # eggnog-mapper 2.0 needs a db v2.0 (based on eggnog v5.0)
+    # db v4.5 are not compatible with eggnog-mapper 2.0
+    version = "2.0"
+    if "4.5" in db_version:
+        version = "1.0"
     data_table_entry = dict(value=db_version, name=db_version,
-                            path=args.install_path)
+                            path=args.install_path, version=version)
     dm_dict['data_tables'][data_table].append(data_table_entry)
 
     # save info to json file
--- a/data_manager/data_manager_eggnog.xml	Fri Sep 04 21:38:59 2020 +0000
+++ b/data_manager/data_manager_eggnog.xml	Fri Feb 19 18:53:40 2021 +0000
@@ -1,4 +1,4 @@
-<tool id="data_manager_eggnog" name="EggNOG DB Download" version="@VERSION@" tool_type="manage_data">
+<tool id="data_manager_eggnog" name="EggNOG DB Download" version="@VERSION@+galaxy1" tool_type="manage_data" profile="18.09">
     <description>eggnog data</description>
     <macros>
         <import>eggnog_macros.xml</import>
@@ -8,7 +8,7 @@
     <command detect_errors="exit_code"><![CDATA[
 #import json, os
 #set params = json.loads(open(str($out_file)).read())
-#set install_path = $params['output_data'][0]['extra_files_path'].encode('ascii', 'replace')
+#set install_path = $params['output_data'][0]['extra_files_path']
 @DOWNLOAD_CMD@
     ]]></command>
     <inputs>
@@ -20,7 +20,7 @@
     </tests>
     <help><![CDATA[
 This tool downloads eggnog data using download_eggnog_data.py
-and populates the data tables: eggnog_mapper_db.
+and populates the data tables: eggnog_mapper_db_versioned.
 The data is located at: http://eggnog5.embl.de/download/emapperdb-5.0.0/
 can vary from 1G to 80G in size.
 
--- a/data_manager/eggnog_macros.xml	Fri Sep 04 21:38:59 2020 +0000
+++ b/data_manager/eggnog_macros.xml	Fri Feb 19 18:53:40 2021 +0000
@@ -1,7 +1,14 @@
 <?xml version="1.0"?>
 <macros>
    <token name="@VERSION@">2.0.1</token>
-   <token name="@EGGNOG_DB_VERSION@">5.0</token>
+   <token name="@EGGNOG_DB_VERSION@">2.0</token>
+    <!--
+    # Versionning is super confusing:
+    # eggnog-mapper 1.* needed a db v4.5 (based on eggnog v4.5)
+    # eggnog-mapper 2.0 needs a db v2.0 (based on eggnog v5.0)
+    # db v4.5 are not compatible with eggnog-mapper 2.0
+    -->
+   <token name="@IDX_VERSION@">2.0</token>
    <xml name="citations">
         <citations>
             <citation type="doi">10.1093/nar/gkv1248</citation>
@@ -47,7 +54,7 @@
             <yield />
             <output name="out_file">
                 <assert_contents>
-                    <has_text text="eggnog_mapper_db" />
+                    <has_text text="eggnog_mapper_db_versioned" />
                     <has_text text="@EGGNOG_DB_VERSION@" />
                 </assert_contents>
             </output>
--- a/data_manager_conf.xml	Fri Sep 04 21:38:59 2020 +0000
+++ b/data_manager_conf.xml	Fri Feb 19 18:53:40 2021 +0000
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <data_managers>
   <data_manager tool_file="data_manager/data_manager_eggnog.xml" id="data_manager_eggnog" >
-    <data_table name="eggnog_mapper_db">  <!-- Defines a Data Table to be modified. -->
+    <data_table name="eggnog_mapper_db_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 -->
@@ -12,6 +12,7 @@
           <value_translation>${GALAXY_DATA_MANAGER_DATA_PATH}/eggnog_data/${value}</value_translation>
           <value_translation type="function">abspath</value_translation>
         </column>
+        <column name="version" />
       </output>
     </data_table>
   </data_manager>
--- a/test-data/cached_locally/eggnog_mapper_db.loc	Fri Sep 04 21:38:59 2020 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-#value	name	path
-5.0	eggNOG_5.0	${__HERE__}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/cached_locally/eggnog_mapper_db_versioned.loc	Fri Feb 19 18:53:40 2021 +0000
@@ -0,0 +1,2 @@
+#value	name	path	version
+2.0	eggNOG_2.0	${__HERE__}	2.0
--- a/tool-data/eggnog_mapper_db.loc.sample	Fri Sep 04 21:38:59 2020 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-#This is a sample file distributed with Galaxy that enables tools
-#to use a directory of eggnog_mapper data files.
-#
-# eggnog-mapper requires the following files to be installed in the data directory:
-#  https://github.com/jhcepas/eggnog-mapper/blob/master/data/og2level.tsv.gz
-#  http://eggnog5.embl.de/download/emapperdb-5.0.0/eggnog.db.gz
-# A complete diamond database is available from:
-#  http://eggnog5.embl.de/download/emapperdb-5.0.0/eggnog_proteins.dmnd.gz
-#
-# The python script download_eggnog_data.py,
-# included with eggnog_mapper, can be used to download the files to the correct directory
-#
-# The near-equivalence of columns "value" and "db" is needed for the tests to work,
-# and for the setting of --data_dir to the parent directory of eggnog.db
-# The complicated eggNOG database structure makes passing custom HMM databases somewhat tricky.
-# See test-data/cached_locally/eggnog_mapper.loc for how this was done with the included test databases
-# In all other cases, when the appropriate HMM database (for example, "thaNOG") was downloaded from eggnogdb.embl.de,
-# value and db should be the same (in the example, both should be "thaNOG")
-#
-#
-#db_version	name	path
-#5.0	eggnog_5.0	/path/to/directory/that/contains/eggnog.db
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tool-data/eggnog_mapper_db_versioned.loc.sample	Fri Feb 19 18:53:40 2021 +0000
@@ -0,0 +1,22 @@
+#This is a sample file distributed with Galaxy that enables tools
+#to use a directory of eggnog_mapper data files.
+#
+# eggnog-mapper requires the following files to be installed in the data directory:
+#  https://github.com/jhcepas/eggnog-mapper/blob/master/data/og2level.tsv.gz
+#  http://eggnog5.embl.de/download/emapperdb-5.0.0/eggnog.db.gz
+# A complete diamond database is available from:
+#  http://eggnog5.embl.de/download/emapperdb-5.0.0/eggnog_proteins.dmnd.gz
+#
+# The python script download_eggnog_data.py,
+# included with eggnog_mapper, can be used to download the files to the correct directory
+#
+# The near-equivalence of columns "value" and "db" is needed for the tests to work,
+# and for the setting of --data_dir to the parent directory of eggnog.db
+# The complicated eggNOG database structure makes passing custom HMM databases somewhat tricky.
+# See test-data/cached_locally/eggnog_mapper.loc for how this was done with the included test databases
+# In all other cases, when the appropriate HMM database (for example, "thaNOG") was downloaded from eggnogdb.embl.de,
+# value and db should be the same (in the example, both should be "thaNOG")
+#
+#
+#db_version	name	path
+#5.0	eggnog_5.0	/path/to/directory/that/contains/eggnog.db
--- a/tool_data_table_conf.xml.sample	Fri Sep 04 21:38:59 2020 +0000
+++ b/tool_data_table_conf.xml.sample	Fri Feb 19 18:53:40 2021 +0000
@@ -1,7 +1,7 @@
 <tables>
     <!-- Locations of all eggnog_mapper data -->
-    <table name="eggnog_mapper_db" comment_char="#" allow_duplicate_entries="False">
-        <columns>value,name,path</columns>
-        <file path="tool-data/eggnog_mapper_db.loc" />
+    <table name="eggnog_mapper_db_versioned" comment_char="#" allow_duplicate_entries="False">
+        <columns>value,name,path,version</columns>
+        <file path="tool-data/eggnog_mapper_db_versioned.loc" />
     </table>
 </tables>
--- a/tool_data_table_conf.xml.test	Fri Sep 04 21:38:59 2020 +0000
+++ b/tool_data_table_conf.xml.test	Fri Feb 19 18:53:40 2021 +0000
@@ -1,7 +1,7 @@
 <tables>
     <!-- Locations of all eggnog_mapper data -->
-    <table name="eggnog_mapper_db" comment_char="#">
-        <columns>value,name,path</columns>
-        <file path="${__HERE__}/test-data/cached_locally/eggnog_mapper_db.loc" />
+    <table name="eggnog_mapper_db_versioned" comment_char="#" allow_duplicate_entries="False">
+        <columns>value,name,path,version</columns>
+        <file path="${__HERE__}/test-data/cached_locally/eggnog_mapper_db_versioned.loc" />
     </table>
 </tables>