From 8fb4e48d7d1b36f9de3197f8e8fc26d6c745c839 Mon Sep 17 00:00:00 2001 From: ChristopherMancuso Date: Mon, 25 Nov 2024 15:38:08 -0500 Subject: [PATCH] added error for Mondo in not human --- geneplexus/exception.py | 4 ++++ geneplexus/geneplexus.py | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/geneplexus/exception.py b/geneplexus/exception.py index ddea587..86ef3f8 100644 --- a/geneplexus/exception.py +++ b/geneplexus/exception.py @@ -4,6 +4,10 @@ class FlyMonarchError(Exception): """Raised becasue no Monarch annotations for Fly.""" + +class MondoError(Exception): + """Raised becasue no Mondo only has annotations for Human.""" + class ZebrafishBioGRIDError(Exception): """Raised becuse BioGRID doesn't have a good Zebrafish network.""" diff --git a/geneplexus/geneplexus.py b/geneplexus/geneplexus.py index abaabcf..b5b6600 100755 --- a/geneplexus/geneplexus.py +++ b/geneplexus/geneplexus.py @@ -18,6 +18,7 @@ from ._config.logger_util import set_stream_level from .download import download_select_data from .exception import FlyMonarchError +from .exception import MondoError from .exception import NoPositivesError from .exception import ZebrafishBioGRIDError @@ -105,6 +106,11 @@ def __init__( raise FlyMonarchError( f"Fly has no annotations for Monarch. Use either Combined or GO for GSC", ) + + if (self.sp_trn != "Human" and self.gsc_trn == "Mondo") or (self.sp_res != "Human" and self.gsc_res == "Mondo"): + raise MondoError( + f"Mondo only has annotations for Human", + ) if self.gsc_trn == "Combined": logger.info(