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

Clinical-Genomics / cg / 11294476725

11 Oct 2024 02:48PM UTC coverage: 83.512%. First build
11294476725

Pull #3832

github

web-flow
Merge 3043d180d into 560003d27
Pull Request #3832: feat - new post process all command

48 of 81 new or added lines in 7 files covered. (59.26%)

20295 of 24302 relevant lines covered (83.51%)

0.94 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_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, RunDirectoryNamesServices
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
    names_services: RunDirectoryNamesServices = context.run_directory_names_services
×
NEW
45
    are_all_services_successful: bool = True
×
NEW
46
    for service, name_service in [(services.pacbio, names_services.pacbio)]:
×
NEW
47
        try:
×
NEW
48
            service.post_process_all(
×
49
                run_directory_names=name_service.get_run_names(), dry_run=dry_run
50
            )
NEW
51
        except Exception as error:
×
NEW
52
            LOG.error(f"{error}")
×
NEW
53
            are_all_services_successful = False
×
NEW
54
    if not are_all_services_successful:
×
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

© 2025 Coveralls, Inc