aboutsummaryrefslogtreecommitdiff
path: root/gn2/wqflask/correlation/exceptions.py
blob: f4e2b72b506a63d673549b310f074348c524c27f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
"""Correlation-Specific Exceptions"""

class WrongCorrelationType(Exception):
    """Raised when a correlation is requested for incompatible datasets."""

    def __init__(self, trait, target_dataset, corr_method):
        corr_method = {
            "lit": "Literature",
            "tissue": "Tissue"
        }[corr_method]
        message = (
            f"It is not possible to compute the '{corr_method}' correlations "
            f"between trait '{trait.name}' and the data in the "
            f"'{target_dataset.fullname}' dataset. "
            "Please try again after selecting another type of correlation.")
        super().__init__(message)