# HG changeset patch # User jjohnson # Date 1572987222 18000 # Node ID 9d94fe7ce8b919d2ae6c1874347e0958f67e629a # Parent a74d61dbd15578b4f13b31ebad1a8d775eb12829 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/eggnog_mapper commit e711920c41c8862d7d8133f7b455cf475924e103 diff -r a74d61dbd155 -r 9d94fe7ce8b9 data_manager/data_manager_eggnog.py --- a/data_manager/data_manager_eggnog.py Mon Nov 04 16:38:44 2019 -0500 +++ b/data_manager/data_manager_eggnog.py Tue Nov 05 15:53:42 2019 -0500 @@ -6,8 +6,9 @@ import json import os.path import sqlite3 +import sys from sqlite3 import OperationalError -import sys + def _get_db_version(sqlitedb_path): version = '4.5' @@ -18,40 +19,47 @@ cur.execute(query) version = cur.fetchone()[0] except OperationalError as e: - print('Assuming eggnog version %s because %s %s' % (version, sqlitedb_path, e), file=sys.stderr) + print('Assuming eggnog version %s because %s %s' % + (version, sqlitedb_path, e), file=sys.stderr) return version + def main(): parser = argparse.ArgumentParser() - parser.add_argument( '--config_file' ) - parser.add_argument( '--install_path' ) - parser.add_argument( '--dbs', default='') + 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') + eggnog_db_path = os.path.join(args.install_path, 'eggnog.db') if not os.path.exists(eggnog_db_path): print('Can not open: %s' % eggnog_db_path, file=sys.stderr) exit(1) db_version = _get_db_version(eggnog_db_path) - params = json.loads( open( args.config_file ).read() ) - data_manager_dict = {} - data_manager_dict['data_tables'] = data_manager_dict.get( 'data_tables', {} ) + # 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_manager_dict['data_tables'][data_table] = data_manager_dict['data_tables'].get( data_table, [] ) - data_table_entry = dict(value=db_version, name=db_version, path=eggnog_db_path) - data_manager_dict['data_tables'][data_table].append( data_table_entry ) + dm_dict['data_tables'][data_table]\ + = dm_dict['data_tables'].get(data_table, []) + data_table_entry = dict(value=db_version, name=db_version, + path=eggnog_db_path) + dm_dict['data_tables'][data_table].append(data_table_entry) data_table = 'eggnog_mapper_hmm_dbs' - data_manager_dict['data_tables'][data_table] = data_manager_dict['data_tables'].get( data_table, [] ) + 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) - data_manager_dict['data_tables'][data_table].append( data_table_entry ) + 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) # save info to json file - open( args.config_file, 'wb' ).write( json.dumps( data_manager_dict ) ) + open(args.config_file, 'wb').write(json.dumps(dm_dict)) + if __name__ == "__main__": main() diff -r a74d61dbd155 -r 9d94fe7ce8b9 data_manager/data_manager_eggnog.xml --- a/data_manager/data_manager_eggnog.xml Mon Nov 04 16:38:44 2019 -0500 +++ b/data_manager/data_manager_eggnog.xml Tue Nov 05 15:53:42 2019 -0500 @@ -1,7 +1,7 @@ - + Download a new database - 4.5.1 + 1.0.3 eggnog-mapper @@ -12,17 +12,19 @@ #set params = json.loads(open(str($out_file)).read()) #set install_path = $params['output_data'][0]['extra_files_path'].encode('ascii', 'replace') #if $dbs: -#set $eggnogdbs = ' '.join($dbs.split(',')) +#set $eggnogdbs = ' '.join(str($dbs).split(',')) #else #set $eggnogdbs = 'none' -#endif +#end if #if $test == 'false' -mkdir -p '${target_directory}' && +mkdir -p '${install_path}' && download_eggnog_data.py $diamond_database -y -q --data_dir $install_path $eggnogdbs ' '.join(dbs.split(',')) && +#else +#set $install_path = '/Users/jj/gx/gh/jj/tools-galaxyp/tools/eggnog_mapper/test-data/cached_locally' #end if -python '${__tool_directory__}/data_manager_eggnog.py --config_file $out_file --install_path $target_directory --dbs '$dbs' +python '${__tool_directory__}/data_manager_eggnog.py' --config_file '$out_file' --install_path '$install_path' --dbs '$dbs' ]]> @@ -158,6 +160,9 @@ 10.1093/nar/gkv1248 diff -r a74d61dbd155 -r 9d94fe7ce8b9 data_manager_conf.xml --- a/data_manager_conf.xml Mon Nov 04 16:38:44 2019 -0500 +++ b/data_manager_conf.xml Tue Nov 05 15:53:42 2019 -0500 @@ -7,9 +7,9 @@ - ${value} + eggnog_data/${value} - ${GALAXY_DATA_MANAGER_DATA_PATH}/${value} + ${GALAXY_DATA_MANAGER_DATA_PATH}/eggnog_data/${value} abspath