Skip to content

Commit

Permalink
Patch comparison for q30 threshold (#424)(patch)
Browse files Browse the repository at this point in the history
### Fixed
- Q30 score values used in sequencing QC functions.
  • Loading branch information
seallard authored Aug 17, 2023
1 parent 357392a commit 53474b2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions cg_lims/EPPs/qc/sequencing_quality_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def _update_sample_with_quality_results(
sample_id=metrics.sample_internal_id,
lane=metrics.flow_cell_lane_number,
reads=metrics.sample_total_reads_in_lane,
q30_score=metrics.sample_base_fraction_passing_q30,
q30_score=metrics.sample_base_fraction_passing_q30 * 100,
passed_quality_control=passed_quality_control,
)

Expand All @@ -75,7 +75,7 @@ def _quality_control(self, metrics: SampleLaneSequencingMetrics) -> bool:

def _passes_quality_thresholds(self, q30_score: float, reads: int) -> bool:
"""Check if the provided metrics pass the minimum quality thresholds."""
passes_q30_threshold = q30_score >= self.q30_threshold
passes_q30_threshold = q30_score * 100 >= self.q30_threshold
passes_read_threshold = reads >= self.READS_MIN_THRESHOLD
return passes_q30_threshold and passes_read_threshold

Expand Down
10 changes: 5 additions & 5 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ def novaseq_metrics_passing_thresholds_json(
sample_ids=novaseq_sample_ids,
lanes=novaseq_lanes,
total_reads_in_lane=10000,
base_fraction_passing_q30=100,
base_fraction_passing_q30=0.95,
)


Expand All @@ -315,7 +315,7 @@ def novaseq_metrics_failing_reads_json(
sample_ids=novaseq_sample_ids,
lanes=novaseq_lanes,
total_reads_in_lane=0,
base_fraction_passing_q30=100,
base_fraction_passing_q30=0.95,
)


Expand All @@ -328,7 +328,7 @@ def novaseq_metrics_two_failing(
sample_ids=novaseq_sample_ids,
lanes=novaseq_lanes,
total_reads_in_lane=10000,
base_fraction_passing_q30=100,
base_fraction_passing_q30=0.95,
)

metrics[0]["sample_base_fraction_passing_q30"] = 0
Expand Down Expand Up @@ -365,7 +365,7 @@ def novaseq_metrics_missing_for_sample_in_lane(
sample_ids=novaseq_sample_ids,
lanes=novaseq_lanes,
total_reads_in_lane=10000,
base_fraction_passing_q30=100,
base_fraction_passing_q30=0.95,
)
for metric in metrics:
if (
Expand All @@ -390,7 +390,7 @@ def novaseq_missing_sample(
sample_ids=novaseq_sample_ids,
lanes=novaseq_lanes,
total_reads_in_lane=10000,
base_fraction_passing_q30=100,
base_fraction_passing_q30=0.95,
)
return metrics

Expand Down

0 comments on commit 53474b2

Please sign in to comment.