From 7bb9067585616f2759add72c668d666c9ac73aa8 Mon Sep 17 00:00:00 2001
From: zsloan
Date: Thu, 14 Apr 2022 19:45:59 +0000
Subject: 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.
---
wqflask/base/data_set.py | 12 ++++++------
wqflask/wqflask/templates/loading.html | 2 +-
wqflask/wqflask/views.py | 3 +++
3 files changed, 10 insertions(+), 7 deletions(-)
(limited to 'wqflask')
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 @@
group = {{ start_vars.group[0] | upper }}{{ start_vars.group[1:] }}
- trait identifier = {{ start_vars.trait_id }}
+ trait identifier = {{ start_vars.trait_name }}
n of sample = {{ start_vars.n_samples }}
{% 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'] != "":
--
cgit v1.2.3