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

Clinical-Genomics / cg / 11237273489

08 Oct 2024 02:09PM UTC coverage: 84.465%. First build
11237273489

Pull #3818

github

web-flow
Merge 25d0d263a into 94fa764b0
Pull Request #3818: add cli command post process all

35 of 53 new or added lines in 5 files covered. (66.04%)

22880 of 27088 relevant lines covered (84.47%)

0.84 hits per line

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

67.74
/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_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, PostProcessingServices
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
    services: PostProcessingServices = context.post_processing_services
×
NEW
44
    are_all_services_successful: bool = True
×
NEW
45
    for service in [services.pacbio]:
×
NEW
46
        is_service_successful: bool = service.post_process_all(dry_run=dry_run)
×
NEW
47
        are_all_services_successful = are_all_services_successful and is_service_successful
×
NEW
48
    if not are_all_services_successful:
×
NEW
49
        raise click.Abort
×
50

51

52
post_process_group.add_command(post_process_run)
1✔
53
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