From 0a6a863acccbec9ca4e4f4bdd72e44ff97dd4033 Mon Sep 17 00:00:00 2001 From: Omer Weissbrod Date: Tue, 5 Mar 2024 22:20:37 +0200 Subject: [PATCH] Add clear error when HESS-estimated prior-var is >=1 --- finemapper.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/finemapper.py b/finemapper.py index 9d450b9..8f4dc70 100644 --- a/finemapper.py +++ b/finemapper.py @@ -782,6 +782,8 @@ def finemap(self, locus_start, locus_end, num_causal_snps, use_prior_causal_prob prior_var = h2_hess / num_causal_snps if prior_var <= 0: raise ValueError('HESS estimates that the locus causally explains zero heritability') + if prior_var >= 1: + raise ValueError('HESS-estimated prior-var >1. The HESS estimator cannot be used in this locus.') logging.info('HESS estimated causal effect size variance: %0.4e'%(prior_var)) if hess_resvar: