Commit 75c66d2c authored by Mathieu Courcelles's avatar Mathieu Courcelles

Adds validation status color in 3D viewer (Issue #13)

parent ed059aa3
Pipeline #15344732 (#) passed with stage
in 2 minutes and 14 seconds
...@@ -175,6 +175,18 @@ ...@@ -175,6 +175,18 @@
else if(scale_type == 'score') { else if(scale_type == 'score') {
color_command = 'color measure [x' + scale(position['score']).substring(1) + ']; ' color_command = 'color measure [x' + scale(position['score']).substring(1) + ']; '
} }
else if(scale_type == 'validation') {
status = validation[position['pk']];
colors = {};
colors['G'] = '00a65a';
colors['Y'] = 'f39c12';
colors['R'] = 'dd4b39';
colors[''] = '999999';
color_command = 'color measure [x' + colors[status] + ']; '
}
else { else {
color_command = 'color measure [x999999]; ' color_command = 'color measure [x999999]; '
} }
...@@ -206,6 +218,14 @@ ...@@ -206,6 +218,14 @@
{% endfor %} {% endfor %}
}; };
validation = {
{% for clpep in validation_list %}
{{clpep.pk}}: '{{clpep.validated}}',
{% endfor %}
};
var coloredLabeled = {}; var coloredLabeled = {};
......
...@@ -208,6 +208,7 @@ def jsmol_view(request, clpeptide_set, form=None): ...@@ -208,6 +208,7 @@ def jsmol_view(request, clpeptide_set, form=None):
return HttpResponse('<h1>%s</h1>' % e) return HttpResponse('<h1>%s</h1>' % e)
cross_links = [] cross_links = []
validation_list = list()
cl_count = len(clpeptide_set) cl_count = len(clpeptide_set)
mapped_cl_count = 0 mapped_cl_count = 0
...@@ -278,6 +279,8 @@ def jsmol_view(request, clpeptide_set, form=None): ...@@ -278,6 +279,8 @@ def jsmol_view(request, clpeptide_set, form=None):
cldistance.identity_2, cldistance.identity_2,
)) ))
validation_list.append(clpep)
if min_distance != 1000000000000: if min_distance != 1000000000000:
min_distance_list.append(min_distance) min_distance_list.append(min_distance)
...@@ -390,7 +393,9 @@ def jsmol_view(request, clpeptide_set, form=None): ...@@ -390,7 +393,9 @@ def jsmol_view(request, clpeptide_set, form=None):
'draw_count': draw_count, 'draw_count': draw_count,
'p_value': p_value_str, 'p_value': p_value_str,
'min_score': form.cleaned_data['min_score'], 'min_score': form.cleaned_data['min_score'],
'max_score': form.cleaned_data['max_score'] 'max_score': form.cleaned_data['max_score'],
'validation_list': validation_list
} }
return render(request, 'jsmol.html', c) return render(request, 'jsmol.html', c)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment