aboutsummaryrefslogtreecommitdiff
path: root/wqflask/base/data_set.py
diff options
context:
space:
mode:
authorzsloan2018-04-19 15:31:23 +0000
committerzsloan2018-04-19 15:31:23 +0000
commit72db6b91baf15de4fbd64cd4aef022cf32067b0c (patch)
treea0e70df31750907b5ef0f5f845224391cdf77f0e /wqflask/base/data_set.py
parentf59c0c12415a23982e593f46b608fedab2367c03 (diff)
downloadgenenetwork2-72db6b91baf15de4fbd64cd4aef022cf32067b0c.tar.gz
Changed width of top bar and a couple other html objects to 100% instead of set width
Changed to using BIMBAM files to build Marker objects in dataset.py
Diffstat (limited to 'wqflask/base/data_set.py')
-rw-r--r--wqflask/base/data_set.py23
1 files changed, 20 insertions, 3 deletions
diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py
index 9ca880d0..4a422ee4 100644
--- a/wqflask/base/data_set.py
+++ b/wqflask/base/data_set.py
@@ -169,8 +169,27 @@ class Markers(object):
"""Todo: Build in cacheing so it saves us reading the same file more than once"""
def __init__(self, name):
json_data_fh = open(locate(name + ".json",'genotype/json'))
+
try:
- markers = json.load(json_data_fh)
+ markers = []
+ with open(locate(name + "_snps.txt", 'r')) as bimbam_fh:
+ marker = {}
+ if len(bimbam_fh[0].split(", ")) > 2:
+ delimiter = ", "
+ elif len(bimbam_fh[0].split(",")) > 2:
+ delimiter = ","
+ elif len(bimbam_fh[0].split("\t")) > 2:
+ delimiter = "\t"
+ else:
+ delimiter = " "
+ for line in bimbam_fh:
+ marker['name'] = line.split(delimiter)[0]
+ marker['Mb']
+ marker['chr'] = line.split(delimiter)[2]
+ marker['cM']
+ markers.append(marker)
+ #try:
+ # markers = json.load(json_data_fh)
except:
markers = []
@@ -180,8 +199,6 @@ class Markers(object):
marker['Mb'] = float(marker['Mb'])
self.markers = markers
- #logger.debug("self.markers:", self.markers)
-
def add_pvalues(self, p_values):
logger.debug("length of self.markers:", len(self.markers))