aboutsummaryrefslogtreecommitdiff
path: root/gn2/wqflask/templates/show_trait_mapping_tools.html
blob: 24e1b204eddf5c512a0654cc9f84175e8f85862c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
<div class="main">
    {% if dataset.group.mapping_names|length > 0 %}
    <div class="options">
        <div class="tabbable"> <!-- Only required for left/right tabs -->

            <ul class="nav nav-pills">
                {% for mapping_method in dataset.group.mapping_names %}
                {% if mapping_method == "GEMMA" %}
                <li class="gemma-tab mapping-tab {% if dataset.group.mapping_id == '1' or dataset.group.mapping_id == '2' %}active{% endif %}">
                    <a href="#gemma" data-toggle="tab">GEMMA</a>
                </li>
                {% elif mapping_method == "R/qtl" %}
                <li class="rqtl-geno-tab mapping-tab {% if dataset.group.mapping_id == '3' %}active{% endif %}">
                    <a href="#rqtl_geno" data-toggle="tab">R/qtl</a>
                </li>
                <li class="rqtl-pair-tab mapping-tab">
                    <a href="#rqtl_pair" data-toggle="tab">Pair Scan</a>
                </li>
                {% elif mapping_method == "QTLReaper" %}
                <li class="reaper-tab mapping-tab">
                    <a href="#interval_mapping" data-toggle="tab">Haley-Knott Regression</a>
                </li>
                {% endif %}
                {% endfor %}
            </ul>

            <div class="tab-content">
                {% for mapping_method in dataset.group.mapping_names %}
                {% if mapping_method == "GEMMA" %}
                <div class="tab-pane {% if dataset.group.mapping_id == '1' or dataset.group.mapping_id == '2' %}active{% endif %}" id="gemma">
                    <div class="form-horizontal section-form-div">
                        <div class="mapping_method_fields form-group">
                            <label for="chr_select" class="col-xs-3 control-label">Chromosome</label>
                            <div class="col-xs-2 controls">
                                <select id="chr_gemma" class="form-control chr-select">
                                    {% for item in chr_list %}
                                    <option value="{{ item[1] }}">{{ item[0] }}</option>
                                    {% endfor %}
                                </select>
                            </div>
                        </div>
                        {% if genofiles and genofiles|length>0 %}
                        <div class="mapping_method_fields form-group">
                            <label for="genofiles" class="col-xs-3 control-label">Genotypes</label>
                            <div class="col-xs-6 controls">
                                <select id="genofile_gemma" class="form-control">
                                    {% for item in genofiles %}
                                    <option value="{{item['location']}}:{{item['title']}}">{{item['title']}}</option>
                                    {% endfor %}
                                </select>
                            </div>
                        </div>
                        {% endif %}
                        <div class="mapping_method_fields form-group">
                            <label for="maf_gemma" class="col-xs-3 control-label">Minor Allele ≥</label>
                            <div class="col-xs-4 controls">
                                <input name="maf_gemma" value="{{ maf }}" type="text" class="form-control maf-select">
                            </div>
                        </div>
                        <div class="mapping_method_fields form-group">
                            <label class="col-xs-3 control-label">Use LOCO</label>
                            <div class="col-xs-6 controls">
                                <label class="radio-inline">
                                    <input type="radio" name="use_loco" value="True" checked="">
                                    Yes
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="use_loco" value="False">
                                    No
                               </label>
                            </div>
                        </div>
                        <div class="mapping_method_fields form-group">
                            <label class="col-xs-3 control-label">Covariates<br><span class="covar-text">Select covariate(s) from a collection</span></label>
                            <div class="col-xs-8 covar-options">
                              <div class="select-covar-div">
                                <button type="button" class="btn btn-success select-covar-button select_covariates">Select</button>
                                <button type="button" class="btn btn-default select-covar-button remove_covariates">Remove</button>
                                <button type="button" class="btn btn-danger select-covar-button remove_all_covariates">Clear</button>
                              </div>
                              <select size="2" name="selected_covariates_gemma" class="form-control selected-covariates" multiple>
                                  <option value="">No covariates selected</option>
                              </select>
                            </div>
                        </div>
                        <div class="mapping_method_fields form-group">
                          <label class="col-xs-3 control-label"></label>
                          <div class="col-xs-6">
                            <button id="gemma_compute" type="button" class="btn submit_special btn-success" title="Compute Marker Regression" value="Compute" disabled>Loading...</button>
                          </div>
                        </div>
                    </div>
                </div>
                {% elif mapping_method == "QTLReaper" %}
                <div class="tab-pane" id="interval_mapping">
                    <div class="form-horizontal section-form-div">
                        <div class="mapping_method_fields form-group">
                            <label for="chr_select" class="col-xs-3 control-label">Chromosome</label>
                            <div class="col-xs-2 controls">
                                    <select id="chr_reaper" class="form-control chr-select">
                                    {% for item in chr_list %}
                                    <option value="{{ item[1] }}">{{ item[0] }}</option>
                                    {% endfor %}
                                </select>
                            </div>
                        </div>
                        {% if genofiles and genofiles|length>0 %}
                        <div class="mapping_method_fields form-group">
                            <label for="scale_select" class="col-xs-3 control-label">Map Scale</label>
                            <div class="col-xs-2 controls">
                                <select id="scale_reaper" class="form-control scale-select">
                                    {% for item in scales_in_geno[genofiles[0]['location']] %}
                                    <option value="{{ item[0] }}">{{ item[1] }}</option>
                                    {% endfor %}
                                </select>
                            </div>
                        </div>
                        <div class="mapping_method_fields form-group">
                            <label for="genofiles" class="col-xs-3 control-label">Genotypes</label>
                            <div class="col-xs-6 controls">
                                <select id="genofile_reaper" class="form-control">
                                    {% for item in genofiles %}
                                    <option value="{{item['location']}}:{{item['title']}}">{{item['title']}}</option>
                                    {% endfor %}
                                </select>
                            </div>
                        </div>
                        {% else %}
                        <div class="mapping_method_fields form-group">
                            <label for="scale_select" class="col-xs-3 control-label">Map Scale</label>
                            <div class="col-xs-2 controls">
                                <select id="scale_reaper" class="form-control scale-select">
                                    {% for item in scales_in_geno[dataset.group.name + ".geno"] %}
                                    <option value="{{ item[0] }}">{{ item[1] }}</option>
                                    {% endfor %}
                                </select>
                            </div>
                        </div>
                        {% endif %}
                        <div class="mapping_method_fields form-group">
                            <label for="mapping_permutations" class="col-xs-3 control-label">Permutations</label>
                            <div class="col-xs-4 controls">
                                <input name="num_perm_reaper" value="1000" type="text" class="form-control">
                            </div>
                        </div>
                        <div class="mapping_method_fields form-group">
                            <label for="mapping_bootstraps" class="col-xs-3 control-label">Bootstraps</label>
                            <div class="col-xs-4 controls">
                                <input name="num_bootstrap" value="0" type="text" class="form-control">
                            </div>
                        </div>
                        <div class="mapping_method_fields form-group">
                            <label for="control_for" class="col-xs-3 control-label">Control&nbsp;for<br>Cofactors</label>
                            <div class="col-xs-6 controls">
                                <input name="control_reaper" value="{% if dataset.type == 'ProbeSet' and this_trait.locus_chr != '' %}{{ nearest_marker }}{% endif %}" type="text" class="form-control cofactor-input" />
                                <br>
                                <label class="radio-inline">
                                  <input type="radio" name="do_control_reaper" value="true">
                                  Yes
                                </label>
                                <label class="radio-inline">
                                  <input type="radio" name="do_control_reaper" value="false" checked="">
                                  No
                                </label>
                            </div>
                        </div>
                        <div class="mapping_method_fields form-group">
                            <label class="col-xs-3 control-label">Interval Map</label>
                            <div class="col-xs-6 controls">
                                <label class="radio-inline">
                                    <input type="radio" name="manhattan_plot_reaper" value="false" checked="">
                                    Yes
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="manhattan_plot_reaper" value="true">
                                    No
                               </label>
                            </div>
                        </div>
                        <div class="mapping_method_fields form-group">
                            <label class="col-xs-3 control-label"></label>
                            <div class="col-xs-6">
                              <button id="interval_mapping_compute" type="button" class="btn submit_special btn-success" title="Compute Interval Mapping" value="Compute" disabled>Loading...</button>
                            </div>
                        </div>
                    </div>
                </div>
                {% elif mapping_method == "R/qtl" %}
                <div class="tab-pane {% if dataset.group.mapping_id == '3' %}active{% endif %}" id="rqtl_geno">
                    <div class="form-horizontal section-form-div">
                        <div class="mapping_method_fields form-group">
                            <label for="chr_select" class="col-xs-3 control-label">Chromosome</label>
                            <div class="col-xs-2 controls">
                                    <select id="chr_rqtl_geno" class="form-control chr-select">
                                    {% for item in chr_list %}
                                    <option value="{{ item[1] }}">{{ item[0] }}</option>
                                    {% endfor %}
                                </select>
                            </div>
                        </div>
                        {% if genofiles and genofiles|length > 0 %}
                        <div class="mapping_method_fields form-group">
                            <label for="scale_select" class="col-xs-3 control-label">Map Scale</label>
                            <div class="col-xs-2 controls">
                                <select id="scale_rqtl_geno" class="form-control scale-select">
                                    {% for item in scales_in_geno[genofiles[0]['location']] %}
                                    <option value="{{ item[0] }}">{{ item[1] }}</option>
                                    {% endfor %}
                                </select>
                            </div>
                        </div>
                        <div class="mapping_method_fields form-group">
                            <label for="genofiles" class="col-xs-3 control-label">Genotypes</label>
                            <div class="col-xs-6 controls">
                                <select id="genofile_rqtl_geno" class="form-control">
                                    {% for item in genofiles %}
                                    <option value="{{item['location']}}:{{item['title']}}">{{item['title']}}</option>
                                    {% endfor %}
                                </select>
                            </div>
                        </div>
                        {% else %}
                        <div class="mapping_method_fields form-group">
                            <label for="scale_select" class="col-xs-3 control-label">Map Scale</label>
                            <div class="col-xs-2 controls">
                                <select id="scale_rqtl_geno" class="form-control scale-select">
                                    {% for item in scales_in_geno[dataset.group.name + ".geno"] %}
                                    <option value="{{ item[0] }}">{{ item[1] }}</option>
                                    {% endfor %}
                                </select>
                            </div>
                        </div>
                        {% endif %}
                        <div class="mapping_method_fields form-group">
                            <label for="mapping_permutations" class="col-xs-3 control-label">Permutations</label>
                            <div class="col-xs-4 controls">
                                <input name="num_perm_rqtl_geno" value="0" type="text" class="form-control">
                            </div>
                        </div>
                        {% if sample_groups[0].attributes|length > 0 %}
                        <div class="mapping_method_fields form-group">
                            <label class="col-xs-3 control-label">Stratified</label>
                            <div class="col-xs-6 controls">
                                <label class="radio-inline">
                                    <input type="radio" name="perm_strata" value="True" checked=""> 
                                    Yes
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="perm_strata" value="False" >
                                    No
                               </label>
                            </div>
                        </div>
                        {% endif %}
                        <div class="mapping_method_fields form-group">
                            <label for="mapmodel_rqtl_geno" class="col-xs-3 control-label">Model</label>
                            <div class="col-xs-4 controls">
                              <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 for="mapmethod_rqtl_geno" class="col-xs-3 control-label">Method</label>
                            <div 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 for="missing_genotypes" class="col-xs-3 control-label"></label>
                            <div 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 class="col-xs-3 control-label">Manhattan<br>Plot</label>
                            <div class="col-xs-6 controls">
                                <label class="radio-inline">
                                    <input type="radio" name="manhattan_plot_rqtl" value="True">
                                    Yes
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="manhattan_plot_rqtl" value="False" checked="">
                                    No
                               </label>
                            </div>
                        </div>
                        <div class="mapping_method_fields form-group">
                          <label class="col-xs-3 control-label">Covariates<br><span class="covar-text">Select covariate(s) from a collection</span></label>
                          <div class="col-xs-8 covar-options">
                            <div class="select-covar-div">
                              <button type="button" class="btn btn-success select-covar-button select_covariates">Select</button>
                              <button type="button" class="btn btn-default select-covar-button remove_covariates">Remove</button>
                              <button type="button" class="btn btn-danger select-covar-button remove_all_covariates">Clear</button>
                            </div>
                            <select size="2" name="selected_covariates_rqtl" class="form-control selected-covariates" multiple>
                                <option value="">No covariates selected</option>
                            </select>
                          </div>
                        </div>
                        <div class="mapping_method_fields form-group">
                            <label class="col-xs-3 control-label"></label>
                            <div class="col-xs-6 controls">
                              <button id="rqtl_geno_compute" type="button" class="btn submit_special btn-success" title="Compute Marker Regression" value="Compute" disabled>Loading...</button>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="tab-pane" id="rqtl_pair">
                    <div class="form-horizontal section-form-div">
                        {% if genofiles and genofiles|length > 0 %}
                        <div class="mapping_method_fields form-group">
                            <label for="genofiles" class="col-xs-3 control-label">Genotypes</label>
                            <div class="col-xs-6 controls">
                                <select id="genofile_rqtl_pair" class="form-control">
                                    {% for item in genofiles %}
                                    <option value="{{item['location']}}:{{item['title']}}">{{item['title']}}</option>
                                    {% endfor %}
                                </select>
                            </div>
                        </div>
                        {% endif %}
                        <div class="mapping_method_fields form-group">
                            <label for="control_for" class="col-xs-3 control-label">Control&nbsp;for</label>
                            <div class="col-xs-6 controls">
                              <input name="control_rqtl_pair" value="{% if dataset.type == 'ProbeSet' and this_trait.locus_chr != '' %}{{ nearest_marker }}{% endif %}" type="text" class="form-control cofactor-input" />
                              <label class="radio-inline">
                                  <input type="radio" name="do_control_rqtl" value="true">
                                  Yes
                              </label>
                              <label class="radio-inline">
                                  <input type="radio" name="do_control_rqtl" value="false" checked="">
                                  No
                              </label>
                            </div>
                        </div>
                        <div class="mapping_method_fields form-group">
                            <label for="mapmodel_rqtl_pair" class="col-xs-3 control-label">Model</label>
                            <div class="col-xs-4 controls">
                              <select id="mapmodel_rqtl_pair" name="mapmodel_rqtl_pair" 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 for="mapmethod_rqtl_pair" class="col-xs-3 control-label">Method</label>
                            <div class="col-xs-6 controls">
                              <select id="mapmethod_rqtl_pair" name="mapmethod_rqtl_pair" 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_pair_div" class="mapping_method_fields form-group" style="display: none;">
                            <label for="missing_genotypes_pair" class="col-xs-3 control-label"></label>
                            <div class="col-xs-6 controls">
                              <select id="missing_genotype_pair" 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 class="col-xs-3 control-label">Covariates<br><span class="covar-text">Select covariate(s) from a collection</span></label>
                          <div class="col-xs-8 covar-options">
                            <div class="select-covar-div">
                              <button type="button" class="btn btn-default select-covar-button select_covariates">Select</button>
                              <button type="button" class="btn btn-default select-covar-button remove_covariates">Remove</button>
                            </div>
                            <textarea rows="3" cols="50" readonly placeholder="No covariates selected" class="selected-covariates"></textarea>
                          </div>
                        </div>
                        <div class="mapping_method_fields form-group">
                            <label class="col-xs-3 control-label"></label>
                            <div class="col-xs-6 controls">
                              <button id="rqtl_pair_compute" type="button" class="btn submit_special btn-success" data-url="/marker_regression" title="Compute Pair Scan" value="Compute" disabled>Loading...</button>
                            </div>
                        </div>
                    </div>
                </div>
                {% endif %}
                {% endfor %}
            </div>
        </div>
    </div>
    <div class="descriptions">
        <div class="section-form-div">
            <dl>
                {% for mapping_method in dataset.group.mapping_names %}
                {% if mapping_method == "GEMMA" %}
                <dt>GEMMA</dt>
                <dd>GEMMA maps with correction for kinship using a linear mixed model and can include covariates such as sex and age. Defaults include a minor allele frequency of 0.05  and the leave-one-chromosome-out method (<a href="https://www.ncbi.nlm.nih.gov/pubmed/24531419">PMID:&nbsp;2453419</a>, and <a href="https://github.com/genetics-statistics/GEMMA"> GitHub code</a>).</dd>
                {% elif mapping_method == "R/qtl" %}
                <dt class="map-method-text">R/qtl (version 1.44.9)</dt>
                <dd><a href="https://www.ncbi.nlm.nih.gov/pubmed/12724300">R/qtl</a> maps using several models and uniquely support 4-way intercrosses such as the "Aging Mouse Lifespan Studies" (NIA UM-HET3). We will add support for R/qtl2 (<a href="https://www.ncbi.nlm.nih.gov/pubmed/30591514">PMID:&nbsp;30591514</a>) in the near future—a version that handles complex populations with admixture and many haplotypes.</dd>
                <dt class="map-method-text">Pair Scan (R/qtl v 1.44.9)</dt>
                <dd>The Pair Scan mapping tool performs a search for joint effects of two separate loci that may influence a trait. This search typically requires large sample sizes. Pair Scans can included covariates such as age and sex. For more on this function by K. Broman and colleagues see www.rdocumentation.org/packages/qtl/versions/1.60/topics/scantwo</dd>
                {% elif mapping_method == "QTLReaper" %}
                <dt class="map-method-text">Haley-Knott Regression</dt>
                <dd>HK regression (QTL Reaper) is a fast mapping method with permutation that works well with F2 intercrosses and backcrosses (<a href="https://www.ncbi.nlm.nih.gov/pubmed/16718932">PMID:&nbsp;16718932</a>), but is not recommended for admixed populations, advanced intercrosses, or strain families such as the BXDs (<a href="https://github.com/pjotrp/QTLReaper">QTL Reaper code</a>).</dd>
                {% endif %}
                {% endfor %}
            </dl>
            <div class="rqtl-description">
            More information on R/qtl mapping models and methods can be found <a href="http://www.rqtl.org/tutorials/rqtltour.pdf">here</a>.
            </div>
        </div>
    </div>
    <div id="mapping_result_holder_wrapper" style="display:none;">
        <div id="mapping_result_holder"></div>
    </div>
    {% else %}
    Mapping options are disabled for data not matched with genotypes.
    {% endif %}
</div>