aboutsummaryrefslogtreecommitdiff
path: root/wqflask/base/webqtlCaseData.py
diff options
context:
space:
mode:
Diffstat (limited to 'wqflask/base/webqtlCaseData.py')
-rw-r--r--wqflask/base/webqtlCaseData.py48
1 files changed, 23 insertions, 25 deletions
diff --git a/wqflask/base/webqtlCaseData.py b/wqflask/base/webqtlCaseData.py
index d8487f01..25b6cb8a 100644
--- a/wqflask/base/webqtlCaseData.py
+++ b/wqflask/base/webqtlCaseData.py
@@ -19,8 +19,7 @@
# This module is used by GeneNetwork project (www.genenetwork.org)
#
# Created by GeneNetwork Core Team 2010/08/10
-#
-# Last updated by GeneNetwork Core Team 2010/10/20
+
from utility.logger import getLogger
logger = getLogger(__name__)
@@ -29,58 +28,57 @@ import utility.tools
utility.tools.show_settings()
-class webqtlCaseData(object):
+
+class webqtlCaseData:
"""one case data in one trait"""
def __init__(self, name, value=None, variance=None, num_cases=None, name2=None):
self.name = name
- self.name2 = name2 # Other name (for traits like BXD65a)
+ # Other name (for traits like BXD65a)
+ self.name2 = name2
self.value = value # Trait Value
self.variance = variance # Trait Variance
self.num_cases = num_cases # Number of individuals/cases
self.extra_attributes = None
- self.this_id = None # Set a sane default (can't be just "id" cause that's a reserved word)
+ # Set a sane default (can't be just "id" cause that's a reserved word)
+ self.this_id = None
self.outlier = None # Not set to True/False until later
def __repr__(self):
- str = "<webqtlCaseData> "
- if self.value != None:
- str += "value=%2.3f" % self.value
- if self.variance != None:
- str += " variance=%2.3f" % self.variance
+ case_data_string = "<webqtlCaseData> "
+ if self.value is not None:
+ case_data_string += "value=%2.3f" % self.value
+ if self.variance is not None:
+ case_data_string += " variance=%2.3f" % self.variance
if self.num_cases:
- str += " ndata=%s" % self.num_cases
+ case_data_string += " ndata=%s" % self.num_cases
if self.name:
- str += " name=%s" % self.name
+ case_data_string += " name=%s" % self.name
if self.name2:
- str += " name2=%s" % self.name2
- return str
+ case_data_string += " name2=%s" % self.name2
+ return case_data_string
@property
def class_outlier(self):
"""Template helper"""
if self.outlier:
return "outlier"
- else:
- return ""
+ return ""
@property
def display_value(self):
- if self.value != None:
+ if self.value is not None:
return "%2.3f" % self.value
- else:
- return "x"
+ return "x"
@property
def display_variance(self):
- if self.variance != None:
+ if self.variance is not None:
return "%2.3f" % self.variance
- else:
- return "x"
+ return "x"
@property
def display_num_cases(self):
- if self.num_cases != None:
+ if self.num_cases is not None:
return "%s" % self.num_cases
- else:
- return "x"
+ return "x"