Skip to content

Commit

Permalink
move base_modules to constants and add hgvs-converter
Browse files Browse the repository at this point in the history
  • Loading branch information
kmoad committed May 9, 2024
1 parent 819760d commit df83927
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 9 deletions.
29 changes: 28 additions & 1 deletion cravat/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
4 changes: 1 addition & 3 deletions cravat/cravat_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
7 changes: 2 additions & 5 deletions cravat/webstore/webstore.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit df83927

Please sign in to comment.