# HG changeset patch # User davidvanzessen # Date 1543589798 18000 # Node ID de3516853bde9b343d68faddfdf347af08d574fa Uploaded diff -r 000000000000 -r de3516853bde data_manager/fetch_vep_cache_data.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data_manager/fetch_vep_cache_data.py Fri Nov 30 09:56:38 2018 -0500 @@ -0,0 +1,54 @@ +import argparse +import os +import json +import re +import pprint +import subprocess +import sys + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description="Use VEP INSTALL.pl to download/process the cache for an assembly") + parser.add_argument("--output-file") + parser.add_argument("--output-dir") + parser.add_argument("--assembly") + args = parser.parse_args() + + output_file = args.output_file + output_dir = args.output_dir + assembly = args.assembly + extra = args.assembly + + with open(output_file) as output_file_handle: + params = json.loads(output_file_handle.read()) + + print(output_file) + print(output_dir) + print(assembly) + pprint.pprint(params) + + if not os.path.exists(output_dir): + os.makedirs(output_dir) + + vep_install_cmd = ["vep_install", "--NO_HTSLIB", "-a alcf", "--CACHEDIR", output_dir, "--SPECIES", assembly] + vep_install_cmd = "vep_install --NO_HTSLIB -a alcf --CACHEDIR {0} --SPECIES {1}".format(output_dir, assembly) + print("Running INSTALL.pl") + #print(" ".join(vep_install_cmd)) + print(vep_install_cmd) + exit_code = subprocess.call(vep_install_cmd, cwd=output_dir, shell=True) + #process = subprocess.Popen(vep_install_cmd, shell=True, cwd=output_dir) + + print(exit_code) + + output_dict = dict( + data_tables=dict( + vep_cache_data=[{ + "path": output_dir, + "dbkey": assembly, + "name": assembly, + "value": assembly + }] + ) + ) + with open(output_file, 'w') as output_file_handle: + output_file_handle.write(json.dumps(output_dict)) + sys.exit(0) \ No newline at end of file diff -r 000000000000 -r de3516853bde data_manager/fetch_vep_cache_data.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data_manager/fetch_vep_cache_data.xml Fri Nov 30 09:56:38 2018 -0500 @@ -0,0 +1,37 @@ + + + ensembl-vep + + fetching + + +python $__tool_directory__/fetch_vep_cache_data.py +--output-file ${ out_file } +--output-dir ${ out_file.extra_files_path } +--assembly ${ dbkey }${ extra } + + + + + + + + + + + + + + + + + + There is no help + + \ No newline at end of file diff -r 000000000000 -r de3516853bde data_manager_conf.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data_manager_conf.xml Fri Nov 30 09:56:38 2018 -0500 @@ -0,0 +1,19 @@ + + + + + + + + + + + ${path} + ${dbkey}/seq/${path} + + ${GALAXY_DATA_MANAGER_DATA_PATH}/${dbkey}/seq/${path} + + + + + diff -r 000000000000 -r de3516853bde tool-data/vep_cache_data.loc.sample --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tool-data/vep_cache_data.loc.sample Fri Nov 30 09:56:38 2018 -0500 @@ -0,0 +1,6 @@ +# VEP data cache location +# +# short name of the entry +# galaxy ref key +# display name of the entry +# path to the directory of the cache dir \ No newline at end of file