about summary refs log tree commit diff
path: root/uploader/templates/genotypes/list-genotypes.html
blob: be297a4d9062edd4232721d50da664a73421da75 (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
{%extends "genotypes/base.html"%}
{%from "flash_messages.html" import flash_all_messages%}

{%block title%}Genotypes{%endblock%}

{%block pagetitle%}Genotypes{%endblock%}

{%block contents%}
{{flash_all_messages()}}

<div class="row">
  <h2>Genotype Encoding</h2>
  <p>
    The genotype encoding used for the "{{population.FullName}}" population from
    the "{{species.FullName}}" species is as shown in the table below.
  </p>
  <table class="table">

    <thead>
      <tr>
        <th>Allele Type</th>
        <th>Allele Symbol</th>
        <th>Allele Value</th>
      </tr>
    </thead>

    <tbody>
      {%for row in genocode%}
      <tr>
        <td>{{row.AlleleType}}</td>
        <td>{{row.AlleleSymbol}}</td>
        <td>{{row.DatabaseValue if row.DatabaseValue is not none else "NULL"}}</td>
      </tr>
      {%else%}
      <tr>
        <td colspan="7" class="text-info">
          <span class="glyphicon glyphicon-exclamation-sign"></span>
          There is no explicit genotype encoding defined for this population.
        </td>
      </tr>
      {%endfor%}
    </tbody>
  </table>

  {%if genocode | length < 1%}
  <div class="col">
    <a href="#add-genotype-encoding"
       title="Add a genotype encoding system for this population"
       class="btn btn-primary not-implemented">
      define genotype encoding
    </a>
  </div>
  {%endif%}
</div>

<div class="row">
  <h2 class="subheading">Genetic Markers</h2>

  <table id="tbl-genetic-markers" class="table compact stripe cell-border"
         data-genetic-markers='{{genetic_markers | tojson}}'>
    <thead>
      <tr>
        <th title="">Index</th>
        <th title="">Marker Name</th>
        <th title="Chromosome">Chr</th>
        <th title="Physical location of the marker in megabasepairs">
          Location (Mb)</th>
        <th title="">Source</th>
        <th title="">Source2</th>
    </thead>

    <tbody>
      {%for marker in markers%}
      <tr>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
      </tr>
      {%endfor%}
    </tbody>
  </table>
</div>

<div class="row text-danger">
  <h3>Some Important Concepts to Consider/Remember</h3>
  <ul>
    <li>Reference vs. Non-reference alleles</li>
    <li>In <em>GenoCode</em> table, items are ordered by <strong>InbredSet</strong></li>
  </ul>
  <h3>Possible references</h3>
  <ul>
    <li>https://mr-dictionary.mrcieu.ac.uk/term/genotype/</li>
    <li>https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7363099/</li>
  </ul>
</div>

<div class="row">
  <h2>Genotype Datasets</h2>

  <p>The genotype data is organised under various genotype datasets. You can
    click on the link for the relevant dataset to view a little more information
    about it.</p>

  {%if dataset is not none%}
    <table class="table">
      <thead>
        <tr>
          <th>Name</th>
          <th>Full Name</th>
        </tr>
      </thead>

      <tbody>
        <tr>
          <td>{{dataset.Name}}</td>
          <td><a href="{{url_for('species.populations.genotypes.view_dataset',
                       species_id=species.SpeciesId,
                       population_id=population.Id,
                       dataset_id=dataset.Id)}}"
                 title="View details regarding and manage dataset '{{dataset.FullName}}'">
              {{dataset.FullName}}</a></td>
        </tr>
      </tbody>
    </table>
  {%else%}
  <p class="text-warning">
    <span class="glyphicon glyphicon-exclamation-sign"></span>
    There is no genotype dataset defined for this population.
  </p>
  <p>
    <a href="{{url_for('species.populations.genotypes.create_dataset',
             species_id=species.SpeciesId,
             population_id=population.Id)}}"
       title="Create a new genotype dataset for the '{{population.FullName}}' population for the '{{species.FullName}}' species."
       class="btn btn-primary">
      create new genotype dataset</a></p>
  {%endif%}
</div>
<div class="row text-warning">
  <p>
    <span class="glyphicon glyphicon-exclamation-sign"></span>
    <strong>NOTE</strong>: Currently the GN2 (and related) system(s) expect a
    single genotype dataset. If there is more than one, the system apparently
    fails in unpredictable ways.
  </p>
  <p>Fix this to allow multiple datasets, each with a different assembly from
    all the rest.</p>
</div>
{%endblock%}


{%block javascript%}
<script type="text/javascript">
  $(function() {
      var dtGeneticMarkers = buildDataTable(
          "#tbl-genetic-markers",
          JSON.parse($("#tbl-genetic-markers").attr("data-genetic-markers")),
          [
              {data: 'index'},
              {data: 'Name'},
              {data: 'Chr'},
              {data: 'Mb'},
              {data: 'Source'},
              {data: 'Source2'}
          ]);
  })
</script>
{%endblock%}