Skip to content
This repository has been archived by the owner on Jul 18, 2023. It is now read-only.

Commit

Permalink
Include ext_pos_dna_missing, ext_pos_dna_positive, ext_pos_rna_rt_mis…
Browse files Browse the repository at this point in the history
…sing, and ext_pos_rna_rta_positive values in the PCRReplicate invalid_reasons array
  • Loading branch information
aaronstephenson committed Jun 12, 2019
1 parent 1776a0f commit ade38c4
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion code.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "lide",
"organization": "U.S. Geological Survey",
"description": "Web services for LILI (LIDE (Laboratory for Infectious Disease and the Environment) Information Management System)",
"version": "v0.104.1",
"version": "v0.104.2",
"status": "Release Candidate",

"permissions": {
Expand Down
26 changes: 26 additions & 0 deletions lideservices/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1081,6 +1081,30 @@ def invalid_reasons(self):
else:
reasons["peg_neg_missing"] = False
reasons["peg_neg_missing_replicates"] = ""
if pcrreplicate_batch.extraction_batch.ext_pos_dna_cq_value is None:
reasons["ext_pos_dna_missing"] = True
else:
reasons["ext_pos_dna_missing"] = False
if (pcrreplicate_batch.extraction_batch.ext_pos_dna_cq_value is not None
and pcrreplicate_batch.extraction_batch.ext_pos_dna_cq_value > Decimal('0')):
reasons["ext_pos_dna_positive"] = True
else:
reasons["ext_pos_dna_positive"] = False
# ext_pos_rt_rna_positive is a special case that only applies if the target of the pcrreplicate_batch is RNA
if pcrreplicate_batch.target.nucleic_acid_type.name == 'RNA':
rt = ReverseTranscription.objects.filter(
extraction_batch=pcrreplicate_batch.extraction_batch.id, re_rt=None).first()
if rt.ext_pos_rna_rt_cq_value is None:
reasons["ext_pos_rna_rt_missing"] = True
else:
reasons["ext_pos_rna_rt_missing"] = False
if rt.ext_pos_rna_rt_cq_value is not None and rt.ext_pos_rna_rt_cq_value > Decimal('0'):
reasons["ext_pos_rna_rt_positive"] = True
else:
reasons["ext_pos_rna_rta_positive"] = False
else:
reasons["ext_pos_rna_rt_missing"] = False
reasons["ext_pos_rna_rta_positive"] = False
if pcrreplicate_batch.ext_neg_cq_value is None:
reasons["ext_neg_missing"] = True
else:
Expand Down Expand Up @@ -1121,6 +1145,8 @@ def invalid_reasons(self):
else:
reasons = {
"peg_neg_invalid": False, "peg_neg_missing_replicates": False,
"ext_pos_dna_missing": False, "ext_pos_dna_positive": False,
"ext_pos_rna_rt_missing": False, "ext_pos_rna_rt_positive": False,
"ext_neg_missing": False, "ext_neg_positive": False,
"rt_neg_missing": False, "rt_neg_positive": False,
"pcr_neg_missing": False, "pcr_neg_positive": False,
Expand Down

0 comments on commit ade38c4

Please sign in to comment.