aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorzsloan2019-10-18 14:35:17 -0500
committerzsloan2019-10-18 14:35:17 -0500
commitacf114fb60ce493287dc852265a91ef12c854b0b (patch)
tree397480e3e918a84d7affaf54d8d241a3f26b94ac /wqflask
parented550f028b5db1fef57789d15c5f59a413f567f1 (diff)
downloadgenenetwork2-acf114fb60ce493287dc852265a91ef12c854b0b.tar.gz
Fixed issue with collections ordering
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/utility/webqtlUtil.py5
-rw-r--r--wqflask/wqflask/api/gen_menu.py6
-rw-r--r--wqflask/wqflask/collect.py2
-rwxr-xr-xwqflask/wqflask/templates/index_page_orig.html1
-rw-r--r--wqflask/wqflask/user_manager.py5
5 files changed, 15 insertions, 4 deletions
diff --git a/wqflask/utility/webqtlUtil.py b/wqflask/utility/webqtlUtil.py
index 67a476e3..53661ae4 100644
--- a/wqflask/utility/webqtlUtil.py
+++ b/wqflask/utility/webqtlUtil.py
@@ -52,11 +52,12 @@ ParInfo ={
'AXB':['ABF1', 'BAF1', 'C57BL/6J', 'A/J'],
'BXA':['BAF1', 'ABF1', 'C57BL/6J', 'A/J'],
'LXS':['LSF1', 'SLF1', 'ISS', 'ILS'],
-'HXBBXH':['HSRBNF1', 'BNHSRF1', 'BN', 'HSR'],
+'HXBBXH':['SHR_BNF1', 'BN_SHRF1', 'BN-Lx/Cub', 'SHR/OlaIpcv'],
'BayXSha':['BayXShaF1', 'ShaXBayF1', 'Bay-0','Shahdara'],
'ColXBur':['ColXBurF1', 'BurXColF1', 'Col-0','Bur-0'],
'ColXCvi':['ColXCviF1', 'CviXColF1', 'Col-0','Cvi'],
-'SXM':['SMF1', 'MSF1', 'Steptoe','Morex']
+'SXM':['SMF1', 'MSF1', 'Steptoe','Morex'],
+'HRDP':['SHR_BNF1', 'BN_SHRF1', 'BN-Lx/Cub', 'SHR/OlaIpcv']
}
#########################################
diff --git a/wqflask/wqflask/api/gen_menu.py b/wqflask/wqflask/api/gen_menu.py
index d7a59f29..77ca6525 100644
--- a/wqflask/wqflask/api/gen_menu.py
+++ b/wqflask/wqflask/api/gen_menu.py
@@ -1,6 +1,7 @@
from __future__ import print_function, division
import sys
+import json
from flask import g
@@ -35,6 +36,11 @@ def gen_dropdown_json():
types=types,
datasets=datasets)
+ output_file = """./wqflask/static/new/javascript/dataset_menu_structure.json"""
+
+ with open(output_file, 'w') as fh:
+ json.dump(data, fh, indent=3, sort_keys=True)
+
return data
def get_species():
diff --git a/wqflask/wqflask/collect.py b/wqflask/wqflask/collect.py
index 73269c4d..c273af59 100644
--- a/wqflask/wqflask/collect.py
+++ b/wqflask/wqflask/collect.py
@@ -100,7 +100,7 @@ class AnonCollection(object):
collection_exists = True
break
if collection_exists:
- collections_list[collection_position]['members'].extend(self.traits)
+ collections_list[collection_position]['members'] += list(set(self.traits) - set(collections_list[collection_position]['members']))
collections_list[collection_position]['num_members'] = len(collections_list[collection_position]['members'])
collections_list[collection_position]['changed_timestamp'] = datetime.datetime.utcnow().strftime('%b %d %Y %I:%M%p')
else:
diff --git a/wqflask/wqflask/templates/index_page_orig.html b/wqflask/wqflask/templates/index_page_orig.html
index f8ea3c7c..bdee6a12 100755
--- a/wqflask/wqflask/templates/index_page_orig.html
+++ b/wqflask/wqflask/templates/index_page_orig.html
@@ -193,6 +193,7 @@
<li><a href="http://bnw.genenetwork.org/">Bayesian Network Web Server</a> at UTHSC</li>
<li><a href="http://genenetwork.org">GeneNetwork 1</a> at UTHSC</li>
<li><a href="https://www.geneweaver.org/">GeneWeaver</a></li>
+ <li><a href="https://phenogen.org/">PhenoGen</a> at University of Colorado</li>
<li><a href="http://www.webgestalt.org/">WebGestalt</a> at Baylor</li>
</ul>
</div>
diff --git a/wqflask/wqflask/user_manager.py b/wqflask/wqflask/user_manager.py
index b2c7a914..3298c244 100644
--- a/wqflask/wqflask/user_manager.py
+++ b/wqflask/wqflask/user_manager.py
@@ -99,6 +99,8 @@ class AnonUser(object):
for collection in collections:
collection['created_timestamp'] = datetime.datetime.strptime(collection['created_timestamp'], '%b %d %Y %I:%M%p')
collection['changed_timestamp'] = datetime.datetime.strptime(collection['changed_timestamp'], '%b %d %Y %I:%M%p')
+
+ collections = sorted(collections, key = lambda i: i['changed_timestamp'], reverse = True)
return collections
def import_traits_to_user(self):
@@ -234,7 +236,8 @@ class UserSession(object):
user_info = response['hits']['hits'][0]['_source']
if 'collections' in user_info.keys():
if len(user_info['collections']) > 0:
- return json.loads(user_info['collections'])
+ collection_list = json.loads(user_info['collections'])
+ return sorted(collection_list, key = lambda i: datetime.datetime.strptime(i['changed_timestamp'], '%b %d %Y %I:%M%p'), reverse=True)
else:
return []
else: