aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--wqflask/base/data_set.py23
-rw-r--r--wqflask/wqflask/marker_regression/gemma_mapping.py4
-rw-r--r--wqflask/wqflask/marker_regression/marker_regression.py1
-rw-r--r--wqflask/wqflask/templates/base.html4
-rwxr-xr-xwqflask/wqflask/templates/index_page_orig.html2
5 files changed, 25 insertions, 9 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))
diff --git a/wqflask/wqflask/marker_regression/gemma_mapping.py b/wqflask/wqflask/marker_regression/gemma_mapping.py
index 7563eb2c..157e4f33 100644
--- a/wqflask/wqflask/marker_regression/gemma_mapping.py
+++ b/wqflask/wqflask/marker_regression/gemma_mapping.py
@@ -32,7 +32,7 @@ def run_gemma(this_dataset, samples, vals, covariates, method, use_loco):
if covariates != "":
gen_covariates_file(this_dataset, covariates)
- if method == "gemma":
+ if method == "gemma_plink":
gemma_command = GEMMA_COMMAND + ' -bfile %s/%s -k %s/%s.cXX.txt -lmm 1 -maf 0.1' % (flat_files('mapping'),
this_dataset.group.name,
flat_files('mapping'),
@@ -113,7 +113,7 @@ def run_gemma(this_dataset, samples, vals, covariates, method, use_loco):
def gen_pheno_txt_file(this_dataset, genofile_name, vals, method):
"""Generates phenotype file for GEMMA"""
- if method == "gemma":
+ if method == "gemma_plink":
current_file_data = []
with open("{}/{}.fam".format(flat_files('mapping'), this_dataset.group.name), "r") as outfile:
for i, line in enumerate(outfile):
diff --git a/wqflask/wqflask/marker_regression/marker_regression.py b/wqflask/wqflask/marker_regression/marker_regression.py
index bfb63995..50e673c4 100644
--- a/wqflask/wqflask/marker_regression/marker_regression.py
+++ b/wqflask/wqflask/marker_regression/marker_regression.py
@@ -587,7 +587,6 @@ def export_mapping_results(dataset, trait, markers, results_path, mapping_scale,
output_file.write(",Dominance")
output_file.write("\n")
for i, marker in enumerate(markers):
- logger.debug("THE MARKER:", marker)
output_file.write(marker['name'] + "," + str(marker['chr']) + "," + str(marker['Mb']) + ",")
if "lod_score" in marker.keys():
output_file.write(str(marker['lod_score']))
diff --git a/wqflask/wqflask/templates/base.html b/wqflask/wqflask/templates/base.html
index 64daa1cc..e8b51523 100644
--- a/wqflask/wqflask/templates/base.html
+++ b/wqflask/wqflask/templates/base.html
@@ -22,9 +22,9 @@
<body style="width: 100% !important;">
<!-- Navbar ================================================== -->
- <div class="navbar navbar-inverse navbar-static-top pull-left" role="navigation">
+ <div class="navbar navbar-inverse navbar-static-top pull-left" role="navigation" style="width: 100%;">
- <div class="container-fluid" style="width: 1500px !important;">
+ <div class="container-fluid" style="width: 100%;">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<a class="navbar-brand" href="/">GeneNetwork</a>
diff --git a/wqflask/wqflask/templates/index_page_orig.html b/wqflask/wqflask/templates/index_page_orig.html
index 72ced084..2a5556ea 100755
--- a/wqflask/wqflask/templates/index_page_orig.html
+++ b/wqflask/wqflask/templates/index_page_orig.html
@@ -21,7 +21,7 @@
{{ flash_me() }}
- <div class="row" style="width: 1400px !important;">
+ <div class="row" style="width: 100%;">
<div class="col-xs-5">
<section id="search">