From e63c4014e7bc34b440707be19af3779b72102fdb Mon Sep 17 00:00:00 2001
From: zsloan
Date: Thu, 26 Jan 2017 16:26:16 +0000
Subject: GEMMA now works with CFW data (had to update where it looks for the
input files and how it writes the phenotype file)
Y-axis for GEMMA now says -log(p)
Updated the style of the trait sample data table in the trait page
Updated dataset_select_menu_orig.js to also build just the Species and Group drop-downs for the trait input page (as opposed to all 4 drop-downs)
Updated dataset menu json file
Added option to show and hide columns to regular search page using colVis
Changed regular and global search result table styles/column widths
Began work on user trait submission code (not working yet though)
Began work on static loading page for mapping results
---
wqflask/base/data_set.py | 22 ++++++++++++++++------
wqflask/base/trait.py | 12 ++++++------
2 files changed, 22 insertions(+), 12 deletions(-)
(limited to 'wqflask/base')
diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py
index 06e02b02..94b38e13 100644
--- a/wqflask/base/data_set.py
+++ b/wqflask/base/data_set.py
@@ -44,7 +44,7 @@ from db import webqtlDatabaseFunction
from utility import webqtlUtil
from utility.benchmark import Bench
from utility import chunks
-from utility.tools import locate, locate_ignore_error
+from utility.tools import locate, locate_ignore_error, flat_files
from maintenance import get_group_samplelists
@@ -53,7 +53,7 @@ from pprint import pformat as pf
from db.gn_server import menu_main
from db.call import fetchall,fetchone,fetch1
-from utility.tools import USE_GN_SERVER, USE_REDIS
+from utility.tools import USE_GN_SERVER, USE_REDIS, flat_files, flat_file_exists
from utility.logger import getLogger
logger = getLogger(__name__ )
@@ -226,7 +226,7 @@ class Markers(object):
class HumanMarkers(Markers):
def __init__(self, name, specified_markers = []):
- marker_data_fh = open(locate('genotype') + '/' + name + '.bim')
+ marker_data_fh = open(flat_files('mapping') + '/' + name + '.bim')
self.markers = []
for line in marker_data_fh:
splat = line.strip().split()
@@ -299,11 +299,21 @@ class DatasetGroup(object):
self.markers = HumanMarkers(self.name, markers)
def get_markers(self):
- #logger.debug("self.species is:", self.species)
- if self.species == "human":
+ logger.debug("self.species is:", self.species)
+
+ def check_plink_gemma():
+ if flat_file_exists("mapping"):
+ MAPPING_PATH = flat_files("mapping")+"/"
+ if (os.path.isfile(MAPPING_PATH+self.name+".bed") and
+ (os.path.isfile(MAPPING_PATH+self.name+".map") or
+ os.path.isfile(MAPPING_PATH+self.name+".bim"))):
+ return True
+ return False
+
+ if check_plink_gemma():
marker_class = HumanMarkers
else:
- marker_class = Markers
+ marker_class = Markers
self.markers = marker_class(self.name)
diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py
index eb5b91c3..bf87e879 100644
--- a/wqflask/base/trait.py
+++ b/wqflask/base/trait.py
@@ -207,7 +207,7 @@ class GeneralTrait(object):
formatted = self.post_publication_description
else:
formatted = "Not available"
- return formatted.capitalize()
+ return formatted
@property
def alias_fmt(self):
@@ -379,7 +379,7 @@ def jsonable_table_row(trait, dataset_name, index):
additive = "N/A"
else:
additive = "%.3f" % round(float(trait.additive), 2)
- return ['',
+ return ['',
index,
''+str(trait.name)+'',
trait.symbol,
@@ -395,7 +395,7 @@ def jsonable_table_row(trait, dataset_name, index):
else:
additive = "%.2f" % round(float(trait.additive), 2)
if trait.pubmed_id:
- return ['',
+ return ['',
index,
''+str(trait.name)+'',
trait.description_display,
@@ -405,7 +405,7 @@ def jsonable_table_row(trait, dataset_name, index):
trait.LRS_location_repr,
additive]
else:
- return ['',
+ return ['',
index,
''+str(trait.name)+'',
trait.description_display,
@@ -415,7 +415,7 @@ def jsonable_table_row(trait, dataset_name, index):
trait.LRS_location_repr,
additive]
elif dataset.type == "Geno":
- return ['',
+ return ['',
index,
''+str(trait.name)+'',
trait.location_repr]
@@ -499,7 +499,7 @@ def retrieve_trait_info(trait, dataset, get_qtl_info=False):
for i, field in enumerate(dataset.display_fields):
holder = trait_info[i]
if isinstance(trait_info[i], basestring):
- holder = unicode(trait_info[i], "utf8", "ignore")
+ holder = unicode(trait_info[i], "utf-8", "ignore")
setattr(trait, field, holder)
if dataset.type == 'Publish':
--
cgit v1.2.3