From b9801d778fa5ccf224bff8dc977f8d2d6757ba8d Mon Sep 17 00:00:00 2001 From: Eva Holtkamp Date: Mon, 21 Oct 2024 12:15:42 +0200 Subject: [PATCH 1/2] skip seak association testing if all burdens are constant --- deeprvat/deeprvat/associate.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/deeprvat/deeprvat/associate.py b/deeprvat/deeprvat/associate.py index a19721bd..09fd0f51 100644 --- a/deeprvat/deeprvat/associate.py +++ b/deeprvat/deeprvat/associate.py @@ -1151,7 +1151,10 @@ def regress_on_gene_scoretest( if np.all(np.abs(burdens) < 1e-6): logger.warning(f"Burden for gene {gene} is 0 for all samples; skipping") return None - + + if np.unique(burdens).shape[0] == 1: + logger.warning(f"Burdens for gene {gene} are all constant; skipping") + return None pv = model_score.pv_alt_model(burdens) logger.info(f"p-value: {pv}") From a325f7c290b182b8cdb60c7db587a5329c44be19 Mon Sep 17 00:00:00 2001 From: PMBio Date: Mon, 21 Oct 2024 10:20:53 +0000 Subject: [PATCH 2/2] fixup! Format Python code with psf/black pull_request --- deeprvat/deeprvat/associate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deeprvat/deeprvat/associate.py b/deeprvat/deeprvat/associate.py index 09fd0f51..e1f64fdc 100644 --- a/deeprvat/deeprvat/associate.py +++ b/deeprvat/deeprvat/associate.py @@ -1151,7 +1151,7 @@ def regress_on_gene_scoretest( if np.all(np.abs(burdens) < 1e-6): logger.warning(f"Burden for gene {gene} is 0 for all samples; skipping") return None - + if np.unique(burdens).shape[0] == 1: logger.warning(f"Burdens for gene {gene} are all constant; skipping") return None