aboutsummaryrefslogtreecommitdiff
path: root/gn3/db
diff options
context:
space:
mode:
Diffstat (limited to 'gn3/db')
-rw-r--r--gn3/db/traits.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/gn3/db/traits.py b/gn3/db/traits.py
index d315eb9..8ba8a53 100644
--- a/gn3/db/traits.py
+++ b/gn3/db/traits.py
@@ -2,6 +2,7 @@
to the published database"""
from typing import Any, Dict, Optional
from dataclasses import dataclass
+from typing import Optional
@dataclass(frozen=True)
@@ -14,6 +15,24 @@ BXD
r_id: int
+@dataclass(frozen=True)
+class webqtlCaseData:
+ """Class for keeping track of one case data in one trait"""
+ value: Optional[float] = None
+ variance: Optional[float] = None
+ count: Optional[int] = None # Number of Individuals
+
+ def __str__(self):
+ _str = ""
+ if self.value:
+ _str += f"value={self.value:.3f}"
+ if self.variance:
+ _str += f" variance={self.variance:.3f}"
+ if self.count:
+ _str += " n_data={self.count}"
+ return _str
+
+
def get_riset(data_type: str, name: str, conn: Any):
query, _name, _id = None, None, None
if data_type == "Publish":