From 1517b200476380179e5c53c141a874348e28dd87 Mon Sep 17 00:00:00 2001 From: zsloan Date: Mon, 22 May 2017 15:57:26 +0000 Subject: Added submit trait to header menu and fixed some minor issues with Network Graph interface --- wqflask/wqflask/templates/base.html | 3 +++ wqflask/wqflask/templates/network_graph.html | 17 ++--------------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/wqflask/wqflask/templates/base.html b/wqflask/wqflask/templates/base.html index ec55ebeb..ba8ef769 100644 --- a/wqflask/wqflask/templates/base.html +++ b/wqflask/wqflask/templates/base.html @@ -39,6 +39,9 @@
  • Search
  • +
  • + Submit Trait +
  • Collections {% if g.user_session.user_ob %} diff --git a/wqflask/wqflask/templates/network_graph.html b/wqflask/wqflask/templates/network_graph.html index 57426af7..50c0c230 100644 --- a/wqflask/wqflask/templates/network_graph.html +++ b/wqflask/wqflask/templates/network_graph.html @@ -45,7 +45,8 @@ 0               -               +/- 1 +               +              +/- 1 @@ -82,20 +83,6 @@ - - - - - - - - - - - - - - -- cgit 1.4.1 From 6c3edf38ecc6549bc2cdf3893067d64a0a8e0ba3 Mon Sep 17 00:00:00 2001 From: zsloan Date: Wed, 31 May 2017 16:01:21 +0000 Subject: Added various tool options to correlation results page and improved table appearance for mRNA assay data sets (still need to improve it for others) Fixed minor logic issue in trait.py --- wqflask/base/trait.py | 2 + wqflask/wqflask/templates/correlation_page.html | 152 +++++++++++++++++++++--- 2 files changed, 137 insertions(+), 17 deletions(-) diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py index e22a51e4..33a4efe9 100644 --- a/wqflask/base/trait.py +++ b/wqflask/base/trait.py @@ -206,6 +206,8 @@ class GeneralTrait(object): formatted = self.description if self.probe_target_description: formatted += "; " + self.probe_target_description + else: + formatted = "Not available" elif self.dataset.type == 'Publish': if self.confidential: formatted = self.pre_publication_description diff --git a/wqflask/wqflask/templates/correlation_page.html b/wqflask/wqflask/templates/correlation_page.html index f5fe2120..fbf373f6 100644 --- a/wqflask/wqflask/templates/correlation_page.html +++ b/wqflask/wqflask/templates/correlation_page.html @@ -21,6 +21,35 @@ and analysis page.

    +
    +
    + {% if uc %} + + {% endif %} + + + + + + + + + + + +
    +
    +

    @@ -31,9 +60,10 @@

    +
    - +
    @@ -99,7 +129,7 @@ {% for trait in correlation_results %} - + + @@ -167,8 +197,6 @@ - - -- cgit 1.4.1 From be458ca49557b93d2e5b8a0407d42f0a2fe9673f Mon Sep 17 00:00:00 2001 From: zsloan Date: Fri, 9 Jun 2017 17:19:36 +0000 Subject: - Changed the way the genofile is set so different genofiles can be selected for mapping - Now shows error page for Correlation Matrix if traits aren't all from the same group (later need to make it check for shared samples, since different groups may contain some of the same samples - Mapping results page now displays the genofile in the information section - Only show Interval Analyst if species is mouse or rat (previously it would show a blank table for other species) - Network Graph now only shows links in a node's info if the relevant information (for example geneid) exists, and the label changes depending on the type of data set - Other minor changes to the appearance of the Network Graph menu (less white space, plus clickable descriptions for a couple options) - Improved Correlations Results page to shorten Description and Authors cell content for Phenotype traits (to keep table width manageable) - Changed the glossary links for LRS and Additive Effect columns for Gene Global Search - Improved appearance for Phenotype Global Search results - Temporarily removed Mapping options/features that don't work from the trait page --- wqflask/base/data_set.py | 7 +- .../wqflask/correlation_matrix/show_corr_matrix.py | 163 +++++++++++---------- .../wqflask/marker_regression/marker_regression.py | 11 +- .../marker_regression/marker_regression_gn1.py | 2 + wqflask/wqflask/network_graph/network_graph.py | 22 ++- wqflask/wqflask/static/new/css/network_graph.css | 1 - .../wqflask/static/new/javascript/network_graph.js | 16 +- wqflask/wqflask/templates/correlation_matrix.html | 16 +- wqflask/wqflask/templates/correlation_page.html | 13 +- wqflask/wqflask/templates/empty_collection.html | 15 -- wqflask/wqflask/templates/gsearch_gene.html | 12 +- wqflask/wqflask/templates/gsearch_pheno.html | 76 +++++----- .../wqflask/templates/marker_regression_gn1.html | 13 +- wqflask/wqflask/templates/network_graph.html | 23 ++- .../templates/show_trait_mapping_tools.html | 26 +--- 15 files changed, 213 insertions(+), 203 deletions(-) delete mode 100644 wqflask/wqflask/templates/empty_collection.html diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py index 4959457a..dbdbb51c 100644 --- a/wqflask/base/data_set.py +++ b/wqflask/base/data_set.py @@ -169,7 +169,7 @@ def mescape(*items): class Markers(object): """Todo: Build in cacheing so it saves us reading the same file more than once""" def __init__(self, name): - json_data_fh = open(locate(name + '.json','genotype/json')) + json_data_fh = open(locate(name + ".json",'genotype/json')) try: markers = json.load(json_data_fh) except: @@ -334,7 +334,10 @@ class DatasetGroup(object): else: marker_class = Markers - self.markers = marker_class(self.name) + if self.genofile: + self.markers = marker_class(self.genofile[:-5]) + else: + self.markers = marker_class(self.name) def get_f1_parent_strains(self): try: diff --git a/wqflask/wqflask/correlation_matrix/show_corr_matrix.py b/wqflask/wqflask/correlation_matrix/show_corr_matrix.py index 95a5f6a6..b34beb7b 100644 --- a/wqflask/wqflask/correlation_matrix/show_corr_matrix.py +++ b/wqflask/wqflask/correlation_matrix/show_corr_matrix.py @@ -72,7 +72,14 @@ class CorrelationMatrix(object): self.all_sample_list = [] self.traits = [] + self.insufficient_shared_samples = False + this_group = self.trait_list[0][1].group.name #ZS: Getting initial group name before verifying all traits are in the same group in the following loop for trait_db in self.trait_list: + if trait_db[1].group.name != this_group: + self.insufficient_shared_samples = True + break + else: + this_group = trait_db[1].group.name this_trait = trait_db[0] self.traits.append(this_trait) this_sample_data = this_trait.data @@ -81,100 +88,102 @@ class CorrelationMatrix(object): if sample not in self.all_sample_list: self.all_sample_list.append(sample) - self.sample_data = [] - for trait_db in self.trait_list: - this_trait = trait_db[0] - this_sample_data = this_trait.data - - this_trait_vals = [] - for sample in self.all_sample_list: - if sample in this_sample_data: - this_trait_vals.append(this_sample_data[sample].value) - else: - this_trait_vals.append('') - self.sample_data.append(this_trait_vals) + if self.insufficient_shared_samples: + pass + else: + self.sample_data = [] + for trait_db in self.trait_list: + this_trait = trait_db[0] + this_sample_data = this_trait.data - if len(this_trait_vals) < len(self.trait_list): #Shouldn't do PCA if there are more traits than observations/samples - return False + this_trait_vals = [] + for sample in self.all_sample_list: + if sample in this_sample_data: + this_trait_vals.append(this_sample_data[sample].value) + else: + this_trait_vals.append('') + self.sample_data.append(this_trait_vals) - self.lowest_overlap = 8 #ZS: Variable set to the lowest overlapping samples in order to notify user, or 8, whichever is lower (since 8 is when we want to display warning) + if len(this_trait_vals) < len(self.trait_list): #Shouldn't do PCA if there are more traits than observations/samples + return False - self.corr_results = [] - self.pca_corr_results = [] - self.trait_data_array = [] - for trait_db in self.trait_list: - this_trait = trait_db[0] - this_db = trait_db[1] + self.lowest_overlap = 8 #ZS: Variable set to the lowest overlapping samples in order to notify user, or 8, whichever is lower (since 8 is when we want to display warning) - this_db_samples = this_db.group.all_samples_ordered() - this_sample_data = this_trait.data + self.corr_results = [] + self.pca_corr_results = [] + self.trait_data_array = [] + for trait_db in self.trait_list: + this_trait = trait_db[0] + this_db = trait_db[1] - this_trait_vals = [] - for index, sample in enumerate(this_db_samples): - if (sample in this_sample_data): - sample_value = this_sample_data[sample].value - this_trait_vals.append(sample_value) - self.trait_data_array.append(this_trait_vals) - - corr_result_row = [] - pca_corr_result_row = [] - is_spearman = False #ZS: To determine if it's above or below the diagonal - for target in self.trait_list: - target_trait = target[0] - target_db = target[1] - target_samples = target_db.group.all_samples_ordered() - target_sample_data = target_trait.data + this_db_samples = this_db.group.all_samples_ordered() + this_sample_data = this_trait.data this_trait_vals = [] - target_vals = [] - for index, sample in enumerate(target_samples): - if (sample in this_sample_data) and (sample in target_sample_data): + for index, sample in enumerate(this_db_samples): + if (sample in this_sample_data): sample_value = this_sample_data[sample].value - target_sample_value = target_sample_data[sample].value this_trait_vals.append(sample_value) - target_vals.append(target_sample_value) - - this_trait_vals, target_vals, num_overlap = corr_result_helpers.normalize_values(this_trait_vals, target_vals) - - if num_overlap < self.lowest_overlap: - self.lowest_overlap = num_overlap - if num_overlap == 0: - corr_result_row.append([target_trait, 0, num_overlap]) - pca_corr_result_row.append(0) - else: - pearson_r, pearson_p = scipy.stats.pearsonr(this_trait_vals, target_vals) - if is_spearman == False: - sample_r, sample_p = pearson_r, pearson_p - if sample_r == 1: - is_spearman = True + self.trait_data_array.append(this_trait_vals) + + corr_result_row = [] + pca_corr_result_row = [] + is_spearman = False #ZS: To determine if it's above or below the diagonal + for target in self.trait_list: + target_trait = target[0] + target_db = target[1] + target_samples = target_db.group.all_samples_ordered() + target_sample_data = target_trait.data + + this_trait_vals = [] + target_vals = [] + for index, sample in enumerate(target_samples): + if (sample in this_sample_data) and (sample in target_sample_data): + sample_value = this_sample_data[sample].value + target_sample_value = target_sample_data[sample].value + this_trait_vals.append(sample_value) + target_vals.append(target_sample_value) + + this_trait_vals, target_vals, num_overlap = corr_result_helpers.normalize_values(this_trait_vals, target_vals) + + if num_overlap < self.lowest_overlap: + self.lowest_overlap = num_overlap + if num_overlap == 0: + corr_result_row.append([target_trait, 0, num_overlap]) + pca_corr_result_row.append(0) else: - sample_r, sample_p = scipy.stats.spearmanr(this_trait_vals, target_vals) - - corr_result_row.append([target_trait, sample_r, num_overlap]) - pca_corr_result_row.append(pearson_r) + pearson_r, pearson_p = scipy.stats.pearsonr(this_trait_vals, target_vals) + if is_spearman == False: + sample_r, sample_p = pearson_r, pearson_p + if sample_r == 1: + is_spearman = True + else: + sample_r, sample_p = scipy.stats.spearmanr(this_trait_vals, target_vals) - self.corr_results.append(corr_result_row) - self.pca_corr_results.append(pca_corr_result_row) + corr_result_row.append([target_trait, sample_r, num_overlap]) + pca_corr_result_row.append(pearson_r) - corr_result_eigen = la.eigenvectors(numarray.array(self.pca_corr_results)) - corr_eigen_value, corr_eigen_vectors = sortEigenVectors(corr_result_eigen) + self.corr_results.append(corr_result_row) + self.pca_corr_results.append(pca_corr_result_row) - groups = [] - for sample in self.all_sample_list: - groups.append(1) + corr_result_eigen = la.eigenvectors(numarray.array(self.pca_corr_results)) + corr_eigen_value, corr_eigen_vectors = sortEigenVectors(corr_result_eigen) - pca = self.calculate_pca(range(len(self.traits)), corr_eigen_value, corr_eigen_vectors) + groups = [] + for sample in self.all_sample_list: + groups.append(1) - self.loadings_array = self.process_loadings() + pca = self.calculate_pca(range(len(self.traits)), corr_eigen_value, corr_eigen_vectors) - self.js_data = dict(traits = [trait.name for trait in self.traits], - groups = groups, - cols = range(len(self.traits)), - rows = range(len(self.traits)), - samples = self.all_sample_list, - sample_data = self.sample_data,) - # corr_results = [result[1] for result in result_row for result_row in self.corr_results]) + self.loadings_array = self.process_loadings() + self.js_data = dict(traits = [trait.name for trait in self.traits], + groups = groups, + cols = range(len(self.traits)), + rows = range(len(self.traits)), + samples = self.all_sample_list, + sample_data = self.sample_data,) + # corr_results = [result[1] for result in result_row for result_row in self.corr_results]) def get_trait_db_obs(self, trait_db_list): diff --git a/wqflask/wqflask/marker_regression/marker_regression.py b/wqflask/wqflask/marker_regression/marker_regression.py index 8882c515..60424468 100644 --- a/wqflask/wqflask/marker_regression/marker_regression.py +++ b/wqflask/wqflask/marker_regression/marker_regression.py @@ -148,6 +148,10 @@ class MarkerRegression(object): self.showGenes = "ON" self.viewLegend = "ON" + if 'genofile' in start_vars: + if start_vars['genofile'] != "": + self.genofile_string = start_vars['genofile'] + self.dataset.group.genofile = self.genofile_string.split(":")[0] self.dataset.group.get_markers() if self.mapping_method == "gemma": self.score_type = "-log(p)" @@ -162,11 +166,10 @@ class MarkerRegression(object): self.mapping_scale = "morgan" self.control_marker = start_vars['control_marker'] self.do_control = start_vars['do_control'] - self.dataset.group.genofile = start_vars['genofile'] self.method = start_vars['mapmethod_rqtl_geno'] self.model = start_vars['mapmodel_rqtl_geno'] - if start_vars['pair_scan'] == "true": - self.pair_scan = True + #if start_vars['pair_scan'] == "true": + # self.pair_scan = True if self.permCheck and self.num_perm > 0: self.perm_output, self.suggestive, self.significant, results = rqtl_mapping.run_rqtl_geno(self.vals, self.dataset, self.method, self.model, self.permCheck, self.num_perm, self.do_control, self.control_marker, self.manhattan_plot, self.pair_scan) else: @@ -198,7 +201,6 @@ class MarkerRegression(object): self.control_marker = start_vars['control_marker'] self.do_control = start_vars['do_control'] - self.dataset.group.genofile = start_vars['genofile'] logger.info("Running qtlreaper") results, self.json_data, self.perm_output, self.suggestive, self.significant, self.bootstrap_results = qtlreaper_mapping.gen_reaper_results(self.this_trait, self.dataset, @@ -217,7 +219,6 @@ class MarkerRegression(object): #results = self.run_plink() elif self.mapping_method == "pylmm": logger.debug("RUNNING PYLMM") - self.dataset.group.genofile = start_vars['genofile'] if self.num_perm > 0: self.run_permutations(str(temp_uuid)) results = self.gen_data(str(temp_uuid)) diff --git a/wqflask/wqflask/marker_regression/marker_regression_gn1.py b/wqflask/wqflask/marker_regression/marker_regression_gn1.py index 82a44796..d99ac074 100644 --- a/wqflask/wqflask/marker_regression/marker_regression_gn1.py +++ b/wqflask/wqflask/marker_regression/marker_regression_gn1.py @@ -171,6 +171,8 @@ class MarkerRegression(object): self.dataset = start_vars['dataset'] self.this_trait = start_vars['this_trait'] self.species = start_vars['species'] + if 'genofile_string' in start_vars: + self.genofile_string = start_vars['genofile_string'] #Needing for form submission when doing single chr mapping or remapping after changing options self.samples = start_vars['samples'] diff --git a/wqflask/wqflask/network_graph/network_graph.py b/wqflask/wqflask/network_graph/network_graph.py index cebe5c03..4ce6c48d 100644 --- a/wqflask/wqflask/network_graph/network_graph.py +++ b/wqflask/wqflask/network_graph/network_graph.py @@ -181,12 +181,21 @@ class NetworkGraph(object): self.edges_list.append(edge_dict) - node_dict = { 'data' : {'id' : str(this_trait.name) + ":" + str(this_trait.dataset.name), - 'label' : this_trait.name, - 'symbol' : this_trait.symbol, - 'geneid' : this_trait.geneid, - 'omim' : this_trait.omim, - 'max_corr' : max_corr } } + if trait_db[1].type == "ProbeSet": + node_dict = { 'data' : {'id' : str(this_trait.name) + ":" + str(this_trait.dataset.name), + 'label' : this_trait.symbol, + 'symbol' : this_trait.symbol, + 'geneid' : this_trait.geneid, + 'omim' : this_trait.omim, + 'max_corr' : max_corr } } + elif trait_db[1].type == "Publish": + node_dict = { 'data' : {'id' : str(this_trait.name) + ":" + str(this_trait.dataset.name), + 'label' : this_trait.name, + 'max_corr' : max_corr } } + else: + node_dict = { 'data' : {'id' : str(this_trait.name) + ":" + str(this_trait.dataset.name), + 'label' : this_trait.name, + 'max_corr' : max_corr } } self.nodes_list.append(node_dict) #self.network_data['dataSchema'] = {'nodes' : [{'name' : "label" , 'type' : "string"}], @@ -211,7 +220,6 @@ class NetworkGraph(object): # corr_results = [result[1] for result in result_row for result_row in self.corr_results]) def get_trait_db_obs(self, trait_db_list): - self.trait_list = [] for i, trait_db in enumerate(trait_db_list): if i == (len(trait_db_list) - 1): diff --git a/wqflask/wqflask/static/new/css/network_graph.css b/wqflask/wqflask/static/new/css/network_graph.css index 1cba546a..1a0bafeb 100644 --- a/wqflask/wqflask/static/new/css/network_graph.css +++ b/wqflask/wqflask/static/new/css/network_graph.css @@ -14,7 +14,6 @@ position: relative; float: left; width: 18.5em; - padding: 1em 1em 1em 1em; background: #fff url('/static/new/images/a1.gif') top right repeat-y; } diff --git a/wqflask/wqflask/static/new/javascript/network_graph.js b/wqflask/wqflask/static/new/javascript/network_graph.js index d1afd47c..731acf1a 100644 --- a/wqflask/wqflask/static/new/javascript/network_graph.js +++ b/wqflask/wqflask/static/new/javascript/network_graph.js @@ -12,7 +12,7 @@ window.onload=function() { selector: 'node', style: { 'background-color': '#666', - 'label': 'data(symbol)', + 'label': 'data(label )', 'font-size': 10 } }, @@ -81,10 +81,18 @@ window.onload=function() { function create_qtips(cy){ cy.nodes().qtip({ content: function(){ + qtip_content = '' gn_link = ''+''+this.data().id +''+'
    ' - ncbi_link = 'NCBI'+'
    ' - omim_link = '
    OMIM'+'
    ' - qtip_content = gn_link + ncbi_link + omim_link + qtip_content += gn_link + if (typeof(this.data().geneid) !== 'undefined'){ + ncbi_link = '
    NCBI'+'
    ' + qtip_content += ncbi_link + } + if (typeof(this.data().omim) !== 'undefined'){ + omim_link = '
    OMIM'+'
    ' + qtip_content += omim_link + } + //qtip_content = gn_link + ncbi_link + omim_link return qtip_content //return ''+'
    '+this.data().id +''+'' }, diff --git a/wqflask/wqflask/templates/correlation_matrix.html b/wqflask/wqflask/templates/correlation_matrix.html index eb675568..ab793d58 100644 --- a/wqflask/wqflask/templates/correlation_matrix.html +++ b/wqflask/wqflask/templates/correlation_matrix.html @@ -64,21 +64,15 @@

    Factor Loadings Plot

    -
    - +

    Factor Loadings Table

    -
      {{ loop.index }} {{ trait.location_repr }}{{ trait.location_repr }} {{ '%0.3f' % trait.mean|float }} {% if trait.LRS_score_repr != "N/A" %}{{ '%0.1f' % trait.LRS_score_repr|float }}{% else %}N/A{% endif %} {{ trait.LRS_location_repr }}
    +
    - - - {% if trait_list|length > 2 %}{% endif %} - + + + {% if trait_list|length > 2 %}{% endif %} diff --git a/wqflask/wqflask/templates/correlation_page.html b/wqflask/wqflask/templates/correlation_page.html index fbf373f6..fa9e3585 100644 --- a/wqflask/wqflask/templates/correlation_page.html +++ b/wqflask/wqflask/templates/correlation_page.html @@ -383,8 +383,8 @@ { "type": "natural" }, { "type": "natural" }, { "type": "natural" }, - { "type": "natural", "width": "25%" }, - { "type": "natural", "width": "15%" }, + { "type": "natural", "width": "20%" }, + { "type": "natural", "width": "12%" }, { "type": "natural" }, { "type": "natural" }, { "type": "natural" }, @@ -394,9 +394,14 @@ { "type": "scientific" } ], "createdRow": function ( row, data, index ) { + $('td', row).eq(3).attr('title', $('td', row).eq(3).text()); + if ($('td', row).eq(3).text().length > 50) { + $('td', row).eq(3).text($('td', row).eq(3).text().substring(0, 50)); + $('td', row).eq(3).text($('td', row).eq(3).text() + '...') + } $('td', row).eq(4).attr('title', $('td', row).eq(4).text()); - if ($('td', row).eq(4).text().length > 60) { - $('td', row).eq(4).text($('td', row).eq(4).text().substring(0, 60)); + if ($('td', row).eq(4).text().length > 40) { + $('td', row).eq(4).text($('td', row).eq(4).text().substring(0, 40)); $('td', row).eq(4).text($('td', row).eq(4).text() + '...') } }, diff --git a/wqflask/wqflask/templates/empty_collection.html b/wqflask/wqflask/templates/empty_collection.html deleted file mode 100644 index 3f2b3786..00000000 --- a/wqflask/wqflask/templates/empty_collection.html +++ /dev/null @@ -1,15 +0,0 @@ -{% extends "base.html" %} -{% block title %}{{ tool }}{% endblock %} -{% block content %} - - {{ header("Error") }} - -
    - -

    You must select at least one trait to use the {{ tool }}.

    -
    - - - - -{% endblock %} diff --git a/wqflask/wqflask/templates/gsearch_gene.html b/wqflask/wqflask/templates/gsearch_gene.html index e8bb6337..c1f039c7 100644 --- a/wqflask/wqflask/templates/gsearch_gene.html +++ b/wqflask/wqflask/templates/gsearch_gene.html @@ -42,9 +42,9 @@
    - + - + @@ -80,9 +80,9 @@ - - - + + +
    Factor 1Factor 2Factor 3Factor 1Factor 2Factor 3
    Description Location MeanMax LRS ?Max LRS Max LRS LocationAdditive ?Additive Effect
    Description Location MeanMax LRS ?Max LRS LocationAdditive ?Max LRS Max LRS LocationAdditive Effect
    @@ -102,8 +102,6 @@ - - - - - - - - - - - - - - - +{% extends "base.html" %} +{% block title %}Heatmap{% endblock %} +{% block css %} + + +{% endblock %} +{% block content %} + + {{ header("Heatmap") }} + +
    +
    +

    + The following heatmap is a work in progress. The heatmap for each trait runs horizontally (as opposed to vertically in GeneNetwork 1), + and hovering over a given trait's heatmap track will display its corresponding QTL chart below. Black on the heatmap corresponds with a + low positive or negative z-score (darker when closer to 0), while light blue and yellow correspond to high negative and positive z-scores respectively. +

    +
    +
    +
    + +
    +
    + +
    + + + +{% endblock %} + +{% block js %} + + + + + + + + + + + + {% endblock %} \ No newline at end of file -- cgit 1.4.1 From 3d1d8839d38d0552ba110de9ea467b83f72069fd Mon Sep 17 00:00:00 2001 From: zsloan Date: Tue, 13 Jun 2017 16:25:06 +0000 Subject: Fixed minor issue where the part of the legend describing the LRS/LOD line still appeared for manhattan plots --- wqflask/wqflask/marker_regression/marker_regression_gn1.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/wqflask/wqflask/marker_regression/marker_regression_gn1.py b/wqflask/wqflask/marker_regression/marker_regression_gn1.py index d99ac074..74474cb0 100644 --- a/wqflask/wqflask/marker_regression/marker_regression_gn1.py +++ b/wqflask/wqflask/marker_regression/marker_regression_gn1.py @@ -1052,7 +1052,10 @@ class MarkerRegression(object): startPosY = 15 nCol = 2 smallLabelFont = pid.Font(ttf="trebuc", size=12*fontZoom, bold=1) - leftOffset = xLeftOffset+(nCol-1)*200*fontZoom + if self.manhattan_plot: + leftOffset = xLeftOffset + else: + leftOffset = xLeftOffset+(nCol-1)*200*fontZoom canvas.drawPolygon(((leftOffset+6, startPosY-6), (leftOffset, startPosY+6), (leftOffset+12, startPosY+6)), edgeColor=pid.black, fillColor=self.TRANSCRIPT_LOCATION_COLOR, closed=1) canvas.drawString("Sequence Site", (leftOffset+15), (startPosY+5), smallLabelFont, self.TOP_RIGHT_INFO_COLOR) @@ -1143,9 +1146,10 @@ class MarkerRegression(object): labelFont=pid.Font(ttf="trebuc",size=12*fontZoom, bold=1) startPosY = 15 stepPosY = 12*fontZoom - canvas.drawLine(xLeftOffset,startPosY,xLeftOffset+32,startPosY,color=self.LRS_COLOR, width=2) - canvas.drawString(self.LRS_LOD, xLeftOffset+40,startPosY+5,font=labelFont,color=pid.black) - startPosY += stepPosY + if self.manhattan_plot != True: + canvas.drawLine(xLeftOffset,startPosY,xLeftOffset+32,startPosY,color=self.LRS_COLOR, width=2) + canvas.drawString(self.LRS_LOD, xLeftOffset+40,startPosY+5,font=labelFont,color=pid.black) + startPosY += stepPosY if self.additiveChecked: startPosX = xLeftOffset -- cgit 1.4.1 From 3977687e3613e71705e7ffcc894c51f166f46820 Mon Sep 17 00:00:00 2001 From: zsloan Date: Tue, 13 Jun 2017 17:15:56 +0000 Subject: Fixed issue that caused haplotype analyst to no longer work Fixed Results table for centimorgan results to display cM instead of Mb --- .../wqflask/marker_regression/marker_regression_gn1.py | 4 ++-- wqflask/wqflask/templates/marker_regression_gn1.html | 17 +++++++++++------ wqflask/wqflask/views.py | 1 + 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/wqflask/wqflask/marker_regression/marker_regression_gn1.py b/wqflask/wqflask/marker_regression/marker_regression_gn1.py index 74474cb0..08332e7d 100644 --- a/wqflask/wqflask/marker_regression/marker_regression_gn1.py +++ b/wqflask/wqflask/marker_regression/marker_regression_gn1.py @@ -447,7 +447,7 @@ class MarkerRegression(object): if self.haplotypeAnalystChecked and self.selectedChr > -1: #thisTrait = self.traitList[0] thisTrait = self.this_trait - _strains, _vals, _vars = thisTrait.export_informative() + _strains, _vals, _vars, _aliases = thisTrait.export_informative() smd=[] for ii, _val in enumerate(_vals): temp = GeneralObject(name=_strains[ii], value=_val) @@ -1440,7 +1440,7 @@ class MarkerRegression(object): #thisTrait = self.traitList[0] thisTrait = self.this_trait - _strains, _vals, _vars = thisTrait.export_informative() + _strains, _vals, _vars, _aliases = thisTrait.export_informative() smd=[] for ii, _val in enumerate(_vals): diff --git a/wqflask/wqflask/templates/marker_regression_gn1.html b/wqflask/wqflask/templates/marker_regression_gn1.html index ae922389..5afd134a 100644 --- a/wqflask/wqflask/templates/marker_regression_gn1.html +++ b/wqflask/wqflask/templates/marker_regression_gn1.html @@ -174,7 +174,7 @@ {% if selectedChr == -1 %} -
    +

    Results

    @@ -185,7 +185,7 @@ - {% if plotScale == "centimorgan" %} + {% if plotScale != "physic" %} {% else %} @@ -222,7 +222,11 @@ {% endif %} {% endif %} + {% if plotScale != "physic" %} + + {% else %} + {% endif %} {% if 'additive' in marker %} {% endif %} @@ -235,8 +239,8 @@
    Locus {{ LRS_LOD }} ChrcMMb{{marker.chr}}{{ '%0.3f' | format(marker.Mb|float) }}{{ '%0.6f' | format(marker.Mb|float) }}{{ '%0.3f' | format(marker.additive|float) }}
    - {% elif selectedChr != -1 and (dataset.group.species == 'mouse' or dataset.group.species == 'rat') %} -
    + {% elif selectedChr != -1 and plotScale =="physic" and (dataset.group.species == 'mouse' or dataset.group.species == 'rat') %} +

    Interval Analyst

    @@ -350,9 +354,10 @@ "order": [[3, "asc" ]], "sDom": "RZtir", "iDisplayLength": -1, - "bDeferRender": true, + "autoWidth": false, + "deferRender": true, "bSortClasses": false, - "scrollY": true, + "scrollY": "600px", "scrollCollapse": false, "paging": false } ); diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index ca7f04e9..83496000 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -558,6 +558,7 @@ def marker_regression_page(): 'selected_chr', 'chromosomes', 'mapping_scale', + 'plotScale', 'score_type', 'suggestive', 'significant', -- cgit 1.4.1 From f13cf491ac849c9ca484a204cc25d9493f36d781 Mon Sep 17 00:00:00 2001 From: zsloan Date: Tue, 13 Jun 2017 18:31:38 +0000 Subject: Added to border to table footer in search results --- wqflask/wqflask/static/new/packages/DataTables/css/jquery.dataTables.css | 1 + 1 file changed, 1 insertion(+) diff --git a/wqflask/wqflask/static/new/packages/DataTables/css/jquery.dataTables.css b/wqflask/wqflask/static/new/packages/DataTables/css/jquery.dataTables.css index ab7420a6..a5b9f09c 100644 --- a/wqflask/wqflask/static/new/packages/DataTables/css/jquery.dataTables.css +++ b/wqflask/wqflask/static/new/packages/DataTables/css/jquery.dataTables.css @@ -42,6 +42,7 @@ table.dataTable tfoot td { color: #000000; background-color: #ffffff; border-collapse: collapse; + border-top: #cccccc 2px solid; //padding: 0; padding: 10px 18px 6px 18px; //border-top: 1px solid #111; -- cgit 1.4.1 From ecd573cc7e150805383d9cdbd41f1b136c9afc0e Mon Sep 17 00:00:00 2001 From: zsloan Date: Tue, 13 Jun 2017 18:45:11 +0000 Subject: Fixed trait links in network graph nodes Added warning notifying users that file upload option in the submit_trait page doesn't work yet --- wqflask/wqflask/network_graph/network_graph.py | 6 ++++++ wqflask/wqflask/static/new/javascript/network_graph.js | 2 +- wqflask/wqflask/templates/submit_trait.html | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/wqflask/wqflask/network_graph/network_graph.py b/wqflask/wqflask/network_graph/network_graph.py index 4ce6c48d..7eb5be61 100644 --- a/wqflask/wqflask/network_graph/network_graph.py +++ b/wqflask/wqflask/network_graph/network_graph.py @@ -183,6 +183,8 @@ class NetworkGraph(object): if trait_db[1].type == "ProbeSet": node_dict = { 'data' : {'id' : str(this_trait.name) + ":" + str(this_trait.dataset.name), + 'name' : str(this_trait.name), + 'dataset' : str(this_trait.dataset.name), 'label' : this_trait.symbol, 'symbol' : this_trait.symbol, 'geneid' : this_trait.geneid, @@ -190,10 +192,14 @@ class NetworkGraph(object): 'max_corr' : max_corr } } elif trait_db[1].type == "Publish": node_dict = { 'data' : {'id' : str(this_trait.name) + ":" + str(this_trait.dataset.name), + 'name' : str(this_trait.name), + 'dataset' : str(this_trait.dataset.name), 'label' : this_trait.name, 'max_corr' : max_corr } } else: node_dict = { 'data' : {'id' : str(this_trait.name) + ":" + str(this_trait.dataset.name), + 'name' : str(this_trait.name), + 'dataset' : str(this_trait.dataset.name), 'label' : this_trait.name, 'max_corr' : max_corr } } self.nodes_list.append(node_dict) diff --git a/wqflask/wqflask/static/new/javascript/network_graph.js b/wqflask/wqflask/static/new/javascript/network_graph.js index 731acf1a..03ef1c98 100644 --- a/wqflask/wqflask/static/new/javascript/network_graph.js +++ b/wqflask/wqflask/static/new/javascript/network_graph.js @@ -82,7 +82,7 @@ window.onload=function() { cy.nodes().qtip({ content: function(){ qtip_content = '' - gn_link = ''+''+this.data().id +''+'
    ' + gn_link = ''+''+this.data().id +''+'
    ' qtip_content += gn_link if (typeof(this.data().geneid) !== 'undefined'){ ncbi_link = 'NCBI'+'
    ' diff --git a/wqflask/wqflask/templates/submit_trait.html b/wqflask/wqflask/templates/submit_trait.html index 8d624ffd..e93c1c9d 100644 --- a/wqflask/wqflask/templates/submit_trait.html +++ b/wqflask/wqflask/templates/submit_trait.html @@ -56,6 +56,7 @@

    2. Enter Trait Data:

    +

    WARNING: File uploading isn't enabled yet, so please paste your values using the second option.


    -- cgit 1.4.1 From ee6e8504e0c6e24d75f9ea939b1e48762dcfc977 Mon Sep 17 00:00:00 2001 From: zsloan Date: Wed, 14 Jun 2017 18:40:35 +0000 Subject: Added descriptions for GEMMA and PLINK as well as a warning about the issue with GEMMA where you can't run it simultaneously on two traits from the same group --- wqflask/wqflask/templates/show_trait_mapping_tools.html | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/wqflask/wqflask/templates/show_trait_mapping_tools.html b/wqflask/wqflask/templates/show_trait_mapping_tools.html index d8a18f38..bded60d2 100644 --- a/wqflask/wqflask/templates/show_trait_mapping_tools.html +++ b/wqflask/wqflask/templates/show_trait_mapping_tools.html @@ -341,6 +341,7 @@
    + {% if dataset.group.mapping_id == "1" %}
    Interval Mapping
    Interval mapping is a process in which the statistical significance of a hypothetical QTL is evaluated at regular points across a chromosome, even in the absence of explicit genotype data at those points.
    @@ -349,6 +350,17 @@
    R/qtl
    R/qtl is an extensible, interactive environment for mapping quantitative trait loci (QTL) in experimental crosses.
    + {% else %} +
    +
    GEMMA
    +
    + GEMMA is software implementing the Genome-wide Efficient Mixed Model Association algorithm for a standard linear mixed model for genome-wide association studies (GWAS).
    + Note: There currently exists an issue where GEMMA can't be run on traits from the same group simultaneously. If you recieve an error, please wait a few minutes and try again. +
    +
    PLINK
    +
    PLINK is a free, open-source whole genome association analysis toolset.
    +
    + {% endif %}
    --> + {% if g.user_session.user_ob %}
    @@ -146,7 +147,7 @@
    - {% endif %} + {% endif %}--> -- cgit 1.4.1 From adbdd62dfe4817b9d4bb6021f73de694199810b7 Mon Sep 17 00:00:00 2001 From: zsloan Date: Wed, 14 Jun 2017 23:16:28 +0000 Subject: Changed color scale for heatmap to blue <-> white <-> red Removed an extraneous character in the gsearch_pheno html --- wqflask/wqflask/static/new/javascript/lodheatmap.js | 2 +- wqflask/wqflask/templates/gsearch_pheno.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wqflask/wqflask/static/new/javascript/lodheatmap.js b/wqflask/wqflask/static/new/javascript/lodheatmap.js index 45feb75d..f604cd10 100644 --- a/wqflask/wqflask/static/new/javascript/lodheatmap.js +++ b/wqflask/wqflask/static/new/javascript/lodheatmap.js @@ -20,7 +20,7 @@ lodheatmap = function() { chrGap = 8; titlepos = 20; rectcolor = d3.rgb(230, 230, 230); - colors = ["slateblue", "black", "yellow"]; + colors = ["blue", "white", "crimson"]; title = ""; xlab = "Chromosome"; ylab = ""; diff --git a/wqflask/wqflask/templates/gsearch_pheno.html b/wqflask/wqflask/templates/gsearch_pheno.html index 1bb2120e..46a80a09 100644 --- a/wqflask/wqflask/templates/gsearch_pheno.html +++ b/wqflask/wqflask/templates/gsearch_pheno.html @@ -27,7 +27,7 @@
    - v
    +
    -- cgit 1.4.1 From 79310b037ad6ddb2da8f8ebd2ec9e892f3004ba2 Mon Sep 17 00:00:00 2001 From: zsloan Date: Thu, 6 Jul 2017 16:52:44 +0000 Subject: Improved table appearance for global searches Scatterplot Matrix works again Added the first few changes to get covariates working (not done yet) --- .../javascript/get_covariates_from_collection.js | 238 +++++++++++++++++++++ .../new/javascript/get_traits_from_collection.js | 1 + .../static/new/javascript/scatter-matrix.js | 2 +- .../wqflask/static/new/javascript/show_trait.js | 28 ++- wqflask/wqflask/templates/collections/list.html | 9 +- wqflask/wqflask/templates/gsearch_gene.html | 13 +- wqflask/wqflask/templates/gsearch_pheno.html | 13 +- wqflask/wqflask/templates/show_trait.html | 6 +- .../wqflask/templates/show_trait_statistics.html | 8 +- 9 files changed, 298 insertions(+), 20 deletions(-) create mode 100644 wqflask/wqflask/static/new/javascript/get_covariates_from_collection.js diff --git a/wqflask/wqflask/static/new/javascript/get_covariates_from_collection.js b/wqflask/wqflask/static/new/javascript/get_covariates_from_collection.js new file mode 100644 index 00000000..c267b045 --- /dev/null +++ b/wqflask/wqflask/static/new/javascript/get_covariates_from_collection.js @@ -0,0 +1,238 @@ +// Generated by CoffeeScript 1.8.0 +var add_trait_data, assemble_into_json, back_to_collections, collection_click, collection_list, color_by_trait, create_trait_data_csv, get_this_trait_vals, get_trait_data, process_traits, selected_traits, submit_click, this_trait_data, trait_click, + __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; + +console.log("before get_traits_from_collection"); + +collection_list = null; + +this_trait_data = null; + +selected_traits = {}; + +collection_click = function() { + var this_collection_url; + console.log("Clicking on:", $(this)); + this_collection_url = $(this).find('.collection_name').prop("href"); + this_collection_url += "&json"; + console.log("this_collection_url", this_collection_url); + collection_list = $("#collections_holder").html(); + return $.ajax({ + dataType: "json", + url: this_collection_url, + success: process_traits + }); +}; + +submit_click = function() { + var all_vals, sample, samples, scatter_matrix, this_trait_vals, trait, trait_names, trait_vals_csv, traits, _i, _j, _len, _len1, _ref; + selected_traits = {}; + traits = []; + $('#collections_holder').find('input[type=checkbox]:checked').each(function() { + var this_dataset, this_trait, this_trait_url; + this_trait = $(this).parents('tr').find('.trait').text(); + console.log("this_trait is:", this_trait); + this_dataset = $(this).parents('tr').find('.dataset').text(); + console.log("this_dataset is:", this_dataset); + this_trait_url = "/trait/get_sample_data?trait=" + this_trait + "&dataset=" + this_dataset; + return $.ajax({ + dataType: "json", + url: this_trait_url, + async: false, + success: add_trait_data + }); + }); + console.log("SELECTED_TRAITS IS:", selected_traits); + trait_names = []; + samples = $('input[name=allsamples]').val().split(" "); + all_vals = []; + this_trait_vals = get_this_trait_vals(samples); + all_vals.push(this_trait_vals); + _ref = Object.keys(selected_traits); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + trait = _ref[_i]; + trait_names.push(trait); + this_trait_vals = []; + for (_j = 0, _len1 = samples.length; _j < _len1; _j++) { + sample = samples[_j]; + if (__indexOf.call(Object.keys(selected_traits[trait]), sample) >= 0) { + this_trait_vals.push(parseFloat(selected_traits[trait][sample])); + } else { + this_trait_vals.push(null); + } + } + all_vals.push(this_trait_vals); + } + trait_vals_csv = create_trait_data_csv(selected_traits); + scatter_matrix = new ScatterMatrix(trait_vals_csv); + scatter_matrix.render(); + return $.colorbox.close(); +}; + +create_trait_data_csv = function(selected_traits) { + var all_vals, index, sample, sample_vals, samples, this_trait_vals, trait, trait_names, trait_vals_csv, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref; + trait_names = []; + trait_names.push($('input[name=trait_id]').val()); + samples = $('input[name=allsamples]').val().split(" "); + all_vals = []; + this_trait_vals = get_this_trait_vals(samples); + all_vals.push(this_trait_vals); + _ref = Object.keys(selected_traits); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + trait = _ref[_i]; + trait_names.push(trait); + this_trait_vals = []; + for (_j = 0, _len1 = samples.length; _j < _len1; _j++) { + sample = samples[_j]; + if (__indexOf.call(Object.keys(selected_traits[trait]), sample) >= 0) { + this_trait_vals.push(parseFloat(selected_traits[trait][sample])); + } else { + this_trait_vals.push(null); + } + } + all_vals.push(this_trait_vals); + } + console.log("all_vals:", all_vals); + trait_vals_csv = trait_names.join(","); + trait_vals_csv += "\n"; + for (index = _k = 0, _len2 = samples.length; _k < _len2; index = ++_k) { + sample = samples[index]; + if (all_vals[0][index] === null) { + continue; + } + sample_vals = []; + for (_l = 0, _len3 = all_vals.length; _l < _len3; _l++) { + trait = all_vals[_l]; + sample_vals.push(trait[index]); + } + trait_vals_csv += sample_vals.join(","); + trait_vals_csv += "\n"; + } + return trait_vals_csv; +}; + +trait_click = function() { + var dataset, this_trait_url, trait; + console.log("Clicking on:", $(this)); + trait = $(this).parent().find('.trait').text(); + dataset = $(this).parent().find('.dataset').text(); + console.log("BEFORE COVAR:", trait + ":" + dataset) + $('input[name=covariates]').val(trait + ":" + dataset) + console.log("AFTER COVAR:", $('input[name=covariates]').val()) + return $.colorbox.close(); + // this_trait_url = "/trait/get_sample_data?trait=" + trait + "&dataset=" + dataset; + // console.log("this_trait_url", this_trait_url); + // $.ajax({ + // dataType: "json", + // url: this_trait_url, + // success: get_trait_data + // }); + // return $.colorbox.close(); +}; + +add_trait_data = function(trait_data, textStatus, jqXHR) { + var trait_name, trait_sample_data; + trait_name = trait_data[0]; + trait_sample_data = trait_data[1]; + selected_traits[trait_name] = trait_sample_data; + return console.log("selected_traits:", selected_traits); +}; + +get_trait_data = function(trait_data, textStatus, jqXHR) { + var sample, samples, this_trait_vals, trait_sample_data, vals, _i, _len; + console.log("trait:", trait_data[0]); + trait_sample_data = trait_data[1]; + console.log("trait_sample_data:", trait_sample_data); + samples = $('input[name=allsamples]').val().split(" "); + vals = []; + for (_i = 0, _len = samples.length; _i < _len; _i++) { + sample = samples[_i]; + if (__indexOf.call(Object.keys(trait_sample_data), sample) >= 0) { + vals.push(parseFloat(trait_sample_data[sample])); + } else { + vals.push(null); + } + } + if ($('input[name=samples]').length < 1) { + $('#hidden_inputs').append(''); + } + $('#hidden_inputs').append(''); + this_trait_vals = get_this_trait_vals(samples); + console.log("THE LENGTH IS:", $('input[name=vals]').length); + return color_by_trait(trait_sample_data); +}; + +get_this_trait_vals = function(samples) { + var sample, this_trait_vals, this_val, this_vals_json, _i, _len; + this_trait_vals = []; + for (_i = 0, _len = samples.length; _i < _len; _i++) { + sample = samples[_i]; + this_val = parseFloat($("input[name='value:" + sample + "']").val()); + if (!isNaN(this_val)) { + this_trait_vals.push(this_val); + } else { + this_trait_vals.push(null); + } + } + console.log("this_trait_vals:", this_trait_vals); + this_vals_json = '[' + this_trait_vals.toString() + ']'; + return this_trait_vals; +}; + +assemble_into_json = function(this_trait_vals) { + var json_data, json_ids, num_traits, samples; + num_traits = $('input[name=vals]').length; + samples = $('input[name=samples]').val(); + json_ids = samples; + json_data = '[' + this_trait_vals; + $('input[name=vals]').each((function(_this) { + return function(index, element) { + return json_data += ',' + $(element).val(); + }; + })(this)); + json_data += ']'; + return [json_ids, json_data]; +}; + +color_by_trait = function(trait_sample_data, textStatus, jqXHR) { + console.log('in color_by_trait:', trait_sample_data); + return root.bar_chart.color_by_trait(trait_sample_data); +}; + +process_traits = function(trait_data, textStatus, jqXHR) { + var the_html, trait, _i, _len; + console.log('in process_traits with trait_data:', trait_data); + the_html = ""; + the_html += " "; + the_html += "
    "; + the_html += ""; + the_html += ""; + for (_i = 0, _len = trait_data.length; _i < _len; _i++) { + trait = trait_data[_i]; + the_html += ""; + the_html += ""; + the_html += ""; + the_html += ""; + the_html += ""; + the_html += ""; + } + the_html += ""; + the_html += "
    RecordData SetDescriptionMean
    " + trait.name + "" + trait.dataset + "" + trait.description + "" + (trait.mean || ' ') + "
    "; + the_html += "" + $("#collections_holder").html(the_html); + return $('#collections_holder').colorbox.resize(); +}; + +back_to_collections = function() { + console.log("collection_list:", collection_list); + $("#collections_holder").html(collection_list); + $(document).on("click", ".collection_line", collection_click); + return $('#collections_holder').colorbox.resize(); +}; + +console.log("inside get_traits_from_collection"); +$(".collection_line").on("click", collection_click); +$("#submit").on("click", submit_click); +$(".trait").on("click", trait_click); +$("#back_to_collections").on("click", back_to_collections); \ No newline at end of file diff --git a/wqflask/wqflask/static/new/javascript/get_traits_from_collection.js b/wqflask/wqflask/static/new/javascript/get_traits_from_collection.js index bcd83889..4abb0735 100644 --- a/wqflask/wqflask/static/new/javascript/get_traits_from_collection.js +++ b/wqflask/wqflask/static/new/javascript/get_traits_from_collection.js @@ -215,6 +215,7 @@ process_traits = function(trait_data, textStatus, jqXHR) { } the_html += ""; the_html += ""; + the_html += "" $("#collections_holder").html(the_html); return $('#collections_holder').colorbox.resize(); }; diff --git a/wqflask/wqflask/static/new/javascript/scatter-matrix.js b/wqflask/wqflask/static/new/javascript/scatter-matrix.js index 278a93bc..31cb384b 100644 --- a/wqflask/wqflask/static/new/javascript/scatter-matrix.js +++ b/wqflask/wqflask/static/new/javascript/scatter-matrix.js @@ -60,7 +60,7 @@ ScatterMatrix.prototype.render = function () { .style({'float':'left', 'margin-right':'50px'}) var svg = container.append('div') .attr('class', 'scatter-matrix-svg') - .style({'float':'right'}) + .style({'float':'left'}) .html('Loading data...'); this.onData(function() { diff --git a/wqflask/wqflask/static/new/javascript/show_trait.js b/wqflask/wqflask/static/new/javascript/show_trait.js index bb1af326..f232c6eb 100644 --- a/wqflask/wqflask/static/new/javascript/show_trait.js +++ b/wqflask/wqflask/static/new/javascript/show_trait.js @@ -74,6 +74,11 @@ return open_trait_selection(); }; })(this)); + d3.select("#select_covariate").on("click", (function(_this) { + return function() { + return open_covariate_selection(); + }; + })(this)); d3.select("#clear_compare_trait").on("click", (function(_this) { return function() { return $('.scatter-matrix-container').remove(); @@ -84,7 +89,28 @@ return function() { $.colorbox({ inline: true, - href: "#collections_holder" + href: "#collections_holder", + onComplete: function(){ + console.log("before get script") + $.getScript("/static/new/javascript/get_traits_from_collection.js"); + console.log("after get script") + } + }); + return $('a.collection_name').attr('onClick', 'return false'); + }; + })(this)); + }; + open_covariate_selection = function() { + return $('#collections_holder').load('/collections/list?select_covariates #collections_list', (function(_this) { + return function() { + $.colorbox({ + inline: true, + href: "#collections_holder", + onComplete: function(){ + console.log("before get script") + $.getScript("/static/new/javascript/get_covariates_from_collection.js"); + console.log("after get script") + } }); return $('a.collection_name').attr('onClick', 'return false'); }; diff --git a/wqflask/wqflask/templates/collections/list.html b/wqflask/wqflask/templates/collections/list.html index b1284895..cc60ecff 100644 --- a/wqflask/wqflask/templates/collections/list.html +++ b/wqflask/wqflask/templates/collections/list.html @@ -65,7 +65,11 @@ {% endfor %} - + {% if "color_by_trait" in params %} + + {% else %} + + {% endif %}
    @@ -84,9 +88,6 @@ - {% if "color_by_trait" in params %} - - {% endif %} - - + + - diff --git a/wqflask/wqflask/templates/show_trait_statistics.html b/wqflask/wqflask/templates/show_trait_statistics.html index 1fc470ff..d4a8c1f7 100644 --- a/wqflask/wqflask/templates/show_trait_statistics.html +++ b/wqflask/wqflask/templates/show_trait_statistics.html @@ -13,12 +13,12 @@
  • Probability Plot
  • - @@ -119,7 +119,8 @@ - {% if g.user_session.user_ob %}
    @@ -147,7 +149,7 @@
    - {% endif %}--> + {% endif %} -- cgit 1.4.1