diff options
author | zsloan | 2016-03-14 15:49:13 +0000 |
---|---|---|
committer | zsloan | 2016-03-14 15:49:13 +0000 |
commit | 98293e5a4b68565bc0a26240d111f55c60907006 (patch) | |
tree | aa6f5c752bbf36b52d66adb2e72869c5f7ad0a30 | |
parent | bf599c2e873a619fc6e575fcfba29cd8f8c9a32d (diff) | |
download | genenetwork2-98293e5a4b68565bc0a26240d111f55c60907006.tar.gz |
Changed the way headers look across all pages
Changed the way details are displayed in show trait page
Changed search query so that it orders results by symbol
-rwxr-xr-x | wqflask/base/trait.py | 35 | ||||
-rwxr-xr-x | wqflask/wqflask/do_search.py | 4 | ||||
-rwxr-xr-x | wqflask/wqflask/static/packages/bootstrap/css/docs.css | 4 | ||||
-rwxr-xr-x | wqflask/wqflask/templates/collections/view.html | 12 | ||||
-rwxr-xr-x | wqflask/wqflask/templates/search_result_page.html | 23 | ||||
-rwxr-xr-x | wqflask/wqflask/templates/show_trait.html | 37 | ||||
-rwxr-xr-x | wqflask/wqflask/templates/show_trait_details.html | 133 |
7 files changed, 134 insertions, 114 deletions
diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py index eb9bc940..ff149ba3 100755 --- a/wqflask/base/trait.py +++ b/wqflask/base/trait.py @@ -221,32 +221,6 @@ class GeneralTrait(object): if samplelist == None: samplelist = [] - #assert self.dataset - - #if self.cellid: - # #Probe Data - # query = ''' - # SELECT - # Strain.Name, ProbeData.value, ProbeSE.error, ProbeData.Id - # FROM - # (ProbeData, ProbeFreeze, ProbeSetFreeze, ProbeXRef, - # Strain, Probe, ProbeSet) - # left join ProbeSE on - # (ProbeSE.DataId = ProbeData.Id AND ProbeSE.StrainId = ProbeData.StrainId) - # WHERE - # Probe.Name = '%s' AND ProbeSet.Name = '%s' AND - # Probe.ProbeSetId = ProbeSet.Id AND - # ProbeXRef.ProbeId = Probe.Id AND - # ProbeXRef.ProbeFreezeId = ProbeFreeze.Id AND - # ProbeSetFreeze.ProbeFreezeId = ProbeFreeze.Id AND - # ProbeSetFreeze.Name = '%s' AND - # ProbeXRef.DataId = ProbeData.Id AND - # ProbeData.StrainId = Strain.Id - # Order BY - # Strain.Name - # ''' % (self.cellid, self.name, self.dataset.name) - # - #else: results = self.dataset.retrieve_sample_data(self.name) # Todo: is this necessary? If not remove @@ -260,15 +234,6 @@ class GeneralTrait(object): if not samplelist or (samplelist and name in samplelist): self.data[name] = webqtlCaseData(*item) #name, value, variance, num_cases) - #def keys(self): - # return self.__dict__.keys() - # - #def has_key(self, key): - # return self.__dict__.has_key(key) - # - #def items(self): - # return self.__dict__.items() - def retrieve_info(self, get_qtl_info=False): assert self.dataset, "Dataset doesn't exist" if self.dataset.type == 'Publish': diff --git a/wqflask/wqflask/do_search.py b/wqflask/wqflask/do_search.py index a6f9c949..0e2dd27a 100755 --- a/wqflask/wqflask/do_search.py +++ b/wqflask/wqflask/do_search.py @@ -171,6 +171,7 @@ class MrnaAssaySearch(DoSearch): WHERE %s and ProbeSet.Id = ProbeSetXRef.ProbeSetId and ProbeSetXRef.ProbeSetFreezeId = %s + ORDER BY ProbeSet.symbol ASC """ % (escape(from_clause), where_clause, escape(str(self.dataset.id)))) @@ -192,6 +193,7 @@ class MrnaAssaySearch(DoSearch): WHERE %s and ProbeSet.Id = ProbeSetXRef.ProbeSetId and ProbeSetXRef.ProbeSetFreezeId = %s + ORDER BY ProbeSet.symbol ASC """ % (escape(from_clause), where_clause, escape(str(self.dataset.id)))) @@ -205,7 +207,7 @@ class MrnaAssaySearch(DoSearch): print("Running ProbeSetSearch") where_clause = self.get_where_clause() - query = self.base_query + "WHERE " + where_clause + query = self.base_query + "WHERE " + where_clause + "ORDER BY ProbeSet.symbol ASC" #print("final query is:", pf(query)) diff --git a/wqflask/wqflask/static/packages/bootstrap/css/docs.css b/wqflask/wqflask/static/packages/bootstrap/css/docs.css index 2d6a713c..31616821 100755 --- a/wqflask/wqflask/static/packages/bootstrap/css/docs.css +++ b/wqflask/wqflask/static/packages/bootstrap/css/docs.css @@ -94,7 +94,7 @@ hr.soften { .jumbotron { position: relative; padding: 0px 0; - color: #336699; + color: black; text-align: left; text-shadow: 0 1px 3px rgba(0,0,0,.4), 0 0 30px rgba(0,0,0,.075); background: #d5d5d5; /* Old browsers */ @@ -107,7 +107,7 @@ hr.soften { line-height: 1; } .jumbotron p { - font-size: 15px; + font-size: 20px; font-weight: 300; line-height: 20px; margin-bottom: 10px; diff --git a/wqflask/wqflask/templates/collections/view.html b/wqflask/wqflask/templates/collections/view.html index a53759c4..f92d9984 100755 --- a/wqflask/wqflask/templates/collections/view.html +++ b/wqflask/wqflask/templates/collections/view.html @@ -8,13 +8,17 @@ {% endblock %} {% block content %} <!-- Start of body --> + + <div class="container"> {% if uc %} - {{ header(uc.name, - 'This collection has {}.'.format(numify(trait_obs|count, "record", "records"))) }} + <h2>{{ uc.name }}</h2> + <h3>{{ 'This collection has {}.'.format(numify(trait_obs|count, "record", "records")) }}</h3> {% else %} - {{ header('Your Collection', - 'This collection has {}.'.format(numify(trait_obs|count, "record", "records"))) }} + <h2>Your Collection</h2> + <h3>{{ 'This collection has {}.'.format(numify(trait_obs|count, "record", "records")) }}</h3> {% endif %} + </div> + <div class="container"> <div> {% if uc %} diff --git a/wqflask/wqflask/templates/search_result_page.html b/wqflask/wqflask/templates/search_result_page.html index ff3e04bb..a4ef68b9 100755 --- a/wqflask/wqflask/templates/search_result_page.html +++ b/wqflask/wqflask/templates/search_result_page.html @@ -2,6 +2,7 @@ {% block title %}Search Results{% endblock %} {% block css %} <link rel="stylesheet" type="text/css" href="/static/new/packages/DataTables/css/jquery.dataTables.css" /> + <link rel="stylesheet" type="text/css" href="//cdn.datatables.net/scroller/1.4.1/css/scroller.dataTables.min.css"> <link rel="stylesheet" type="text/css" href="/static/new/packages/DataTables/extensions/dataTables.fixedHeader.css" > <link rel="stylesheet" type="text/css" href="//cdn.datatables.net/fixedcolumns/3.0.4/css/dataTables.fixedColumns.css"> <link rel="stylesheet" type="text/css" href="/static/new/packages/DataTables/extensions/buttons.bootstrap.css" /> @@ -161,6 +162,7 @@ <script language="javascript" type="text/javascript" src="https://cdn.datatables.net/1.10.8/js/jquery.dataTables.min.js"></script> <script language="javascript" type="text/javascript" src="https://cdn.datatables.net/buttons/1.0.0/js/dataTables.buttons.min.js"></script> + <script language="javascript" type="text/javascript" src="https://cdn.datatables.net/scroller/1.4.1/js/dataTables.scroller.min.js"></script> <script language="javascript" type="text/javascript" src="https://cdn.datatables.net/buttons/1.0.0/js/buttons.html5.min.js"></script> <script language="javascript" type="text/javascript" src="https://cdn.datatables.net/buttons/1.0.0/js/buttons.bootstrap.min.js"></script> <script language="javascript" type="text/javascript" src="/static/new/js_external/jszip.min.js"></script> @@ -217,8 +219,29 @@ } }); +/* + serverSide: true, + ajax: function ( data, callback, settings ) { + var out = []; + + for ( var i=data.start, ien=data.start+data.length ; i<ien ; i++ ) { + out.push( [ i+'-1', i+'-2', i+'-3', i+'-4', i+'-5' ] ); + } + + setTimeout( function () { + callback( { + draw: data.draw, + data: out, + recordsTotal: 5000000, + recordsFiltered: 5000000 + } ); + }, 50 ); + }, +*/ + console.time("Creating table"); {% if dataset.type == 'ProbeSet' %} + //ZS: Need to make sort by symbol, also need to make sure blank symbol fields at the bottom and symbols starting with numbers below letters $('#trait_table').DataTable( { "columns": [ { "type": "natural" }, diff --git a/wqflask/wqflask/templates/show_trait.html b/wqflask/wqflask/templates/show_trait.html index 0d463d5b..4720f8ec 100755 --- a/wqflask/wqflask/templates/show_trait.html +++ b/wqflask/wqflask/templates/show_trait.html @@ -16,13 +16,18 @@ {% endblock %} {% block content %} <!-- Start of body --> +<!-- {% if this_trait.dataset.type != 'Geno' %} {{ header("{}".format(this_trait.name_header_fmt), '{}: {}'.format(this_trait.name, this_trait.description_fmt)) }} {% else %} {{ header("{}".format(this_trait.name_header_fmt)) }} {% endif %} - +--> + <div class="container"> + <h2>Trait Data and Analysis for <b>{{ this_trait.name }}</b></h2> + <h3>{{ this_trait.description_fmt }}</h3> + </div> <form method="post" target="_blank" action="/corr_compute" name="trait_page" id="trait_data_form" class="form-horizontal"> @@ -36,40 +41,50 @@ <input type="hidden" name="temp_uuid" id="temp_uuid" value="{{ temp_uuid }}"> <div class="container"> - - {% include 'show_trait_details.html' %} <div class="panel-group" id="accordion"> <div class="panel panel-default"> - <div class="panel-heading" data-toggle="collapse" data-parent="#accordion" data-target="#collapseOne"> + <div class="panel-heading" data-toggle="collapse" data-parent="#accordion" data-target="#collapseOne" aria-expanded="true"> + <h3 class="panel-title"> + <span class="glyphicon glyphicon-chevron-down"></span> Details and Links + </h3> + </div> + <div id="collapseOne" class="panel-collapse collapse" aria-expanded="true"> + <div class="panel-body"> + {% include 'show_trait_details.html' %} + </div> + </div> + </div> + <div class="panel panel-default"> + <div class="panel-heading" data-toggle="collapse" data-parent="#accordion" data-target="#collapseTwo"> <h3 class="panel-title"> <span class="glyphicon glyphicon-chevron-down"></span> Statistics </h3> </div> - <div id="collapseOne" class="panel-collapse collapse in"> + <div id="collapseTwo" class="panel-collapse collapse in"> <div class="panel-body"> {% include 'show_trait_statistics.html' %} </div> </div> </div> <div class="panel panel-default"> - <div class="panel-heading" data-toggle="collapse" data-parent="#accordion" data-target="#collapseTwo"> + <div class="panel-heading" data-toggle="collapse" data-parent="#accordion" data-target="#collapseThree"> <h3 class="panel-title"> <span class="glyphicon glyphicon-chevron-down"></span> Calculate Correlations </h3> </div> - <div id="collapseTwo" class="panel-collapse collapse in"> + <div id="collapseThree" class="panel-collapse collapse in"> <div class="panel-body"> {% include 'show_trait_calculate_correlations.html' %} </div> </div> </div> <div class="panel panel-default"> - <div class="panel-heading" data-toggle="collapse" data-parent="#accordion" data-target="#collapseThree"> + <div class="panel-heading" data-toggle="collapse" data-parent="#accordion" data-target="#collapseFour"> <h3 class="panel-title"> <span class="glyphicon glyphicon-chevron-down"></span> Mapping Tools </h3> </div> - <div id="collapseThree" class="panel-collapse collapse in"> + <div id="collapseFour" class="panel-collapse collapse in"> <div class="panel-body"> {% include 'show_trait_mapping_tools.html' %} </div> @@ -77,12 +92,12 @@ </div> </div> <div class="panel panel-default"> - <div class="panel-heading" data-toggle="collapse" data-parent="#accordion" data-target="#collapseFour" aria-expanded="true"> + <div class="panel-heading" data-toggle="collapse" data-parent="#accordion" data-target="#collapseFive" aria-expanded="true"> <h3 class="panel-title"> <span class="glyphicon glyphicon-chevron-up"></span> Review and Edit Data </h3> </div> - <div id="collapseFour" class="panel-collapse collapse" aria-expanded="true"> + <div id="collapseFive" class="panel-collapse collapse" aria-expanded="true"> <div class="panel-body"> {% include 'show_trait_edit_data.html' %} </div> diff --git a/wqflask/wqflask/templates/show_trait_details.html b/wqflask/wqflask/templates/show_trait_details.html index 16c5dc47..ccb3b51b 100755 --- a/wqflask/wqflask/templates/show_trait_details.html +++ b/wqflask/wqflask/templates/show_trait_details.html @@ -1,71 +1,82 @@ -<dl class="dl-horizontal"> - <dt>Species</dt> - <dd>{{ this_trait.dataset.group.species }}</dd> - <dt>Group</dt> - <dd>{{ this_trait.dataset.group.name }}</dd> - <dt>Tissue</dt> - <dd>{{ this_trait.dataset.tissue }}</dd> +<table class="table"> + <tr> + <td>Species</td> + <td>{{ this_trait.dataset.group.species }}</td> + </tr> + <tr> + <td>Group</td> + <td>{{ this_trait.dataset.group.name }}</td> + </tr> + <tr> + <td>Tissue</td> + <td>{{ this_trait.dataset.tissue }}</td> + </tr> {% if this_trait.dataset.type == 'ProbeSet' %} - <dt>Aliases</dt> - <dd>{{ this_trait.alias_fmt }}</dd> + <tr> + <td>Aliases</td> + <td>{{ this_trait.alias_fmt|replace(",",";") }}</td> + </tr> {% endif %} - {% if this_trait.dataset.type != 'Publish' %} - <dt>Location</dt> - <dd>{{ this_trait.location_fmt }}</dd> + <tr> + <td>Location</td> + <td>{{ this_trait.location_fmt }}</td> + </tr> {% endif %} - - <dt>Database</dt> - <dd> - <a href="{{ url_for('static', filename='dbdoc/' + dataset.fullname + '.html') }}" target="_blank"> - {{ dataset.name }} - </a> - </dd> - + <tr> + <td>Database</td> + <td> + <a href="{{ url_for('static', filename='dbdoc/' + dataset.fullname + '.html') }}" target="_blank"> + {{ dataset.fullname }} + </a> + </td> + </tr> {% if this_trait.probe_set_specificity %} - <dt> - <a href="/blatInfo.html" target="_blank" - title="Values higher than 2 for the specificity are good"> - BLAT Specificity - </a> - </dt> - <dd>{{ "%0.3f" | format(this_trait.probe_set_specificity|float) }}</dd> + <tr> + <td>Target Score</td> + <td> + <a href="/blatInfo.html" target="_blank" + title="Values higher than 2 for the specificity are good"> + BLAT Specificity + </a>: + {{ "%0.3f" | format(this_trait.probe_set_specificity|float) }} + + {% if this_trait.probe_set_blat_score %} + Score: {{ "%0.3f" | format(this_trait.probe_set_blat_score|float) }} + {% endif %} + </td> + </tr> {% endif %} - {% if this_trait.probe_set_blat_score %} - <dt>BLAT Score</dt> - <dd>{{ "%0.3f" | format(this_trait.probe_set_blat_score|float) }}</dd> - {% endif %} - <dt>Resource Links</dt> - {% if this_trait.dataset.type == 'ProbeSet' %} - <dd> - {% if this_trait.geneid != None %} - <a href="http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=gene&cmd=Retrieve&dopt=Graphics&list_uids={{ this_trait.geneid }}" target="_blank" title="Info from NCBI Entrez Gene"> - Gene - </a> - + <tr> + <td>Resource Links</td> + <td> + {% if this_trait.geneid != None %} + <a href="http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=gene&cmd=Retrieve&dopt=Graphics&list_uids={{ this_trait.geneid }}" target="_blank" title="Info from NCBI Entrez Gene"> + Gene + </a> + + {% endif %} + {% if this_trait.omim != None %} + <a href="http://www.ncbi.nlm.nih.gov/omim/{{ this_trait.omim }}" target="_blank" title="Summary from On Mendelion Inheritance in Man"> + OMIM + </a> + + {% endif %} + {% if this_trait.genbankid != None %} + <a href="http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=Nucleotide&cmd=search&doptcmdl=DocSum&term={{ this_trait.genbankid }}" target="_blank" title="Find the original GenBank sequence used to design the probes"> + GenBank + </a> + + {% endif %} + {% if this_trait.symbol != None %} + <a href="http://www.genotation.org/Getd2g.pl?gene_list={{ this_trait.symbol }}" target="_blank" title="Related descriptive, genomic, clinical, functional and drug-therapy information"> + Genotation + </a> + {% endif %} - {% if this_trait.omim != None %} - <a href="http://www.ncbi.nlm.nih.gov/omim/{{ this_trait.omim }}" target="_blank" title="Summary from On Mendelion Inheritance in Man"> - OMIM - </a> - - {% endif %} - {% if this_trait.genbankid != None %} - <a href="http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=Nucleotide&cmd=search&doptcmdl=DocSum&term={{ this_trait.genbankid }}" target="_blank" title="Find the original GenBank sequence used to design the probes"> - GenBank - </a> - - {% endif %} - {% if this_trait.symbol != None %} - <a href="http://www.genotation.org/Getd2g.pl?gene_list={{ this_trait.symbol }}" target="_blank" title="Related descriptive, genomic, clinical, functional and drug-therapy information"> - Genotation - </a> - - {% endif %} - </dd> - {% endif %} -</dl> - + </td> + </tr> +</table> <div style="margin-bottom:15px;" class="btn-toolbar"> <div class="btn-group"> |