aboutsummaryrefslogtreecommitdiff
path: root/gn2/wqflask/templates/marker_regression.html
blob: b633f815d97bd22f779cdc903e725ac2cc03df5d (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
{% from "base_macro.html" import header %}
{% block content %}
    {{ header("Mapping",
        '{}: {}'.format(this_trait.name, this_trait.description_fmt)) }}

    <div class="container">
        <div>
            <h2>
                Whole Genome Mapping
            </h2>
            <form style ='float: left; padding: 5px;' id="exportform" action="export" method="post">
              <input type="hidden" id="data" name="data" value="">
              <input type="hidden" id="filename" name="filename" value="">
              <input type="submit" id="export" value="Download SVG">
            </form>
            <form style ='float: left; padding: 5px;' id="exportpdfform" action="export_pdf" method="post">
              <input type="hidden" id="data" name="data" value="">
              <input type="hidden" id="filename" name="filename" value="">
              <input type="submit" id="export_pdf" value="Download PDF">
            </form>
            <button id="return_to_full_view" class="btn" style="display:none">Return to full view</button>
        </div>
        <div id="chart_container">
            <div class="qtlcharts" id="topchart">
                
            </div>
        </div>
        <div style="width:60%;">
            <h2>
                Results
            </h2>
            <table id="qtl_results" class="table table-hover table-striped">
                <thead>
                    <tr>
                        <th></th>
                        <th>Index</th>
                        <th>{{ score_type }}</th>
                        <th>Chr</th>
                        {% if mapping_scale == "centimorgan" %}
                        <th>cM</th>
                        {% else %}
                        <th>Mb</th>
                        {% endif %}
                        <th>Locus</th>
                   </tr>
                </thead>
                <tbody>
                    {% for marker in qtl_results %}
                        {% if (score_type == "LOD" and marker.lod_score > cutoff) or
                              (score_type == "LRS" and marker.lrs_value > cutoff) %}
                        <tr>
                            <td>
                                <input type="checkbox" name="selectCheck"
                                       class="checkbox edit_sample_checkbox"
                                       value="{{ marker.name }}" checked="checked">
                            </td>
                            <Td align="right">{{ loop.index }}</Td>
                            {% if score_type == "LOD" %}
                            <td>{{ '%0.2f' | format(marker.lod_score|float) }}</td>
                            {% else %}
                            <td>{{ '%0.2f' | format(marker.lrs_value|float) }}</td>
                            {% endif %}
                            <td>{{marker.chr}}</td>
                            <td>{{ '%0.6f' | format(marker.Mb|float) }}</td>
                            <td>
                                {{ marker.name }}
                                <!--<a href="{{ url_for('show_trait_page',
                                        trait_id = marker.name,
                                        dataset = dataset.name
                                        )}}">
                                    {{ marker.name }}
                                </a>-->
                            </td>
                        </tr>
                        {% endif %}
                    {% endfor %}
                </tbody>
            </table>
        </div>
    </div>

    <!-- End of body -->

{% endblock %}

{% block js %}  
    <script>
        js_data = {{ js_data | safe }}
    </script>

    <script type="text/javascript" charset="utf-8">
        $(document).ready( function () {
            console.time("Creating table");
            $('#qtl_results').dataTable( {
                "columns": [
                    { "type": "natural", "bSortable": false },
                    { "type": "natural" },
                    { "type": "natural" },
                    { "type": "natural" },
                    { "type": "natural" },
                    { "type": "natural" }
                    ],
                "buttons": [
                    'csv'
                ],
                "sDom": "RZBtir",
                "iDisplayLength": -1,
                "autoWidth": true,
                "bDeferRender": true,
                "bSortClasses": false,
                "scrollY": "700px",
                "scrollCollapse": true,
                "paging": false
            } );
            console.timeEnd("Creating table");

        });
    </script>
{% endblock %}