aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/base/data_set.py40
-rw-r--r--wqflask/wqflask/correlation/corr_scatter_plot.py11
-rw-r--r--wqflask/wqflask/correlation_matrix/show_corr_matrix.py2
-rw-r--r--wqflask/wqflask/docs.py4
-rw-r--r--wqflask/wqflask/resource_manager.py20
-rw-r--r--wqflask/wqflask/static/new/css/show_trait.css5
-rw-r--r--wqflask/wqflask/static/new/javascript/search_results.js14
-rw-r--r--wqflask/wqflask/templates/base.html8
-rw-r--r--wqflask/wqflask/templates/collections/add.html2
-rw-r--r--wqflask/wqflask/templates/collections/view.html26
-rw-r--r--wqflask/wqflask/templates/correlation_matrix.html2
-rw-r--r--wqflask/wqflask/templates/correlation_page.html32
-rwxr-xr-xwqflask/wqflask/templates/index_page_orig.html10
-rw-r--r--wqflask/wqflask/templates/search_result_page.html29
-rw-r--r--wqflask/wqflask/templates/show_trait_details.html32
-rw-r--r--wqflask/wqflask/templates/show_trait_edit_data.html2
-rw-r--r--wqflask/wqflask/templates/show_trait_statistics.html4
-rw-r--r--wqflask/wqflask/views.py4
18 files changed, 111 insertions, 136 deletions
diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py
index afffe780..2f1549ae 100644
--- a/wqflask/base/data_set.py
+++ b/wqflask/base/data_set.py
@@ -150,10 +150,12 @@ Publish or ProbeSet. E.g.
"geno": "Geno",
}
+ group_name = name
if t in ['pheno', 'other_pheno']:
- name = name.replace("Publish", "")
+ group_name = name.replace("Publish", "")
- if bool(len(g.db.execute(sql_query_mapping[t].format(name)).fetchone())):
+ results = g.db.execute(sql_query_mapping[t].format(group_name)).fetchone()
+ if results:
self.datasets[name] = dataset_name_mapping[t]
self.redis_instance.set("dataset_structure", json.dumps(self.datasets))
return True
@@ -1173,40 +1175,6 @@ class TempDataSet(DataSet):
self.fullname = 'Temporary Storage'
self.shortname = 'Temp'
- @staticmethod
- def handle_pca(desc):
- if 'PCA' in desc:
- # Todo: Modernize below lines
- desc = desc[desc.rindex(':')+1:].strip()
- else:
- desc = desc[:desc.index('entered')].strip()
- return desc
-
- def get_desc(self):
- query = 'SELECT description FROM Temp WHERE Name=%s' % self.name
- logger.sql(query)
- g.db.execute(query)
- desc = g.db.fetchone()[0]
- desc = self.handle_pca(desc)
- return desc
-
- def retrieve_sample_data(self, trait):
- query = """
- SELECT
- Strain.Name, TempData.value, TempData.SE, TempData.NStrain, TempData.Id
- FROM
- TempData, Temp, Strain
- WHERE
- TempData.StrainId = Strain.Id AND
- TempData.Id = Temp.DataId AND
- Temp.name = '%s'
- Order BY
- Strain.Name
- """ % escape(trait.name)
-
- logger.sql(query)
- results = g.db.execute(query).fetchall()
-
def geno_mrna_confidentiality(ob):
dataset_table = ob.type + "Freeze"
diff --git a/wqflask/wqflask/correlation/corr_scatter_plot.py b/wqflask/wqflask/correlation/corr_scatter_plot.py
index 819836b1..0f3d455c 100644
--- a/wqflask/wqflask/correlation/corr_scatter_plot.py
+++ b/wqflask/wqflask/correlation/corr_scatter_plot.py
@@ -17,8 +17,15 @@ class CorrScatterPlot(object):
"""Page that displays a correlation scatterplot with a line fitted to it"""
def __init__(self, params):
- self.dataset_1 = data_set.create_dataset(params['dataset_1'])
- self.dataset_2 = data_set.create_dataset(params['dataset_2'])
+ if "Temp" in params['dataset_1']:
+ self.dataset_1 = data_set.create_dataset(dataset_name = "Temp", dataset_type = "Temp", group_name = params['dataset_1'].split("_")[1])
+ else:
+ self.dataset_1 = data_set.create_dataset(params['dataset_1'])
+ if "Temp" in params['dataset_2']:
+ self.dataset_2 = data_set.create_dataset(dataset_name = "Temp", dataset_type = "Temp", group_name = params['dataset_2'].split("_")[1])
+ else:
+ self.dataset_2 = data_set.create_dataset(params['dataset_2'])
+
#self.dataset_3 = data_set.create_dataset(params['dataset_3'])
self.trait_1 = create_trait(name=params['trait_1'], dataset=self.dataset_1)
self.trait_2 = create_trait(name=params['trait_2'], dataset=self.dataset_2)
diff --git a/wqflask/wqflask/correlation_matrix/show_corr_matrix.py b/wqflask/wqflask/correlation_matrix/show_corr_matrix.py
index 0ac94139..3beee84f 100644
--- a/wqflask/wqflask/correlation_matrix/show_corr_matrix.py
+++ b/wqflask/wqflask/correlation_matrix/show_corr_matrix.py
@@ -147,7 +147,7 @@ class CorrelationMatrix(object):
if num_overlap < self.lowest_overlap:
self.lowest_overlap = num_overlap
- if num_overlap == 0:
+ if num_overlap < 2:
corr_result_row.append([target_trait, 0, num_overlap])
pca_corr_result_row.append(0)
else:
diff --git a/wqflask/wqflask/docs.py b/wqflask/wqflask/docs.py
index 78407e22..9fad1cf1 100644
--- a/wqflask/wqflask/docs.py
+++ b/wqflask/wqflask/docs.py
@@ -11,7 +11,7 @@ class Docs(object):
def __init__(self, entry, start_vars={}):
sql = """
- SELECT Docs.title, Docs.content
+ SELECT Docs.title, CAST(Docs.content AS BINARY)
FROM Docs
WHERE Docs.entry LIKE %s
"""
@@ -22,7 +22,7 @@ class Docs(object):
self.content = ""
else:
self.title = result[0]
- self.content = result[1].encode("latin1")
+ self.content = result[1]
self.editable = "false"
# ZS: Removing option to edit to see if text still gets vandalized
diff --git a/wqflask/wqflask/resource_manager.py b/wqflask/wqflask/resource_manager.py
index 39a07310..14ff2183 100644
--- a/wqflask/wqflask/resource_manager.py
+++ b/wqflask/wqflask/resource_manager.py
@@ -25,16 +25,16 @@ def manage_resource():
group_masks_with_names = get_group_names(group_masks)
default_mask = resource_info['default_mask']['data']
owner_id = resource_info['owner_id']
- owner_info = get_user_by_unique_column("user_id", owner_id)
-
- if 'name' in owner_info:
- owner_display_name = owner_info['full_name']
- elif 'user_name' in owner_info:
- owner_display_name = owner_info['user_name']
- elif 'email_address' in owner_info:
- owner_display_name = owner_info['email_address']
- else:
- owner_display_name = None
+
+ owner_display_name = None
+ if owner_id != "none":
+ owner_info = get_user_by_unique_column("user_id", owner_id)
+ if 'name' in owner_info:
+ owner_display_name = owner_info['full_name']
+ elif 'user_name' in owner_info:
+ owner_display_name = owner_info['user_name']
+ elif 'email_address' in owner_info:
+ owner_display_name = owner_info['email_address']
return render_template("admin/manage_resource.html", owner_name = owner_display_name, resource_id = resource_id, resource_info=resource_info, default_mask=default_mask, group_masks=group_masks_with_names, admin_status=admin_status)
diff --git a/wqflask/wqflask/static/new/css/show_trait.css b/wqflask/wqflask/static/new/css/show_trait.css
index 338302af..92deab20 100644
--- a/wqflask/wqflask/static/new/css/show_trait.css
+++ b/wqflask/wqflask/static/new/css/show_trait.css
@@ -46,4 +46,9 @@ table.dataTable.cell-border tbody th, table.dataTable.cell-border tbody td {
table.dataTable.cell-border tbody tr th:first-child,
table.dataTable.cell-border tbody tr td:first-child {
border-left: 1px solid #ccc;
+}
+
+.glyphicon {
+ position: relative;
+ top: 2px;
} \ No newline at end of file
diff --git a/wqflask/wqflask/static/new/javascript/search_results.js b/wqflask/wqflask/static/new/javascript/search_results.js
index 685d6291..86660126 100644
--- a/wqflask/wqflask/static/new/javascript/search_results.js
+++ b/wqflask/wqflask/static/new/javascript/search_results.js
@@ -93,7 +93,7 @@ $(function() {
});
- add = function() {
+ add_to_collection = function() {
var traits;
traits = $("#trait_table input:checked").map(function() {
return $(this).val();
@@ -250,7 +250,7 @@ $(function() {
$("#select_all").click(select_all);
$("#deselect_all").click(deselect_all);
$("#invert").click(invert);
- $("#add").click(add);
+ $("#add").click(add_to_collection);
$("#submit_bnw").click(submit_bnw);
$("#export_traits").click(export_traits);
$('.trait_checkbox, .btn').click(change_buttons);
@@ -261,6 +261,12 @@ $(function() {
let na_equivalent_vals = ["N/A", "--", ""]; //ZS: Since there are multiple values that should be treated the same as N/A
+ function extract_inner_text(the_string){
+ var span = document.createElement('span');
+ span.innerHTML = the_string;
+ return span.textContent || span.innerText;
+ }
+
function sort_NAs(a, b, sort_function){
if ( na_equivalent_vals.includes(a) && na_equivalent_vals.includes(b)) {
return 0;
@@ -276,10 +282,10 @@ $(function() {
$.extend( $.fn.dataTableExt.oSort, {
"natural-minus-na-asc": function (a, b) {
- return sort_NAs(a, b, naturalAsc)
+ return sort_NAs(extract_inner_text(a), extract_inner_text(b), naturalAsc)
},
"natural-minus-na-desc": function (a, b) {
- return sort_NAs(a, b, naturalDesc)
+ return sort_NAs(extract_inner_text(a), extract_inner_text(b), naturalDesc)
}
});
diff --git a/wqflask/wqflask/templates/base.html b/wqflask/wqflask/templates/base.html
index e6802cc4..b44538cf 100644
--- a/wqflask/wqflask/templates/base.html
+++ b/wqflask/wqflask/templates/base.html
@@ -21,6 +21,14 @@
{% block css %}
{% endblock %}
+ <style>
+ table.dataTable thead .sorting_asc {
+ background-image: url({{ url_for("js", filename="DataTables/images/sort_asc_disabled.png") }});
+ }
+ table.dataTable thead .sorting_desc {
+ background-image: url({{ url_for("js", filename="DataTables/images/sort_desc_disabled.png") }});
+ }
+ </style>
</head>
<body style="width: 100%">
diff --git a/wqflask/wqflask/templates/collections/add.html b/wqflask/wqflask/templates/collections/add.html
index 825dfb84..62b6abb5 100644
--- a/wqflask/wqflask/templates/collections/add.html
+++ b/wqflask/wqflask/templates/collections/add.html
@@ -5,7 +5,7 @@
or add to an existing collection.</p>
</div>
<div class="modal-body" style="margin-left: 20px;">
- <form action="/collections/new" data-validate="parsley" id="add_form">
+ <form action="/collections/new" target="_blank" data-validate="parsley" id="add_form">
{% if traits is defined %}
<input type="hidden" name="traits" value="{{ traits }}" />
{% else %}
diff --git a/wqflask/wqflask/templates/collections/view.html b/wqflask/wqflask/templates/collections/view.html
index dce814dd..bc487a59 100644
--- a/wqflask/wqflask/templates/collections/view.html
+++ b/wqflask/wqflask/templates/collections/view.html
@@ -16,8 +16,6 @@
</h1>
<h3>This collection has {{ '{}'.format(numify(trait_obs|count, "record", "records")) }}</h3>
- <!--<hr style="height: 1px; background-color: #A9A9A9;">-->
-
<div>
<form id="collection_form" action="/delete" method="post">
<input type="hidden" name="uc_id" id="uc_id" value="{{ uc.id }}" />
@@ -77,7 +75,7 @@
<input type="hidden" name="database_name" id="database_name" value="None">
<input type="hidden" name="export_data" id="export_data" value="">
<input type="hidden" name="file_name" id="file_name" value="collection_table">
- <button class="btn btn-default" id="export_traits">Download CSV</button>
+ <button class="btn btn-default" id="export_traits">Download</button>
<input type="text" id="searchbox" class="form-control" style="width: 200px; display: inline; padding-bottom: 9px;" placeholder="Search Table For ...">
<input type="text" id="select_top" class="form-control" style="width: 200px; display: inline; padding-bottom: 9px;" placeholder="Select Top ...">
<button class="btn btn-default" id="deselect_all" type="button"><span class="glyphicon glyphicon-remove"></span> Deselect</button>
@@ -99,9 +97,9 @@
<th data-export="Description">Description</th>
<th data-export="Location">Location</th>
<th data-export="Mean">Mean</th>
- <th data-export="Max LRS">Max LRS <a href="http://genenetwork.org//glossary.html#L" target="_blank"><sup>?</sup></a></th>
- <th data-export="Max LRS Location">Max LRS Location</th>
- <th data-export="Add. Eff.">Additive Effect <a href="http://genenetwork.org//glossary.html#A" target="_blank"><sup>?</sup></a></th>
+ <th data-export="Max LRS">Max LRS <a href="http://genenetwork.org//glossary.html#L" target="_blank"><sup style="font-size: small; color: #FF0000;"> ?</sup></a></th>
+ <th data-export="Peak Location">Peak Location</th>
+ <th data-export="Add. Eff.">Effect Size <a href="http://genenetwork.org//glossary.html#A" target="_blank"><sup style="font-size: small; color: #FF0000;"> ?</sup></a></th>
</tr>
</thead>
@@ -144,7 +142,7 @@
<TD data-export="{{ this_trait.LRS_score_repr }}" align="right">N/A</TD>
{% endif %}
<TD data-export="{{ this_trait.LRS_location_repr }}">{{ this_trait.LRS_location_repr }}</TD>
- {% if this_trait.additive|float > 0 %}
+ {% if this_trait.additive|float != 0 %}
<TD data-export="{{ this_trait.additive }}" align="right">{{ '%0.3f' % this_trait.additive|float }}</TD>
{% else %}
<TD data-export="{{ this_trait.additive }}" align="right">N/A</TD>
@@ -166,13 +164,13 @@
{% block js %}
<script language="javascript" type="text/javascript" src="/static/new/js_external/jszip.min.js"></script>
<script language="javascript" type="text/javascript" src="{{ url_for('js', filename='js_alt/md5.min.js') }}"></script>
- <script type="text/javascript" src="/static/new/javascript/search_results.js"></script>
<script language="javascript" type="text/javascript" src="{{ url_for('js', filename='DataTables/js/jquery.dataTables.min.js') }}"></script>
<script language="javascript" type="text/javascript" src="{{ url_for('js', filename='DataTablesExtensions/plugins/sorting/natural.js') }}"></script>
<script language="javascript" type="text/javascript" src="{{ url_for('js', filename='DataTablesExtensions/colResize/dataTables.colResize.js') }}"></script>
<script language="javascript" type="text/javascript" src="{{ url_for('js', filename='DataTablesExtensions/colReorder/js/dataTables.colReorder.js') }}"></script>
<script language="javascript" type="text/javascript" src="{{ url_for('js', filename='DataTablesExtensions/buttons/js/dataTables.buttons.min.js') }}"></script>
<script language="javascript" type="text/javascript" src="{{ url_for('js', filename='DataTablesExtensions/buttons/js/buttons.colVis.min.js') }}"></script>
+ <script type="text/javascript" src="/static/new/javascript/search_results.js"></script>
<script language="javascript" type="text/javascript">
@@ -187,10 +185,14 @@
console.time("Creating table");
$('#trait_table').dataTable( {
"columns": [
- { "type": "natural", "width": 10 },
+ {
+ "orderDataType": "dom-checkbox",
+ "orderSequence": [ "desc", "asc"],
+ "width": 10
+ },
{ "type": "natural", "width": 50 },
{ "type": "natural" },
- { "type": "natural", "width": 120 },
+ { 'type': "natural-minus-na", "width": 120 },
{ "type": "natural" },
{ "type": "natural" },
{ "type": "natural", "width": 130 },
@@ -199,10 +201,6 @@
{ "type": "natural", "width": 130 },
{ "type": "natural" }
],
- "columnDefs": [ {
- "targets": 0,
- "orderable": false
- } ],
"order": [[1, "asc" ]],
buttons: [
{
diff --git a/wqflask/wqflask/templates/correlation_matrix.html b/wqflask/wqflask/templates/correlation_matrix.html
index 9b96de1c..d556f31a 100644
--- a/wqflask/wqflask/templates/correlation_matrix.html
+++ b/wqflask/wqflask/templates/correlation_matrix.html
@@ -51,7 +51,7 @@
{% if result[0].name == trait.name and result[0].dataset == trait.dataset %}
<td nowrap="ON" align="center" bgcolor="#cccccc" style="padding: 3px; line-height: 1.1;"><a href="/show_trait?trait_id={{ trait.name }}&dataset={{ trait.dataset.name }}"><font style="font-size: 12px; color: #3071a9; font-weight: bold;" ><em>n</em><br>{{ result[2] }}</font></a></td>
{% else %}
- <td nowrap="ON" align="middle" class="corr_cell" style="padding: 3px; line-height: 1.1;"><a href="/corr_scatter_plot?dataset_1={{ trait.dataset.name }}&dataset_2={{ result[0].dataset.name }}&trait_1={{ trait.name }}&trait_2={{ result[0].name }}"><font style="font-size: 12px; color: #3071a9; font-weight: bold;" ><span class="corr_value">{{ '%0.2f' % result[1] }}</span><br>{{ result[2] }}</font></a></td>
+ <td nowrap="ON" align="middle" class="corr_cell" style="padding: 3px; line-height: 1.1;"><a href="/corr_scatter_plot?dataset_1={% if trait.dataset.name == 'Temp' %}Temp_{{ trait.dataset.group.name }}{% else %}{{ trait.dataset.name }}{% endif %}&dataset_2={% if result[0].dataset.name == 'Temp' %}Temp_{{ result[0].dataset.group.name }}{% else %}{{ result[0].dataset.name }}{% endif %}&trait_1={{ trait.name }}&trait_2={{ result[0].name }}"><font style="font-size: 12px; color: #3071a9; font-weight: bold;" ><span class="corr_value">{{ '%0.2f' % result[1] }}</span><br>{{ result[2] }}</font></a></td>
{% endif %}
{% endfor %}
</tr>
diff --git a/wqflask/wqflask/templates/correlation_page.html b/wqflask/wqflask/templates/correlation_page.html
index e597bea9..fb218e29 100644
--- a/wqflask/wqflask/templates/correlation_page.html
+++ b/wqflask/wqflask/templates/correlation_page.html
@@ -144,7 +144,7 @@
<td data-export="{{ trait.description_display }}">{{ trait.description_display }}</TD>
<td data-export="{{ trait.location_repr }}" style="white-space: nowrap;">{{ trait.location_repr }}</td>
<td data-export="{{ '%0.3f' % trait.mean|float }}" align="right">{{ '%0.3f' % trait.mean|float }}</td>
- <td data-export="{{ '%0.3f'|format(trait.sample_r) }}"" align="right"><a target="_blank" href="corr_scatter_plot?dataset_1={{dataset.name}}&dataset_2={{trait.dataset.name}}&trait_1={{this_trait.name}}&trait_2={{trait.name}}">{{ '%0.3f'|format(trait.sample_r) }}</a></td>
+ <td data-export="{{ '%0.3f'|format(trait.sample_r) }}"" align="right"><a target="_blank" href="corr_scatter_plot?dataset_1={% if dataset.name == 'Temp' %}Temp_{{ dataset.group.name }}{% else %}{{ dataset.name }}{% endif %}&dataset_2={% if trait.dataset.name == 'Temp' %}Temp_{{ trait.dataset.group.name }}{% else %}{{ trait.dataset.name }}{% endif %}&trait_1={{ this_trait.name }}&trait_2={{ trait.name }}">{{ '%0.3f'|format(trait.sample_r) }}</a></td>
<td data-export="{{ trait.num_overlap }}" align="right">{{ trait.num_overlap }}</td>
<td data-export="{{ '%0.3e'|format(trait.sample_p) }}" align="right">{{ '%0.3e'|format(trait.sample_p) }}</td>
{% if trait.lit_corr == "" or trait.lit_corr == 0.000 %}
@@ -164,22 +164,26 @@
<td data-export={% if trait.additive != "" %}"{{ '%0.3f' % trait.additive|float }}"{% else %}"N/A"{% endif %} align="right">{% if trait.additive != "" %}{{ '%0.3f' % trait.additive|float }}{% else %}N/A{% endif %}</td>
{% elif target_dataset.type == "Publish" %}
{% if trait.abbreviation %}
- <TD title="{{ trait.abbreviation }}" data-export="{{ trait.abbreviation }}">{% if trait.abbreviation|length > 20 %}{{ trait.abbreviation[:20] }}...{% else %}{{ trait.abbreviation }}{% endif %}</TD>
+ <td title="{{ trait.abbreviation }}" data-export="{{ trait.abbreviation }}">{% if trait.abbreviation|length > 20 %}{{ trait.abbreviation[:20] }}...{% else %}{{ trait.abbreviation }}{% endif %}</td>
{% else %}
- <TD data-export="N/A">N/A</TD>
+ <td data-export="N/A">N/A</td>
{% endif %}
<td data-export="{{ trait.description_display }}">{% if trait.description_display|length > 70 %}{{ trait.description_display[:70] }}...{% else %}{{ trait.description_display }}{% endif %}</td>
{% if trait.authors %}
<td data-export="{{ trait.authors }}">{% if trait.authors.split(',') > 6 %}{{ trait.authors.split(',')[:6]|join(', ') }}, et al.{% else %}{{ trait.authors }}{% endif %}</td>
{% else %}
- <TD data-export="N/A">N/A</TD>
+ <td data-export="N/A">N/A</td>
{% endif %}
<td data-export="{{ trait.pubmed_text }}">
+ {% if trait.pubmed_text != "N/A" %}
<a href="{{ trait.pubmed_link }}">
{{ trait.pubmed_text }}
</a>
+ {% else %}
+ {{ trait.pubmed_text }}
+ {% endif %}
</td>
- <td data-export="{{ '%0.3f'|format(trait.sample_r) }}" align="right"><a target="_blank" href="corr_scatter_plot?dataset_1={{dataset.name}}&dataset_2={{trait.dataset.name}}&trait_1={{this_trait.name}}&trait_2={{trait.name}}">{{ '%0.3f'|format(trait.sample_r) }}</a></td>
+ <td data-export="{{ '%0.3f'|format(trait.sample_r) }}"" align="right"><a target="_blank" href="corr_scatter_plot?dataset_1={% if dataset.name == 'Temp' %}Temp_{{ dataset.group.name }}{% else %}{{ dataset.name }}{% endif %}&dataset_2={{ trait.dataset.name }}&trait_1={{ this_trait.name }}&trait_2={{ trait.name }}">{{ '%0.3f'|format(trait.sample_r) }}</a></td>
<td data-export="{{ trait.num_overlap }}" align="right">{{ trait.num_overlap }}</td>
<td data-export="{{ '%0.3e'|format(trait.sample_p) }}" align="right">{{ '%0.3e'|format(trait.sample_p) }}</td>
<td data-export="{{ trait.LRS_score_repr }}" align="right">{{ trait.LRS_score_repr }}</td>
@@ -187,7 +191,7 @@
<td data-export={% if trait.additive != "" %}"{{ '%0.3f' % trait.additive|float }}"{% else %}"N/A"{% endif %} align="right">{% if trait.additive != "" %}{{ '%0.3f' % trait.additive|float }}{% else %}N/A{% endif %}</td>
{% elif target_dataset.type == "Geno" %}
<td data-export="{{ trait.location_repr }}" align="right">{{ trait.location_repr }}</TD>
- <td data-export="{{ '%0.3f'|format(trait.sample_r) }}" align="right"><a target="_blank" href="corr_scatter_plot?dataset_1={{dataset.name}}&dataset_2={{trait.dataset.name}}&trait_1={{this_trait.name}}&trait_2={{trait.name}}">{{ '%0.3f'|format(trait.sample_r) }}</a></td>
+ <td data-export="{{ '%0.3f'|format(trait.sample_r) }}"" align="right"><a target="_blank" href="corr_scatter_plot?dataset_1={% if dataset.name == 'Temp' %}Temp_{{ dataset.group.name }}{% else %}{{ dataset.name }}{% endif %}&dataset_2={{ trait.dataset.name }}&trait_1={{ this_trait.name }}&trait_2={{ trait.name }}">{{ '%0.3f'|format(trait.sample_r) }}</a></td>
<td data-export="{{ trait.num_overlap }}" align="right">{{ trait.num_overlap }}</td>
<td data-export="{{ '%0.3e'|format(trait.sample_p) }}" align="right">{{ '%0.3e'|format(trait.sample_p) }}</td>
{% endif %}
@@ -365,9 +369,9 @@
{ "type": "numeric-html", 'orderSequence': [ "desc", "asc"] },
{ "type": "numeric-html", 'orderSequence': [ "desc", "asc"] },
{ "type": "scientific" },
- { "type": "natural" },
- { "type": "natural" },
- { "type": "natural" }
+ { "type": "natural-minus-na" },
+ { "type": "natural-minus-na" },
+ { "type": "natural-minus-na" }
],
"createdRow": function ( row, data, index ) {
$('td', row).eq(4).attr('title', $('td', row).eq(4).text());
@@ -419,13 +423,13 @@
{ "type": "natural" },
{ "type": "natural", "width": "20%" },
{ "type": "natural", "width": "12%" },
- { "orderDataType": "dom-innertext" },
+ { "type": "natural-minus-na" },
{ "orderDataType": "dom-innertext", 'orderSequence': [ "desc", "asc"] },
{ "type": "natural" },
{ "type": "scientific" },
- { "type": "natural" },
- { "type": "natural" },
- { "type": "natural" }
+ { "type": "natural-minus-na" },
+ { "type": "natural-minus-na" },
+ { "type": "natural-minus-na" }
],
"order": [[9, "asc" ]],
"sDom": "Btir",
@@ -461,7 +465,7 @@
{ "type": "natural" },
{ "type": "natural" },
{ "orderDataType": "dom-innertext", 'orderSequence': [ "desc", "asc"] },
- { "type": "natural" },
+ { "type": "natural-minus-na" },
{ "type": "scientific" }
],
"order": [[6, "asc" ]],
diff --git a/wqflask/wqflask/templates/index_page_orig.html b/wqflask/wqflask/templates/index_page_orig.html
index 06b71f53..6b3bec9a 100755
--- a/wqflask/wqflask/templates/index_page_orig.html
+++ b/wqflask/wqflask/templates/index_page_orig.html
@@ -17,13 +17,13 @@
</header>
-->
- <div class="container-fluid" style="min-width: 1200px;">
+ <div class="container-fluid" style="min-width: 1210px;">
{{ flash_me() }}
<div class="row" style="width: 100%;">
- <div class="col-xs-5" style="min-width: 530px; max-width: 550px;">
+ <div class="col-xs-4" style="margin-right:50px; min-width: 530px; max-width: 550px;">
<section id="search">
<div>
<h1>Select and search</h1>
@@ -84,7 +84,7 @@
<label for="or_search" class="col-xs-1 control-label" style="padding-left: 0px; padding-right: 0px; width: 65px !important;">Get Any:</label>
<div class="col-xs-10 controls" style="padding-left: 20px;">
<div class="col-8">
- <textarea onkeydown="pressed(event)" name="search_terms_or" rows="1" class="form-control search-query" style="max-width: 550px; width: 450px !important;" id="or_search"></textarea>
+ <textarea onkeydown="pressed(event)" name="search_terms_or" rows="1" class="form-control search-query" style="resize: vertical; max-width: 550px; width: 450px !important;" id="or_search"></textarea>
</div>
</div>
</div>
@@ -105,7 +105,7 @@
<label for="and_search" class="col-xs-1 control-label" style="padding-left: 0px; padding-right: 0px; width: 65px !important;">Combined:</label>
<div class="col-xs-10 controls" style="padding-left: 20px;">
<div class="col-8">
- <textarea onkeydown="pressed(event)" name="search_terms_and" rows="1" class="form-control search-query" style="max-width: 550px; width: 450px !important;" id="and_search"></textarea>
+ <textarea onkeydown="pressed(event)" name="search_terms_and" rows="1" class="form-control search-query" style="resize: vertical; max-width: 550px; width: 450px !important;" id="and_search"></textarea>
</div>
</div>
</div>
@@ -184,7 +184,7 @@
</section>
</div>
- <div style="padding-left:80px" class="col-xs-4" style="width: 600px !important;">
+ <div class="col-xs-4" style="width: 600px !important;">
<section id="affiliates">
<div class="page-header">
<h1>Affiliates</h1>
diff --git a/wqflask/wqflask/templates/search_result_page.html b/wqflask/wqflask/templates/search_result_page.html
index 282e752d..e2e1aa46 100644
--- a/wqflask/wqflask/templates/search_result_page.html
+++ b/wqflask/wqflask/templates/search_result_page.html
@@ -127,7 +127,7 @@
<input type="hidden" name="export_data" id="export_data" value="">
<button class="btn btn-default" id="select_all" type="button"><span class="glyphicon glyphicon-ok"></span> Select</button>
<button class="btn btn-success" id="add" type="button" disabled><span class="glyphicon glyphicon-plus-sign"></span> Add</button>
- <button class="btn btn-default" id="export_traits">Download CSV</button>
+ <button class="btn btn-default" id="export_traits">Download <span class="glyphicon glyphicon-download"></span></button>
<input type="text" id="searchbox" class="form-control" style="width: 200px; display: inline;" placeholder="Search This Table For ...">
<input type="text" id="select_top" class="form-control" style="width: 200px; display: inline;" placeholder="Select Top ...">
<button class="btn btn-default" id="deselect_all" type="button"><span class="glyphicon glyphicon-remove"></span> Deselect</button>
@@ -274,10 +274,9 @@
},
{
'title': "Record",
- 'type': "natural",
+ 'type': "natural-minus-na",
'data': null,
'width': "60px",
- 'orderDataType': "dom-inner-text",
'render': function(data, type, row, meta) {
return '<a target="_blank" href="/show_trait?trait_id=' + data.name + '&dataset=' + data.dataset + '">' + data.display_name + '</a>'
}
@@ -315,20 +314,20 @@
'orderSequence': [ "desc", "asc"]
},
{
- 'title': "Max LRS<a href=\"http://genenetwork.org//glossary.html#LRS\" target=\"_blank\" style=\"color: white;\"><sup>?</sup></a>",
+ 'title': "Max LRS<a href=\"http://genenetwork.org//glossary.html#LRS\" target=\"_blank\" style=\"color: white;\"><sup style=\"font-size: small; color: #FF0000;\"> ?</sup></a>",
'type': "natural-minus-na",
'data': "lrs_score",
'width': "80px",
'orderSequence': [ "desc", "asc"]
},
{
- 'title': "Max LRS Location",
+ 'title': "Peak Location",
'type': "natural-minus-na",
- 'width': "150px",
+ 'width': "120px",
'data': "lrs_location"
},
{
- 'title': "Additive Effect<a href=\"http://genenetwork.org//glossary.html#A\" target=\"_blank\" style=\"color: white;\"><sup>?</sup></a>",
+ 'title': "Effect Size<a href=\"http://genenetwork.org//glossary.html#A\" target=\"_blank\" style=\"color: white;\"><sup style=\"font-size: small; color: #FF0000;\"> ?</sup></a>",
'type': "natural-minus-na",
'data': "additive",
'width': "120px",
@@ -367,17 +366,11 @@
author_string = data.authors
}
return author_string
- // try {
- // return decodeURIComponent(escape(author_string))
- // } catch(err){
- // return author_string
- // }
}
},
{
'title': "Year",
'type': "natural-minus-na",
- 'orderDataType': "dom-inner-text",
'data': null,
'width': "80px",
'render': function(data, type, row, meta) {
@@ -390,20 +383,20 @@
'orderSequence': [ "desc", "asc"]
},
{
- 'title': "Max LRS<a href=\"http://genenetwork.org//glossary.html#LRS\" target=\"_blank\" style=\"color: white;\"><sup>?</sup></a>",
+ 'title': "Max LRS<a href=\"http://genenetwork.org//glossary.html#LRS\" target=\"_blank\" style=\"color: white;\"><sup style=\"font-size: small; color: #FF0000;\"> ?</sup></a>",
'type': "natural-minus-na",
'data': "lrs_score",
'width': "80px",
'orderSequence': [ "desc", "asc"]
},
{
- 'title': "Max LRS Location",
+ 'title': "Peak Location",
'type': "natural-minus-na",
- 'width': "150px",
+ 'width': "120px",
'data': "lrs_location"
},
{
- 'title': "Additive Effect<a href=\"http://genenetwork.org//glossary.html#A\" target=\"_blank\" style=\"color: white;\"><sup>?</sup></a>",
+ 'title': "Effect Size<a href=\"http://genenetwork.org//glossary.html#A\" target=\"_blank\" style=\"color: white;\"><sup style=\"font-size: small; color: #FF0000;\"> ?</sup></a>",
'type': "natural-minus-na",
'width': "120px",
'data': "additive",
@@ -412,7 +405,7 @@
{
'title': "Location",
'type': "natural-minus-na",
- 'width': "140px",
+ 'width': "120px",
'data': "location"
}{% endif %}
],
diff --git a/wqflask/wqflask/templates/show_trait_details.html b/wqflask/wqflask/templates/show_trait_details.html
index 8b3e4907..4aced50c 100644
--- a/wqflask/wqflask/templates/show_trait_details.html
+++ b/wqflask/wqflask/templates/show_trait_details.html
@@ -215,43 +215,27 @@
<div style="margin-bottom:15px;" class="btn-toolbar">
<div class="btn-group">
- <a href="#redirect">
- <button type="button" id="add_to_collection" class="btn btn-primary" title="Add to collection">Add</button>
- </a>
+ <button type="button" id="add_to_collection" class="btn btn-success" title="Add to Collection">Add</button>
{% if this_trait.dataset.type == 'ProbeSet' or this_trait.dataset.type == 'Geno' %}
{% if this_trait.symbol != None %}
- <a target="_blank" href="http://gn1.genenetwork.org/webqtl/main.py?cmd=sch&amp;gene={{ this_trait.symbol }}&amp;alias=1&amp;species={{ dataset.group.species }}">
- <button type="button" class="btn btn-default" title="Find similar expression data">Find</button>
- </a>
+ <button type="button" class="btn btn-default" title="Find similar expression data" onclick="window.open('http://gn1.genenetwork.org/webqtl/main.py?cmd=sch&amp;gene={{ this_trait.symbol }}&amp;alias=1&amp;species={{ dataset.group.species }}', '_blank')">Find</button>
{% endif %}
{% if UCSC_BLAT_URL != "" %}
- <a target="_blank" href="{{ UCSC_BLAT_URL }}">
- <button type="button" class="btn btn-default" title="Check probe locations at UCSC">Verify</button>
- </a>
+ <button type="button" class="btn btn-default" title="Check probe locations at UCSC" onclick="window.open('{{ UCSC_BLAT_URL }}', '_blank')">Verify</button>
{% endif %}
{% if this_trait.symbol != None %}
- <a target="_blank" href="http://gn1.genenetwork.org/webqtl/main.py?FormID=geneWiki&symbol={{ this_trait.symbol }}">
- <button type="button" class="btn btn-default" title="Write or review comments about this gene">GeneWiki</button>
- </a>
+ <button type="button" class="btn btn-default" title="Write or review comments about this gene" onclick="window.open('http://gn1.genenetwork.org/webqtl/main.py?FormID=geneWiki&symbol={{ this_trait.symbol }}', '_blank')">GeneWiki</button>
{% if dataset.group.species == "mouse" or dataset.group.species == "rat" %}
- <a href="/snp_browser?first_run=true&species={{ dataset.group.species }}&gene_name={{ this_trait.symbol }}&limit_strains=on">
- <button type="button" class="btn btn-default" title="View SNPs and Indels">SNPs</button>
- </a>
+ <button type="button" class="btn btn-default" title="View SNPs and Indels" onclick="window.open('/snp_browser?first_run=true&species={{ dataset.group.species }}&gene_name={{ this_trait.symbol }}&limit_strains=on', '_blank')">SNPs</button>
{% endif %}
{% endif %}
{% if show_probes == "True" %}
- <a target="_blank" href="http://gn1.genenetwork.org/webqtl/main.py?FormID=showProbeInfo&database={{ this_trait.dataset.name }}&ProbeSetID={{ this_trait.name }}&CellID={{ this_trait.cellid }}&RISet={{ dataset.group.name }}&incparentsf1=ON">
- <button type="button" class="btn btn-default" title="Check sequence of probes">Probes</button>
- </a>
+ <button type="button" class="btn btn-default" title="Check sequence of probes" onclick="window.open('http://gn1.genenetwork.org/webqtl/main.py?FormID=showProbeInfo&database={{ this_trait.dataset.name }}&ProbeSetID={{ this_trait.name }}&CellID={{ this_trait.cellid }}&RISet={{ dataset.group.name }}&incparentsf1=ON', '_blank')">Probes</button>
{% endif %}
{% endif %}
- <a target="_blank" href="http://gn1.genenetwork.org/webqtl/main.py?cmd=show&db={{ this_trait.dataset.name }}&probeset={{ this_trait.name }}">
- <button type="button" id="view_in_gn1" class="btn btn-primary" title="View Trait in GN1">View in GN1</button>
- </a>
+ <button type="button" id="view_in_gn1" class="btn btn-primary" title="View Trait in GN1" onclick="window.open('http://gn1.genenetwork.org/webqtl/main.py?cmd=show&db={{ this_trait.dataset.name }}&probeset={{ this_trait.name }}', '_blank')">Go to GN1</button>
{% if admin_status == "owner" or admin_status == "edit-admins" or admin_status == "edit-access" %}
- <a target="_blank" href="./resources/manage?resource_id={{ resource_id }}">
- <button type="button" id="edit_resource" class="btn btn-success" title="Edit Resource">Edit</button>
- </a>
+ <button type="button" id="edit_resource" class="btn btn-success" title="Edit Resource" onclick="window.open('./resources/manage?resource_id={{ resource_id }}', '_blank')">Edit</button>
{% endif %}
</div>
</div>
diff --git a/wqflask/wqflask/templates/show_trait_edit_data.html b/wqflask/wqflask/templates/show_trait_edit_data.html
index 05a2be73..a8ed91b1 100644
--- a/wqflask/wqflask/templates/show_trait_edit_data.html
+++ b/wqflask/wqflask/templates/show_trait_edit_data.html
@@ -5,7 +5,7 @@
<input type="text" id="{{ sample_type.sample_group_type }}_searchbox" class="form-control" style="width: 200px; display: inline; float: left; vertical-align: top;" placeholder="Search This Table For ...">
</div>
<div style="padding-left: 10px; display: inline;">
- <input type="button" class="btn btn-default export" value="Export">
+ <button class="btn btn-default export">Export <span class="glyphicon glyphicon-download-alt"></span></button>
<select class="select optional span2 export_format">
<option value="excel">Excel</option>
<option value="csv">CSV</option>
diff --git a/wqflask/wqflask/templates/show_trait_statistics.html b/wqflask/wqflask/templates/show_trait_statistics.html
index 974081d3..7bdb3ef9 100644
--- a/wqflask/wqflask/templates/show_trait_statistics.html
+++ b/wqflask/wqflask/templates/show_trait_statistics.html
@@ -76,11 +76,13 @@
<i class="icon-signal"></i> Sort By Value
</button>
</div>
+ <!--
<div class="btn-group">
- <button type="button" class="btn btn-default" id="color_by_trait">
+ <button type="button" class="btn btn-default" id="color_by_trait" style="margin-bottom: 5px;">
<i class="icon-tint"></i> Color by Trait
</button>
</div>
+ -->
<div id="bar_chart_container">
<div id="bar_chart"></div>
</div>
diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py
index 42a10c7a..94ec7137 100644
--- a/wqflask/wqflask/views.py
+++ b/wqflask/wqflask/views.py
@@ -50,7 +50,7 @@ from wqflask.search_results import SearchResultPage
from wqflask.export_traits import export_search_results_csv
from wqflask.gsearch import GSearch
from wqflask.update_search_results import GSearch as UpdateGSearch
-from wqflask.docs import Docs
+from wqflask.docs import Docs, update_text
from wqflask.db_info import InfoPage
from utility import temp_data
@@ -350,7 +350,7 @@ def environments():
@app.route("/update_text", methods=('POST',))
def update_page():
- docs.update_text(request.form)
+ update_text(request.form)
doc = Docs(request.form['entry_type'], request.form)
return render_template("docs.html", **doc.__dict__)