aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
Diffstat (limited to 'wqflask')
-rwxr-xr-xwqflask/base/trait.py2
-rw-r--r--wqflask/wqflask/my_pylmm/pyLMM/lmm.py2
-rw-r--r--wqflask/wqflask/templates/quick_search.html110
-rw-r--r--wqflask/wqflask/views.py2
4 files changed, 12 insertions, 104 deletions
diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py
index 7c1c035c..dde8b8d8 100755
--- a/wqflask/base/trait.py
+++ b/wqflask/base/trait.py
@@ -302,7 +302,7 @@ class GeneralTrait:
#XZ: assign SQL query result to trait attributes.
for i, field in enumerate(self.dataset.display_fields):
- setattr(self, field, traitInfo[i])
+ setattr(self, field, str(traitInfo[i]))
if self.dataset.type == 'Publish':
self.confidential = 0
diff --git a/wqflask/wqflask/my_pylmm/pyLMM/lmm.py b/wqflask/wqflask/my_pylmm/pyLMM/lmm.py
index 62fb0fbd..5bfc3a01 100644
--- a/wqflask/wqflask/my_pylmm/pyLMM/lmm.py
+++ b/wqflask/wqflask/my_pylmm/pyLMM/lmm.py
@@ -243,6 +243,8 @@ def run(pheno_vector,
with Bench("LMM_ob fitting"):
lmm_ob.fit()
+ print("genotype_matrix: ", genotype_matrix.shape)
+
with Bench("Doing GWAS"):
t_stats, p_values = GWAS(pheno_vector,
genotype_matrix,
diff --git a/wqflask/wqflask/templates/quick_search.html b/wqflask/wqflask/templates/quick_search.html
index 5877a840..01588924 100644
--- a/wqflask/wqflask/templates/quick_search.html
+++ b/wqflask/wqflask/templates/quick_search.html
@@ -105,7 +105,7 @@
{% if result.result_fields['species'] == species %}
<tr>
<td>
- <a href="http://gn2python.genenetwork.org/show_trait?trait_id={{ result.result_fields['name'] }}&dataset={{ result.result_fields['dataset'] }}"
+ <a href="http://gn2python.genenetwork.org/show_trait?trait_id={{ result.result_fields['name'] }}&dataset={{ result.result_fields['dataset'] }}">
{{ result.result_fields['name'] }}
</a>
</td>
@@ -114,7 +114,7 @@
<td>{{ result.result_fields['dataset_name'] }}</td>
<td>{{ result.result_fields['symbol'] }}</td>
<td>{{ result.result_fields['description'] }}</td>
- <td>{{ result.result_fields['chr'] }} : {{ result['mb'] }}</td>
+ <td>Chr {{ result.result_fields['chr'] }}: {{ result.result_fields['mb'] }}</td>
<td>{{ result.result_fields['mean'] }}</td>
<td>{{ result.result_fields['lrs'] }}</td>
</tr>
@@ -168,105 +168,6 @@
{% endblock %}
- {#
- <table id="pheno_results" class="table table-hover table-striped table-bordered">
- <thead>
- <tr>
- <th>Id</th>
- <th>Species</th>
- <th>Group</th>
- <th>Description</th>
- <th>LRS</th>
- <th>Year</th>
- <th>Authors</th>
- </tr>
- </thead>
- <tbody>
- {% for result in results.phenotype %}
- <tr>
- <td>{{ result.result_fields['phenotype_id'] }}</td>
- <td>{{ result.result_fields['species'] }}</td>
- <td>{{ result.result_fields['group_name'] }}</td>
- <td>{{ result.result_fields['description'] }}</td>
- <td>{{ result.result_fields['lrs'] }}</td>
- <td>
- <a href="http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&list_uids={{ result.result_fields['pubmed_id'] }}&dopt=Abstract">
- {{ result.result_fields['year'] }}
- </a>
- </td>
- <td>{{ result.result_fields['authors'] }}</td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- </div>
- <div class="tab-pane" id="tab2">
- <table id="mrna_assay_results" class="table table-hover table-striped table-bordered">
- <thead>
- <tr>
- <th>Record ID</th>
- <th>Species</th>
- <th>Group</th>
- <th>Data Set</th>
- <th>Symbol</th>
- <th>Description</th>
- <th>Location</th>
- <th>Mean Expr</th>
- <th>Max LRS</th>
- </tr>
- </thead>
- <tbody>
- {% for result in results.mrna_assay %}
- <tr>
- <td>
- <a href="http://gn2python.genenetwork.org/show_trait?trait_id={{ result.result_fields['name'] }}&dataset={{ result.result_fields['dataset'] }}"
- {{ result.result_fields['name'] }}
- </a>
- </td>
- <td>{{ result.result_fields['species'] }}</td>
- <td>{{ result.result_fields['group_name'] }}</td>
- <td>{{ result.result_fields['dataset_name'] }}</td>
- <td>{{ result.result_fields['symbol'] }}</td>
- <td>{{ result.result_fields['description'] }}</td>
- <td>{{ result.result_fields['chr'] }} : {{ result['mb'] }}</td>
- <td>{{ result.result_fields['mean'] }}</td>
- <td>{{ result.result_fields['lrs'] }}</td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- </div>
- <div class="tab-pane" id="tab3">
- <table id="geno_results" class="table table-hover table-striped table-bordered">
- <thead>
- <tr>
- <th>Marker</th>
- <th>Species</th>
- <th>Group</th>
- <th>Data Set</th>
- <th>Location</th>
- </tr>
- </thead>
- <tbody>
- {% for result in results.genotype %}
- <tr>
- <td>
- <a href="http://gn2python.genenetwork.org/show_trait?trait_id={{ result.result_fields['marker_name'] }}&dataset={{ result.result_fields['dataset'] }}">
- {{ result.result_fields['marker_name'] }}
- </a>
- </td>
- <td>{{ result.result_fields['species'] }}</td>
- <td>{{ result.result_fields['group_name'] }}</td>
- <td>{{ result.result_fields['dataset_name'] }}</td>
- <td>{{ result.result_fields['chr'] }} : {{ result.result_fields['mb'] }}</td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- </div>
- #}
-
-
{% block js %}
<script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/js/jquery.dataTables.min.js"></script>
@@ -274,9 +175,14 @@
<script language="javascript" type="text/javascript" src="/static/packages/TableTools/media/js/TableTools.min.js"></script>
<script language="javascript" type="text/javascript" src="/static/packages/underscore/underscore-min.js"></script>
-
<script type="text/javascript" charset="utf-8">
$(document).ready( function () {
+
+ $("div[id^='tab'").bind('click', function(){
+ tab_id = $(this).attr('id');
+ $("a[href^='"+tab_id+"']").first().trigger('click');
+ });
+
$('#species_level ul li:first').addClass('active');
$('#trait_type_level ul li:first').addClass('active');
console.time("Creating table");
diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py
index 1af324b2..4480e8da 100644
--- a/wqflask/wqflask/views.py
+++ b/wqflask/wqflask/views.py
@@ -80,7 +80,7 @@ def search_page():
print("key is:", pf(key))
with Bench("Loading cache"):
result = Redis.get(key)
-
+
if result:
print("Cache hit!!!")
with Bench("Loading results"):