<commit_before># -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from pkg_resources import load_entry_point

import click
from path import path

from .utils import list_interfaces
from ..miner import Miner

ROOT_PACKAGE = __package__.split('.')[0]


@click.command()
@click.option('-r', '--render', type=click.Choice(list_interfaces()),
              default='tabular')
@click.option('-s', '--samples', type=str, multiple=True)
@click.option('-g', '--group', type=str)
@click.option('-l', '--language', type=click.Choice(['en', 'sv']))
@click.option('--human', is_flag=True, help='Make output more human readable')
@click.option('-p', '--panel', type=click.File('r', encoding='utf-8'),
              help='Gene panel file with (superblock) IDs')
@click.option('-n', '--panel-name', type=str, help='Name of gene panel')
@click.pass_context
def report(context, render, language, samples, group, human, panel,
           panel_name):
  """Generate a coverage report from Chanjo SQL output."""
  # get uri + dialect of Chanjo database
  uri, dialect = context.obj.get('db'), context.obj.get('dialect')

  # guess name of gene panel unless explicitly set
  name_of_panel = panel_name or path(panel.name).basename().splitext()[0]

  # set the custom option
  context.obj.set('report.human', human)
  context.obj.set('report.panel', panel)
  context.obj.set('report.panel_name', name_of_panel)
  context.obj.set('report.samples', samples)
  context.obj.set('report.group', group)<commit_msg>fix: gene panel is optional (CLI)<commit_after># -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from pkg_resources import load_entry_point

import click
from path import path

from .utils import list_interfaces
from ..miner import Miner

ROOT_PACKAGE = __package__.split('.')[0]


@click.command()
@click.option('-r', '--render', type=click.Choice(list_interfaces()),
              default='tabular')
@click.option('-s', '--samples', type=str, multiple=True)
@click.option('-g', '--group', type=str)
@click.option('-l', '--language', type=click.Choice(['en', 'sv']))
@click.option('--human', is_flag=True, help='Make output more human readable')
@click.option('-p', '--panel', type=click.File('r', encoding='utf-8'),
              help='Gene panel file with (superblock) IDs')
@click.option('-n', '--panel-name', type=str, help='Name of gene panel')
@click.pass_context
def report(context, render, language, samples, group, human, panel,
           panel_name):
  """Generate a coverage report from Chanjo SQL output."""
  # get uri + dialect of Chanjo database
  uri, dialect = context.obj.get('db'), context.obj.get('dialect')

  # guess name of gene panel unless explicitly set
  if panel:
    name_of_panel = panel_name or path(panel.name).basename().splitext()[0]

  # set the custom option
  context.obj.set('report.human', human)
  context.obj.set('report.panel', panel)
  context.obj.set('report.panel_name', name_of_panel)
  context.obj.set('report.samples', samples)
  context.obj.set('report.group', group)
{'fraction_non_alphanumeric': 0.17036553524804177, 'fraction_numerical': 0.0026109660574412533, 'mean_word_length': 4.654981549815498, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2948474', 'n_tokens_mistral': 981, 'n_tokens_neox': 958, 'n_words': 250}