# HG changeset patch # User galaxyp # Date 1613760743 0 # Node ID 46d2e3ed9530c9a00aeea8a60136e50e404d00bf # Parent 48893cfa76a8c8edb67172d5aac8bf1991c5bf0b "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/eggnog_mapper/data_manager_eggnog_mapper_abspath commit fd234f7532b34a1b6ced0d3ac53a8f42348e23f7" diff -r 48893cfa76a8 -r 46d2e3ed9530 data_manager/data_manager_eggnog.py --- a/data_manager/data_manager_eggnog.py Mon Nov 11 11:47:57 2019 -0500 +++ b/data_manager/data_manager_eggnog.py Fri Feb 19 18:52:23 2021 +0000 @@ -11,7 +11,7 @@ def _get_db_version(sqlitedb_path): - version = '4.5' + version = '5.0' try: query = 'select version from version' conn = sqlite3.connect(sqlitedb_path) @@ -28,7 +28,6 @@ parser = argparse.ArgumentParser() parser.add_argument('--config_file') parser.add_argument('--install_path') - parser.add_argument('--dbs', default='') args = parser.parse_args() eggnog_db_path = os.path.join(args.install_path, 'eggnog.db') @@ -40,25 +39,22 @@ # params = json.loads(open(args.config_file).read()) dm_dict = {} dm_dict['data_tables'] = dm_dict.get('data_tables', {}) - data_table = 'eggnog_mapper_db' - dm_dict['data_tables'][data_table]\ - = dm_dict['data_tables'].get(data_table, []) - data_table_entry = dict(value=db_version, name=db_version, - path=args.install_path) - dm_dict['data_tables'][data_table].append(data_table_entry) - data_table = 'eggnog_mapper_hmm_dbs' + data_table = 'eggnog_mapper_db_versioned' dm_dict['data_tables'][data_table]\ = dm_dict['data_tables'].get(data_table, []) - if args.dbs: - dbs = [x.strip() for x in args.dbs.split(',')] - for db in dbs: - key = '%s_%s' % (db_version, db) - data_table_entry = dict(key=key, db_version=db_version, - value=db, name=db, path=db) - dm_dict['data_tables'][data_table].append(data_table_entry) + # 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, version=version) + dm_dict['data_tables'][data_table].append(data_table_entry) # save info to json file - open(args.config_file, 'wb').write(json.dumps(dm_dict)) + open(args.config_file, 'w').write(json.dumps(dm_dict)) if __name__ == "__main__": diff -r 48893cfa76a8 -r 46d2e3ed9530 data_manager/data_manager_eggnog.xml --- a/data_manager/data_manager_eggnog.xml Mon Nov 11 11:47:57 2019 -0500 +++ b/data_manager/data_manager_eggnog.xml Fri Feb 19 18:52:23 2021 +0000 @@ -1,4 +1,4 @@ - + eggnog data to a specified directory eggnog_macros.xml @@ -10,7 +10,7 @@ @DOWNLOAD_CMD@ ]]> - ^/.*$ @@ -18,16 +18,17 @@ - + + + diff -r 48893cfa76a8 -r 46d2e3ed9530 data_manager/eggnog_macros.xml --- a/data_manager/eggnog_macros.xml Mon Nov 11 11:47:57 2019 -0500 +++ b/data_manager/eggnog_macros.xml Fri Feb 19 18:52:23 2021 +0000 @@ -1,9 +1,18 @@ - 1.0.3 + 2.0.1 + 2.0 + + 2.0 10.1093/nar/gkv1248 + 10.1093/molbev/msx148 @@ -16,119 +25,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -141,33 +38,26 @@ #import os.path #set $install_path = $os.path.join($os.path.dirname($__tool_directory__), 'test-data/cached_locally') #end if -#if $dbs: -#set $eggnogdbs = ' '.join(str($dbs).split(',')) -#else -#set $eggnogdbs = 'none' -#end if mkdir -p '${install_path}' && -download_eggnog_data.py - $diamond_database -y -q +download_eggnog_data.py + $diamond_database -y -q #if $test == 'true' -s #end if - --data_dir '$install_path' - $eggnogdbs && -python '${__tool_directory__}/data_manager_eggnog.py' --config_file '$out_file' --install_path '$install_path' --dbs '$dbs' + --data_dir '$install_path' && +python '${__tool_directory__}/data_manager_eggnog.py' --config_file '$out_file' --install_path '$install_path' ]]> - diff -r 48893cfa76a8 -r 46d2e3ed9530 data_manager_conf.xml --- a/data_manager_conf.xml Mon Nov 11 11:47:57 2019 -0500 +++ b/data_manager_conf.xml Fri Feb 19 18:52:23 2021 +0000 @@ -1,20 +1,12 @@ - + - - - - - - - - - + diff -r 48893cfa76a8 -r 46d2e3ed9530 test-data/cached_locally/eggnog.db Binary file test-data/cached_locally/eggnog.db has changed diff -r 48893cfa76a8 -r 46d2e3ed9530 test-data/cached_locally/eggnog_mapper_db.loc --- a/test-data/cached_locally/eggnog_mapper_db.loc Mon Nov 11 11:47:57 2019 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -#value name path -4.5 eggNOG_4.5 ${__HERE__} diff -r 48893cfa76a8 -r 46d2e3ed9530 test-data/cached_locally/eggnog_mapper_db_versioned.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/cached_locally/eggnog_mapper_db_versioned.loc Fri Feb 19 18:52:23 2021 +0000 @@ -0,0 +1,2 @@ +#value name path version +2.0 eggNOG_2.0 ${__HERE__} 2.0 diff -r 48893cfa76a8 -r 46d2e3ed9530 test-data/cached_locally/eggnog_mapper_hmm_dbs.loc --- a/test-data/cached_locally/eggnog_mapper_hmm_dbs.loc Mon Nov 11 11:47:57 2019 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -#key db_version value name path -4.5_ENOG411CB2I 4.5 ENOG411CB2I ENOG411CB2I ${__HERE__}/hmmdb_levels/ENOG411CB2I/ENOG411CB2I diff -r 48893cfa76a8 -r 46d2e3ed9530 tool-data/eggnog_mapper_db.loc.sample --- a/tool-data/eggnog_mapper_db.loc.sample Mon Nov 11 11:47:57 2019 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +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://eggnogdb.embl.de/download/eggnog_4.5/eggnog-mapper-data/eggnog.db.gz -# http://eggnogdb.embl.de/download/eggnog_4.5/eggnog-mapper-data/OG_fasta.tar.gz -# In addition individual HMM DBs can be installed from: -# http://eggnogdb.embl.de/download/eggnog_4.5/eggnog-mapper-data/hmmdb_levels/ -# A complete diamond database is available from: -# http://eggnogdb.embl.de/download/eggnog_4.5/eggnog-mapper-data/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 -#4.5.1 eggnog_4.5.1 /path/to/directory/that/contains/eggnog.db diff -r 48893cfa76a8 -r 46d2e3ed9530 tool-data/eggnog_mapper_db_versioned.loc.sample --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tool-data/eggnog_mapper_db_versioned.loc.sample Fri Feb 19 18:52:23 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 diff -r 48893cfa76a8 -r 46d2e3ed9530 tool-data/eggnog_mapper_hmm_dbs.loc.sample --- a/tool-data/eggnog_mapper_hmm_dbs.loc.sample Mon Nov 11 11:47:57 2019 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +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://eggnogdb.embl.de/download/eggnog_4.5/eggnog-mapper-data/eggnog.db.gz -# http://eggnogdb.embl.de/download/eggnog_4.5/eggnog-mapper-data/OG_fasta.tar.gz -# In addition individual HMM DBs can be installed from: -# http://eggnogdb.embl.de/download/eggnog_4.5/eggnog-mapper-data/hmmdb_levels/ -# A complete diamond database is available from: -# http://eggnogdb.embl.de/download/eggnog_4.5/eggnog-mapper-data/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") -# -# -#key db_version value name path -#4.5.1_NOG 4.5.1 NOG Full eggNOG database (NOG) -#4.5.1_euk 4.5.1 euk Eukaryotes (euk) -#4.5.1_aproNOG 4.5.1 aproNOG Proteobacteria_alpha (aproNOG) -#4.5.1_aproNOG 4.5.1 ENOG411CB2I ENOG411CB2I (custom) /path/to/custom/hmmdb/ENOG411CB2I diff -r 48893cfa76a8 -r 46d2e3ed9530 tool_data_table_conf.xml.sample --- a/tool_data_table_conf.xml.sample Mon Nov 11 11:47:57 2019 -0500 +++ b/tool_data_table_conf.xml.sample Fri Feb 19 18:52:23 2021 +0000 @@ -1,11 +1,7 @@ - - value,name,path - -
- - key,db_version,value,name,path - +
+ value,name,path,version +
diff -r 48893cfa76a8 -r 46d2e3ed9530 tool_data_table_conf.xml.test --- a/tool_data_table_conf.xml.test Mon Nov 11 11:47:57 2019 -0500 +++ b/tool_data_table_conf.xml.test Fri Feb 19 18:52:23 2021 +0000 @@ -1,11 +1,7 @@ - - value,name,path - -
- - key,db_version,value,name,path - +
+ value,name,path,version +