Commit 72ebb905 authored by Mathieu Courcelles's avatar Mathieu Courcelles

Adds validation color to XiNET (Issue #13)

parent 8349a691
......@@ -133,7 +133,8 @@ class quantificationForm(forms.Form):
COLOR_CHOICES = (
('default', 'default'),
('score', 'Peptide score'),
('quant', 'Peptide fold change')
('quant', 'Peptide fold change'),
('validation', 'Validation')
)
color_scheme = forms.ChoiceField(choices=COLOR_CHOICES)
......
......@@ -214,6 +214,12 @@ quant = {
{% for quant_clpep in quant_set %}
{{quant_clpep.clpeptide.pk}}: {{quant_clpep.fold_change}},
{% endfor %}
};
validation = {
{% for clpep in clpeptide_set %}
{{clpep.pk}}: '{{clpep.validated}}',
{% endfor %}
};
// synchFilters();
......
......@@ -351,6 +351,45 @@ ResidueLink.prototype.check = function(filter) {
this.line.setAttribute("stroke", scale(sum/count));
}
}
// Recolor link based on validation status
if(scale_type == 'validation') {
status = ''
for(i = 0; i < filteredMatches.length; i++) {
if(validation[filteredMatches[i]['id']]) {
value = validation[filteredMatches[i]['id']];
if(status == '' && value != '') {
status = value;
}
else if (status == 'G') {
}
else if (status == 'Y' && value == 'G') {
status = value;
}
else if (status == 'R' && (value == 'G' || value == 'Y')) {
status = value;
}
}
}
if(status == 'G') {
this.line.setAttribute("stroke", '#00a65a');
}
else if(status == 'Y') {
this.line.setAttribute("stroke", '#f39c12');
}
else if(status == 'R') {
this.line.setAttribute("stroke", '#dd4b39');
}
else {
this.line.setAttribute("stroke", 'gray');
}
}
......
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