Skip to content

Commit

Permalink
added more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Karl-Svard committed Mar 15, 2024
1 parent 51b52c5 commit 96d1f57
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions cg_lims/EPPs/udf/calculate/qpcr_dilution.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,16 @@ def set_artifact_udfs(
molar_concentration = self.get_concentration(
cq_threshold=float(replicate_threshold), size_bp=int(size_bp)
)
self.artifact.qc_flag = "FAILED"
self.artifact.qc_flag = "PASSED"
self.artifact.udf["Size (bp)"] = int(size_bp)
self.artifact.udf["Concentration"] = molar_concentration
self.artifact.udf["Concentration (nM)"] = molar_concentration * 10**9
if self.artifact.udf["Concentration (nM)"] > concentration_threshold:
self.artifact.qc_flag = "PASSED"
if self.artifact.udf["Concentration (nM)"] < concentration_threshold:
self.artifact.qc_flag = "FAILED"
LOG.info(
f" Concentration of {self.artifact.samples[0].id} is {molar_concentration * 10**9} nM."
f" Setting QC flag to failed as this is below the threshold of {concentration_threshold} nM."
)
self.artifact.put()


Expand Down Expand Up @@ -153,7 +157,9 @@ def qpcr_dilution(
failed_samples += 1

if failed_samples:
error_message = f"{failed_samples} failed the QC! See the logs for further information."
error_message = (
f"{failed_samples} sample(s) failed the QC! See the logs for further information."
)
LOG.error(error_message)
raise FailingQCError(error_message)

Expand Down

0 comments on commit 96d1f57

Please sign in to comment.