Mercurial > repos > iuc > gemini
comparison data_manager/data_manager_gemini_download.py @ 20:b5207530f991 draft default tip
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/data_managers/data_manager_gemini_downloader commit e88029bb12e5262687267293f9d2a694eb00d3f0-dirty
| author | iuc |
|---|---|
| date | Tue, 29 Dec 2015 10:19:47 -0500 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 19:27ce3de83007 | 20:b5207530f991 |
|---|---|
| 1 #!/usr/bin/env python | |
| 2 | |
| 3 import sys | |
| 4 import os | |
| 5 import json | |
| 6 import shlex | |
| 7 import datetime | |
| 8 import subprocess | |
| 9 | |
| 10 def main(): | |
| 11 | |
| 12 today = datetime.date.today() | |
| 13 params = json.loads( open( sys.argv[1] ).read() ) | |
| 14 target_directory = params[ 'output_data' ][0]['extra_files_path'] | |
| 15 os.mkdir( target_directory ) | |
| 16 cmd = "gemini --annotation-dir %s update --dataonly %s %s" % (target_directory, params['param_dict']['gerp_bp'], params['param_dict']['cadd'] ) | |
| 17 ret = subprocess.check_call( cmd, shell=True ) | |
| 18 data_manager_dict = { | |
| 19 'data_tables': | |
| 20 {'gemini_databases': [ | |
| 21 {'value': today.isoformat(), 'dbkey': 'hg19', 'name': 'GEMINI annotations (%s)' % today.isoformat(), 'path': './%s' % today.isoformat() } | |
| 22 ] | |
| 23 } | |
| 24 } | |
| 25 | |
| 26 #save info to json file | |
| 27 with open( sys.argv[1], 'wb' ) as out: | |
| 28 out.write( json.dumps( data_manager_dict ) ) | |
| 29 | |
| 30 if __name__ == "__main__": | |
| 31 main() | |
| 32 |
