allpy
changeset 1133:1c4de7c376a6
JavaScript alignment viewer: fix groups highlighting
If some aminoacid is not member of any conservative group
and a column consists of this aminoacid (100%),
it used not to be highlighted.
author | Boris Nagaev <bnagaev@gmail.com> |
---|---|
date | Fri, 11 Jan 2013 18:27:32 +0400 |
parents | 0596fc8cd846 |
children | 1d5dffc8d201 |
files | blocks3d/www/input/blocks.js |
diffstat | 1 files changed, 10 insertions(+), 2 deletions(-) [+] |
line diff
1.1 --- a/blocks3d/www/input/blocks.js Thu Jan 10 20:02:04 2013 +0400 1.2 +++ b/blocks3d/www/input/blocks.js Fri Jan 11 18:27:32 2013 +0400 1.3 @@ -56,13 +56,21 @@ 1.4 var result = false; 1.5 $.each(conservative_groups_dict, function(i, group) { 1.6 var inside_group = true; 1.7 + var conservative = true; 1.8 + var aa = '' 1.9 $.each(sequences, function(j, ID) { 1.10 - if (!group[fasta_dict[ID].charAt(column).toUpperCase()]) 1.11 + var a = fasta_dict[ID].charAt(column).toUpperCase(); 1.12 + if (!group[a]) 1.13 { 1.14 inside_group = false; 1.15 } 1.16 + if (aa == '') { 1.17 + aa = a; 1.18 + } else if (a != aa) { 1.19 + conservative = false; 1.20 + } 1.21 }); 1.22 - if (inside_group) 1.23 + if (inside_group || conservative) 1.24 { 1.25 result = true; 1.26 }