comparison data_manager/data_manager_gemini_download.py @ 7:5bcf0e24f42c draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_gemini_database_downloader commit 73ea765822334d9afc2f7b2ef4ddfc1a3fd4289e"
author iuc
date Thu, 14 May 2020 05:08:26 -0400
parents f57426daa04d
children 52b6a4d98009
comparison
equal deleted inserted replaced
6:f57426daa04d 7:5bcf0e24f42c
14 yaml.dump(config, fo, allow_unicode=False, default_flow_style=False) 14 yaml.dump(config, fo, allow_unicode=False, default_flow_style=False)
15 15
16 16
17 def main(): 17 def main():
18 today = datetime.date.today() 18 today = datetime.date.today()
19 params = json.loads( open( sys.argv[1] ).read() ) 19 params = json.loads(open(sys.argv[1]).read())
20 target_directory = params[ 'output_data' ][0]['extra_files_path'] 20 target_directory = params['output_data'][0]['extra_files_path']
21 os.mkdir( target_directory ) 21 os.mkdir(target_directory)
22 22
23 # Generate a minimal configuration file for GEMINI update 23 # Generate a minimal configuration file for GEMINI update
24 # to instruct the tool to download the annotation data into a 24 # to instruct the tool to download the annotation data into a
25 # subfolder of the target directory. 25 # subfolder of the target directory.
26 config_file = os.path.join(target_directory, 'gemini-config.yaml') 26 config_file = os.path.join(target_directory, 'gemini-config.yaml')
37 gemini_env['GEMINI_CONFIG'] = target_directory 37 gemini_env['GEMINI_CONFIG'] = target_directory
38 cmd = "gemini update --dataonly %s %s" % ( 38 cmd = "gemini update --dataonly %s %s" % (
39 params['param_dict']['gerp_bp'], 39 params['param_dict']['gerp_bp'],
40 params['param_dict']['cadd'] 40 params['param_dict']['cadd']
41 ) 41 )
42 subprocess.check_call( cmd, shell=True, env=gemini_env ) 42 subprocess.check_call(cmd, shell=True, env=gemini_env)
43 43
44 # GEMINI tool wrappers that need access to the annotation files 44 # GEMINI tool wrappers that need access to the annotation files
45 # are supposed to symlink them into a gemini/data subfolder of 45 # are supposed to symlink them into a gemini/data subfolder of
46 # the job working directory. To have GEMINI discover them there, 46 # the job working directory. To have GEMINI discover them there,
47 # we need to set this location as the 'annotation_dir' in the 47 # we need to set this location as the 'annotation_dir' in the
81 ] 81 ]
82 } 82 }
83 } 83 }
84 84
85 # ... and save it to the json results file 85 # ... and save it to the json results file
86 with open( sys.argv[1], 'wb' ) as out: 86 with open(sys.argv[1], 'w') as out:
87 out.write( json.dumps( data_manager_dict ) ) 87 out.write(json.dumps(data_manager_dict))
88 88
89 89
90 if __name__ == "__main__": 90 if __name__ == "__main__":
91 main() 91 main()