From 064ce5b42a8f711fb4d8107150aad2d382ae99c2 Mon Sep 17 00:00:00 2001 From: Nikhil Kumar Date: Tue, 18 Jun 2024 14:46:43 -0400 Subject: [PATCH] handle NA values for cellularity --- .../msk/phylowgs/parsecnvs/resources/usr/bin/parse_cnvs.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/msk/phylowgs/parsecnvs/resources/usr/bin/parse_cnvs.py b/modules/msk/phylowgs/parsecnvs/resources/usr/bin/parse_cnvs.py index 848acf33..bd3f0fd9 100755 --- a/modules/msk/phylowgs/parsecnvs/resources/usr/bin/parse_cnvs.py +++ b/modules/msk/phylowgs/parsecnvs/resources/usr/bin/parse_cnvs.py @@ -107,9 +107,10 @@ def calc_cellularity(self): with open(self._fc_filename) as facetf: reader = csv.DictReader(facetf, dialect="excel-tab") for record in reader: - cellularity = float(record["cf.em"]) - if cellularity < 1: - max_cellularity = max(max_cellularity, cellularity) + if record["cf.em"] != "NA": + cellularity = float(record["cf.em"]) + if cellularity < 1: + max_cellularity = max(max_cellularity, cellularity) if max_cellularity > 0: self._cellularity = max_cellularity else: