From 51735462d495082c5a92e01e670f3ad9bcbe37cf Mon Sep 17 00:00:00 2001 From: Alexander Berger Date: Tue, 24 Sep 2024 11:07:10 -0400 Subject: [PATCH] Fix geneset has no hom_ids KeyError --- pyproject.toml | 2 +- src/application.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 28bc1dc8..bf9abf73 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "geneweaver-legacy" -version = "1.4.6" +version = "1.4.7" description = "" authors = ["Alexander Berger "] readme = "README.md" diff --git a/src/application.py b/src/application.py index ca5a89b7..16f5a80e 100644 --- a/src/application.py +++ b/src/application.py @@ -3226,7 +3226,8 @@ def calculate_jaccard(gs_id, genesets): gs1 = geneweaverdb.get_geneset_hom_ids(gs_id) gs2s = geneweaverdb.get_genesets_hom_ids(genesets) for g in genesets: - jaccards[g] = jaccard(gs1, gs2s[g]) + if g in gs2s: + jaccards[g] = jaccard(gs1, gs2s[g]) return jaccards