Skip to content

Commit

Permalink
address comments by CO and SA
Browse files Browse the repository at this point in the history
  • Loading branch information
diitaz93 committed Jul 26, 2024
1 parent c173235 commit f73d6b8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
7 changes: 4 additions & 3 deletions cg/services/post_processing/abstract_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ def get_files_to_store(self, run_data: RunData) -> list[Path]:

class PostProcessingMetricsParser(ABC):

@staticmethod
@abstractmethod
def parse_metrics(metrics_files: list[Path]) -> RunMetrics:
def __init__(self, file_manager: RunFileManager):
self.file_manager: RunFileManager = file_manager

def parse_metrics(self, run_data: RunData) -> RunMetrics:
pass


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,21 @@
from cg.services.post_processing.pacbio.metrics_parser.utils import (
get_parsed_metrics_from_file_name,
)
from cg.services.post_processing.pacbio.run_data_generator.run_data import PacBioRunData
from cg.services.post_processing.pacbio.run_file_manager.run_file_manager import (
PacBioRunFileManager,
)


class PacBioMetricsParser(PostProcessingMetricsParser):
"""Class for parsing PacBio sequencing metrics."""

@staticmethod
def parse_metrics(metrics_files: list[Path]) -> PacBioMetrics:
def __init__(self, file_manager: PacBioRunFileManager):
super().__init__(file_manager=file_manager)

def parse_metrics(self, run_data: PacBioRunData) -> PacBioMetrics:
"""Return all the relevant PacBio metrics parsed in a single Pydantic object."""
metrics_files: list[Path] = self.file_manager.get_files_to_parse(run_data)
hifi_metrics: HiFiMetrics = get_parsed_metrics_from_file_name(
metrics_files=metrics_files, file_name=PacBioDirsAndFiles.BASECALLING_REPORT
)
Expand Down

0 comments on commit f73d6b8

Please sign in to comment.