aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--wqflask/wqflask/correlation/show_corr_results.py2
-rw-r--r--wqflask/wqflask/show_trait/show_trait.py26
-rw-r--r--wqflask/wqflask/static/new/css/show_trait.css17
-rw-r--r--wqflask/wqflask/templates/show_trait.html4
-rw-r--r--wqflask/wqflask/templates/show_trait_edit_data.html8
-rw-r--r--wqflask/wqflask/templates/show_trait_mapping_tools.html2
6 files changed, 43 insertions, 16 deletions
diff --git a/wqflask/wqflask/correlation/show_corr_results.py b/wqflask/wqflask/correlation/show_corr_results.py
index 9f3f7982..0b2875cc 100644
--- a/wqflask/wqflask/correlation/show_corr_results.py
+++ b/wqflask/wqflask/correlation/show_corr_results.py
@@ -99,7 +99,7 @@ class CorrelationResults(object):
else:
helper_functions.get_species_dataset_trait(self, start_vars)
- self.dataset.group.read_genotype_file()
+ #self.dataset.group.read_genotype_file()
corr_samples_group = start_vars['corr_samples_group']
diff --git a/wqflask/wqflask/show_trait/show_trait.py b/wqflask/wqflask/show_trait/show_trait.py
index f75302f6..34447853 100644
--- a/wqflask/wqflask/show_trait/show_trait.py
+++ b/wqflask/wqflask/show_trait/show_trait.py
@@ -188,13 +188,23 @@ class ShowTrait(object):
self.stats_table_width, self.trait_table_width = get_table_widths(self.sample_groups, self.has_num_cases)
- #ZS: Needed to know whether to display bar chart
+ #ZS: Needed to know whether to display bar chart + get max sample name length in order to set table column width
self.num_values = 0
+ max_samplename_width = 1
for group in self.sample_groups:
for sample in group.sample_list:
+ if len(sample.name) > max_samplename_width:
+ max_samplename_width = len(sample.name)
if sample.display_value != "x":
self.num_values += 1
+ sample_column_width = max_samplename_width * 8
+
+ if self.num_values >= 500:
+ self.maf = 0.01
+ else:
+ self.maf = 0.05
+
trait_symbol = None
if not self.temp_trait:
if self.this_trait.symbol:
@@ -208,6 +218,7 @@ class ShowTrait(object):
sample_lists = sample_lists,
attribute_names = self.sample_groups[0].attributes,
num_values = self.num_values,
+ sample_column_width = sample_column_width,
temp_uuid = self.temp_uuid)
self.js_data = js_data
@@ -368,15 +379,14 @@ def get_table_widths(sample_groups, has_num_cases=False):
if len(sample_groups) > 1:
stats_table_width = 450
- trait_table_width = 25
+ trait_table_width = 380
if sample_groups[0].se_exists():
- trait_table_width += 15
+ trait_table_width += 70
if has_num_cases:
- trait_table_width += 5
- if (trait_table_width + len(sample_groups[0].attributes)*10) > 100:
- trait_table_width = 100
- else:
- trait_table_width += len(sample_groups[0].attributes)*10
+ trait_table_width += 30
+ trait_table_width += len(sample_groups[0].attributes)*40
+
+ trait_table_width = str(trait_table_width) + "px"
return stats_table_width, trait_table_width
diff --git a/wqflask/wqflask/static/new/css/show_trait.css b/wqflask/wqflask/static/new/css/show_trait.css
index 135a7643..69c4418a 100644
--- a/wqflask/wqflask/static/new/css/show_trait.css
+++ b/wqflask/wqflask/static/new/css/show_trait.css
@@ -12,4 +12,21 @@ div.sample_group {
.js-plotly-plot .plotly .modebar {
left: 100px;
+}
+
+table.dataTable thead th{
+ border-right: 1px solid white;
+ color: white;
+ background-color: #369;
+}
+
+table.dataTable thead .sorting_asc {
+ background-image: url("../packages/DataTables/images/sort_asc_disabled.png");
+}
+table.dataTable thead .sorting_desc {
+ background-image: url("../packages/DataTables/images/sort_desc_disabled.png");
+}
+
+table.dataTable tbody td {
+ padding: 3px 20px 1px 10px;
} \ No newline at end of file
diff --git a/wqflask/wqflask/templates/show_trait.html b/wqflask/wqflask/templates/show_trait.html
index ef05e321..8726226c 100644
--- a/wqflask/wqflask/templates/show_trait.html
+++ b/wqflask/wqflask/templates/show_trait.html
@@ -1,7 +1,6 @@
{% extends "base.html" %}
{% block title %}Trait Data and Analysis{% endblock %}
{% block css %}
- <link rel="stylesheet" type="text/css" href="/static/new/css/show_trait.css" />
<link rel="stylesheet" type="text/css" href="/static/new/css/bar_chart.css" />
<link rel="stylesheet" type="text/css" href="/static/new/css/box_plot.css" />
<link rel="stylesheet" type="text/css" href="/static/new/css/prob_plot.css" />
@@ -12,6 +11,7 @@
<link rel="stylesheet" type="text/css" href="/static/new/packages/noUiSlider/nouislider.css" />
<link rel="stylesheet" type="text/css" href="/static/new/packages/noUiSlider/nouislider.pips.css" />
<link rel="stylesheet" type="text/css" href="/static/packages/DT_bootstrap/DT_bootstrap.css" />
+ <link rel="stylesheet" type="text/css" href="/static/new/css/show_trait.css" />
{% endblock %}
{% block content %} <!-- Start of body -->
@@ -192,7 +192,7 @@
"columns": [
{ "bSortable": false },
{ "type": "natural" },
- { "type": "natural", "width": "25%" },
+ { "type": "natural", "width": js_data.sample_column_width},
{ "type": "cust-txt" },
{ "bSortable": false },
{ "type": "cust-txt" }{% if has_num_cases %},
diff --git a/wqflask/wqflask/templates/show_trait_edit_data.html b/wqflask/wqflask/templates/show_trait_edit_data.html
index bd40946d..7ac4b2c0 100644
--- a/wqflask/wqflask/templates/show_trait_edit_data.html
+++ b/wqflask/wqflask/templates/show_trait_edit_data.html
@@ -86,11 +86,11 @@
<!--<div id="edit_sample_lists">-->
{% for sample_type in sample_groups %}
{% set outer_loop = loop %}
- <div class="sample_group" style="width:{{ trait_table_width }}%;">
+ <div class="sample_group" style="width:{{ trait_table_width }};">
<h3>{{ sample_type.header }}</h3>
<hr>
<div id="table_container">
- <table class="table-hover table-striped" id="samples_{{ sample_type.sample_group_type }}" style="float: left; width:100%;">
+ <table class="table-hover table-striped cell-border" id="samples_{{ sample_type.sample_group_type }}" style="float: left; width:100%;">
<thead>
<tr>
<th></th>
@@ -98,7 +98,7 @@
<th>Sample</th>
<th style="text-align: right;">Value</th>
{% if sample_type.se_exists() %}
- <th>&nbsp;</th>
+ <th style="padding-left: 3px; padding-right: 3px;">&nbsp;</th>
<th style="text-align: right;">SE</th>
{% endif %}
{% if has_num_cases %}
@@ -134,7 +134,7 @@
</td>
{% if sample_type.se_exists() %}
- <td>
+ <td align="center" style="padding-left: 2px; padding-right: 2px;">
±
</td>
diff --git a/wqflask/wqflask/templates/show_trait_mapping_tools.html b/wqflask/wqflask/templates/show_trait_mapping_tools.html
index 72b3b00b..8e003897 100644
--- a/wqflask/wqflask/templates/show_trait_mapping_tools.html
+++ b/wqflask/wqflask/templates/show_trait_mapping_tools.html
@@ -54,7 +54,7 @@
<div class="mapping_method_fields form-group">
<label for="maf_gemma" style="text-align: right;" class="col-xs-3 control-label">MAF</label>
<div style="margin-left:20px;" class="col-xs-4 controls">
- <input name="maf_gemma" value="0.05" type="text" class="form-control">
+ <input name="maf_gemma" value="{{ maf }}" type="text" class="form-control">
</div>
</div>
<div class="mapping_method_fields form-group">