aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzsloan2017-02-09 15:52:53 -0600
committerGitHub2017-02-09 15:52:53 -0600
commit048596e5ffb0323b0ebf3cc1a837b26b8774504e (patch)
treec2a31f6087fbd06185bf4ece9ddf30ebd602782b
parentce55cd478b70b7a9692a24c2bc8fa47d84ea19a4 (diff)
parent434ce88d3b7bf29a65e738aa171a7bba6a887471 (diff)
downloadgenenetwork2-048596e5ffb0323b0ebf3cc1a837b26b8774504e.tar.gz
Merge pull request #246 from zsloan/master
Added genetic_type to DatasetGroup object to differentiate between wh…
-rw-r--r--wqflask/base/data_set.py4
-rw-r--r--wqflask/wqflask/do_search.py7
-rw-r--r--wqflask/wqflask/show_trait/show_trait.py8
-rw-r--r--wqflask/wqflask/static/new/javascript/dataset_menu_structure.json150
-rw-r--r--wqflask/wqflask/static/new/javascript/draw_probability_plot.js12
-rw-r--r--wqflask/wqflask/templates/marker_regression_gn1.html29
-rw-r--r--wqflask/wqflask/templates/show_trait_details.html42
-rw-r--r--wqflask/wqflask/templates/show_trait_statistics.html4
8 files changed, 139 insertions, 117 deletions
diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py
index 02b5e07c..4b3ee4ca 100644
--- a/wqflask/base/data_set.py
+++ b/wqflask/base/data_set.py
@@ -264,7 +264,7 @@ class DatasetGroup(object):
def __init__(self, dataset):
"""This sets self.group and self.group_id"""
#logger.debug("DATASET NAME2:", dataset.name)
- self.name, self.id = fetchone(dataset.query_for_group)
+ self.name, self.id, self.genetic_type = fetchone(dataset.query_for_group)
if self.name == 'BXD300':
self.name = "BXD"
@@ -965,7 +965,7 @@ class MrnaAssayDataSet(DataSet):
self.query_for_group = '''
SELECT
- InbredSet.Name, InbredSet.Id
+ InbredSet.Name, InbredSet.Id, InbredSet.GeneticType
FROM
InbredSet, ProbeSetFreeze, ProbeFreeze
WHERE
diff --git a/wqflask/wqflask/do_search.py b/wqflask/wqflask/do_search.py
index ad3eab79..e1df1e63 100644
--- a/wqflask/wqflask/do_search.py
+++ b/wqflask/wqflask/do_search.py
@@ -826,7 +826,8 @@ class PositionSearch(DoSearch):
def get_where_clause(self):
self.search_term = [float(value) if is_number(value) else value for value in self.search_term]
- self.chr, self.mb_min, self.mb_max = self.search_term[:3]
+ chr, self.mb_min, self.mb_max = self.search_term[:3]
+ self.chr = str(chr).lower()
self.get_chr()
where_clause = """ %s.Chr = %s and
@@ -846,9 +847,9 @@ class PositionSearch(DoSearch):
self.chr = int(self.chr)
except:
if 'chr' in self.chr:
- self.chr = int(self.chr.replace('chr', ''))
+ self.chr = self.chr.replace('chr', '')
else:
- self.chr = int(self.chr.replace('CHR', ''))
+ self.chr = self.chr.replace('CHR', '')
def run(self):
diff --git a/wqflask/wqflask/show_trait/show_trait.py b/wqflask/wqflask/show_trait/show_trait.py
index 3e145e40..5d55ebe1 100644
--- a/wqflask/wqflask/show_trait/show_trait.py
+++ b/wqflask/wqflask/show_trait/show_trait.py
@@ -118,7 +118,13 @@ class ShowTrait(object):
self.trait_table_width = get_trait_table_width(self.sample_groups)
- js_data = dict(dataset_type = self.dataset.type,
+ if self.this_trait.symbol:
+ trait_symbol = self.this_trait.symbol
+ else:
+ trait_symbol = None
+ js_data = dict(trait_id = self.this_trait.name,
+ trait_symbol = trait_symbol,
+ dataset_type = self.dataset.type,
data_scale = self.dataset.data_scale,
sample_group_types = self.sample_group_types,
sample_lists = sample_lists,
diff --git a/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json b/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json
index ad4d9419..861af3d6 100644
--- a/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json
+++ b/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json
@@ -117,14 +117,14 @@
"Barley1 Leaf MAS 5.0 SCRI (Dec06)"
],
[
- "125",
- "B30_K_1206_R",
- "Barley1 Leaf gcRMA SCRI (Dec06)"
- ],
- [
"126",
"B30_K_1206_Rn",
"Barley1 Leaf gcRMAn SCRI (Dec06)"
+ ],
+ [
+ "125",
+ "B30_K_1206_R",
+ "Barley1 Leaf gcRMA SCRI (Dec06)"
]
],
"Phenotypes": [
@@ -1526,14 +1526,14 @@
"NCI Mammary LMT miRNA v2 (Apr09) RMA"
],
[
- "36",
- "MA_M_0704_M",
- "NCI Mammary mRNA M430 (July04) MAS5"
- ],
- [
"37",
"MA_M_0704_R",
"NCI Mammary mRNA M430 (July04) RMA"
+ ],
+ [
+ "36",
+ "MA_M_0704_M",
+ "NCI Mammary mRNA M430 (July04) MAS5"
]
]
},
@@ -1591,14 +1591,14 @@
],
"Liver mRNA": [
[
- "38",
- "LVF2_M_0704_M",
- "(B6 x BTBR)F2-ob/ob Liver mRNA M430 (Jul04) MAS5"
- ],
- [
"39",
"LVF2_M_0704_R",
"(B6 x BTBR)F2-ob/ob Liver mRNA M430 (Jul04) RMA"
+ ],
+ [
+ "38",
+ "LVF2_M_0704_M",
+ "(B6 x BTBR)F2-ob/ob Liver mRNA M430 (Jul04) MAS5"
]
],
"Phenotypes": [
@@ -1621,11 +1621,6 @@
"B6D2F2": {
"Brain mRNA": [
[
- "78",
- "BRF2_M_0805_P",
- "OHSU/VA B6D2F2 Brain mRNA M430 (Aug05) PDNN"
- ],
- [
"77",
"BRF2_M_0805_R",
"OHSU/VA B6D2F2 Brain mRNA M430 (Aug05) RMA"
@@ -1636,19 +1631,24 @@
"OHSU/VA B6D2F2 Brain mRNA M430 (Aug05) MAS5"
],
[
+ "78",
+ "BRF2_M_0805_P",
+ "OHSU/VA B6D2F2 Brain mRNA M430 (Aug05) PDNN"
+ ],
+ [
"33",
"BRF2_M_0304_P",
"OHSU/VA B6D2F2 Brain mRNA M430A (Mar04) PDNN"
],
[
- "31",
- "BRF2_M_0304_M",
- "OHSU/VA B6D2F2 Brain mRNA M430A (Mar04) MAS5"
- ],
- [
"32",
"BRF2_M_0304_R",
"OHSU/VA B6D2F2 Brain mRNA M430A (Mar04) RMA"
+ ],
+ [
+ "31",
+ "BRF2_M_0304_M",
+ "OHSU/VA B6D2F2 Brain mRNA M430A (Mar04) MAS5"
]
],
"Genotypes": [
@@ -1727,11 +1727,6 @@
],
"Striatum mRNA": [
[
- "83",
- "SA_M2_0905_M",
- "OHSU/VA B6D2F2 Striatum M430v2 (Sep05) MAS5"
- ],
- [
"85",
"SA_M2_0905_P",
"OHSU/VA B6D2F2 Striatum M430v2 (Sep05) PDNN"
@@ -1740,6 +1735,11 @@
"84",
"SA_M2_0905_R",
"OHSU/VA B6D2F2 Striatum M430v2 (Sep05) RMA"
+ ],
+ [
+ "83",
+ "SA_M2_0905_M",
+ "OHSU/VA B6D2F2 Striatum M430v2 (Sep05) MAS5"
]
]
},
@@ -2081,11 +2081,6 @@
"Eye M430v2 WT Gpnmb (Sep08) RMA"
],
[
- "382",
- "Eye_M2_0908_WTWT",
- "Eye M430v2 WT WT (Sep08) RMA"
- ],
- [
"279",
"Eye_M2_0908_R_WT",
"Eye M430v2 WT Tyrp1 (Sep08) RMA"
@@ -2096,6 +2091,11 @@
"Eye M430v2 Mutant Tyrp1 (Sep08) RMA"
],
[
+ "382",
+ "Eye_M2_0908_WTWT",
+ "Eye M430v2 WT WT (Sep08) RMA"
+ ],
+ [
"400",
"DBA2J-ONH-1212",
"Howell et al. 2011, DBA/2J Glaucoma Optic Nerve Head M430 2.0 (Dec12) RMA"
@@ -2332,16 +2332,16 @@
],
"Kidney mRNA": [
[
- "240",
- "MA_M2M_0706_R",
- "Mouse kidney M430v2 Male (Aug06) RMA"
- ],
- [
"239",
"MA_M2F_0706_R",
"Mouse kidney M430v2 Female (Aug06) RMA"
],
[
+ "240",
+ "MA_M2M_0706_R",
+ "Mouse kidney M430v2 Male (Aug06) RMA"
+ ],
+ [
"118",
"MA_M2_0806_R",
"Mouse kidney M430v2 Sex Balanced (Aug06) RMA"
@@ -2352,14 +2352,14 @@
"Mouse Kidney M430v2 Sex Balanced (Aug06) PDNN"
],
[
- "115",
- "MA_M2_0706_R",
- "Mouse Kidney M430v2 (Jul06) RMA"
- ],
- [
"116",
"MA_M2_0706_P",
"Mouse Kidney M430v2 (Jul06) PDNN"
+ ],
+ [
+ "115",
+ "MA_M2_0706_R",
+ "Mouse Kidney M430v2 (Jul06) RMA"
]
],
"Liver Metabolome": [
@@ -2521,16 +2521,16 @@
],
"Neocortex mRNA": [
[
- "374",
- "DevNeocortex_ILM6.2P3RInv_1111",
- "BIDMC/UTHSC Dev Neocortex P3 ILMv6.2 (Nov11) RankInv"
- ],
- [
"375",
"DevNeocortex_ILM6.2P14RInv_1111",
"BIDMC/UTHSC Dev Neocortex P14 ILMv6.2 (Nov11) RankInv"
],
[
+ "374",
+ "DevNeocortex_ILM6.2P3RInv_1111",
+ "BIDMC/UTHSC Dev Neocortex P3 ILMv6.2 (Nov11) RankInv"
+ ],
+ [
"284",
"HQFNeoc_1210v2_RankInv",
"HQF BXD Neocortex ILM6v1.1 (Dec10v2) RankInv"
@@ -2761,11 +2761,6 @@
],
"Ventral Tegmental Area mRNA": [
[
- "228",
- "VCUSal_0609_R",
- "VCU BXD VTA Sal M430 2.0 (Jun09) RMA"
- ],
- [
"230",
"VCUEtvsSal_0609_R",
"VCU BXD VTA Et vs Sal M430 2.0 (Jun09) RMA"
@@ -2774,6 +2769,11 @@
"229",
"VCUEtOH_0609_R",
"VCU BXD VTA EtOH M430 2.0 (Jun09) RMA"
+ ],
+ [
+ "228",
+ "VCUSal_0609_R",
+ "VCU BXD VTA Sal M430 2.0 (Jun09) RMA"
]
]
},
@@ -3023,14 +3023,14 @@
],
"Hippocampus mRNA": [
[
- "99",
- "HC_M2CB_1205_P",
- "Hippocampus Consortium M430v2 CXB (Dec05) PDNN"
- ],
- [
"100",
"HC_M2CB_1205_R",
"Hippocampus Consortium M430v2 CXB (Dec05) RMA"
+ ],
+ [
+ "99",
+ "HC_M2CB_1205_P",
+ "Hippocampus Consortium M430v2 CXB (Dec05) PDNN"
]
],
"Phenotypes": [
@@ -3097,16 +3097,6 @@
],
"Hippocampus mRNA": [
[
- "214",
- "Illum_LXS_Hipp_NOE_1008",
- "Hippocampus Illumina NOE (Oct08) RankInv beta"
- ],
- [
- "211",
- "Illum_LXS_Hipp_RSS_1008",
- "Hippocampus Illumina RSS (Oct08) RankInv beta"
- ],
- [
"213",
"Illum_LXS_Hipp_NOS_1008",
"Hippocampus Illumina NOS (Oct08) RankInv beta"
@@ -3122,6 +3112,16 @@
"Hippocampus Illumina RSE (Oct08) RankInv beta"
],
[
+ "214",
+ "Illum_LXS_Hipp_NOE_1008",
+ "Hippocampus Illumina NOE (Oct08) RankInv beta"
+ ],
+ [
+ "211",
+ "Illum_LXS_Hipp_RSS_1008",
+ "Hippocampus Illumina RSS (Oct08) RankInv beta"
+ ],
+ [
"143",
"Illum_LXS_Hipp_loess0807",
"Hippocampus Illumina (Aug07) LOESS"
@@ -3212,14 +3212,14 @@
],
"Hippocampus mRNA": [
[
- "272",
- "HC_M2_0606_MDP",
- "Hippocampus Consortium M430v2 (Jun06) RMA MDP"
- ],
- [
"273",
"UMUTAffyExon_0209_RMA_MDP",
"UMUTAffy Hippocampus Exon (Feb09) RMA MDP"
+ ],
+ [
+ "272",
+ "HC_M2_0606_MDP",
+ "Hippocampus Consortium M430v2 (Jun06) RMA MDP"
]
],
"Liver mRNA": [
diff --git a/wqflask/wqflask/static/new/javascript/draw_probability_plot.js b/wqflask/wqflask/static/new/javascript/draw_probability_plot.js
index 1eeb6e73..e5787564 100644
--- a/wqflask/wqflask/static/new/javascript/draw_probability_plot.js
+++ b/wqflask/wqflask/static/new/javascript/draw_probability_plot.js
@@ -45,8 +45,7 @@
chart = nv.models.scatterChart().width(w).height(h).showLegend(true).color(d3.scale.category10().range());
chart.pointRange([50, 50]);
chart.legend.updateState(false);
- chart.xAxis.axisLabel("Theoretical quantiles").tickFormat(d3.format('.02f'));
- //chart.yAxis.axisLabel("Sample quantiles").tickFormat(d3.format('.02f'));
+ chart.xAxis.axisLabel("Expected Z score").tickFormat(d3.format('.02f'));
chart.tooltipContent(function(obj) {
return '<b style="font-size: 20px">' + obj.point.name + '</b>';
});
@@ -79,7 +78,7 @@
}
return results;
})();
- chart.yAxis.axisLabel("Sample quantiles").tickFormat(d3.format('.0'+max_decimals.toString()+'f'));
+ chart.yAxis.axisLabel("Trait value").tickFormat(d3.format('.0'+max_decimals.toString()+'f'));
sw_result = ShapiroWilkW(sorted_values);
W = sw_result.w.toFixed(3);
pvalue = sw_result.p.toFixed(3);
@@ -115,7 +114,12 @@
data = [make_data('samples_primary'), make_data('samples_other')];
console.log("THE DATA IS:", data);
d3.select("#prob_plot_container svg").datum(data).call(chart);
- $("#prob_plot_title").html("<h3>Normal probability plot</h3>" + test_str);
+ if (js_data.trait_symbol != null) {
+ $("#prob_plot_title").html("<h3>" + js_data.trait_symbol + ": " + js_data.trait_id + "</h3>");
+ } else {
+ $("#prob_plot_title").html("<h3>" + js_data.trait_id + "</h3>");
+ }
+ $("#shapiro_wilk_text").html(test_str)
$("#prob_plot_container .nv-legendWrap").toggle(sample_group === "samples_all");
return chart;
};
diff --git a/wqflask/wqflask/templates/marker_regression_gn1.html b/wqflask/wqflask/templates/marker_regression_gn1.html
index de901ff5..6d3f9326 100644
--- a/wqflask/wqflask/templates/marker_regression_gn1.html
+++ b/wqflask/wqflask/templates/marker_regression_gn1.html
@@ -192,7 +192,7 @@
{% if 'additive' in trimmed_markers[0] %}
<th>Add Eff</th>
{% endif %}
- {% if 'dominance' in trimmed_markers[0] %}
+ {% if 'dominance' in trimmed_markers[0] and dataset.group.genetic_type != "riset" %}
<th>Dom Eff</th>
{% endif %}
</tr>
@@ -225,7 +225,7 @@
{% if 'additive' in marker %}
<td align="right">{{ '%0.3f' | format(marker.additive|float) }}</td>
{% endif %}
- {% if 'dominance' in marker %}
+ {% if 'dominance' in marker and dataset.group.genetic_type != "riset" %}
<td align="right">{{ '%0.2f' | format(marker.dominance|float) }}</td>
{% endif %}
</tr>
@@ -292,6 +292,7 @@
$(document).ready( function () {
console.time("Creating table");
$('#qtl_results').DataTable( {
+ {% if mapping_method != "reaper" %}
"columns": [
{ "type": "natural", "width": "5%" },
{ "type": "natural", "width": "8%" },
@@ -299,7 +300,29 @@
{ "type": "natural", "width": "8%" },
{ "type": "natural", "width": "8%" },
{ "type": "natural", "width": "15%" }
- ],
+ ],
+ {% elif dataset.group.genetic_type == "riset" %}
+ "columns": [
+ { "type": "natural", "width": "5%" },
+ { "type": "natural", "width": "8%" },
+ { "type": "natural", "width": "20%" },
+ { "type": "natural", "width": "8%" },
+ { "type": "natural", "width": "8%" },
+ { "type": "natural", "width": "15%" },
+ { "type": "natural", "width": "8%" }
+ ],
+ {% else %}
+ "columns": [
+ { "type": "natural", "width": "5%" },
+ { "type": "natural", "width": "8%" },
+ { "type": "natural", "width": "20%" },
+ { "type": "natural", "width": "8%" },
+ { "type": "natural", "width": "8%" },
+ { "type": "natural", "width": "15%" },
+ { "type": "natural", "width": "8%" },
+ { "type": "natural", "width": "8%" }
+ ],
+ {% endif %}
"columnDefs": [ {
"targets": 0,
"orderable": false
diff --git a/wqflask/wqflask/templates/show_trait_details.html b/wqflask/wqflask/templates/show_trait_details.html
index d4b70a02..547c3c27 100644
--- a/wqflask/wqflask/templates/show_trait_details.html
+++ b/wqflask/wqflask/templates/show_trait_details.html
@@ -1,17 +1,19 @@
<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>
+ <td>Species and Group</td>
+ <td>{{ this_trait.dataset.group.species }}, {{ this_trait.dataset.group.name }}</td>
</tr>
<tr>
<td>Tissue</td>
<td>{{ this_trait.dataset.tissue }}</td>
</tr>
{% if this_trait.dataset.type == 'ProbeSet' %}
+ {% if this_trait.symbol != None %}
+ <tr>
+ <td>Gene Symbol</td>
+ <td>{{ this_trait.symbol }}</td>
+ </tr>
+ {% endif %}
<tr>
<td>Aliases</td>
<td>{{ this_trait.alias_fmt|replace(",",";") }}</td>
@@ -74,49 +76,35 @@
<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">
- <i class="icon-plus-sign icon-white"></i> Add
- </button>
+ <button type="button" id="add_to_collection" class="btn btn-primary" title="Add to collection">Add</button>
</a>
{% if this_trait.dataset.type == 'ProbeSet' %}
{% if this_trait.symbol != None %}
<a href="http://www.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">
- <i class="icon-search"></i> Find
- </button>
+ <button type="button" class="btn btn-default" title="Find similar expression data">Find</button>
</a>
{% endif %}
{% if UCSC_BLAT_URL != "" %}
<a href="{{ UCSC_BLAT_URL }}">
- <button type="button" class="btn btn-default" title="Check probe locations at UCSC">
- <i class="icon-ok"></i> Verify
- </button>
+ <button type="button" class="btn btn-default" title="Check probe locations at UCSC">Verify</button>
</a>
{% endif %}
{% if this_trait.symbol != None %}
<a href="http://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">
- <i class="icon-edit"></i> GeneWiki
- </button>
+ <button type="button" class="btn btn-default" title="Write or review comments about this gene">GeneWiki</button>
</a>
<a href="http://genenetwork.org/webqtl/main.py?FormID=SnpBrowserResultPage&submitStatus=1&diffAlleles=True&customStrain=True&geneName={{ this_trait.symbol }}">
- <button type="button" class="btn btn-default" title="View SNPs and Indels">
- <i class="icon-road"></i> SNPs
- </button>
+ <button type="button" class="btn btn-default" title="View SNPs and Indels">SNPs</button>
</a>
{% endif %}
{% if UTHSC_BLAT_URL != "" %}
<a href="{{ UTHSC_BLAT_URL }}">
- <button type="button" class="btn btn-default" title="View probes, SNPs, and RNA-seq at UTHSC">
- <i class="icon-eye-close"></i> RNA-seq
- </button>
+ <button type="button" class="btn btn-default" title="View probes, SNPs, and RNA-seq at UTHSC">RNA-seq</button>
</a>
{% endif %}
{% if show_probes == "True" %}
<a href="http://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">
- <i class="icon-list"></i> Probes
- </button>
+ <button type="button" class="btn btn-default" title="Check sequence of probes">Probes</button>
</a>
{% endif %}
{% endif %}
diff --git a/wqflask/wqflask/templates/show_trait_statistics.html b/wqflask/wqflask/templates/show_trait_statistics.html
index 8e237868..0a0e9990 100644
--- a/wqflask/wqflask/templates/show_trait_statistics.html
+++ b/wqflask/wqflask/templates/show_trait_statistics.html
@@ -106,11 +106,11 @@
<div id="prob_plot_title"></div>
<svg></svg>
</div>
-
+ <div id="shapiro_wilk_text"></div>
<div>
More about <a href="http://en.wikipedia.org/wiki/Normal_probability_plot">Normal Probability Plots</a> and more
about interpreting these plots from the <a href="http://genenetwork.org/glossary.html#normal_probability">glossary</a>
- </div>
+ </div>
</div>