From df839272d661c3489f8f96f3cb32d8670d655dd4 Mon Sep 17 00:00:00 2001 From: Kyle Moad Date: Thu, 9 May 2024 13:44:03 -0400 Subject: [PATCH] move base_modules to constants and add hgvs-converter --- cravat/constants.py | 29 ++++++++++++++++++++++++++++- cravat/cravat_admin.py | 4 +--- cravat/webstore/webstore.py | 7 ++----- 3 files changed, 31 insertions(+), 9 deletions(-) diff --git a/cravat/constants.py b/cravat/constants.py index 9a83e331..68845730 100644 --- a/cravat/constants.py +++ b/cravat/constants.py @@ -76,12 +76,39 @@ # Live conf live_conf_fname = "live.yml" -base_modules_key = "base_modules" main_conf_fname = "cravat.yml" main_conf_path = os.path.join(default_conf_dir, main_conf_fname) if os.path.exists(main_conf_path) == False: shutil.copyfile(os.path.join(packagedir, main_conf_fname), main_conf_path) +# Base modules +base_modules = [ + 'cravat-converter', + 'vcf-converter', + 'oldcravat-converter', + 'hgvs-converter', + 'textreporter', + 'excelreporter', + 'tagsampler', + 'vcfinfo', + 'hg38', + 'casecontrol', + 'wgbase', + 'wghg19', + 'wgncrna', + 'wglollipop', + 'wgndex', + 'wgcircossummary', + 'wgcodingvsnoncodingsummary', + 'wggosummary', + 'wgsosamplesummary', + 'wgsosummary', + 'wgnote', + 'wgvcfinfo', + 'hg38wgs', + 'varmeta', + 'wgrankscore', +] # metrics save_metrics_key = 'save_metrics' diff --git a/cravat/cravat_admin.py b/cravat/cravat_admin.py index 10872811..d0ee16d9 100644 --- a/cravat/cravat_admin.py +++ b/cravat/cravat_admin.py @@ -408,9 +408,7 @@ def publish_module (args): au.publish_module(args.module, args.user, args.password, overwrite=args.overwrite, include_data=args.data) def install_base (args): - sys_conf = au.get_system_conf() - base_modules = sys_conf.get(constants.base_modules_key,[]) - args = SimpleNamespace(modules=base_modules, + args = SimpleNamespace(modules=constants.base_modules, force_data=args.force_data, version=None, yes=True, diff --git a/cravat/webstore/webstore.py b/cravat/webstore/webstore.py index 869202f7..0a553449 100644 --- a/cravat/webstore/webstore.py +++ b/cravat/webstore/webstore.py @@ -250,9 +250,7 @@ async def queue_install (request): return web.Response(text = 'queued ' + queries['module']) async def get_base_modules (request): - global system_conf - base_modules = system_conf['base_modules'] - return web.json_response(base_modules) + return web.json_response(constants.base_modules) async def install_base_modules (request): global servermode @@ -261,8 +259,7 @@ async def install_base_modules (request): if r == False: response = 'failed' return web.json_response(response) - base_modules = system_conf.get(constants.base_modules_key,[]) - for module in base_modules: + for module in constants.base_modules: install_queue.put({'module': module, 'version': None}) response = 'queued' return web.json_response(response)