From daea7eb0eb4eef445140275522703e7e2214154b Mon Sep 17 00:00:00 2001 From: Zachary Sloan Date: Tue, 18 Dec 2012 17:15:09 -0600 Subject: Created new file species.py and species class object TheSpecies Converted html for the mapping tabs to bootstrap and redid html inside of the Interval Mapping tab Added text input for # of permutation tests and bootstrap tests --- wqflask/base/data_set.py | 8 +- wqflask/base/species.py | 16 + wqflask/wqflask/show_trait/show_trait.py | 3 +- .../templates/show_trait_mapping_tools.html | 551 +++++++-------------- wqflask/wqflask/views.py | 8 + 5 files changed, 218 insertions(+), 368 deletions(-) create mode 100644 wqflask/base/species.py diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py index 2182fe9e..612b9209 100755 --- a/wqflask/base/data_set.py +++ b/wqflask/base/data_set.py @@ -30,6 +30,7 @@ from htmlgen import HTMLgen2 as HT import reaper import webqtlConfig +from base import species from dbFunction import webqtlDatabaseFunction from utility import webqtlUtil @@ -145,7 +146,7 @@ class DataSet(object): def __init__(self, name): - assert name + assert name, "Need a name" self.name = name self.id = None self.type = None @@ -155,7 +156,10 @@ class DataSet(object): self.check_confidentiality() self.retrieve_other_names() - self.group = DatasetGroup(self) # sets self.group and self.group_id + + self.species = species.TheSpecies(self) + self.group = DatasetGroup(self) # sets self.group and self.group_id and gets genotype + def get_desc(self): diff --git a/wqflask/base/species.py b/wqflask/base/species.py new file mode 100644 index 00000000..98941ce5 --- /dev/null +++ b/wqflask/base/species.py @@ -0,0 +1,16 @@ +from __future__ import print_function, division + + +class TheSpecies(object): + def __init__(self, dataset): + self.dataset = dataset + + @property + def chromosomes(self): + chromosomes = [("All", -1)] + + for counter, genotype in enumerate(self.dataset.group.genotype): + if len(genotype) > 1: + chromosomes.append((genotype.name, counter)) + + return chromosomes diff --git a/wqflask/wqflask/show_trait/show_trait.py b/wqflask/wqflask/show_trait/show_trait.py index 836d37ea..c605cb58 100755 --- a/wqflask/wqflask/show_trait/show_trait.py +++ b/wqflask/wqflask/show_trait/show_trait.py @@ -1354,7 +1354,8 @@ class ShowTrait(object): return_results_menu_selected = return_results_menu_selected,) - def dispMappingTools(self, fd, title4Body, this_trait): + def build_mapping_tools(self, this_trait): + _Species = webqtlDatabaseFunction.retrieveSpecies(cursor=self.cursor, group=fd.group) diff --git a/wqflask/wqflask/templates/show_trait_mapping_tools.html b/wqflask/wqflask/templates/show_trait_mapping_tools.html index 90498e9a..1109ded3 100644 --- a/wqflask/wqflask/templates/show_trait_mapping_tools.html +++ b/wqflask/wqflask/templates/show_trait_mapping_tools.html @@ -1,382 +1,203 @@ -

  Mapping Tools

- -

- - - -
-
- - -
- - - - - - +
+

Mapping Tools

+ +
+ + +
+
+ + +
+ {% if dataset.group.genotype.Mbmap %} + + + {% endif %} +
+ + + + +
+ + +
+ +
+
+
- - - - - - - - - - - - -
Chromosome:
Mapping Scale:

- Permutation Test (n=2000)
- Bootstrap Test (n=2000)
- Use Parents
- Use Weighted
-
-
-
-
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + +
Display LRS greater than:
Display all LRS
Use Parents
Use Weighted

+
+
+
Marker regression computes and displays LRS + values for individual markers.
+ This function also lists additive effects (phenotype units per allele) and
+ dominance deviations for some datasets.

+
+ +
+ + + + + + + + +
+ + + + + + + + + + + + +
Sort by:
Return:

+ Permutation Test + (n=500)
+
+
+
+
Pair-Scan searches for pairs of chromosomal regions + that are
+ involved in two-locus epistatic interactions.

+
+
+ + + + diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index 70d8cd20..503b0972 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -160,6 +160,14 @@ def corr_compute_page(): print("Made it to rendering") return render_template("correlation_page.html", **template_vars.__dict__) +@app.route("/int_mapping", methods=('POST',)) +def interval_mapping_page(): + fd = webqtlFormData.webqtlFormData(request.form) + print("Have fd") + template_vars = CorrelationPage.CorrelationPage(fd) + print("Made it to rendering") + return render_template("correlation_page.html", **template_vars.__dict__) + # Todo: Can we simplify this? -Sam def sharing_info_page(): -- cgit v1.2.3