aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzsloan2022-04-14 19:45:59 +0000
committerzsloan2022-04-14 19:45:59 +0000
commit7bb9067585616f2759add72c668d666c9ac73aa8 (patch)
tree666e523d4c00e10faf26fd87df0d08587825b79e
parent242590edb6fa45767a8bdd53c4c24aa5dbd1137c (diff)
downloadgenenetwork2-7bb9067585616f2759add72c668d666c9ac73aa8.tar.gz
Add group code to loading pages when applicable
This adds the group code to phenotype traits on loading pages, and also sets the group code as an attribute of the dataset.group class.
-rw-r--r--wqflask/base/data_set.py12
-rw-r--r--wqflask/wqflask/templates/loading.html2
-rw-r--r--wqflask/wqflask/views.py3
3 files changed, 10 insertions, 7 deletions
diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py
index d7e4e62f..a7811a30 100644
--- a/wqflask/base/data_set.py
+++ b/wqflask/base/data_set.py
@@ -333,11 +333,11 @@ class DatasetGroup:
def __init__(self, dataset, name=None):
"""This sets self.group and self.group_id"""
if name == None:
- self.name, self.id, self.genetic_type = fetchone(
+ self.name, self.id, self.genetic_type, self.code = fetchone(
dataset.query_for_group)
else:
- self.name, self.id, self.genetic_type = fetchone(
- "SELECT InbredSet.Name, InbredSet.Id, InbredSet.GeneticType FROM InbredSet where Name='%s'" % name)
+ self.name, self.id, self.genetic_type, self.code = fetchone(
+ "SELECT InbredSet.Name, InbredSet.Id, InbredSet.GeneticType, InbredSet.InbredSetCode FROM InbredSet where Name='%s'" % name)
if self.name == 'BXD300':
self.name = "BXD"
@@ -866,7 +866,7 @@ class PhenotypeDataSet(DataSet):
self.query_for_group = '''
SELECT
- InbredSet.Name, InbredSet.Id, InbredSet.GeneticType
+ InbredSet.Name, InbredSet.Id, InbredSet.GeneticType, InbredSet.InbredSetCode
FROM
InbredSet, PublishFreeze
WHERE
@@ -982,7 +982,7 @@ class GenotypeDataSet(DataSet):
self.query_for_group = '''
SELECT
- InbredSet.Name, InbredSet.Id, InbredSet.GeneticType
+ InbredSet.Name, InbredSet.Id, InbredSet.GeneticType, InbredSet.InbredSetCode
FROM
InbredSet, GenoFreeze
WHERE
@@ -1082,7 +1082,7 @@ class MrnaAssayDataSet(DataSet):
self.query_for_group = '''
SELECT
- InbredSet.Name, InbredSet.Id, InbredSet.GeneticType
+ InbredSet.Name, InbredSet.Id, InbredSet.GeneticType, InbredSet.InbredSetCode
FROM
InbredSet, ProbeSetFreeze, ProbeFreeze
WHERE
diff --git a/wqflask/wqflask/templates/loading.html b/wqflask/wqflask/templates/loading.html
index b9e31ad0..a6d9ae5e 100644
--- a/wqflask/wqflask/templates/loading.html
+++ b/wqflask/wqflask/templates/loading.html
@@ -20,7 +20,7 @@
<br>
group = <b><i>{{ start_vars.group[0] | upper }}{{ start_vars.group[1:] }}</i></b>
<br>
- trait identifier = <b><i>{{ start_vars.trait_id }}</i></b>
+ trait identifier = <b><i>{{ start_vars.trait_name }}</i></b>
<br>
n of sample = <b><i>{{ start_vars.n_samples }}</i></b>
{% if start_vars.transform != "" %}
diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py
index fdb49c7f..cad07267 100644
--- a/wqflask/wqflask/views.py
+++ b/wqflask/wqflask/views.py
@@ -723,6 +723,9 @@ def loading_page():
start_vars['dataset'], group_name=start_vars['group'])
else:
dataset = create_dataset(start_vars['dataset'])
+ start_vars['trait_name'] = start_vars['trait_id']
+ if dataset.type == "Publish":
+ start_vars['trait_name'] = dataset.group.code + "_" + start_vars['trait_name']
samples = dataset.group.samplelist
if 'genofile' in start_vars:
if start_vars['genofile'] != "":