Skip to content

Commit

Permalink
add normalization for contamination and completeness
Browse files Browse the repository at this point in the history
  • Loading branch information
mbthornton-lbl committed Nov 15, 2024
1 parent 9cdda69 commit 98d4322
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 5 additions & 0 deletions nmdc_automation/models/nmdc.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ def _normalize_mags_record(record: Dict[str, Any]) -> Dict[str, Any]:
# add type to eukaryotic_evaluation if it exists
if "eukaryotic_evaluation" in mag:
record["mags_list"][i]["eukaryotic_evaluation"]["type"] = "nmdc:EukEval"
# conpleteness and contamination need to be converted from string to float
if "completeness" in mag["eukaryotic_evaluation"]:
record["mags_list"][i]["eukaryotic_evaluation"]["completeness"] = float(mag["eukaryotic_evaluation"]["completeness"])
if "contamination" in mag["eukaryotic_evaluation"]:
record["mags_list"][i]["eukaryotic_evaluation"]["contamination"] = float(mag["eukaryotic_evaluation"]["contamination"])
# gene count should be a positive integer - remove if 'null'
if "gene_count" in mag and mag["gene_count"] == "null":
mag.pop("gene_count")
Expand Down
1 change: 0 additions & 1 deletion nmdc_automation/workflow_automation/watch_nmdc.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,6 @@ def cycle(self):
)
if validation_report.results:
logger.error(f"Validation error: {validation_report.results[0].message}")
logger.error(job_dict)
continue

# post workflow execution and data objects to the runtime api
Expand Down

0 comments on commit 98d4322

Please sign in to comment.