diff options
author | zsloan | 2019-02-05 10:42:46 -0600 |
---|---|---|
committer | zsloan | 2019-02-05 10:42:46 -0600 |
commit | 85f014695b7873941ad200051606635ff37b2c20 (patch) | |
tree | b5827907dceff6a14945b9b551c06f86e4f2e5be /wqflask/base | |
parent | a593fb56a01f2015491299af7274270228f9230c (diff) | |
download | genenetwork2-85f014695b7873941ad200051606635ff37b2c20.tar.gz |
Fixed issue with getting marker info that affected heatmap and possibly other functions
Added the collection page features (correlation matrix, network graph, third party link-outs, etc) to the search result and correlation result pages
Diffstat (limited to 'wqflask/base')
-rw-r--r-- | wqflask/base/data_set.py | 38 |
1 files changed, 15 insertions, 23 deletions
diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py index 2acb3b61..79f72390 100644 --- a/wqflask/base/data_set.py +++ b/wqflask/base/data_set.py @@ -171,28 +171,22 @@ class Markers(object): def __init__(self, name): json_data_fh = open(locate(name + ".json",'genotype/json')) - try: - markers = [] - with open(locate(name + "_snps.txt", 'r')) as bimbam_fh: + markers = [] + with open("%s/%s_snps.txt" % (flat_files('genotype/bimbam'), name), 'r') as bimbam_fh: + if len(bimbam_fh.readline().split(", ")) > 2: + delimiter = ", " + elif len(bimbam_fh.readline().split(",")) > 2: + delimiter = "," + elif len(bimbam_fh.readline().split("\t")) > 2: + delimiter = "\t" + else: + delimiter = " " + for line in 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 = [] + marker['name'] = line.split(delimiter)[0].rstrip() + marker['Mb'] = float(line.split(delimiter)[1].rstrip())/1000000 + marker['chr'] = line.split(delimiter)[2].rstrip() + markers.append(marker) for marker in markers: if (marker['chr'] != "X") and (marker['chr'] != "Y"): @@ -334,8 +328,6 @@ class DatasetGroup(object): return mapping_id, mapping_names def get_markers(self): - logger.debug("self.species is:", self.species) - def check_plink_gemma(): if flat_file_exists("mapping"): MAPPING_PATH = flat_files("mapping")+"/" |