scout/commands/load/panel.py
def panel(context, path, date, display_name, version, panel_type, panel_id, institute, omim, api_key, panel_app):
    """Add a gene panel to the database."""

    adapter = context.obj['adapter']
    institute = institute or 'cust000'

    if omim:
        api_key = api_key or context.obj.get('omim_api_key')
        if not api_key:
            LOG.warning("Please provide a omim api key to load the omim gene panel")
            context.abort()
        #Check if OMIM-AUTO exists
        if adapter.gene_panel(panel_id='OMIM-AUTO'):
            LOG.warning("OMIM-AUTO already exists in database")
            LOG.info("To create a new version use scout update omim")
            return

        # Here we know that there is no panel loaded
        try:
            adapter.load_omim_panel(api_key, institute=institute)
        except Exception as err:
            LOG.error(err)
            context.abort()
    
    if panel_app:
        # try:
        load_panel_app(adapter, panel_id, institute=institute)
        # except Exception as err:
        #     LOG.warning(err)
        #     context.abort()

    if (omim or panel_app):
        return

    if path is None:
        LOG.info("Please provide a panel")
        return
    try:
        load_panel(path, adapter, date, display_name, version, panel_type, panel_id, institute)
    except Exception as err:
        LOG.warning(err)
        context.abort()
def panel(context, path, date, display_name, version, panel_type, panel_id, institute, omim, api_key, panel_app):
    """Add a gene panel to the database."""

    adapter = context.obj['adapter']
    institute = institute or 'cust000'

    if omim:
        api_key = api_key or context.obj.get('omim_api_key')
        if not api_key:
            LOG.warning("Please provide a omim api key to load the omim gene panel")
            context.abort()
        #Check if OMIM-AUTO exists
        if adapter.gene_panel(panel_id='OMIM-AUTO'):
            LOG.warning("OMIM-AUTO already exists in database")
            LOG.info("To create a new version use scout update omim")
            return

        # Here we know that there is no panel loaded
        try:
            adapter.load_omim_panel(api_key, institute=institute)
        except Exception as err:
            LOG.error(err)
            context.abort()
    
    if panel_app:
        # try:
        load_panel_app(adapter, panel_id, institute=institute)
        # except Exception as err:
        #     LOG.warning(err)
        #     context.abort()

    if (omim or panel_app):
        return

    if path is None:
        LOG.info("Please provide a panel")
        return
    try:
        load_panel(path, adapter, date, display_name, version, panel_type, panel_id, institute)
    except Exception as err:
        LOG.warning(err)
        context.abort()
Add a gene panel to the database.