-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgenotype_description_edit.html
114 lines (84 loc) · 3.51 KB
/
genotype_description_edit.html
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
{% extends "base.html" %}
{% block pagetitle %} Edit Genotype Description {% endblock %}
{% block c_body %}
<h3>Submission: <a href="{{ url_for('edit_submission', id=submission_id) }}"> {{ submission_id }} </a> </h3>
<form action="{{ url_for('edit_genotype_description', id=id) }}" method="POST" name="form" class="form-horizontal" enctype="multipart/form-data">
{{ form.hidden_tag() }}
{% include 'genotype_description_form.html' %}
{% if ncbi %}
<div class="row">
<div class="col-sm-8 col-sm-offset-2">
{{ sam_table }}
</div>
</div>
<div class="row">
<div class="col-sm-8 col-sm-offset-2">
{{ srr_table }}
</div>
</div>
<div class="row col-sm-offset-3">
<p >(Details will be updated from NCBI when you save)</p>
</div>
{% endif %}
<div class="form-group">
<div class="col-sm-8 col-sm-offset-3">
<ul class="list-unstyled">
<li>Choosing a Genotype File to upload will overwrite any existing data.</li>
<li>This <a href="https://github.com/airr-community/ogrdbstats" target="_blank">R script</a> can be used to create the Genotype File.</li>
<li><a href="/static/templates/genotype_template.csv">Download Genotype File Template</a></li>
<li><a href="/static/templates/genotype_fields.csv">Download Field Descriptions</a></li>
<li><a href="/static/docs/genotype_1.csv">Download Example File</a></li>
</ul>
</div>
</div>
<input type="submit" value="Save" class="btn btn-primary col-sm-offset-3" id="save_genotype">
<input type="submit" value="Save & Close" class="btn btn-default" id="save_close_genotype" name="save_close_genotype">
{{ form.cancel(class="btn btn-cancel") }}
</form>
{% endblock %}
{% block scripts %}
{{ super() }}
<script>
hc_seq_values = '';
lc_seq_values = '';
function arrayRemove(arr, value) {
return arr.filter(function(ele){
return ele != value;
});
}
function seq_type_options() {
lightchains = ['IGK', 'IGL', 'TRA', 'TRG'];
sel_value = $('#sequence_type').val();
$('#sequence_type').children().remove();
if(lightchains.includes($('#locus').val())) {
opts = lc_seq_values;
} else {
opts = hc_seq_values;
}
$.each(opts, function(key, value) {
$('#sequence_type')
.append($("<option></option>")
.attr("value",value)
.text(value));
});
$('#sequence_type').val(sel_value);
}
$('#locus').change(function() {
seq_type_options();
});
$(document).ready(function () {
seq_options = $('#sequence_type option');
hc_seq_values = $.map(seq_options ,function(option) {
return option.value;
});
lc_seq_values = hc_seq_values;
h_seqs = ['D', 'CH1', 'CH2', 'CH3', 'CH4']
hc_seq_values.forEach(function(item, index) {
if(h_seqs.includes(item)) {
lc_seq_values = arrayRemove(lc_seq_values, item)
}
});
seq_type_options();
});
</script>
{% endblock %}