# HG changeset patch # User iuc # Date 1544204742 18000 # Node ID 8885ab36d6b55328d5ace4319f45bad00dffb579 # Parent d17a77df0616509782a983e7c673410ed6b73f8e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_gemini_database_downloader commit e4dce25c8dbeffca62c402f74ca733ddc7a6091b diff -r d17a77df0616 -r 8885ab36d6b5 data_manager/data_manager_gemini_download.py --- a/data_manager/data_manager_gemini_download.py Tue Apr 04 17:51:18 2017 -0400 +++ b/data_manager/data_manager_gemini_download.py Fri Dec 07 12:45:42 2018 -0500 @@ -6,18 +6,51 @@ import subprocess import sys +import yaml + def main(): today = datetime.date.today() params = json.loads( open( sys.argv[1] ).read() ) target_directory = params[ 'output_data' ][0]['extra_files_path'] os.mkdir( target_directory ) - cmd = "gemini --annotation-dir %s update --dataonly %s %s" % (target_directory, params['param_dict']['gerp_bp'], params['param_dict']['cadd'] ) - subprocess.check_call( cmd, shell=True ) + # The target_directory needs to be specified twice for the following + # invocation of gemini. + # In essence, the GEMINI_CONFIG environment variable makes gemini store + # its yaml configuration file in that directory, while the + # --annotation-dir argument makes it write the same path into the yaml + # file, which is then used for determining where the actual annotation + # files should be stored. + gemini_env = os.environ.copy() + gemini_env['GEMINI_CONFIG'] = target_directory + cmd = "gemini --annotation-dir %s update --dataonly %s %s" % ( + target_directory, + params['param_dict']['gerp_bp'], + params['param_dict']['cadd'] + ) + subprocess.check_call( cmd, shell=True, env=gemini_env ) + + # modify the newly created gemini config file to contain a relative + # annotation dir path, which will be interpreted as relative to + # the job working directory at runtime by any gemini tool + config_file = os.path.join(target_directory, 'gemini-config.yaml') + with open(config_file) as fi: + config = yaml.load(fi) + config['annotation_dir'] = 'gemini/data' + with open(config_file, 'w') as fo: + yaml.dump(config, fo, allow_unicode=False, default_flow_style=False) + data_manager_dict = { 'data_tables': { - 'gemini_databases': [ - {'value': today.isoformat(), 'dbkey': 'hg19', 'name': 'GEMINI annotations (%s)' % today.isoformat(), 'path': './%s' % today.isoformat() } + 'gemini_versioned_databases': [ + { + 'value': today.isoformat(), + 'dbkey': 'hg19', + 'version': params['param_dict']['gemini_db_version'], + 'name': + 'GEMINI annotations (%s snapshot)' % today.isoformat(), + 'path': './%s' % today.isoformat() + } ] } } diff -r d17a77df0616 -r 8885ab36d6b5 data_manager/data_manager_gemini_download.xml --- a/data_manager/data_manager_gemini_download.xml Tue Apr 04 17:51:18 2017 -0400 +++ b/data_manager/data_manager_gemini_download.xml Fri Dec 07 12:45:42 2018 -0500 @@ -1,5 +1,9 @@ - + Download a new database + + 0.18.1 + 181 + gemini @@ -11,6 +15,7 @@ label="Download CADD scores for GEMINI database annotation" help="(--extra cadd_score)"/> + diff -r d17a77df0616 -r 8885ab36d6b5 data_manager_conf.xml --- a/data_manager_conf.xml Tue Apr 04 17:51:18 2017 -0400 +++ b/data_manager_conf.xml Fri Dec 07 12:45:42 2018 -0500 @@ -1,16 +1,17 @@ - + + - gemini/data/${dbkey}/${value} + gemini/${version}/${dbkey}/${value} - ${GALAXY_DATA_MANAGER_DATA_PATH}/gemini/data/${dbkey}/${value}/gemini/data/ + ${GALAXY_DATA_MANAGER_DATA_PATH}/gemini/${version}/${dbkey}/${value}/ abspath diff -r d17a77df0616 -r 8885ab36d6b5 tool-data/gemini_databases.loc.sample --- a/tool-data/gemini_databases.loc.sample Tue Apr 04 17:51:18 2017 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -## GEMINI databases -#Version dbkey Description -#08_08_2014 hg19 Database (08-08-2014) diff -r d17a77df0616 -r 8885ab36d6b5 tool-data/gemini_versioned_databases.loc.sample --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tool-data/gemini_versioned_databases.loc.sample Fri Dec 07 12:45:42 2018 -0500 @@ -0,0 +1,3 @@ +## GEMINI versioned databases +#DownloadDate dbkey DBversion Description +#2018-07-08 hg19 181 GEMINI annotations (2018-07-08 snapshot) diff -r d17a77df0616 -r 8885ab36d6b5 tool_data_table_conf.xml.sample --- a/tool_data_table_conf.xml.sample Tue Apr 04 17:51:18 2017 -0400 +++ b/tool_data_table_conf.xml.sample Fri Dec 07 12:45:42 2018 -0500 @@ -1,7 +1,7 @@ - - value, dbkey, name, path - +
+ value, dbkey, version, name, path +