Skip to content

Commit

Permalink
add exception
Browse files Browse the repository at this point in the history
  • Loading branch information
Karl-Svard committed Mar 15, 2024
1 parent 662770b commit cd846d9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cg_lims/EPPs/udf/calculate/qpcr_dilution.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import pandas as pd
from cg_lims import options
from cg_lims.EPPs.udf.calculate.constants import WELL_TRANSFORMER
from cg_lims.exceptions import FailingQCError, LimsError, MissingFileError
from cg_lims.exceptions import FailingQCError, LimsError, MissingFileError, MissingValueError
from cg_lims.get.artifacts import get_artifact_by_name, get_artifacts
from cg_lims.get.files import get_file_path
from genologics.entities import Artifact, Process
Expand Down Expand Up @@ -146,6 +146,12 @@ def qpcr_dilution(
quantification_data = parse_quantification_summary(summary_file=file_path)
failed_samples = 0
for artifact in artifacts:
artifact_well = artifact.location[1]
if artifact_well not in quantification_data.keys():
raise MissingValueError(
f"No values found for well {artifact_well} in the result file! "
f"Please double check if sample {artifact.samples[0].id} has been placed correctly."
)
well_results: WellValues = quantification_data[artifact.location[1]]
well_results.connect_artifact(artifact=artifact)
well_results.set_artifact_udfs(
Expand Down

0 comments on commit cd846d9

Please sign in to comment.