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

Clinical-Genomics / cg / 11324534123

14 Oct 2024 09:14AM UTC coverage: 83.091%. First build
11324534123

Pull #3841

github

web-flow
Merge 232ad2057 into 9f13f37f4
Pull Request #3841: post process all runs calling service over a list of run names

49 of 73 new or added lines in 7 files covered. (67.12%)

19130 of 23023 relevant lines covered (83.09%)

0.99 hits per line

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

60.0
/cg/cli/post_process/post_process.py
1
"""CLI commands to post-process a sequencing run."""
2

3
import logging
1✔
4

5
import click
1✔
6

7
from cg.cli.post_process.utils import get_all_run_names, get_post_processing_service_from_run_name
1✔
8
from cg.cli.utils import CLICK_CONTEXT_SETTINGS
1✔
9
from cg.constants.cli_options import DRY_RUN
1✔
10
from cg.models.cg_config import CGConfig
1✔
11
from cg.services.run_devices.abstract_classes import PostProcessingService
1✔
12

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

15

16
@click.group(name="post-process", context_settings=CLICK_CONTEXT_SETTINGS)
1✔
17
def post_process_group():
1✔
18
    """Post-process sequencing runs from the sequencing instruments."""
19
    LOG.info("Running cg post-processing.")
×
20

21

22
@post_process_group.command(name="run")
1✔
23
@DRY_RUN
1✔
24
@click.argument("run-name")
1✔
25
@click.pass_obj
1✔
26
def post_process_run(context: CGConfig, run_name: str, dry_run: bool) -> None:
1✔
27
    """Post-process a sequencing run from the PacBio instrument.
28

29
    run-name is the full name of the sequencing unit of run. For example:
30
        PacBio: 'r84202_20240522_133539/1_A01'
31
    """
32
    post_processing_service: PostProcessingService = get_post_processing_service_from_run_name(
×
33
        context=context, run_name=run_name
34
    )
35
    post_processing_service.post_process(run_name=run_name, dry_run=dry_run)
×
36

37

38
@post_process_group.command(name="all")
1✔
39
@DRY_RUN
1✔
40
@click.pass_obj
1✔
41
def post_process_all_runs(context: CGConfig, dry_run: bool) -> None:
1✔
42
    """Post-process all runs from the instruments."""
NEW
43
    exit_success: bool = True
×
NEW
44
    run_names: list[str] = get_all_run_names(context=context)
×
NEW
45
    for run_name in run_names:
×
NEW
46
        try:
×
NEW
47
            post_processing_service: PostProcessingService = (
×
48
                get_post_processing_service_from_run_name(context=context, run_name=run_name)
49
            )
NEW
50
            post_processing_service.post_process(run_name=run_name, dry_run=dry_run)
×
NEW
51
        except Exception as error:
×
NEW
52
            LOG.error(f"{error}")
×
NEW
53
            exit_success = False
×
NEW
54
    if not exit_success:
×
NEW
55
        raise click.Abort
×
56

57

58
post_process_group.add_command(post_process_run)
1✔
59
post_process_group.add_command(post_process_all_runs)
1✔
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