from cg.apps.sequencing_metrics_parser.models.bcl2fastq_metrics import Bcl2FastqSequencingMetrics


def parse_bcl2fastq_sequencing_metrics(
    stats_json_path: str,
) -> Bcl2FastqSequencingMetrics:
    """Parse the stats.json file generated by the demultiplexing software Bcl2fastq."""
    sequencing_metrics: Bcl2FastqSequencingMetrics = Bcl2FastqSequencingMetrics.parse_file(
        stats_json_path
    )
    return sequencing_metrics
