• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Clinical-Genomics / cg / 11890272117

18 Nov 2024 10:14AM UTC coverage: 84.467%. First build
11890272117

Pull #3926

github

web-flow
Merge a7149a3a7 into 40c89d2a7
Pull Request #3926: Refactor get cases for analysis

13 of 14 new or added lines in 3 files covered. (92.86%)

23416 of 27722 relevant lines covered (84.47%)

0.84 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

72.97
/cg/cli/workflow/raw_data/base.py
1
import logging
1✔
2

3
import click
1✔
4

5
from cg.cli.utils import CLICK_CONTEXT_SETTINGS
1✔
6
from cg.cli.workflow.commands import ARGUMENT_CASE_ID
1✔
7
from cg.cli.workflow.raw_data.raw_data_service import RawDataAnalysisService
1✔
8
from cg.constants.cli_options import DRY_RUN
1✔
9
from cg.constants.constants import Workflow
1✔
10
from cg.meta.workflow.analysis import AnalysisAPI
1✔
11
from cg.services.sequencing_qc_service import SequencingQCService
1✔
12
from cg.store.store import Store
1✔
13

14
LOG = logging.getLogger(__name__)
1✔
15

16

17
@click.group(invoke_without_command=True, context_settings=CLICK_CONTEXT_SETTINGS)
1✔
18
@click.pass_context
1✔
19
def raw_data(context: click.Context):
1✔
20
    """Function for storing raw-data-cases"""
21
    AnalysisAPI.get_help(context)
×
22

23

24
@raw_data.command("store")
1✔
25
@DRY_RUN
1✔
26
@ARGUMENT_CASE_ID
1✔
27
@click.pass_context
1✔
28
def store_raw_data_analysis(context: click.Context, case_id: str, dry_run: bool = False):
1✔
29
    LOG.info(f"Creating an analysis for case {case_id}")
1✔
30

31
    if dry_run:
1✔
32
        return
×
33

34
    raw_data_service = RawDataAnalysisService(
1✔
35
        store=context.obj.status_db,
36
        trailblazer_api=context.obj.trailblazer_api,
37
    )
38
    raw_data_service.store_analysis(case_id)
1✔
39

40

41
@raw_data.command("store-available")
1✔
42
@DRY_RUN
1✔
43
@click.pass_context
1✔
44
def store_available_raw_data_analysis(context: click.Context, dry_run: bool = False):
1✔
45
    """Creates an analysis object in status-db for all raw data cases to be delivered."""
46
    status_db: Store = context.obj.status_db
×
NEW
47
    for case in status_db.get_cases_to_analyse(workflow=Workflow.RAW_DATA):
×
48
        LOG.info(f"Creating an analysis for case {case.internal_id}")
×
49
        if SequencingQCService.case_pass_sequencing_qc(case):
×
50
            if dry_run:
×
51
                return
×
52
            raw_data_service = RawDataAnalysisService(
×
53
                store=context.obj.status_db,
54
                trailblazer_api=context.obj.trailblazer_api,
55
            )
56
            raw_data_service.store_analysis(case.internal_id)
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc