diff options
Diffstat (limited to 'wqflask')
4 files changed, 55 insertions, 18 deletions
diff --git a/wqflask/wqflask/marker_regression/run_mapping.py b/wqflask/wqflask/marker_regression/run_mapping.py index 7ee3ac01..c0d6dc0b 100644 --- a/wqflask/wqflask/marker_regression/run_mapping.py +++ b/wqflask/wqflask/marker_regression/run_mapping.py @@ -187,7 +187,10 @@ class RunMapping(object): self.mapping_scale = "morgan" self.control_marker = start_vars['control_marker'] self.do_control = start_vars['do_control'] - self.method = start_vars['mapmethod_rqtl_geno'] + if 'mapmethod_rqtl_geno' in start_vars: + self.method = start_vars['mapmethod_rqtl_geno'] + else: + self.method = "em" self.model = start_vars['mapmodel_rqtl_geno'] #if start_vars['pair_scan'] == "true": # self.pair_scan = True diff --git a/wqflask/wqflask/show_trait/show_trait.py b/wqflask/wqflask/show_trait/show_trait.py index 932260de..c7e6be4c 100644 --- a/wqflask/wqflask/show_trait/show_trait.py +++ b/wqflask/wqflask/show_trait/show_trait.py @@ -199,6 +199,7 @@ class ShowTrait(object): #ZS: Needed to know whether to display bar chart + get max sample name length in order to set table column width self.num_values = 0 + self.binary = "true" #ZS: So it knows whether to display the Binary R/qtl mapping method, which doesn't work unless all values are 0 or 1 max_samplename_width = 1 for group in self.sample_groups: for sample in group.sample_list: @@ -206,6 +207,8 @@ class ShowTrait(object): max_samplename_width = len(sample.name) if sample.display_value != "x": self.num_values += 1 + if sample.display_value != 0 or sample.display_value != 1: + self.binary = "false" sample_column_width = max_samplename_width * 8 diff --git a/wqflask/wqflask/static/new/javascript/show_trait_mapping_tools.js b/wqflask/wqflask/static/new/javascript/show_trait_mapping_tools.js index 3eb34d03..2ab87d03 100644 --- a/wqflask/wqflask/static/new/javascript/show_trait_mapping_tools.js +++ b/wqflask/wqflask/static/new/javascript/show_trait_mapping_tools.js @@ -245,6 +245,28 @@ $("#mapping_method_choice").change(mapping_method_fields); + $("#mapmodel_rqtl_geno").change(function() { + if ($(this).val() == "np"){ + $("#mapmethod_rqtl_geno").attr('disabled', 'disabled'); + $("#mapmethod_rqtl_geno").css('background-color', '#CCC'); + $("#missing_geno").attr('disabled', 'disabled'); + $("#missing_geno").css('background-color', '#CCC'); + } else { + $("#mapmethod_rqtl_geno").removeAttr('disabled'); + $("#mapmethod_rqtl_geno").css('background-color', '#FFF'); + $("#missing_geno").removeAttr('disabled'); + $("#missing_geno").css('background-color', '#FFF'); + } + }); + + $("#mapmethod_rqtl_geno").change(function() { + if ($(this).val() == "mr"){ + $("#missing_geno_div").css('display', 'block'); + } else { + $("#missing_geno_div").css('display', 'none'); + } + }); + toggle_enable_disable = function(elem) { return $(elem).prop("disabled", !$(elem).prop("disabled")); }; diff --git a/wqflask/wqflask/templates/show_trait_mapping_tools.html b/wqflask/wqflask/templates/show_trait_mapping_tools.html index e79cf1ab..c7fd2612 100644 --- a/wqflask/wqflask/templates/show_trait_mapping_tools.html +++ b/wqflask/wqflask/templates/show_trait_mapping_tools.html @@ -265,31 +265,40 @@ </div> <div class="mapping_method_fields form-group"> - <label style="text-align:right;" for="mapmethod_rqtl_geno" class="col-xs-3 control-label">Method</label> + <label style="text-align:right;" for="mapmodel_rqtl_geno" class="col-xs-3 control-label">Model</label> <div style="margin-left:20px;" class="col-xs-4 controls"> - <select name="mapmethod_rqtl_geno" class="form-control"> - <option value="hk" selected>hk</option> - <option value="em">em</option> - <option value="imp">imp</option> - <option value="ehk">ehk</option> - <option value="mr">mr</option> - <option value="mr-imp">mr-imp</option> - <option value="mr-argmax">mr-argmax</option> + <select id="mapmodel_rqtl_geno" name="mapmodel_rqtl_geno" class="form-control"> + <option value="normal">Normal</option> + {% if binary == "true" %}<option value="binary">Binary</option>{% endif %} + <!--<option value="2part">2-part</option>--> + <option value="np">Non-parametric</option> </select> </div> </div> <div class="mapping_method_fields form-group"> - <label style="text-align:right;" for="mapmodel_rqtl_geno" class="col-xs-3 control-label">Model</label> - <div style="margin-left:20px;" class="col-xs-4 controls"> - <select name="mapmodel_rqtl_geno" class="form-control"> - <option value="normal">normal</option> - <!--<option value="binary">binary</option> - <option value="2part">2part</option>--> - <option value="np">np</option> + <label style="text-align:right;" for="mapmethod_rqtl_geno" class="col-xs-3 control-label">Method</label> + <div style="margin-left:20px;" class="col-xs-6 controls"> + <select id="mapmethod_rqtl_geno" name="mapmethod_rqtl_geno" class="form-control"> + <option value="hk" selected>Haley-Knott</option> + <option value="ehk">Extended Haley-Knott</option> + <option value="mr">Marker Regression</option> + <option value="em">Expectation-Maximization</option> + <option value="imp">Imputation</option> </select> </div> </div> + <div id="missing_geno_div" class="mapping_method_fields form-group" style="display: none;"> + <label style="text-align:right;" for="missing_genotypes" class="col-xs-3 control-label"></label> + <div style="margin-left:20px;" class="col-xs-6 controls"> + <select id="missing_genotype" name="missing_genotypes" class="form-control"> + <option value="mr">Remove Samples w/o Genotypes</option> + <option value="mr-imp">Single Imputation</option> + <option value="mr-argmax">Imputation w/ Viterbi Algorithm</option> + </select> + </div> + </div> + <!-- <div class="mapping_method_fields form-group"> <label style="text-align:left;" class="col-xs-12 control-label">Pair Scan</label> @@ -306,7 +315,7 @@ </div> --> <div class="mapping_method_fields form-group"> - <label style="text-align:right;" class="col-xs-3 control-label">Marker<br>Regression</label> + <label style="text-align:right;" class="col-xs-3 control-label">Manhattan<br>Plot</label> <div style="margin-left:20px;" class="col-xs-6 controls"> <label class="radio-inline"> <input type="radio" name="manhattan_plot_rqtl" value="True"> |