From: gmungoc Date: Mon, 26 Jan 2015 16:45:29 +0000 (+0000) Subject: Merge branch 'features/JAL-1588saveChimeraSession' into develop X-Git-Tag: Jalview_2_9~106 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=c0aaf84826ff25d510846bd1099e10809c4df711;hp=31f1b88951cc5ff3aea7ae0bc1a9d8fbdd264ea3;p=jalview.git Merge branch 'features/JAL-1588saveChimeraSession' into develop --- diff --git a/.classpath b/.classpath index 4c39421..59772ae 100644 --- a/.classpath +++ b/.classpath @@ -49,11 +49,10 @@ - - + diff --git a/examples/testdata/uniref50_seqref.jva b/examples/testdata/uniref50_seqref.jva new file mode 100644 index 0000000..5e7d2da --- /dev/null +++ b/examples/testdata/uniref50_seqref.jva @@ -0,0 +1,176 @@ +JALVIEW_ANNOTATION +# Created: Fri Jun 21 13:44:50 BST 2013 + +BAR_GRAPH Conservation Conservation of total alignment less than 25% gaps 1.0,1,1.0,[5d1500]|3.0,3,3.0,[7d3f00]|0.0,-,0.0,[4d0000]|0.0,-,0.0,[4d0000]|0.0,-,0.0,[4d0000]|0.0,-,0.0,[4d0000]|0.0,-,0.0,[4d0000]|0.0,-,0.0,[4d0000]|0.0,-,0.0,[4d0000]|0.0,-,0.0,[4d0000]|0.0,-,0.0,[4d0000]|0.0,-,0.0,[4d0000]|0.0,-,0.0,[4d0000]|0.0,-,0.0,[4d0000]|1.0,1,1.0,[5d1500]|2.0,2,2.0,[6d2a00]|0.0,0,0.0,[4d0000]|1.0,1,1.0,[5d1500]|0.0,0,0.0,[4d0000]|1.0,1,1.0,[5d1500]|0.0,0,0.0,[4d0000]|0.0,-,0.0,[4d0000]|0.0,-,0.0,[4d0000]|0.0,-,0.0,[4d0000]|0.0,0,0.0,[4d0000]|1.0,1,1.0,[5d1500]|0.0,0,0.0,[4d0000]|0.0,0,0.0,[4d0000]|0.0,0,0.0,[4d0000]|0.0,-,0.0,[4d0000]|0.0,-,0.0,[4d0000]|0.0,0,0.0,[4d0000]|0.0,0,0.0,[4d0000]|0.0,0,0.0,[4d0000]|0.0,0,0.0,[4d0000]|0.0,0,0.0,[4d0000]|0.0,0,0.0,[4d0000]|0.0,0,0.0,[4d0000]|0.0,-,0.0,[4d0000]|0.0,-,0.0,[4d0000]|2.0,2,2.0,[6d2a00]|1.0,1,1.0,[5d1500]|1.0,1,1.0,[5d1500]|1.0,1,1.0,[5d1500]|0.0,0,0.0,[4d0000]|0.0,0,0.0,[4d0000]|1.0,1,1.0,[5d1500]|0.0,-,0.0,[4d0000]|2.0,2,2.0,[6d2a00]|0.0,-,0.0,[4d0000]|0.0,-,0.0,[4d0000]|0.0,-,0.0,[4d0000]|0.0,-,0.0,[4d0000]|0.0,-,0.0,[4d0000]|0.0,0,0.0,[4d0000]|0.0,0,0.0,[4d0000]|0.0,0,0.0,[4d0000]|1.0,1,1.0,[5d1500]|0.0,0,0.0,[4d0000]|11.0,*,11.0,[ffe600]|7.0,7,7.0,[be9200]|11.0,*,11.0,[ffe600]|6.0,6,6.0,[ae7d00]|11.0,*,11.0,[ffe600]|6.0,6,6.0,[ae7d00]|8.0,8,8.0,[cea700]|9.0,9,9.0,[dfbc00]|11.0,*,11.0,[ffe600]|11.0,*,11.0,[ffe600]|7.0,7,7.0,[be9200]|11.0,*,11.0,[ffe600]|3.0,3,3.0,[7d3f00]|6.0,6,6.0,[ae7d00]|11.0,*,11.0,[ffe600]|7.0,7,7.0,[be9200]|7.0,7,7.0,[be9200]|9.0,9,9.0,[dfbc00]|5.0,5,5.0,[9e6800]|6.0,6,6.0,[ae7d00]|8.0,8,8.0,[cea700]|11.0,*,11.0,[ffe600]|11.0,*,11.0,[ffe600]|9.0,9,9.0,[dfbc00]|11.0,*,11.0,[ffe600]|11.0,*,11.0,[ffe600]|3.0,3,3.0,[7d3f00]|11.0,*,11.0,[ffe600]|11.0,*,11.0,[ffe600]|11.0,*,11.0,[ffe600]|3.0,3,3.0,[7d3f00]|11.0,*,11.0,[ffe600]|5.0,5,5.0,[9e6800]|9.0,9,9.0,[dfbc00]|11.0,*,11.0,[ffe600]|11.0,*,11.0,[ffe600]|9.0,9,9.0,[dfbc00]|11.0,*,11.0,[ffe600]|11.0,*,11.0,[ffe600]|11.0,*,11.0,[ffe600]|11.0,*,11.0,[ffe600]|11.0,*,11.0,[ffe600]|11.0,*,11.0,[ffe600]|11.0,*,11.0,[ffe600]|11.0,*,11.0,[ffe600]|11.0,*,11.0,[ffe600]|11.0,*,11.0,[ffe600]|11.0,*,11.0,[ffe600]|11.0,*,11.0,[ffe600]|11.0,*,11.0,[ffe600]|9.0,9,9.0,[dfbc00]|3.0,3,3.0,[7d3f00]|7.0,7,7.0,[be9200]|11.0,*,11.0,[ffe600]|3.0,3,3.0,[7d3f00]|9.0,9,9.0,[dfbc00]|8.0,8,8.0,[cea700]|11.0,*,11.0,[ffe600]|6.0,6,6.0,[ae7d00]|11.0,*,11.0,[ffe600]|4.0,4,4.0,[8d5300]|5.0,5,5.0,[9e6800]|9.0,9,9.0,[dfbc00]|11.0,*,11.0,[ffe600]|8.0,8,8.0,[cea700]|9.0,9,9.0,[dfbc00]|0.0,0,0.0,[4d0000]|1.0,1,1.0,[5d1500]|0.0,0,0.0,[4d0000]|0.0,0,0.0,[4d0000]|0.0,0,0.0,[4d0000]|3.0,3,3.0,[7d3f00]|2.0,2,2.0,[6d2a00]|3.0,3,3.0,[7d3f00]|2.0,2,2.0,[6d2a00]|2.0,2,2.0,[6d2a00]|2.0,2,2.0,[6d2a00]|1.0,1,1.0,[5d1500]|3.0,3,3.0,[7d3f00]|2.0,2,2.0,[6d2a00]|2.0,2,2.0,[6d2a00]|0.0,0,0.0,[4d0000]|1.0,1,1.0,[5d1500]|4.0,4,4.0,[8d5300]|3.0,3,3.0,[7d3f00]|1.0,1,1.0,[5d1500]|2.0,2,2.0,[6d2a00]|3.0,3,3.0,[7d3f00]|2.0,2,2.0,[6d2a00]|5.0,5,5.0,[9e6800]|3.0,3,3.0,[7d3f00]|3.0,3,3.0,[7d3f00]|0.0,0,0.0,[4d0000]|0.0,0,0.0,[4d0000]|1.0,1,1.0,[5d1500]|0.0,0,0.0,[4d0000]|0.0,-,0.0,[4d0000]|0.0,-,0.0,[4d0000]| +BAR_GRAPH Quality Alignment Quality based on Blosum62 scores 29.151815,29.151815,[cba200]|30.574812,30.574812,[d1aa00]|14.400199,14.400199,[8b5000]|16.93248,16.93248,[965e00]|2.1220763,2.1220763,[560c00]|2.2049963,2.2049963,[560c00]|3.647952,3.647952,[5c1400]|4.814642,4.814642,[611b00]|18.351393,18.351393,[9c6600]|17.532412,17.532412,[996200]|7.5054855,7.5054855,[6d2a00]|15.490477,15.490477,[905600]|14.241707,14.241707,[8a4f00]|9.905579,9.905579,[773700]|20.354017,20.354017,[a57100]|26.870352,26.870352,[c19600]|24.969187,24.969187,[b98b00]|27.419409,27.419409,[c39900]|15.350427,15.350427,[8f5600]|21.116522,21.116522,[a87600]|9.34032,9.34032,[753400]|14.1895275,14.1895275,[8a4f00]|10.104505,10.104505,[783800]|8.587312,8.587312,[723000]|18.694708,18.694708,[9e6800]|11.420612,11.420612,[7e4000]|6.8467255,6.8467255,[6a2600]|17.449827,17.449827,[986100]|16.825909,16.825909,[955e00]|2.4334474,2.4334474,[570e00]|15.685622,15.685622,[915700]|9.836516,9.836516,[773700]|3.4712791,3.4712791,[5c1300]|4.531816,4.531816,[601900]|7.8744216,7.8744216,[6f2c00]|0.0,0.0,[4d0000]|9.01113,9.01113,[743200]|3.174218,3.174218,[5a1200]|2.0395048,2.0395048,[550b00]|2.1654668,2.1654668,[560c00]|21.517344,21.517344,[aa7800]|15.738462,15.738462,[915800]|14.844854,14.844854,[8d5300]|22.159096,22.159096,[ad7c00]|13.956608,13.956608,[894e00]|20.147892,20.147892,[a47000]|25.067545,25.067545,[b98c00]|2.0943506,2.0943506,[560c00]|20.30842,20.30842,[a57100]|10.254437,10.254437,[793900]|6.5836596,6.5836596,[692500]|19.446732,19.446732,[a16c00]|6.2202287,6.2202287,[672300]|9.796006,9.796006,[773700]|6.0385494,6.0385494,[672200]|13.963727,13.963727,[894e00]|13.838549,13.838549,[884d00]|18.48424,18.48424,[9d6700]|18.302633,18.302633,[9c6600]|41.172745,41.172745,[ffe600]|32.59908,32.59908,[dab600]|41.172745,41.172745,[ffe600]|34.495945,34.495945,[e2c000]|41.172745,41.172745,[ffe600]|33.501804,33.501804,[debb00]|27.034466,27.034466,[c29700]|40.020737,40.020737,[fadf00]|41.172745,41.172745,[ffe600]|41.172745,41.172745,[ffe600]|29.252739,29.252739,[cba300]|41.172745,41.172745,[ffe600]|14.935498,14.935498,[8d5300]|0.88449144,0.88449144,[500500]|41.172745,41.172745,[ffe600]|20.81991,20.81991,[a77400]|31.73346,31.73346,[d6b100]|29.757969,29.757969,[cea600]|16.279755,16.279755,[935b00]|32.647984,32.647984,[dab600]|38.352337,38.352337,[f3d600]|41.172745,41.172745,[ffe600]|41.172745,41.172745,[ffe600]|39.6125,39.6125,[f8dd00]|41.172745,41.172745,[ffe600]|41.172745,41.172745,[ffe600]|9.671661,9.671661,[763600]|41.172745,41.172745,[ffe600]|41.172745,41.172745,[ffe600]|41.172745,41.172745,[ffe600]|11.17141,11.17141,[7d3e00]|41.172745,41.172745,[ffe600]|3.2054348,3.2054348,[5a1200]|38.569283,38.569283,[f4d700]|41.172745,41.172745,[ffe600]|41.172745,41.172745,[ffe600]|39.707684,39.707684,[f9dd00]|41.172745,41.172745,[ffe600]|41.172745,41.172745,[ffe600]|41.172745,41.172745,[ffe600]|41.172745,41.172745,[ffe600]|41.172745,41.172745,[ffe600]|41.172745,41.172745,[ffe600]|41.172745,41.172745,[ffe600]|41.172745,41.172745,[ffe600]|41.172745,41.172745,[ffe600]|41.172745,41.172745,[ffe600]|41.172745,41.172745,[ffe600]|41.172745,41.172745,[ffe600]|41.172745,41.172745,[ffe600]|39.447525,39.447525,[f8dc00]|21.229778,21.229778,[a97600]|27.779364,27.779364,[c59b00]|41.172745,41.172745,[ffe600]|24.149143,24.149143,[b58700]|39.447525,39.447525,[f8dc00]|33.857655,33.857655,[dfbd00]|41.172745,41.172745,[ffe600]|28.69976,28.69976,[c9a000]|41.172745,41.172745,[ffe600]|14.611241,14.611241,[8c5100]|32.346375,32.346375,[d9b400]|39.24055,39.24055,[f7db00]|41.172745,41.172745,[ffe600]|38.352337,38.352337,[f3d600]|38.569283,38.569283,[f4d700]|22.374107,22.374107,[ae7d00]|36.98438,36.98438,[edce00]|12.34415,12.34415,[824500]|11.811655,11.811655,[804200]|14.798897,14.798897,[8d5200]|36.60138,36.60138,[ebcc00]|14.0762415,14.0762415,[8a4e00]|36.817875,36.817875,[eccd00]|36.53897,36.53897,[ebcc00]|37.583706,37.583706,[efd100]|35.536423,35.536423,[e7c600]|18.004925,18.004925,[9b6400]|37.633095,37.633095,[f0d200]|34.738743,34.738743,[e3c200]|36.451622,36.451622,[ebcb00]|19.948801,19.948801,[a36f00]|28.285,28.285,[c79e00]|35.93151,35.93151,[e8c800]|36.817875,36.817875,[eccd00]|26.762383,26.762383,[c19500]|36.37101,36.37101,[eacb00]|36.413998,36.413998,[eacb00]|37.583706,37.583706,[efd100]|36.282784,36.282784,[eaca00]|34.729824,34.729824,[e3c200]|36.413998,36.413998,[eacb00]|24.348654,24.348654,[b68800]|24.349539,24.349539,[b68800]|34.091675,34.091675,[e0be00]|21.114677,21.114677,[a87600]|13.676696,13.676696,[884c00]|2.1107035,2.1107035,[560c00]| +BAR_GRAPH Consensus PID 80.0,M,M 80%|80.0,A,A 80%|20.0,+,[AST] 20%|53.333332,T,T 53%|0.0,-,- 0%|0.0,-,- 0%|13.333333,T,T 13%|20.0,P,P 20%|40.0,A,A 40%|40.0,L,L 40%|46.666668,S,S 46%|40.0,G,G 40%|33.333332,T,T 33%|20.0,+,[AIM] 20%|33.333332,V,V 33%|66.666664,S,S 66%|66.666664,T,T 66%|66.666664,S,S 66%|66.666664,F,F 66%|46.666668,L,L 46%|46.666668,R,R 46%|46.666668,R,R 46%|26.666666,Q,Q 26%|46.666668,P,P 46%|40.0,A,A 40%|60.0,P,P 60%|26.666666,T,T 26%|53.333332,S,S 53%|40.0,L,L 40%|20.0,R,R 20%|26.666666,S,S 26%|33.333332,L,L 33%|40.0,P,P 40%|26.666666,S,S 26%|33.333332,+,[AN] 33%|26.666666,V,V 26%|33.333332,G,G 33%|20.0,+,[EQ] 20%|0.0,-,- 0%|0.0,-,- 0%|33.333332,+,[AS] 33%|53.333332,L,L 53%|60.0,F,F 60%|73.333336,G,G 73%|66.666664,L,L 66%|66.666664,K,K 66%|53.333332,S,S 53%|0.0,-,- 0%|40.0,S,S 40%|26.666666,T,T 26%|20.0,A,A 20%|66.666664,R,R 66%|40.0,G,G 40%|53.333332,G,G 53%|46.666668,R,R 46%|33.333332,V,V 33%|46.666668,T,T 46%|53.333332,A,A 53%|66.666664,M,M 66%|100.0,A,A 100%|53.333332,T,T 53%|100.0,Y,Y 100%|86.666664,K,K 86%|100.0,V,V 100%|86.666664,K,K 86%|66.666664,L,L 66%|80.0,I,I 80%|100.0,T,T 100%|100.0,P,P 100%|66.666664,E,E 66%|100.0,G,G 100%|46.666668,E,E 46%|46.666668,Q,Q 46%|100.0,E,E 100%|46.666668,F,F 46%|60.0,E,E 60%|86.666664,C,C 86%|66.666664,P,P 66%|80.0,D,D 80%|93.333336,D,D 93%|100.0,V,V 100%|100.0,Y,Y 100%|66.666664,I,I 66%|100.0,L,L 100%|100.0,D,D 100%|46.666668,A,A 46%|100.0,A,A 100%|100.0,E,E 100%|100.0,E,E 100%|53.333332,A,A 53%|100.0,G,G 100%|60.0,I,I 60%|93.333336,D,D 93%|100.0,L,L 100%|100.0,P,P 100%|93.333336,Y,Y 93%|100.0,S,S 100%|100.0,C,C 100%|100.0,R,R 100%|100.0,A,A 100%|100.0,G,G 100%|100.0,S,S 100%|100.0,C,C 100%|100.0,S,S 100%|100.0,S,S 100%|100.0,C,C 100%|100.0,A,A 100%|100.0,G,G 100%|100.0,K,K 100%|80.0,V,V 80%|60.0,V,V 60%|53.333332,S,S 53%|100.0,G,G 100%|60.0,S,S 60%|80.0,V,V 80%|80.0,D,D 80%|100.0,Q,Q 100%|66.666664,S,S 66%|100.0,D,D 100%|46.666668,+,[GQ] 46%|73.333336,S,S 73%|93.333336,F,F 93%|100.0,L,L 100%|93.333336,D,D 93%|93.333336,D,D 93%|53.333332,D,D 53%|93.333336,Q,Q 93%|53.333332,I,I 53%|40.0,A,A 40%|53.333332,E,E 53%|93.333336,G,G 93%|46.666668,W,W 46%|93.333336,V,V 93%|93.333336,L,L 93%|93.333336,T,T 93%|93.333336,C,C 93%|53.333332,V,V 53%|93.333336,A,A 93%|86.666664,Y,Y 86%|93.333336,P,P 93%|60.0,T,T 60%|73.333336,S,S 73%|93.333336,D,D 93%|93.333336,V,V 93%|66.666664,T,T 66%|93.333336,I,I 93%|93.333336,E,E 93%|93.333336,T,T 93%|93.333336,H,H 93%|86.666664,K,K 86%|93.333336,E,E 93%|73.333336,E,E 73%|60.0,E,E 60%|73.333336,L,L 73%|46.666668,T,T 46%|40.0,A,A 40%|0.0,-,- 0%| + +SEQUENCE_REF FER2_ARATH +LINE_GRAPH IUPredWS (Long) Protein Disorder with IUPredWS - raw scores
Above 0.5 indicates disorder 0.1671,0.1671,[72144e]|0.2129,0.2129,[72144e]|0.247,0.247,[72144e]|0.1554,0.1554,[72144e]|0.1162,0.1162,[72144e]|0.1449,0.1449,[72144e]|0.1731,0.1731,[72144e]|0.2064,0.2064,[72144e]|0.2436,0.2436,[72144e]|0.2715,0.2715,[72144e]|0.3249,0.3249,[72144e]|0.2783,0.2783,[72144e]|0.3019,0.3019,[72144e]|0.2399,0.2399,[72144e]|0.2364,0.2364,[72144e]|0.2645,0.2645,[72144e]|0.2609,0.2609,[72144e]|0.2988,0.2988,[72144e]|0.2064,0.2064,[72144e]|0.2094,0.2094,[72144e]|0.2849,0.2849,[72144e]|0.3426,0.3426,[72144e]|0.3529,0.3529,[72144e]|0.3426,0.3426,[72144e]|0.2817,0.2817,[72144e]|0.2783,0.2783,[72144e]|0.3426,0.3426,[72144e]|0.2715,0.2715,[72144e]|0.2609,0.2609,[72144e]|0.2503,0.2503,[72144e]|0.2364,0.2364,[72144e]|0.2364,0.2364,[72144e]|0.1791,0.1791,[72144e]|0.247,0.247,[72144e]|0.2503,0.2503,[72144e]|0.3149,0.3149,[72144e]|0.3149,0.3149,[72144e]|0.2645,0.2645,[72144e]|0.3356,0.3356,[72144e]|0.2752,0.2752,[72144e]|0.346,0.346,[72144e]|0.346,0.346,[72144e]|0.3426,0.3426,[72144e]|0.2645,0.2645,[72144e]|0.247,0.247,[72144e]|0.1969,0.1969,[72144e]|0.2503,0.2503,[72144e]|0.2503,0.2503,[72144e]|0.1852,0.1852,[72144e]|0.2541,0.2541,[72144e]|0.2951,0.2951,[72144e]|0.3182,0.3182,[72144e]|0.3215,0.3215,[72144e]|0.3392,0.3392,[72144e]|0.374,0.374,[72144e]|0.3948,0.3948,[72144e]|0.3392,0.3392,[72144e]|0.3599,0.3599,[72144e]|0.268,0.268,[72144e]|0.3426,0.3426,[72144e]|0.3599,0.3599,[72144e]|0.4051,0.4051,[72144e]|0.374,0.374,[72144e]|0.3249,0.3249,[72144e]|0.268,0.268,[72144e]|0.2783,0.2783,[72144e]|0.3019,0.3019,[72144e]|0.3286,0.3286,[72144e]|0.3117,0.3117,[72144e]|0.4292,0.4292,[72144e]|0.5296,0.5296,[72144e]|0.4901,0.4901,[72144e]|0.4582,0.4582,[72144e]|0.3667,0.3667,[72144e]|0.384,0.384,[72144e]|0.2918,0.2918,[72144e]|0.3182,0.3182,[72144e]|0.2193,0.2193,[72144e]|0.2752,0.2752,[72144e]|0.1643,0.1643,[72144e]|0.2541,0.2541,[72144e]|0.2034,0.2034,[72144e]|0.1852,0.1852,[72144e]|0.1702,0.1702,[72144e]|0.1399,0.1399,[72144e]|0.2034,0.2034,[72144e]|0.2541,0.2541,[72144e]|0.2292,0.2292,[72144e]|0.1881,0.1881,[72144e]|0.2129,0.2129,[72144e]|0.2292,0.2292,[72144e]|0.1643,0.1643,[72144e]|0.107,0.107,[72144e]|0.1251,0.1251,[72144e]|0.1251,0.1251,[72144e]|0.1759,0.1759,[72144e]|0.1115,0.1115,[72144e]|0.1731,0.1731,[72144e]|0.1501,0.1501,[72144e]|0.2164,0.2164,[72144e]|0.2328,0.2328,[72144e]|0.3286,0.3286,[72144e]|0.3286,0.3286,[72144e]|0.2645,0.2645,[72144e]|0.2034,0.2034,[72144e]|0.2193,0.2193,[72144e]|0.3286,0.3286,[72144e]|0.3529,0.3529,[72144e]|0.3631,0.3631,[72144e]|0.4292,0.4292,[72144e]|0.4541,0.4541,[72144e]|0.4766,0.4766,[72144e]|0.4864,0.4864,[72144e]|0.4652,0.4652,[72144e]|0.4685,0.4685,[72144e]|0.4051,0.4051,[72144e]|0.4087,0.4087,[72144e]|0.3117,0.3117,[72144e]|0.3321,0.3321,[72144e]|0.2918,0.2918,[72144e]|0.2164,0.2164,[72144e]|0.2503,0.2503,[72144e]|0.2364,0.2364,[72144e]|0.2292,0.2292,[72144e]|0.2503,0.2503,[72144e]|0.2918,0.2918,[72144e]|0.3053,0.3053,[72144e]|0.2258,0.2258,[72144e]|0.2292,0.2292,[72144e]|0.2129,0.2129,[72144e]|0.2064,0.2064,[72144e]|0.2164,0.2164,[72144e]|0.2436,0.2436,[72144e]|0.2436,0.2436,[72144e]|0.2193,0.2193,[72144e]|0.2258,0.2258,[72144e]|0.2503,0.2503,[72144e]|0.3117,0.3117,[72144e]|0.2884,0.2884,[72144e]|0.374,0.374,[72144e]|0.4149,0.4149,[72144e]|0.4292,0.4292,[72144e]|0.5098,0.5098,[72144e]|0.4476,0.4476,[72144e]|0.422,0.422,[72144e]|0.4017,0.4017,[72144e]|0.3494,0.3494,[72144e]|0.4087,0.4087,[72144e]| +GRAPHLINE IUPredWS (Long) 0.5 Above 0.5 indicates disorder ff0000 +LINE_GRAPH IUPredWS (Short) Protein Disorder with IUPredWS - raw scores
Above 0.5 indicates disorder 0.82,0.82,[329440]|0.7147,0.7147,[329440]|0.6715,0.6715,[329440]|0.6334,0.6334,[329440]|0.59,0.59,[329440]|0.4513,0.4513,[329440]|0.3263,0.3263,[329440]|0.2963,0.2963,[329440]|0.2657,0.2657,[329440]|0.2292,0.2292,[329440]|0.1998,0.1998,[329440]|0.2209,0.2209,[329440]|0.2865,0.2865,[329440]|0.2122,0.2122,[329440]|0.2041,0.2041,[329440]|0.1667,0.1667,[329440]|0.2602,0.2602,[329440]|0.2558,0.2558,[329440]|0.1844,0.1844,[329440]|0.2483,0.2483,[329440]|0.2292,0.2292,[329440]|0.2657,0.2657,[329440]|0.2748,0.2748,[329440]|0.2748,0.2748,[329440]|0.2865,0.2865,[329440]|0.3762,0.3762,[329440]|0.3847,0.3847,[329440]|0.2786,0.2786,[329440]|0.27,0.27,[329440]|0.1878,0.1878,[329440]|0.1805,0.1805,[329440]|0.1805,0.1805,[329440]|0.1532,0.1532,[329440]|0.2255,0.2255,[329440]|0.1958,0.1958,[329440]|0.2786,0.2786,[329440]|0.2657,0.2657,[329440]|0.2748,0.2748,[329440]|0.3491,0.3491,[329440]|0.2531,0.2531,[329440]|0.3456,0.3456,[329440]|0.3491,0.3491,[329440]|0.3146,0.3146,[329440]|0.282,0.282,[329440]|0.27,0.27,[329440]|0.1998,0.1998,[329440]|0.2558,0.2558,[329440]|0.282,0.282,[329440]|0.2602,0.2602,[329440]|0.2602,0.2602,[329440]|0.1878,0.1878,[329440]|0.1844,0.1844,[329440]|0.2122,0.2122,[329440]|0.2292,0.2292,[329440]|0.2602,0.2602,[329440]|0.2786,0.2786,[329440]|0.282,0.282,[329440]|0.3005,0.3005,[329440]|0.2385,0.2385,[329440]|0.3184,0.3184,[329440]|0.2255,0.2255,[329440]|0.2748,0.2748,[329440]|0.3225,0.3225,[329440]|0.3762,0.3762,[329440]|0.3225,0.3225,[329440]|0.3225,0.3225,[329440]|0.2865,0.2865,[329440]|0.2865,0.2865,[329440]|0.3263,0.3263,[329440]|0.3717,0.3717,[329440]|0.4037,0.4037,[329440]|0.4245,0.4245,[329440]|0.4116,0.4116,[329440]|0.3578,0.3578,[329440]|0.3535,0.3535,[329440]|0.2748,0.2748,[329440]|0.2963,0.2963,[329440]|0.2167,0.2167,[329440]|0.3096,0.3096,[329440]|0.2255,0.2255,[329440]|0.3225,0.3225,[329440]|0.1732,0.1732,[329440]|0.1495,0.1495,[329440]|0.1088,0.1088,[329440]|0.1456,0.1456,[329440]|0.2041,0.2041,[329440]|0.1532,0.1532,[329440]|0.2041,0.2041,[329440]|0.1878,0.1878,[329440]|0.1322,0.1322,[329440]|0.1349,0.1349,[329440]|0.1205,0.1205,[329440]|0.0965,0.0965,[329440]|0.0884,0.0884,[329440]|0.0643,0.0643,[329440]|0.0935,0.0935,[329440]|0.0771,0.0771,[329440]|0.1088,0.1088,[329440]|0.0587,0.0587,[329440]|0.0991,0.0991,[329440]|0.0991,0.0991,[329440]|0.1958,0.1958,[329440]|0.2255,0.2255,[329440]|0.2602,0.2602,[329440]|0.2657,0.2657,[329440]|0.1844,0.1844,[329440]|0.2292,0.2292,[329440]|0.2483,0.2483,[329440]|0.2657,0.2657,[329440]|0.3939,0.3939,[329440]|0.4245,0.4245,[329440]|0.4037,0.4037,[329440]|0.4203,0.4203,[329440]|0.4967,0.4967,[329440]|0.5473,0.5473,[329440]|0.4781,0.4781,[329440]|0.4282,0.4282,[329440]|0.3578,0.3578,[329440]|0.4203,0.4203,[329440]|0.3491,0.3491,[329440]|0.2913,0.2913,[329440]|0.2657,0.2657,[329440]|0.1805,0.1805,[329440]|0.2167,0.2167,[329440]|0.208,0.208,[329440]|0.2963,0.2963,[329440]|0.3806,0.3806,[329440]|0.2963,0.2963,[329440]|0.2255,0.2255,[329440]|0.1456,0.1456,[329440]|0.1635,0.1635,[329440]|0.1766,0.1766,[329440]|0.1698,0.1698,[329440]|0.1349,0.1349,[329440]|0.1532,0.1532,[329440]|0.2292,0.2292,[329440]|0.2483,0.2483,[329440]|0.2432,0.2432,[329440]|0.2041,0.2041,[329440]|0.3005,0.3005,[329440]|0.4037,0.4037,[329440]|0.4749,0.4749,[329440]|0.59,0.59,[329440]|0.5941,0.5941,[329440]|0.6442,0.6442,[329440]|0.6827,0.6827,[329440]|0.7034,0.7034,[329440]|0.8001,0.8001,[329440]| +GRAPHLINE IUPredWS (Short) 0.5 Above 0.5 indicates disorder ff0000 + +SEQUENCE_REF Q93Z60_ARATH +LINE_GRAPH IUPredWS (Long) Protein Disorder with IUPredWS - raw scores
Above 0.5 indicates disorder 0.1671,0.1671,[72144e]|0.2129,0.2129,[72144e]|0.247,0.247,[72144e]|0.1554,0.1554,[72144e]|0.1162,0.1162,[72144e]|0.1449,0.1449,[72144e]|0.1731,0.1731,[72144e]|0.2064,0.2064,[72144e]|0.2436,0.2436,[72144e]|0.2715,0.2715,[72144e]|0.3215,0.3215,[72144e]|0.2752,0.2752,[72144e]|0.2988,0.2988,[72144e]|0.2364,0.2364,[72144e]|0.2328,0.2328,[72144e]|0.2575,0.2575,[72144e]|0.2575,0.2575,[72144e]|0.2918,0.2918,[72144e]|0.2034,0.2034,[72144e]|0.2034,0.2034,[72144e]|0.2817,0.2817,[72144e]|0.3392,0.3392,[72144e]|0.3494,0.3494,[72144e]|0.3426,0.3426,[72144e]|0.2783,0.2783,[72144e]|0.2752,0.2752,[72144e]|0.3426,0.3426,[72144e]|0.2715,0.2715,[72144e]|0.2609,0.2609,[72144e]|0.247,0.247,[72144e]|0.2364,0.2364,[72144e]|0.2364,0.2364,[72144e]|0.1791,0.1791,[72144e]|0.247,0.247,[72144e]|0.2503,0.2503,[72144e]|0.3215,0.3215,[72144e]|0.3215,0.3215,[72144e]|0.2715,0.2715,[72144e]|0.3426,0.3426,[72144e]|0.2817,0.2817,[72144e]|0.3566,0.3566,[72144e]|0.3566,0.3566,[72144e]|0.3529,0.3529,[72144e]|0.2715,0.2715,[72144e]|0.2575,0.2575,[72144e]|0.2064,0.2064,[72144e]|0.2645,0.2645,[72144e]|0.2645,0.2645,[72144e]|0.1942,0.1942,[72144e]|0.2645,0.2645,[72144e]|0.3053,0.3053,[72144e]|0.3286,0.3286,[72144e]|0.3321,0.3321,[72144e]|0.3494,0.3494,[72144e]|0.384,0.384,[72144e]|0.4051,0.4051,[72144e]|0.3494,0.3494,[72144e]|0.3667,0.3667,[72144e]|0.2752,0.2752,[72144e]|0.346,0.346,[72144e]|0.3631,0.3631,[72144e]|0.4051,0.4051,[72144e]|0.3704,0.3704,[72144e]|0.3215,0.3215,[72144e]|0.268,0.268,[72144e]|0.2783,0.2783,[72144e]|0.2988,0.2988,[72144e]|0.3249,0.3249,[72144e]|0.3053,0.3053,[72144e]|0.422,0.422,[72144e]|0.5139,0.5139,[72144e]|0.4801,0.4801,[72144e]|0.4476,0.4476,[72144e]|0.3566,0.3566,[72144e]|0.374,0.374,[72144e]|0.2849,0.2849,[72144e]|0.3087,0.3087,[72144e]|0.2129,0.2129,[72144e]|0.2645,0.2645,[72144e]|0.1583,0.1583,[72144e]|0.247,0.247,[72144e]|0.2002,0.2002,[72144e]|0.1852,0.1852,[72144e]|0.1702,0.1702,[72144e]|0.1399,0.1399,[72144e]|0.2002,0.2002,[72144e]|0.247,0.247,[72144e]|0.2224,0.2224,[72144e]|0.1852,0.1852,[72144e]|0.2094,0.2094,[72144e]|0.2258,0.2258,[72144e]|0.1611,0.1611,[72144e]|0.1092,0.1092,[72144e]|0.1251,0.1251,[72144e]|0.1251,0.1251,[72144e]|0.1759,0.1759,[72144e]|0.1115,0.1115,[72144e]|0.1731,0.1731,[72144e]|0.1501,0.1501,[72144e]|0.2129,0.2129,[72144e]|0.2292,0.2292,[72144e]|0.3249,0.3249,[72144e]|0.3215,0.3215,[72144e]|0.2645,0.2645,[72144e]|0.2002,0.2002,[72144e]|0.2193,0.2193,[72144e]|0.3286,0.3286,[72144e]|0.3249,0.3249,[72144e]|0.3117,0.3117,[72144e]|0.391,0.391,[72144e]|0.4051,0.4051,[72144e]|0.384,0.384,[72144e]|0.3774,0.3774,[72144e]|0.4292,0.4292,[72144e]|0.4901,0.4901,[72144e]|0.4801,0.4801,[72144e]|0.4582,0.4582,[72144e]|0.4409,0.4409,[72144e]| +GRAPHLINE IUPredWS (Long) 0.5 Above 0.5 indicates disorder ff0000 +LINE_GRAPH IUPredWS (Short) Protein Disorder with IUPredWS - raw scores
Above 0.5 indicates disorder 0.82,0.82,[329440]|0.7147,0.7147,[329440]|0.6715,0.6715,[329440]|0.6334,0.6334,[329440]|0.59,0.59,[329440]|0.4513,0.4513,[329440]|0.3263,0.3263,[329440]|0.2963,0.2963,[329440]|0.2657,0.2657,[329440]|0.2292,0.2292,[329440]|0.1998,0.1998,[329440]|0.2209,0.2209,[329440]|0.2865,0.2865,[329440]|0.2122,0.2122,[329440]|0.2041,0.2041,[329440]|0.1667,0.1667,[329440]|0.2602,0.2602,[329440]|0.2558,0.2558,[329440]|0.1844,0.1844,[329440]|0.2483,0.2483,[329440]|0.2292,0.2292,[329440]|0.2657,0.2657,[329440]|0.2748,0.2748,[329440]|0.2748,0.2748,[329440]|0.2865,0.2865,[329440]|0.3762,0.3762,[329440]|0.3847,0.3847,[329440]|0.2786,0.2786,[329440]|0.27,0.27,[329440]|0.1878,0.1878,[329440]|0.1805,0.1805,[329440]|0.1805,0.1805,[329440]|0.1532,0.1532,[329440]|0.2255,0.2255,[329440]|0.1958,0.1958,[329440]|0.2786,0.2786,[329440]|0.2657,0.2657,[329440]|0.2748,0.2748,[329440]|0.3491,0.3491,[329440]|0.2531,0.2531,[329440]|0.3456,0.3456,[329440]|0.3491,0.3491,[329440]|0.3146,0.3146,[329440]|0.282,0.282,[329440]|0.27,0.27,[329440]|0.1998,0.1998,[329440]|0.2558,0.2558,[329440]|0.282,0.282,[329440]|0.2602,0.2602,[329440]|0.2602,0.2602,[329440]|0.1878,0.1878,[329440]|0.1844,0.1844,[329440]|0.2122,0.2122,[329440]|0.2292,0.2292,[329440]|0.2602,0.2602,[329440]|0.2786,0.2786,[329440]|0.282,0.282,[329440]|0.3005,0.3005,[329440]|0.2385,0.2385,[329440]|0.3184,0.3184,[329440]|0.2255,0.2255,[329440]|0.2748,0.2748,[329440]|0.3225,0.3225,[329440]|0.3762,0.3762,[329440]|0.3225,0.3225,[329440]|0.3225,0.3225,[329440]|0.2865,0.2865,[329440]|0.2865,0.2865,[329440]|0.3263,0.3263,[329440]|0.3717,0.3717,[329440]|0.4037,0.4037,[329440]|0.4245,0.4245,[329440]|0.4116,0.4116,[329440]|0.3578,0.3578,[329440]|0.3535,0.3535,[329440]|0.2748,0.2748,[329440]|0.2963,0.2963,[329440]|0.2167,0.2167,[329440]|0.3096,0.3096,[329440]|0.2255,0.2255,[329440]|0.3225,0.3225,[329440]|0.1732,0.1732,[329440]|0.1495,0.1495,[329440]|0.1088,0.1088,[329440]|0.1456,0.1456,[329440]|0.2041,0.2041,[329440]|0.1532,0.1532,[329440]|0.1998,0.1998,[329440]|0.1844,0.1844,[329440]|0.1205,0.1205,[329440]|0.124,0.124,[329440]|0.1088,0.1088,[329440]|0.0858,0.0858,[329440]|0.0789,0.0789,[329440]|0.0607,0.0607,[329440]|0.0858,0.0858,[329440]|0.0701,0.0701,[329440]|0.1018,0.1018,[329440]|0.0567,0.0567,[329440]|0.0935,0.0935,[329440]|0.0965,0.0965,[329440]|0.1921,0.1921,[329440]|0.2167,0.2167,[329440]|0.2558,0.2558,[329440]|0.2602,0.2602,[329440]|0.1921,0.1921,[329440]|0.2602,0.2602,[329440]|0.2786,0.2786,[329440]|0.2913,0.2913,[329440]|0.4556,0.4556,[329440]|0.5331,0.5331,[329440]|0.5802,0.5802,[329440]|0.6412,0.6412,[329440]|0.7232,0.7232,[329440]|0.8074,0.8074,[329440]|0.8457,0.8457,[329440]|0.8823,0.8823,[329440]|0.9141,0.9141,[329440]| +GRAPHLINE IUPredWS (Short) 0.5 Above 0.5 indicates disorder ff0000 + +SEQUENCE_REF FER1_ARATH +LINE_GRAPH IUPredWS (Long) Protein Disorder with IUPredWS - raw scores
Above 0.5 indicates disorder 0.1583,0.1583,[72144e]|0.2034,0.2034,[72144e]|0.2364,0.2364,[72144e]|0.1476,0.1476,[72144e]|0.1048,0.1048,[72144e]|0.1349,0.1349,[72144e]|0.1643,0.1643,[72144e]|0.1881,0.1881,[72144e]|0.247,0.247,[72144e]|0.2399,0.2399,[72144e]|0.2951,0.2951,[72144e]|0.2503,0.2503,[72144e]|0.2783,0.2783,[72144e]|0.2129,0.2129,[72144e]|0.2094,0.2094,[72144e]|0.2364,0.2364,[72144e]|0.2328,0.2328,[72144e]|0.2715,0.2715,[72144e]|0.2715,0.2715,[72144e]|0.2715,0.2715,[72144e]|0.346,0.346,[72144e]|0.4051,0.4051,[72144e]|0.4149,0.4149,[72144e]|0.4087,0.4087,[72144e]|0.3392,0.3392,[72144e]|0.3392,0.3392,[72144e]|0.4087,0.4087,[72144e]|0.3321,0.3321,[72144e]|0.3215,0.3215,[72144e]|0.3215,0.3215,[72144e]|0.2884,0.2884,[72144e]|0.3215,0.3215,[72144e]|0.2609,0.2609,[72144e]|0.3321,0.3321,[72144e]|0.3356,0.3356,[72144e]|0.4051,0.4051,[72144e]|0.4017,0.4017,[72144e]|0.3494,0.3494,[72144e]|0.4292,0.4292,[72144e]|0.3667,0.3667,[72144e]|0.346,0.346,[72144e]|0.3494,0.3494,[72144e]|0.346,0.346,[72144e]|0.268,0.268,[72144e]|0.247,0.247,[72144e]|0.1969,0.1969,[72144e]|0.2541,0.2541,[72144e]|0.2541,0.2541,[72144e]|0.1881,0.1881,[72144e]|0.2609,0.2609,[72144e]|0.3019,0.3019,[72144e]|0.3249,0.3249,[72144e]|0.3249,0.3249,[72144e]|0.346,0.346,[72144e]|0.3053,0.3053,[72144e]|0.3249,0.3249,[72144e]|0.2715,0.2715,[72144e]|0.2951,0.2951,[72144e]|0.2034,0.2034,[72144e]|0.2715,0.2715,[72144e]|0.2817,0.2817,[72144e]|0.3249,0.3249,[72144e]|0.2951,0.2951,[72144e]|0.247,0.247,[72144e]|0.1942,0.1942,[72144e]|0.2002,0.2002,[72144e]|0.2224,0.2224,[72144e]|0.2503,0.2503,[72144e]|0.2328,0.2328,[72144e]|0.346,0.346,[72144e]|0.4409,0.4409,[72144e]|0.4087,0.4087,[72144e]|0.3774,0.3774,[72144e]|0.2849,0.2849,[72144e]|0.2988,0.2988,[72144e]|0.2064,0.2064,[72144e]|0.3087,0.3087,[72144e]|0.2094,0.2094,[72144e]|0.2645,0.2645,[72144e]|0.1554,0.1554,[72144e]|0.2399,0.2399,[72144e]|0.1969,0.1969,[72144e]|0.1852,0.1852,[72144e]|0.1702,0.1702,[72144e]|0.1399,0.1399,[72144e]|0.2002,0.2002,[72144e]|0.2503,0.2503,[72144e]|0.2258,0.2258,[72144e]|0.1881,0.1881,[72144e]|0.2129,0.2129,[72144e]|0.2292,0.2292,[72144e]|0.1611,0.1611,[72144e]|0.107,0.107,[72144e]|0.1251,0.1251,[72144e]|0.1229,0.1229,[72144e]|0.1759,0.1759,[72144e]|0.1229,0.1229,[72144e]|0.1914,0.1914,[72144e]|0.1702,0.1702,[72144e]|0.2364,0.2364,[72144e]|0.2503,0.2503,[72144e]|0.3529,0.3529,[72144e]|0.3494,0.3494,[72144e]|0.2884,0.2884,[72144e]|0.2258,0.2258,[72144e]|0.2436,0.2436,[72144e]|0.3529,0.3529,[72144e]|0.3774,0.3774,[72144e]|0.3872,0.3872,[72144e]|0.4119,0.4119,[72144e]|0.4369,0.4369,[72144e]|0.4619,0.4619,[72144e]|0.4725,0.4725,[72144e]|0.433,0.433,[72144e]|0.4369,0.4369,[72144e]|0.374,0.374,[72144e]|0.3774,0.3774,[72144e]|0.2817,0.2817,[72144e]|0.3087,0.3087,[72144e]|0.2715,0.2715,[72144e]|0.1942,0.1942,[72144e]|0.2292,0.2292,[72144e]|0.2164,0.2164,[72144e]|0.2064,0.2064,[72144e]|0.2224,0.2224,[72144e]|0.2609,0.2609,[72144e]|0.3249,0.3249,[72144e]|0.2436,0.2436,[72144e]|0.2503,0.2503,[72144e]|0.2328,0.2328,[72144e]|0.2193,0.2193,[72144e]|0.2715,0.2715,[72144e]|0.2951,0.2951,[72144e]|0.2988,0.2988,[72144e]|0.3149,0.3149,[72144e]|0.3392,0.3392,[72144e]|0.3356,0.3356,[72144e]|0.3948,0.3948,[72144e]|0.3774,0.3774,[72144e]|0.4725,0.4725,[72144e]|0.4864,0.4864,[72144e]|0.5055,0.5055,[72144e]|0.6043,0.6043,[72144e]|0.5296,0.5296,[72144e]|0.5098,0.5098,[72144e]|0.4979,0.4979,[72144e]|0.4507,0.4507,[72144e]|0.5296,0.5296,[72144e]| +GRAPHLINE IUPredWS (Long) 0.5 Above 0.5 indicates disorder ff0000 +LINE_GRAPH IUPredWS (Short) Protein Disorder with IUPredWS - raw scores
Above 0.5 indicates disorder 0.8242,0.8242,[329440]|0.7275,0.7275,[329440]|0.6906,0.6906,[329440]|0.6516,0.6516,[329440]|0.6124,0.6124,[329440]|0.4781,0.4781,[329440]|0.3535,0.3535,[329440]|0.3225,0.3225,[329440]|0.2913,0.2913,[329440]|0.2432,0.2432,[329440]|0.2292,0.2292,[329440]|0.2209,0.2209,[329440]|0.2913,0.2913,[329440]|0.2167,0.2167,[329440]|0.208,0.208,[329440]|0.1766,0.1766,[329440]|0.2657,0.2657,[329440]|0.2657,0.2657,[329440]|0.1958,0.1958,[329440]|0.2558,0.2558,[329440]|0.3184,0.3184,[329440]|0.3456,0.3456,[329440]|0.3456,0.3456,[329440]|0.3399,0.3399,[329440]|0.3578,0.3578,[329440]|0.4458,0.4458,[329440]|0.46,0.46,[329440]|0.3578,0.3578,[329440]|0.3456,0.3456,[329440]|0.2786,0.2786,[329440]|0.2558,0.2558,[329440]|0.2913,0.2913,[329440]|0.2602,0.2602,[329440]|0.3399,0.3399,[329440]|0.3096,0.3096,[329440]|0.3885,0.3885,[329440]|0.3717,0.3717,[329440]|0.3762,0.3762,[329440]|0.4556,0.4556,[329440]|0.363,0.363,[329440]|0.3668,0.3668,[329440]|0.3668,0.3668,[329440]|0.3359,0.3359,[329440]|0.3005,0.3005,[329440]|0.282,0.282,[329440]|0.208,0.208,[329440]|0.2602,0.2602,[329440]|0.282,0.282,[329440]|0.2602,0.2602,[329440]|0.2483,0.2483,[329440]|0.1732,0.1732,[329440]|0.1698,0.1698,[329440]|0.1998,0.1998,[329440]|0.2122,0.2122,[329440]|0.2432,0.2432,[329440]|0.2602,0.2602,[329440]|0.1878,0.1878,[329440]|0.208,0.208,[329440]|0.1532,0.1532,[329440]|0.2209,0.2209,[329440]|0.1456,0.1456,[329440]|0.1844,0.1844,[329440]|0.2255,0.2255,[329440]|0.2748,0.2748,[329440]|0.2209,0.2209,[329440]|0.2255,0.2255,[329440]|0.1878,0.1878,[329440]|0.1844,0.1844,[329440]|0.2167,0.2167,[329440]|0.2657,0.2657,[329440]|0.3005,0.3005,[329440]|0.3225,0.3225,[329440]|0.3096,0.3096,[329440]|0.2483,0.2483,[329440]|0.2483,0.2483,[329440]|0.1698,0.1698,[329440]|0.2602,0.2602,[329440]|0.1805,0.1805,[329440]|0.27,0.27,[329440]|0.1878,0.1878,[329440]|0.2786,0.2786,[329440]|0.138,0.138,[329440]|0.1205,0.1205,[329440]|0.0884,0.0884,[329440]|0.1178,0.1178,[329440]|0.1732,0.1732,[329440]|0.1292,0.1292,[329440]|0.1805,0.1805,[329440]|0.1698,0.1698,[329440]|0.1178,0.1178,[329440]|0.124,0.124,[329440]|0.1088,0.1088,[329440]|0.0858,0.0858,[329440]|0.0771,0.0771,[329440]|0.0554,0.0554,[329440]|0.0832,0.0832,[329440]|0.0677,0.0677,[329440]|0.1018,0.1018,[329440]|0.0554,0.0554,[329440]|0.0965,0.0965,[329440]|0.0965,0.0965,[329440]|0.1921,0.1921,[329440]|0.2167,0.2167,[329440]|0.2558,0.2558,[329440]|0.2602,0.2602,[329440]|0.1844,0.1844,[329440]|0.2333,0.2333,[329440]|0.2531,0.2531,[329440]|0.2657,0.2657,[329440]|0.3992,0.3992,[329440]|0.4333,0.4333,[329440]|0.3762,0.3762,[329440]|0.3992,0.3992,[329440]|0.4781,0.4781,[329440]|0.5374,0.5374,[329440]|0.4651,0.4651,[329440]|0.4203,0.4203,[329440]|0.3535,0.3535,[329440]|0.4078,0.4078,[329440]|0.3311,0.3311,[329440]|0.3096,0.3096,[329440]|0.2865,0.2865,[329440]|0.208,0.208,[329440]|0.2531,0.2531,[329440]|0.2483,0.2483,[329440]|0.3263,0.3263,[329440]|0.4078,0.4078,[329440]|0.3225,0.3225,[329440]|0.3005,0.3005,[329440]|0.2041,0.2041,[329440]|0.2255,0.2255,[329440]|0.2748,0.2748,[329440]|0.2602,0.2602,[329440]|0.208,0.208,[329440]|0.2292,0.2292,[329440]|0.3263,0.3263,[329440]|0.3885,0.3885,[329440]|0.3939,0.3939,[329440]|0.3456,0.3456,[329440]|0.4458,0.4458,[329440]|0.5173,0.5173,[329440]|0.5802,0.5802,[329440]|0.6789,0.6789,[329440]|0.6789,0.6789,[329440]|0.7275,0.7275,[329440]|0.7644,0.7644,[329440]|0.7912,0.7912,[329440]|0.8823,0.8823,[329440]| +GRAPHLINE IUPredWS (Short) 0.5 Above 0.5 indicates disorder ff0000 + +SEQUENCE_REF FER_BRANA +LINE_GRAPH IUPredWS (Long) Protein Disorder with IUPredWS - raw scores
Above 0.5 indicates disorder 0.1969,0.1969,[72144e]|0.2783,0.2783,[72144e]|0.3182,0.3182,[72144e]|0.384,0.384,[72144e]|0.3321,0.3321,[72144e]|0.3872,0.3872,[72144e]|0.2752,0.2752,[72144e]|0.3182,0.3182,[72144e]|0.3599,0.3599,[72144e]|0.3948,0.3948,[72144e]|0.3566,0.3566,[72144e]|0.3149,0.3149,[72144e]|0.2609,0.2609,[72144e]|0.268,0.268,[72144e]|0.3053,0.3053,[72144e]|0.3321,0.3321,[72144e]|0.3249,0.3249,[72144e]|0.4476,0.4476,[72144e]|0.5456,0.5456,[72144e]|0.5098,0.5098,[72144e]|0.4766,0.4766,[72144e]|0.384,0.384,[72144e]|0.4017,0.4017,[72144e]|0.3087,0.3087,[72144e]|0.3321,0.3321,[72144e]|0.2399,0.2399,[72144e]|0.2918,0.2918,[72144e]|0.1643,0.1643,[72144e]|0.2541,0.2541,[72144e]|0.2094,0.2094,[72144e]|0.1942,0.1942,[72144e]|0.1759,0.1759,[72144e]|0.1323,0.1323,[72144e]|0.1852,0.1852,[72144e]|0.2292,0.2292,[72144e]|0.1914,0.1914,[72144e]|0.1528,0.1528,[72144e]|0.1759,0.1759,[72144e]|0.1791,0.1791,[72144e]|0.1206,0.1206,[72144e]|0.0765,0.0765,[72144e]|0.0888,0.0888,[72144e]|0.0888,0.0888,[72144e]|0.0749,0.0749,[72144e]|0.0473,0.0473,[72144e]|0.0817,0.0817,[72144e]|0.0704,0.0704,[72144e]|0.1048,0.1048,[72144e]|0.1162,0.1162,[72144e]|0.2258,0.2258,[72144e]|0.2364,0.2364,[72144e]|0.1731,0.1731,[72144e]|0.1251,0.1251,[72144e]|0.1399,0.1399,[72144e]|0.2503,0.2503,[72144e]|0.2715,0.2715,[72144e]|0.2783,0.2783,[72144e]|0.3215,0.3215,[72144e]|0.3215,0.3215,[72144e]|0.346,0.346,[72144e]|0.3667,0.3667,[72144e]|0.3249,0.3249,[72144e]|0.3249,0.3249,[72144e]|0.2645,0.2645,[72144e]|0.268,0.268,[72144e]|0.2541,0.2541,[72144e]|0.2817,0.2817,[72144e]|0.2399,0.2399,[72144e]|0.1702,0.1702,[72144e]|0.2034,0.2034,[72144e]|0.1914,0.1914,[72144e]|0.1643,0.1643,[72144e]|0.1823,0.1823,[72144e]|0.2164,0.2164,[72144e]|0.2849,0.2849,[72144e]|0.2002,0.2002,[72144e]|0.2064,0.2064,[72144e]|0.1942,0.1942,[72144e]|0.1823,0.1823,[72144e]|0.2224,0.2224,[72144e]|0.2752,0.2752,[72144e]|0.2752,0.2752,[72144e]|0.2988,0.2988,[72144e]|0.3249,0.3249,[72144e]|0.3249,0.3249,[72144e]|0.3872,0.3872,[72144e]|0.3667,0.3667,[72144e]|0.4685,0.4685,[72144e]|0.4864,0.4864,[72144e]|0.5017,0.5017,[72144e]|0.5951,0.5951,[72144e]|0.5296,0.5296,[72144e]|0.5055,0.5055,[72144e]|0.494,0.494,[72144e]|0.4441,0.4441,[72144e]|0.5254,0.5254,[72144e]| +GRAPHLINE IUPredWS (Long) 0.5 Above 0.5 indicates disorder ff0000 +LINE_GRAPH IUPredWS (Short) Protein Disorder with IUPredWS - raw scores
Above 0.5 indicates disorder 0.7605,0.7605,[329440]|0.7458,0.7458,[329440]|0.7079,0.7079,[329440]|0.6906,0.6906,[329440]|0.6557,0.6557,[329440]|0.6412,0.6412,[329440]|0.5374,0.5374,[329440]|0.5173,0.5173,[329440]|0.3806,0.3806,[329440]|0.3578,0.3578,[329440]|0.3311,0.3311,[329440]|0.3885,0.3885,[329440]|0.3456,0.3456,[329440]|0.3456,0.3456,[329440]|0.3225,0.3225,[329440]|0.3225,0.3225,[329440]|0.3806,0.3806,[329440]|0.4116,0.4116,[329440]|0.4379,0.4379,[329440]|0.4651,0.4651,[329440]|0.4458,0.4458,[329440]|0.3806,0.3806,[329440]|0.3762,0.3762,[329440]|0.2913,0.2913,[329440]|0.3096,0.3096,[329440]|0.2167,0.2167,[329440]|0.3146,0.3146,[329440]|0.2255,0.2255,[329440]|0.3184,0.3184,[329440]|0.1698,0.1698,[329440]|0.138,0.138,[329440]|0.1018,0.1018,[329440]|0.1322,0.1322,[329440]|0.1805,0.1805,[329440]|0.1322,0.1322,[329440]|0.1805,0.1805,[329440]|0.1667,0.1667,[329440]|0.1117,0.1117,[329440]|0.115,0.115,[329440]|0.1018,0.1018,[329440]|0.0771,0.0771,[329440]|0.066,0.066,[329440]|0.0478,0.0478,[329440]|0.0677,0.0677,[329440]|0.0554,0.0554,[329440]|0.0478,0.0478,[329440]|0.0268,0.0268,[329440]|0.0441,0.0441,[329440]|0.0455,0.0455,[329440]|0.1018,0.1018,[329440]|0.124,0.124,[329440]|0.1667,0.1667,[329440]|0.1698,0.1698,[329440]|0.1088,0.1088,[329440]|0.138,0.138,[329440]|0.1532,0.1532,[329440]|0.1667,0.1667,[329440]|0.2786,0.2786,[329440]|0.3184,0.3184,[329440]|0.2602,0.2602,[329440]|0.2558,0.2558,[329440]|0.3399,0.3399,[329440]|0.4078,0.4078,[329440]|0.3263,0.3263,[329440]|0.2786,0.2786,[329440]|0.2913,0.2913,[329440]|0.3491,0.3491,[329440]|0.27,0.27,[329440]|0.2432,0.2432,[329440]|0.2209,0.2209,[329440]|0.1532,0.1532,[329440]|0.1732,0.1732,[329440]|0.1698,0.1698,[329440]|0.2483,0.2483,[329440]|0.3311,0.3311,[329440]|0.2483,0.2483,[329440]|0.2292,0.2292,[329440]|0.1495,0.1495,[329440]|0.1698,0.1698,[329440]|0.2122,0.2122,[329440]|0.2292,0.2292,[329440]|0.1805,0.1805,[329440]|0.1998,0.1998,[329440]|0.3053,0.3053,[329440]|0.3806,0.3806,[329440]|0.3939,0.3939,[329440]|0.3399,0.3399,[329440]|0.4513,0.4513,[329440]|0.5173,0.5173,[329440]|0.5846,0.5846,[329440]|0.6827,0.6827,[329440]|0.6827,0.6827,[329440]|0.7317,0.7317,[329440]|0.7688,0.7688,[329440]|0.7951,0.7951,[329440]|0.8857,0.8857,[329440]| +GRAPHLINE IUPredWS (Short) 0.5 Above 0.5 indicates disorder ff0000 + +SEQUENCE_REF FER3_RAPSA +LINE_GRAPH IUPredWS (Long) Protein Disorder with IUPredWS - raw scores
Above 0.5 indicates disorder 0.2224,0.2224,[72144e]|0.3053,0.3053,[72144e]|0.346,0.346,[72144e]|0.4087,0.4087,[72144e]|0.3599,0.3599,[72144e]|0.4149,0.4149,[72144e]|0.2988,0.2988,[72144e]|0.3426,0.3426,[72144e]|0.384,0.384,[72144e]|0.4186,0.4186,[72144e]|0.384,0.384,[72144e]|0.3426,0.3426,[72144e]|0.2918,0.2918,[72144e]|0.2988,0.2988,[72144e]|0.3356,0.3356,[72144e]|0.3599,0.3599,[72144e]|0.3529,0.3529,[72144e]|0.4685,0.4685,[72144e]|0.5665,0.5665,[72144e]|0.5342,0.5342,[72144e]|0.4979,0.4979,[72144e]|0.4087,0.4087,[72144e]|0.4256,0.4256,[72144e]|0.3356,0.3356,[72144e]|0.3599,0.3599,[72144e]|0.268,0.268,[72144e]|0.3182,0.3182,[72144e]|0.1881,0.1881,[72144e]|0.2849,0.2849,[72144e]|0.2399,0.2399,[72144e]|0.2224,0.2224,[72144e]|0.2034,0.2034,[72144e]|0.1528,0.1528,[72144e]|0.2094,0.2094,[72144e]|0.2575,0.2575,[72144e]|0.2129,0.2129,[72144e]|0.1759,0.1759,[72144e]|0.1969,0.1969,[72144e]|0.2034,0.2034,[72144e]|0.1424,0.1424,[72144e]|0.0929,0.0929,[72144e]|0.107,0.107,[72144e]|0.107,0.107,[72144e]|0.1501,0.1501,[72144e]|0.1028,0.1028,[72144e]|0.1611,0.1611,[72144e]|0.1399,0.1399,[72144e]|0.1942,0.1942,[72144e]|0.2129,0.2129,[72144e]|0.3249,0.3249,[72144e]|0.3321,0.3321,[72144e]|0.2715,0.2715,[72144e]|0.2094,0.2094,[72144e]|0.2258,0.2258,[72144e]|0.3529,0.3529,[72144e]|0.374,0.374,[72144e]|0.3807,0.3807,[72144e]|0.4256,0.4256,[72144e]|0.4256,0.4256,[72144e]|0.4507,0.4507,[72144e]|0.4685,0.4685,[72144e]|0.4256,0.4256,[72144e]|0.4292,0.4292,[72144e]|0.3667,0.3667,[72144e]|0.3704,0.3704,[72144e]|0.2645,0.2645,[72144e]|0.2918,0.2918,[72144e]|0.2503,0.2503,[72144e]|0.1823,0.1823,[72144e]|0.2129,0.2129,[72144e]|0.2002,0.2002,[72144e]|0.1914,0.1914,[72144e]|0.2094,0.2094,[72144e]|0.247,0.247,[72144e]|0.3117,0.3117,[72144e]|0.2292,0.2292,[72144e]|0.2328,0.2328,[72144e]|0.2193,0.2193,[72144e]|0.2064,0.2064,[72144e]|0.2609,0.2609,[72144e]|0.3087,0.3087,[72144e]|0.3087,0.3087,[72144e]|0.3286,0.3286,[72144e]|0.3983,0.3983,[72144e]|0.3948,0.3948,[72144e]|0.4541,0.4541,[72144e]|0.4369,0.4369,[72144e]|0.5533,0.5533,[72144e]|0.5758,0.5758,[72144e]|0.5992,0.5992,[72144e]|0.708,0.708,[72144e]|0.6375,0.6375,[72144e]|0.6227,0.6227,[72144e]|0.6136,0.6136,[72144e]|0.5577,0.5577,[72144e]|0.6661,0.6661,[72144e]| +GRAPHLINE IUPredWS (Long) 0.5 Above 0.5 indicates disorder ff0000 +LINE_GRAPH IUPredWS (Short) Protein Disorder with IUPredWS - raw scores
Above 0.5 indicates disorder 0.7605,0.7605,[329440]|0.7458,0.7458,[329440]|0.7079,0.7079,[329440]|0.6906,0.6906,[329440]|0.6557,0.6557,[329440]|0.6412,0.6412,[329440]|0.5374,0.5374,[329440]|0.5173,0.5173,[329440]|0.3806,0.3806,[329440]|0.3578,0.3578,[329440]|0.3311,0.3311,[329440]|0.3885,0.3885,[329440]|0.3456,0.3456,[329440]|0.3456,0.3456,[329440]|0.3225,0.3225,[329440]|0.3225,0.3225,[329440]|0.3806,0.3806,[329440]|0.4116,0.4116,[329440]|0.4379,0.4379,[329440]|0.4651,0.4651,[329440]|0.4458,0.4458,[329440]|0.3806,0.3806,[329440]|0.3806,0.3806,[329440]|0.2963,0.2963,[329440]|0.3184,0.3184,[329440]|0.2292,0.2292,[329440]|0.3225,0.3225,[329440]|0.2385,0.2385,[329440]|0.3359,0.3359,[329440]|0.1844,0.1844,[329440]|0.1566,0.1566,[329440]|0.115,0.115,[329440]|0.1495,0.1495,[329440]|0.2041,0.2041,[329440]|0.1532,0.1532,[329440]|0.2041,0.2041,[329440]|0.1878,0.1878,[329440]|0.1322,0.1322,[329440]|0.1349,0.1349,[329440]|0.1205,0.1205,[329440]|0.0965,0.0965,[329440]|0.0832,0.0832,[329440]|0.0607,0.0607,[329440]|0.0858,0.0858,[329440]|0.0701,0.0701,[329440]|0.1018,0.1018,[329440]|0.0554,0.0554,[329440]|0.0909,0.0909,[329440]|0.0909,0.0909,[329440]|0.1844,0.1844,[329440]|0.208,0.208,[329440]|0.2483,0.2483,[329440]|0.2531,0.2531,[329440]|0.1732,0.1732,[329440]|0.2167,0.2167,[329440]|0.2333,0.2333,[329440]|0.2483,0.2483,[329440]|0.3717,0.3717,[329440]|0.4078,0.4078,[329440]|0.3535,0.3535,[329440]|0.3456,0.3456,[329440]|0.4282,0.4282,[329440]|0.4879,0.4879,[329440]|0.4116,0.4116,[329440]|0.3668,0.3668,[329440]|0.3005,0.3005,[329440]|0.3578,0.3578,[329440]|0.282,0.282,[329440]|0.2558,0.2558,[329440]|0.2385,0.2385,[329440]|0.1667,0.1667,[329440]|0.2041,0.2041,[329440]|0.1998,0.1998,[329440]|0.282,0.282,[329440]|0.363,0.363,[329440]|0.282,0.282,[329440]|0.2602,0.2602,[329440]|0.1766,0.1766,[329440]|0.1998,0.1998,[329440]|0.2483,0.2483,[329440]|0.2657,0.2657,[329440]|0.2255,0.2255,[329440]|0.2531,0.2531,[329440]|0.3491,0.3491,[329440]|0.4116,0.4116,[329440]|0.4458,0.4458,[329440]|0.3992,0.3992,[329440]|0.5008,0.5008,[329440]|0.5623,0.5623,[329440]|0.6293,0.6293,[329440]|0.7275,0.7275,[329440]|0.7275,0.7275,[329440]|0.7724,0.7724,[329440]|0.8118,0.8118,[329440]|0.8391,0.8391,[329440]|0.9141,0.9141,[329440]| +GRAPHLINE IUPredWS (Short) 0.5 Above 0.5 indicates disorder ff0000 + +SEQUENCE_REF FER1_MAIZE +LINE_GRAPH IUPredWS (Long) Protein Disorder with IUPredWS - raw scores
Above 0.5 indicates disorder 0.422,0.422,[72144e]|0.2918,0.2918,[72144e]|0.1852,0.1852,[72144e]|0.1115,0.1115,[72144e]|0.1373,0.1373,[72144e]|0.1643,0.1643,[72144e]|0.1914,0.1914,[72144e]|0.2193,0.2193,[72144e]|0.1731,0.1731,[72144e]|0.2002,0.2002,[72144e]|0.1969,0.1969,[72144e]|0.1969,0.1969,[72144e]|0.2575,0.2575,[72144e]|0.2193,0.2193,[72144e]|0.3087,0.3087,[72144e]|0.384,0.384,[72144e]|0.3566,0.3566,[72144e]|0.3019,0.3019,[72144e]|0.2436,0.2436,[72144e]|0.1731,0.1731,[72144e]|0.2292,0.2292,[72144e]|0.1759,0.1759,[72144e]|0.1759,0.1759,[72144e]|0.2575,0.2575,[72144e]|0.2918,0.2918,[72144e]|0.384,0.384,[72144e]|0.3117,0.3117,[72144e]|0.2817,0.2817,[72144e]|0.2849,0.2849,[72144e]|0.2849,0.2849,[72144e]|0.3529,0.3529,[72144e]|0.3215,0.3215,[72144e]|0.3494,0.3494,[72144e]|0.374,0.374,[72144e]|0.3426,0.3426,[72144e]|0.374,0.374,[72144e]|0.3426,0.3426,[72144e]|0.268,0.268,[72144e]|0.2951,0.2951,[72144e]|0.3249,0.3249,[72144e]|0.3631,0.3631,[72144e]|0.4087,0.4087,[72144e]|0.384,0.384,[72144e]|0.3321,0.3321,[72144e]|0.3704,0.3704,[72144e]|0.3215,0.3215,[72144e]|0.3704,0.3704,[72144e]|0.3019,0.3019,[72144e]|0.3053,0.3053,[72144e]|0.3392,0.3392,[72144e]|0.3704,0.3704,[72144e]|0.3872,0.3872,[72144e]|0.391,0.391,[72144e]|0.4409,0.4409,[72144e]|0.3872,0.3872,[72144e]|0.4087,0.4087,[72144e]|0.3392,0.3392,[72144e]|0.3494,0.3494,[72144e]|0.2951,0.2951,[72144e]|0.3948,0.3948,[72144e]|0.4119,0.4119,[72144e]|0.4582,0.4582,[72144e]|0.391,0.391,[72144e]|0.3426,0.3426,[72144e]|0.2645,0.2645,[72144e]|0.2783,0.2783,[72144e]|0.2849,0.2849,[72144e]|0.3494,0.3494,[72144e]|0.3286,0.3286,[72144e]|0.4149,0.4149,[72144e]|0.5139,0.5139,[72144e]|0.5296,0.5296,[72144e]|0.494,0.494,[72144e]|0.3983,0.3983,[72144e]|0.4119,0.4119,[72144e]|0.3215,0.3215,[72144e]|0.4087,0.4087,[72144e]|0.3087,0.3087,[72144e]|0.3774,0.3774,[72144e]|0.2817,0.2817,[72144e]|0.3356,0.3356,[72144e]|0.2817,0.2817,[72144e]|0.2645,0.2645,[72144e]|0.247,0.247,[72144e]|0.2164,0.2164,[72144e]|0.2918,0.2918,[72144e]|0.3631,0.3631,[72144e]|0.346,0.346,[72144e]|0.3019,0.3019,[72144e]|0.2951,0.2951,[72144e]|0.3117,0.3117,[72144e]|0.2399,0.2399,[72144e]|0.1702,0.1702,[72144e]|0.1554,0.1554,[72144e]|0.1554,0.1554,[72144e]|0.2193,0.2193,[72144e]|0.1554,0.1554,[72144e]|0.2364,0.2364,[72144e]|0.2129,0.2129,[72144e]|0.2918,0.2918,[72144e]|0.3087,0.3087,[72144e]|0.4017,0.4017,[72144e]|0.4017,0.4017,[72144e]|0.3566,0.3566,[72144e]|0.2884,0.2884,[72144e]|0.3087,0.3087,[72144e]|0.4119,0.4119,[72144e]|0.4119,0.4119,[72144e]|0.422,0.422,[72144e]|0.4369,0.4369,[72144e]|0.4409,0.4409,[72144e]|0.4541,0.4541,[72144e]|0.4619,0.4619,[72144e]|0.4409,0.4409,[72144e]|0.4441,0.4441,[72144e]|0.374,0.374,[72144e]|0.3774,0.3774,[72144e]|0.2918,0.2918,[72144e]|0.3494,0.3494,[72144e]|0.3087,0.3087,[72144e]|0.2328,0.2328,[72144e]|0.268,0.268,[72144e]|0.2541,0.2541,[72144e]|0.247,0.247,[72144e]|0.2645,0.2645,[72144e]|0.2849,0.2849,[72144e]|0.3053,0.3053,[72144e]|0.2193,0.2193,[72144e]|0.2224,0.2224,[72144e]|0.2224,0.2224,[72144e]|0.2164,0.2164,[72144e]|0.2752,0.2752,[72144e]|0.3149,0.3149,[72144e]|0.3149,0.3149,[72144e]|0.3356,0.3356,[72144e]|0.346,0.346,[72144e]|0.4017,0.4017,[72144e]|0.4685,0.4685,[72144e]|0.4409,0.4409,[72144e]|0.5296,0.5296,[72144e]|0.5139,0.5139,[72144e]|0.5296,0.5296,[72144e]|0.6136,0.6136,[72144e]|0.5493,0.5493,[72144e]|0.5296,0.5296,[72144e]|0.5139,0.5139,[72144e]|0.4685,0.4685,[72144e]|0.5342,0.5342,[72144e]|0.6136,0.6136,[72144e]|0.7547,0.7547,[72144e]| +GRAPHLINE IUPredWS (Long) 0.5 Above 0.5 indicates disorder ff0000 +LINE_GRAPH IUPredWS (Short) Protein Disorder with IUPredWS - raw scores
Above 0.5 indicates disorder 0.865,0.865,[329440]|0.8488,0.8488,[329440]|0.7724,0.7724,[329440]|0.6557,0.6557,[329440]|0.5253,0.5253,[329440]|0.3847,0.3847,[329440]|0.3399,0.3399,[329440]|0.2913,0.2913,[329440]|0.2432,0.2432,[329440]|0.1958,0.1958,[329440]|0.106,0.106,[329440]|0.1456,0.1456,[329440]|0.1456,0.1456,[329440]|0.115,0.115,[329440]|0.1844,0.1844,[329440]|0.2122,0.2122,[329440]|0.2333,0.2333,[329440]|0.2531,0.2531,[329440]|0.1998,0.1998,[329440]|0.1322,0.1322,[329440]|0.1456,0.1456,[329440]|0.0858,0.0858,[329440]|0.1266,0.1266,[329440]|0.1667,0.1667,[329440]|0.2122,0.2122,[329440]|0.3225,0.3225,[329440]|0.2483,0.2483,[329440]|0.2483,0.2483,[329440]|0.1766,0.1766,[329440]|0.1602,0.1602,[329440]|0.2255,0.2255,[329440]|0.2209,0.2209,[329440]|0.2558,0.2558,[329440]|0.2657,0.2657,[329440]|0.2432,0.2432,[329440]|0.2865,0.2865,[329440]|0.27,0.27,[329440]|0.2748,0.2748,[329440]|0.3146,0.3146,[329440]|0.3184,0.3184,[329440]|0.3491,0.3491,[329440]|0.3847,0.3847,[329440]|0.3668,0.3668,[329440]|0.363,0.363,[329440]|0.4037,0.4037,[329440]|0.3184,0.3184,[329440]|0.4037,0.4037,[329440]|0.3359,0.3359,[329440]|0.4116,0.4116,[329440]|0.3717,0.3717,[329440]|0.3005,0.3005,[329440]|0.2865,0.2865,[329440]|0.3263,0.3263,[329440]|0.3668,0.3668,[329440]|0.3717,0.3717,[329440]|0.3806,0.3806,[329440]|0.3053,0.3053,[329440]|0.3146,0.3146,[329440]|0.2292,0.2292,[329440]|0.3096,0.3096,[329440]|0.2432,0.2432,[329440]|0.3146,0.3146,[329440]|0.3225,0.3225,[329440]|0.3806,0.3806,[329440]|0.3184,0.3184,[329440]|0.3311,0.3311,[329440]|0.2657,0.2657,[329440]|0.2657,0.2657,[329440]|0.2913,0.2913,[329440]|0.3578,0.3578,[329440]|0.3939,0.3939,[329440]|0.4116,0.4116,[329440]|0.3885,0.3885,[329440]|0.4037,0.4037,[329440]|0.3939,0.3939,[329440]|0.3184,0.3184,[329440]|0.4116,0.4116,[329440]|0.3263,0.3263,[329440]|0.4379,0.4379,[329440]|0.363,0.363,[329440]|0.4282,0.4282,[329440]|0.2865,0.2865,[329440]|0.2602,0.2602,[329440]|0.2041,0.2041,[329440]|0.2558,0.2558,[329440]|0.3225,0.3225,[329440]|0.2748,0.2748,[329440]|0.3399,0.3399,[329440]|0.3225,0.3225,[329440]|0.2122,0.2122,[329440]|0.2209,0.2209,[329440]|0.1998,0.1998,[329440]|0.1698,0.1698,[329440]|0.1178,0.1178,[329440]|0.0909,0.0909,[329440]|0.1292,0.1292,[329440]|0.106,0.106,[329440]|0.1532,0.1532,[329440]|0.0935,0.0935,[329440]|0.138,0.138,[329440]|0.138,0.138,[329440]|0.2292,0.2292,[329440]|0.2531,0.2531,[329440]|0.2865,0.2865,[329440]|0.2865,0.2865,[329440]|0.2122,0.2122,[329440]|0.2558,0.2558,[329440]|0.27,0.27,[329440]|0.2786,0.2786,[329440]|0.3847,0.3847,[329440]|0.4203,0.4203,[329440]|0.363,0.363,[329440]|0.3535,0.3535,[329440]|0.4149,0.4149,[329440]|0.4703,0.4703,[329440]|0.3939,0.3939,[329440]|0.3535,0.3535,[329440]|0.2865,0.2865,[329440]|0.3359,0.3359,[329440]|0.2602,0.2602,[329440]|0.2558,0.2558,[329440]|0.2333,0.2333,[329440]|0.1635,0.1635,[329440]|0.1958,0.1958,[329440]|0.1878,0.1878,[329440]|0.2657,0.2657,[329440]|0.3456,0.3456,[329440]|0.2748,0.2748,[329440]|0.2167,0.2167,[329440]|0.1602,0.1602,[329440]|0.1766,0.1766,[329440]|0.2255,0.2255,[329440]|0.2333,0.2333,[329440]|0.1998,0.1998,[329440]|0.2209,0.2209,[329440]|0.3184,0.3184,[329440]|0.3847,0.3847,[329440]|0.3847,0.3847,[329440]|0.3847,0.3847,[329440]|0.4513,0.4513,[329440]|0.4282,0.4282,[329440]|0.4967,0.4967,[329440]|0.6079,0.6079,[329440]|0.6124,0.6124,[329440]|0.6604,0.6604,[329440]|0.6944,0.6944,[329440]|0.7232,0.7232,[329440]|0.8118,0.8118,[329440]|0.8857,0.8857,[329440]|0.9491,0.9491,[329440]| +GRAPHLINE IUPredWS (Short) 0.5 Above 0.5 indicates disorder ff0000 + +SEQUENCE_REF O80429_MAIZE +LINE_GRAPH IUPredWS (Long) Protein Disorder with IUPredWS - raw scores
Above 0.5 indicates disorder 0.1007,0.1007,[72144e]|0.1028,0.1028,[72144e]|0.1731,0.1731,[72144e]|0.2503,0.2503,[72144e]|0.3249,0.3249,[72144e]|0.2292,0.2292,[72144e]|0.1476,0.1476,[72144e]|0.1731,0.1731,[72144e]|0.1942,0.1942,[72144e]|0.2503,0.2503,[72144e]|0.1969,0.1969,[72144e]|0.2258,0.2258,[72144e]|0.1823,0.1823,[72144e]|0.2094,0.2094,[72144e]|0.1501,0.1501,[72144e]|0.1501,0.1501,[72144e]|0.1611,0.1611,[72144e]|0.1399,0.1399,[72144e]|0.1554,0.1554,[72144e]|0.1823,0.1823,[72144e]|0.1881,0.1881,[72144e]|0.2258,0.2258,[72144e]|0.1969,0.1969,[72144e]|0.2541,0.2541,[72144e]|0.1942,0.1942,[72144e]|0.1671,0.1671,[72144e]|0.1399,0.1399,[72144e]|0.2292,0.2292,[72144e]|0.2575,0.2575,[72144e]|0.1881,0.1881,[72144e]|0.1881,0.1881,[72144e]|0.1399,0.1399,[72144e]|0.2129,0.2129,[72144e]|0.1852,0.1852,[72144e]|0.2645,0.2645,[72144e]|0.1852,0.1852,[72144e]|0.2503,0.2503,[72144e]|0.2193,0.2193,[72144e]|0.2752,0.2752,[72144e]|0.2292,0.2292,[72144e]|0.1611,0.1611,[72144e]|0.1424,0.1424,[72144e]|0.2364,0.2364,[72144e]|0.2884,0.2884,[72144e]|0.3182,0.3182,[72144e]|0.3087,0.3087,[72144e]|0.2783,0.2783,[72144e]|0.2988,0.2988,[72144e]|0.2224,0.2224,[72144e]|0.2224,0.2224,[72144e]|0.2364,0.2364,[72144e]|0.3392,0.3392,[72144e]|0.3566,0.3566,[72144e]|0.4051,0.4051,[72144e]|0.3356,0.3356,[72144e]|0.2817,0.2817,[72144e]|0.1969,0.1969,[72144e]|0.2094,0.2094,[72144e]|0.2164,0.2164,[72144e]|0.1791,0.1791,[72144e]|0.1583,0.1583,[72144e]|0.2436,0.2436,[72144e]|0.3426,0.3426,[72144e]|0.3566,0.3566,[72144e]|0.3286,0.3286,[72144e]|0.2258,0.2258,[72144e]|0.2436,0.2436,[72144e]|0.1554,0.1554,[72144e]|0.2364,0.2364,[72144e]|0.1298,0.1298,[72144e]|0.1914,0.1914,[72144e]|0.1115,0.1115,[72144e]|0.1528,0.1528,[72144e]|0.1115,0.1115,[72144e]|0.1007,0.1007,[72144e]|0.0909,0.0909,[72144e]|0.0734,0.0734,[72144e]|0.1206,0.1206,[72144e]|0.1823,0.1823,[72144e]|0.1643,0.1643,[72144e]|0.1298,0.1298,[72144e]|0.2164,0.2164,[72144e]|0.2399,0.2399,[72144e]|0.1671,0.1671,[72144e]|0.1092,0.1092,[72144e]|0.0948,0.0948,[72144e]|0.0948,0.0948,[72144e]|0.1501,0.1501,[72144e]|0.0967,0.0967,[72144e]|0.1611,0.1611,[72144e]|0.1424,0.1424,[72144e]|0.2328,0.2328,[72144e]|0.2503,0.2503,[72144e]|0.3529,0.3529,[72144e]|0.3494,0.3494,[72144e]|0.2817,0.2817,[72144e]|0.2064,0.2064,[72144e]|0.2193,0.2193,[72144e]|0.3286,0.3286,[72144e]|0.3392,0.3392,[72144e]|0.3494,0.3494,[72144e]|0.384,0.384,[72144e]|0.3872,0.3872,[72144e]|0.4017,0.4017,[72144e]|0.4087,0.4087,[72144e]|0.3807,0.3807,[72144e]|0.384,0.384,[72144e]|0.3117,0.3117,[72144e]|0.3182,0.3182,[72144e]|0.2328,0.2328,[72144e]|0.268,0.268,[72144e]|0.2258,0.2258,[72144e]|0.1501,0.1501,[72144e]|0.1791,0.1791,[72144e]|0.1702,0.1702,[72144e]|0.1611,0.1611,[72144e]|0.1791,0.1791,[72144e]|0.2164,0.2164,[72144e]|0.2328,0.2328,[72144e]|0.1554,0.1554,[72144e]|0.1583,0.1583,[72144e]|0.1528,0.1528,[72144e]|0.1424,0.1424,[72144e]|0.1823,0.1823,[72144e]|0.2224,0.2224,[72144e]|0.2224,0.2224,[72144e]|0.2436,0.2436,[72144e]|0.2541,0.2541,[72144e]|0.2399,0.2399,[72144e]|0.3087,0.3087,[72144e]|0.2817,0.2817,[72144e]|0.3566,0.3566,[72144e]|0.3667,0.3667,[72144e]|0.3774,0.3774,[72144e]|0.4541,0.4541,[72144e]|0.391,0.391,[72144e]|0.3599,0.3599,[72144e]|0.3356,0.3356,[72144e]|0.2783,0.2783,[72144e]|0.3426,0.3426,[72144e]| +GRAPHLINE IUPredWS (Long) 0.5 Above 0.5 indicates disorder ff0000 +LINE_GRAPH IUPredWS (Short) Protein Disorder with IUPredWS - raw scores
Above 0.5 indicates disorder 0.7573,0.7573,[329440]|0.6516,0.6516,[329440]|0.6293,0.6293,[329440]|0.5412,0.5412,[329440]|0.5229,0.5229,[329440]|0.5008,0.5008,[329440]|0.4825,0.4825,[329440]|0.3806,0.3806,[329440]|0.2292,0.2292,[329440]|0.1921,0.1921,[329440]|0.1602,0.1602,[329440]|0.208,0.208,[329440]|0.1667,0.1667,[329440]|0.2167,0.2167,[329440]|0.1416,0.1416,[329440]|0.1878,0.1878,[329440]|0.1921,0.1921,[329440]|0.1635,0.1635,[329440]|0.1322,0.1322,[329440]|0.1088,0.1088,[329440]|0.1805,0.1805,[329440]|0.2748,0.2748,[329440]|0.1805,0.1805,[329440]|0.1921,0.1921,[329440]|0.1495,0.1495,[329440]|0.1495,0.1495,[329440]|0.1088,0.1088,[329440]|0.1532,0.1532,[329440]|0.2531,0.2531,[329440]|0.2531,0.2531,[329440]|0.1805,0.1805,[329440]|0.106,0.106,[329440]|0.1667,0.1667,[329440]|0.1292,0.1292,[329440]|0.1998,0.1998,[329440]|0.1566,0.1566,[329440]|0.2292,0.2292,[329440]|0.1844,0.1844,[329440]|0.27,0.27,[329440]|0.2255,0.2255,[329440]|0.2041,0.2041,[329440]|0.124,0.124,[329440]|0.1205,0.1205,[329440]|0.1416,0.1416,[329440]|0.1998,0.1998,[329440]|0.1958,0.1958,[329440]|0.2292,0.2292,[329440]|0.2483,0.2483,[329440]|0.1732,0.1732,[329440]|0.1805,0.1805,[329440]|0.1667,0.1667,[329440]|0.2432,0.2432,[329440]|0.1732,0.1732,[329440]|0.2385,0.2385,[329440]|0.2531,0.2531,[329440]|0.3096,0.3096,[329440]|0.2385,0.2385,[329440]|0.2531,0.2531,[329440]|0.1844,0.1844,[329440]|0.1921,0.1921,[329440]|0.2167,0.2167,[329440]|0.208,0.208,[329440]|0.2558,0.2558,[329440]|0.27,0.27,[329440]|0.2558,0.2558,[329440]|0.2558,0.2558,[329440]|0.2531,0.2531,[329440]|0.1732,0.1732,[329440]|0.27,0.27,[329440]|0.1844,0.1844,[329440]|0.3005,0.3005,[329440]|0.208,0.208,[329440]|0.282,0.282,[329440]|0.1456,0.1456,[329440]|0.124,0.124,[329440]|0.0884,0.0884,[329440]|0.1292,0.1292,[329440]|0.1805,0.1805,[329440]|0.1416,0.1416,[329440]|0.1998,0.1998,[329440]|0.1844,0.1844,[329440]|0.1635,0.1635,[329440]|0.1667,0.1667,[329440]|0.1532,0.1532,[329440]|0.124,0.124,[329440]|0.0789,0.0789,[329440]|0.0554,0.0554,[329440]|0.0858,0.0858,[329440]|0.0701,0.0701,[329440]|0.106,0.106,[329440]|0.0587,0.0587,[329440]|0.1088,0.1088,[329440]|0.1088,0.1088,[329440]|0.1878,0.1878,[329440]|0.2122,0.2122,[329440]|0.2483,0.2483,[329440]|0.2432,0.2432,[329440]|0.1667,0.1667,[329440]|0.208,0.208,[329440]|0.2041,0.2041,[329440]|0.2209,0.2209,[329440]|0.3311,0.3311,[329440]|0.3668,0.3668,[329440]|0.3184,0.3184,[329440]|0.3096,0.3096,[329440]|0.3762,0.3762,[329440]|0.4282,0.4282,[329440]|0.3578,0.3578,[329440]|0.3096,0.3096,[329440]|0.2385,0.2385,[329440]|0.2865,0.2865,[329440]|0.2167,0.2167,[329440]|0.1878,0.1878,[329440]|0.1732,0.1732,[329440]|0.115,0.115,[329440]|0.1416,0.1416,[329440]|0.1349,0.1349,[329440]|0.208,0.208,[329440]|0.2865,0.2865,[329440]|0.2255,0.2255,[329440]|0.1667,0.1667,[329440]|0.106,0.106,[329440]|0.1205,0.1205,[329440]|0.1456,0.1456,[329440]|0.1495,0.1495,[329440]|0.1266,0.1266,[329440]|0.1416,0.1416,[329440]|0.208,0.208,[329440]|0.27,0.27,[329440]|0.27,0.27,[329440]|0.208,0.208,[329440]|0.3146,0.3146,[329440]|0.3806,0.3806,[329440]|0.4513,0.4513,[329440]|0.5623,0.5623,[329440]|0.5623,0.5623,[329440]|0.6219,0.6219,[329440]|0.6604,0.6604,[329440]|0.6906,0.6906,[329440]|0.7817,0.7817,[329440]| +GRAPHLINE IUPredWS (Short) 0.5 Above 0.5 indicates disorder ff0000 + +SEQUENCE_REF Q7XA98_TRIPR +LINE_GRAPH IUPredWS (Long) Protein Disorder with IUPredWS - raw scores
Above 0.5 indicates disorder 0.2292,0.2292,[72144e]|0.2645,0.2645,[72144e]|0.3019,0.3019,[72144e]|0.3286,0.3286,[72144e]|0.2328,0.2328,[72144e]|0.2258,0.2258,[72144e]|0.2645,0.2645,[72144e]|0.2988,0.2988,[72144e]|0.3286,0.3286,[72144e]|0.3774,0.3774,[72144e]|0.346,0.346,[72144e]|0.4051,0.4051,[72144e]|0.4051,0.4051,[72144e]|0.4017,0.4017,[72144e]|0.3494,0.3494,[72144e]|0.2988,0.2988,[72144e]|0.3286,0.3286,[72144e]|0.3948,0.3948,[72144e]|0.4864,0.4864,[72144e]|0.494,0.494,[72144e]|0.494,0.494,[72144e]|0.5139,0.5139,[72144e]|0.5419,0.5419,[72144e]|0.4441,0.4441,[72144e]|0.4685,0.4685,[72144e]|0.4685,0.4685,[72144e]|0.5707,0.5707,[72144e]|0.4901,0.4901,[72144e]|0.4831,0.4831,[72144e]|0.4087,0.4087,[72144e]|0.3872,0.3872,[72144e]|0.3566,0.3566,[72144e]|0.3566,0.3566,[72144e]|0.3215,0.3215,[72144e]|0.3566,0.3566,[72144e]|0.346,0.346,[72144e]|0.3983,0.3983,[72144e]|0.4256,0.4256,[72144e]|0.4369,0.4369,[72144e]|0.3667,0.3667,[72144e]|0.3392,0.3392,[72144e]|0.2884,0.2884,[72144e]|0.2609,0.2609,[72144e]|0.2436,0.2436,[72144e]|0.2436,0.2436,[72144e]|0.3392,0.3392,[72144e]|0.2328,0.2328,[72144e]|0.2258,0.2258,[72144e]|0.1791,0.1791,[72144e]|0.2575,0.2575,[72144e]|0.1969,0.1969,[72144e]|0.1969,0.1969,[72144e]|0.2094,0.2094,[72144e]|0.2399,0.2399,[72144e]|0.3149,0.3149,[72144e]|0.3182,0.3182,[72144e]|0.3426,0.3426,[72144e]|0.3599,0.3599,[72144e]|0.3807,0.3807,[72144e]|0.2884,0.2884,[72144e]|0.2884,0.2884,[72144e]|0.2609,0.2609,[72144e]|0.3149,0.3149,[72144e]|0.3774,0.3774,[72144e]|0.4119,0.4119,[72144e]|0.391,0.391,[72144e]|0.3356,0.3356,[72144e]|0.268,0.268,[72144e]|0.2849,0.2849,[72144e]|0.3117,0.3117,[72144e]|0.3599,0.3599,[72144e]|0.346,0.346,[72144e]|0.4292,0.4292,[72144e]|0.5254,0.5254,[72144e]|0.4652,0.4652,[72144e]|0.4369,0.4369,[72144e]|0.346,0.346,[72144e]|0.3704,0.3704,[72144e]|0.2783,0.2783,[72144e]|0.2988,0.2988,[72144e]|0.1969,0.1969,[72144e]|0.2849,0.2849,[72144e]|0.1852,0.1852,[72144e]|0.2752,0.2752,[72144e]|0.2193,0.2193,[72144e]|0.2064,0.2064,[72144e]|0.1942,0.1942,[72144e]|0.1583,0.1583,[72144e]|0.2258,0.2258,[72144e]|0.2918,0.2918,[72144e]|0.2609,0.2609,[72144e]|0.2224,0.2224,[72144e]|0.2258,0.2258,[72144e]|0.2399,0.2399,[72144e]|0.1731,0.1731,[72144e]|0.1184,0.1184,[72144e]|0.1611,0.1611,[72144e]|0.1611,0.1611,[72144e]|0.2292,0.2292,[72144e]|0.1643,0.1643,[72144e]|0.2292,0.2292,[72144e]|0.2064,0.2064,[72144e]|0.3053,0.3053,[72144e]|0.3215,0.3215,[72144e]|0.4149,0.4149,[72144e]|0.4119,0.4119,[72144e]|0.3494,0.3494,[72144e]|0.2884,0.2884,[72144e]|0.3053,0.3053,[72144e]|0.4087,0.4087,[72144e]|0.433,0.433,[72144e]|0.4409,0.4409,[72144e]|0.4685,0.4685,[72144e]|0.5176,0.5176,[72144e]|0.5139,0.5139,[72144e]|0.5296,0.5296,[72144e]|0.5098,0.5098,[72144e]|0.5098,0.5098,[72144e]|0.433,0.433,[72144e]|0.4369,0.4369,[72144e]|0.3249,0.3249,[72144e]|0.3249,0.3249,[72144e]|0.2951,0.2951,[72144e]|0.1969,0.1969,[72144e]|0.2064,0.2064,[72144e]|0.2002,0.2002,[72144e]|0.1942,0.1942,[72144e]|0.2094,0.2094,[72144e]|0.2436,0.2436,[72144e]|0.3087,0.3087,[72144e]|0.2258,0.2258,[72144e]|0.2328,0.2328,[72144e]|0.2164,0.2164,[72144e]|0.2034,0.2034,[72144e]|0.2541,0.2541,[72144e]|0.2575,0.2575,[72144e]|0.2783,0.2783,[72144e]|0.3019,0.3019,[72144e]|0.3019,0.3019,[72144e]|0.3529,0.3529,[72144e]|0.3948,0.3948,[72144e]|0.384,0.384,[72144e]|0.4766,0.4766,[72144e]|0.5254,0.5254,[72144e]|0.5419,0.5419,[72144e]|0.6755,0.6755,[72144e]|0.6136,0.6136,[72144e]|0.5901,0.5901,[72144e]|0.5807,0.5807,[72144e]|0.5382,0.5382,[72144e]|0.6322,0.6322,[72144e]|0.6089,0.6089,[72144e]| +GRAPHLINE IUPredWS (Long) 0.5 Above 0.5 indicates disorder ff0000 +LINE_GRAPH IUPredWS (Short) Protein Disorder with IUPredWS - raw scores
Above 0.5 indicates disorder 0.892,0.892,[329440]|0.835,0.835,[329440]|0.7388,0.7388,[329440]|0.6944,0.6944,[329440]|0.6557,0.6557,[329440]|0.6124,0.6124,[329440]|0.4967,0.4967,[329440]|0.4149,0.4149,[329440]|0.3939,0.3939,[329440]|0.3717,0.3717,[329440]|0.3359,0.3359,[329440]|0.3939,0.3939,[329440]|0.363,0.363,[329440]|0.3847,0.3847,[329440]|0.3535,0.3535,[329440]|0.3311,0.3311,[329440]|0.3053,0.3053,[329440]|0.3225,0.3225,[329440]|0.3992,0.3992,[329440]|0.3939,0.3939,[329440]|0.3939,0.3939,[329440]|0.4203,0.4203,[329440]|0.4781,0.4781,[329440]|0.4825,0.4825,[329440]|0.4513,0.4513,[329440]|0.363,0.363,[329440]|0.4651,0.4651,[329440]|0.4967,0.4967,[329440]|0.4749,0.4749,[329440]|0.3535,0.3535,[329440]|0.3456,0.3456,[329440]|0.2558,0.2558,[329440]|0.3225,0.3225,[329440]|0.2963,0.2963,[329440]|0.2602,0.2602,[329440]|0.2657,0.2657,[329440]|0.3184,0.3184,[329440]|0.3359,0.3359,[329440]|0.3491,0.3491,[329440]|0.3491,0.3491,[329440]|0.3578,0.3578,[329440]|0.3096,0.3096,[329440]|0.2865,0.2865,[329440]|0.2292,0.2292,[329440]|0.2292,0.2292,[329440]|0.2865,0.2865,[329440]|0.2292,0.2292,[329440]|0.2255,0.2255,[329440]|0.1566,0.1566,[329440]|0.2333,0.2333,[329440]|0.1766,0.1766,[329440]|0.2209,0.2209,[329440]|0.1602,0.1602,[329440]|0.1088,0.1088,[329440]|0.1495,0.1495,[329440]|0.1766,0.1766,[329440]|0.1921,0.1921,[329440]|0.1998,0.1998,[329440]|0.2122,0.2122,[329440]|0.2255,0.2255,[329440]|0.2385,0.2385,[329440]|0.2041,0.2041,[329440]|0.2483,0.2483,[329440]|0.2122,0.2122,[329440]|0.27,0.27,[329440]|0.3225,0.3225,[329440]|0.3762,0.3762,[329440]|0.3225,0.3225,[329440]|0.3311,0.3311,[329440]|0.2865,0.2865,[329440]|0.282,0.282,[329440]|0.3184,0.3184,[329440]|0.3668,0.3668,[329440]|0.4037,0.4037,[329440]|0.4245,0.4245,[329440]|0.4116,0.4116,[329440]|0.3359,0.3359,[329440]|0.3311,0.3311,[329440]|0.2483,0.2483,[329440]|0.2558,0.2558,[329440]|0.1766,0.1766,[329440]|0.2913,0.2913,[329440]|0.2041,0.2041,[329440]|0.3005,0.3005,[329440]|0.1416,0.1416,[329440]|0.1205,0.1205,[329440]|0.0884,0.0884,[329440]|0.1205,0.1205,[329440]|0.1766,0.1766,[329440]|0.1266,0.1266,[329440]|0.1766,0.1766,[329440]|0.1667,0.1667,[329440]|0.0991,0.0991,[329440]|0.1041,0.1041,[329440]|0.0935,0.0935,[329440]|0.0723,0.0723,[329440]|0.0771,0.0771,[329440]|0.0554,0.0554,[329440]|0.0771,0.0771,[329440]|0.066,0.066,[329440]|0.0935,0.0935,[329440]|0.0526,0.0526,[329440]|0.0771,0.0771,[329440]|0.0744,0.0744,[329440]|0.1805,0.1805,[329440]|0.2041,0.2041,[329440]|0.2333,0.2333,[329440]|0.2385,0.2385,[329440]|0.1667,0.1667,[329440]|0.2167,0.2167,[329440]|0.2255,0.2255,[329440]|0.2333,0.2333,[329440]|0.3717,0.3717,[329440]|0.4037,0.4037,[329440]|0.3399,0.3399,[329440]|0.3806,0.3806,[329440]|0.4333,0.4333,[329440]|0.4918,0.4918,[329440]|0.442,0.442,[329440]|0.3992,0.3992,[329440]|0.3399,0.3399,[329440]|0.4037,0.4037,[329440]|0.3456,0.3456,[329440]|0.2963,0.2963,[329440]|0.2602,0.2602,[329440]|0.1805,0.1805,[329440]|0.2209,0.2209,[329440]|0.2167,0.2167,[329440]|0.2963,0.2963,[329440]|0.3717,0.3717,[329440]|0.2913,0.2913,[329440]|0.2786,0.2786,[329440]|0.1921,0.1921,[329440]|0.2122,0.2122,[329440]|0.27,0.27,[329440]|0.2292,0.2292,[329440]|0.1998,0.1998,[329440]|0.2209,0.2209,[329440]|0.2963,0.2963,[329440]|0.3717,0.3717,[329440]|0.363,0.363,[329440]|0.3578,0.3578,[329440]|0.3992,0.3992,[329440]|0.4967,0.4967,[329440]|0.5549,0.5549,[329440]|0.665,0.665,[329440]|0.6681,0.6681,[329440]|0.7111,0.7111,[329440]|0.7501,0.7501,[329440]|0.7772,0.7772,[329440]|0.8677,0.8677,[329440]|0.904,0.904,[329440]| +GRAPHLINE IUPredWS (Short) 0.5 Above 0.5 indicates disorder ff0000 + +SEQUENCE_REF FER1_PEA +LINE_GRAPH IUPredWS (Long) Protein Disorder with IUPredWS - raw scores
Above 0.5 indicates disorder 0.1914,0.1914,[72144e]|0.2258,0.2258,[72144e]|0.268,0.268,[72144e]|0.2951,0.2951,[72144e]|0.1914,0.1914,[72144e]|0.1476,0.1476,[72144e]|0.1823,0.1823,[72144e]|0.2094,0.2094,[72144e]|0.247,0.247,[72144e]|0.3019,0.3019,[72144e]|0.2918,0.2918,[72144e]|0.3566,0.3566,[72144e]|0.3566,0.3566,[72144e]|0.3529,0.3529,[72144e]|0.2988,0.2988,[72144e]|0.2752,0.2752,[72144e]|0.3087,0.3087,[72144e]|0.3774,0.3774,[72144e]|0.4541,0.4541,[72144e]|0.4256,0.4256,[72144e]|0.3215,0.3215,[72144e]|0.346,0.346,[72144e]|0.4087,0.4087,[72144e]|0.4087,0.4087,[72144e]|0.3087,0.3087,[72144e]|0.2436,0.2436,[72144e]|0.3392,0.3392,[72144e]|0.3321,0.3321,[72144e]|0.3182,0.3182,[72144e]|0.3182,0.3182,[72144e]|0.3053,0.3053,[72144e]|0.2064,0.2064,[72144e]|0.2258,0.2258,[72144e]|0.1969,0.1969,[72144e]|0.2258,0.2258,[72144e]|0.2399,0.2399,[72144e]|0.2292,0.2292,[72144e]|0.2002,0.2002,[72144e]|0.1501,0.1501,[72144e]|0.1275,0.1275,[72144e]|0.1162,0.1162,[72144e]|0.1162,0.1162,[72144e]|0.1942,0.1942,[72144e]|0.1298,0.1298,[72144e]|0.1162,0.1162,[72144e]|0.0851,0.0851,[72144e]|0.1424,0.1424,[72144e]|0.1424,0.1424,[72144e]|0.1048,0.1048,[72144e]|0.1554,0.1554,[72144e]|0.1914,0.1914,[72144e]|0.2002,0.2002,[72144e]|0.2034,0.2034,[72144e]|0.2752,0.2752,[72144e]|0.2918,0.2918,[72144e]|0.3117,0.3117,[72144e]|0.2164,0.2164,[72144e]|0.2258,0.2258,[72144e]|0.2002,0.2002,[72144e]|0.2575,0.2575,[72144e]|0.3087,0.3087,[72144e]|0.3494,0.3494,[72144e]|0.3249,0.3249,[72144e]|0.2752,0.2752,[72144e]|0.2064,0.2064,[72144e]|0.2193,0.2193,[72144e]|0.247,0.247,[72144e]|0.2988,0.2988,[72144e]|0.2817,0.2817,[72144e]|0.3704,0.3704,[72144e]|0.4476,0.4476,[72144e]|0.391,0.391,[72144e]|0.3599,0.3599,[72144e]|0.2752,0.2752,[72144e]|0.2884,0.2884,[72144e]|0.2164,0.2164,[72144e]|0.2399,0.2399,[72144e]|0.1476,0.1476,[72144e]|0.2328,0.2328,[72144e]|0.1323,0.1323,[72144e]|0.2129,0.2129,[72144e]|0.1583,0.1583,[72144e]|0.1611,0.1611,[72144e]|0.1476,0.1476,[72144e]|0.1206,0.1206,[72144e]|0.1791,0.1791,[72144e]|0.2436,0.2436,[72144e]|0.2164,0.2164,[72144e]|0.1791,0.1791,[72144e]|0.1823,0.1823,[72144e]|0.1969,0.1969,[72144e]|0.1349,0.1349,[72144e]|0.0851,0.0851,[72144e]|0.1184,0.1184,[72144e]|0.1162,0.1162,[72144e]|0.1914,0.1914,[72144e]|0.1373,0.1373,[72144e]|0.2034,0.2034,[72144e]|0.1823,0.1823,[72144e]|0.2575,0.2575,[72144e]|0.2715,0.2715,[72144e]|0.3631,0.3631,[72144e]|0.3599,0.3599,[72144e]|0.2918,0.2918,[72144e]|0.2258,0.2258,[72144e]|0.2436,0.2436,[72144e]|0.3494,0.3494,[72144e]|0.374,0.374,[72144e]|0.384,0.384,[72144e]|0.4051,0.4051,[72144e]|0.4541,0.4541,[72144e]|0.4256,0.4256,[72144e]|0.4369,0.4369,[72144e]|0.391,0.391,[72144e]|0.3948,0.3948,[72144e]|0.3249,0.3249,[72144e]|0.3286,0.3286,[72144e]|0.2064,0.2064,[72144e]|0.2034,0.2034,[72144e]|0.1702,0.1702,[72144e]|0.1092,0.1092,[72144e]|0.1323,0.1323,[72144e]|0.1251,0.1251,[72144e]|0.1251,0.1251,[72144e]|0.1373,0.1373,[72144e]|0.1702,0.1702,[72144e]|0.1852,0.1852,[72144e]|0.1184,0.1184,[72144e]|0.1251,0.1251,[72144e]|0.1115,0.1115,[72144e]|0.1028,0.1028,[72144e]|0.1424,0.1424,[72144e]|0.1449,0.1449,[72144e]|0.1881,0.1881,[72144e]|0.2064,0.2064,[72144e]|0.2328,0.2328,[72144e]|0.2849,0.2849,[72144e]|0.3249,0.3249,[72144e]|0.3182,0.3182,[72144e]|0.4051,0.4051,[72144e]|0.4541,0.4541,[72144e]|0.4725,0.4725,[72144e]|0.5577,0.5577,[72144e]|0.494,0.494,[72144e]|0.4766,0.4766,[72144e]|0.4619,0.4619,[72144e]|0.4149,0.4149,[72144e]|0.4831,0.4831,[72144e]|0.5665,0.5665,[72144e]| +GRAPHLINE IUPredWS (Long) 0.5 Above 0.5 indicates disorder ff0000 +LINE_GRAPH IUPredWS (Short) Protein Disorder with IUPredWS - raw scores
Above 0.5 indicates disorder 0.8781,0.8781,[329440]|0.82,0.82,[329440]|0.7192,0.7192,[329440]|0.6756,0.6756,[329440]|0.6374,0.6374,[329440]|0.59,0.59,[329440]|0.4651,0.4651,[329440]|0.3578,0.3578,[329440]|0.3359,0.3359,[329440]|0.2913,0.2913,[329440]|0.2531,0.2531,[329440]|0.3184,0.3184,[329440]|0.3184,0.3184,[329440]|0.3491,0.3491,[329440]|0.3184,0.3184,[329440]|0.2913,0.2913,[329440]|0.2531,0.2531,[329440]|0.2963,0.2963,[329440]|0.3806,0.3806,[329440]|0.3762,0.3762,[329440]|0.3806,0.3806,[329440]|0.3717,0.3717,[329440]|0.3399,0.3399,[329440]|0.3456,0.3456,[329440]|0.3535,0.3535,[329440]|0.3535,0.3535,[329440]|0.3359,0.3359,[329440]|0.3263,0.3263,[329440]|0.3053,0.3053,[329440]|0.2333,0.2333,[329440]|0.2255,0.2255,[329440]|0.1958,0.1958,[329440]|0.2292,0.2292,[329440]|0.1456,0.1456,[329440]|0.1698,0.1698,[329440]|0.1805,0.1805,[329440]|0.2385,0.2385,[329440]|0.2483,0.2483,[329440]|0.1878,0.1878,[329440]|0.1635,0.1635,[329440]|0.1178,0.1178,[329440]|0.1205,0.1205,[329440]|0.1667,0.1667,[329440]|0.138,0.138,[329440]|0.1322,0.1322,[329440]|0.0813,0.0813,[329440]|0.1416,0.1416,[329440]|0.1456,0.1456,[329440]|0.1349,0.1349,[329440]|0.1322,0.1322,[329440]|0.0909,0.0909,[329440]|0.0884,0.0884,[329440]|0.1088,0.1088,[329440]|0.1602,0.1602,[329440]|0.1635,0.1635,[329440]|0.1495,0.1495,[329440]|0.1635,0.1635,[329440]|0.1698,0.1698,[329440]|0.1456,0.1456,[329440]|0.1844,0.1844,[329440]|0.1602,0.1602,[329440]|0.2167,0.2167,[329440]|0.2483,0.2483,[329440]|0.3053,0.3053,[329440]|0.2483,0.2483,[329440]|0.2602,0.2602,[329440]|0.2122,0.2122,[329440]|0.2167,0.2167,[329440]|0.2432,0.2432,[329440]|0.3053,0.3053,[329440]|0.3263,0.3263,[329440]|0.3491,0.3491,[329440]|0.3359,0.3359,[329440]|0.2748,0.2748,[329440]|0.27,0.27,[329440]|0.2209,0.2209,[329440]|0.2292,0.2292,[329440]|0.1602,0.1602,[329440]|0.2748,0.2748,[329440]|0.1921,0.1921,[329440]|0.282,0.282,[329440]|0.1322,0.1322,[329440]|0.124,0.124,[329440]|0.0909,0.0909,[329440]|0.124,0.124,[329440]|0.1805,0.1805,[329440]|0.1322,0.1322,[329440]|0.1844,0.1844,[329440]|0.1732,0.1732,[329440]|0.1041,0.1041,[329440]|0.1088,0.1088,[329440]|0.0991,0.0991,[329440]|0.0771,0.0771,[329440]|0.0771,0.0771,[329440]|0.0554,0.0554,[329440]|0.0771,0.0771,[329440]|0.0643,0.0643,[329440]|0.1088,0.1088,[329440]|0.0607,0.0607,[329440]|0.1041,0.1041,[329440]|0.1041,0.1041,[329440]|0.208,0.208,[329440]|0.2385,0.2385,[329440]|0.2657,0.2657,[329440]|0.2748,0.2748,[329440]|0.1878,0.1878,[329440]|0.2292,0.2292,[329440]|0.2483,0.2483,[329440]|0.2602,0.2602,[329440]|0.3992,0.3992,[329440]|0.4282,0.4282,[329440]|0.363,0.363,[329440]|0.4116,0.4116,[329440]|0.4333,0.4333,[329440]|0.4967,0.4967,[329440]|0.4203,0.4203,[329440]|0.3762,0.3762,[329440]|0.282,0.282,[329440]|0.3399,0.3399,[329440]|0.2558,0.2558,[329440]|0.1998,0.1998,[329440]|0.1844,0.1844,[329440]|0.1178,0.1178,[329440]|0.1566,0.1566,[329440]|0.1495,0.1495,[329440]|0.2209,0.2209,[329440]|0.3053,0.3053,[329440]|0.2209,0.2209,[329440]|0.1566,0.1566,[329440]|0.0884,0.0884,[329440]|0.1041,0.1041,[329440]|0.1416,0.1416,[329440]|0.1178,0.1178,[329440]|0.1205,0.1205,[329440]|0.1349,0.1349,[329440]|0.2209,0.2209,[329440]|0.282,0.282,[329440]|0.2748,0.2748,[329440]|0.27,0.27,[329440]|0.3005,0.3005,[329440]|0.3992,0.3992,[329440]|0.4703,0.4703,[329440]|0.5762,0.5762,[329440]|0.5762,0.5762,[329440]|0.6293,0.6293,[329440]|0.6715,0.6715,[329440]|0.6944,0.6944,[329440]|0.7951,0.7951,[329440]|0.8781,0.8781,[329440]| +GRAPHLINE IUPredWS (Short) 0.5 Above 0.5 indicates disorder ff0000 + +SEQUENCE_REF FER1_SPIOL +LINE_GRAPH IUPredWS (Long) Protein Disorder with IUPredWS - raw scores
Above 0.5 indicates disorder 0.3704,0.3704,[72144e]|0.4017,0.4017,[72144e]|0.4292,0.4292,[72144e]|0.3215,0.3215,[72144e]|0.2884,0.2884,[72144e]|0.3566,0.3566,[72144e]|0.3704,0.3704,[72144e]|0.4292,0.4292,[72144e]|0.4619,0.4619,[72144e]|0.4476,0.4476,[72144e]|0.4979,0.4979,[72144e]|0.5807,0.5807,[72144e]|0.5758,0.5758,[72144e]|0.5758,0.5758,[72144e]|0.5382,0.5382,[72144e]|0.5055,0.5055,[72144e]|0.4409,0.4409,[72144e]|0.4685,0.4685,[72144e]|0.5055,0.5055,[72144e]|0.5493,0.5493,[72144e]|0.5533,0.5533,[72144e]|0.5951,0.5951,[72144e]|0.6375,0.6375,[72144e]|0.6322,0.6322,[72144e]|0.5493,0.5493,[72144e]|0.5456,0.5456,[72144e]|0.6043,0.6043,[72144e]|0.4864,0.4864,[72144e]|0.4864,0.4864,[72144e]|0.4507,0.4507,[72144e]|0.4369,0.4369,[72144e]|0.4652,0.4652,[72144e]|0.433,0.433,[72144e]|0.3983,0.3983,[72144e]|0.4292,0.4292,[72144e]|0.4619,0.4619,[72144e]|0.4541,0.4541,[72144e]|0.4831,0.4831,[72144e]|0.5176,0.5176,[72144e]|0.4541,0.4541,[72144e]|0.433,0.433,[72144e]|0.3392,0.3392,[72144e]|0.3286,0.3286,[72144e]|0.2849,0.2849,[72144e]|0.2817,0.2817,[72144e]|0.2224,0.2224,[72144e]|0.2364,0.2364,[72144e]|0.3249,0.3249,[72144e]|0.3599,0.3599,[72144e]|0.422,0.422,[72144e]|0.433,0.433,[72144e]|0.4409,0.4409,[72144e]|0.391,0.391,[72144e]|0.4186,0.4186,[72144e]|0.3249,0.3249,[72144e]|0.3392,0.3392,[72144e]|0.247,0.247,[72144e]|0.2783,0.2783,[72144e]|0.3215,0.3215,[72144e]|0.3321,0.3321,[72144e]|0.3182,0.3182,[72144e]|0.2609,0.2609,[72144e]|0.2193,0.2193,[72144e]|0.247,0.247,[72144e]|0.268,0.268,[72144e]|0.2918,0.2918,[72144e]|0.2645,0.2645,[72144e]|0.3494,0.3494,[72144e]|0.422,0.422,[72144e]|0.4476,0.4476,[72144e]|0.4119,0.4119,[72144e]|0.346,0.346,[72144e]|0.3599,0.3599,[72144e]|0.2918,0.2918,[72144e]|0.3704,0.3704,[72144e]|0.2609,0.2609,[72144e]|0.3494,0.3494,[72144e]|0.2436,0.2436,[72144e]|0.3392,0.3392,[72144e]|0.2817,0.2817,[72144e]|0.268,0.268,[72144e]|0.2541,0.2541,[72144e]|0.2094,0.2094,[72144e]|0.2951,0.2951,[72144e]|0.3566,0.3566,[72144e]|0.3215,0.3215,[72144e]|0.2849,0.2849,[72144e]|0.3117,0.3117,[72144e]|0.3249,0.3249,[72144e]|0.2399,0.2399,[72144e]|0.2064,0.2064,[72144e]|0.1852,0.1852,[72144e]|0.1852,0.1852,[72144e]|0.247,0.247,[72144e]|0.1759,0.1759,[72144e]|0.2399,0.2399,[72144e]|0.2193,0.2193,[72144e]|0.3182,0.3182,[72144e]|0.3321,0.3321,[72144e]|0.4369,0.4369,[72144e]|0.433,0.433,[72144e]|0.3704,0.3704,[72144e]|0.3087,0.3087,[72144e]|0.3249,0.3249,[72144e]|0.433,0.433,[72144e]|0.4476,0.4476,[72144e]|0.4582,0.4582,[72144e]|0.4864,0.4864,[72144e]|0.5296,0.5296,[72144e]|0.5533,0.5533,[72144e]|0.5665,0.5665,[72144e]|0.5456,0.5456,[72144e]|0.5017,0.5017,[72144e]|0.4369,0.4369,[72144e]|0.4369,0.4369,[72144e]|0.3356,0.3356,[72144e]|0.374,0.374,[72144e]|0.3426,0.3426,[72144e]|0.2609,0.2609,[72144e]|0.2817,0.2817,[72144e]|0.2164,0.2164,[72144e]|0.2034,0.2034,[72144e]|0.2164,0.2164,[72144e]|0.2541,0.2541,[72144e]|0.3117,0.3117,[72144e]|0.2328,0.2328,[72144e]|0.2399,0.2399,[72144e]|0.2224,0.2224,[72144e]|0.2064,0.2064,[72144e]|0.2575,0.2575,[72144e]|0.268,0.268,[72144e]|0.268,0.268,[72144e]|0.2918,0.2918,[72144e]|0.3019,0.3019,[72144e]|0.3494,0.3494,[72144e]|0.3872,0.3872,[72144e]|0.3807,0.3807,[72144e]|0.4685,0.4685,[72144e]|0.4831,0.4831,[72144e]|0.494,0.494,[72144e]|0.5854,0.5854,[72144e]|0.5176,0.5176,[72144e]|0.5807,0.5807,[72144e]|0.5707,0.5707,[72144e]|0.5296,0.5296,[72144e]|0.6183,0.6183,[72144e]|0.5992,0.5992,[72144e]| +GRAPHLINE IUPredWS (Long) 0.5 Above 0.5 indicates disorder ff0000 +LINE_GRAPH IUPredWS (Short) Protein Disorder with IUPredWS - raw scores
Above 0.5 indicates disorder 0.928,0.928,[329440]|0.8823,0.8823,[329440]|0.8283,0.8283,[329440]|0.7912,0.7912,[329440]|0.754,0.754,[329440]|0.6474,0.6474,[329440]|0.5473,0.5473,[329440]|0.5296,0.5296,[329440]|0.4918,0.4918,[329440]|0.4703,0.4703,[329440]|0.4379,0.4379,[329440]|0.442,0.442,[329440]|0.4967,0.4967,[329440]|0.5514,0.5514,[329440]|0.5229,0.5229,[329440]|0.4879,0.4879,[329440]|0.4556,0.4556,[329440]|0.4245,0.4245,[329440]|0.4116,0.4116,[329440]|0.4651,0.4651,[329440]|0.4703,0.4703,[329440]|0.5008,0.5008,[329440]|0.5296,0.5296,[329440]|0.5229,0.5229,[329440]|0.5374,0.5374,[329440]|0.6174,0.6174,[329440]|0.6255,0.6255,[329440]|0.5253,0.5253,[329440]|0.5229,0.5229,[329440]|0.4458,0.4458,[329440]|0.442,0.442,[329440]|0.4781,0.4781,[329440]|0.4513,0.4513,[329440]|0.4282,0.4282,[329440]|0.4749,0.4749,[329440]|0.4967,0.4967,[329440]|0.5173,0.5173,[329440]|0.5549,0.5549,[329440]|0.5667,0.5667,[329440]|0.5412,0.5412,[329440]|0.5043,0.5043,[329440]|0.4703,0.4703,[329440]|0.4333,0.4333,[329440]|0.3578,0.3578,[329440]|0.3311,0.3311,[329440]|0.2657,0.2657,[329440]|0.3146,0.3146,[329440]|0.3263,0.3263,[329440]|0.27,0.27,[329440]|0.3184,0.3184,[329440]|0.3456,0.3456,[329440]|0.3311,0.3311,[329440]|0.3311,0.3311,[329440]|0.3311,0.3311,[329440]|0.2531,0.2531,[329440]|0.2748,0.2748,[329440]|0.1921,0.1921,[329440]|0.1921,0.1921,[329440]|0.1456,0.1456,[329440]|0.1698,0.1698,[329440]|0.2122,0.2122,[329440]|0.2657,0.2657,[329440]|0.2333,0.2333,[329440]|0.2385,0.2385,[329440]|0.1844,0.1844,[329440]|0.1844,0.1844,[329440]|0.1998,0.1998,[329440]|0.2209,0.2209,[329440]|0.2432,0.2432,[329440]|0.2657,0.2657,[329440]|0.2483,0.2483,[329440]|0.27,0.27,[329440]|0.2657,0.2657,[329440]|0.208,0.208,[329440]|0.282,0.282,[329440]|0.1998,0.1998,[329440]|0.3184,0.3184,[329440]|0.2432,0.2432,[329440]|0.3359,0.3359,[329440]|0.1732,0.1732,[329440]|0.1566,0.1566,[329440]|0.1205,0.1205,[329440]|0.1602,0.1602,[329440]|0.2255,0.2255,[329440]|0.1766,0.1766,[329440]|0.2385,0.2385,[329440]|0.2255,0.2255,[329440]|0.1635,0.1635,[329440]|0.1732,0.1732,[329440]|0.1602,0.1602,[329440]|0.1292,0.1292,[329440]|0.0771,0.0771,[329440]|0.0701,0.0701,[329440]|0.0965,0.0965,[329440]|0.0858,0.0858,[329440]|0.124,0.124,[329440]|0.0643,0.0643,[329440]|0.0935,0.0935,[329440]|0.0935,0.0935,[329440]|0.2041,0.2041,[329440]|0.2209,0.2209,[329440]|0.2602,0.2602,[329440]|0.2657,0.2657,[329440]|0.1878,0.1878,[329440]|0.2333,0.2333,[329440]|0.2432,0.2432,[329440]|0.2531,0.2531,[329440]|0.3668,0.3668,[329440]|0.3992,0.3992,[329440]|0.3359,0.3359,[329440]|0.3717,0.3717,[329440]|0.4556,0.4556,[329440]|0.4825,0.4825,[329440]|0.4245,0.4245,[329440]|0.3806,0.3806,[329440]|0.3146,0.3146,[329440]|0.3762,0.3762,[329440]|0.3263,0.3263,[329440]|0.3005,0.3005,[329440]|0.2748,0.2748,[329440]|0.1998,0.1998,[329440]|0.2432,0.2432,[329440]|0.1878,0.1878,[329440]|0.2657,0.2657,[329440]|0.3456,0.3456,[329440]|0.2748,0.2748,[329440]|0.2558,0.2558,[329440]|0.1766,0.1766,[329440]|0.1998,0.1998,[329440]|0.2483,0.2483,[329440]|0.2209,0.2209,[329440]|0.1732,0.1732,[329440]|0.1921,0.1921,[329440]|0.282,0.282,[329440]|0.3535,0.3535,[329440]|0.3456,0.3456,[329440]|0.3491,0.3491,[329440]|0.3806,0.3806,[329440]|0.4458,0.4458,[329440]|0.5084,0.5084,[329440]|0.6174,0.6174,[329440]|0.6174,0.6174,[329440]|0.7034,0.7034,[329440]|0.7418,0.7418,[329440]|0.7644,0.7644,[329440]|0.8595,0.8595,[329440]|0.8945,0.8945,[329440]| +GRAPHLINE IUPredWS (Short) 0.5 Above 0.5 indicates disorder ff0000 + +SEQUENCE_REF FER1_MESCR +LINE_GRAPH IUPredWS (Long) Protein Disorder with IUPredWS - raw scores
Above 0.5 indicates disorder 0.3117,0.3117,[72144e]|0.2951,0.2951,[72144e]|0.3249,0.3249,[72144e]|0.3566,0.3566,[72144e]|0.3426,0.3426,[72144e]|0.2503,0.2503,[72144e]|0.2436,0.2436,[72144e]|0.3053,0.3053,[72144e]|0.3182,0.3182,[72144e]|0.3426,0.3426,[72144e]|0.3948,0.3948,[72144e]|0.4619,0.4619,[72144e]|0.4619,0.4619,[72144e]|0.4979,0.4979,[72144e]|0.4652,0.4652,[72144e]|0.433,0.433,[72144e]|0.3983,0.3983,[72144e]|0.4619,0.4619,[72144e]|0.5296,0.5296,[72144e]|0.5419,0.5419,[72144e]|0.4864,0.4864,[72144e]|0.5176,0.5176,[72144e]|0.5176,0.5176,[72144e]|0.5176,0.5176,[72144e]|0.4541,0.4541,[72144e]|0.3599,0.3599,[72144e]|0.3872,0.3872,[72144e]|0.4119,0.4119,[72144e]|0.4292,0.4292,[72144e]|0.3948,0.3948,[72144e]|0.4017,0.4017,[72144e]|0.3704,0.3704,[72144e]|0.3356,0.3356,[72144e]|0.3053,0.3053,[72144e]|0.3286,0.3286,[72144e]|0.3286,0.3286,[72144e]|0.3087,0.3087,[72144e]|0.3392,0.3392,[72144e]|0.3774,0.3774,[72144e]|0.3182,0.3182,[72144e]|0.2918,0.2918,[72144e]|0.2609,0.2609,[72144e]|0.2292,0.2292,[72144e]|0.2224,0.2224,[72144e]|0.1731,0.1731,[72144e]|0.2002,0.2002,[72144e]|0.2002,0.2002,[72144e]|0.2436,0.2436,[72144e]|0.247,0.247,[72144e]|0.3426,0.3426,[72144e]|0.3774,0.3774,[72144e]|0.3774,0.3774,[72144e]|0.3704,0.3704,[72144e]|0.4087,0.4087,[72144e]|0.4369,0.4369,[72144e]|0.3704,0.3704,[72144e]|0.3948,0.3948,[72144e]|0.2988,0.2988,[72144e]|0.3807,0.3807,[72144e]|0.391,0.391,[72144e]|0.4292,0.4292,[72144e]|0.4087,0.4087,[72144e]|0.3529,0.3529,[72144e]|0.3149,0.3149,[72144e]|0.3356,0.3356,[72144e]|0.3566,0.3566,[72144e]|0.3807,0.3807,[72144e]|0.3529,0.3529,[72144e]|0.4369,0.4369,[72144e]|0.5139,0.5139,[72144e]|0.4831,0.4831,[72144e]|0.4507,0.4507,[72144e]|0.3566,0.3566,[72144e]|0.3704,0.3704,[72144e]|0.3182,0.3182,[72144e]|0.3392,0.3392,[72144e]|0.2328,0.2328,[72144e]|0.2951,0.2951,[72144e]|0.1791,0.1791,[72144e]|0.2715,0.2715,[72144e]|0.2164,0.2164,[72144e]|0.2002,0.2002,[72144e]|0.1881,0.1881,[72144e]|0.1501,0.1501,[72144e]|0.2164,0.2164,[72144e]|0.2817,0.2817,[72144e]|0.247,0.247,[72144e]|0.2094,0.2094,[72144e]|0.2328,0.2328,[72144e]|0.2503,0.2503,[72144e]|0.1823,0.1823,[72144e]|0.1643,0.1643,[72144e]|0.1852,0.1852,[72144e]|0.1852,0.1852,[72144e]|0.247,0.247,[72144e]|0.1881,0.1881,[72144e]|0.2541,0.2541,[72144e]|0.2328,0.2328,[72144e]|0.3249,0.3249,[72144e]|0.3426,0.3426,[72144e]|0.4369,0.4369,[72144e]|0.4292,0.4292,[72144e]|0.3704,0.3704,[72144e]|0.3117,0.3117,[72144e]|0.3249,0.3249,[72144e]|0.4369,0.4369,[72144e]|0.4507,0.4507,[72144e]|0.4619,0.4619,[72144e]|0.4901,0.4901,[72144e]|0.5055,0.5055,[72144e]|0.5342,0.5342,[72144e]|0.5419,0.5419,[72144e]|0.5176,0.5176,[72144e]|0.4619,0.4619,[72144e]|0.4017,0.4017,[72144e]|0.4051,0.4051,[72144e]|0.3053,0.3053,[72144e]|0.3053,0.3053,[72144e]|0.2783,0.2783,[72144e]|0.1942,0.1942,[72144e]|0.2129,0.2129,[72144e]|0.2002,0.2002,[72144e]|0.2002,0.2002,[72144e]|0.2129,0.2129,[72144e]|0.2503,0.2503,[72144e]|0.3117,0.3117,[72144e]|0.2328,0.2328,[72144e]|0.2399,0.2399,[72144e]|0.2258,0.2258,[72144e]|0.2129,0.2129,[72144e]|0.268,0.268,[72144e]|0.2988,0.2988,[72144e]|0.2988,0.2988,[72144e]|0.3215,0.3215,[72144e]|0.3249,0.3249,[72144e]|0.3774,0.3774,[72144e]|0.4149,0.4149,[72144e]|0.4051,0.4051,[72144e]|0.4979,0.4979,[72144e]|0.5456,0.5456,[72144e]|0.5665,0.5665,[72144e]|0.6755,0.6755,[72144e]|0.6089,0.6089,[72144e]|0.5901,0.5901,[72144e]|0.5807,0.5807,[72144e]|0.5382,0.5382,[72144e]|0.6227,0.6227,[72144e]|0.6043,0.6043,[72144e]| +GRAPHLINE IUPredWS (Long) 0.5 Above 0.5 indicates disorder ff0000 +LINE_GRAPH IUPredWS (Short) Protein Disorder with IUPredWS - raw scores
Above 0.5 indicates disorder 0.8857,0.8857,[329440]|0.8283,0.8283,[329440]|0.7912,0.7912,[329440]|0.7111,0.7111,[329440]|0.6681,0.6681,[329440]|0.6334,0.6334,[329440]|0.5549,0.5549,[329440]|0.4282,0.4282,[329440]|0.3491,0.3491,[329440]|0.3311,0.3311,[329440]|0.2913,0.2913,[329440]|0.3225,0.3225,[329440]|0.3806,0.3806,[329440]|0.442,0.442,[329440]|0.4078,0.4078,[329440]|0.4078,0.4078,[329440]|0.4078,0.4078,[329440]|0.4037,0.4037,[329440]|0.3939,0.3939,[329440]|0.4203,0.4203,[329440]|0.4245,0.4245,[329440]|0.46,0.46,[329440]|0.3885,0.3885,[329440]|0.4282,0.4282,[329440]|0.4556,0.4556,[329440]|0.4149,0.4149,[329440]|0.3885,0.3885,[329440]|0.3847,0.3847,[329440]|0.4203,0.4203,[329440]|0.3263,0.3263,[329440]|0.3311,0.3311,[329440]|0.3263,0.3263,[329440]|0.3005,0.3005,[329440]|0.2432,0.2432,[329440]|0.2786,0.2786,[329440]|0.2865,0.2865,[329440]|0.3146,0.3146,[329440]|0.3578,0.3578,[329440]|0.3535,0.3535,[329440]|0.3263,0.3263,[329440]|0.2913,0.2913,[329440]|0.2558,0.2558,[329440]|0.2913,0.2913,[329440]|0.2657,0.2657,[329440]|0.1698,0.1698,[329440]|0.1958,0.1958,[329440]|0.1878,0.1878,[329440]|0.2748,0.2748,[329440]|0.2041,0.2041,[329440]|0.208,0.208,[329440]|0.1998,0.1998,[329440]|0.2333,0.2333,[329440]|0.2483,0.2483,[329440]|0.2748,0.2748,[329440]|0.2602,0.2602,[329440]|0.2602,0.2602,[329440]|0.2786,0.2786,[329440]|0.1998,0.1998,[329440]|0.2748,0.2748,[329440]|0.1844,0.1844,[329440]|0.2483,0.2483,[329440]|0.2913,0.2913,[329440]|0.3456,0.3456,[329440]|0.3184,0.3184,[329440]|0.3225,0.3225,[329440]|0.27,0.27,[329440]|0.2748,0.2748,[329440]|0.2913,0.2913,[329440]|0.3225,0.3225,[329440]|0.3491,0.3491,[329440]|0.3717,0.3717,[329440]|0.3578,0.3578,[329440]|0.3053,0.3053,[329440]|0.3005,0.3005,[329440]|0.2602,0.2602,[329440]|0.2748,0.2748,[329440]|0.1958,0.1958,[329440]|0.3005,0.3005,[329440]|0.2209,0.2209,[329440]|0.3146,0.3146,[329440]|0.1602,0.1602,[329440]|0.138,0.138,[329440]|0.1041,0.1041,[329440]|0.1349,0.1349,[329440]|0.1958,0.1958,[329440]|0.1532,0.1532,[329440]|0.2041,0.2041,[329440]|0.1878,0.1878,[329440]|0.1322,0.1322,[329440]|0.1349,0.1349,[329440]|0.124,0.124,[329440]|0.0991,0.0991,[329440]|0.0884,0.0884,[329440]|0.0858,0.0858,[329440]|0.1205,0.1205,[329440]|0.1018,0.1018,[329440]|0.138,0.138,[329440]|0.0832,0.0832,[329440]|0.1178,0.1178,[329440]|0.1178,0.1178,[329440]|0.2385,0.2385,[329440]|0.2602,0.2602,[329440]|0.2865,0.2865,[329440]|0.2963,0.2963,[329440]|0.2209,0.2209,[329440]|0.2748,0.2748,[329440]|0.2865,0.2865,[329440]|0.2963,0.2963,[329440]|0.4116,0.4116,[329440]|0.442,0.442,[329440]|0.3885,0.3885,[329440]|0.3885,0.3885,[329440]|0.4651,0.4651,[329440]|0.4749,0.4749,[329440]|0.4149,0.4149,[329440]|0.3762,0.3762,[329440]|0.3184,0.3184,[329440]|0.3668,0.3668,[329440]|0.3146,0.3146,[329440]|0.2657,0.2657,[329440]|0.2333,0.2333,[329440]|0.1667,0.1667,[329440]|0.208,0.208,[329440]|0.1998,0.1998,[329440]|0.2786,0.2786,[329440]|0.3456,0.3456,[329440]|0.2786,0.2786,[329440]|0.2602,0.2602,[329440]|0.1844,0.1844,[329440]|0.1998,0.1998,[329440]|0.2483,0.2483,[329440]|0.2531,0.2531,[329440]|0.2041,0.2041,[329440]|0.2209,0.2209,[329440]|0.2963,0.2963,[329440]|0.3578,0.3578,[329440]|0.3491,0.3491,[329440]|0.3491,0.3491,[329440]|0.3847,0.3847,[329440]|0.4781,0.4781,[329440]|0.5374,0.5374,[329440]|0.6442,0.6442,[329440]|0.6474,0.6474,[329440]|0.6944,0.6944,[329440]|0.7317,0.7317,[329440]|0.7605,0.7605,[329440]|0.8521,0.8521,[329440]|0.892,0.892,[329440]| +GRAPHLINE IUPredWS (Short) 0.5 Above 0.5 indicates disorder ff0000 + +SEQUENCE_REF FER_CAPAN +LINE_GRAPH IUPredWS (Long) Protein Disorder with IUPredWS - raw scores
Above 0.5 indicates disorder 0.2817,0.2817,[72144e]|0.1671,0.1671,[72144e]|0.1611,0.1611,[72144e]|0.2364,0.2364,[72144e]|0.2783,0.2783,[72144e]|0.2951,0.2951,[72144e]|0.3566,0.3566,[72144e]|0.3426,0.3426,[72144e]|0.3053,0.3053,[72144e]|0.3286,0.3286,[72144e]|0.346,0.346,[72144e]|0.3087,0.3087,[72144e]|0.3321,0.3321,[72144e]|0.3631,0.3631,[72144e]|0.346,0.346,[72144e]|0.3774,0.3774,[72144e]|0.4119,0.4119,[72144e]|0.3566,0.3566,[72144e]|0.384,0.384,[72144e]|0.4766,0.4766,[72144e]|0.4507,0.4507,[72144e]|0.3807,0.3807,[72144e]|0.2884,0.2884,[72144e]|0.3774,0.3774,[72144e]|0.3392,0.3392,[72144e]|0.3019,0.3019,[72144e]|0.2918,0.2918,[72144e]|0.2752,0.2752,[72144e]|0.2503,0.2503,[72144e]|0.2752,0.2752,[72144e]|0.3249,0.3249,[72144e]|0.3149,0.3149,[72144e]|0.2645,0.2645,[72144e]|0.3356,0.3356,[72144e]|0.2399,0.2399,[72144e]|0.1852,0.1852,[72144e]|0.2258,0.2258,[72144e]|0.1969,0.1969,[72144e]|0.1251,0.1251,[72144e]|0.1583,0.1583,[72144e]|0.1229,0.1229,[72144e]|0.1028,0.1028,[72144e]|0.0817,0.0817,[72144e]|0.0799,0.0799,[72144e]|0.1399,0.1399,[72144e]|0.1611,0.1611,[72144e]|0.2399,0.2399,[72144e]|0.247,0.247,[72144e]|0.2783,0.2783,[72144e]|0.2328,0.2328,[72144e]|0.2503,0.2503,[72144e]|0.1643,0.1643,[72144e]|0.1791,0.1791,[72144e]|0.1092,0.1092,[72144e]|0.1702,0.1702,[72144e]|0.1791,0.1791,[72144e]|0.2849,0.2849,[72144e]|0.2645,0.2645,[72144e]|0.2094,0.2094,[72144e]|0.1501,0.1501,[72144e]|0.1643,0.1643,[72144e]|0.1852,0.1852,[72144e]|0.247,0.247,[72144e]|0.2258,0.2258,[72144e]|0.3149,0.3149,[72144e]|0.4087,0.4087,[72144e]|0.3774,0.3774,[72144e]|0.346,0.346,[72144e]|0.3286,0.3286,[72144e]|0.3494,0.3494,[72144e]|0.2541,0.2541,[72144e]|0.3529,0.3529,[72144e]|0.247,0.247,[72144e]|0.3392,0.3392,[72144e]|0.2224,0.2224,[72144e]|0.3249,0.3249,[72144e]|0.268,0.268,[72144e]|0.2541,0.2541,[72144e]|0.2436,0.2436,[72144e]|0.1969,0.1969,[72144e]|0.2752,0.2752,[72144e]|0.3426,0.3426,[72144e]|0.3053,0.3053,[72144e]|0.2645,0.2645,[72144e]|0.2503,0.2503,[72144e]|0.2715,0.2715,[72144e]|0.1823,0.1823,[72144e]|0.1424,0.1424,[72144e]|0.1611,0.1611,[72144e]|0.1611,0.1611,[72144e]|0.1424,0.1424,[72144e]|0.0967,0.0967,[72144e]|0.1528,0.1528,[72144e]|0.1399,0.1399,[72144e]|0.2129,0.2129,[72144e]|0.2292,0.2292,[72144e]|0.3286,0.3286,[72144e]|0.3356,0.3356,[72144e]|0.2752,0.2752,[72144e]|0.2094,0.2094,[72144e]|0.2292,0.2292,[72144e]|0.346,0.346,[72144e]|0.3631,0.3631,[72144e]|0.374,0.374,[72144e]|0.4119,0.4119,[72144e]|0.4619,0.4619,[72144e]|0.4864,0.4864,[72144e]|0.4901,0.4901,[72144e]|0.4979,0.4979,[72144e]|0.4725,0.4725,[72144e]|0.4051,0.4051,[72144e]|0.4087,0.4087,[72144e]|0.3182,0.3182,[72144e]|0.3215,0.3215,[72144e]|0.2817,0.2817,[72144e]|0.1969,0.1969,[72144e]|0.2224,0.2224,[72144e]|0.2164,0.2164,[72144e]|0.2129,0.2129,[72144e]|0.2193,0.2193,[72144e]|0.2575,0.2575,[72144e]|0.3215,0.3215,[72144e]|0.2399,0.2399,[72144e]|0.2436,0.2436,[72144e]|0.2292,0.2292,[72144e]|0.2164,0.2164,[72144e]|0.268,0.268,[72144e]|0.268,0.268,[72144e]|0.2193,0.2193,[72144e]|0.2436,0.2436,[72144e]|0.2436,0.2436,[72144e]|0.247,0.247,[72144e]|0.3087,0.3087,[72144e]|0.3019,0.3019,[72144e]|0.4017,0.4017,[72144e]|0.4441,0.4441,[72144e]|0.4541,0.4541,[72144e]|0.5419,0.5419,[72144e]|0.4831,0.4831,[72144e]|0.4507,0.4507,[72144e]|0.4369,0.4369,[72144e]|0.391,0.391,[72144e]|0.4541,0.4541,[72144e]|0.4292,0.4292,[72144e]| +GRAPHLINE IUPredWS (Long) 0.5 Above 0.5 indicates disorder ff0000 +LINE_GRAPH IUPredWS (Short) Protein Disorder with IUPredWS - raw scores
Above 0.5 indicates disorder 0.8424,0.8424,[329440]|0.8074,0.8074,[329440]|0.7644,0.7644,[329440]|0.6442,0.6442,[329440]|0.5762,0.5762,[329440]|0.5549,0.5549,[329440]|0.5253,0.5253,[329440]|0.4879,0.4879,[329440]|0.4651,0.4651,[329440]|0.3847,0.3847,[329440]|0.2748,0.2748,[329440]|0.2963,0.2963,[329440]|0.3311,0.3311,[329440]|0.2657,0.2657,[329440]|0.3311,0.3311,[329440]|0.3535,0.3535,[329440]|0.3146,0.3146,[329440]|0.3311,0.3311,[329440]|0.3578,0.3578,[329440]|0.363,0.363,[329440]|0.3578,0.3578,[329440]|0.363,0.363,[329440]|0.3225,0.3225,[329440]|0.3491,0.3491,[329440]|0.2913,0.2913,[329440]|0.2657,0.2657,[329440]|0.1878,0.1878,[329440]|0.1878,0.1878,[329440]|0.1732,0.1732,[329440]|0.1732,0.1732,[329440]|0.2292,0.2292,[329440]|0.2255,0.2255,[329440]|0.2255,0.2255,[329440]|0.282,0.282,[329440]|0.2209,0.2209,[329440]|0.1958,0.1958,[329440]|0.1844,0.1844,[329440]|0.138,0.138,[329440]|0.1088,0.1088,[329440]|0.1602,0.1602,[329440]|0.1041,0.1041,[329440]|0.0965,0.0965,[329440]|0.0813,0.0813,[329440]|0.1088,0.1088,[329440]|0.1205,0.1205,[329440]|0.0789,0.0789,[329440]|0.1117,0.1117,[329440]|0.1322,0.1322,[329440]|0.1349,0.1349,[329440]|0.1602,0.1602,[329440]|0.1805,0.1805,[329440]|0.1322,0.1322,[329440]|0.1495,0.1495,[329440]|0.0965,0.0965,[329440]|0.1495,0.1495,[329440]|0.0771,0.0771,[329440]|0.1495,0.1495,[329440]|0.1921,0.1921,[329440]|0.2209,0.2209,[329440]|0.1698,0.1698,[329440]|0.1805,0.1805,[329440]|0.1456,0.1456,[329440]|0.1495,0.1495,[329440]|0.1732,0.1732,[329440]|0.2432,0.2432,[329440]|0.2786,0.2786,[329440]|0.3053,0.3053,[329440]|0.2913,0.2913,[329440]|0.2432,0.2432,[329440]|0.2432,0.2432,[329440]|0.1958,0.1958,[329440]|0.2865,0.2865,[329440]|0.2041,0.2041,[329440]|0.3225,0.3225,[329440]|0.2385,0.2385,[329440]|0.3578,0.3578,[329440]|0.1844,0.1844,[329440]|0.1698,0.1698,[329440]|0.1495,0.1495,[329440]|0.1844,0.1844,[329440]|0.2558,0.2558,[329440]|0.1844,0.1844,[329440]|0.2483,0.2483,[329440]|0.2385,0.2385,[329440]|0.1266,0.1266,[329440]|0.1322,0.1322,[329440]|0.1205,0.1205,[329440]|0.0965,0.0965,[329440]|0.0832,0.0832,[329440]|0.0744,0.0744,[329440]|0.0813,0.0813,[329440]|0.0677,0.0677,[329440]|0.0832,0.0832,[329440]|0.0478,0.0478,[329440]|0.0813,0.0813,[329440]|0.0813,0.0813,[329440]|0.1766,0.1766,[329440]|0.1958,0.1958,[329440]|0.2209,0.2209,[329440]|0.2255,0.2255,[329440]|0.1566,0.1566,[329440]|0.208,0.208,[329440]|0.2209,0.2209,[329440]|0.2292,0.2292,[329440]|0.3668,0.3668,[329440]|0.3939,0.3939,[329440]|0.3263,0.3263,[329440]|0.3717,0.3717,[329440]|0.4513,0.4513,[329440]|0.4825,0.4825,[329440]|0.4245,0.4245,[329440]|0.3762,0.3762,[329440]|0.3399,0.3399,[329440]|0.3885,0.3885,[329440]|0.3053,0.3053,[329440]|0.2531,0.2531,[329440]|0.2385,0.2385,[329440]|0.1635,0.1635,[329440]|0.2041,0.2041,[329440]|0.208,0.208,[329440]|0.2865,0.2865,[329440]|0.3668,0.3668,[329440]|0.2865,0.2865,[329440]|0.27,0.27,[329440]|0.1805,0.1805,[329440]|0.1998,0.1998,[329440]|0.2602,0.2602,[329440]|0.2209,0.2209,[329440]|0.1766,0.1766,[329440]|0.1958,0.1958,[329440]|0.2209,0.2209,[329440]|0.2913,0.2913,[329440]|0.2913,0.2913,[329440]|0.2385,0.2385,[329440]|0.3096,0.3096,[329440]|0.4078,0.4078,[329440]|0.4749,0.4749,[329440]|0.5846,0.5846,[329440]|0.59,0.59,[329440]|0.6334,0.6334,[329440]|0.6681,0.6681,[329440]|0.6906,0.6906,[329440]|0.7869,0.7869,[329440]|0.835,0.835,[329440]| +GRAPHLINE IUPredWS (Short) 0.5 Above 0.5 indicates disorder ff0000 + +SEQUENCE_REF FER_CAPAA +LINE_GRAPH IUPredWS (Long) Protein Disorder with IUPredWS - raw scores
Above 0.5 indicates disorder 0.247,0.247,[72144e]|0.3392,0.3392,[72144e]|0.2609,0.2609,[72144e]|0.3249,0.3249,[72144e]|0.2258,0.2258,[72144e]|0.2817,0.2817,[72144e]|0.1759,0.1759,[72144e]|0.2364,0.2364,[72144e]|0.2817,0.2817,[72144e]|0.3215,0.3215,[72144e]|0.2918,0.2918,[72144e]|0.2436,0.2436,[72144e]|0.1852,0.1852,[72144e]|0.1942,0.1942,[72144e]|0.2258,0.2258,[72144e]|0.2884,0.2884,[72144e]|0.2783,0.2783,[72144e]|0.3667,0.3667,[72144e]|0.4541,0.4541,[72144e]|0.4292,0.4292,[72144e]|0.3948,0.3948,[72144e]|0.3704,0.3704,[72144e]|0.391,0.391,[72144e]|0.2918,0.2918,[72144e]|0.3948,0.3948,[72144e]|0.2951,0.2951,[72144e]|0.3872,0.3872,[72144e]|0.2575,0.2575,[72144e]|0.3599,0.3599,[72144e]|0.3019,0.3019,[72144e]|0.2849,0.2849,[72144e]|0.2645,0.2645,[72144e]|0.2034,0.2034,[72144e]|0.2752,0.2752,[72144e]|0.3356,0.3356,[72144e]|0.2918,0.2918,[72144e]|0.247,0.247,[72144e]|0.2364,0.2364,[72144e]|0.247,0.247,[72144e]|0.1643,0.1643,[72144e]|0.1275,0.1275,[72144e]|0.1449,0.1449,[72144e]|0.1449,0.1449,[72144e]|0.1323,0.1323,[72144e]|0.0888,0.0888,[72144e]|0.1449,0.1449,[72144e]|0.1275,0.1275,[72144e]|0.1881,0.1881,[72144e]|0.2064,0.2064,[72144e]|0.3149,0.3149,[72144e]|0.3286,0.3286,[72144e]|0.268,0.268,[72144e]|0.2034,0.2034,[72144e]|0.2224,0.2224,[72144e]|0.3494,0.3494,[72144e]|0.3704,0.3704,[72144e]|0.3807,0.3807,[72144e]|0.422,0.422,[72144e]|0.4725,0.4725,[72144e]|0.5017,0.5017,[72144e]|0.5176,0.5176,[72144e]|0.5176,0.5176,[72144e]|0.4901,0.4901,[72144e]|0.422,0.422,[72144e]|0.422,0.422,[72144e]|0.3356,0.3356,[72144e]|0.3356,0.3356,[72144e]|0.2951,0.2951,[72144e]|0.2129,0.2129,[72144e]|0.2436,0.2436,[72144e]|0.2328,0.2328,[72144e]|0.2328,0.2328,[72144e]|0.247,0.247,[72144e]|0.2849,0.2849,[72144e]|0.3494,0.3494,[72144e]|0.2609,0.2609,[72144e]|0.268,0.268,[72144e]|0.2541,0.2541,[72144e]|0.2328,0.2328,[72144e]|0.2849,0.2849,[72144e]|0.2884,0.2884,[72144e]|0.2364,0.2364,[72144e]|0.2609,0.2609,[72144e]|0.2645,0.2645,[72144e]|0.2645,0.2645,[72144e]|0.3286,0.3286,[72144e]|0.3215,0.3215,[72144e]|0.4186,0.4186,[72144e]|0.4582,0.4582,[72144e]|0.4725,0.4725,[72144e]|0.5533,0.5533,[72144e]|0.494,0.494,[72144e]|0.4652,0.4652,[72144e]|0.4476,0.4476,[72144e]|0.3983,0.3983,[72144e]|0.4619,0.4619,[72144e]|0.433,0.433,[72144e]| +GRAPHLINE IUPredWS (Long) 0.5 Above 0.5 indicates disorder ff0000 +LINE_GRAPH IUPredWS (Short) Protein Disorder with IUPredWS - raw scores
Above 0.5 indicates disorder 0.7724,0.7724,[329440]|0.7501,0.7501,[329440]|0.7111,0.7111,[329440]|0.6984,0.6984,[329440]|0.59,0.59,[329440]|0.5711,0.5711,[329440]|0.442,0.442,[329440]|0.4203,0.4203,[329440]|0.2786,0.2786,[329440]|0.27,0.27,[329440]|0.2385,0.2385,[329440]|0.3005,0.3005,[329440]|0.2385,0.2385,[329440]|0.2483,0.2483,[329440]|0.2167,0.2167,[329440]|0.2255,0.2255,[329440]|0.2657,0.2657,[329440]|0.3456,0.3456,[329440]|0.3717,0.3717,[329440]|0.3992,0.3992,[329440]|0.3847,0.3847,[329440]|0.3311,0.3311,[329440]|0.3225,0.3225,[329440]|0.27,0.27,[329440]|0.3668,0.3668,[329440]|0.2786,0.2786,[329440]|0.4037,0.4037,[329440]|0.3096,0.3096,[329440]|0.4116,0.4116,[329440]|0.2255,0.2255,[329440]|0.2041,0.2041,[329440]|0.1602,0.1602,[329440]|0.1998,0.1998,[329440]|0.2657,0.2657,[329440]|0.1921,0.1921,[329440]|0.2558,0.2558,[329440]|0.2483,0.2483,[329440]|0.1322,0.1322,[329440]|0.138,0.138,[329440]|0.124,0.124,[329440]|0.0991,0.0991,[329440]|0.0884,0.0884,[329440]|0.0771,0.0771,[329440]|0.0858,0.0858,[329440]|0.0701,0.0701,[329440]|0.0858,0.0858,[329440]|0.049,0.049,[329440]|0.0813,0.0813,[329440]|0.0813,0.0813,[329440]|0.1766,0.1766,[329440]|0.1998,0.1998,[329440]|0.2255,0.2255,[329440]|0.2255,0.2255,[329440]|0.1566,0.1566,[329440]|0.208,0.208,[329440]|0.2209,0.2209,[329440]|0.2292,0.2292,[329440]|0.3668,0.3668,[329440]|0.3939,0.3939,[329440]|0.3263,0.3263,[329440]|0.3717,0.3717,[329440]|0.4513,0.4513,[329440]|0.4825,0.4825,[329440]|0.4245,0.4245,[329440]|0.3762,0.3762,[329440]|0.3399,0.3399,[329440]|0.3885,0.3885,[329440]|0.3053,0.3053,[329440]|0.2531,0.2531,[329440]|0.2385,0.2385,[329440]|0.1635,0.1635,[329440]|0.2041,0.2041,[329440]|0.208,0.208,[329440]|0.2865,0.2865,[329440]|0.3668,0.3668,[329440]|0.2865,0.2865,[329440]|0.27,0.27,[329440]|0.1805,0.1805,[329440]|0.1998,0.1998,[329440]|0.2602,0.2602,[329440]|0.2209,0.2209,[329440]|0.1766,0.1766,[329440]|0.1958,0.1958,[329440]|0.2209,0.2209,[329440]|0.2913,0.2913,[329440]|0.2913,0.2913,[329440]|0.2385,0.2385,[329440]|0.3096,0.3096,[329440]|0.4078,0.4078,[329440]|0.4749,0.4749,[329440]|0.5846,0.5846,[329440]|0.59,0.59,[329440]|0.6334,0.6334,[329440]|0.6681,0.6681,[329440]|0.6906,0.6906,[329440]|0.7869,0.7869,[329440]|0.835,0.835,[329440]| +GRAPHLINE IUPredWS (Short) 0.5 Above 0.5 indicates disorder ff0000 + +SEQUENCE_REF Q93XJ9_SOLTU +LINE_GRAPH IUPredWS (Long) Protein Disorder with IUPredWS - raw scores
Above 0.5 indicates disorder 0.3182,0.3182,[72144e]|0.2002,0.2002,[72144e]|0.1449,0.1449,[72144e]|0.2164,0.2164,[72144e]|0.2503,0.2503,[72144e]|0.268,0.268,[72144e]|0.3286,0.3286,[72144e]|0.2951,0.2951,[72144e]|0.2609,0.2609,[72144e]|0.2849,0.2849,[72144e]|0.3053,0.3053,[72144e]|0.2609,0.2609,[72144e]|0.2817,0.2817,[72144e]|0.2541,0.2541,[72144e]|0.2575,0.2575,[72144e]|0.2575,0.2575,[72144e]|0.2645,0.2645,[72144e]|0.2064,0.2064,[72144e]|0.2292,0.2292,[72144e]|0.3149,0.3149,[72144e]|0.2884,0.2884,[72144e]|0.2164,0.2164,[72144e]|0.1399,0.1399,[72144e]|0.2129,0.2129,[72144e]|0.2094,0.2094,[72144e]|0.1731,0.1731,[72144e]|0.1702,0.1702,[72144e]|0.1759,0.1759,[72144e]|0.1501,0.1501,[72144e]|0.2002,0.2002,[72144e]|0.247,0.247,[72144e]|0.2436,0.2436,[72144e]|0.1823,0.1823,[72144e]|0.2503,0.2503,[72144e]|0.1583,0.1583,[72144e]|0.1611,0.1611,[72144e]|0.2002,0.2002,[72144e]|0.2002,0.2002,[72144e]|0.1298,0.1298,[72144e]|0.1643,0.1643,[72144e]|0.1275,0.1275,[72144e]|0.107,0.107,[72144e]|0.087,0.087,[72144e]|0.087,0.087,[72144e]|0.1501,0.1501,[72144e]|0.1759,0.1759,[72144e]|0.2503,0.2503,[72144e]|0.2609,0.2609,[72144e]|0.2918,0.2918,[72144e]|0.2258,0.2258,[72144e]|0.2436,0.2436,[72144e]|0.1554,0.1554,[72144e]|0.1731,0.1731,[72144e]|0.0948,0.0948,[72144e]|0.1611,0.1611,[72144e]|0.1702,0.1702,[72144e]|0.2849,0.2849,[72144e]|0.2609,0.2609,[72144e]|0.2094,0.2094,[72144e]|0.1554,0.1554,[72144e]|0.1671,0.1671,[72144e]|0.1852,0.1852,[72144e]|0.2436,0.2436,[72144e]|0.2258,0.2258,[72144e]|0.3117,0.3117,[72144e]|0.3983,0.3983,[72144e]|0.4186,0.4186,[72144e]|0.3872,0.3872,[72144e]|0.374,0.374,[72144e]|0.3872,0.3872,[72144e]|0.2918,0.2918,[72144e]|0.391,0.391,[72144e]|0.2918,0.2918,[72144e]|0.384,0.384,[72144e]|0.2541,0.2541,[72144e]|0.3631,0.3631,[72144e]|0.3053,0.3053,[72144e]|0.2918,0.2918,[72144e]|0.2783,0.2783,[72144e]|0.2193,0.2193,[72144e]|0.2951,0.2951,[72144e]|0.3599,0.3599,[72144e]|0.3149,0.3149,[72144e]|0.2752,0.2752,[72144e]|0.2645,0.2645,[72144e]|0.2817,0.2817,[72144e]|0.2094,0.2094,[72144e]|0.1942,0.1942,[72144e]|0.1528,0.1528,[72144e]|0.1528,0.1528,[72144e]|0.1554,0.1554,[72144e]|0.1092,0.1092,[72144e]|0.1671,0.1671,[72144e]|0.1501,0.1501,[72144e]|0.2164,0.2164,[72144e]|0.2292,0.2292,[72144e]|0.3392,0.3392,[72144e]|0.3249,0.3249,[72144e]|0.2645,0.2645,[72144e]|0.2034,0.2034,[72144e]|0.2164,0.2164,[72144e]|0.3356,0.3356,[72144e]|0.3494,0.3494,[72144e]|0.3599,0.3599,[72144e]|0.494,0.494,[72144e]|0.494,0.494,[72144e]|0.4652,0.4652,[72144e]|0.4766,0.4766,[72144e]|0.4369,0.4369,[72144e]|0.3872,0.3872,[72144e]|0.3494,0.3494,[72144e]|0.3529,0.3529,[72144e]|0.2292,0.2292,[72144e]|0.2328,0.2328,[72144e]|0.2002,0.2002,[72144e]|0.1349,0.1349,[72144e]|0.1611,0.1611,[72144e]|0.1399,0.1399,[72144e]|0.0676,0.0676,[72144e]|0.078,0.078,[72144e]|0.1007,0.1007,[72144e]|0.1424,0.1424,[72144e]|0.0948,0.0948,[72144e]|0.0985,0.0985,[72144e]|0.0929,0.0929,[72144e]|0.0851,0.0851,[72144e]|0.0676,0.0676,[72144e]|0.0909,0.0909,[72144e]|0.1229,0.1229,[72144e]|0.1399,0.1399,[72144e]|0.1583,0.1583,[72144e]|0.1969,0.1969,[72144e]|0.2364,0.2364,[72144e]|0.2292,0.2292,[72144e]|0.3321,0.3321,[72144e]|0.3667,0.3667,[72144e]|0.3774,0.3774,[72144e]|0.4441,0.4441,[72144e]|0.3872,0.3872,[72144e]|0.384,0.384,[72144e]|0.5577,0.5577,[72144e]|0.5176,0.5176,[72144e]|0.6043,0.6043,[72144e]|0.5854,0.5854,[72144e]| +GRAPHLINE IUPredWS (Long) 0.5 Above 0.5 indicates disorder ff0000 +LINE_GRAPH IUPredWS (Short) Protein Disorder with IUPredWS - raw scores
Above 0.5 indicates disorder 0.8311,0.8311,[329440]|0.7912,0.7912,[329440]|0.7501,0.7501,[329440]|0.6255,0.6255,[329440]|0.5008,0.5008,[329440]|0.4825,0.4825,[329440]|0.4513,0.4513,[329440]|0.4078,0.4078,[329440]|0.3885,0.3885,[329440]|0.2786,0.2786,[329440]|0.1732,0.1732,[329440]|0.1921,0.1921,[329440]|0.2292,0.2292,[329440]|0.1635,0.1635,[329440]|0.2385,0.2385,[329440]|0.2041,0.2041,[329440]|0.138,0.138,[329440]|0.138,0.138,[329440]|0.1566,0.1566,[329440]|0.1698,0.1698,[329440]|0.1698,0.1698,[329440]|0.1698,0.1698,[329440]|0.138,0.138,[329440]|0.1566,0.1566,[329440]|0.1456,0.1456,[329440]|0.1266,0.1266,[329440]|0.0744,0.0744,[329440]|0.0744,0.0744,[329440]|0.0621,0.0621,[329440]|0.0965,0.0965,[329440]|0.1416,0.1416,[329440]|0.138,0.138,[329440]|0.1349,0.1349,[329440]|0.2041,0.2041,[329440]|0.138,0.138,[329440]|0.1667,0.1667,[329440]|0.1635,0.1635,[329440]|0.138,0.138,[329440]|0.1117,0.1117,[329440]|0.1635,0.1635,[329440]|0.1088,0.1088,[329440]|0.1041,0.1041,[329440]|0.0884,0.0884,[329440]|0.1266,0.1266,[329440]|0.1416,0.1416,[329440]|0.1018,0.1018,[329440]|0.1495,0.1495,[329440]|0.1732,0.1732,[329440]|0.1805,0.1805,[329440]|0.1805,0.1805,[329440]|0.2041,0.2041,[329440]|0.1566,0.1566,[329440]|0.1732,0.1732,[329440]|0.1117,0.1117,[329440]|0.1766,0.1766,[329440]|0.0991,0.0991,[329440]|0.1805,0.1805,[329440]|0.2292,0.2292,[329440]|0.2865,0.2865,[329440]|0.2292,0.2292,[329440]|0.2432,0.2432,[329440]|0.2041,0.2041,[329440]|0.2122,0.2122,[329440]|0.2432,0.2432,[329440]|0.3184,0.3184,[329440]|0.3535,0.3535,[329440]|0.3762,0.3762,[329440]|0.363,0.363,[329440]|0.3762,0.3762,[329440]|0.3717,0.3717,[329440]|0.3225,0.3225,[329440]|0.4078,0.4078,[329440]|0.3359,0.3359,[329440]|0.4458,0.4458,[329440]|0.3668,0.3668,[329440]|0.4879,0.4879,[329440]|0.3096,0.3096,[329440]|0.2865,0.2865,[329440]|0.2385,0.2385,[329440]|0.2865,0.2865,[329440]|0.3578,0.3578,[329440]|0.2865,0.2865,[329440]|0.3491,0.3491,[329440]|0.3359,0.3359,[329440]|0.208,0.208,[329440]|0.2167,0.2167,[329440]|0.1958,0.1958,[329440]|0.1635,0.1635,[329440]|0.1117,0.1117,[329440]|0.1088,0.1088,[329440]|0.1041,0.1041,[329440]|0.0858,0.0858,[329440]|0.1117,0.1117,[329440]|0.0643,0.0643,[329440]|0.1041,0.1041,[329440]|0.1041,0.1041,[329440]|0.2122,0.2122,[329440]|0.2292,0.2292,[329440]|0.2483,0.2483,[329440]|0.2333,0.2333,[329440]|0.1602,0.1602,[329440]|0.208,0.208,[329440]|0.2167,0.2167,[329440]|0.2209,0.2209,[329440]|0.3491,0.3491,[329440]|0.3717,0.3717,[329440]|0.3885,0.3885,[329440]|0.3806,0.3806,[329440]|0.3992,0.3992,[329440]|0.4116,0.4116,[329440]|0.3668,0.3668,[329440]|0.3263,0.3263,[329440]|0.2748,0.2748,[329440]|0.3225,0.3225,[329440]|0.2122,0.2122,[329440]|0.1635,0.1635,[329440]|0.1495,0.1495,[329440]|0.0991,0.0991,[329440]|0.1322,0.1322,[329440]|0.1292,0.1292,[329440]|0.1117,0.1117,[329440]|0.1667,0.1667,[329440]|0.1117,0.1117,[329440]|0.1018,0.1018,[329440]|0.0607,0.0607,[329440]|0.0723,0.0723,[329440]|0.0587,0.0587,[329440]|0.0643,0.0643,[329440]|0.0643,0.0643,[329440]|0.0771,0.0771,[329440]|0.1292,0.1292,[329440]|0.1766,0.1766,[329440]|0.1667,0.1667,[329440]|0.1667,0.1667,[329440]|0.2255,0.2255,[329440]|0.3225,0.3225,[329440]|0.3885,0.3885,[329440]|0.5008,0.5008,[329440]|0.5008,0.5008,[329440]|0.5667,0.5667,[329440]|0.7079,0.7079,[329440]|0.7342,0.7342,[329440]|0.835,0.835,[329440]|0.8746,0.8746,[329440]| +GRAPHLINE IUPredWS (Short) 0.5 Above 0.5 indicates disorder ff0000 + +SEQUENCE_REF FER1_SOLLC +LINE_GRAPH IUPredWS (Long) Protein Disorder with IUPredWS - raw scores
Above 0.5 indicates disorder 0.3286,0.3286,[72144e]|0.2094,0.2094,[72144e]|0.1528,0.1528,[72144e]|0.2258,0.2258,[72144e]|0.2609,0.2609,[72144e]|0.2752,0.2752,[72144e]|0.3356,0.3356,[72144e]|0.3249,0.3249,[72144e]|0.2918,0.2918,[72144e]|0.3149,0.3149,[72144e]|0.3321,0.3321,[72144e]|0.2884,0.2884,[72144e]|0.3087,0.3087,[72144e]|0.2849,0.2849,[72144e]|0.2849,0.2849,[72144e]|0.2849,0.2849,[72144e]|0.2951,0.2951,[72144e]|0.2364,0.2364,[72144e]|0.2575,0.2575,[72144e]|0.3426,0.3426,[72144e]|0.3149,0.3149,[72144e]|0.247,0.247,[72144e]|0.1643,0.1643,[72144e]|0.2436,0.2436,[72144e]|0.2399,0.2399,[72144e]|0.2034,0.2034,[72144e]|0.2002,0.2002,[72144e]|0.2064,0.2064,[72144e]|0.1823,0.1823,[72144e]|0.2094,0.2094,[72144e]|0.2609,0.2609,[72144e]|0.2575,0.2575,[72144e]|0.1942,0.1942,[72144e]|0.2645,0.2645,[72144e]|0.1759,0.1759,[72144e]|0.1791,0.1791,[72144e]|0.2193,0.2193,[72144e]|0.2193,0.2193,[72144e]|0.1476,0.1476,[72144e]|0.1852,0.1852,[72144e]|0.1424,0.1424,[72144e]|0.1206,0.1206,[72144e]|0.0985,0.0985,[72144e]|0.0985,0.0985,[72144e]|0.1671,0.1671,[72144e]|0.1942,0.1942,[72144e]|0.2817,0.2817,[72144e]|0.2918,0.2918,[72144e]|0.3215,0.3215,[72144e]|0.2575,0.2575,[72144e]|0.2752,0.2752,[72144e]|0.1823,0.1823,[72144e]|0.2034,0.2034,[72144e]|0.1206,0.1206,[72144e]|0.1969,0.1969,[72144e]|0.2034,0.2034,[72144e]|0.3182,0.3182,[72144e]|0.2951,0.2951,[72144e]|0.2436,0.2436,[72144e]|0.1852,0.1852,[72144e]|0.1969,0.1969,[72144e]|0.2193,0.2193,[72144e]|0.2817,0.2817,[72144e]|0.2645,0.2645,[72144e]|0.3494,0.3494,[72144e]|0.4369,0.4369,[72144e]|0.4541,0.4541,[72144e]|0.422,0.422,[72144e]|0.4017,0.4017,[72144e]|0.4186,0.4186,[72144e]|0.3215,0.3215,[72144e]|0.422,0.422,[72144e]|0.3215,0.3215,[72144e]|0.4119,0.4119,[72144e]|0.2884,0.2884,[72144e]|0.391,0.391,[72144e]|0.3321,0.3321,[72144e]|0.3182,0.3182,[72144e]|0.3053,0.3053,[72144e]|0.2541,0.2541,[72144e]|0.3286,0.3286,[72144e]|0.391,0.391,[72144e]|0.3529,0.3529,[72144e]|0.3117,0.3117,[72144e]|0.3019,0.3019,[72144e]|0.3182,0.3182,[72144e]|0.247,0.247,[72144e]|0.2292,0.2292,[72144e]|0.1852,0.1852,[72144e]|0.1852,0.1852,[72144e]|0.1823,0.1823,[72144e]|0.1298,0.1298,[72144e]|0.1942,0.1942,[72144e]|0.1759,0.1759,[72144e]|0.2436,0.2436,[72144e]|0.2609,0.2609,[72144e]|0.3631,0.3631,[72144e]|0.3667,0.3667,[72144e]|0.3087,0.3087,[72144e]|0.247,0.247,[72144e]|0.2609,0.2609,[72144e]|0.384,0.384,[72144e]|0.3983,0.3983,[72144e]|0.4087,0.4087,[72144e]|0.5419,0.5419,[72144e]|0.5419,0.5419,[72144e]|0.5139,0.5139,[72144e]|0.5211,0.5211,[72144e]|0.4831,0.4831,[72144e]|0.4292,0.4292,[72144e]|0.3948,0.3948,[72144e]|0.3983,0.3983,[72144e]|0.2884,0.2884,[72144e]|0.2884,0.2884,[72144e]|0.2541,0.2541,[72144e]|0.1791,0.1791,[72144e]|0.2094,0.2094,[72144e]|0.1823,0.1823,[72144e]|0.1823,0.1823,[72144e]|0.1881,0.1881,[72144e]|0.2224,0.2224,[72144e]|0.2884,0.2884,[72144e]|0.2164,0.2164,[72144e]|0.2164,0.2164,[72144e]|0.2064,0.2064,[72144e]|0.1942,0.1942,[72144e]|0.1643,0.1643,[72144e]|0.2064,0.2064,[72144e]|0.2541,0.2541,[72144e]|0.2783,0.2783,[72144e]|0.3019,0.3019,[72144e]|0.3494,0.3494,[72144e]|0.391,0.391,[72144e]|0.3807,0.3807,[72144e]|0.4864,0.4864,[72144e]|0.5342,0.5342,[72144e]|0.5533,0.5533,[72144e]|0.6576,0.6576,[72144e]|0.5901,0.5901,[72144e]|0.6043,0.6043,[72144e]|0.5951,0.5951,[72144e]|0.5493,0.5493,[72144e]|0.6427,0.6427,[72144e]|0.6227,0.6227,[72144e]| +GRAPHLINE IUPredWS (Long) 0.5 Above 0.5 indicates disorder ff0000 +LINE_GRAPH IUPredWS (Short) Protein Disorder with IUPredWS - raw scores
Above 0.5 indicates disorder 0.8391,0.8391,[329440]|0.8001,0.8001,[329440]|0.7573,0.7573,[329440]|0.6334,0.6334,[329440]|0.5173,0.5173,[329440]|0.5008,0.5008,[329440]|0.4703,0.4703,[329440]|0.4245,0.4245,[329440]|0.4116,0.4116,[329440]|0.3263,0.3263,[329440]|0.2167,0.2167,[329440]|0.2385,0.2385,[329440]|0.2786,0.2786,[329440]|0.2041,0.2041,[329440]|0.2865,0.2865,[329440]|0.2531,0.2531,[329440]|0.1805,0.1805,[329440]|0.1766,0.1766,[329440]|0.1958,0.1958,[329440]|0.2122,0.2122,[329440]|0.208,0.208,[329440]|0.2122,0.2122,[329440]|0.1766,0.1766,[329440]|0.1921,0.1921,[329440]|0.1844,0.1844,[329440]|0.1602,0.1602,[329440]|0.0991,0.0991,[329440]|0.1018,0.1018,[329440]|0.0858,0.0858,[329440]|0.1041,0.1041,[329440]|0.1566,0.1566,[329440]|0.1495,0.1495,[329440]|0.1495,0.1495,[329440]|0.2167,0.2167,[329440]|0.1495,0.1495,[329440]|0.1766,0.1766,[329440]|0.1732,0.1732,[329440]|0.1456,0.1456,[329440]|0.1205,0.1205,[329440]|0.1732,0.1732,[329440]|0.115,0.115,[329440]|0.1088,0.1088,[329440]|0.0935,0.0935,[329440]|0.1292,0.1292,[329440]|0.1456,0.1456,[329440]|0.1018,0.1018,[329440]|0.1532,0.1532,[329440]|0.1732,0.1732,[329440]|0.1878,0.1878,[329440]|0.1878,0.1878,[329440]|0.2122,0.2122,[329440]|0.1602,0.1602,[329440]|0.1766,0.1766,[329440]|0.1178,0.1178,[329440]|0.1844,0.1844,[329440]|0.1018,0.1018,[329440]|0.1844,0.1844,[329440]|0.2333,0.2333,[329440]|0.2913,0.2913,[329440]|0.2333,0.2333,[329440]|0.2483,0.2483,[329440]|0.208,0.208,[329440]|0.2167,0.2167,[329440]|0.2531,0.2531,[329440]|0.3263,0.3263,[329440]|0.3578,0.3578,[329440]|0.3806,0.3806,[329440]|0.3668,0.3668,[329440]|0.3762,0.3762,[329440]|0.3717,0.3717,[329440]|0.3225,0.3225,[329440]|0.4116,0.4116,[329440]|0.3399,0.3399,[329440]|0.4513,0.4513,[329440]|0.3717,0.3717,[329440]|0.4879,0.4879,[329440]|0.3146,0.3146,[329440]|0.2865,0.2865,[329440]|0.2385,0.2385,[329440]|0.2865,0.2865,[329440]|0.363,0.363,[329440]|0.2913,0.2913,[329440]|0.3535,0.3535,[329440]|0.3359,0.3359,[329440]|0.2122,0.2122,[329440]|0.2209,0.2209,[329440]|0.1998,0.1998,[329440]|0.1667,0.1667,[329440]|0.115,0.115,[329440]|0.115,0.115,[329440]|0.106,0.106,[329440]|0.0884,0.0884,[329440]|0.1205,0.1205,[329440]|0.0723,0.0723,[329440]|0.115,0.115,[329440]|0.115,0.115,[329440]|0.2292,0.2292,[329440]|0.2558,0.2558,[329440]|0.2786,0.2786,[329440]|0.2786,0.2786,[329440]|0.1958,0.1958,[329440]|0.2558,0.2558,[329440]|0.27,0.27,[329440]|0.2865,0.2865,[329440]|0.4149,0.4149,[329440]|0.442,0.442,[329440]|0.4651,0.4651,[329440]|0.46,0.46,[329440]|0.4781,0.4781,[329440]|0.4879,0.4879,[329440]|0.4513,0.4513,[329440]|0.4078,0.4078,[329440]|0.3491,0.3491,[329440]|0.3992,0.3992,[329440]|0.3146,0.3146,[329440]|0.2602,0.2602,[329440]|0.2385,0.2385,[329440]|0.1698,0.1698,[329440]|0.2167,0.2167,[329440]|0.1921,0.1921,[329440]|0.2748,0.2748,[329440]|0.3456,0.3456,[329440]|0.27,0.27,[329440]|0.2432,0.2432,[329440]|0.1667,0.1667,[329440]|0.1844,0.1844,[329440]|0.1635,0.1635,[329440]|0.1805,0.1805,[329440]|0.1844,0.1844,[329440]|0.2041,0.2041,[329440]|0.2913,0.2913,[329440]|0.3535,0.3535,[329440]|0.3399,0.3399,[329440]|0.3399,0.3399,[329440]|0.3806,0.3806,[329440]|0.4781,0.4781,[329440]|0.5374,0.5374,[329440]|0.6442,0.6442,[329440]|0.6442,0.6442,[329440]|0.7111,0.7111,[329440]|0.7458,0.7458,[329440]|0.7724,0.7724,[329440]|0.865,0.865,[329440]|0.9009,0.9009,[329440]| +GRAPHLINE IUPredWS (Short) 0.5 Above 0.5 indicates disorder ff0000 + +COLOUR IUPredWS (Long) 72144e +COLOUR IUPredWS (Short) 329440 +COLOUR IUPredWS (Long) 72144e +COLOUR IUPredWS (Short) 329440 +COLOUR IUPredWS (Long) 72144e +COLOUR IUPredWS (Short) 329440 +COLOUR IUPredWS (Long) 72144e +COLOUR IUPredWS (Short) 329440 +COLOUR IUPredWS (Long) 72144e +COLOUR IUPredWS (Short) 329440 +COLOUR IUPredWS (Long) 72144e +COLOUR IUPredWS (Short) 329440 +COLOUR IUPredWS (Long) 72144e +COLOUR IUPredWS (Short) 329440 +COLOUR IUPredWS (Long) 72144e +COLOUR IUPredWS (Short) 329440 +COLOUR IUPredWS (Long) 72144e +COLOUR IUPredWS (Short) 329440 +COLOUR IUPredWS (Long) 72144e +COLOUR IUPredWS (Short) 329440 +COLOUR IUPredWS (Long) 72144e +COLOUR IUPredWS (Short) 329440 +COLOUR IUPredWS (Long) 72144e +COLOUR IUPredWS (Short) 329440 +COLOUR IUPredWS (Long) 72144e +COLOUR IUPredWS (Short) 329440 +COLOUR IUPredWS (Long) 72144e +COLOUR IUPredWS (Short) 329440 +COLOUR IUPredWS (Long) 72144e +COLOUR IUPredWS (Short) 329440 +COMBINE IUPredWS (Long) IUPredWS (Short) + +SEQUENCE_REF Q93XJ9_SOLTU +COMBINE IUPredWS (Long) IUPredWS (Short) + +SEQUENCE_REF FER_CAPAA +COMBINE IUPredWS (Long) IUPredWS (Short) + +SEQUENCE_REF FER_CAPAN +COMBINE IUPredWS (Long) IUPredWS (Short) + +SEQUENCE_REF FER1_MESCR +COMBINE IUPredWS (Long) IUPredWS (Short) + +SEQUENCE_REF FER1_SPIOL +COMBINE IUPredWS (Long) IUPredWS (Short) + +SEQUENCE_REF FER1_PEA +COMBINE IUPredWS (Long) IUPredWS (Short) + +SEQUENCE_REF Q7XA98_TRIPR +COMBINE IUPredWS (Long) IUPredWS (Short) + +SEQUENCE_REF O80429_MAIZE +COMBINE IUPredWS (Long) IUPredWS (Short) + +SEQUENCE_REF FER1_MAIZE +COMBINE IUPredWS (Long) IUPredWS (Short) + +SEQUENCE_REF FER3_RAPSA +COMBINE IUPredWS (Long) IUPredWS (Short) + +SEQUENCE_REF FER_BRANA +COMBINE IUPredWS (Long) IUPredWS (Short) + +SEQUENCE_REF FER1_ARATH +COMBINE IUPredWS (Long) IUPredWS (Short) + +SEQUENCE_REF Q93Z60_ARATH +COMBINE IUPredWS (Long) IUPredWS (Short) + +SEQUENCE_REF FER2_ARATH +COMBINE IUPredWS (Long) IUPredWS (Short) + +SEQUENCE_REF FER1_SOLLC +# takes the current reference sequence and makes it the reference for the view +VIEW_SETREF +# nominal name for new hide columns command +HIDE_INSERTIONS diff --git a/help/help.jhm b/help/help.jhm index af010a4..eafcc68 100755 --- a/help/help.jhm +++ b/help/help.jhm @@ -105,7 +105,8 @@ - + + diff --git a/help/helpTOC.xml b/help/helpTOC.xml index b67eb6f..9cfd17e 100755 --- a/help/helpTOC.xml +++ b/help/helpTOC.xml @@ -90,6 +90,7 @@ + diff --git a/help/html/calculations/AnnotationColumnSelectionWithSM.gif b/help/html/calculations/AnnotationColumnSelectionWithSM.gif new file mode 100644 index 0000000..4373493 Binary files /dev/null and b/help/html/calculations/AnnotationColumnSelectionWithSM.gif differ diff --git a/help/html/calculations/AnnotationColumnSelectionWithoutSM.gif b/help/html/calculations/AnnotationColumnSelectionWithoutSM.gif new file mode 100644 index 0000000..921f028 Binary files /dev/null and b/help/html/calculations/AnnotationColumnSelectionWithoutSM.gif differ diff --git a/help/html/calculations/columnFilterByAnnotation.html b/help/html/calculations/columnFilterByAnnotation.html new file mode 100644 index 0000000..62bfcf1 --- /dev/null +++ b/help/html/calculations/columnFilterByAnnotation.html @@ -0,0 +1,95 @@ + + + +Filter Columns by Annotation + + + +

+ Filter Columns by Annotation +

+

Jalview allows the columns of an alignment to be filtered using + any annotation rows added to that alignment.

+ From "Select" menu + "Select by Annotation..." to bring + up the Select by Annotation window. The filter options vary depending + on the type of annotation selected. If an annotation that has a numeric + values is selected, the threshold filter option is activated as seen in the + figure on the right below. +
+
+ +
+ +
+
+ +
+
 
+ +
    +
  • Select which annotation to base the filtering on using the + top-most selection box.
  • + +
  • Search Filter +
      +
    • When a text is entered in the textfield on the search + filter section, the "Display Label" and "Description" + checkboxes becomes selectable.
    • +
    • On selecting any of the checkboxes, a regular expresion + search (RegEx) is executed on the specified field of the current + annotation row selected, and the matching columns will be highlighted + in the alignment.
    • +
    +
  • Structure Filter +
      +
    • Alignment columns can also be filtered by the type of + secondary structure present in a choosen annotation row.
    • +
    • This can be achieved by ticking the type of structure you + wish to filter by under the structures filter section.
    • +
    +
  • Threshold Filter +
      +
    • This filter is only activated for annotation which contain + numeric values
    • +
    • Select whether to Filter the alignment above or below an + adjustable threshold with the selection box within the threshold + filter section.
    • +
    • Change the threshold value with the slider, or enter the + exact value in the text box.
    • +
    +
  • Actions +
      +
    • The "Select" and "Hide" radio buttons + determines the action that will be carried out on the matching + columns in the alignment during the filtering process.
    • +
    • The default option is "Select" and this simply + enables column selection on the matching alignment column.
    • +
    • While the "Hide" option enables the matching columns to + be hidden automatically during the filtering process.
    • +
    • The "Ok" button applies the filter when clicked.
    • +
    • And finally, The "Cancel" button restores the alignment to its previous state before the filtering when clicked. +
  • +
+ + + diff --git a/help/html/features/annotationsFormat.html b/help/html/features/annotationsFormat.html index 141379f..72691ce 100755 --- a/help/html/features/annotationsFormat.html +++ b/help/html/features/annotationsFormat.html @@ -30,8 +30,10 @@ version 2.08 of Jalview, via an annotations file. It is a simple ASCII text file consisting of tab delimited records similar to the Sequence Features File, and introduced primarily for use with the Jalview applet.

-

Alignment annotations files are imported into Jalview in the -following ways:
+ +

Importing annotation files
+Alignment annotations files are imported into Jalview in the +following ways:

  • from the command line
      -annotations <Annotations filename>
  • @@ -40,53 +42,142 @@ following ways:
    menu of an alignment window.

-

Format of an Annotations File

-

The file consists of lines containing an instruction followed by -tab delimited fields, and any lines starting with "#" are -ignored. The first non-commented out line of a valid Annotations file +

+ Exporting annotation files
An annotation file + can be created for any alignment view from the "Export + Annotations ..." entry in the File menu of an + alignment window. +

+

THE ANNOTATION FILE FORMAT +
An annotation file consists of lines containing an instruction followed by +tab delimited fields. Any lines starting with "#" are considered comments, and +ignored. The sections below describe the structure of an annotation file. +

+

+ At the end of this document, you can also find notes on compatibility of annotation files across + different versions of Jalview. An example + annotation file is also provided along with instructions on how to + import it to Jalview. +

+
+

Header line
The first non-commented out line of a valid Annotations file must begin with :

JALVIEW_ANNOTATION

-

A row of annotation is added with a line like

GRAPH_TYPE	Label	Description (optional)	Values

+
+

LINE_GRAPH, BAR_GRAPH and NO_GRAPH
+Labels, secondary structure, histograms and line graphs are added with a line like

GRAPH_TYPE	Label	Description (optional)	Values

- The GRAPH_TYPE field, which appears first, defines the + Here, the GRAPH_TYPE field in the first column defines the appearance of the annotation row when rendered by Jalview. The next field is the row label for the annotation. This may be followed by a description for the row, which is shown in a tooltip when the user mouses over the annotation row's label. Since - Jalview 2.7, the description field may also contain html in the same - way as a sequence feature's label, - providing the html is enclosed in an <html/> tag. + Jalview 2.7, the description field may also contain HTML tags (in the same + way as a sequence feature's label), + providing the text is enclosed in an <html/> tag. -

    Please note: URL links embedded in HTML descriptions will - be supported in a future release of Jalview +
      Please note: URL links embedded in HTML descriptions are not yet supported.

    The final Values field contains a series of "|" separated value fields. Each value field is itself a comma separated list of fields of a particular - type defined by the annotation row's GRAPH_TYPE. The allowed values of - GRAPH_TYPE and the format of their respective value fields (with the - trailing "|" symbol) are shown below: + type defined by the annotation row's GRAPH_TYPE. The allowed values of + GRAPH_TYPE and corresponding interpretation of each Value are shown below:

      -
    • BAR_GRAPH
      Plots a histogram with labels below each +
    • BAR_GRAPH
      Plots a histogram with labels below each bar.
      number,text character,Tooltip text
    • -
    • LINE_GRAPH
      Draws a line between values on the +
    • LINE_GRAPH
      Draws a line between values on the annotation row.
      number
    • -
    • NO_GRAPH
      For a row consisting of text labels and/or - secondary structure symbols.
      {Secondary Structure - Symbol},text label,Tooltip text
      Currently - supported secondary structure structure symbols are H (for - helix) and E (for strand)
    • +
    • NO_GRAPH
      For a row consisting of text labels and/or + secondary structure symbols.
      {Secondary Structure + Symbol},text label,Tooltip text

      The type of secondary structure symbol depends on the alignment being annotated being either Protein or RNA.
      For proteins, structure symbols are H (for + helix) and E (for strand)

      For RNA, VIENNA, WUSS or extended notation can be used to specify positions that are paired (e.g. "(|(||)|)" or "|A|A|A|(|a|a|a|)")
    Any or all value fields may be left empty, as well as the BAR_GRAPH's text character field, and either or both of the text-label and secondary structure symbol fields of the NO_GRAPH type annotation rows.

    Color strings can be embedded in a value field by enclosing an RGB triplet in square brackets to colour that position in an annotation row.

    -

    SEQUENCE_REF and GROUP_REF

    +
    +

    COMBINE, COLOUR and GRAPHLINE for line graphs
    +LINE_GRAPH type annotations can be given a colour +(specified as 24 bit RGB triplet in hexadecimal or comma separated +values), combined onto the same vertical axis, and have ordinate lines +(horizontal lines at a particular vertical axis value) using the +following commands (respectively): +

    COLOUR	graph_name	colour
    +COMBINE	graph_1_name	graph_2_name
    +GRAPHLINE	graph_name	value	label	colour
    +
    +

    +
    +

    ROWPROPERTIES
    +The visual display properties for a set of annotation rows can be modified using the following tab-delimited line:

    +
    ROWPROPERTIES	Row label	centrelabs=true( or false)	showalllabs=true(default is false)	scaletofit=true (default is false)
    +

    This sets the visual display properties according to the given values for all the annotation rows with labels matching Row label. The properties mostly affect the display of multi-character column labels, and are as follows: +

    • centrelabs Centre each label on its column.
    • +
    • showalllabs Show every column label rather than only the first of a run of identical labels (setting this to true can have a drastic effect on secondary structure rows).
    • +
    • scaletofit Shrink each label's font size so that the label fits within the column. Useful when annotating an alignment with a specific column numbering system. (Not available in Jalview applet due to AWT 1.1 limitations)
    • +

    +

    SEQUENCE_GROUP
    +Groups of sequences and column ranges can be defined using a tab delimited statement like:

    +
    SEQUENCE_GROUP	Group_Name	Group_Start	Group_End	Sequences
    +

    The sequences can be defined by alignment index and a range of sequences can + be defined in a comma delimited field such as

    +

    2-5,8-15,20,22

    +

    Enter * to select all groups.

    +

    Note: If the alignment indices are not known, enter -1, followed by a tab and then a tab delimited list +of sequence IDs.

    +

    If a SEQUENCE_REF has been defined, then group_start and group_end will be + relative to the sequence residue numbering, otherwise the group_start and group_end + will be alignment column indices.

    +
    +

    PROPERTIES
    This statement allows various visualisation properties to be assigned to a named group. This takes a series of tab-delimited key=value pairs:

    +
    PROPERTIES	Group_name	tab_delimited_key_value_pairs
    +
    +

    The currently supported set of sequence group key-value pairs that can be provided here are :

    + + + + + + + + + + + + + + + + + +
    KeyValue
    descriptionText - may include simple HTML tags
    colourA string resolving to a valid Jalview colourscheme (e.g. Helix Propensity)
    pidThresholdA number from 0-100 specifying the Percent Identity Threshold for colouring columns in the group or alignment
    consThresholdA number from 0-100 specifying the degree of bleaching applied for conservation colouring
    outlineColourLine colour used for outlining the group (default is red)
    displayBoxesBoolean (default true) controlling display of shaded box for each alignment position
    displayTextBoolean (default true) controlling display of text for each alignment position
    colourTextBoolean (default false) specifying whether text should be shaded by applied colourscheme
    textCol1Colour for text when shown on a light background
    textCol2Colour for text when shown on a dark background
    textColThresholdNumber from 0-100 specifying switching threshold between light and dark background
    idColourColour for highlighting the Sequence ID labels for this group
    If idColour is given but colour is not, then idColor will also be used for the group background colour.
    showunconservedBoolean (default false) indicating whether residues should only be shown that are different from current reference or consensus sequence
    hideBoolean (default false) indicating whether the rows in this group should be marked as hidden.
    Note: if the group is sequence associated (specified by SEQUENCE_REF), then all members will be hidden and marked as represented by the reference sequence.
    + +

    Specifying colours in PROPERTIES key-value pairs
    +The colour property can take either a colour scheme name, + or a single colour specification (either a colour name like 'red' or an RGB + triplet like 'ff0066'). If a single colour is specified, then the group + will be coloured with that colour.

    +
    +

    SEQUENCE_REF and GROUP_REF
    By default, annotation is associated with the alignment as a whole. However, it is also possible to have an annotation row associated with @@ -114,79 +205,42 @@ definitions by: Group association is turned off for subsequent annotation rows by:

    GROUP_REF	ALIGNMENT

    -

    LINE_GRAPH Grouping

    -

    LINE_GRAPH type annotations can be given a colour -(specified as 24 bit RGB triplet in hexadecimal or comma separated -values), combined onto the same vertical axis, and have ordinate lines -(horizontal lines at a particular vertical axis value) using the -following commands (respectively): -

    COLOUR	graph_name	colour
    -COMBINE	graph_1_name	graph_2_name
    -GRAPHLINE	graph_name	value	label	colour
    -
    -

    -

    (Since Jalview 2.5) ROWPROPERTIES

    -

    The visual display properties for a set of annotation rows can be modified using the following tab-delimited line:

    -
    ROWPROPERTIES	Row label	centrelabs=true( or false)	showalllabs=true(default is false)	scaletofit=true (default is false)
    -

    This sets the visual display properties according to the given values for all the annotation rows with labels matching Row label. The properties mostly affect the display of multi-character column labels, and are as follows: -

    • centrelabs Centre each label on its column.
    • -
    • showalllabs Show every column label rather than only the first of a run of identical labels (setting this to true can have a drastic effect on secondary structure rows).
    • -
    • scaletofit Shrink each label's font size so that the label fits within the column. Useful when annotating an alignment with a specific column numbering system. (Not available in Jalview applet due to AWT 1.1 limitations)
    • -

    -

    (Since Jalview 2.2.1) SEQUENCE_GROUP

    -

    Groups of sequences can be defined using the tab delimited line

    -
    SEQUENCE_GROUP	Group_Name	Group_Start	Group_End	Sequences
    -

    The sequences can be defined by alignment index and a range of sequences can - be defined in a comma delimited field such as

    -

    2-5,8-15,20,22

    -

    Enter * to select all groups.

    -

    Note: If the alignment indices are not known, enter -1, followed by a tab and then a tab delimited list -specifying the sequence ids.

    -

    If the SEQUENCE_REF has been defined, the group_start and group_end will be - relative to the sequence residue numbering, otherwise the group_start and group_end - will be the alignment column indices.

    -

    The group can (optionally) be assigned various visualisation properties via - another tab delimited line thus:

    -
    PROPERTIES	Group_name	tab_delimited_key_value_pairs
    -
    -

    The key_value_pairs allow you to define a description and to colour the group - in various ways. All, none or some of the following values could be used for - a group:

    -

    description=Text
    - colour=Helix Propensity
    - pidThreshold=0
    - consThreshold=0
    - outlineColour=red
    - displayBoxes=true
    - displayText=false
    - colourText=false
    - textCol1=black
    - textCol2=black
    - textColThreshold=0
    - idColour=ff3322
    - - showunconserved=false

    -
    • New Features in 2.4:
      if the idColour property -is given without specifying a colour scheme with the colour -property, then the idColour will also be used to colour the sequence.
    • -
    • the colour property can take either a colour scheme name, - or a single colour specification (either a colour name like 'red' or an RGB - triplet like 'ff0066'). If a single colour is specified, then the group - will be coloured with that colour.
    • - -
    • Sequence associated Groups
      If a group is defined after a valid - SEQUENCE_REF sequence reference statement, the sequence representative - for the group will be set to the referenced sequence.
    • -
    • The interpretation of the COMBINE statement in Version 2.8.1 was refined +
      +

      VIEW_SETREF, VIEW_HIDECOL and HIDE_INSERTIONS
      +Since Jalview 2.9, the Annotations file has also supported the definition of views on the alignment, and definition of hidden regions.

      + +

      + VIEW_SETREF takes either a single sequence ID string, or a + numeric index (second argument), and attempts to assign a + corresponding sequence as the reference + sequence for the alignment. +

      + VIEW_HIDECOLS takes either a single argument consisting of a + comma separated series of integer pairs like + 3-4. These integer pairs define columns (starting from the + left-hand column 0) that should be marked as hidden in the alignment + view. +

      +

      + HIDE_INSERTIONS takes a either a single sequence ID or a + numeric index, or no arguments. This command marks all gapped + positions in a specified sequence (either the one located by the + arguments, the current SEQUENCE_REF, or the reference sequence for the + view). +


      +

      COMPATIBILITY NOTES
      + The interpretation of the COMBINE statement in Version 2.8.1 was refined so that only annotation line graphs with the given names ands the same - SEQUENCE_REF and GROUP_REF scope are grouped.

    • -
    -

    -

    An example Annotation file is given below: + SEQUENCE_REF and GROUP_REF scope are grouped.

    +
    + +

    EXAMPLES
    +An example Annotation file is given below. Copy and paste the contents into a text file and load it onto the Jalview example protein alignment.

    #Comment lines follow the hash symbol
     JALVIEW_ANNOTATION
     SEQUENCE_REF	FER1_MESCR	5
    @@ -211,6 +265,5 @@ PROPERTIES	Group_B	outlineColour=red
     PROPERTIES	Group_C	colour=Clustal
     

    -

    Last updated for version 2.8.1

    diff --git a/resources/lang/Messages.properties b/resources/lang/Messages.properties index fce8470..cfec3c9 100644 --- a/resources/lang/Messages.properties +++ b/resources/lang/Messages.properties @@ -57,8 +57,10 @@ action.by_pairwise_id = by Pairwise Identity action.by_id = by Id action.by_length = by Length action.by_group = by Group +action.unmark_as_reference = Unmark as Reference +action.set_as_reference = Set as Reference action.remove = Remove -action.remove_redundancy = Remove Redundancy +action.remove_redundancy = Remove Redundancy... action.pairwise_alignment = Pairwise Alignments... action.by_rna_helixes = by RNA Helices action.user_defined = User Defined... @@ -476,8 +478,8 @@ label.settings_for_type = Settings for {0} label.view_full_application = View in Full Application label.load_associated_tree = Load Associated Tree ... label.load_features_annotations = Load Features/Annotations ... -label.export_features = Export Features -label.export_annotations = Export Annotations +label.export_features = Export Features ... +label.export_annotations = Export Annotations ... label.jalview_copy = Copy (Jalview Only) label.jalview_cut = Cut (Jalview Only) label.to_upper_case = To Upper Case @@ -595,7 +597,7 @@ label.figure_id_column_width = Figure ID column width label.use_modeller_output = Use Modeller Output label.wrap_alignment = Wrap Alignment label.right_align_ids = Right Align Ids -label.sequence_name_italics = Seq Name Italics +label.sequence_name_italics = Sequence Name Italics label.open_overview = Open Overview label.default_colour_scheme_for_alignment = Default Colour Scheme for alignment label.annotation_shading_default = Annotation Shading Default @@ -1176,3 +1178,16 @@ label.show_logo = Show Logo label.normalise_logo = Normalise Logo label.no_colour_selection_in_scheme = Please, make a colour selection before to apply colour scheme label.no_colour_selection_warn = Error saving colour scheme +label.select_by_annotation = Select By Annotation +action.select_by_annotation = Select by Annotation... +label.threshold_filter = Threshold Filter +action.hide = Hide +action.select = Select +label.alpha_helix = Alpha Helix +label.beta_strand = Beta Strand +label.turn = Turn +label.select_all = Select All +label.structures_filter = Structures Filter +label.search_filter = Search Filter +label.display_name = Display Label +label.description = Description diff --git a/src/MCview/AppletPDBCanvas.java b/src/MCview/AppletPDBCanvas.java index a1bb272..9b0412a 100644 --- a/src/MCview/AppletPDBCanvas.java +++ b/src/MCview/AppletPDBCanvas.java @@ -550,7 +550,7 @@ public class AppletPDBCanvas extends Panel implements MouseListener, StructureMapping[] mapping = ssm.getMapping(pdbentry.getFile()); boolean showFeatures = false; - if (ap.av.getShowSequenceFeatures()) + if (ap.av.isShowSequenceFeatures()) { if (fr == null) { diff --git a/src/MCview/PDBCanvas.java b/src/MCview/PDBCanvas.java index dc0f718..4fd7a35 100644 --- a/src/MCview/PDBCanvas.java +++ b/src/MCview/PDBCanvas.java @@ -110,7 +110,7 @@ public class PDBCanvas extends JPanel implements MouseListener, boolean seqColoursReady = false; - jalview.gui.FeatureRenderer fr; + jalview.renderer.seqfeatures.FeatureRenderer fr; Color backgroundColour = Color.black; @@ -520,7 +520,7 @@ public class PDBCanvas extends JPanel implements MouseListener, StructureMapping[] mapping = ssm.getMapping(pdbentry.getFile()); boolean showFeatures = false; - if (ap.av.getShowSequenceFeatures()) + if (ap.av.isShowSequenceFeatures()) { if (fr == null) { diff --git a/src/jalview/analysis/Conservation.java b/src/jalview/analysis/Conservation.java index 4d64685..66a6d78 100755 --- a/src/jalview/analysis/Conservation.java +++ b/src/jalview/analysis/Conservation.java @@ -71,6 +71,8 @@ public class Conservation int[][] cons2; + private String[] consSymbs; + /** * Creates a new Conservation object. * @@ -366,17 +368,17 @@ public class Conservation { consString.append('-'); } - + consSymbs = new String[end-start+1]; for (int i = start; i <= end; i++) { gapcons = countConsNGaps(i); totGaps = gapcons[1]; pgaps = ((float) totGaps * 100) / (float) sequences.length; - + consSymbs[i-start]=new String(); + if (percentageGaps > pgaps) { resultHash = total[i - start]; - // Now find the verdict count = 0; enumeration = resultHash.keys(); @@ -385,12 +387,12 @@ public class Conservation { type = (String) enumeration.nextElement(); result = (Integer) resultHash.get(type); - // Do we want to count +ve conservation or +ve and -ve cons.? if (consflag) { if (result.intValue() == 1) { + consSymbs[i-start] = type+" "+consSymbs[i-start]; count++; } } @@ -398,6 +400,14 @@ public class Conservation { if (result.intValue() != -1) { + { + if (result.intValue()==0) { + consSymbs[i-start] = consSymbs[i-start]+ " !"+type; + } else { + consSymbs[i-start] = type+" "+consSymbs[i-start]; + } + } + count++; } } @@ -683,7 +693,7 @@ public class Conservation float vprop = value - min; vprop /= max; conservation.annotations[i] = new Annotation(String.valueOf(c), - String.valueOf(value), ' ', value, new Color(minR + consSymbs[i-start], ' ', value, new Color(minR + (maxR * vprop), minG + (maxG * vprop), minB + (maxB * vprop))); diff --git a/src/jalview/analysis/Finder.java b/src/jalview/analysis/Finder.java index 96151d7..b87c170 100644 --- a/src/jalview/analysis/Finder.java +++ b/src/jalview/analysis/Finder.java @@ -188,7 +188,7 @@ public class Finder { continue; } - +// if invalid string used, then regex has no matched to/from int sres = seq .findPosition(resIndex + Integer.parseInt(spaces.elementAt(resIndex) diff --git a/src/jalview/analysis/NJTree.java b/src/jalview/analysis/NJTree.java index a8ca3f7..099400e 100644 --- a/src/jalview/analysis/NJTree.java +++ b/src/jalview/analysis/NJTree.java @@ -20,13 +20,21 @@ */ package jalview.analysis; -import java.util.*; - import jalview.api.analysis.ScoreModelI; -import jalview.datamodel.*; -import jalview.io.*; -import jalview.schemes.*; -import jalview.util.*; +import jalview.datamodel.AlignmentView; +import jalview.datamodel.BinaryNode; +import jalview.datamodel.CigarArray; +import jalview.datamodel.NodeTransformI; +import jalview.datamodel.SeqCigar; +import jalview.datamodel.Sequence; +import jalview.datamodel.SequenceI; +import jalview.datamodel.SequenceNode; +import jalview.io.NewickFile; +import jalview.schemes.ResidueProperties; + +import java.util.Enumeration; +import java.util.List; +import java.util.Vector; /** * DOCUMENT ME! @@ -210,7 +218,7 @@ public class NJTree * DOCUMENT ME! */ public NJTree(SequenceI[] sequence, AlignmentView seqData, String type, - String pwtype, int start, int end) + String pwtype, ScoreModelI sm, int start, int end) { this.sequence = sequence; this.node = new Vector(); @@ -237,7 +245,7 @@ public class NJTree type = "AV"; } - if (!(pwtype.equals("PID"))) + if (sm == null && !(pwtype.equals("PID"))) { if (ResidueProperties.getScoreMatrix(pwtype) == null) { @@ -257,7 +265,7 @@ public class NJTree noseqs = i++; - distance = findDistances(); + distance = findDistances(sm); // System.err.println("Made distances");// dbg makeLeaves(); // System.err.println("Made leaves");// dbg @@ -315,7 +323,7 @@ public class NJTree for (int j = 0; j < seqs.length; j++) { - seqs[j] = (SequenceI) list.get(j); + seqs[j] = list.get(j); } seqmatcher = new SequenceIdMatcher(seqs); @@ -722,16 +730,18 @@ public class NJTree * * @return similarity matrix used to compute tree */ - public float[][] findDistances() + public float[][] findDistances(ScoreModelI _pwmatrix) { float[][] distance = new float[noseqs][noseqs]; - - // Pairwise substitution score (with no gap penalties) - ScoreModelI _pwmatrix = ResidueProperties.getScoreModel(pwtype); if (_pwmatrix == null) { - _pwmatrix = ResidueProperties.getScoreMatrix("BLOSUM62"); + // Resolve substitution model + _pwmatrix = ResidueProperties.getScoreModel(pwtype); + if (_pwmatrix == null) + { + _pwmatrix = ResidueProperties.getScoreMatrix("BLOSUM62"); + } } distance = _pwmatrix.findDistances(seqData); return distance; @@ -857,12 +867,12 @@ public class NJTree { System.out .println("Leaf = " + ((SequenceI) node.element()).getName()); - System.out.println("Dist " + ((SequenceNode) node).dist); + System.out.println("Dist " + node.dist); System.out.println("Boot " + node.getBootstrap()); } else { - System.out.println("Dist " + ((SequenceNode) node).dist); + System.out.println("Dist " + node.dist); printNode((SequenceNode) node.left()); printNode((SequenceNode) node.right()); } @@ -883,11 +893,11 @@ public class NJTree if ((node.left() == null) && (node.right() == null)) { - float dist = ((SequenceNode) node).dist; + float dist = node.dist; if (dist > maxDistValue) { - maxdist = (SequenceNode) node; + maxdist = node; maxDistValue = dist; } } @@ -1089,9 +1099,9 @@ public class NJTree + ((SequenceI) node.element()).getName()); } - System.out.println(" dist = " + ((SequenceNode) node).dist + " " - + ((SequenceNode) node).count + " " - + ((SequenceNode) node).height); + System.out.println(" dist = " + node.dist + " " + + node.count + " " + + node.height); } /** @@ -1137,13 +1147,13 @@ public class NJTree SequenceNode l = (SequenceNode) node.left(); SequenceNode r = (SequenceNode) node.right(); - ((SequenceNode) node).count = l.count + r.count; - ((SequenceNode) node).ycount = (l.ycount + r.ycount) / 2; + node.count = l.count + r.count; + node.ycount = (l.ycount + r.ycount) / 2; } else { - ((SequenceNode) node).count = 1; - ((SequenceNode) node).ycount = ycount++; + node.count = 1; + node.ycount = ycount++; } _lycount--; } @@ -1282,7 +1292,9 @@ public class NJTree { for (Enumeration nodes = node.elements(); nodes.hasMoreElements(); nodeTransformI .transform((BinaryNode) nodes.nextElement())) + { ; + } } } diff --git a/src/jalview/analysis/SequenceIdMatcher.java b/src/jalview/analysis/SequenceIdMatcher.java index aec7faf..bedce3f 100755 --- a/src/jalview/analysis/SequenceIdMatcher.java +++ b/src/jalview/analysis/SequenceIdMatcher.java @@ -42,10 +42,15 @@ public class SequenceIdMatcher // TODO: deal with ID collisions - SequenceI should be appended to list // associated with this key. names.put(new SeqIdName(seqs[i].getDisplayId(true)), seqs[i]); + SequenceI dbseq = seqs[i]; + while (dbseq.getDatasetSequence()!=null) + { + dbseq = dbseq.getDatasetSequence(); + } // add in any interesting identifiers - if (seqs[i].getDBRef() != null) + if (dbseq.getDBRef() != null) { - DBRefEntry dbr[] = seqs[i].getDBRef(); + DBRefEntry dbr[] = dbseq.getDBRef(); SeqIdName sid = null; for (int r = 0; r < dbr.length; r++) { diff --git a/src/jalview/analysis/scoremodels/FeatureScoreModel.java b/src/jalview/analysis/scoremodels/FeatureScoreModel.java new file mode 100644 index 0000000..e2a8b9a --- /dev/null +++ b/src/jalview/analysis/scoremodels/FeatureScoreModel.java @@ -0,0 +1,138 @@ +package jalview.analysis.scoremodels; + +import jalview.api.analysis.ScoreModelI; +import jalview.api.analysis.ViewBasedAnalysisI; +import jalview.datamodel.AlignmentView; +import jalview.datamodel.SequenceFeature; +import jalview.datamodel.SequenceI; +import jalview.util.Comparison; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Hashtable; +import java.util.List; + +public class FeatureScoreModel implements ScoreModelI, ViewBasedAnalysisI +{ + jalview.api.FeatureRenderer fr; + + @Override + public boolean configureFromAlignmentView( + jalview.api.AlignmentViewPanel view) + { + fr = view.cloneFeatureRenderer(); + return true; + } + + @Override + public float[][] findDistances(AlignmentView seqData) + { + int nofeats = 0; + List dft = Arrays.asList(fr.getDisplayedFeatureTypes()); + + if (dft != null) + { + nofeats = dft.size(); + } + + SequenceI[] sequenceString = seqData.getVisibleAlignment( + Comparison.GapChars.charAt(0)).getSequencesArray(); + int noseqs = sequenceString.length; + int cpwidth = seqData.getWidth(); + float[][] distance = new float[noseqs][noseqs]; + if (nofeats == 0) + { + for (float[] d : distance) + { + for (int i = 0; i < d.length; d[i++] = 0f) + { + ; + } + } + return distance; + } + float max = 0; + for (int cpos = 0; cpos < cpwidth; cpos++) + { + // get visible features at cpos under view's display settings and compare + // them + List> sfap = new ArrayList>(); + for (int i = 0; i < noseqs; i++) + { + Hashtable types = new Hashtable(); + List sfs = fr.findFeaturesAtRes(sequenceString[i], + sequenceString[i].findPosition(cpos)); + for (SequenceFeature sf : sfs) + { + types.put(sf.getType(), sf); + } + sfap.add(types); + } + for (int i = 0; i < (noseqs - 1); i++) + { + if (cpos == 0) + { + distance[i][i] = 0f; + } + for (int j = i + 1; j < noseqs; j++) + { + int sfcommon = 0; + // compare the two lists of features... + Hashtable fi = sfap.get(i), fk, fj = sfap + .get(j); + if (fi.size() > fj.size()) + { + fk = fj; + } + else + { + fk = fi; + fi = fj; + } + for (String k : fi.keySet()) + { + SequenceFeature sfj = fk.get(k); + if (sfj != null) + { + sfcommon++; + } + } + distance[i][j] += (fi.size() + fk.size() - 2f * sfcommon); + distance[j][i] += distance[i][j]; + } + } + } + for (int i = 0; i < noseqs; i++) + { + for (int j = i + 1; j < noseqs; j++) + { + distance[i][j] /= cpwidth; + distance[j][i] = distance[i][j]; + } + } + return distance; + } + + @Override + public String getName() + { + return "Sequence Feature Similarity"; + } + + @Override + public boolean isDNA() + { + return true; + } + + @Override + public boolean isProtein() + { + return true; + } + + public String toString() + { + return "Score between sequences based on hamming distance between binary vectors marking features displayed at each column"; + } +} diff --git a/src/jalview/api/AlignViewControllerGuiI.java b/src/jalview/api/AlignViewControllerGuiI.java index b9638e5..4010e8b 100644 --- a/src/jalview/api/AlignViewControllerGuiI.java +++ b/src/jalview/api/AlignViewControllerGuiI.java @@ -20,6 +20,8 @@ */ package jalview.api; +import jalview.commands.CommandI; + /** * Interface implemented by gui implementations managing a Jalview Alignment * View @@ -37,4 +39,6 @@ public interface AlignViewControllerGuiI */ void setStatus(String string); + void addHistoryItem(CommandI command); + } diff --git a/src/jalview/api/AlignViewControllerI.java b/src/jalview/api/AlignViewControllerI.java index 35f084f..9bd3f45 100644 --- a/src/jalview/api/AlignViewControllerI.java +++ b/src/jalview/api/AlignViewControllerI.java @@ -64,4 +64,16 @@ public interface AlignViewControllerI boolean markColumnsContainingFeatures(boolean invert, boolean extendCurrent, boolean clearColumns, String featureType); + /** + * sort the alignment or current selection by average score over the given set of features + * @param typ list of feature names or null to use currently displayed features + */ + void sortAlignmentByFeatureScore(String[] typ); + + /** + * sort the alignment or current selection by distribution of the given set of features + * @param typ list of feature names or null to use currently displayed features + */ + void sortAlignmentByFeatureDensity(String[] typ); + } diff --git a/src/jalview/api/AlignViewportI.java b/src/jalview/api/AlignViewportI.java index d8ba30d..2dea15e 100644 --- a/src/jalview/api/AlignViewportI.java +++ b/src/jalview/api/AlignViewportI.java @@ -20,11 +20,6 @@ */ package jalview.api; -import java.awt.Color; -import java.util.Hashtable; -import java.util.List; -import java.util.Map; - import jalview.analysis.Conservation; import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.AlignmentI; @@ -36,6 +31,11 @@ import jalview.datamodel.SequenceGroup; import jalview.datamodel.SequenceI; import jalview.schemes.ColourSchemeI; +import java.awt.Color; +import java.util.Hashtable; +import java.util.List; +import java.util.Map; + /** * @author jimp * @@ -163,6 +163,29 @@ public interface AlignViewportI */ void updateGroupAnnotationSettings(boolean applyGlobalSettings, boolean preserveNewGroupSettings); + + /** + * @return true if a reference sequence is set and should be displayed + */ + public boolean isDisplayReferenceSeq(); + + /** + * @return set the flag for displaying reference sequences when they are + * available + */ + public void setDisplayReferenceSeq(boolean displayReferenceSeq); + + /** + * @return true if colourschemes should render according to reference sequence + * rather than consensus if available + */ + public boolean isColourByReferenceSeq(); + + /** + * @return true set flag for deciding if colourschemes should render according + * to reference sequence rather than consensus if available + */ + public void setColourByReferenceSeq(boolean colourByReferenceSeq); void setSequenceColour(SequenceI seq, Color col); @@ -172,16 +195,58 @@ public interface AlignViewportI SequenceGroup getSelectionGroup(); + /** + * get the currently selected sequence objects or all the sequences in the + * alignment. TODO: change to List<> + * + * @return array of references to sequence objects + */ SequenceI[] getSequenceSelection(); void clearSequenceColours(); + /** + * This method returns the visible alignment as text, as seen on the GUI, ie + * if columns are hidden they will not be returned in the result. Use this for + * calculating trees, PCA, redundancy etc on views which contain hidden + * columns. + * + * @return String[] + */ CigarArray getViewAsCigars(boolean selectedRegionOnly); + /** + * return a compact representation of the current alignment selection to pass + * to an analysis function + * + * @param selectedOnly + * boolean true to just return the selected view + * @return AlignmentView + */ AlignmentView getAlignmentView(boolean selectedOnly); + /** + * return a compact representation of the current alignment selection to pass + * to an analysis function + * + * @param selectedOnly + * boolean true to just return the selected view + * @param markGroups + * boolean true to annotate the alignment view with groups on the + * alignment (and intersecting with selected region if selectedOnly + * is true) + * @return AlignmentView + */ AlignmentView getAlignmentView(boolean selectedOnly, boolean markGroups); + /** + * This method returns the visible alignment as text, as seen on the GUI, ie + * if columns are hidden they will not be returned in the result. Use this for + * calculating trees, PCA, redundancy etc on views which contain hidden + * columns. + * + * @return String[] + */ String[] getViewAsString(boolean selectedRegionOnly); void setSelectionGroup(SequenceGroup sg); @@ -200,4 +265,93 @@ public interface AlignViewportI List getVisibleAlignmentAnnotation( boolean selectedOnly); + FeaturesDisplayedI getFeaturesDisplayed(); + + String getSequenceSetId(); + + boolean isShowSequenceFeatures(); + + void setShowSequenceFeatures(boolean b); + + /** + * + * @param flag + * indicating if annotation panel shown below alignment + * + */ + void setShowAnnotation(boolean b); + + /** + * flag indicating if annotation panel shown below alignment + * + * @return + */ + boolean isShowAnnotation(); + + boolean isRightAlignIds(); + + void setRightAlignIds(boolean rightAlignIds); + + boolean areFeaturesDisplayed(); + + void setShowSequenceFeaturesHeight(boolean selected); + + boolean isShowSequenceFeaturesHeight(); + + void setFeaturesDisplayed(FeaturesDisplayedI featuresDisplayedI); + + void alignmentChanged(AlignmentViewPanel ap); + + /** + * @return the padGaps + */ + boolean isPadGaps(); + + /** + * @param padGaps + * the padGaps to set + */ + void setPadGaps(boolean padGaps); + + /** + * return visible region boundaries within given column range + * + * @param min + * first column (inclusive, from 0) + * @param max + * last column (exclusive) + * @return int[][] range of {start,end} visible positions TODO: change to list + * of int ranges + */ + int[][] getVisibleRegionBoundaries(int min, int max); + + /** + * This method returns an array of new SequenceI objects derived from the + * whole alignment or just the current selection with start and end points + * adjusted + * + * @note if you need references to the actual SequenceI objects in the + * alignment or currently selected then use getSequenceSelection() + * @return selection as new sequenceI objects + */ + SequenceI[] getSelectionAsNewSequence(); + + void invertColumnSelection(); + + /** + * broadcast selection to any interested parties + */ + void sendSelection(); + + /** + * calculate the row position for alignmentIndex if all hidden sequences were + * shown + * + * @param alignmentIndex + * @return adjusted row position + */ + int adjustForHiddenSeqs(int alignmentIndex); + + boolean hasHiddenRows(); + } diff --git a/src/jalview/api/AlignmentViewPanel.java b/src/jalview/api/AlignmentViewPanel.java index 0955cb4..a68c1f6 100644 --- a/src/jalview/api/AlignmentViewPanel.java +++ b/src/jalview/api/AlignmentViewPanel.java @@ -51,6 +51,10 @@ public interface AlignmentViewPanel extends OOMHandlerI */ void adjustAnnotationHeight(); + FeatureRenderer getFeatureRenderer(); + + FeatureRenderer cloneFeatureRenderer(); + /** * * @return displayed name for the view diff --git a/src/jalview/api/FeatureRenderer.java b/src/jalview/api/FeatureRenderer.java index 679cded..4fd89c1 100644 --- a/src/jalview/api/FeatureRenderer.java +++ b/src/jalview/api/FeatureRenderer.java @@ -20,9 +20,13 @@ */ package jalview.api; +import jalview.datamodel.SequenceFeature; import jalview.datamodel.SequenceI; import java.awt.Color; +import java.util.Hashtable; +import java.util.List; +import java.util.Map; /** * Abstract feature renderer interface @@ -37,4 +41,38 @@ public interface FeatureRenderer void featuresAdded(); + Object getFeatureStyle(String ft); + + void setColour(String ft, Object ggc); + + AlignViewportI getViewport(); + + FeaturesDisplayedI getFeaturesDisplayed(); + + Map getFeatureColours(); + + void findAllFeatures(boolean newMadeVisible); + + Map getDisplayedFeatureCols(); + + List getFeatureGroups(); + + List getGroups(boolean visible); + + void setGroupVisibility(List toset, boolean visible); + + void setGroupVisibility(String group, boolean visible); + + List findFeaturesAtRes(SequenceI sequence, int res); + + boolean isTransparencyAvailable(); + + String[] getDisplayedFeatureTypes(); + + String[] getDisplayedFeatureGroups(); + + void setAllVisible(List featureTypes); + + void setVisible(String featureType); + } diff --git a/src/jalview/api/FeatureSettingsControllerI.java b/src/jalview/api/FeatureSettingsControllerI.java new file mode 100644 index 0000000..c718e36 --- /dev/null +++ b/src/jalview/api/FeatureSettingsControllerI.java @@ -0,0 +1,6 @@ +package jalview.api; + +public interface FeatureSettingsControllerI +{ + +} diff --git a/src/jalview/api/FeatureSettingsModelI.java b/src/jalview/api/FeatureSettingsModelI.java new file mode 100644 index 0000000..c148f3f --- /dev/null +++ b/src/jalview/api/FeatureSettingsModelI.java @@ -0,0 +1,6 @@ +package jalview.api; + +public interface FeatureSettingsModelI +{ + +} diff --git a/src/jalview/api/FeaturesDisplayedI.java b/src/jalview/api/FeaturesDisplayedI.java new file mode 100644 index 0000000..9ed5ae5 --- /dev/null +++ b/src/jalview/api/FeaturesDisplayedI.java @@ -0,0 +1,29 @@ +package jalview.api; + +import java.util.Collection; +import java.util.Iterator; + +public interface FeaturesDisplayedI +{ + + Iterator getVisibleFeatures(); + + boolean isVisible(String featureType); + + boolean areVisible(Collection featureTypes); + + void clear(); + + void setVisible(String featureType); + + void setAllVisible(Collection featureTypes); + + boolean isRegistered(String type); + + void setAllRegisteredVisible(); + + int getVisibleFeatureCount(); + + int getRegisterdFeaturesCount(); + +} diff --git a/src/jalview/api/analysis/ViewBasedAnalysisI.java b/src/jalview/api/analysis/ViewBasedAnalysisI.java new file mode 100644 index 0000000..3404afc --- /dev/null +++ b/src/jalview/api/analysis/ViewBasedAnalysisI.java @@ -0,0 +1,17 @@ +package jalview.api.analysis; + +import jalview.api.AlignViewportI; +import jalview.api.AlignmentViewPanel; + +public interface ViewBasedAnalysisI +{ + + /** + * Parameterise the analysis model using the current view + * @param view + * @return true if model is applicable and calculation should proceed + */ + + boolean configureFromAlignmentView(AlignmentViewPanel view); + +} diff --git a/src/jalview/appletgui/APopupMenu.java b/src/jalview/appletgui/APopupMenu.java index 98a4a1c..c58fc5b 100644 --- a/src/jalview/appletgui/APopupMenu.java +++ b/src/jalview/appletgui/APopupMenu.java @@ -152,6 +152,8 @@ public class APopupMenu extends java.awt.PopupMenu implements MenuItem selSeqDetails = new MenuItem( MessageManager.getString("label.sequence_details") + "..."); + MenuItem makeReferenceSeq = new MenuItem(); + Sequence seq; MenuItem revealAll = new MenuItem(); @@ -347,6 +349,17 @@ public class APopupMenu extends java.awt.PopupMenu implements if (seq != null) { seqMenu.setLabel(seq.getName()); + if (seq == ap.av.getAlignment().getSeqrep()) + { + makeReferenceSeq.setLabel(MessageManager + .getString("action.unmark_as_reference"));// Unmark + // representative"); + } + else + { + makeReferenceSeq.setLabel(MessageManager + .getString("action.set_as_reference")); // ); + } repGroup.setLabel(MessageManager.formatMessage( "label.represent_group_with", new String[] { seq.getName() })); @@ -515,6 +528,10 @@ public class APopupMenu extends java.awt.PopupMenu implements { editName(); } + else if (source == makeReferenceSeq) + { + makeReferenceSeq_actionPerformed(); + } else if (source == sequenceDetails) { showSequenceDetails(); @@ -673,7 +690,7 @@ public class APopupMenu extends java.awt.PopupMenu implements features, true, ap)) { ap.alignFrame.sequenceFeatures.setState(true); - ap.av.showSequenceFeatures(true); + ap.av.setShowSequenceFeatures(true);; ap.highlightSearchResults(null); } } @@ -732,7 +749,7 @@ public class APopupMenu extends java.awt.PopupMenu implements true, true, false, - (ap.seqPanel.seqCanvas.fr != null) ? ap.seqPanel.seqCanvas.fr.minmax + (ap.seqPanel.seqCanvas.fr != null) ? ap.seqPanel.seqCanvas.fr.getMinMax() : null); contents.append("

    "); } @@ -909,6 +926,7 @@ public class APopupMenu extends java.awt.PopupMenu implements toLower.addActionListener(this); editMenu.add(toggleCase); seqMenu.add(sequenceName); + seqMenu.add(makeReferenceSeq); // seqMenu.add(sequenceDetails); if (!ap.av.applet.useXtrnalSviewer) @@ -928,6 +946,7 @@ public class APopupMenu extends java.awt.PopupMenu implements repGroup.addActionListener(this); revealAll.addActionListener(this); revealSeq.addActionListener(this); + makeReferenceSeq.addActionListener(this); } void refresh() @@ -1117,6 +1136,28 @@ public class APopupMenu extends java.awt.PopupMenu implements getGroup().setDisplayText(showText.getState()); refresh(); } + public void makeReferenceSeq_actionPerformed() + { + if (!ap.av.getAlignment().hasSeqrep()) + { + // initialise the display flags so the user sees something happen + ap.av.setDisplayReferenceSeq(true); + ap.av.setColourByReferenceSeq(true); + ap.av.getAlignment().setSeqrep(seq); + } + else + { + if (ap.av.getAlignment().getSeqrep() == seq) + { + ap.av.getAlignment().setSeqrep(null); + } + else + { + ap.av.getAlignment().setSeqrep(seq); + } + } + refresh(); + } public void showNonconserved_itemStateChanged() { diff --git a/src/jalview/appletgui/AlignFrame.java b/src/jalview/appletgui/AlignFrame.java index 9f65786..1f32da0 100644 --- a/src/jalview/appletgui/AlignFrame.java +++ b/src/jalview/appletgui/AlignFrame.java @@ -23,6 +23,7 @@ package jalview.appletgui; import jalview.analysis.AlignmentSorter; import jalview.api.AlignViewControllerGuiI; import jalview.api.AlignViewControllerI; +import jalview.api.FeatureRenderer; import jalview.api.SequenceStructureBinding; import jalview.bin.JalviewLite; import jalview.commands.CommandI; @@ -90,9 +91,10 @@ import java.awt.event.WindowEvent; import java.io.IOException; import java.net.URL; import java.net.URLEncoder; -import java.util.Enumeration; +import java.util.Arrays; import java.util.Hashtable; import java.util.List; +import java.util.Map; import java.util.StringTokenizer; import java.util.Vector; @@ -286,7 +288,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, { featuresFile = new jalview.io.FeaturesFile(file, type) .parse(viewport.getAlignment(), alignPanel.seqPanel.seqCanvas - .getFeatureRenderer().featureColours, featureLinks, + .getFeatureRenderer().getFeatureColours(), featureLinks, true, viewport.applet.getDefaultParameter( "relaxedidmatch", false)); } catch (Exception ex) @@ -302,9 +304,14 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, } if (autoenabledisplay) { - viewport.showSequenceFeatures = true; + viewport.setShowSequenceFeatures(true); sequenceFeatures.setState(true); } + if (alignPanel.seqPanel.seqCanvas.fr != null) + { + // update the min/max ranges where necessary + alignPanel.seqPanel.seqCanvas.fr.findAllFeatures(true); + } if (viewport.featureSettings != null) { viewport.featureSettings.refreshTable(); @@ -730,7 +737,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, } else if (evt.getSource() == sequenceFeatures) { - viewport.showSequenceFeatures(sequenceFeatures.getState()); + viewport.setShowSequenceFeatures(sequenceFeatures.getState()); alignPanel.seqPanel.seqCanvas.repaint(); } else if (evt.getSource() == conservationMenuItem) @@ -1100,6 +1107,10 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, { new AnnotationColourChooser(viewport, alignPanel); } + else if (source == annotationColumnSelection) + { + new AnnotationColumnChooser(viewport, alignPanel); + } else if (source == sortPairwiseMenuItem) { sortPairwiseMenuItem_actionPerformed(); @@ -1192,11 +1203,8 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, public String outputAnnotations(boolean displayTextbox) { - String annotation = new AnnotationFile().printAnnotations( - viewport.showAnnotation ? viewport.getAlignment() - .getAlignmentAnnotation() : null, viewport - .getAlignment().getGroups(), ((Alignment) viewport - .getAlignment()).alignmentProperties); + String annotation = new AnnotationFile() + .printAnnotationsForView(viewport); if (displayTextbox) { @@ -1211,20 +1219,13 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, return annotation; } - private Hashtable getDisplayedFeatureCols() + private Map getDisplayedFeatureCols() { if (alignPanel.getFeatureRenderer() != null - && viewport.featuresDisplayed != null) + && viewport.getFeaturesDisplayed()!= null) { - FeatureRenderer fr = alignPanel.getFeatureRenderer(); - Hashtable fcols = new Hashtable(); - Enumeration en = viewport.featuresDisplayed.keys(); - while (en.hasMoreElements()) - { - Object col = en.nextElement(); - fcols.put(col, fr.featureColours.get(col)); - } - return fcols; + return alignPanel.getFeatureRenderer().getDisplayedFeatureCols(); + } return null; } @@ -1430,6 +1431,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, /** * TODO: JAL-1104 */ + @Override public void addHistoryItem(CommandI command) { if (command.getSize() > 0) @@ -1688,11 +1690,8 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, { copiedHiddenColumns = new Vector(); int hiddenOffset = viewport.getSelectionGroup().getStartRes(); - for (int i = 0; i < viewport.getColumnSelection().getHiddenColumns() - .size(); i++) + for (int[] region : viewport.getColumnSelection().getHiddenColumns()) { - int[] region = (int[]) viewport.getColumnSelection() - .getHiddenColumns().elementAt(i); copiedHiddenColumns.addElement(new int[] { region[0] - hiddenOffset, region[1] - hiddenOffset }); @@ -2272,7 +2271,14 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, if (alignPanel != null && (fr = alignPanel.getFeatureRenderer()) != null) { - return fr.getGroups(); + List gps = fr.getFeatureGroups(); + int p=0; + String[] _gps = new String[gps.size()]; + for (Object gp:gps) + { + _gps[p++] = gp.toString(); + } + return _gps; } return null; } @@ -2290,7 +2296,14 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, if (alignPanel != null && (fr = alignPanel.getFeatureRenderer()) != null) { - return fr.getGroups(visible); + List gps = fr.getGroups(visible); + int p=0; + String[] _gps = new String[gps.size()]; + for (Object gp:gps) + { + _gps[p++] = gp.toString(); + } + return _gps; } return null; } @@ -2307,11 +2320,12 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, { FeatureRenderer fr = null; this.sequenceFeatures.setState(true); - viewport.showSequenceFeatures(true); + viewport.setShowSequenceFeatures(true); if (alignPanel != null && (fr = alignPanel.getFeatureRenderer()) != null) { - fr.setGroupState(groups, state); + + fr.setGroupVisibility(Arrays.asList(groups), state); alignPanel.seqPanel.seqCanvas.repaint(); if (alignPanel.overviewPanel != null) { @@ -3258,6 +3272,10 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, annotationColour.setLabel(MessageManager .getString("action.by_annotation")); annotationColour.addActionListener(this); + + annotationColumnSelection.setLabel("Select by Annotation"); + annotationColumnSelection.addActionListener(this); + invertSequenceMenuItem.setLabel(MessageManager .getString("action.invert_sequence_selection")); invertColSel.setLabel(MessageManager @@ -3446,6 +3464,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, selectMenu.add(unGroup); selectMenu.add(grpsFromSelection); selectMenu.add(deleteGroups); + selectMenu.add(annotationColumnSelection); } @@ -3460,6 +3479,8 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, MenuItem annotationColour = new MenuItem(); + MenuItem annotationColumnSelection = new MenuItem(); + MenuItem invertColSel = new MenuItem(); Menu menu1 = new Menu(); diff --git a/src/jalview/appletgui/AlignViewport.java b/src/jalview/appletgui/AlignViewport.java index 7400122..84a62ae 100644 --- a/src/jalview/appletgui/AlignViewport.java +++ b/src/jalview/appletgui/AlignViewport.java @@ -20,19 +20,23 @@ */ package jalview.appletgui; -import java.util.*; - -import java.awt.*; - -import jalview.analysis.*; +import jalview.analysis.NJTree; import jalview.api.AlignViewportI; -import jalview.bin.*; -import jalview.datamodel.*; -import jalview.schemes.*; +import jalview.bin.JalviewLite; +import jalview.datamodel.AlignmentI; +import jalview.datamodel.ColumnSelection; +import jalview.datamodel.Sequence; +import jalview.datamodel.SequenceGroup; +import jalview.datamodel.SequenceI; +import jalview.schemes.ColourSchemeProperty; +import jalview.schemes.UserColourScheme; import jalview.structure.SelectionSource; import jalview.structure.VamsasSource; import jalview.viewmodel.AlignmentViewport; +import java.awt.Font; +import java.util.Stack; + public class AlignViewport extends AlignmentViewport implements AlignViewportI, SelectionSource, VamsasSource { @@ -58,8 +62,6 @@ public class AlignViewport extends AlignmentViewport implements boolean renderGaps = true; - boolean showSequenceFeatures = false; - boolean showAnnotation = true; boolean upperCasebold = false; @@ -86,10 +88,6 @@ public class AlignViewport extends AlignmentViewport implements boolean scaleRightWrapped = true; - // The following vector holds the features which are - // currently visible, in the correct order or rendering - public Hashtable featuresDisplayed; - boolean showHiddenMarkers = true; public jalview.bin.JalviewLite applet; @@ -100,6 +98,8 @@ public class AlignViewport extends AlignmentViewport implements Stack redoList = new Stack(); + private AnnotationColumnChooser annotationColumnSelectionState; + public void finalize() { applet = null; @@ -256,16 +256,6 @@ public class AlignViewport extends AlignmentViewport implements } - public void showSequenceFeatures(boolean b) - { - showSequenceFeatures = b; - } - - public boolean getShowSequenceFeatures() - { - return showSequenceFeatures; - } - /** * get the consensus sequence as displayed under the PID consensus annotation * row. @@ -639,12 +629,6 @@ public class AlignViewport extends AlignmentViewport implements } } - @Override - public boolean hasHiddenColumns() - { - return hasHiddenColumns; - } - public boolean isNormaliseSequenceLogo() { return normaliseSequenceLogo; @@ -664,4 +648,15 @@ public class AlignViewport extends AlignmentViewport implements return validCharWidth; } + public AnnotationColumnChooser getAnnotationColumnSelectionState() + { + return annotationColumnSelectionState; + } + + public void setAnnotationColumnSelectionState( + AnnotationColumnChooser annotationColumnSelectionState) + { + this.annotationColumnSelectionState = annotationColumnSelectionState; + } + } diff --git a/src/jalview/appletgui/AlignmentPanel.java b/src/jalview/appletgui/AlignmentPanel.java index a90425f..5308a42 100644 --- a/src/jalview/appletgui/AlignmentPanel.java +++ b/src/jalview/appletgui/AlignmentPanel.java @@ -157,12 +157,18 @@ public class AlignmentPanel extends Panel implements AdjustmentListener, { return seqPanel.seqCanvas.sr; } - - public FeatureRenderer getFeatureRenderer() + @Override + public jalview.api.FeatureRenderer getFeatureRenderer() { return seqPanel.seqCanvas.fr; } - + @Override + public jalview.api.FeatureRenderer cloneFeatureRenderer() + { + FeatureRenderer nfr = new FeatureRenderer(av); + nfr.transferSettings(seqPanel.seqCanvas.fr); + return nfr; + } public void alignmentChanged() { av.alignmentChanged(this); diff --git a/src/jalview/appletgui/AnnotationColourChooser.java b/src/jalview/appletgui/AnnotationColourChooser.java index c7b7c6c..cc2e530 100644 --- a/src/jalview/appletgui/AnnotationColourChooser.java +++ b/src/jalview/appletgui/AnnotationColourChooser.java @@ -20,15 +20,34 @@ */ package jalview.appletgui; -import java.util.*; - -import java.awt.*; -import java.awt.event.*; - -import jalview.datamodel.*; -import jalview.schemes.*; +import jalview.datamodel.SequenceGroup; +import jalview.schemes.AnnotationColourGradient; +import jalview.schemes.ColourSchemeI; import jalview.util.MessageManager; +import java.awt.BorderLayout; +import java.awt.Button; +import java.awt.Checkbox; +import java.awt.Choice; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.Frame; +import java.awt.Panel; +import java.awt.Scrollbar; +import java.awt.TextField; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.AdjustmentEvent; +import java.awt.event.AdjustmentListener; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.util.Hashtable; +import java.util.Vector; + public class AnnotationColourChooser extends Panel implements ActionListener, AdjustmentListener, ItemListener, MouseListener { @@ -104,9 +123,13 @@ public class AnnotationColourChooser extends Panel implements { String label = av.getAlignment().getAlignmentAnnotation()[i].label; if (!list.contains(label)) + { list.addElement(label); + } else + { list.addElement(label + "_" + (index++)); + } } for (int i = 0; i < list.size(); i++) @@ -137,7 +160,9 @@ public class AnnotationColourChooser extends Panel implements threshold.select(1); break; default: - throw new Error(MessageManager.getString("error.implementation_error_dont_know_thereshold_annotationcolourgradient")); + throw new Error( + MessageManager + .getString("error.implementation_error_dont_know_thereshold_annotationcolourgradient")); } thresholdIsMin.setState(acg.thresholdIsMinMax); thresholdValue.setText("" + acg.getAnnotationThreshold()); @@ -348,14 +373,14 @@ public class AnnotationColourChooser extends Panel implements { if (!adjusting) { - thresholdValue.setText(((float) slider.getValue() / 1000f) + ""); + thresholdValue.setText((slider.getValue() / 1000f) + ""); if (currentColours.getState() && !(av.getGlobalColourScheme() instanceof AnnotationColourGradient)) { changeColour(); } - currentAnnotation.threshold.value = (float) slider.getValue() / 1000f; + currentAnnotation.threshold.value = slider.getValue() / 1000f; ap.paintAlignment(false); } } diff --git a/src/jalview/appletgui/AnnotationColumnChooser.java b/src/jalview/appletgui/AnnotationColumnChooser.java new file mode 100644 index 0000000..e25ff8f --- /dev/null +++ b/src/jalview/appletgui/AnnotationColumnChooser.java @@ -0,0 +1,927 @@ +package jalview.appletgui; + +import jalview.datamodel.AlignmentAnnotation; +import jalview.datamodel.ColumnSelection; +import jalview.gui.JvSwingUtils; +import jalview.schemes.AnnotationColourGradient; +import jalview.util.MessageManager; +import jalview.viewmodel.annotationfilter.AnnotationFilterParameter; + +import java.awt.BorderLayout; +import java.awt.CardLayout; +import java.awt.Checkbox; +import java.awt.Choice; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Frame; +import java.awt.Panel; +import java.awt.TextField; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.AdjustmentEvent; +import java.awt.event.AdjustmentListener; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.TextEvent; +import java.awt.event.TextListener; +import java.util.Iterator; +import java.util.Vector; + +import javax.swing.JPanel; + +//import net.miginfocom.swing.MigLayout; + +public class AnnotationColumnChooser extends AnnotationRowFilter implements + ActionListener, AdjustmentListener, ItemListener, MouseListener +{ + + private Choice annotations = new Choice(); + + private Panel actionPanel = new Panel(); + + private TitledPanel thresholdPanel = new TitledPanel(); + + private Panel switchableViewsPanel = new Panel(new CardLayout()); + + private CardLayout switchableViewsLayout = (CardLayout) (switchableViewsPanel + .getLayout()); + + private Panel noGraphFilterView = new Panel(); + + private Panel graphFilterView = new Panel(); + + private Panel annotationComboBoxPanel = new Panel(); + + private BorderLayout borderLayout1 = new BorderLayout(); + + private BorderLayout gBorderLayout = new BorderLayout(); + + private BorderLayout ngBorderLayout = new BorderLayout(); + + private Choice threshold = new Choice(); + + private StructureFilterPanel gStructureFilterPanel; + + private StructureFilterPanel ngStructureFilterPanel; + + private StructureFilterPanel currentStructureFilterPanel; + + private SearchPanel currentSearchPanel; + + private SearchPanel gSearchPanel; + + private SearchPanel ngSearchPanel; + + private FurtherActionPanel currentFurtherActionPanel; + + private FurtherActionPanel gFurtherActionPanel; + + private FurtherActionPanel ngFurtherActionPanel; + + public static final int ACTION_OPTION_SELECT = 1; + + public static int ACTION_OPTION_HIDE = 2; + + public static String NO_GRAPH_VIEW = "0"; + + public static String GRAPH_VIEW = "1"; + + private int actionOption = ACTION_OPTION_SELECT; + + private ColumnSelection oldColumnSelection; + + public AnnotationColumnChooser() + { + try + { + jbInit(); + } catch (Exception ex) + { + ex.printStackTrace(); + } + } + + public AnnotationColumnChooser(AlignViewport av, final AlignmentPanel ap) + { + super(av, ap); + frame = new Frame(); + frame.add(this); + jalview.bin.JalviewLite.addFrame(frame, + MessageManager.getString("label.select_by_annotation"), 520, + 215); + + slider.addAdjustmentListener(this); + slider.addMouseListener(this); + + if (av.getAlignment().getAlignmentAnnotation() == null) + { + return; + } + setOldColumnSelection(av.getColumnSelection()); + adjusting = true; + Vector list = new Vector(); + int index = 1; + for (int i = 0; i < av.getAlignment().getAlignmentAnnotation().length; i++) + { + String label = av.getAlignment().getAlignmentAnnotation()[i].label; + if (!list.contains(label)) + { + list.addElement(label); + } + else + { + list.addElement(label + "_" + (index++)); + } + } + + for (int i = 0; i < list.size(); i++) + { + annotations.addItem(list.elementAt(i).toString()); + } + + populateThresholdComboBox(threshold); + + // restore Object state from the previous session if one exists + if (av.getAnnotationColumnSelectionState() != null) + { + currentSearchPanel = av.getAnnotationColumnSelectionState() + .getCurrentSearchPanel(); + currentStructureFilterPanel = av.getAnnotationColumnSelectionState() + .getCurrentStructureFilterPanel(); + annotations.select(av.getAnnotationColumnSelectionState() + .getAnnotations().getSelectedIndex()); + threshold.select(av.getAnnotationColumnSelectionState() + .getThreshold().getSelectedIndex()); + actionOption = av.getAnnotationColumnSelectionState() + .getActionOption(); + } + + try + { + jbInit(); + } catch (Exception ex) + { + } + adjusting = false; + + updateView(); + frame.invalidate(); + frame.pack(); + } + + private void jbInit() throws Exception + { + ok.setLabel(MessageManager.getString("action.ok")); + + cancel.setLabel(MessageManager.getString("action.cancel")); + + thresholdValue.setEnabled(false); + thresholdValue.setColumns(7); + + ok.addActionListener(this); + cancel.addActionListener(this); + annotations.addItemListener(this); + thresholdValue.addActionListener(this); + threshold.addItemListener(this); + + slider.setBackground(Color.white); + slider.setEnabled(false); + slider.setPreferredSize(new Dimension(100, 32)); + + thresholdPanel.setBackground(Color.white); + thresholdPanel.setFont(JvSwingUtils.getLabelFont()); + // thresholdPanel.setLayout(new MigLayout("", "[left][right]", "[][]")); + + actionPanel.setBackground(Color.white); + actionPanel.setFont(JvSwingUtils.getLabelFont()); + + graphFilterView.setLayout(gBorderLayout); + graphFilterView.setBackground(Color.white); + + noGraphFilterView.setLayout(ngBorderLayout); + noGraphFilterView.setBackground(Color.white); + + annotationComboBoxPanel.setBackground(Color.white); + annotationComboBoxPanel.setFont(JvSwingUtils.getLabelFont()); + + gSearchPanel = new SearchPanel(this); + ngSearchPanel = new SearchPanel(this); + gFurtherActionPanel = new FurtherActionPanel(this); + ngFurtherActionPanel = new FurtherActionPanel(this); + gStructureFilterPanel = new StructureFilterPanel(this); + ngStructureFilterPanel = new StructureFilterPanel(this); + + thresholdPanel.setTitle("Threshold Filter"); + thresholdPanel.add(getThreshold()); + thresholdPanel.add(slider); + thresholdPanel.add(thresholdValue); + + actionPanel.add(ok); + actionPanel.add(cancel); + + JPanel staticPanel = new JPanel(); + staticPanel.setLayout(new BorderLayout()); + staticPanel.setBackground(Color.white); + + staticPanel.add(gSearchPanel, java.awt.BorderLayout.NORTH); + staticPanel.add(gStructureFilterPanel, java.awt.BorderLayout.SOUTH); + + graphFilterView.add(staticPanel, java.awt.BorderLayout.NORTH); + graphFilterView.add(thresholdPanel, java.awt.BorderLayout.CENTER); + graphFilterView.add(gFurtherActionPanel, java.awt.BorderLayout.SOUTH); + + noGraphFilterView.add(ngSearchPanel, java.awt.BorderLayout.PAGE_START); + noGraphFilterView.add(ngStructureFilterPanel, + java.awt.BorderLayout.CENTER); + noGraphFilterView.add(ngFurtherActionPanel, + java.awt.BorderLayout.CENTER); + + annotationComboBoxPanel.add(getAnnotations()); + switchableViewsPanel.add(noGraphFilterView, + AnnotationColumnChooser.NO_GRAPH_VIEW); + switchableViewsPanel.add(graphFilterView, + AnnotationColumnChooser.GRAPH_VIEW); + + this.setLayout(borderLayout1); + this.add(annotationComboBoxPanel, java.awt.BorderLayout.PAGE_START); + this.add(switchableViewsPanel, java.awt.BorderLayout.CENTER); + this.add(actionPanel, java.awt.BorderLayout.SOUTH); + + selectedAnnotationChanged(); + this.validate(); + } + + @SuppressWarnings("unchecked") + public void reset() + { + if (this.getOldColumnSelection() != null) + { + av.getColumnSelection().clear(); + + if (av.getAnnotationColumnSelectionState() != null) + { + ColumnSelection oldSelection = av + .getAnnotationColumnSelectionState() + .getOldColumnSelection(); + if (oldSelection != null && oldSelection.getHiddenColumns() != null + && !oldSelection.getHiddenColumns().isEmpty()) + { + for (Iterator itr = oldSelection.getHiddenColumns() + .iterator(); itr.hasNext();) + { + int positions[] = itr.next(); + av.hideColumns(positions[0], positions[1]); + } + } + av.setColumnSelection(oldSelection); + } + ap.paintAlignment(true); + } + + } + + public void adjustmentValueChanged(AdjustmentEvent evt) + { + if (!adjusting) + { + thresholdValue.setText((slider.getValue() / 1000f) + ""); + valueChanged(!sliderDragging); + } + } + + protected void addSliderMouseListeners() + { + + slider.addMouseListener(new MouseAdapter() + { + @Override + public void mousePressed(MouseEvent e) + { + sliderDragging = true; + super.mousePressed(e); + } + + @Override + public void mouseDragged(MouseEvent e) + { + sliderDragging = true; + super.mouseDragged(e); + } + + @Override + public void mouseReleased(MouseEvent evt) + { + if (sliderDragging) + { + sliderDragging = false; + valueChanged(true); + } + ap.paintAlignment(true); + } + }); + } + + public void valueChanged(boolean updateAllAnnotation) + { + if (slider.isEnabled()) + { + getCurrentAnnotation().threshold.value = slider.getValue() / 1000f; + updateView(); + ap.paintAlignment(false); + } + } + + public Choice getThreshold() + { + return threshold; + } + + public void setThreshold(Choice threshold) + { + this.threshold = threshold; + } + + public Choice getAnnotations() + { + return annotations; + } + + public void setAnnotations(Choice annotations) + { + this.annotations = annotations; + } + + @Override + public void updateView() + { + // Check if combobox is still adjusting + if (adjusting) + { + return; + } + + AnnotationFilterParameter filterParams = new AnnotationFilterParameter(); + setCurrentAnnotation(av.getAlignment().getAlignmentAnnotation()[getAnnotations() + .getSelectedIndex()]); + + int selectedThresholdItem = getSelectedThresholdItem(getThreshold() + .getSelectedIndex()); + + slider.setEnabled(true); + thresholdValue.setEnabled(true); + + if (selectedThresholdItem == AnnotationColourGradient.NO_THRESHOLD) + { + slider.setEnabled(false); + thresholdValue.setEnabled(false); + thresholdValue.setText(""); + // build filter params + } + else if (selectedThresholdItem != AnnotationColourGradient.NO_THRESHOLD) + { + if (getCurrentAnnotation().threshold == null) + { + getCurrentAnnotation() + .setThreshold( + new jalview.datamodel.GraphLine( + (getCurrentAnnotation().graphMax - getCurrentAnnotation().graphMin) / 2f, + "Threshold", Color.black)); + } + + adjusting = true; + float range = getCurrentAnnotation().graphMax * 1000 + - getCurrentAnnotation().graphMin * 1000; + + slider.setMinimum((int) (getCurrentAnnotation().graphMin * 1000)); + slider.setMaximum((int) (getCurrentAnnotation().graphMax * 1000)); + slider.setValue((int) (getCurrentAnnotation().threshold.value * 1000)); + thresholdValue.setText(getCurrentAnnotation().threshold.value + ""); + // slider.setMajorTickSpacing((int) (range / 10f)); + slider.setEnabled(true); + thresholdValue.setEnabled(true); + adjusting = false; + + // build filter params + filterParams + .setThresholdType(AnnotationFilterParameter.ThresholdType.NO_THRESHOLD); + if (getCurrentAnnotation().graph != AlignmentAnnotation.NO_GRAPH) + { + filterParams + .setThresholdValue(getCurrentAnnotation().threshold.value); + + if (selectedThresholdItem == AnnotationColourGradient.ABOVE_THRESHOLD) + { + filterParams + .setThresholdType(AnnotationFilterParameter.ThresholdType.ABOVE_THRESHOLD); + } + else if (selectedThresholdItem == AnnotationColourGradient.BELOW_THRESHOLD) + { + filterParams + .setThresholdType(AnnotationFilterParameter.ThresholdType.BELOW_THRESHOLD); + } + } + } + + if (currentStructureFilterPanel != null) + { + if (currentStructureFilterPanel.alphaHelix.getState()) + { + filterParams.setFilterAlphaHelix(true); + } + if (currentStructureFilterPanel.betaStrand.getState()) + { + filterParams.setFilterBetaSheet(true); + } + if (currentStructureFilterPanel.turn.getState()) + { + filterParams.setFilterTurn(true); + } + } + + if (currentSearchPanel != null) + { + + if (!currentSearchPanel.searchBox.getText().isEmpty()) + { + currentSearchPanel.description.setEnabled(true); + currentSearchPanel.displayName.setEnabled(true); + filterParams.setRegexString(currentSearchPanel.searchBox.getText()); + if (currentSearchPanel.displayName.getState()) + { + filterParams + .addRegexSearchField(AnnotationFilterParameter.SearchableAnnotationField.DISPLAY_STRING); + } + if (currentSearchPanel.description.getState()) + { + filterParams + .addRegexSearchField(AnnotationFilterParameter.SearchableAnnotationField.DESCRIPTION); + } + } + else + { + currentSearchPanel.description.setEnabled(false); + currentSearchPanel.displayName.setEnabled(false); + } + } + + av.getColumnSelection().filterAnnotations( + getCurrentAnnotation().annotations, filterParams); + + av.showAllHiddenColumns(); + if (getActionOption() == ACTION_OPTION_HIDE) + { + av.hideSelectedColumns(); + } + + filterParams = null; + av.setAnnotationColumnSelectionState(this); + ap.paintAlignment(true); + } + + public ColumnSelection getOldColumnSelection() + { + return oldColumnSelection; + } + + public void setOldColumnSelection(ColumnSelection currentColumnSelection) + { + if (currentColumnSelection != null) + { + this.oldColumnSelection = new ColumnSelection(currentColumnSelection); + } + } + + public FurtherActionPanel getCurrentFutherActionPanel() + { + return currentFurtherActionPanel; + } + + public void setCurrentFutherActionPanel( + FurtherActionPanel currentFutherActionPanel) + { + this.currentFurtherActionPanel = currentFutherActionPanel; + } + + public SearchPanel getCurrentSearchPanel() + { + return currentSearchPanel; + } + + public void setCurrentSearchPanel(SearchPanel currentSearchPanel) + { + this.currentSearchPanel = currentSearchPanel; + } + + public int getActionOption() + { + return actionOption; + } + + public void setActionOption(int actionOption) + { + this.actionOption = actionOption; + } + + public StructureFilterPanel getCurrentStructureFilterPanel() + { + return currentStructureFilterPanel; + } + + public void setCurrentStructureFilterPanel( + StructureFilterPanel currentStructureFilterPanel) + { + this.currentStructureFilterPanel = currentStructureFilterPanel; + } + + @Override + public void itemStateChanged(ItemEvent e) + { + if (e.getSource() == annotations) + { + selectedAnnotationChanged(); + } + else if (e.getSource() == threshold) + { + threshold_actionPerformed(null); + } + } + + public void selectedAnnotationChanged() + { + String currentView = AnnotationColumnChooser.NO_GRAPH_VIEW; + if (av.getAlignment().getAlignmentAnnotation()[getAnnotations() + .getSelectedIndex()].graph != AlignmentAnnotation.NO_GRAPH) + { + currentView = AnnotationColumnChooser.GRAPH_VIEW; + } + + gSearchPanel.syncState(); + gFurtherActionPanel.syncState(); + gStructureFilterPanel.syncState(); + + ngSearchPanel.syncState(); + ngFurtherActionPanel.syncState(); + ngStructureFilterPanel.syncState(); + + switchableViewsLayout.show(switchableViewsPanel, currentView); + updateView(); + } + + public class FurtherActionPanel extends Panel implements + ItemListener + { + private AnnotationColumnChooser aColChooser; + + private Choice furtherAction = new Choice(); + + public FurtherActionPanel(AnnotationColumnChooser aColChooser) + { + this.aColChooser = aColChooser; + furtherAction.addItem("Select"); + furtherAction.addItem("Hide"); + furtherAction.addItemListener(this); + syncState(); + + // this.setTitle("Filter Actions"); + // this.setFont(JvSwingUtils.getLabelFont()); + + this.add(furtherAction); + } + + public void syncState() + { + if (aColChooser.getActionOption() == AnnotationColumnChooser.ACTION_OPTION_HIDE) + { + furtherAction.select("Hide"); + } + else + { + furtherAction.select("Select"); + } + } + + @Override + public void itemStateChanged(ItemEvent e) + { + aColChooser.setCurrentFutherActionPanel(this); + if (furtherAction.getSelectedItem().equalsIgnoreCase("Select")) + { + setActionOption(ACTION_OPTION_SELECT); + updateView(); + } + else + { + setActionOption(ACTION_OPTION_HIDE); + updateView(); + } + + } + } + + public class StructureFilterPanel extends TitledPanel implements + ItemListener + { + private AnnotationColumnChooser aColChooser; + + private Checkbox alphaHelix = new Checkbox(); + + private Checkbox betaStrand = new Checkbox(); + + private Checkbox turn = new Checkbox(); + + private Checkbox all = new Checkbox(); + + public StructureFilterPanel(AnnotationColumnChooser aColChooser) + { + this.aColChooser = aColChooser; + + alphaHelix.setLabel(MessageManager.getString("label.alpha_helix")); + alphaHelix.setBackground(Color.white); + + alphaHelix.addItemListener(this); + + betaStrand.setLabel(MessageManager.getString("label.beta_strand")); + betaStrand.setBackground(Color.white); + betaStrand.addItemListener(this); + + turn.setLabel(MessageManager.getString("label.turn")); + turn.setBackground(Color.white); + turn.addItemListener(this); + + all.setLabel(MessageManager.getString("label.select_all")); + all.setBackground(Color.white); + all.addItemListener(this); + + this.setBackground(Color.white); + this.setTitle("Structure Filter"); + this.setFont(JvSwingUtils.getLabelFont()); + + this.add(all); + this.add(alphaHelix); + this.add(betaStrand); + this.add(turn); + } + + public void alphaHelix_actionPerformed() + { + updateSelectAllState(); + aColChooser.setCurrentStructureFilterPanel(this); + aColChooser.updateView(); + } + + public void betaStrand_actionPerformed() + { + updateSelectAllState(); + aColChooser.setCurrentStructureFilterPanel(this); + aColChooser.updateView(); + } + + public void turn_actionPerformed() + { + updateSelectAllState(); + aColChooser.setCurrentStructureFilterPanel(this); + aColChooser.updateView(); + } + + public void all_actionPerformed() + { + if (all.getState()) + { + alphaHelix.setState(true); + betaStrand.setState(true); + turn.setState(true); + } + else + { + alphaHelix.setState(false); + betaStrand.setState(false); + turn.setState(false); + } + aColChooser.setCurrentStructureFilterPanel(this); + aColChooser.updateView(); + } + + public void updateSelectAllState() + { + if (alphaHelix.getState() && betaStrand.getState() && turn.getState()) + { + all.setState(true); + } + else + { + all.setState(false); + } + } + + public void syncState() + { + StructureFilterPanel sfp = aColChooser + .getCurrentStructureFilterPanel(); + if (sfp != null) + { + alphaHelix.setState(sfp.alphaHelix.getState()); + betaStrand.setState(sfp.betaStrand.getState()); + turn.setState(sfp.turn.getState()); + if (sfp.all.getState()) + { + all.setState(true); + alphaHelix.setState(true); + betaStrand.setState(true); + turn.setState(true); + } + } + + } + + @Override + public void itemStateChanged(ItemEvent e) + { + if (e.getSource() == alphaHelix) + { + alphaHelix_actionPerformed(); + } + else if (e.getSource() == betaStrand) + { + betaStrand_actionPerformed(); + } + else if (e.getSource() == turn) + { + turn_actionPerformed(); + } + else if (e.getSource() == all) + { + all_actionPerformed(); + } + } + } + + public class SearchPanel extends TitledPanel implements ItemListener + { + private AnnotationColumnChooser aColChooser; + + private Checkbox displayName = new Checkbox(); + + private Checkbox description = new Checkbox(); + + private TextField searchBox = new TextField(10); + + public SearchPanel(AnnotationColumnChooser aColChooser) + { + + this.aColChooser = aColChooser; + searchBox.addTextListener(new TextListener() + { + + @Override + public void textValueChanged(TextEvent e) + { + searchStringAction(); + + } + + }); + + displayName.setLabel(MessageManager.getString("label.display_name")); + displayName.setEnabled(false); + displayName.addItemListener(this); + + description.setLabel(MessageManager.getString("label.description")); + description.setEnabled(false); + description.addItemListener(this); + this.setTitle("Search Filter"); + this.setFont(JvSwingUtils.getLabelFont()); + + syncState(); + this.add(searchBox); + this.add(displayName); + this.add(description); + } + + public void displayNameCheckboxAction() + { + aColChooser.setCurrentSearchPanel(this); + aColChooser.updateView(); + } + + public void discriptionCheckboxAction() + { + aColChooser.setCurrentSearchPanel(this); + aColChooser.updateView(); + } + + public void searchStringAction() + { + aColChooser.setCurrentSearchPanel(this); + aColChooser.updateView(); + } + + public void syncState() + { + SearchPanel sp = aColChooser.getCurrentSearchPanel(); + if (sp != null) + { + description.setEnabled(sp.description.isEnabled()); + description.setState(sp.description.getState()); + + displayName.setEnabled(sp.displayName.isEnabled()); + displayName.setState(sp.displayName.getState()); + + searchBox.setText(sp.searchBox.getText()); + } + } + + @Override + public void itemStateChanged(ItemEvent e) + { + if (e.getSource() == displayName) + { + displayNameCheckboxAction(); + } + else if (e.getSource() == description) + { + discriptionCheckboxAction(); + } + + } + } + + public void actionPerformed(ActionEvent evt) + { + if (evt.getSource() == thresholdValue) + { + try + { + float f = new Float(thresholdValue.getText()).floatValue(); + slider.setValue((int) (f * 1000)); + adjustmentValueChanged(null); + } catch (NumberFormatException ex) + { + } + } + + else if (evt.getSource() == ok) + { + ok_actionPerformed(null); + } + else if (evt.getSource() == cancel) + { + cancel_actionPerformed(null); + } + else if (evt.getSource() == thresholdValue) + { + thresholdValue_actionPerformed(null); + } + else + { + updateView(); + } + } + + @Override + public void mouseClicked(MouseEvent e) + { + // TODO Auto-generated method stub + + } + + @Override + public void mousePressed(MouseEvent e) + { + if (e.getSource() == slider) + { + updateView(); + } + + } + + @Override + public void mouseReleased(MouseEvent e) + { + if (e.getSource() == slider) + { + updateView(); + } + } + + @Override + public void mouseEntered(MouseEvent e) + { + if (e.getSource() == slider) + { + updateView(); + } + } + + @Override + public void mouseExited(MouseEvent e) + { + if (e.getSource() == slider) + { + updateView(); + } + } + +} diff --git a/src/jalview/appletgui/AnnotationLabels.java b/src/jalview/appletgui/AnnotationLabels.java index 3e81664..6aaa033 100755 --- a/src/jalview/appletgui/AnnotationLabels.java +++ b/src/jalview/appletgui/AnnotationLabels.java @@ -20,14 +20,36 @@ */ package jalview.appletgui; -import java.util.*; -import java.awt.*; -import java.awt.event.*; - -import jalview.datamodel.*; +import jalview.datamodel.AlignmentAnnotation; +import jalview.datamodel.Annotation; +import jalview.datamodel.SequenceGroup; +import jalview.datamodel.SequenceI; import jalview.util.MessageManager; import jalview.util.ParseHtmlBodyAndLinks; +import java.awt.Checkbox; +import java.awt.CheckboxMenuItem; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.FontMetrics; +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.Image; +import java.awt.MenuItem; +import java.awt.Panel; +import java.awt.PopupMenu; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.InputEvent; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.MouseMotionListener; +import java.util.Arrays; +import java.util.Vector; + public class AnnotationLabels extends Panel implements ActionListener, MouseListener, MouseMotionListener { @@ -221,7 +243,9 @@ public class AnnotationLabels extends Panel implements ActionListener, return true; } else + { return false; + } } @@ -713,11 +737,8 @@ public class AnnotationLabels extends Panel implements ActionListener, if (av.hasHiddenColumns()) { jalview.appletgui.AlignFrame.copiedHiddenColumns = new Vector(); - for (int i = 0; i < av.getColumnSelection().getHiddenColumns().size(); i++) + for (int[] region : av.getColumnSelection().getHiddenColumns()) { - int[] region = (int[]) av.getColumnSelection().getHiddenColumns() - .elementAt(i); - jalview.appletgui.AlignFrame.copiedHiddenColumns .addElement(new int[] { region[0], region[1] }); diff --git a/src/jalview/appletgui/AnnotationRowFilter.java b/src/jalview/appletgui/AnnotationRowFilter.java new file mode 100644 index 0000000..8a0a44a --- /dev/null +++ b/src/jalview/appletgui/AnnotationRowFilter.java @@ -0,0 +1,198 @@ +package jalview.appletgui; + +import jalview.schemes.AnnotationColourGradient; +import jalview.util.MessageManager; + +import java.awt.Button; +import java.awt.Checkbox; +import java.awt.Choice; +import java.awt.Frame; +import java.awt.Panel; +import java.awt.Scrollbar; +import java.awt.TextField; +import java.awt.event.ActionEvent; +import java.util.Vector; + + + +@SuppressWarnings("serial") +public abstract class AnnotationRowFilter extends Panel +{ + protected AlignViewport av; + + protected AlignmentPanel ap; + + protected int[] annmap; + + protected boolean enableSeqAss = false; + + private jalview.datamodel.AlignmentAnnotation currentAnnotation; + + protected boolean adjusting = false; + + protected Checkbox currentColours = new Checkbox(); + + protected Panel minColour = new Panel(); + + protected Panel maxColour = new Panel(); + + protected Checkbox seqAssociated = new Checkbox(); + + protected Checkbox thresholdIsMin = new Checkbox(); + + protected Scrollbar slider = new Scrollbar(Scrollbar.HORIZONTAL); + + protected TextField thresholdValue = new TextField(20); + + protected Frame frame; + + protected Button ok = new Button(); + + protected Button cancel = new Button(); + + /** + * enabled if the user is dragging the slider - try to keep updates to a + * minimun + */ + protected boolean sliderDragging = false; + + + public AnnotationRowFilter(AlignViewport av, final AlignmentPanel ap) + { + this.av = av; + this.ap = ap; + } + + public AnnotationRowFilter() + { + + } + + + public Vector getAnnotationItems(boolean isSeqAssociated) + { + Vector list = new Vector(); + int index = 1; + int[] anmap = new int[av.getAlignment().getAlignmentAnnotation().length]; + for (int i = 0; i < av.getAlignment().getAlignmentAnnotation().length; i++) + { + if (av.getAlignment().getAlignmentAnnotation()[i].sequenceRef == null) + { + if (isSeqAssociated) + { + continue; + } + } + else + { + enableSeqAss = true; + } + String label = av.getAlignment().getAlignmentAnnotation()[i].label; + if (!list.contains(label)) + { + anmap[list.size()] = i; + list.add(label); + + } + else + { + if (!isSeqAssociated) + { + anmap[list.size()] = i; + list.add(label + "_" + (index++)); + } + } + } + this.annmap = new int[list.size()]; + System.arraycopy(anmap, 0, this.annmap, 0, this.annmap.length); + return list; + } + + protected int getSelectedThresholdItem(int indexValue) + { + int selectedThresholdItem = -1; + if (indexValue == 1) + { + selectedThresholdItem = AnnotationColourGradient.ABOVE_THRESHOLD; + } + else if (indexValue == 2) + { + selectedThresholdItem = AnnotationColourGradient.BELOW_THRESHOLD; + } + return selectedThresholdItem; + } + + public void modelChanged() + { + seqAssociated.setEnabled(enableSeqAss); + } + + public void ok_actionPerformed(ActionEvent e) + { + updateView(); + frame.setVisible(false); + } + + public void cancel_actionPerformed(ActionEvent e) + { + reset(); + ap.paintAlignment(true); + frame.setVisible(false); + } + + public void thresholdCheck_actionPerformed(ActionEvent e) + { + updateView(); + } + + public void annotations_actionPerformed(ActionEvent e) + { + updateView(); + } + + public void threshold_actionPerformed(ActionEvent e) + { + updateView(); + } + + public void thresholdValue_actionPerformed(ActionEvent e) + { + try + { + float f = Float.parseFloat(thresholdValue.getText()); + slider.setValue((int) (f * 1000)); + updateView(); + } catch (NumberFormatException ex) + { + } + } + + + protected void populateThresholdComboBox(Choice threshold) + { + threshold.addItem(MessageManager + .getString("label.threshold_feature_no_thereshold")); + threshold.addItem(MessageManager + .getString("label.threshold_feature_above_thereshold")); + threshold.addItem(MessageManager + .getString("label.threshold_feature_below_thereshold")); + } + + + public jalview.datamodel.AlignmentAnnotation getCurrentAnnotation() + { + return currentAnnotation; + } + + public void setCurrentAnnotation( + jalview.datamodel.AlignmentAnnotation currentAnnotation) + { + this.currentAnnotation = currentAnnotation; + } + + public abstract void valueChanged(boolean updateAllAnnotation); + + public abstract void updateView(); + + public abstract void reset(); +} \ No newline at end of file diff --git a/src/jalview/appletgui/AppletJmol.java b/src/jalview/appletgui/AppletJmol.java index 0db3e30..4dcb5d7 100644 --- a/src/jalview/appletgui/AppletJmol.java +++ b/src/jalview/appletgui/AppletJmol.java @@ -552,7 +552,7 @@ public class AppletJmol extends EmbmenuFrame implements else if (evt.getSource() == seqColour) { setEnabled(seqColour); - jmb.colourBySequence(ap.av.getShowSequenceFeatures(), ap); + jmb.colourBySequence(ap.av.isShowSequenceFeatures(), ap); } else if (!allChainsSelected) { @@ -582,7 +582,7 @@ public class AppletJmol extends EmbmenuFrame implements public void updateColours(Object source) { AlignmentPanel ap = (AlignmentPanel) source; - jmb.colourBySequence(ap.av.getShowSequenceFeatures(), ap); + jmb.colourBySequence(ap.av.isShowSequenceFeatures(), ap); } public void updateTitleAndMenus() @@ -593,7 +593,7 @@ public class AppletJmol extends EmbmenuFrame implements return; } setChainMenuItems(jmb.chainNames); - jmb.colourBySequence(ap.av.getShowSequenceFeatures(), ap); + jmb.colourBySequence(ap.av.isShowSequenceFeatures(), ap); setTitle(jmb.getViewerTitle()); } diff --git a/src/jalview/appletgui/AppletJmolBinding.java b/src/jalview/appletgui/AppletJmolBinding.java index e22e20a..ff1f5b2 100644 --- a/src/jalview/appletgui/AppletJmolBinding.java +++ b/src/jalview/appletgui/AppletJmolBinding.java @@ -52,7 +52,7 @@ class AppletJmolBinding extends jalview.ext.jmol.JalviewJmolBinding AlignmentViewPanel alignment) { AlignmentPanel ap = (AlignmentPanel) alignment; - if (appletJmolBinding.ap.av.showSequenceFeatures) + if (appletJmolBinding.ap.av.isShowSequenceFeatures()) { if (appletJmolBinding.fr == null) { @@ -107,7 +107,7 @@ class AppletJmolBinding extends jalview.ext.jmol.JalviewJmolBinding public void updateColours(Object source) { AlignmentPanel ap = (AlignmentPanel) source; - colourBySequence(ap.av.getShowSequenceFeatures(), ap); + colourBySequence(ap.av.isShowSequenceFeatures(), ap); } public void showUrl(String url) diff --git a/src/jalview/appletgui/CutAndPasteTransfer.java b/src/jalview/appletgui/CutAndPasteTransfer.java index 636dd7f..0a9ca56 100644 --- a/src/jalview/appletgui/CutAndPasteTransfer.java +++ b/src/jalview/appletgui/CutAndPasteTransfer.java @@ -20,14 +20,28 @@ */ package jalview.appletgui; -import java.awt.*; -import java.awt.event.*; - -import jalview.datamodel.*; -import jalview.io.*; +import jalview.datamodel.Alignment; +import jalview.datamodel.PDBEntry; +import jalview.datamodel.Sequence; +import jalview.io.AnnotationFile; +import jalview.io.AppletFormatAdapter; +import jalview.io.IdentifyFile; +import jalview.io.TCoffeeScoreFile; import jalview.schemes.TCoffeeColourScheme; import jalview.util.MessageManager; +import java.awt.BorderLayout; +import java.awt.Button; +import java.awt.Dialog; +import java.awt.Font; +import java.awt.Frame; +import java.awt.Panel; +import java.awt.TextArea; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; + public class CutAndPasteTransfer extends Panel implements ActionListener, MouseListener { @@ -132,12 +146,15 @@ public class CutAndPasteTransfer extends Panel implements ActionListener, pdb.setFile(text); if (alignFrame.alignPanel.av.applet.jmolAvailable) + { new jalview.appletgui.AppletJmol(pdb, new Sequence[] { seq }, null, alignFrame.alignPanel, AppletFormatAdapter.PASTE); + } else - + { new MCview.AppletPDBViewer(pdb, new Sequence[] { seq }, null, alignFrame.alignPanel, AppletFormatAdapter.PASTE); + } } else if (treeImport) @@ -203,8 +220,8 @@ public class CutAndPasteTransfer extends Panel implements ActionListener, } if (tcf == null) { - if (new AnnotationFile().readAnnotationFile( - alignFrame.viewport.getAlignment(), textarea.getText(), + if (new AnnotationFile().annotateAlignmentView(alignFrame.viewport, + textarea.getText(), jalview.io.AppletFormatAdapter.PASTE)) { alignFrame.alignPanel.fontChanged(); diff --git a/src/jalview/appletgui/ExtJmol.java b/src/jalview/appletgui/ExtJmol.java index 58bd5a6..cb99f87 100644 --- a/src/jalview/appletgui/ExtJmol.java +++ b/src/jalview/appletgui/ExtJmol.java @@ -78,7 +78,7 @@ public class ExtJmol extends JalviewJmolBinding public FeatureRenderer getFeatureRenderer(AlignmentViewPanel alignment) { AlignmentPanel ap = (AlignmentPanel) alignment; - if (ap.av.showSequenceFeatures) + if (ap.av.isShowSequenceFeatures()) { return ap.getFeatureRenderer(); } diff --git a/src/jalview/appletgui/FeatureColourChooser.java b/src/jalview/appletgui/FeatureColourChooser.java index 32ffdbf..c87803c 100644 --- a/src/jalview/appletgui/FeatureColourChooser.java +++ b/src/jalview/appletgui/FeatureColourChooser.java @@ -73,10 +73,10 @@ public class FeatureColourChooser extends Panel implements ActionListener, { this.type = type; fr = frenderer; - float mm[] = ((float[][]) fr.minmax.get(type))[0]; + float mm[] = ((float[][]) fr.getMinMax().get(type))[0]; min = mm[0]; max = mm[1]; - oldcs = fr.featureColours.get(type); + oldcs = fr.getFeatureColours().get(type); if (oldcs instanceof GraduatedColor) { cs = new GraduatedColor((GraduatedColor) oldcs, min, max); @@ -130,7 +130,7 @@ public class FeatureColourChooser extends Panel implements ActionListener, { // cancel reset(); - PaintRefresher.Refresh(this, fr.av.getSequenceSetId()); + PaintRefresher.Refresh(this, fr.getViewport().getSequenceSetId()); frame.setVisible(false); } } @@ -289,7 +289,7 @@ public class FeatureColourChooser extends Panel implements ActionListener, threshline.value = (float) slider.getValue() / 1000f; cs.setThresh(threshline.value); changeColour(); - PaintRefresher.Refresh(this, fr.av.getSequenceSetId()); + PaintRefresher.Refresh(this, fr.getViewport().getSequenceSetId()); // ap.paintAlignment(false); } @@ -402,16 +402,16 @@ public class FeatureColourChooser extends Panel implements ActionListener, } } - fr.featureColours.put(type, acg); + fr.setColour(type, acg); cs = acg; - PaintRefresher.Refresh(this, fr.av.getSequenceSetId()); + PaintRefresher.Refresh(this, fr.getViewport().getSequenceSetId()); // ap.paintAlignment(false); } void reset() { - fr.featureColours.put(type, oldcs); - PaintRefresher.Refresh(this, fr.av.getSequenceSetId()); + fr.setColour(type, oldcs); + PaintRefresher.Refresh(this, fr.getViewport().getSequenceSetId()); // ap.paintAlignment(true); } @@ -433,7 +433,7 @@ public class FeatureColourChooser extends Panel implements ActionListener, } else { - PaintRefresher.Refresh(this, fr.av.getSequenceSetId()); + PaintRefresher.Refresh(this, fr.getViewport().getSequenceSetId()); } // ap.paintAlignment(true); } diff --git a/src/jalview/appletgui/FeatureRenderer.java b/src/jalview/appletgui/FeatureRenderer.java index 29c3ac5..dd2b873 100644 --- a/src/jalview/appletgui/FeatureRenderer.java +++ b/src/jalview/appletgui/FeatureRenderer.java @@ -21,15 +21,14 @@ package jalview.appletgui; import java.util.*; - import java.awt.*; - import java.awt.event.*; import jalview.datamodel.*; import jalview.schemes.AnnotationColourGradient; import jalview.schemes.GraduatedColor; import jalview.util.MessageManager; +import jalview.viewmodel.seqfeatures.FeaturesDisplayed; /** * DOCUMENT ME! @@ -37,34 +36,13 @@ import jalview.util.MessageManager; * @author $author$ * @version $Revision$ */ -public class FeatureRenderer implements jalview.api.FeatureRenderer +public class FeatureRenderer extends jalview.renderer.seqfeatures.FeatureRenderer { - AlignViewport av; - - Hashtable featureColours = new Hashtable(); - - // A higher level for grouping features of a - // particular type - Hashtable featureGroups = null; // Holds web links for feature groups and feature types // in the form label|link Hashtable featureLinks = null; - // This is actually an Integer held in the hashtable, - // Retrieved using the key feature type - Object currentColour; - - String[] renderOrder; - - FontMetrics fm; - - int charOffset; - - float transparency = 1f; - - TransparencySetter transparencySetter = null; - /** * Creates a new FeatureRenderer object. * @@ -73,39 +51,10 @@ public class FeatureRenderer implements jalview.api.FeatureRenderer */ public FeatureRenderer(AlignViewport av) { + super(); this.av = av; - if (!System.getProperty("java.version").startsWith("1.1")) - { - transparencySetter = new TransparencySetter(); - } - } - - public void transferSettings(FeatureRenderer fr) - { - renderOrder = fr.renderOrder; - featureGroups = fr.featureGroups; - featureColours = fr.featureColours; - transparency = fr.transparency; - if (av != null && fr.av != null && fr.av != av) - { - if (fr.av.featuresDisplayed != null) - { - if (av.featuresDisplayed == null) - { - av.featuresDisplayed = new Hashtable(); - } - else - { - av.featuresDisplayed.clear(); - } - Enumeration en = fr.av.featuresDisplayed.keys(); - while (en.hasMoreElements()) - { - av.featuresDisplayed.put(en.nextElement(), Boolean.TRUE); - } - } - } + setTransparencyAvailable(!System.getProperty("java.version").startsWith("1.1")); } static String lastFeatureAdded; @@ -452,6 +401,7 @@ public class FeatureRenderer implements jalview.api.FeatureRenderer } ffile.parseDescriptionHTML(sf, false); + setVisible(lastFeatureAdded); // if user edited name then make sure new type is visible } if (deleteFeature) { @@ -472,36 +422,17 @@ public class FeatureRenderer implements jalview.api.FeatureRenderer ffile.parseDescriptionHTML(features[i], false); } - if (av.featuresDisplayed == null) - { - av.featuresDisplayed = new Hashtable(); - } - - if (featureGroups == null) - { - featureGroups = new Hashtable(); - } - col = colourPanel.getBackground(); // setColour(lastFeatureAdded, fcol); if (lastFeatureGroupAdded != null) { - featureGroups.put(lastFeatureGroupAdded, new Boolean(true)); - } - if (fcol instanceof Color) - { - setColour(lastFeatureAdded, fcol); + setGroupVisibility(lastFeatureGroupAdded, true); } - av.featuresDisplayed.put(lastFeatureAdded, - getFeatureStyle(lastFeatureAdded)); - - findAllFeatures(); - - String[] tro = new String[renderOrder.length]; - tro[0] = renderOrder[renderOrder.length - 1]; - System.arraycopy(renderOrder, 0, tro, 1, renderOrder.length - 1); - renderOrder = tro; + setColour(lastFeatureAdded, fcol); + setVisible(lastFeatureAdded); + findAllFeatures(false); // different to original applet behaviour ? + // findAllFeatures(); } else { @@ -510,9 +441,9 @@ public class FeatureRenderer implements jalview.api.FeatureRenderer } } // refresh the alignment and the feature settings dialog - if (av.featureSettings != null) + if (((jalview.appletgui.AlignViewport) av).featureSettings != null) { - av.featureSettings.refreshTable(); + ((jalview.appletgui.AlignViewport) av).featureSettings.refreshTable(); } // findAllFeatures(); @@ -520,759 +451,4 @@ public class FeatureRenderer implements jalview.api.FeatureRenderer return true; } - - public Color findFeatureColour(Color initialCol, SequenceI seq, int i) - { - overview = true; - if (!av.showSequenceFeatures) - { - return initialCol; - } - - lastSeq = seq; - sequenceFeatures = lastSeq.getSequenceFeatures(); - if (sequenceFeatures == null) - { - return initialCol; - } - - sfSize = sequenceFeatures.length; - - if (jalview.util.Comparison.isGap(lastSeq.getCharAt(i))) - { - return Color.white; - } - - currentColour = null; - - drawSequence(null, lastSeq, lastSeq.findPosition(i), -1, -1); - - if (currentColour == null) - { - return initialCol; - } - - return new Color(((Integer) currentColour).intValue()); - } - - /** - * This is used by the Molecule Viewer to get the accurate colour of the - * rendered sequence - */ - boolean overview = false; - - /** - * DOCUMENT ME! - * - * @param g - * DOCUMENT ME! - * @param seq - * DOCUMENT ME! - * @param sg - * DOCUMENT ME! - * @param start - * DOCUMENT ME! - * @param end - * DOCUMENT ME! - * @param x1 - * DOCUMENT ME! - * @param y1 - * DOCUMENT ME! - * @param width - * DOCUMENT ME! - * @param height - * DOCUMENT ME! - */ - // String type; - // SequenceFeature sf; - SequenceI lastSeq; - - SequenceFeature[] sequenceFeatures; - - int sfSize, sfindex, spos, epos; - - synchronized public void drawSequence(Graphics g, SequenceI seq, - int start, int end, int y1) - { - if (seq.getSequenceFeatures() == null - || seq.getSequenceFeatures().length == 0) - { - return; - } - - if (transparencySetter != null && g != null) - { - transparencySetter.setTransparency(g, transparency); - } - - if (lastSeq == null || seq != lastSeq - || sequenceFeatures != seq.getSequenceFeatures()) - { - lastSeq = seq; - sequenceFeatures = seq.getSequenceFeatures(); - sfSize = sequenceFeatures.length; - } - - if (av.featuresDisplayed == null || renderOrder == null) - { - findAllFeatures(); - if (av.featuresDisplayed.size() < 1) - { - return; - } - - sequenceFeatures = seq.getSequenceFeatures(); - sfSize = sequenceFeatures.length; - } - if (!overview) - { - spos = lastSeq.findPosition(start); - epos = lastSeq.findPosition(end); - if (g != null) - { - fm = g.getFontMetrics(); - } - } - String type; - for (int renderIndex = 0; renderIndex < renderOrder.length; renderIndex++) - { - type = renderOrder[renderIndex]; - if (!av.featuresDisplayed.containsKey(type)) - { - continue; - } - - // loop through all features in sequence to find - // current feature to render - for (sfindex = 0; sfindex < sfSize; sfindex++) - { - if (!sequenceFeatures[sfindex].type.equals(type)) - { - continue; - } - - if (featureGroups != null - && sequenceFeatures[sfindex].featureGroup != null - && featureGroups - .containsKey(sequenceFeatures[sfindex].featureGroup) - && !((Boolean) featureGroups - .get(sequenceFeatures[sfindex].featureGroup)) - .booleanValue()) - { - continue; - } - - if (!overview - && (sequenceFeatures[sfindex].getBegin() > epos || sequenceFeatures[sfindex] - .getEnd() < spos)) - { - continue; - } - - if (overview) - { - if (sequenceFeatures[sfindex].begin <= start - && sequenceFeatures[sfindex].end >= start) - { - currentColour = new Integer( - getColour(sequenceFeatures[sfindex]).getRGB());// av.featuresDisplayed - // .get(sequenceFeatures[sfindex].type); - } - - } - else if (sequenceFeatures[sfindex].type.equals("disulfide bond")) - { - - renderFeature(g, seq, - seq.findIndex(sequenceFeatures[sfindex].begin) - 1, - seq.findIndex(sequenceFeatures[sfindex].begin) - 1, - getColour(sequenceFeatures[sfindex]) - // new Color(((Integer) av.featuresDisplayed - // .get(sequenceFeatures[sfindex].type)).intValue()) - , start, end, y1); - renderFeature(g, seq, - seq.findIndex(sequenceFeatures[sfindex].end) - 1, - seq.findIndex(sequenceFeatures[sfindex].end) - 1, - getColour(sequenceFeatures[sfindex]) - // new Color(((Integer) av.featuresDisplayed - // .get(sequenceFeatures[sfindex].type)).intValue()) - , start, end, y1); - - } - else - { - if (showFeature(sequenceFeatures[sfindex])) - { - renderFeature(g, seq, - seq.findIndex(sequenceFeatures[sfindex].begin) - 1, - seq.findIndex(sequenceFeatures[sfindex].end) - 1, - getColour(sequenceFeatures[sfindex]), start, end, y1); - } - } - - } - } - - if (transparencySetter != null && g != null) - { - transparencySetter.setTransparency(g, 1.0f); - } - } - - char s; - - int i; - - void renderFeature(Graphics g, SequenceI seq, int fstart, int fend, - Color featureColour, int start, int end, int y1) - { - - if (((fstart <= end) && (fend >= start))) - { - if (fstart < start) - { // fix for if the feature we have starts before the sequence start, - fstart = start; // but the feature end is still valid!! - } - - if (fend >= end) - { - fend = end; - } - - for (i = fstart; i <= fend; i++) - { - s = seq.getCharAt(i); - - if (jalview.util.Comparison.isGap(s)) - { - continue; - } - - g.setColor(featureColour); - - g.fillRect((i - start) * av.charWidth, y1, av.charWidth, - av.charHeight); - - if (!av.validCharWidth) - { - continue; - } - - g.setColor(Color.white); - charOffset = (av.charWidth - fm.charWidth(s)) / 2; - g.drawString(String.valueOf(s), charOffset - + (av.charWidth * (i - start)), (y1 + av.charHeight) - - av.charHeight / 5); // pady = height / 5; - - } - } - } - - Hashtable minmax = null; - - /** - * Called when alignment in associated view has new/modified features to - * discover and display. - * - */ - public void featuresAdded() - { - lastSeq = null; - findAllFeatures(); - } - - /** - * find all features on the alignment - */ - void findAllFeatures() - { - jalview.schemes.UserColourScheme ucs = new jalview.schemes.UserColourScheme(); - - av.featuresDisplayed = new Hashtable(); - Vector allfeatures = new Vector(); - minmax = new Hashtable(); - AlignmentI alignment = av.getAlignment(); - for (int i = 0; i < alignment.getHeight(); i++) - { - SequenceFeature[] features = alignment.getSequenceAt(i) - .getSequenceFeatures(); - - if (features == null) - { - continue; - } - - int index = 0; - while (index < features.length) - { - if (features[index].begin == 0 && features[index].end == 0) - { - index++; - continue; - } - if (!av.featuresDisplayed.containsKey(features[index].getType())) - { - if (getColour(features[index].getType()) == null) - { - featureColours.put(features[index].getType(), - ucs.createColourFromName(features[index].getType())); - } - - av.featuresDisplayed.put(features[index].getType(), new Integer( - getColour(features[index].getType()).getRGB())); - allfeatures.addElement(features[index].getType()); - } - if (features[index].score != Float.NaN) - { - int nonpos = features[index].getBegin() >= 1 ? 0 : 1; - float[][] mm = (float[][]) minmax.get(features[index].getType()); - if (mm == null) - { - mm = new float[][] - { null, null }; - minmax.put(features[index].getType(), mm); - } - if (mm[nonpos] == null) - { - mm[nonpos] = new float[] - { features[index].score, features[index].score }; - - } - else - { - if (mm[nonpos][0] > features[index].score) - { - mm[nonpos][0] = features[index].score; - } - if (mm[nonpos][1] < features[index].score) - { - mm[nonpos][1] = features[index].score; - } - } - } - - index++; - } - } - - renderOrder = new String[allfeatures.size()]; - Enumeration en = allfeatures.elements(); - int i = allfeatures.size() - 1; - while (en.hasMoreElements()) - { - renderOrder[i] = en.nextElement().toString(); - i--; - } - } - - /** - * get a feature style object for the given type string. Creates a - * java.awt.Color for a featureType with no existing colourscheme. TODO: - * replace return type with object implementing standard abstract colour/style - * interface - * - * @param featureType - * @return java.awt.Color or GraduatedColor - */ - public Object getFeatureStyle(String featureType) - { - Object fc = featureColours.get(featureType); - if (fc == null) - { - jalview.schemes.UserColourScheme ucs = new jalview.schemes.UserColourScheme(); - Color col = ucs.createColourFromName(featureType); - featureColours.put(featureType, fc = col); - } - return fc; - } - - public Color getColour(String featureType) - { - Object fc = getFeatureStyle(featureType); - - if (fc instanceof Color) - { - return (Color) fc; - } - else - { - if (fc instanceof GraduatedColor) - { - return ((GraduatedColor) fc).getMaxColor(); - } - } - throw new Error(MessageManager.formatMessage("error.implementation_error_unrecognised_render_object_for_features_type", new String[]{fc.getClass().getCanonicalName(),featureType})); - } - - /** - * - * @param sequenceFeature - * @return true if feature is visible. - */ - private boolean showFeature(SequenceFeature sequenceFeature) - { - Object fc = getFeatureStyle(sequenceFeature.type); - if (fc instanceof GraduatedColor) - { - return ((GraduatedColor) fc).isColored(sequenceFeature); - } - else - { - return true; - } - } - - /** - * implement graduated colouring for features with scores - * - * @param feature - * @return render colour for the given feature - */ - public Color getColour(SequenceFeature feature) - { - Object fc = getFeatureStyle(feature.getType()); - if (fc instanceof Color) - { - return (Color) fc; - } - else - { - if (fc instanceof GraduatedColor) - { - return ((GraduatedColor) fc).findColor(feature); - } - } - throw new Error("Implementation Error: Unrecognised render object " - + fc.getClass() + " for features of type " + feature.getType()); - } - - public void setColour(String featureType, Object col) - { - // overwrite - // Color _col = (col instanceof Color) ? ((Color) col) : (col instanceof - // GraduatedColor) ? ((GraduatedColor) col).getMaxColor() : null; - // Object c = featureColours.get(featureType); - // if (c == null || c instanceof Color || (c instanceof GraduatedColor && - // !((GraduatedColor)c).getMaxColor().equals(_col))) - { - featureColours.put(featureType, col); - } - } - - public void setFeaturePriority(Object[][] data) - { - // The feature table will display high priority - // features at the top, but theses are the ones - // we need to render last, so invert the data - if (av.featuresDisplayed != null) - { - av.featuresDisplayed.clear(); - } - - /* - * if (visibleNew) { if (av.featuresDisplayed != null) { - * av.featuresDisplayed.clear(); } else { av.featuresDisplayed = new - * Hashtable(); } } if (data == null) { return; } - */ - - renderOrder = new String[data.length]; - - if (data.length > 0) - { - for (int i = 0; i < data.length; i++) - { - String type = data[i][0].toString(); - setColour(type, data[i][1]); - if (((Boolean) data[i][2]).booleanValue()) - { - av.featuresDisplayed.put(type, new Integer(getColour(type) - .getRGB())); - } - - renderOrder[data.length - i - 1] = type; - } - } - } - - /** - * @return a simple list of feature group names or null - */ - public String[] getGroups() - { - buildGroupHash(); - if (featureGroups != null) - { - String[] gps = new String[featureGroups.size()]; - Enumeration gn = featureGroups.keys(); - int i = 0; - while (gn.hasMoreElements()) - { - gps[i++] = (String) gn.nextElement(); - } - return gps; - } - return null; - } - - /** - * get visible or invisible groups - * - * @param visible - * true to return visible groups, false to return hidden ones. - * @return list of groups - */ - public String[] getGroups(boolean visible) - { - buildGroupHash(); - if (featureGroups != null) - { - Vector gp = new Vector(); - - Enumeration gn = featureGroups.keys(); - while (gn.hasMoreElements()) - { - String nm = (String) gn.nextElement(); - Boolean state = (Boolean) featureGroups.get(nm); - if (state.booleanValue() == visible) - { - gp.addElement(nm); - } - } - String[] gps = new String[gp.size()]; - gp.copyInto(gps); - - int i = 0; - while (gn.hasMoreElements()) - { - gps[i++] = (String) gn.nextElement(); - } - return gps; - } - return null; - } - - /** - * set all feature groups in toset to be visible or invisible - * - * @param toset - * group names - * @param visible - * the state of the named groups to set - */ - public void setGroupState(String[] toset, boolean visible) - { - buildGroupHash(); - if (toset != null && toset.length > 0 && featureGroups != null) - { - boolean rdrw = false; - for (int i = 0; i < toset.length; i++) - { - Object st = featureGroups.get(toset[i]); - featureGroups.put(toset[i], new Boolean(visible)); - if (st != null) - { - rdrw = rdrw || (visible != ((Boolean) st).booleanValue()); - } - } - if (rdrw) - { - if (this.av != null) - if (this.av.featureSettings != null) - { - av.featureSettings.rebuildGroups(); - this.av.featureSettings.resetTable(true); - } - else - { - buildFeatureHash(); - } - if (av != null) - { - av.alignmentChanged(null); - } - } - } - } - - ArrayList hiddenGroups = new ArrayList(); - - /** - * analyse alignment for groups and hash tables (used to be embedded in - * FeatureSettings.setTableData) - * - * @return true if features are on the alignment - */ - public boolean buildGroupHash() - { - boolean alignmentHasFeatures = false; - if (featureGroups == null) - { - featureGroups = new Hashtable(); - } - hiddenGroups = new ArrayList(); - hiddenGroups.addAll(featureGroups.keySet()); - ArrayList allFeatures = new ArrayList(); - ArrayList allGroups = new ArrayList(); - SequenceFeature[] tmpfeatures; - String group; - AlignmentI alignment = av.getAlignment(); - for (int i = 0; i < alignment.getHeight(); i++) - { - if (alignment.getSequenceAt(i).getSequenceFeatures() == null) - { - continue; - } - - alignmentHasFeatures = true; - - tmpfeatures = alignment.getSequenceAt(i).getSequenceFeatures(); - int index = 0; - while (index < tmpfeatures.length) - { - if (tmpfeatures[index].getFeatureGroup() != null) - { - group = tmpfeatures[index].featureGroup; - // Remove group from the hiddenGroup list - hiddenGroups.remove(group); - if (!allGroups.contains(group)) - { - allGroups.add(group); - - boolean visible = true; - if (featureGroups.containsKey(group)) - { - visible = ((Boolean) featureGroups.get(group)).booleanValue(); - } - else - { - featureGroups.put(group, new Boolean(visible)); - } - } - } - - if (!allFeatures.contains(tmpfeatures[index].getType())) - { - allFeatures.add(tmpfeatures[index].getType()); - } - index++; - } - } - - return alignmentHasFeatures; - } - - /** - * rebuild the featuresDisplayed and renderorder list based on the - * featureGroups hash and any existing display state and force a repaint if - * necessary - * - * @return true if alignment has visible features - */ - public boolean buildFeatureHash() - { - boolean alignmentHasFeatures = false; - if (featureGroups == null) - { - alignmentHasFeatures = buildGroupHash(); - } - if (!alignmentHasFeatures) - return false; - Hashtable fdisp = av.featuresDisplayed; - Vector allFeatures = new Vector(); - SequenceFeature[] tmpfeatures; - String group; - AlignmentI alignment = av.getAlignment(); - for (int i = 0; i < alignment.getHeight(); i++) - { - if (alignment.getSequenceAt(i).getSequenceFeatures() == null) - { - continue; - } - - alignmentHasFeatures = true; - - tmpfeatures = alignment.getSequenceAt(i).getSequenceFeatures(); - int index = 0; - while (index < tmpfeatures.length) - { - boolean visible = true; - if (tmpfeatures[index].getFeatureGroup() != null) - { - group = tmpfeatures[index].featureGroup; - if (featureGroups.containsKey(group)) - { - visible = ((Boolean) featureGroups.get(group)).booleanValue(); - } - } - - if (visible && !allFeatures.contains(tmpfeatures[index].getType())) - { - allFeatures.addElement(tmpfeatures[index].getType()); - } - index++; - } - } - if (allFeatures.size() > 0) - { - String[] neworder = new String[allFeatures.size()]; - int p = neworder.length - 1; - for (int i = renderOrder.length - 1; i >= 0; i--) - { - if (allFeatures.contains(renderOrder[i])) - { - neworder[p--] = renderOrder[i]; - allFeatures.removeElement(renderOrder[i]); - } - else - { - av.featuresDisplayed.remove(renderOrder[i]); - } - } - for (int i = allFeatures.size() - 1; i > 0; i++) - { - Object e = allFeatures.elementAt(i); - if (e != null) - { - neworder[p--] = (String) e; - av.featuresDisplayed.put(e, getColour((String) e)); - } - } - renderOrder = neworder; - return true; - } - - return alignmentHasFeatures; - } - - /** - * - * @return the displayed feature type as an array of strings - */ - protected String[] getDisplayedFeatureTypes() - { - String[] typ = null; - synchronized (renderOrder) - { - typ = new String[renderOrder.length]; - System.arraycopy(renderOrder, 0, typ, 0, typ.length); - for (int i = 0; i < typ.length; i++) - { - if (av.featuresDisplayed.get(typ[i]) == null) - { - typ[i] = null; - } - } - } - return typ; - } -} - -class TransparencySetter -{ - void setTransparency(Graphics g, float value) - { - Graphics2D g2 = (Graphics2D) g; - g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, - value)); - } } diff --git a/src/jalview/appletgui/FeatureSettings.java b/src/jalview/appletgui/FeatureSettings.java index cd11a35..4b29f53 100755 --- a/src/jalview/appletgui/FeatureSettings.java +++ b/src/jalview/appletgui/FeatureSettings.java @@ -21,7 +21,7 @@ package jalview.appletgui; import java.util.*; - +import java.util.List; import java.awt.*; import java.awt.event.*; @@ -50,8 +50,6 @@ public class FeatureSettings extends Panel implements ItemListener, ScrollPane scrollPane; - boolean alignmentHasFeatures = false; - Image linkImage; Scrollbar transparency; @@ -64,9 +62,9 @@ public class FeatureSettings extends Panel implements ItemListener, fr = ap.seqPanel.seqCanvas.getFeatureRenderer(); transparency = new Scrollbar(Scrollbar.HORIZONTAL, - 100 - (int) (fr.transparency * 100), 1, 1, 100); + 100 - (int) (fr.getTransparency() * 100), 1, 1, 100); - if (fr.transparencySetter != null) + if (fr.isTransparencyAvailable()) { transparency.addAdjustmentListener(this); } @@ -81,9 +79,9 @@ public class FeatureSettings extends Panel implements ItemListener, linkImage = java.awt.Toolkit.getDefaultToolkit().getImage(url); } - if (av.featuresDisplayed == null) + if (av.isShowSequenceFeatures() || !fr.hasRenderOrder()) { - fr.findAllFeatures(); + fr.findAllFeatures(true); // was default - now true to make all visible } setTableData(); @@ -91,7 +89,7 @@ public class FeatureSettings extends Panel implements ItemListener, this.setLayout(new BorderLayout()); scrollPane = new ScrollPane(); scrollPane.add(featurePanel); - if (alignmentHasFeatures) + if (fr.getAllFeatureColours()!=null && fr.getAllFeatureColours().size()>0) { add(scrollPane, BorderLayout.CENTER); } @@ -104,7 +102,7 @@ public class FeatureSettings extends Panel implements ItemListener, Panel tPanel = new Panel(new BorderLayout()); - if (fr.transparencySetter != null) + if (fr.isTransparencyAvailable()) { tPanel.add(transparency, BorderLayout.CENTER); tPanel.add(new Label("Transparency"), BorderLayout.EAST); @@ -124,8 +122,8 @@ public class FeatureSettings extends Panel implements ItemListener, { groupPanel .setLayout(new GridLayout( - (fr.featureGroups.size() - fr.hiddenGroups.size()) / 4 + 1, - 4)); + (fr.getFeatureGroupsSize()) / 4 + 1, + 4)); // JBPNote - this was scaled on number of visible groups. seems broken groupPanel.validate(); add(groupPanel, BorderLayout.NORTH); @@ -185,7 +183,7 @@ public class FeatureSettings extends Panel implements ItemListener, public void actionPerformed(ActionEvent e) { - me.sortByScore(new String[] + me.ap.alignFrame.avc.sortAlignmentByFeatureScore(new String[] { type }); } @@ -197,7 +195,7 @@ public class FeatureSettings extends Panel implements ItemListener, public void actionPerformed(ActionEvent e) { - me.sortByDens(new String[] + me.ap.alignFrame.avc.sortAlignmentByFeatureDensity(new String[] { type }); } @@ -253,8 +251,7 @@ public class FeatureSettings extends Panel implements ItemListener, public void setTableData() { - alignmentHasFeatures = fr.buildGroupHash(); - if (alignmentHasFeatures) + if (fr.getAllFeatureColours()!=null && fr.getAllFeatureColours().size()>0) { rebuildGroups(); @@ -279,18 +276,17 @@ public class FeatureSettings extends Panel implements ItemListener, } // TODO: JAL-964 - smoothly incorporate new group entries if panel already // displayed and new groups present - Enumeration gps = fr.featureGroups.keys(); - while (gps.hasMoreElements()) + for (String group:(List)fr.getFeatureGroups()) { - String group = (String) gps.nextElement(); - Boolean vis = (Boolean) fr.featureGroups.get(group); - Checkbox check = new MyCheckbox(group, vis.booleanValue(), + boolean vis = fr.checkGroupVisibility(group, false); + Checkbox check = new MyCheckbox(group, vis, (fr.featureLinks != null && fr.featureLinks .containsKey(group))); check.addMouseListener(this); check.setFont(new Font("Serif", Font.BOLD, 12)); - check.addItemListener(this); - check.setVisible(fr.hiddenGroups.contains(group)); + check.addItemListener(groupItemListener); + // note - visibility seems to correlate with displayed. ???wtf ?? + check.setVisible(vis); groupPanel.add(check); } if (rdrw) @@ -298,7 +294,6 @@ public class FeatureSettings extends Panel implements ItemListener, groupPanel.validate(); } } - // This routine adds and removes checkboxes depending on // Group selection states void resetTable(boolean groupsChanged) @@ -320,8 +315,7 @@ public class FeatureSettings extends Panel implements ItemListener, { group = tmpfeatures[index].featureGroup; - if (group == null || fr.featureGroups.get(group) == null - || ((Boolean) fr.featureGroups.get(group)).booleanValue()) + if (group == null || fr.checkGroupVisibility(group, true)) { type = tmpfeatures[index].getType(); if (!visibleChecks.contains(type)) @@ -350,13 +344,14 @@ public class FeatureSettings extends Panel implements ItemListener, } } - if (fr.renderOrder != null) + if (fr.getRenderOrder() != null) { // First add the checks in the previous render order, // in case the window has been closed and reopened - for (int ro = fr.renderOrder.length - 1; ro > -1; ro--) + List rol = fr.getRenderOrder(); + for (int ro = rol.size() - 1; ro > -1; ro--) { - String item = fr.renderOrder[ro]; + String item = rol.get(ro); if (!visibleChecks.contains(item)) { @@ -418,7 +413,7 @@ public class FeatureSettings extends Panel implements ItemListener, if (addCheck) { boolean selected = false; - if (groupsChanged || av.featuresDisplayed.containsKey(type)) + if (groupsChanged || av.getFeaturesDisplayed().isVisible(type)) { selected = true; } @@ -455,26 +450,22 @@ public class FeatureSettings extends Panel implements ItemListener, selectionChanged(); } - public void itemStateChanged(ItemEvent evt) - { - if (evt != null) - { - // Is the source a top level featureGroup? + private ItemListener groupItemListener = new ItemListener() { + public void itemStateChanged(ItemEvent evt) { Checkbox source = (Checkbox) evt.getSource(); - if (fr.featureGroups.containsKey(source.getLabel())) + fr.setGroupVisibility(source.getLabel(), + source.getState()); + ap.seqPanel.seqCanvas.repaint(); + if (ap.overviewPanel != null) { - fr.featureGroups.put(source.getLabel(), - new Boolean(source.getState())); - ap.seqPanel.seqCanvas.repaint(); - if (ap.overviewPanel != null) - { - ap.overviewPanel.updateOverviewImage(); - } - - resetTable(true); - return; + ap.overviewPanel.updateOverviewImage(); } - } + resetTable(true); + return; + }; + }; + public void itemStateChanged(ItemEvent evt) + { selectionChanged(); } @@ -617,7 +608,7 @@ public class FeatureSettings extends Panel implements ItemListener, MyCheckbox check = (MyCheckbox) evt.getSource(); if ((evt.getModifiers() & InputEvent.BUTTON3_MASK) != 0) { - this.popupSort(check, fr.minmax, evt.getX(), evt.getY()); + this.popupSort(check, fr.getMinMax(), evt.getX(), evt.getY()); } if (fr.featureLinks != null && fr.featureLinks.containsKey(check.type)) { @@ -657,7 +648,7 @@ public class FeatureSettings extends Panel implements ItemListener, public void adjustmentValueChanged(AdjustmentEvent evt) { - fr.transparency = ((float) (100 - transparency.getValue()) / 100f); + fr.setTransparency((float) (100 - transparency.getValue()) / 100f); ap.seqPanel.seqCanvas.repaint(); } @@ -771,81 +762,4 @@ public class FeatureSettings extends Panel implements ItemListener, } } - protected void sortByDens(String[] typ) - { - sortBy(typ, "Sort by Density", AlignmentSorter.FEATURE_DENSITY); - } - - private String[] getDisplayedFeatureTypes() - { - String[] typ = null; - if (fr != null) - { - synchronized (fr.renderOrder) - { - typ = new String[fr.renderOrder.length]; - System.arraycopy(fr.renderOrder, 0, typ, 0, typ.length); - for (int i = 0; i < typ.length; i++) - { - if (av.featuresDisplayed.get(typ[i]) == null) - { - typ[i] = null; - } - } - } - } - return typ; - } - - protected void sortBy(String[] typ, String methodText, final String method) - { - if (typ == null) - { - typ = getDisplayedFeatureTypes(); - } - String gps[] = null; - gps = fr.getGroups(true); - if (typ != null) - { - for (int i = 0; i < typ.length; i++) - { - System.err.println("Sorting on Types:" + typ[i]); - } - } - if (gps != null) - { - - for (int i = 0; i < gps.length; i++) - { - System.err.println("Sorting on groups:" + gps[i]); - } - } - AlignmentPanel alignPanel = ap; - AlignmentI al = alignPanel.av.getAlignment(); - - int start, stop; - SequenceGroup sg = alignPanel.av.getSelectionGroup(); - if (sg != null) - { - start = sg.getStartRes(); - stop = sg.getEndRes(); - } - else - { - start = 0; - stop = al.getWidth(); - } - SequenceI[] oldOrder = al.getSequencesArray(); - AlignmentSorter.sortByFeature(typ, gps, start, stop, al, method); - this.ap.alignFrame.addHistoryItem(new OrderCommand(methodText, - oldOrder, alignPanel.av.getAlignment())); - alignPanel.paintAlignment(true); - - } - - protected void sortByScore(String[] typ) - { - sortBy(typ, "Sort by Feature Score", AlignmentSorter.FEATURE_SCORE); - } - } diff --git a/src/jalview/appletgui/Finder.java b/src/jalview/appletgui/Finder.java index 6ca6ddf..4796bca 100644 --- a/src/jalview/appletgui/Finder.java +++ b/src/jalview/appletgui/Finder.java @@ -113,7 +113,7 @@ public class Finder extends Panel implements ActionListener features, true, ap)) { ap.alignFrame.sequenceFeatures.setState(true); - av.showSequenceFeatures(true); + av.setShowSequenceFeatures(true); ap.highlightSearchResults(null); } } diff --git a/src/jalview/appletgui/IdCanvas.java b/src/jalview/appletgui/IdCanvas.java index 25aa315..0ac4e55 100755 --- a/src/jalview/appletgui/IdCanvas.java +++ b/src/jalview/appletgui/IdCanvas.java @@ -227,7 +227,7 @@ public class IdCanvas extends Panel SequenceI s = av.getAlignment().getSequenceAt(i); gg.setFont(italic); - if (av.hasHiddenRows()) + if (av.isDisplayReferenceSeq() || av.hasHiddenRows()) { setHiddenFont(s); } @@ -257,7 +257,7 @@ public class IdCanvas extends Panel } gg.setFont(italic); // boolean isrep=false; - if (av.hasHiddenRows()) + if (av.isDisplayReferenceSeq() || av.hasHiddenRows()) { // isrep = setHiddenFont(seq); @@ -366,8 +366,7 @@ public class IdCanvas extends Panel Font bold = new Font(av.getFont().getName(), Font.BOLD, av.getFont() .getSize()); - if (av.getHiddenRepSequences() != null - && av.getHiddenRepSequences().containsKey(seq)) + if (av.isHiddenRepSequence(seq)) { gg.setFont(bold); return true; diff --git a/src/jalview/appletgui/OverviewPanel.java b/src/jalview/appletgui/OverviewPanel.java index 2c2c41a..8486fe0 100755 --- a/src/jalview/appletgui/OverviewPanel.java +++ b/src/jalview/appletgui/OverviewPanel.java @@ -69,7 +69,6 @@ public class OverviewPanel extends Panel implements Runnable, sr.renderGaps = false; sr.forOverview = true; fr = new FeatureRenderer(av); - fr.overview = true; // scale the initial size of overviewpanel to shape of alignment float initialScale = (float) av.getAlignment().getWidth() @@ -229,10 +228,9 @@ public class OverviewPanel extends Panel implements Runnable, return; } - if (av.showSequenceFeatures) + if (av.isShowSequenceFeatures()) { - fr.featureGroups = ap.seqPanel.seqCanvas.getFeatureRenderer().featureGroups; - fr.featureColours = ap.seqPanel.seqCanvas.getFeatureRenderer().featureColours; + fr.transferSettings(ap.seqPanel.seqCanvas.fr); } resizing = true; @@ -260,7 +258,7 @@ public class OverviewPanel extends Panel implements Runnable, int alwidth = av.getAlignment().getWidth(); int alheight = av.getAlignment().getHeight(); - if (av.showSequenceFeatures) + if (av.isShowSequenceFeatures()) { fr.transferSettings(ap.seqPanel.seqCanvas.getFeatureRenderer()); } @@ -337,7 +335,7 @@ public class OverviewPanel extends Panel implements Runnable, { color = sr.getResidueBoxColour(seq, lastcol); - if (av.showSequenceFeatures) + if (av.isShowSequenceFeatures()) { color = fr.findFeatureColour(color, seq, lastcol); } diff --git a/src/jalview/appletgui/ScalePanel.java b/src/jalview/appletgui/ScalePanel.java index 60d89aa..2b6f37a 100755 --- a/src/jalview/appletgui/ScalePanel.java +++ b/src/jalview/appletgui/ScalePanel.java @@ -20,12 +20,23 @@ */ package jalview.appletgui; -import java.awt.*; -import java.awt.event.*; - -import jalview.datamodel.*; +import jalview.datamodel.ColumnSelection; +import jalview.datamodel.SequenceGroup; import jalview.util.MessageManager; +import java.awt.Color; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.MenuItem; +import java.awt.Panel; +import java.awt.PopupMenu; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.InputEvent; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.MouseMotionListener; + public class ScalePanel extends Panel implements MouseMotionListener, MouseListener { @@ -97,7 +108,7 @@ public class ScalePanel extends Panel implements MouseMotionListener, }); pop.add(item); - if (av.getColumnSelection().getHiddenColumns().size() > 1) + if (av.getColumnSelection().hasManyHiddenColumns()) { item = new MenuItem(MessageManager.getString("action.reveal_all")); item.addActionListener(new ActionListener() @@ -323,10 +334,8 @@ public class ScalePanel extends Panel implements MouseMotionListener, res = av.getColumnSelection().adjustForHiddenColumns(res); reveal = null; - for (int i = 0; i < av.getColumnSelection().getHiddenColumns().size(); i++) + for (int[] region : av.getColumnSelection().getHiddenColumns()) { - int[] region = (int[]) av.getColumnSelection().getHiddenColumns() - .elementAt(i); if (res + 1 == region[0] || res - 1 == region[1]) { reveal = region; @@ -407,18 +416,18 @@ public class ScalePanel extends Panel implements MouseMotionListener, } gg.drawLine( - (int) (((i - startx - 1) * av.charWidth) + (av.charWidth / 2)), + ((i - startx - 1) * av.charWidth) + (av.charWidth / 2), y + 2, - (int) (((i - startx - 1) * av.charWidth) + (av.charWidth / 2)), + ((i - startx - 1) * av.charWidth) + (av.charWidth / 2), y + (fm.getDescent() * 2)); } else { gg.drawLine( - (int) (((i - startx - 1) * av.charWidth) + (av.charWidth / 2)), + ((i - startx - 1) * av.charWidth) + (av.charWidth / 2), y + fm.getDescent(), - (int) (((i - startx - 1) * av.charWidth) + (av.charWidth / 2)), + ((i - startx - 1) * av.charWidth) + (av.charWidth / 2), y + (fm.getDescent() * 2)); } } diff --git a/src/jalview/appletgui/SeqCanvas.java b/src/jalview/appletgui/SeqCanvas.java index 33caf53..3d1f7e2 100755 --- a/src/jalview/appletgui/SeqCanvas.java +++ b/src/jalview/appletgui/SeqCanvas.java @@ -20,9 +20,16 @@ */ package jalview.appletgui; -import java.awt.*; +import jalview.datamodel.AlignmentI; +import jalview.datamodel.SearchResults; +import jalview.datamodel.SequenceGroup; +import jalview.datamodel.SequenceI; -import jalview.datamodel.*; +import java.awt.Color; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.Image; +import java.awt.Panel; public class SeqCanvas extends Panel { @@ -510,49 +517,52 @@ public class SeqCanvas extends Panel void drawPanel(Graphics g1, int startRes, int endRes, int startSeq, int endSeq, int offset) { + + if (!av.hasHiddenColumns()) { draw(g1, startRes, endRes, startSeq, endSeq, offset); } else { - java.util.Vector regions = av.getColumnSelection().getHiddenColumns(); int screenY = 0; int blockStart = startRes; int blockEnd = endRes; - for (int i = 0; i < regions.size(); i++) + if (av.hasHiddenColumns()) { - int[] region = (int[]) regions.elementAt(i); - int hideStart = region[0]; - int hideEnd = region[1]; - - if (hideStart <= blockStart) + for (int[] region : av.getColumnSelection().getHiddenColumns()) { - blockStart += (hideEnd - hideStart) + 1; - continue; - } + int hideStart = region[0]; + int hideEnd = region[1]; - blockEnd = hideStart - 1; + if (hideStart <= blockStart) + { + blockStart += (hideEnd - hideStart) + 1; + continue; + } - g1.translate(screenY * av.charWidth, 0); + blockEnd = hideStart - 1; - draw(g1, blockStart, blockEnd, startSeq, endSeq, offset); + g1.translate(screenY * av.charWidth, 0); - if (av.getShowHiddenMarkers()) - { - g1.setColor(Color.blue); - g1.drawLine((blockEnd - blockStart + 1) * av.charWidth - 1, - 0 + offset, (blockEnd - blockStart + 1) * av.charWidth - - 1, (endSeq - startSeq) * av.charHeight + offset); - } + draw(g1, blockStart, blockEnd, startSeq, endSeq, offset); - g1.translate(-screenY * av.charWidth, 0); - screenY += blockEnd - blockStart + 1; - blockStart = hideEnd + 1; - } + if (av.getShowHiddenMarkers()) + { + g1.setColor(Color.blue); + g1.drawLine((blockEnd - blockStart + 1) * av.charWidth - 1, + 0 + offset, (blockEnd - blockStart + 1) * av.charWidth + - 1, (endSeq - startSeq) * av.charHeight + + offset); + } + g1.translate(-screenY * av.charWidth, 0); + screenY += blockEnd - blockStart + 1; + blockStart = hideEnd + 1; + } + } if (screenY <= (endRes - startRes)) { blockEnd = blockStart + (endRes - startRes) - screenY; @@ -589,7 +599,7 @@ public class SeqCanvas extends Panel sr.drawSequence(nextSeq, av.getAlignment().findAllGroups(nextSeq), startRes, endRes, offset + ((i - startSeq) * av.charHeight)); - if (av.showSequenceFeatures) + if (av.isShowSequenceFeatures()) { fr.drawSequence(g, nextSeq, startRes, endRes, offset + ((i - startSeq) * av.charHeight)); @@ -646,7 +656,7 @@ public class SeqCanvas extends Panel if ((group == null) && (av.getAlignment().getGroups().size() > 0)) { - group = (SequenceGroup) av.getAlignment().getGroups().get(0); + group = av.getAlignment().getGroups().get(0); groupIndex = 0; } @@ -803,7 +813,7 @@ public class SeqCanvas extends Panel break; } - group = (SequenceGroup) av.getAlignment().getGroups() + group = av.getAlignment().getGroups() .get(groupIndex); } while (groupIndex < av.getAlignment().getGroups().size()); diff --git a/src/jalview/appletgui/SeqPanel.java b/src/jalview/appletgui/SeqPanel.java index 592fd4f..a95dd27 100644 --- a/src/jalview/appletgui/SeqPanel.java +++ b/src/jalview/appletgui/SeqPanel.java @@ -817,18 +817,14 @@ public class SeqPanel extends Panel implements MouseMotionListener, { for (int i = 0; i < features.length; i++) { - if (av.featuresDisplayed == null - || !av.featuresDisplayed.containsKey(features[i].getType())) + if (av.getFeaturesDisplayed() == null + || !av.getFeaturesDisplayed().isVisible(features[i].getType())) { continue; } if (features[i].featureGroup != null - && seqCanvas.fr.featureGroups != null - && seqCanvas.fr.featureGroups - .containsKey(features[i].featureGroup) - && !((Boolean) seqCanvas.fr.featureGroups - .get(features[i].featureGroup)).booleanValue()) + && !seqCanvas.fr.checkGroupVisibility(features[i].featureGroup,false)) { continue; } diff --git a/src/jalview/appletgui/SequenceRenderer.java b/src/jalview/appletgui/SequenceRenderer.java index 92d5beb..9badf43 100755 --- a/src/jalview/appletgui/SequenceRenderer.java +++ b/src/jalview/appletgui/SequenceRenderer.java @@ -230,7 +230,7 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer } char s = ' '; - + boolean srep = av.isDisplayReferenceSeq(); for (int i = start; i <= end; i++) { graphics.setColor(Color.black); @@ -255,9 +255,7 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer } if (currentSequenceGroup.getShowNonconserved()) { - // cheat - use this if we have a consensus for each group: s = - // getDisplayChar(currentSequenceGroup.getConsensus(), i, s, '.'); - s = getDisplayChar(av.getAlignmentConsensusAnnotation(), i, s, + s = getDisplayChar(srep, i, s, '.'); } } @@ -282,7 +280,7 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer } if (av.getShowUnconserved()) { - s = getDisplayChar(av.getAlignmentConsensusAnnotation(), i, s, + s = getDisplayChar(srep, i, s, '.'); } @@ -315,10 +313,12 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer } - private char getDisplayChar(AlignmentAnnotation consensus, int position, + private char getDisplayChar(final boolean usesrep, int position, char s, char c) { - char conschar = consensus.annotations[position].displayCharacter + // TODO - use currentSequenceGroup rather than alignemnt + // currentSequenceGroup.getConsensus() + char conschar = (usesrep) ? av.getAlignment().getSeqrep().getCharAt(position) : av.getAlignmentConsensusAnnotation().annotations[position].displayCharacter .charAt(0); if (conschar != '-' && s == conschar) { diff --git a/src/jalview/appletgui/TitledPanel.java b/src/jalview/appletgui/TitledPanel.java new file mode 100644 index 0000000..1ae36f4 --- /dev/null +++ b/src/jalview/appletgui/TitledPanel.java @@ -0,0 +1,75 @@ +package jalview.appletgui; + +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.Insets; +import java.awt.Label; +import java.awt.Panel; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; + +public class TitledPanel extends Panel +{ + + private String title; + + private Insets insets = new Insets(10, 10, 10, 10); + + public TitledPanel() + { + this(""); + } + + public TitledPanel(String title) + { + this.setTitle(title); + } + + public Insets getInsets() + { + return insets; + } + + public void paint(Graphics g) + { + super.paint(g); + g.setColor(getForeground()); + g.drawRect(5, 5, getWidth() - 10, getHeight() - 10); + int width = g.getFontMetrics().stringWidth(getTitle()); + g.setColor(getBackground()); + g.fillRect(10, 0, width, 10); + g.setColor(getForeground()); + g.drawString(getTitle(), 10, 10); + } + + public static void main(String[] args) + { + Frame f = new Frame("TitledPanel Tester"); + + TitledPanel p = new TitledPanel("Title of Panel"); + p.add(new Label("Label 1")); + p.add(new Label("Label 2")); + p.add(new Label("Label 3")); + f.add(p); + + f.addWindowListener(new WindowAdapter() + { + public void windowClosing(WindowEvent e) + { + System.exit(0); + } + }); + f.setBounds(300, 300, 300, 300); + f.setVisible(true); + } + + public String getTitle() + { + return title; + } + + public void setTitle(String title) + { + this.title = title; + } +} \ No newline at end of file diff --git a/src/jalview/appletgui/TreePanel.java b/src/jalview/appletgui/TreePanel.java index b7c766a..655e182 100644 --- a/src/jalview/appletgui/TreePanel.java +++ b/src/jalview/appletgui/TreePanel.java @@ -20,14 +20,29 @@ */ package jalview.appletgui; -import java.awt.*; -import java.awt.event.*; - -import jalview.analysis.*; -import jalview.datamodel.*; -import jalview.io.*; +import jalview.analysis.NJTree; +import jalview.api.analysis.ScoreModelI; +import jalview.api.analysis.ViewBasedAnalysisI; +import jalview.datamodel.Alignment; +import jalview.datamodel.AlignmentView; +import jalview.datamodel.ColumnSelection; +import jalview.datamodel.SequenceI; +import jalview.io.NewickFile; +import jalview.schemes.ResidueProperties; import jalview.util.MessageManager; +import java.awt.BorderLayout; +import java.awt.CheckboxMenuItem; +import java.awt.Color; +import java.awt.Menu; +import java.awt.MenuBar; +import java.awt.MenuItem; +import java.awt.ScrollPane; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; + public class TreePanel extends EmbmenuFrame implements ActionListener, ItemListener { @@ -204,8 +219,8 @@ public class TreePanel extends EmbmenuFrame implements ActionListener, { int start, end; SequenceI[] seqs; - boolean selview = (av.getSelectionGroup() != null) - && (av.getSelectionGroup().getSize() > 1); + boolean selview = av.getSelectionGroup() != null + && av.getSelectionGroup().getSize() > 1; AlignmentView seqStrings = av.getAlignmentView(selview); if (!selview) { @@ -220,8 +235,27 @@ public class TreePanel extends EmbmenuFrame implements ActionListener, seqs = av.getSelectionGroup().getSequencesInOrder( av.getAlignment()); } - - tree = new NJTree(seqs, seqStrings, type, pwtype, start, end); + ScoreModelI sm = ResidueProperties.getScoreModel(pwtype); + if (sm instanceof ViewBasedAnalysisI) + { + try + { + sm = sm.getClass().newInstance(); + ((ViewBasedAnalysisI) sm) + .configureFromAlignmentView(treeCanvas.ap); + } catch (Exception q) + { + System.err.println("Couldn't create a scoremodel instance for " + + sm.getName()); + q.printStackTrace(); + } + tree = new NJTree(seqs, seqStrings, type, pwtype, sm, start, end); + } + else + { + tree = new NJTree(seqs, seqStrings, type, pwtype, null, start, + end); + } } tree.reCount(tree.getTopNode()); diff --git a/src/jalview/bin/JalviewLite.java b/src/jalview/bin/JalviewLite.java index ae8bc98..dab649e 100644 --- a/src/jalview/bin/JalviewLite.java +++ b/src/jalview/bin/JalviewLite.java @@ -709,8 +709,8 @@ public class JalviewLite extends Applet implements */ public void loadAnnotationFrom(AlignFrame alf, String annotation) { - if (new AnnotationFile().readAnnotationFile(alf.getAlignViewport() - .getAlignment(), annotation, AppletFormatAdapter.PASTE)) + if (new AnnotationFile().annotateAlignmentView(alf.getAlignViewport(), + annotation, AppletFormatAdapter.PASTE)) { alf.alignPanel.fontChanged(); alf.alignPanel.setScrollValues(0, 0); @@ -1990,7 +1990,7 @@ public class JalviewLite extends Applet implements param = applet.getParameter("showFeatureSettings"); if (param != null && param.equalsIgnoreCase("true")) { - newAlignFrame.viewport.showSequenceFeatures(true); + newAlignFrame.viewport.setShowSequenceFeatures(true); new FeatureSettings(newAlignFrame.alignPanel); } @@ -1999,8 +1999,8 @@ public class JalviewLite extends Applet implements { param = setProtocolState(param); - if (new AnnotationFile().readAnnotationFile( - newAlignFrame.viewport.getAlignment(), param, protocol)) + if (new AnnotationFile().annotateAlignmentView( + newAlignFrame.viewport, param, protocol)) { newAlignFrame.alignPanel.fontChanged(); newAlignFrame.alignPanel.setScrollValues(0, 0); diff --git a/src/jalview/controller/AlignViewController.java b/src/jalview/controller/AlignViewController.java index dbc3524..4d734c7 100644 --- a/src/jalview/controller/AlignViewController.java +++ b/src/jalview/controller/AlignViewController.java @@ -20,16 +20,14 @@ */ package jalview.controller; -import java.awt.Color; -import java.util.BitSet; -import java.util.List; - +import jalview.analysis.AlignmentSorter; import jalview.api.AlignViewControllerGuiI; import jalview.api.AlignViewControllerI; import jalview.api.AlignViewportI; import jalview.api.AlignmentViewPanel; +import jalview.api.FeatureRenderer; +import jalview.commands.OrderCommand; import jalview.datamodel.AlignmentI; -import jalview.datamodel.AnnotatedCollectionI; import jalview.datamodel.ColumnSelection; import jalview.datamodel.SequenceCollectionI; import jalview.datamodel.SequenceFeature; @@ -37,6 +35,11 @@ import jalview.datamodel.SequenceGroup; import jalview.datamodel.SequenceI; import jalview.util.MessageManager; +import java.awt.Color; +import java.util.ArrayList; +import java.util.BitSet; +import java.util.List; + public class AlignViewController implements AlignViewControllerI { AlignViewportI viewport = null; @@ -97,7 +100,9 @@ public class AlignViewController implements AlignViewControllerI (int) (Math.random() * 255), (int) (Math.random() * 255)); col = col.brighter(); for (SequenceI sq : gps[g].getSequences(null)) + { viewport.setSequenceColour(sq, col); + } } return true; } @@ -296,4 +301,76 @@ public class AlignViewController implements AlignViewControllerI return false; } } + + + + @Override + public void sortAlignmentByFeatureDensity(String[] typ) + { + sortBy(typ, "Sort by Density", AlignmentSorter.FEATURE_DENSITY); + } + + protected void sortBy(String[] typ, String methodText, final String method) + { + FeatureRenderer fr = alignPanel.getFeatureRenderer(); + if (typ == null) + { + typ = fr==null ? null : fr.getDisplayedFeatureTypes(); + } + String gps[] = null; + gps = fr==null ? null : fr.getDisplayedFeatureGroups(); + if (typ != null) + { + ArrayList types = new ArrayList(); + for (int i = 0; i < typ.length; i++) + { + if (typ[i] != null) + { + types.add(typ[i]); + } + typ = new String[types.size()]; + types.toArray(typ); + } + } + if (gps != null) + { + ArrayList grps = new ArrayList(); + + for (int i = 0; i < gps.length; i++) + { + if (gps[i] != null) + { + grps.add(gps[i]); + } + } + gps = new String[grps.size()]; + grps.toArray(gps); + } + AlignmentI al = viewport.getAlignment(); + + int start, stop; + SequenceGroup sg = viewport.getSelectionGroup(); + if (sg != null) + { + start = sg.getStartRes(); + stop = sg.getEndRes(); + } + else + { + start = 0; + stop = al.getWidth(); + } + SequenceI[] oldOrder = al.getSequencesArray(); + AlignmentSorter.sortByFeature(typ, gps, start, stop, al, method); + avcg.addHistoryItem(new OrderCommand(methodText, oldOrder, viewport + .getAlignment())); + alignPanel.paintAlignment(true); + + } + + @Override + public void sortAlignmentByFeatureScore(String[] typ) + { + sortBy(typ, "Sort by Feature Score", AlignmentSorter.FEATURE_SCORE); + } } diff --git a/src/jalview/controller/FeatureSettingsController.java b/src/jalview/controller/FeatureSettingsController.java new file mode 100644 index 0000000..ebf4958 --- /dev/null +++ b/src/jalview/controller/FeatureSettingsController.java @@ -0,0 +1,12 @@ +package jalview.controller; + +import jalview.api.FeatureRenderer; +import jalview.api.FeatureSettingsModelI; + +public class FeatureSettingsController implements jalview.api.FeatureSettingsControllerI +{ + FeatureSettingsControllerGuiI settingUI; + FeatureRenderer fr; + FeatureSettingsModelI fsettings; + +} diff --git a/src/jalview/controller/FeatureSettingsControllerGuiI.java b/src/jalview/controller/FeatureSettingsControllerGuiI.java new file mode 100644 index 0000000..781759e --- /dev/null +++ b/src/jalview/controller/FeatureSettingsControllerGuiI.java @@ -0,0 +1,6 @@ +package jalview.controller; + +public interface FeatureSettingsControllerGuiI +{ + +} diff --git a/src/jalview/datamodel/Alignment.java b/src/jalview/datamodel/Alignment.java index 9c5914f..01d3d8d 100755 --- a/src/jalview/datamodel/Alignment.java +++ b/src/jalview/datamodel/Alignment.java @@ -1571,6 +1571,39 @@ public class Alignment implements AlignmentI } } + + private SequenceI seqrep=null; + + /** + * + * @return the representative sequence for this group + */ + public SequenceI getSeqrep() + { + return seqrep; + } + + /** + * set the representative sequence for this group. Note - this affects the + * interpretation of the Hidereps attribute. + * + * @param seqrep + * the seqrep to set (null means no sequence representative) + */ + public void setSeqrep(SequenceI seqrep) + { + this.seqrep = seqrep; + } + + /** + * + * @return true if group has a sequence representative + */ + public boolean hasSeqrep() + { + return seqrep != null; + } + @Override public int getEndRes() { diff --git a/src/jalview/datamodel/CigarArray.java b/src/jalview/datamodel/CigarArray.java index 529891f..a55f676 100644 --- a/src/jalview/datamodel/CigarArray.java +++ b/src/jalview/datamodel/CigarArray.java @@ -20,7 +20,7 @@ */ package jalview.datamodel; -import java.util.Vector; +import java.util.List; public class CigarArray extends CigarBase { @@ -148,25 +148,25 @@ public class CigarArray extends CigarBase * internal constructor function - called by CigarArray(AlignmentI, ...); * * @param alignment - * @param columnSelection + * @param list * - vector of visible regions as returned from * columnSelection.getHiddenColumns() * @param selectionGroup */ private void constructFromAlignment(AlignmentI alignment, - Vector columnSelection, SequenceGroup selectionGroup) + List list, SequenceGroup selectionGroup) { int[] _startend = _calcStartEndBounds(alignment, selectionGroup); int start = _startend[1], end = _startend[2]; // now construct the CigarArray operations - if (columnSelection != null) + if (list != null) { int[] region; int hideStart, hideEnd; int last = start; - for (int j = 0; last < end & j < columnSelection.size(); j++) + for (int j = 0; last < end & j < list.size(); j++) { - region = (int[]) columnSelection.elementAt(j); + region = list.get(j); hideStart = region[0]; hideEnd = region[1]; // edit hidden regions to selection range diff --git a/src/jalview/datamodel/ColumnSelection.java b/src/jalview/datamodel/ColumnSelection.java index f414d13..6acca32 100644 --- a/src/jalview/datamodel/ColumnSelection.java +++ b/src/jalview/datamodel/ColumnSelection.java @@ -21,8 +21,11 @@ package jalview.datamodel; import jalview.util.ShiftList; +import jalview.viewmodel.annotationfilter.AnnotationFilterParameter; +import jalview.viewmodel.annotationfilter.AnnotationFilterParameter.SearchableAnnotationField; import java.util.ArrayList; +import java.util.Arrays; import java.util.Enumeration; import java.util.List; import java.util.Vector; @@ -35,7 +38,7 @@ public class ColumnSelection Vector selected = new Vector(); // Vector of int [] {startCol, endCol} - Vector hiddenColumns; + Vector hiddenColumns; /** * Add a column to the selection @@ -208,7 +211,7 @@ public class ColumnSelection int hSize = hiddenColumns.size(); for (int i = 0; i < hSize; i++) { - int[] region = (int[]) hiddenColumns.elementAt(i); + int[] region = hiddenColumns.elementAt(i); if (region[0] > start && start + change > region[1]) { deletedHiddenColumns.add(region); @@ -263,7 +266,7 @@ public class ColumnSelection { for (int i = 0; i < hiddenColumns.size(); i++) { - int[] region = (int[]) hiddenColumns.elementAt(i); + int[] region = hiddenColumns.elementAt(i); if (region[0] >= start) { region[0] -= change; @@ -477,16 +480,13 @@ public class ColumnSelection } /** - * This Method is used to return all the HiddenColumn regions less than the - * given index. - * - * @param end - * int - * @return Vector + * This Method is used to return all the HiddenColumn regions + * @return empty list or List of hidden column intervals */ - public Vector getHiddenColumns() + public List getHiddenColumns() { - return hiddenColumns; + return hiddenColumns == null ? Arrays.asList(new int[] + {}) : hiddenColumns; } /** @@ -503,7 +503,7 @@ public class ColumnSelection { for (int i = 0; i < hiddenColumns.size(); i++) { - int[] region = (int[]) hiddenColumns.elementAt(i); + int[] region = hiddenColumns.elementAt(i); if (result >= region[0]) { result += region[1] - region[0] + 1; @@ -531,7 +531,7 @@ public class ColumnSelection int[] region; do { - region = (int[]) hiddenColumns.elementAt(index++); + region = hiddenColumns.elementAt(index++); if (hiddenColumn > region[1]) { result -= region[1] + 1 - region[0]; @@ -557,7 +557,7 @@ public class ColumnSelection int gaps = 0; do { - int[] region = (int[]) hiddenColumns.elementAt(index); + int[] region = hiddenColumns.elementAt(index); if (hiddenRegion == 0) { return region[0]; @@ -588,7 +588,7 @@ public class ColumnSelection int index = 0; do { - int[] region = (int[]) hiddenColumns.elementAt(index); + int[] region = hiddenColumns.elementAt(index); if (alPos < region[0]) { return region[0]; @@ -616,7 +616,7 @@ public class ColumnSelection int index = hiddenColumns.size() - 1; do { - int[] region = (int[]) hiddenColumns.elementAt(index); + int[] region = hiddenColumns.elementAt(index); if (alPos > region[1]) { return region[1]; @@ -652,7 +652,7 @@ public class ColumnSelection for (int i = 0; i < hiddenColumns.size(); i++) { - int[] region = (int[]) hiddenColumns.elementAt(i); + int[] region = hiddenColumns.elementAt(i); if (start <= region[1] && end >= region[0]) { hiddenColumns.removeElementAt(i); @@ -719,7 +719,7 @@ public class ColumnSelection { for (int i = 0; i < hiddenColumns.size(); i++) { - int[] region = (int[]) hiddenColumns.elementAt(i); + int[] region = hiddenColumns.elementAt(i); for (int j = region[0]; j < region[1] + 1; j++) { addElement(j); @@ -734,7 +734,7 @@ public class ColumnSelection { for (int i = 0; i < hiddenColumns.size(); i++) { - int[] region = (int[]) hiddenColumns.elementAt(i); + int[] region = hiddenColumns.elementAt(i); if (res == region[0]) { for (int j = region[0]; j < region[1] + 1; j++) @@ -758,7 +758,7 @@ public class ColumnSelection { for (int i = 0; i < hiddenColumns.size(); i++) { - int[] region = (int[]) hiddenColumns.elementAt(i); + int[] region = hiddenColumns.elementAt(i); if (column >= region[0] && column <= region[1]) { return false; @@ -792,7 +792,7 @@ public class ColumnSelection for (int i = 0, j = copy.hiddenColumns.size(); i < j; i++) { int[] rh, cp; - rh = (int[]) copy.hiddenColumns.elementAt(i); + rh = copy.hiddenColumns.elementAt(i); if (rh != null) { cp = new int[rh.length]; @@ -821,7 +821,7 @@ public class ColumnSelection for (i = 0; i < iSize; i++) { StringBuffer visibleSeq = new StringBuffer(); - Vector regions = getHiddenColumns(); + List regions = getHiddenColumns(); int blockStart = start, blockEnd = end; int[] region; @@ -829,7 +829,7 @@ public class ColumnSelection for (int j = 0; j < regions.size(); j++) { - region = (int[]) regions.elementAt(j); + region = regions.get(j); hideStart = region[0]; hideEnd = region[1]; @@ -886,7 +886,7 @@ public class ColumnSelection if (hiddenColumns != null && hiddenColumns.size() > 0) { Vector visiblecontigs = new Vector(); - Vector regions = getHiddenColumns(); + List regions = getHiddenColumns(); int vstart = start; int[] region; @@ -894,7 +894,7 @@ public class ColumnSelection for (int j = 0; vstart < end && j < regions.size(); j++) { - region = (int[]) regions.elementAt(j); + region = regions.get(j); hideStart = region[0]; hideEnd = region[1]; @@ -972,14 +972,14 @@ public class ColumnSelection // then mangle the alignmentAnnotation annotation array Vector annels = new Vector(); Annotation[] els = null; - Vector regions = getHiddenColumns(); + List regions = getHiddenColumns(); int blockStart = start, blockEnd = end; int[] region; int hideStart, hideEnd, w = 0; for (int j = 0; j < regions.size(); j++) { - region = (int[]) regions.elementAt(j); + region = regions.get(j); hideStart = region[0]; hideEnd = region[1]; @@ -1265,4 +1265,131 @@ public class ColumnSelection } } } + + /** + * + * @return true if there are columns marked + */ + public boolean hasSelectedColumns() + { + return (selected != null && selected.size() > 0); + } + + /** + * + * @return true if there are columns hidden + */ + public boolean hasHiddenColumns() + { + return hiddenColumns != null && hiddenColumns.size() > 0; + } + + /** + * + * @return true if there are more than one set of columns hidden + */ + public boolean hasManyHiddenColumns() + { + return hiddenColumns != null && hiddenColumns.size() > 1; + } + + /** + * mark the columns corresponding to gap characters as hidden in the column + * selection + * + * @param sr + */ + public void hideInsertionsFor(SequenceI sr) + { + List inserts = sr.getInsertions(); + for (int[] r : inserts) + { + hideColumns(r[0], r[1]); + } + } + + public boolean filterAnnotations(Annotation[] annotations, + AnnotationFilterParameter filterParams) + { + this.revealAllHiddenColumns(); + this.clear(); + int count = 0; + do + { + if (annotations[count] != null) + { + + boolean itemMatched = false; + + if (filterParams.getThresholdType() == AnnotationFilterParameter.ThresholdType.ABOVE_THRESHOLD + && annotations[count].value >= filterParams + .getThresholdValue()) + { + itemMatched = true; + } + if (filterParams.getThresholdType() == AnnotationFilterParameter.ThresholdType.BELOW_THRESHOLD + && annotations[count].value <= filterParams + .getThresholdValue()) + { + itemMatched = true; + } + + if (filterParams.isFilterAlphaHelix() + && annotations[count].secondaryStructure == 'H') + { + itemMatched = true; + } + + if (filterParams.isFilterBetaSheet() + && annotations[count].secondaryStructure == 'E') + { + itemMatched = true; + } + + if (filterParams.isFilterTurn() + && annotations[count].secondaryStructure == 'S') + { + itemMatched = true; + } + + String regexSearchString = filterParams.getRegexString(); + if (regexSearchString != null + && !filterParams.getRegexSearchFields().isEmpty()) + { + List fields = filterParams + .getRegexSearchFields(); + try + { + if (fields.contains(SearchableAnnotationField.DISPLAY_STRING) + && annotations[count].displayCharacter + .matches(regexSearchString)) + { + itemMatched = true; + } + } catch (java.util.regex.PatternSyntaxException pse) + { + if (annotations[count].displayCharacter + .equals(regexSearchString)) + { + itemMatched = true; + } + } + if (fields.contains(SearchableAnnotationField.DESCRIPTION) + && annotations[count].description != null + && annotations[count].description + .matches(regexSearchString)) + { + itemMatched = true; + } + } + + if (itemMatched) + { + this.addElement(count); + } + } + count++; + } while (count < annotations.length); + return false; + } } diff --git a/src/jalview/datamodel/Sequence.java b/src/jalview/datamodel/Sequence.java index 0652fb5..96e469a 100755 --- a/src/jalview/datamodel/Sequence.java +++ b/src/jalview/datamodel/Sequence.java @@ -661,11 +661,7 @@ public class Sequence implements SequenceI return map; } - /* - * (non-Javadoc) - * - * @see jalview.datamodel.SequenceI#findPositionMap() - */ + @Override public int[] findPositionMap() { int map[] = new int[sequence.length]; @@ -685,11 +681,43 @@ public class Sequence implements SequenceI return map; } - /* - * (non-Javadoc) - * - * @see jalview.datamodel.SequenceI#deleteChars(int, int) - */ + @Override + public List getInsertions() + { + ArrayList map = new ArrayList(); + int lastj = -1, j = 0; + int pos = start; + int seqlen = sequence.length; + while ((j < seqlen)) + { + if (jalview.util.Comparison.isGap(sequence[j])) + { + if (lastj == -1) + { + lastj = j; + } + } + else + { + if (lastj != -1) + { + map.add(new int[] + { lastj, j - 1 }); + lastj = -1; + } + } + j++; + } + if (lastj != -1) + { + map.add(new int[] + { lastj, j - 1 }); + lastj = -1; + } + return map; + } + + @Override public void deleteChars(int i, int j) { int newstart = start, newend = end; @@ -768,16 +796,7 @@ public class Sequence implements SequenceI sequence = tmp; } - /** - * DOCUMENT ME! - * - * @param i - * DOCUMENT ME! - * @param c - * DOCUMENT ME! - * @param chop - * DOCUMENT ME! - */ + @Override public void insertCharAt(int i, int length, char c) { char[] tmp = new char[sequence.length + length]; @@ -807,26 +826,31 @@ public class Sequence implements SequenceI sequence = tmp; } + @Override public void insertCharAt(int i, char c) { insertCharAt(i, 1, c); } + @Override public String getVamsasId() { return vamsasId; } + @Override public void setVamsasId(String id) { vamsasId = id; } + @Override public void setDBRef(DBRefEntry[] dbref) { dbrefs = dbref; } + @Override public DBRefEntry[] getDBRef() { if (dbrefs == null && datasetSequence != null @@ -837,6 +861,7 @@ public class Sequence implements SequenceI return dbrefs; } + @Override public void addDBRef(DBRefEntry entry) { if (dbrefs == null) @@ -869,40 +894,33 @@ public class Sequence implements SequenceI dbrefs = temp; } + @Override public void setDatasetSequence(SequenceI seq) { datasetSequence = seq; } + @Override public SequenceI getDatasetSequence() { return datasetSequence; } - /** - * Returns a new array containing this sequence's annotations, or null. - */ + @Override public AlignmentAnnotation[] getAnnotation() { return annotation == null ? null : annotation .toArray(new AlignmentAnnotation[annotation.size()]); } - /** - * Returns true if this sequence has the given annotation (by object - * identity). - */ + @Override public boolean hasAnnotation(AlignmentAnnotation ann) { return annotation == null ? false : annotation.contains(ann); } - /** - * Add the given annotation, if not already added, and set its sequence ref to - * be this sequence. Does nothing if this sequence's annotations already - * include this annotation (by identical object reference). - */ + @Override public void addAlignmentAnnotation(AlignmentAnnotation annotation) { if (this.annotation == null) @@ -948,11 +966,7 @@ public class Sequence implements SequenceI return true; } - /* - * (non-Javadoc) - * - * @see jalview.datamodel.SequenceI#deriveSequence() - */ + @Override public SequenceI deriveSequence() { SequenceI seq = new Sequence(this); @@ -1043,11 +1057,7 @@ public class Sequence implements SequenceI } } - /* - * (non-Javadoc) - * - * @see jalview.datamodel.SequenceI#getAnnotation(java.lang.String) - */ + @Override public AlignmentAnnotation[] getAnnotation(String label) { if (annotation == null || annotation.size() == 0) @@ -1080,6 +1090,7 @@ public class Sequence implements SequenceI return anns; } + @Override public boolean updatePDBIds() { if (datasetSequence != null) @@ -1133,13 +1144,7 @@ public class Sequence implements SequenceI return false; } - /* - * (non-Javadoc) - * - * @see - * jalview.datamodel.SequenceI#transferAnnotation(jalview.datamodel.SequenceI, - * jalview.datamodel.Mapping) - */ + @Override public void transferAnnotation(SequenceI entry, Mapping mp) { if (datasetSequence != null) @@ -1235,13 +1240,6 @@ public class Sequence implements SequenceI return rna; } - /** - * Returns a (possibly empty) list of any annotations that match on given - * calcId (source) and label (type). Null values do not match. - * - * @param calcId - * @param label - */ @Override public List getAlignmentAnnotations(String calcId, String label) diff --git a/src/jalview/datamodel/SequenceCollectionI.java b/src/jalview/datamodel/SequenceCollectionI.java index 3af441b..ee216a4 100644 --- a/src/jalview/datamodel/SequenceCollectionI.java +++ b/src/jalview/datamodel/SequenceCollectionI.java @@ -29,8 +29,23 @@ public interface SequenceCollectionI List getSequences( Map hiddenReps); - int getWidth(); + /** + * + * @return true if getSeqrep doesn't return null + */ + boolean hasSeqrep(); + /** + * get the reference or representative sequence within this collection + * @return null or the current reference sequence + */ + SequenceI getSeqrep(); + /** + * set the reference or representative sequence for this collection. + * Reference is assumed to be present within the collection. + * @return + */ + void setSeqrep(SequenceI refseq); /** * @return the first column included in this collection. Runs from 0<=i getAlignmentAnnotations(String calcId, String label); @@ -403,4 +414,10 @@ public interface SequenceI */ public void setRNA(RNA rna); + /** + * + * @return list of insertions (gap characters) in sequence + */ + public List getInsertions(); + } diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 27e8ca0..6e3024d 100644 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -768,7 +768,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, setColourSelected(ColourSchemeProperty.getColourName(av .getGlobalColourScheme())); - showSeqFeatures.setSelected(av.showSequenceFeatures); + showSeqFeatures.setSelected(av.isShowSequenceFeatures()); hiddenMarkers.setState(av.showHiddenMarkers); applyToAllGroups.setState(av.getColourAppliesToAllGroups()); showNpFeatsMenuitem.setSelected(av.isShowNpFeats()); @@ -1310,11 +1310,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, @Override public void exportAnnotations_actionPerformed(ActionEvent e) { - new AnnotationExporter().exportAnnotations(alignPanel, - viewport.isShowAnnotation() ? viewport.getAlignment() - .getAlignmentAnnotation() : null, viewport - .getAlignment().getGroups(), ((Alignment) viewport - .getAlignment()).alignmentProperties); + new AnnotationExporter().exportAnnotations(alignPanel); } @Override @@ -1776,20 +1772,17 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, return; } - Vector hiddenColumns = null; + ArrayList hiddenColumns = null; if (viewport.hasHiddenColumns()) { - hiddenColumns = new Vector(); + hiddenColumns = new ArrayList(); int hiddenOffset = viewport.getSelectionGroup().getStartRes(), hiddenCutoff = viewport .getSelectionGroup().getEndRes(); - for (int i = 0; i < viewport.getColumnSelection().getHiddenColumns() - .size(); i++) + for (int[] region : viewport.getColumnSelection().getHiddenColumns()) { - int[] region = (int[]) viewport.getColumnSelection() - .getHiddenColumns().elementAt(i); if (region[0] >= hiddenOffset && region[1] <= hiddenCutoff) { - hiddenColumns.addElement(new int[] + hiddenColumns.add(new int[] { region[0] - hiddenOffset, region[1] - hiddenOffset }); } } @@ -2116,10 +2109,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, if (Desktop.jalviewClipboard != null && Desktop.jalviewClipboard[2] != null) { - Vector hc = (Vector) Desktop.jalviewClipboard[2]; - for (int i = 0; i < hc.size(); i++) + List hc = (List) Desktop.jalviewClipboard[2]; + for (int[] region : hc) { - int[] region = (int[]) hc.elementAt(i); af.viewport.hideColumns(region[0], region[1]); } } @@ -2176,10 +2168,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, if (Desktop.jalviewClipboard != null && Desktop.jalviewClipboard[2] != null) { - Vector hc = (Vector) Desktop.jalviewClipboard[2]; - for (int i = 0; i < hc.size(); i++) + List hc = (List) Desktop.jalviewClipboard[2]; + for (int region[] : hc) { - int[] region = (int[]) hc.elementAt(i); af.viewport.hideColumns(region[0], region[1]); } } @@ -3097,7 +3088,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, { viewport.setShowSequenceFeaturesHeight(showSeqFeaturesHeight .isSelected()); - if (viewport.getShowSequenceFeaturesHeight()) + if (viewport.isShowSequenceFeaturesHeight()) { // ensure we're actually displaying features viewport.setShowSequenceFeatures(true); @@ -3330,6 +3321,12 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, } @Override + public void annotationColumn_actionPerformed(ActionEvent e) + { + new AnnotationColumnChooser(viewport, alignPanel); + } + + @Override public void rnahelicesColour_actionPerformed(ActionEvent e) { new RNAHelicesColourChooser(viewport, alignPanel); @@ -4887,7 +4884,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, { featuresFile = new FeaturesFile(file, type).parse(viewport .getAlignment().getDataset(), alignPanel.getSeqPanel().seqCanvas - .getFeatureRenderer().featureColours, false, + .getFeatureRenderer().getFeatureColours(), false, jalview.bin.Cache.getDefault("RELAXEDSEQIDMATCHING", false)); } catch (Exception ex) { @@ -4896,7 +4893,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, if (featuresFile) { - viewport.showSequenceFeatures = true; + viewport.setShowSequenceFeatures(true); showSeqFeatures.setSelected(true); if (alignPanel.getSeqPanel().seqCanvas.fr != null) { @@ -5153,7 +5150,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, // try to parse as annotation. boolean isAnnotation = (format == null || format .equalsIgnoreCase("PFAM")) ? new AnnotationFile() - .readAnnotationFile(viewport.getAlignment(), file, protocol) + .annotateAlignmentView(viewport, file, protocol) : false; if (!isAnnotation) @@ -5758,6 +5755,16 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, alignPanel.paintAlignment(true); } } + public void clearAlignmentSeqRep() + { + // TODO refactor alignmentseqrep to controller + if (viewport.getAlignment().hasSeqrep()) { + viewport.getAlignment().setSeqrep(null); + PaintRefresher.Refresh(this, viewport.getSequenceSetId()); + alignPanel.updateAnnotation(); + alignPanel.paintAlignment(true); + } + } @Override protected void createGroup_actionPerformed(ActionEvent e) diff --git a/src/jalview/gui/AlignViewport.java b/src/jalview/gui/AlignViewport.java index 497dad4..1c105d0 100644 --- a/src/jalview/gui/AlignViewport.java +++ b/src/jalview/gui/AlignViewport.java @@ -95,10 +95,6 @@ public class AlignViewport extends AlignmentViewport implements boolean renderGaps = true; - boolean showSequenceFeatures = false; - - private boolean showAnnotation = true; - SequenceAnnotationOrder sortAnnotationsBy = null; int charHeight; @@ -125,12 +121,6 @@ public class AlignViewport extends AlignmentViewport implements boolean cursorMode = false; - /** - * Keys are the feature types which are currently visible. Note: Values are - * not used! - */ - private Hashtable featuresDisplayed = null; - boolean antiAlias = false; Rectangle explodedPosition; @@ -149,8 +139,7 @@ public class AlignViewport extends AlignmentViewport implements Color textColour2 = Color.white; - private boolean rightAlignIds = false; - + private AnnotationColumnChooser annotationColumnSelectionState; /** * Creates a new AlignViewport object. * @@ -206,16 +195,7 @@ public class AlignViewport extends AlignmentViewport implements setAlignment(al); if (hiddenColumns != null) { - this.colSel = hiddenColumns; - if (hiddenColumns.getHiddenColumns() != null - && hiddenColumns.getHiddenColumns().size() > 0) - { - hasHiddenColumns = true; - } - else - { - hasHiddenColumns = false; - } + colSel = hiddenColumns; } init(); } @@ -262,16 +242,7 @@ public class AlignViewport extends AlignmentViewport implements setAlignment(al); if (hiddenColumns != null) { - this.colSel = hiddenColumns; - if (hiddenColumns.getHiddenColumns() != null - && hiddenColumns.getHiddenColumns().size() > 0) - { - hasHiddenColumns = true; - } - else - { - hasHiddenColumns = false; - } + colSel = hiddenColumns; } init(); } @@ -368,22 +339,6 @@ public class AlignViewport extends AlignmentViewport implements } /** - * set the flag - * - * @param b - * features are displayed if true - */ - public void setShowSequenceFeatures(boolean b) - { - showSequenceFeatures = b; - } - - public boolean getShowSequenceFeatures() - { - return showSequenceFeatures; - } - - /** * centre columnar annotation labels in displayed alignment annotation TODO: * add to jalviewXML and annotation display settings */ @@ -837,27 +792,6 @@ public class AlignViewport extends AlignmentViewport implements * * @return DOCUMENT ME! */ - public boolean getShowAnnotation() - { - return isShowAnnotation(); - } - - /** - * DOCUMENT ME! - * - * @param b - * DOCUMENT ME! - */ - public void setShowAnnotation(boolean b) - { - showAnnotation = b; - } - - /** - * DOCUMENT ME! - * - * @return DOCUMENT ME! - */ public boolean getScaleAboveWrapped() { return scaleAboveWrapped; @@ -1057,23 +991,6 @@ public class AlignViewport extends AlignmentViewport implements shownpfeats = show; } - /** - * - * @return true if view has hidden rows - */ - public boolean hasHiddenRows() - { - return hasHiddenRows; - } - - /** - * - * @return true if view has hidden columns - */ - public boolean hasHiddenColumns() - { - return hasHiddenColumns; - } /** * when set, view will scroll to show the highlighted position @@ -1101,8 +1018,6 @@ public class AlignViewport extends AlignmentViewport implements return followSelection; } - boolean showSeqFeaturesHeight; - public void sendSelection() { jalview.structure.StructureSelectionManager @@ -1111,16 +1026,6 @@ public class AlignViewport extends AlignmentViewport implements new ColumnSelection(getColumnSelection()), this); } - public void setShowSequenceFeaturesHeight(boolean selected) - { - showSeqFeaturesHeight = selected; - } - - public boolean getShowSequenceFeaturesHeight() - { - return showSeqFeaturesHeight; - } - /** * return the alignPanel containing the given viewport. Use this to get the * components currently handling the given viewport. @@ -1274,16 +1179,6 @@ public class AlignViewport extends AlignmentViewport implements } } - - public Hashtable getFeaturesDisplayed() - { - return featuresDisplayed; - } - - public void setFeaturesDisplayed(Hashtable featuresDisplayed) - { - this.featuresDisplayed = featuresDisplayed; - } protected SequenceAnnotationOrder getSortAnnotationsBy() { return sortAnnotationsBy; @@ -1304,18 +1199,14 @@ public class AlignViewport extends AlignmentViewport implements this.showAutocalculatedAbove = showAutocalculatedAbove; } - public boolean isShowAnnotation() - { - return showAnnotation; - } - - public boolean isRightAlignIds() + public AnnotationColumnChooser getAnnotationColumnSelectionState() { - return rightAlignIds; + return annotationColumnSelectionState; } - public void setRightAlignIds(boolean rightAlignIds) + public void setAnnotationColumnSelectionState( + AnnotationColumnChooser currentAnnotationColumnSelectionState) { - this.rightAlignIds = rightAlignIds; + this.annotationColumnSelectionState = currentAnnotationColumnSelectionState; } } diff --git a/src/jalview/gui/AlignmentPanel.java b/src/jalview/gui/AlignmentPanel.java index 6c80464..6517e70 100644 --- a/src/jalview/gui/AlignmentPanel.java +++ b/src/jalview/gui/AlignmentPanel.java @@ -122,7 +122,7 @@ public class AlignmentPanel extends GAlignmentPanel implements setScrollValues(0, 0); - setAnnotationVisible(av.getShowAnnotation()); + setAnnotationVisible(av.isShowAnnotation()); hscroll.addAdjustmentListener(this); vscroll.addAdjustmentListener(this); @@ -729,7 +729,7 @@ public class AlignmentPanel extends GAlignmentPanel implements getSeqPanel().seqCanvas.fastPaint(scrollX, scrollY); getScalePanel().repaint(); - if (av.getShowAnnotation() && scrollX != 0) + if (av.isShowAnnotation() && scrollX != 0) { getAnnotationPanel().fastPaint(scrollX); } @@ -1249,7 +1249,7 @@ public class AlignmentPanel extends GAlignmentPanel implements } } - else if (av.getShowAnnotation()) + else if (av.isShowAnnotation()) { height += getAnnotationPanel().adjustPanelHeight() + 3; } @@ -1553,18 +1553,23 @@ public class AlignmentPanel extends GAlignmentPanel implements new OOMWarning(string, error, this); } - public FeatureRenderer cloneFeatureRenderer() + @Override + public jalview.api.FeatureRenderer cloneFeatureRenderer() { return new FeatureRenderer(this); } - - public void updateFeatureRenderer(FeatureRenderer fr) + @Override + public jalview.api.FeatureRenderer getFeatureRenderer() + { + return seqPanel.seqCanvas.getFeatureRenderer(); + } + public void updateFeatureRenderer(jalview.renderer.seqfeatures.FeatureRenderer fr) { fr.transferSettings(getSeqPanel().seqCanvas.getFeatureRenderer()); } - public void updateFeatureRendererFrom(FeatureRenderer fr) + public void updateFeatureRendererFrom(jalview.api.FeatureRenderer fr) { if (getSeqPanel().seqCanvas.getFeatureRenderer() != null) { diff --git a/src/jalview/gui/AnnotationColourChooser.java b/src/jalview/gui/AnnotationColourChooser.java index b8996b6..2ad0bd2 100644 --- a/src/jalview/gui/AnnotationColourChooser.java +++ b/src/jalview/gui/AnnotationColourChooser.java @@ -21,8 +21,6 @@ package jalview.gui; import jalview.bin.Cache; -import jalview.datamodel.AlignmentAnnotation; -import jalview.datamodel.GraphLine; import jalview.datamodel.SequenceGroup; import jalview.schemes.AnnotationColourGradient; import jalview.schemes.ColourSchemeI; @@ -37,51 +35,50 @@ import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.util.Hashtable; -import java.util.Vector; import javax.swing.BorderFactory; import javax.swing.JButton; -import javax.swing.JCheckBox; import javax.swing.JColorChooser; import javax.swing.JComboBox; import javax.swing.JInternalFrame; import javax.swing.JLayeredPane; import javax.swing.JPanel; -import javax.swing.JSlider; -import javax.swing.JTextField; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; import net.miginfocom.swing.MigLayout; -public class AnnotationColourChooser extends JPanel +@SuppressWarnings("serial") +public class AnnotationColourChooser extends AnnotationRowFilter { - JInternalFrame frame; - - AlignViewport av; - - AlignmentPanel ap; ColourSchemeI oldcs; - Hashtable oldgroupColours; - - jalview.datamodel.AlignmentAnnotation currentAnnotation; - - boolean adjusting = false; + Hashtable oldgroupColours; /** * enabled if the user is dragging the slider - try to keep updates to a * minimun */ - boolean sliderDragging = false; + + JComboBox annotations; + + JButton defColours = new JButton(); + + + JPanel jPanel1 = new JPanel(); + + JPanel jPanel2 = new JPanel(); + + BorderLayout borderLayout1 = new BorderLayout(); + + private JComboBox threshold = new JComboBox(); public AnnotationColourChooser(AlignViewport av, final AlignmentPanel ap) { + super(av, ap); oldcs = av.getGlobalColourScheme(); if (av.getAlignment().getGroups() != null) { - oldgroupColours = new Hashtable(); + oldgroupColours = new Hashtable(); for (SequenceGroup sg : ap.av.getAlignment().getGroups()) { if (sg.cs != null) @@ -90,8 +87,6 @@ public class AnnotationColourChooser extends JPanel } } } - this.av = av; - this.ap = ap; frame = new JInternalFrame(); frame.setContentPane(this); frame.setLayer(JLayeredPane.PALETTE_LAYER); @@ -99,45 +94,8 @@ public class AnnotationColourChooser extends JPanel MessageManager.getString("label.colour_by_annotation"), 520, 215); - slider.addChangeListener(new ChangeListener() - { - @Override - public void stateChanged(ChangeEvent evt) - { - if (!adjusting) - { - thresholdValue.setText((slider.getValue() / 1000f) + ""); - valueChanged(!sliderDragging); - } - } - }); - slider.addMouseListener(new MouseAdapter() - { - @Override - public void mousePressed(MouseEvent e) - { - sliderDragging = true; - super.mousePressed(e); - } - - @Override - public void mouseDragged(MouseEvent e) - { - sliderDragging = true; - super.mouseDragged(e); - } - - @Override - public void mouseReleased(MouseEvent evt) - { - if (sliderDragging) - { - sliderDragging = false; - valueChanged(true); - } - ap.paintAlignment(true); - } - }); + addSliderChangeListener(); + addSliderMouseListeners(); if (av.getAlignment().getAlignmentAnnotation() == null) { @@ -161,15 +119,10 @@ public class AnnotationColourChooser extends JPanel seqAssociated.setSelected(acg.isSeqAssociated()); } - annotations = new JComboBox( + annotations = new JComboBox( getAnnotationItems(seqAssociated.isSelected())); - threshold.addItem(MessageManager - .getString("label.threshold_feature_no_thereshold")); - threshold.addItem(MessageManager - .getString("label.threshold_feature_above_thereshold")); - threshold.addItem(MessageManager - .getString("label.threshold_feature_below_thereshold")); + populateThresholdComboBox(threshold); if (oldcs instanceof AnnotationColourGradient) { @@ -178,13 +131,13 @@ public class AnnotationColourChooser extends JPanel switch (acg.getAboveThreshold()) { case AnnotationColourGradient.NO_THRESHOLD: - threshold.setSelectedIndex(0); + getThreshold().setSelectedIndex(0); break; case AnnotationColourGradient.ABOVE_THRESHOLD: - threshold.setSelectedIndex(1); + getThreshold().setSelectedIndex(1); break; case AnnotationColourGradient.BELOW_THRESHOLD: - threshold.setSelectedIndex(2); + getThreshold().setSelectedIndex(2); break; default: throw new Error(MessageManager.getString("error.implementation_error_dont_know_about_thereshold_setting")); @@ -199,62 +152,11 @@ public class AnnotationColourChooser extends JPanel } catch (Exception ex) { } - adjusting = false; - changeColour(); + updateView(); frame.invalidate(); frame.pack(); - - } - - private Vector getAnnotationItems(boolean isSeqAssociated) - { - Vector list = new Vector(); - int index = 1; - int[] anmap = new int[av.getAlignment().getAlignmentAnnotation().length]; - boolean enableSeqAss = false; - for (int i = 0; i < av.getAlignment().getAlignmentAnnotation().length; i++) - { - if (av.getAlignment().getAlignmentAnnotation()[i].sequenceRef == null) - { - if (isSeqAssociated) - { - continue; - } - } - else - { - enableSeqAss = true; - } - String label = av.getAlignment().getAlignmentAnnotation()[i].label; - if (!list.contains(label)) - { - anmap[list.size()] = i; - list.add(label); - - } - else - { - if (!isSeqAssociated) - { - anmap[list.size()] = i; - list.add(label + "_" + (index++)); - } - } - } - seqAssociated.setEnabled(enableSeqAss); - this.annmap = new int[list.size()]; - System.arraycopy(anmap, 0, this.annmap, 0, this.annmap.length); - return list; - } - - private void setDefaultMinMax() - { - minColour.setBackground(Cache.getDefaultColour("ANNOTATIONCOLOUR_MIN", - Color.orange)); - maxColour.setBackground(Cache.getDefaultColour("ANNOTATIONCOLOUR_MAX", - Color.red)); } public AnnotationColourChooser() @@ -342,7 +244,7 @@ public class AnnotationColourChooser extends JPanel annotations_actionPerformed(e); } }); - threshold.addActionListener(new ActionListener() + getThreshold().addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) @@ -400,7 +302,7 @@ public class AnnotationColourChooser extends JPanel @Override public void actionPerformed(ActionEvent arg0) { - seqAssociated_actionPerformed(arg0); + seqAssociated_actionPerformed(arg0, annotations, seqAssociated); } }); @@ -419,7 +321,7 @@ public class AnnotationColourChooser extends JPanel colpanel.add(minColour); colpanel.add(maxColour); jPanel2.add(colpanel, "wrap"); - jPanel2.add(threshold); + jPanel2.add(getThreshold()); jPanel2.add(defColours, "skip 1, wrap"); jPanel2.add(thresholdIsMin); jPanel2.add(slider, "grow"); @@ -429,72 +331,19 @@ public class AnnotationColourChooser extends JPanel this.validate(); } - protected void seqAssociated_actionPerformed(ActionEvent arg0) - { - adjusting = true; - String cursel = (String) annotations.getSelectedItem(); - boolean isvalid = false, isseqs = seqAssociated.isSelected(); - this.annotations.removeAllItems(); - for (String anitem : getAnnotationItems(seqAssociated.isSelected())) - { - if (anitem.equals(cursel) || (isseqs && cursel.startsWith(anitem))) - { - isvalid = true; - cursel = anitem; - } - this.annotations.addItem(anitem); - } - adjusting = false; - if (isvalid) - { - this.annotations.setSelectedItem(cursel); - } - else - { - if (annotations.getItemCount() > 0) - { - annotations.setSelectedIndex(0); - } - } - } - protected void resetColours_actionPerformed(ActionEvent arg0) { setDefaultMinMax(); - changeColour(); + updateView(); } - JComboBox annotations; - - int[] annmap; - - JPanel minColour = new JPanel(); - - JPanel maxColour = new JPanel(); - - JButton defColours = new JButton(); - - JButton ok = new JButton(); - - JButton cancel = new JButton(); - - JPanel jPanel1 = new JPanel(); - - JPanel jPanel2 = new JPanel(); - - BorderLayout borderLayout1 = new BorderLayout(); - - JComboBox threshold = new JComboBox(); - - JSlider slider = new JSlider(); - - JTextField thresholdValue = new JTextField(20); - - JCheckBox currentColours = new JCheckBox(); - - JCheckBox thresholdIsMin = new JCheckBox(); - - JCheckBox seqAssociated = new JCheckBox(); + private void setDefaultMinMax() + { + minColour.setBackground(Cache.getDefaultColour("ANNOTATIONCOLOUR_MIN", + Color.orange)); + maxColour.setBackground(Cache.getDefaultColour("ANNOTATIONCOLOUR_MAX", + Color.red)); + } public void minColour_actionPerformed() { @@ -505,7 +354,7 @@ public class AnnotationColourChooser extends JPanel minColour.setBackground(col); } minColour.repaint(); - changeColour(); + updateView(); } public void maxColour_actionPerformed() @@ -517,247 +366,115 @@ public class AnnotationColourChooser extends JPanel maxColour.setBackground(col); } maxColour.repaint(); - changeColour(); + updateView(); } - void changeColour() + public void reset() { - // Check if combobox is still adjusting - if (adjusting) - { - return; - } - - currentAnnotation = av.getAlignment().getAlignmentAnnotation()[annmap[annotations - .getSelectedIndex()]]; - - int aboveThreshold = -1; - if (threshold.getSelectedIndex() == 1) - { - aboveThreshold = AnnotationColourGradient.ABOVE_THRESHOLD; - } - else if (threshold.getSelectedIndex() == 2) - { - aboveThreshold = AnnotationColourGradient.BELOW_THRESHOLD; - } - - slider.setEnabled(true); - thresholdValue.setEnabled(true); - thresholdIsMin.setEnabled(true); - - if (aboveThreshold == AnnotationColourGradient.NO_THRESHOLD) - { - slider.setEnabled(false); - thresholdValue.setEnabled(false); - thresholdValue.setText(""); - thresholdIsMin.setEnabled(false); - } - else if (aboveThreshold != AnnotationColourGradient.NO_THRESHOLD - && currentAnnotation.threshold == null) - { - currentAnnotation - .setThreshold(new jalview.datamodel.GraphLine( - (currentAnnotation.graphMax - currentAnnotation.graphMin) / 2f, - "Threshold", Color.black)); - } - - if (aboveThreshold != AnnotationColourGradient.NO_THRESHOLD) - { - adjusting = true; - float range = currentAnnotation.graphMax * 1000 - - currentAnnotation.graphMin * 1000; - - slider.setMinimum((int) (currentAnnotation.graphMin * 1000)); - slider.setMaximum((int) (currentAnnotation.graphMax * 1000)); - slider.setValue((int) (currentAnnotation.threshold.value * 1000)); - thresholdValue.setText(currentAnnotation.threshold.value + ""); - slider.setMajorTickSpacing((int) (range / 10f)); - slider.setEnabled(true); - thresholdValue.setEnabled(true); - adjusting = false; - } - - AnnotationColourGradient acg = null; - if (currentColours.isSelected()) - { - acg = new AnnotationColourGradient(currentAnnotation, - av.getGlobalColourScheme(), aboveThreshold); - } - else - { - acg = new AnnotationColourGradient(currentAnnotation, - minColour.getBackground(), maxColour.getBackground(), - aboveThreshold); - } - acg.setSeqAssociated(seqAssociated.isSelected()); - - if (currentAnnotation.graphMin == 0f - && currentAnnotation.graphMax == 0f) - { - acg.setPredefinedColours(true); - } - - acg.thresholdIsMinMax = thresholdIsMin.isSelected(); - - av.setGlobalColourScheme(acg); - + av.setGlobalColourScheme(oldcs); if (av.getAlignment().getGroups() != null) { for (SequenceGroup sg : ap.av.getAlignment().getGroups()) { - if (sg.cs == null) - { - continue; - } - - if (currentColours.isSelected()) - { - sg.cs = new AnnotationColourGradient(currentAnnotation, sg.cs, - aboveThreshold); - ((AnnotationColourGradient) sg.cs).setSeqAssociated(seqAssociated - .isSelected()); - - } - else - { - sg.cs = new AnnotationColourGradient(currentAnnotation, - minColour.getBackground(), maxColour.getBackground(), - aboveThreshold); - ((AnnotationColourGradient) sg.cs).setSeqAssociated(seqAssociated - .isSelected()); - } - + sg.cs = oldgroupColours.get(sg); } } - ap.alignmentChanged(); - // ensure all associated views (overviews, structures, etc) are notified of - // updated colours. - ap.paintAlignment(true); } - public void ok_actionPerformed(ActionEvent e) - { - changeColour(); - try - { - frame.setClosed(true); - } catch (Exception ex) - { - } - } - - public void cancel_actionPerformed(ActionEvent e) + public void valueChanged(boolean updateAllAnnotation) { - reset(); - // ensure all original colouring is propagated to listeners. - ap.paintAlignment(true); - try + if (slider.isEnabled()) { - frame.setClosed(true); - } catch (Exception ex) - { - } - } - - void reset() - { - av.setGlobalColourScheme(oldcs); - if (av.getAlignment().getGroups() != null) - { - - for (SequenceGroup sg : ap.av.getAlignment().getGroups()) + if (currentColours.isSelected() + && !(av.getGlobalColourScheme() instanceof AnnotationColourGradient)) { - sg.cs = (ColourSchemeI) oldgroupColours.get(sg); + updateView(); } + getCurrentAnnotation().threshold.value = slider.getValue() / 1000f; + propagateSeqAssociatedThreshold(updateAllAnnotation, + getCurrentAnnotation()); + ap.paintAlignment(false); } } - public void thresholdCheck_actionPerformed(ActionEvent e) - { - changeColour(); - } - - public void annotations_actionPerformed(ActionEvent e) - { - changeColour(); - } - - public void threshold_actionPerformed(ActionEvent e) + public JComboBox getThreshold() { - changeColour(); + return threshold; } - public void thresholdValue_actionPerformed(ActionEvent e) + public void setThreshold(JComboBox threshold) { - try - { - float f = Float.parseFloat(thresholdValue.getText()); - slider.setValue((int) (f * 1000)); - } catch (NumberFormatException ex) - { - } + this.threshold = threshold; } - public void valueChanged(boolean updateAllAnnotation) + public void currentColours_actionPerformed(ActionEvent e) { - if (currentColours.isSelected() - && !(av.getGlobalColourScheme() instanceof AnnotationColourGradient)) + if (currentColours.isSelected()) { - changeColour(); + reset(); } - currentAnnotation.threshold.value = slider.getValue() / 1000f; - propagateSeqAssociatedThreshold(updateAllAnnotation); - ap.paintAlignment(false); + maxColour.setEnabled(!currentColours.isSelected()); + minColour.setEnabled(!currentColours.isSelected()); + updateView(); } - private void propagateSeqAssociatedThreshold(boolean allAnnotation) + @Override + public void updateView() { - if (currentAnnotation.sequenceRef == null - || currentAnnotation.threshold == null) + // Check if combobox is still adjusting + if (adjusting) { return; } - // TODO: JAL-1327 only update visible annotation thresholds if allAnnotation - // is false, since we only need to provide a quick visual indicator - float thr = currentAnnotation.threshold.value; - for (int i = 0; i < av.getAlignment().getAlignmentAnnotation().length; i++) + setCurrentAnnotation(av.getAlignment().getAlignmentAnnotation()[annmap[annotations + .getSelectedIndex()]]); + + int selectedThresholdItem = getSelectedThresholdItem(getThreshold() + .getSelectedIndex()); + + slider.setEnabled(true); + thresholdValue.setEnabled(true); + thresholdIsMin.setEnabled(true); + + if (selectedThresholdItem == AnnotationColourGradient.NO_THRESHOLD) { - AlignmentAnnotation aa = av.getAlignment().getAlignmentAnnotation()[i]; - if (aa.label.equals(currentAnnotation.label) - && (currentAnnotation.getCalcId() == null ? aa.getCalcId() == null - : currentAnnotation.getCalcId() - .equals(aa.getCalcId()))) - { - if (aa.threshold == null) - { - aa.threshold = new GraphLine(currentAnnotation.threshold); - } - else - { - aa.threshold.value = thr; - } - } + slider.setEnabled(false); + thresholdValue.setEnabled(false); + thresholdValue.setText(""); + thresholdIsMin.setEnabled(false); } - } - - public void currentColours_actionPerformed(ActionEvent e) - { - if (currentColours.isSelected()) + else if (selectedThresholdItem != AnnotationColourGradient.NO_THRESHOLD + && getCurrentAnnotation().threshold == null) { - reset(); + getCurrentAnnotation() + .setThreshold(new jalview.datamodel.GraphLine( + (getCurrentAnnotation().graphMax - getCurrentAnnotation().graphMin) / 2f, + "Threshold", Color.black)); } - maxColour.setEnabled(!currentColours.isSelected()); - minColour.setEnabled(!currentColours.isSelected()); + if (selectedThresholdItem != AnnotationColourGradient.NO_THRESHOLD) + { + adjusting = true; + float range = getCurrentAnnotation().graphMax * 1000 + - getCurrentAnnotation().graphMin * 1000; - changeColour(); - } + slider.setMinimum((int) (getCurrentAnnotation().graphMin * 1000)); + slider.setMaximum((int) (getCurrentAnnotation().graphMax * 1000)); + slider.setValue((int) (getCurrentAnnotation().threshold.value * 1000)); + thresholdValue.setText(getCurrentAnnotation().threshold.value + ""); + slider.setMajorTickSpacing((int) (range / 10f)); + slider.setEnabled(true); + thresholdValue.setEnabled(true); + adjusting = false; + } + colorAlignmContaining(getCurrentAnnotation(), selectedThresholdItem); - public void thresholdIsMin_actionPerformed(ActionEvent actionEvent) - { - changeColour(); + ap.alignmentChanged(); + // ensure all associated views (overviews, structures, etc) are notified of + // updated colours. + ap.paintAlignment(true); } } diff --git a/src/jalview/gui/AnnotationColumnChooser.java b/src/jalview/gui/AnnotationColumnChooser.java new file mode 100644 index 0000000..00c4217 --- /dev/null +++ b/src/jalview/gui/AnnotationColumnChooser.java @@ -0,0 +1,866 @@ +package jalview.gui; + +import jalview.datamodel.AlignmentAnnotation; +import jalview.datamodel.ColumnSelection; +import jalview.schemes.AnnotationColourGradient; +import jalview.util.MessageManager; +import jalview.viewmodel.annotationfilter.AnnotationFilterParameter; + +import java.awt.BorderLayout; +import java.awt.CardLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.util.Iterator; + +import javax.swing.ButtonGroup; +import javax.swing.JCheckBox; +import javax.swing.JComboBox; +import javax.swing.JInternalFrame; +import javax.swing.JLayeredPane; +import javax.swing.JPanel; +import javax.swing.JRadioButton; +import javax.swing.JTextField; +import javax.swing.border.TitledBorder; +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; + +import net.miginfocom.swing.MigLayout; + +@SuppressWarnings("serial") +public class AnnotationColumnChooser extends AnnotationRowFilter implements + ItemListener +{ + + private JComboBox annotations; + + // private JButton ok = new JButton(); + // + // private JButton cancel = new JButton(); + + private JPanel actionPanel = new JPanel(); + + private JPanel thresholdPanel = new JPanel(); + + private JPanel switchableViewsPanel = new JPanel(new CardLayout()); + + private CardLayout switchableViewsLayout = (CardLayout) (switchableViewsPanel + .getLayout()); + private JPanel noGraphFilterView = new JPanel(); + + private JPanel graphFilterView = new JPanel(); + + private JPanel annotationComboBoxPanel = new JPanel(); + + private BorderLayout borderLayout1 = new BorderLayout(); + + private JComboBox threshold = new JComboBox(); + + private StructureFilterPanel gStructureFilterPanel; + + private StructureFilterPanel ngStructureFilterPanel; + + private StructureFilterPanel currentStructureFilterPanel; + + private SearchPanel currentSearchPanel; + + private SearchPanel gSearchPanel; + + private SearchPanel ngSearchPanel; + + private FurtherActionPanel currentFurtherActionPanel; + + private FurtherActionPanel gFurtherActionPanel; + + private FurtherActionPanel ngFurtherActionPanel; + + public static final int ACTION_OPTION_SELECT = 1; + + public static int ACTION_OPTION_HIDE = 2; + + public static String NO_GRAPH_VIEW = "0"; + + public static String GRAPH_VIEW = "1"; + + private int actionOption = ACTION_OPTION_SELECT; + + private ColumnSelection oldColumnSelection; + + public AnnotationColumnChooser() + { + try + { + jbInit(); + } catch (Exception ex) + { + ex.printStackTrace(); + } + } + + public AnnotationColumnChooser(AlignViewport av, final AlignmentPanel ap) + { + super(av, ap); + frame = new JInternalFrame(); + frame.setContentPane(this); + frame.setLayer(JLayeredPane.PALETTE_LAYER); + Desktop.addInternalFrame(frame, + MessageManager.getString("label.select_by_annotation"), 520, + 215); + + addSliderChangeListener(); + addSliderMouseListeners(); + + if (av.getAlignment().getAlignmentAnnotation() == null) + { + return; + } + setOldColumnSelection(av.getColumnSelection()); + adjusting = true; + + setAnnotations(new JComboBox(getAnnotationItems(false))); + populateThresholdComboBox(threshold); + + // restore Object state from the previous session if one exists + if (av.getAnnotationColumnSelectionState() != null) + { + currentSearchPanel = av.getAnnotationColumnSelectionState() + .getCurrentSearchPanel(); + currentStructureFilterPanel = av.getAnnotationColumnSelectionState() + .getCurrentStructureFilterPanel(); + annotations.setSelectedIndex(av.getAnnotationColumnSelectionState() + .getAnnotations().getSelectedIndex()); + threshold.setSelectedIndex(av.getAnnotationColumnSelectionState() + .getThreshold().getSelectedIndex()); + actionOption = av.getAnnotationColumnSelectionState() + .getActionOption(); + } + + try + { + jbInit(); + } catch (Exception ex) + { + } + adjusting = false; + + updateView(); + frame.invalidate(); + frame.pack(); + } + + private void jbInit() throws Exception + { + ok.setOpaque(false); + ok.setText(MessageManager.getString("action.ok")); + ok.addActionListener(new ActionListener() + { + @Override + public void actionPerformed(ActionEvent e) + { + ok_actionPerformed(e); + } + }); + + cancel.setOpaque(false); + cancel.setText(MessageManager.getString("action.cancel")); + cancel.addActionListener(new ActionListener() + { + @Override + public void actionPerformed(ActionEvent e) + { + cancel_actionPerformed(e); + } + }); + + annotations.addItemListener(this); + threshold.addActionListener(new ActionListener() + { + @Override + public void actionPerformed(ActionEvent e) + { + threshold_actionPerformed(e); + } + }); + + thresholdValue.setEnabled(false); + thresholdValue.setColumns(7); + thresholdValue.addActionListener(new ActionListener() + { + @Override + public void actionPerformed(ActionEvent e) + { + thresholdValue_actionPerformed(e); + } + }); + + slider.setPaintLabels(false); + slider.setPaintTicks(true); + slider.setBackground(Color.white); + slider.setEnabled(false); + slider.setOpaque(false); + slider.setPreferredSize(new Dimension(100, 32)); + + thresholdPanel.setBorder(new TitledBorder(MessageManager + .getString("label.threshold_filter"))); + thresholdPanel.setBackground(Color.white); + thresholdPanel.setFont(JvSwingUtils.getLabelFont()); + thresholdPanel.setLayout(new MigLayout("", "[left][right]", "[][]")); + + actionPanel.setBackground(Color.white); + actionPanel.setFont(JvSwingUtils.getLabelFont()); + + graphFilterView.setLayout(new MigLayout("", "[left][right]", "[][]")); + graphFilterView.setBackground(Color.white); + + noGraphFilterView.setLayout(new MigLayout("", "[left][right]", "[][]")); + noGraphFilterView.setBackground(Color.white); + + annotationComboBoxPanel.setBackground(Color.white); + annotationComboBoxPanel.setFont(JvSwingUtils.getLabelFont()); + + gSearchPanel = new SearchPanel(this); + ngSearchPanel = new SearchPanel(this); + gFurtherActionPanel = new FurtherActionPanel(this); + ngFurtherActionPanel = new FurtherActionPanel(this); + gStructureFilterPanel = new StructureFilterPanel(this); + ngStructureFilterPanel = new StructureFilterPanel(this); + + thresholdPanel.add(getThreshold()); + thresholdPanel.add(thresholdValue, "wrap"); + thresholdPanel.add(slider, "grow, span, wrap"); + + actionPanel.add(ok); + actionPanel.add(cancel); + + graphFilterView.add(gSearchPanel, "grow, span, wrap"); + graphFilterView.add(gStructureFilterPanel, "grow, span, wrap"); + graphFilterView.add(thresholdPanel, "grow, span, wrap"); + graphFilterView.add(gFurtherActionPanel); + + noGraphFilterView.add(ngSearchPanel, "grow, span, wrap"); + noGraphFilterView.add(ngStructureFilterPanel, "grow, span, wrap"); + noGraphFilterView.add(ngFurtherActionPanel); + + annotationComboBoxPanel.add(getAnnotations()); + switchableViewsPanel.add(noGraphFilterView, + AnnotationColumnChooser.NO_GRAPH_VIEW); + switchableViewsPanel.add(graphFilterView, + AnnotationColumnChooser.GRAPH_VIEW); + + this.setLayout(borderLayout1); + this.add(annotationComboBoxPanel, java.awt.BorderLayout.PAGE_START); + this.add(switchableViewsPanel, java.awt.BorderLayout.CENTER); + this.add(actionPanel, java.awt.BorderLayout.SOUTH); + + selectedAnnotationChanged(); + this.validate(); + } + + @SuppressWarnings("unchecked") + public void reset() + { + if (this.getOldColumnSelection() != null) + { + av.getColumnSelection().clear(); + + if (av.getAnnotationColumnSelectionState() != null) + { + ColumnSelection oldSelection = av + .getAnnotationColumnSelectionState() + .getOldColumnSelection(); + if (oldSelection != null && oldSelection.getHiddenColumns() != null + && !oldSelection.getHiddenColumns().isEmpty()) + { + for (Iterator itr = oldSelection.getHiddenColumns() + .iterator(); itr.hasNext();) + { + int positions[] = itr.next(); + av.hideColumns(positions[0], positions[1]); + } + } + av.setColumnSelection(oldSelection); + } + ap.paintAlignment(true); + } + + } + + public void valueChanged(boolean updateAllAnnotation) + { + if (slider.isEnabled()) + { + getCurrentAnnotation().threshold.value = slider.getValue() / 1000f; + updateView(); + propagateSeqAssociatedThreshold(updateAllAnnotation, + getCurrentAnnotation()); + ap.paintAlignment(false); + } + } + + public JComboBox getThreshold() + { + return threshold; + } + + public void setThreshold(JComboBox threshold) + { + this.threshold = threshold; + } + + public JComboBox getAnnotations() + { + return annotations; + } + + public void setAnnotations(JComboBox annotations) + { + this.annotations = annotations; + } + + @Override + public void updateView() + { + // Check if combobox is still adjusting + if (adjusting) + { + return; + } + + AnnotationFilterParameter filterParams = new AnnotationFilterParameter(); + + setCurrentAnnotation(av.getAlignment().getAlignmentAnnotation()[annmap[getAnnotations() + .getSelectedIndex()]]); + + int selectedThresholdItem = getSelectedThresholdItem(getThreshold() + .getSelectedIndex()); + + slider.setEnabled(true); + thresholdValue.setEnabled(true); + + if (selectedThresholdItem == AnnotationColourGradient.NO_THRESHOLD) + { + slider.setEnabled(false); + thresholdValue.setEnabled(false); + thresholdValue.setText(""); + // build filter params + } + else if (selectedThresholdItem != AnnotationColourGradient.NO_THRESHOLD) + { + if (getCurrentAnnotation().threshold == null) + { + getCurrentAnnotation() + .setThreshold( + new jalview.datamodel.GraphLine( + (getCurrentAnnotation().graphMax - getCurrentAnnotation().graphMin) / 2f, + "Threshold", Color.black)); + } + + adjusting = true; + float range = getCurrentAnnotation().graphMax * 1000 + - getCurrentAnnotation().graphMin * 1000; + + slider.setMinimum((int) (getCurrentAnnotation().graphMin * 1000)); + slider.setMaximum((int) (getCurrentAnnotation().graphMax * 1000)); + slider.setValue((int) (getCurrentAnnotation().threshold.value * 1000)); + thresholdValue.setText(getCurrentAnnotation().threshold.value + ""); + slider.setMajorTickSpacing((int) (range / 10f)); + slider.setEnabled(true); + thresholdValue.setEnabled(true); + adjusting = false; + + // build filter params + filterParams + .setThresholdType(AnnotationFilterParameter.ThresholdType.NO_THRESHOLD); + if (getCurrentAnnotation().graph != AlignmentAnnotation.NO_GRAPH) + { + filterParams + .setThresholdValue(getCurrentAnnotation().threshold.value); + + if (selectedThresholdItem == AnnotationColourGradient.ABOVE_THRESHOLD) + { + filterParams + .setThresholdType(AnnotationFilterParameter.ThresholdType.ABOVE_THRESHOLD); + } + else if (selectedThresholdItem == AnnotationColourGradient.BELOW_THRESHOLD) + { + filterParams + .setThresholdType(AnnotationFilterParameter.ThresholdType.BELOW_THRESHOLD); + } + } + } + + if (currentStructureFilterPanel != null) + { + if (currentStructureFilterPanel.alphaHelix.isSelected()) + { + filterParams.setFilterAlphaHelix(true); + } + if (currentStructureFilterPanel.betaStrand.isSelected()) + { + filterParams.setFilterBetaSheet(true); + } + if (currentStructureFilterPanel.turn.isSelected()) + { + filterParams.setFilterTurn(true); + } + } + + if (currentSearchPanel != null) + { + + if (!currentSearchPanel.searchBox.getText().isEmpty()) + { + currentSearchPanel.description.setEnabled(true); + currentSearchPanel.displayName.setEnabled(true); + filterParams.setRegexString(currentSearchPanel.searchBox.getText()); + if (currentSearchPanel.displayName.isSelected()) + { + filterParams + .addRegexSearchField(AnnotationFilterParameter.SearchableAnnotationField.DISPLAY_STRING); + } + if (currentSearchPanel.description.isSelected()) + { + filterParams + .addRegexSearchField(AnnotationFilterParameter.SearchableAnnotationField.DESCRIPTION); + } + } + else + { + currentSearchPanel.description.setEnabled(false); + currentSearchPanel.displayName.setEnabled(false); + } + } + + av.getColumnSelection().filterAnnotations( + getCurrentAnnotation().annotations, filterParams); + + av.showAllHiddenColumns(); + if (getActionOption() == ACTION_OPTION_HIDE) + { + av.hideSelectedColumns(); + } + + filterParams = null; + av.setAnnotationColumnSelectionState(this); + ap.paintAlignment(true); + } + + public ColumnSelection getOldColumnSelection() + { + return oldColumnSelection; + } + + public void setOldColumnSelection(ColumnSelection currentColumnSelection) + { + if (currentColumnSelection != null) + { + this.oldColumnSelection = new ColumnSelection(currentColumnSelection); + } + } + + public FurtherActionPanel getCurrentFutherActionPanel() + { + return currentFurtherActionPanel; + } + + public void setCurrentFutherActionPanel( + FurtherActionPanel currentFutherActionPanel) + { + this.currentFurtherActionPanel = currentFutherActionPanel; + } + + public SearchPanel getCurrentSearchPanel() + { + return currentSearchPanel; + } + + public void setCurrentSearchPanel(SearchPanel currentSearchPanel) + { + this.currentSearchPanel = currentSearchPanel; + } + + public int getActionOption() + { + return actionOption; + } + + public void setActionOption(int actionOption) + { + this.actionOption = actionOption; + } + + public StructureFilterPanel getCurrentStructureFilterPanel() + { + return currentStructureFilterPanel; + } + + public void setCurrentStructureFilterPanel( + StructureFilterPanel currentStructureFilterPanel) + { + this.currentStructureFilterPanel = currentStructureFilterPanel; + } + + public void select_action(ActionEvent actionEvent) + { + JRadioButton radioButton = (JRadioButton) actionEvent.getSource(); + if (radioButton.isSelected()) + { + setActionOption(ACTION_OPTION_SELECT); + updateView(); + } + } + + public void hide_action(ActionEvent actionEvent) + { + JRadioButton radioButton = (JRadioButton) actionEvent.getSource(); + if (radioButton.isSelected()) + { + setActionOption(ACTION_OPTION_HIDE); + updateView(); + } + } + + @Override + public void itemStateChanged(ItemEvent e) + { + selectedAnnotationChanged(); + } + + public void selectedAnnotationChanged() + { + String currentView = AnnotationColumnChooser.NO_GRAPH_VIEW; + if (av.getAlignment().getAlignmentAnnotation()[annmap[getAnnotations() + .getSelectedIndex()]].graph != AlignmentAnnotation.NO_GRAPH) + { + currentView = AnnotationColumnChooser.GRAPH_VIEW; + } + + gSearchPanel.syncState(); + gFurtherActionPanel.syncState(); + gStructureFilterPanel.syncState(); + + ngSearchPanel.syncState(); + ngFurtherActionPanel.syncState(); + ngStructureFilterPanel.syncState(); + + switchableViewsLayout.show(switchableViewsPanel, currentView); + updateView(); + } + + + public class FurtherActionPanel extends JPanel + { + private AnnotationColumnChooser aColChooser; + + private JRadioButton hideOption = new JRadioButton(); + + private JRadioButton selectOption = new JRadioButton(); + + private ButtonGroup optionsGroup = new ButtonGroup(); + + public FurtherActionPanel(AnnotationColumnChooser aColChooser) + { + this.aColChooser = aColChooser; + JvSwingUtils.jvInitComponent(selectOption, "action.select"); + selectOption.addActionListener(new ActionListener() + { + @Override + public void actionPerformed(ActionEvent actionEvent) + { + selectRadioAction(actionEvent); + } + }); + + JvSwingUtils.jvInitComponent(hideOption, "action.hide"); + hideOption.addActionListener(new ActionListener() + { + @Override + public void actionPerformed(ActionEvent actionEvent) + { + hideRadioAction(actionEvent); + } + }); + + optionsGroup.add(selectOption); + optionsGroup.add(hideOption); + optionsGroup.setSelected(selectOption.getModel(), true); + + JvSwingUtils.jvInitComponent(this); + syncState(); + + this.add(selectOption); + this.add(hideOption); + } + + public void selectRadioAction(ActionEvent actionEvent) + { + aColChooser.setCurrentFutherActionPanel(this); + aColChooser.select_action(actionEvent); + } + + public void hideRadioAction(ActionEvent actionEvent) + { + aColChooser.setCurrentFutherActionPanel(this); + aColChooser.hide_action(actionEvent); + } + + public void syncState() + { + if (aColChooser.getActionOption() == AnnotationColumnChooser.ACTION_OPTION_HIDE) + { + this.optionsGroup.setSelected(this.hideOption.getModel(), + true); + } + else + { + this.optionsGroup.setSelected(this.selectOption.getModel(), true); + } + } + } + + public class StructureFilterPanel extends JPanel + { + private AnnotationColumnChooser aColChooser; + + private JCheckBox alphaHelix = new JCheckBox(); + + private JCheckBox betaStrand = new JCheckBox(); + + private JCheckBox turn = new JCheckBox(); + + private JCheckBox all = new JCheckBox(); + + public StructureFilterPanel(AnnotationColumnChooser aColChooser) + { + this.aColChooser = aColChooser; + + JvSwingUtils.jvInitComponent(alphaHelix, "label.alpha_helix"); + alphaHelix.addActionListener(new ActionListener() + { + @Override + public void actionPerformed(ActionEvent actionEvent) + { + alphaHelix_actionPerformed(); + } + }); + + JvSwingUtils.jvInitComponent(betaStrand, "label.beta_strand"); + betaStrand.addActionListener(new ActionListener() + { + @Override + public void actionPerformed(ActionEvent actionEvent) + { + betaStrand_actionPerformed(); + } + }); + + JvSwingUtils.jvInitComponent(turn, "label.turn"); + turn.addActionListener(new ActionListener() + { + @Override + public void actionPerformed(ActionEvent actionEvent) + { + turn_actionPerformed(); + } + }); + + JvSwingUtils.jvInitComponent(all, "label.select_all"); + all.addActionListener(new ActionListener() + { + @Override + public void actionPerformed(ActionEvent actionEvent) + { + all_actionPerformed(); + } + }); + + this.setBorder(new TitledBorder(MessageManager + .getString("label.structures_filter"))); + JvSwingUtils.jvInitComponent(this); + + this.add(all); + this.add(alphaHelix); + this.add(betaStrand); + this.add(turn); + } + + public void alphaHelix_actionPerformed() + { + updateSelectAllState(); + aColChooser.setCurrentStructureFilterPanel(this); + aColChooser.updateView(); + } + + public void betaStrand_actionPerformed() + { + updateSelectAllState(); + aColChooser.setCurrentStructureFilterPanel(this); + aColChooser.updateView(); + } + + public void turn_actionPerformed() + { + updateSelectAllState(); + aColChooser.setCurrentStructureFilterPanel(this); + aColChooser.updateView(); + } + + public void all_actionPerformed() + { + if (all.isSelected()) + { + alphaHelix.setSelected(true); + betaStrand.setSelected(true); + turn.setSelected(true); + } + else + { + alphaHelix.setSelected(false); + betaStrand.setSelected(false); + turn.setSelected(false); + } + aColChooser.setCurrentStructureFilterPanel(this); + aColChooser.updateView(); + } + + public void updateSelectAllState() + { + if (alphaHelix.isSelected() && betaStrand.isSelected() + && turn.isSelected()) + { + all.setSelected(true); + } + else + { + all.setSelected(false); + } + } + + public void syncState() + { + StructureFilterPanel sfp = aColChooser + .getCurrentStructureFilterPanel(); + if (sfp != null) + { + alphaHelix.setSelected(sfp.alphaHelix.isSelected()); + betaStrand.setSelected(sfp.betaStrand.isSelected()); + turn.setSelected(sfp.turn.isSelected()); + if (sfp.all.isSelected()) + { + all.setSelected(true); + alphaHelix.setSelected(true); + betaStrand.setSelected(true); + turn.setSelected(true); + } + } + + } + } + + public class SearchPanel extends JPanel + { + private AnnotationColumnChooser aColChooser; + + private JCheckBox displayName = new JCheckBox(); + + private JCheckBox description = new JCheckBox(); + + private JTextField searchBox = new JTextField(10); + + public SearchPanel(AnnotationColumnChooser aColChooser) + { + + this.aColChooser = aColChooser; + JvSwingUtils.jvInitComponent(this); + this.setBorder(new TitledBorder(MessageManager + .getString("label.search_filter"))); + + JvSwingUtils.jvInitComponent(searchBox); + searchBox.getDocument().addDocumentListener( + new DocumentListener() + { + @Override + public void insertUpdate(DocumentEvent e) + { + searchStringAction(); + } + + @Override + public void removeUpdate(DocumentEvent e) + { + searchStringAction(); + } + + @Override + public void changedUpdate(DocumentEvent e) + { + searchStringAction(); + } + }); + + JvSwingUtils.jvInitComponent(displayName, "label.display_name"); + displayName.setEnabled(false); + displayName.addActionListener(new ActionListener() + { + @Override + public void actionPerformed(ActionEvent actionEvent) + { + displayNameCheckboxAction(); + } + }); + + JvSwingUtils.jvInitComponent(description, "label.description"); + description.setEnabled(false); + description.addActionListener(new ActionListener() + { + @Override + public void actionPerformed(ActionEvent actionEvent) + { + discriptionCheckboxAction(); + } + }); + + syncState(); + this.add(searchBox); + this.add(displayName); + this.add(description); + } + + public void displayNameCheckboxAction() + { + aColChooser.setCurrentSearchPanel(this); + aColChooser.updateView(); + } + + public void discriptionCheckboxAction() + { + aColChooser.setCurrentSearchPanel(this); + aColChooser.updateView(); + } + + public void searchStringAction() + { + aColChooser.setCurrentSearchPanel(this); + aColChooser.updateView(); + } + + public void syncState() + { + SearchPanel sp = aColChooser.getCurrentSearchPanel(); + if (sp != null) + { + description.setEnabled(sp.description.isEnabled()); + description.setSelected(sp.description.isSelected()); + + displayName.setEnabled(sp.displayName.isEnabled()); + displayName.setSelected(sp.displayName.isSelected()); + + searchBox.setText(sp.searchBox.getText()); + } + } + } + +} diff --git a/src/jalview/gui/AnnotationExporter.java b/src/jalview/gui/AnnotationExporter.java index e966c92..df6f9eb 100644 --- a/src/jalview/gui/AnnotationExporter.java +++ b/src/jalview/gui/AnnotationExporter.java @@ -21,7 +21,6 @@ package jalview.gui; import jalview.datamodel.AlignmentAnnotation; -import jalview.datamodel.SequenceGroup; import jalview.io.AnnotationFile; import jalview.io.FeaturesFile; import jalview.io.JalviewFileChooser; @@ -33,9 +32,6 @@ import java.awt.Color; import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.util.Enumeration; -import java.util.Hashtable; -import java.util.List; import javax.swing.BorderFactory; import javax.swing.ButtonGroup; @@ -63,11 +59,9 @@ public class AnnotationExporter extends JPanel boolean features = true; - AlignmentAnnotation[] annotations; + private AlignmentAnnotation[] annotations; - List sequenceGroups; - - Hashtable alignmentProperties; + private boolean wholeView; public AnnotationExporter() { @@ -94,17 +88,29 @@ public class AnnotationExporter extends JPanel frame.setTitle(MessageManager.getString("label.export_features")); } - public void exportAnnotations(AlignmentPanel ap, - AlignmentAnnotation[] annotations, List list, - Hashtable alProperties) + public void exportAnnotations(AlignmentPanel ap) { this.ap = ap; + annotations = ap.av.isShowAnnotation() ? null : ap.av.getAlignment() + .getAlignmentAnnotation(); + wholeView = true; + startExportAnnotation(); + } + + public void exportAnnotations(AlignmentPanel alp, + AlignmentAnnotation[] toExport) + { + ap = alp; + annotations = toExport; + wholeView = false; + startExportAnnotation(); + } + + private void startExportAnnotation() + { features = false; GFFFormat.setVisible(false); CSVFormat.setVisible(true); - this.annotations = annotations; - this.sequenceGroups = list; - this.alignmentProperties = alProperties; frame.setTitle(MessageManager.getString("label.export_annotations")); } @@ -122,34 +128,7 @@ public class AnnotationExporter extends JPanel if (value == JalviewFileChooser.APPROVE_OPTION) { - String text = MessageManager.getString("label.no_features_on_alignment"); - if (features) - { - if (GFFFormat.isSelected()) - { - text = new FeaturesFile().printGFFFormat(ap.av.getAlignment() - .getDataset().getSequencesArray(), - getDisplayedFeatureCols(), true, ap.av.isShowNpFeats());// ap.av.featuresDisplayed//); - } - else - { - text = new FeaturesFile().printJalviewFormat(ap.av.getAlignment() - .getDataset().getSequencesArray(), - getDisplayedFeatureCols(), true, ap.av.isShowNpFeats()); // ap.av.featuresDisplayed); - } - } - else - { - if (CSVFormat.isSelected()) - { - text = new AnnotationFile().printCSVAnnotations(annotations); - } - else - { - text = new AnnotationFile().printAnnotations(annotations, - sequenceGroups, alignmentProperties); - } - } + String text = getFileContents(); try { @@ -167,25 +146,26 @@ public class AnnotationExporter extends JPanel close_actionPerformed(null); } - public void toTextbox_actionPerformed(ActionEvent e) + private String getFileContents() { - String text = MessageManager.getString("label.no_features_on_alignment"); + String text = MessageManager + .getString("label.no_features_on_alignment"); if (features) { if (GFFFormat.isSelected()) { text = new FeaturesFile().printGFFFormat(ap.av.getAlignment() - .getDataset().getSequencesArray(), - getDisplayedFeatureCols(), true, ap.av.isShowNpFeats()); + .getDataset().getSequencesArray(), ap.getFeatureRenderer() + .getDisplayedFeatureCols(), true, ap.av.isShowNpFeats());// ap.av.featuresDisplayed//); } else { text = new FeaturesFile().printJalviewFormat(ap.av.getAlignment() - .getDataset().getSequencesArray(), - getDisplayedFeatureCols(), true, ap.av.isShowNpFeats()); + .getDataset().getSequencesArray(), ap.getFeatureRenderer() + .getDisplayedFeatureCols(), true, ap.av.isShowNpFeats()); // ap.av.featuresDisplayed); } } - else if (!features) + else { if (CSVFormat.isSelected()) { @@ -193,14 +173,26 @@ public class AnnotationExporter extends JPanel } else { - text = new AnnotationFile().printAnnotations(annotations, - sequenceGroups, alignmentProperties); + if (wholeView) + { + text = new AnnotationFile().printAnnotationsForView(ap.av); + } + else + { + text = new AnnotationFile().printAnnotations(annotations, null, + null); + } } } - + return text; + } + public void toTextbox_actionPerformed(ActionEvent e) + { CutAndPasteTransfer cap = new CutAndPasteTransfer(); + try { + String text = getFileContents(); cap.setText(text); Desktop.addInternalFrame( cap, @@ -222,28 +214,6 @@ public class AnnotationExporter extends JPanel close_actionPerformed(null); } - - private Hashtable getDisplayedFeatureCols() - { - Hashtable fcols = new Hashtable(); - if (ap.av.getFeaturesDisplayed() == null) - { - return fcols; - } - - Enumeration en = ap.av.getFeaturesDisplayed().keys(); - FeatureRenderer fr = ap.getSeqPanel().seqCanvas.getFeatureRenderer(); // consider - // higher - // level - // method ? - while (en.hasMoreElements()) - { - Object col = en.nextElement(); - fcols.put(col, fr.featureColours.get(col)); - } - return fcols; - } - public void close_actionPerformed(ActionEvent e) { try @@ -330,5 +300,4 @@ public class AnnotationExporter extends JPanel JPanel jPanel3 = new JPanel(); FlowLayout flowLayout1 = new FlowLayout(); - } diff --git a/src/jalview/gui/AnnotationLabels.java b/src/jalview/gui/AnnotationLabels.java index 501df8a..f732a36 100755 --- a/src/jalview/gui/AnnotationLabels.java +++ b/src/jalview/gui/AnnotationLabels.java @@ -47,8 +47,8 @@ import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; import java.awt.geom.AffineTransform; import java.awt.image.BufferedImage; +import java.util.ArrayList; import java.util.Arrays; -import java.util.Vector; import java.util.regex.Pattern; import javax.swing.JCheckBoxMenuItem; @@ -249,7 +249,7 @@ public class AnnotationLabels extends JPanel implements MouseListener, { new AnnotationExporter().exportAnnotations(ap, new AlignmentAnnotation[] - { aa[selectedRow] }, null, null); + { aa[selectedRow] }); } else if (evt.getActionCommand().equals(COPYCONS_SEQ)) { @@ -872,16 +872,13 @@ public class AnnotationLabels extends JPanel implements MouseListener, Toolkit.getDefaultToolkit().getSystemClipboard() .setContents(new StringSelection(output), Desktop.instance); - Vector hiddenColumns = null; + ArrayList hiddenColumns = null; if (av.hasHiddenColumns()) { - hiddenColumns = new Vector(); - for (int i = 0; i < av.getColumnSelection().getHiddenColumns().size(); i++) + hiddenColumns = new ArrayList(); + for (int[] region : av.getColumnSelection().getHiddenColumns()) { - int[] region = (int[]) av.getColumnSelection().getHiddenColumns() - .elementAt(i); - - hiddenColumns.addElement(new int[] + hiddenColumns.add(new int[] { region[0], region[1] }); } } diff --git a/src/jalview/gui/AnnotationRowFilter.java b/src/jalview/gui/AnnotationRowFilter.java new file mode 100644 index 0000000..21c91d8 --- /dev/null +++ b/src/jalview/gui/AnnotationRowFilter.java @@ -0,0 +1,384 @@ +package jalview.gui; + +import jalview.datamodel.AlignmentAnnotation; +import jalview.datamodel.GraphLine; +import jalview.datamodel.SequenceGroup; +import jalview.schemes.AnnotationColourGradient; +import jalview.util.MessageManager; + +import java.awt.event.ActionEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.util.Vector; + +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JComboBox; +import javax.swing.JInternalFrame; +import javax.swing.JPanel; +import javax.swing.JSlider; +import javax.swing.JTextField; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; + +@SuppressWarnings("serial") +public abstract class AnnotationRowFilter extends JPanel +{ + protected AlignViewport av; + + protected AlignmentPanel ap; + + protected int[] annmap; + + protected boolean enableSeqAss = false; + + private jalview.datamodel.AlignmentAnnotation currentAnnotation; + + protected boolean adjusting = false; + + protected JCheckBox currentColours = new JCheckBox(); + + protected JPanel minColour = new JPanel(); + + protected JPanel maxColour = new JPanel(); + + protected JCheckBox seqAssociated = new JCheckBox(); + + protected JCheckBox thresholdIsMin = new JCheckBox(); + + protected JSlider slider = new JSlider(); + + protected JTextField thresholdValue = new JTextField(20); + + protected JInternalFrame frame; + + protected JButton ok = new JButton(); + + protected JButton cancel = new JButton(); + + /** + * enabled if the user is dragging the slider - try to keep updates to a + * minimun + */ + protected boolean sliderDragging = false; + + protected void addSliderChangeListener() + { + + slider.addChangeListener(new ChangeListener() + { + @Override + public void stateChanged(ChangeEvent evt) + { + if (!adjusting) + { + thresholdValue.setText((slider.getValue() / 1000f) + ""); + valueChanged(!sliderDragging); + } + } + }); + } + + protected void addSliderMouseListeners() + { + + slider.addMouseListener(new MouseAdapter() + { + @Override + public void mousePressed(MouseEvent e) + { + sliderDragging = true; + super.mousePressed(e); + } + + @Override + public void mouseDragged(MouseEvent e) + { + sliderDragging = true; + super.mouseDragged(e); + } + + @Override + public void mouseReleased(MouseEvent evt) + { + if (sliderDragging) + { + sliderDragging = false; + valueChanged(true); + } + ap.paintAlignment(true); + } + }); + } + + + public AnnotationRowFilter(AlignViewport av, final AlignmentPanel ap) + { + this.av = av; + this.ap = ap; + } + + public AnnotationRowFilter() + { + + } + + public Vector getAnnotationItems(boolean isSeqAssociated) + { + Vector list = new Vector(); + int index = 1; + int[] anmap = new int[av.getAlignment().getAlignmentAnnotation().length]; + for (int i = 0; i < av.getAlignment().getAlignmentAnnotation().length; i++) + { + if (av.getAlignment().getAlignmentAnnotation()[i].sequenceRef == null) + { + if (isSeqAssociated) + { + continue; + } + } + else + { + enableSeqAss = true; + } + String label = av.getAlignment().getAlignmentAnnotation()[i].label; + if (!list.contains(label)) + { + anmap[list.size()] = i; + list.add(label); + + } + else + { + if (!isSeqAssociated) + { + anmap[list.size()] = i; + list.add(label + "_" + (index++)); + } + } + } + this.annmap = new int[list.size()]; + System.arraycopy(anmap, 0, this.annmap, 0, this.annmap.length); + return list; + } + + protected int getSelectedThresholdItem(int indexValue) + { + int selectedThresholdItem = -1; + if (indexValue == 1) + { + selectedThresholdItem = AnnotationColourGradient.ABOVE_THRESHOLD; + } + else if (indexValue == 2) + { + selectedThresholdItem = AnnotationColourGradient.BELOW_THRESHOLD; + } + return selectedThresholdItem; + } + + public void modelChanged() + { + seqAssociated.setEnabled(enableSeqAss); + } + + public void ok_actionPerformed(ActionEvent e) + { + updateView(); + try + { + frame.setClosed(true); + } catch (Exception ex) + { + } + } + + public void cancel_actionPerformed(ActionEvent e) + { + reset(); + ap.paintAlignment(true); + try + { + frame.setClosed(true); + } catch (Exception ex) + { + } + } + + public void thresholdCheck_actionPerformed(ActionEvent e) + { + updateView(); + } + + public void annotations_actionPerformed(ActionEvent e) + { + updateView(); + } + + public void threshold_actionPerformed(ActionEvent e) + { + updateView(); + } + + public void thresholdValue_actionPerformed(ActionEvent e) + { + try + { + float f = Float.parseFloat(thresholdValue.getText()); + slider.setValue((int) (f * 1000)); + updateView(); + } catch (NumberFormatException ex) + { + } + } + + public void thresholdIsMin_actionPerformed(ActionEvent actionEvent) + { + updateView(); + } + + protected void populateThresholdComboBox(JComboBox threshold) + { + threshold.addItem(MessageManager + .getString("label.threshold_feature_no_thereshold")); + threshold.addItem(MessageManager + .getString("label.threshold_feature_above_thereshold")); + threshold.addItem(MessageManager + .getString("label.threshold_feature_below_thereshold")); + } + + protected void seqAssociated_actionPerformed(ActionEvent arg0, + JComboBox annotations, JCheckBox seqAssociated) + { + adjusting = true; + String cursel = (String) annotations.getSelectedItem(); + boolean isvalid = false, isseqs = seqAssociated.isSelected(); + annotations.removeAllItems(); + for (String anitem : getAnnotationItems(seqAssociated.isSelected())) + { + if (anitem.equals(cursel) || (isseqs && cursel.startsWith(anitem))) + { + isvalid = true; + cursel = anitem; + } + annotations.addItem(anitem); + } + adjusting = false; + if (isvalid) + { + annotations.setSelectedItem(cursel); + } + else + { + if (annotations.getItemCount() > 0) + { + annotations.setSelectedIndex(0); + } + } + } + + protected void propagateSeqAssociatedThreshold(boolean allAnnotation, + AlignmentAnnotation annotation) + { + if (annotation.sequenceRef == null || annotation.threshold == null) + { + return; + } + + float thr = annotation.threshold.value; + for (int i = 0; i < av.getAlignment().getAlignmentAnnotation().length; i++) + { + AlignmentAnnotation aa = av.getAlignment().getAlignmentAnnotation()[i]; + if (aa.label.equals(annotation.label) + && (annotation.getCalcId() == null ? aa.getCalcId() == null + : annotation.getCalcId().equals(aa.getCalcId()))) + { + if (aa.threshold == null) + { + aa.threshold = new GraphLine(annotation.threshold); + } + else + { + aa.threshold.value = thr; + } + } + } + } + + protected boolean colorAlignmContaining( + AlignmentAnnotation currentAnnotation, int selectedThresholdItem) + { + + AnnotationColourGradient acg = null; + if (currentColours.isSelected()) + { + acg = new AnnotationColourGradient(currentAnnotation, + av.getGlobalColourScheme(), selectedThresholdItem); + } + else + { + acg = new AnnotationColourGradient(currentAnnotation, + minColour.getBackground(), maxColour.getBackground(), + selectedThresholdItem); + } + acg.setSeqAssociated(seqAssociated.isSelected()); + + if (currentAnnotation.graphMin == 0f + && currentAnnotation.graphMax == 0f) + { + acg.setPredefinedColours(true); + } + + acg.thresholdIsMinMax = thresholdIsMin.isSelected(); + + av.setGlobalColourScheme(acg); + + if (av.getAlignment().getGroups() != null) + { + + for (SequenceGroup sg : ap.av.getAlignment().getGroups()) + { + if (sg.cs == null) + { + continue; + } + + if (currentColours.isSelected()) + { + sg.cs = new AnnotationColourGradient(currentAnnotation, sg.cs, + selectedThresholdItem); + ((AnnotationColourGradient) sg.cs).setSeqAssociated(seqAssociated + .isSelected()); + + } + else + { + sg.cs = new AnnotationColourGradient(currentAnnotation, + minColour.getBackground(), maxColour.getBackground(), + selectedThresholdItem); + ((AnnotationColourGradient) sg.cs).setSeqAssociated(seqAssociated + .isSelected()); + } + + } + } + return false; + } + + + public jalview.datamodel.AlignmentAnnotation getCurrentAnnotation() + { + return currentAnnotation; + } + + public void setCurrentAnnotation( + jalview.datamodel.AlignmentAnnotation currentAnnotation) + { + this.currentAnnotation = currentAnnotation; + } + + public abstract void valueChanged(boolean updateAllAnnotation); + + public abstract void updateView(); + + public abstract void reset(); +} diff --git a/src/jalview/gui/AppJmol.java b/src/jalview/gui/AppJmol.java index a4fe27c..df7f43c 100644 --- a/src/jalview/gui/AppJmol.java +++ b/src/jalview/gui/AppJmol.java @@ -938,7 +938,7 @@ public class AppJmol extends StructureViewerBase // Set the colour using the current view for the associated alignframe for (AlignmentPanel ap : _colourwith) { - jmb.colourBySequence(ap.av.showSequenceFeatures, ap); + jmb.colourBySequence(ap.av.isShowSequenceFeatures(), ap); } } } diff --git a/src/jalview/gui/AppJmolBinding.java b/src/jalview/gui/AppJmolBinding.java index 131f5bb..b7617ce 100644 --- a/src/jalview/gui/AppJmolBinding.java +++ b/src/jalview/gui/AppJmolBinding.java @@ -55,11 +55,11 @@ public class AppJmolBinding extends JalviewJmolBinding { AlignmentPanel ap = (alignment == null) ? appJmolWindow.getAlignmentPanel() : (AlignmentPanel) alignment; - if (ap.av.showSequenceFeatures) + if (ap.av.isShowSequenceFeatures()) { if (fr == null) { - fr = ap.cloneFeatureRenderer(); + fr = (jalview.gui.FeatureRenderer) ap.cloneFeatureRenderer(); } else { @@ -132,7 +132,7 @@ public class AppJmolBinding extends JalviewJmolBinding } if (!isLoadingFromArchive()) { - colourBySequence(ap.av.getShowSequenceFeatures(), ap); + colourBySequence(ap.av.isShowSequenceFeatures(), ap); } } diff --git a/src/jalview/gui/ChimeraViewFrame.java b/src/jalview/gui/ChimeraViewFrame.java index 8ebd231..384e1cc 100644 --- a/src/jalview/gui/ChimeraViewFrame.java +++ b/src/jalview/gui/ChimeraViewFrame.java @@ -904,7 +904,7 @@ public class ChimeraViewFrame extends StructureViewerBase // Set the colour using the current view for the associated alignframe for (AlignmentPanel ap : _colourwith) { - jmb.colourBySequence(ap.av.showSequenceFeatures, ap); + jmb.colourBySequence(ap.av.isShowSequenceFeatures(), ap); } } } diff --git a/src/jalview/gui/FeatureColourChooser.java b/src/jalview/gui/FeatureColourChooser.java index 8ab7c85..d1d1b6d 100644 --- a/src/jalview/gui/FeatureColourChooser.java +++ b/src/jalview/gui/FeatureColourChooser.java @@ -109,10 +109,10 @@ public class FeatureColourChooser extends JalviewDialog } }); - float mm[] = ((float[][]) fr.minmax.get(type))[0]; + float mm[] = ((float[][]) fr.getMinMax().get(type))[0]; min = mm[0]; max = mm[1]; - oldcs = fr.featureColours.get(type); + oldcs = fr.getFeatureColours().get(type); if (oldcs instanceof GraduatedColor) { if (((GraduatedColor) oldcs).isAutoScale()) @@ -470,7 +470,7 @@ public class FeatureColourChooser extends JalviewDialog maxColour.setForeground(oldmaxColour); minColour.setForeground(oldminColour); } - fr.featureColours.put(type, acg); + fr.setColour(type, acg); cs = acg; ap.paintAlignment(false); } @@ -495,7 +495,7 @@ public class FeatureColourChooser extends JalviewDialog void reset() { - fr.featureColours.put(type, oldcs); + fr.setColour(type, oldcs); ap.paintAlignment(false); cs = null; } diff --git a/src/jalview/gui/FeatureRenderer.java b/src/jalview/gui/FeatureRenderer.java index 80f1255..3ce831e 100644 --- a/src/jalview/gui/FeatureRenderer.java +++ b/src/jalview/gui/FeatureRenderer.java @@ -20,59 +20,46 @@ */ package jalview.gui; -import java.util.*; -import java.util.concurrent.ConcurrentHashMap; - -import java.awt.*; -import java.awt.event.*; -import java.awt.image.*; -import java.beans.PropertyChangeListener; -import java.beans.PropertyChangeSupport; - -import javax.swing.*; - -import jalview.datamodel.*; +import jalview.datamodel.SearchResults; +import jalview.datamodel.SequenceFeature; +import jalview.datamodel.SequenceI; import jalview.schemes.GraduatedColor; import jalview.util.MessageManager; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.GridLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +import javax.swing.JColorChooser; +import javax.swing.JComboBox; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JSpinner; +import javax.swing.JTextArea; +import javax.swing.JTextField; +import javax.swing.SwingConstants; + /** * DOCUMENT ME! * * @author $author$ * @version $Revision$ */ -public class FeatureRenderer implements jalview.api.FeatureRenderer +public class FeatureRenderer extends jalview.renderer.seqfeatures.FeatureRenderer implements jalview.api.FeatureRenderer { - AlignmentPanel ap; - - AlignViewport av; - Color resBoxColour; - /** - * global transparency for feature - */ - float transparency = 1.0f; - - FontMetrics fm; - - int charOffset; - - Map featureColours = new ConcurrentHashMap(); - - // A higher level for grouping features of a - // particular type - Map featureGroups = new ConcurrentHashMap(); - - // This is actually an Integer held in the hashtable, - // Retrieved using the key feature type - Object currentColour; - - String[] renderOrder; - - PropertyChangeSupport changeSupport = new PropertyChangeSupport(this); - - Vector allfeatures; + AlignmentPanel ap; /** * Creates a new FeatureRenderer object. @@ -82,6 +69,7 @@ public class FeatureRenderer implements jalview.api.FeatureRenderer */ public FeatureRenderer(AlignmentPanel ap) { + super(); this.ap = ap; this.av = ap.av; if (ap != null && ap.getSeqPanel() != null && ap.getSeqPanel().seqCanvas != null @@ -91,895 +79,6 @@ public class FeatureRenderer implements jalview.api.FeatureRenderer } } - public class FeatureRendererSettings implements Cloneable - { - String[] renderOrder; - - Map featureGroups; - - Map featureColours; - - float transparency; - - Map featureOrder; - - public FeatureRendererSettings(String[] renderOrder, - Hashtable featureGroups, Hashtable featureColours, - float transparency, Hashtable featureOrder) - { - super(); - this.renderOrder = renderOrder; - this.featureGroups = featureGroups; - this.featureColours = featureColours; - this.transparency = transparency; - this.featureOrder = featureOrder; - } - - /** - * create an independent instance of the feature renderer settings - * - * @param fr - */ - public FeatureRendererSettings(FeatureRenderer fr) - { - renderOrder = null; - featureGroups = new ConcurrentHashMap(); - featureColours = new ConcurrentHashMap(); - featureOrder = new ConcurrentHashMap(); - if (fr.renderOrder != null) - { - this.renderOrder = new String[fr.renderOrder.length]; - System.arraycopy(fr.renderOrder, 0, renderOrder, 0, - fr.renderOrder.length); - } - if (fr.featureGroups != null) - { - this.featureGroups = new ConcurrentHashMap(fr.featureGroups); - } - if (fr.featureColours != null) - { - this.featureColours = new ConcurrentHashMap(fr.featureColours); - } - Iterator en = fr.featureColours.keySet().iterator(); - while (en.hasNext()) - { - Object next = en.next(); - Object val = featureColours.get(next); - if (val instanceof GraduatedColor) - { - featureColours - .put(next, new GraduatedColor((GraduatedColor) val)); - } - } - this.transparency = fr.transparency; - if (fr.featureOrder != null) - { - this.featureOrder = new ConcurrentHashMap(fr.featureOrder); - } - } - } - - public FeatureRendererSettings getSettings() - { - return new FeatureRendererSettings(this); - } - - public void transferSettings(FeatureRendererSettings fr) - { - this.renderOrder = fr.renderOrder; - this.featureGroups = fr.featureGroups; - this.featureColours = fr.featureColours; - this.transparency = fr.transparency; - this.featureOrder = fr.featureOrder; - } - - /** - * update from another feature renderer - * - * @param fr - * settings to copy - */ - public void transferSettings(FeatureRenderer fr) - { - FeatureRendererSettings frs = new FeatureRendererSettings(fr); - this.renderOrder = frs.renderOrder; - this.featureGroups = frs.featureGroups; - this.featureColours = frs.featureColours; - this.transparency = frs.transparency; - this.featureOrder = frs.featureOrder; - if (av != null && av != fr.av) - { - // copy over the displayed feature settings - if (fr.av != null) - { - if (fr.av.getFeaturesDisplayed() != null) - { - // update display settings - if (av.getFeaturesDisplayed() == null) - { - av.setFeaturesDisplayed(new Hashtable(fr.av.getFeaturesDisplayed())); - } - else - { - av.getFeaturesDisplayed().clear(); - Enumeration en = fr.av.getFeaturesDisplayed().keys(); - while (en.hasMoreElements()) - { - av.getFeaturesDisplayed().put(en.nextElement(), Boolean.TRUE); - } - - } - } - } - } - } - - BufferedImage offscreenImage; - - boolean offscreenRender = false; - - public Color findFeatureColour(Color initialCol, SequenceI seq, int res) - { - return new Color(findFeatureColour(initialCol.getRGB(), seq, res)); - } - - /** - * This is used by the Molecule Viewer and Overview to get the accurate - * colourof the rendered sequence - */ - public synchronized int findFeatureColour(int initialCol, SequenceI seq, - int column) - { - if (!av.showSequenceFeatures) - { - return initialCol; - } - - if (seq != lastSeq) - { - lastSeq = seq; - sequenceFeatures = lastSeq.getDatasetSequence().getSequenceFeatures(); - if (sequenceFeatures != null) - { - sfSize = sequenceFeatures.length; - } - } - - if (sequenceFeatures != lastSeq.getDatasetSequence() - .getSequenceFeatures()) - { - sequenceFeatures = lastSeq.getDatasetSequence().getSequenceFeatures(); - if (sequenceFeatures != null) - { - sfSize = sequenceFeatures.length; - } - } - - if (sequenceFeatures == null || sfSize == 0) - { - return initialCol; - } - - if (jalview.util.Comparison.isGap(lastSeq.getCharAt(column))) - { - return Color.white.getRGB(); - } - - // Only bother making an offscreen image if transparency is applied - if (transparency != 1.0f && offscreenImage == null) - { - offscreenImage = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB); - } - - currentColour = null; - // TODO: non-threadsafe - each rendering thread needs its own instance of - // the feature renderer - or this should be synchronized. - offscreenRender = true; - - if (offscreenImage != null) - { - offscreenImage.setRGB(0, 0, initialCol); - drawSequence(offscreenImage.getGraphics(), lastSeq, column, column, 0); - - return offscreenImage.getRGB(0, 0); - } - else - { - drawSequence(null, lastSeq, lastSeq.findPosition(column), -1, -1); - - if (currentColour == null) - { - return initialCol; - } - else - { - return ((Integer) currentColour).intValue(); - } - } - - } - - /** - * DOCUMENT ME! - * - * @param g - * DOCUMENT ME! - * @param seq - * DOCUMENT ME! - * @param sg - * DOCUMENT ME! - * @param start - * DOCUMENT ME! - * @param end - * DOCUMENT ME! - * @param x1 - * DOCUMENT ME! - * @param y1 - * DOCUMENT ME! - * @param width - * DOCUMENT ME! - * @param height - * DOCUMENT ME! - */ - // String type; - // SequenceFeature sf; - SequenceI lastSeq; - - SequenceFeature[] sequenceFeatures; - - int sfSize, sfindex, spos, epos; - - /** - * show scores as heights - */ - protected boolean varyHeight = false; - - synchronized public void drawSequence(Graphics g, SequenceI seq, - int start, int end, int y1) - { - - if (seq.getDatasetSequence().getSequenceFeatures() == null - || seq.getDatasetSequence().getSequenceFeatures().length == 0) - { - return; - } - - if (g != null) - { - fm = g.getFontMetrics(); - } - - if (av.getFeaturesDisplayed() == null || renderOrder == null - || newFeatureAdded) - { - findAllFeatures(); - if (av.getFeaturesDisplayed().size() < 1) - { - return; - } - - sequenceFeatures = seq.getDatasetSequence().getSequenceFeatures(); - } - - if (lastSeq == null - || seq != lastSeq - || seq.getDatasetSequence().getSequenceFeatures() != sequenceFeatures) - { - lastSeq = seq; - sequenceFeatures = seq.getDatasetSequence().getSequenceFeatures(); - } - - if (transparency != 1 && g != null) - { - Graphics2D g2 = (Graphics2D) g; - g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, - transparency)); - } - - if (!offscreenRender) - { - spos = lastSeq.findPosition(start); - epos = lastSeq.findPosition(end); - } - - sfSize = sequenceFeatures.length; - String type; - for (int renderIndex = 0; renderIndex < renderOrder.length; renderIndex++) - { - type = renderOrder[renderIndex]; - - if (type == null || !av.getFeaturesDisplayed().containsKey(type)) - { - continue; - } - - // loop through all features in sequence to find - // current feature to render - for (sfindex = 0; sfindex < sfSize; sfindex++) - { - if (!sequenceFeatures[sfindex].type.equals(type)) - { - continue; - } - - if (featureGroups != null - && sequenceFeatures[sfindex].featureGroup != null - && sequenceFeatures[sfindex].featureGroup.length() != 0 - && featureGroups - .containsKey(sequenceFeatures[sfindex].featureGroup) - && !((Boolean) featureGroups - .get(sequenceFeatures[sfindex].featureGroup)) - .booleanValue()) - { - continue; - } - - if (!offscreenRender - && (sequenceFeatures[sfindex].getBegin() > epos || sequenceFeatures[sfindex] - .getEnd() < spos)) - { - continue; - } - - if (offscreenRender && offscreenImage == null) - { - if (sequenceFeatures[sfindex].begin <= start - && sequenceFeatures[sfindex].end >= start) - { - // this is passed out to the overview and other sequence renderers - // (e.g. molecule viewer) to get displayed colour for rendered - // sequence - currentColour = new Integer( - getColour(sequenceFeatures[sfindex]).getRGB()); - // used to be retreived from av.featuresDisplayed - // currentColour = av.featuresDisplayed - // .get(sequenceFeatures[sfindex].type); - - } - } - else if (sequenceFeatures[sfindex].type.equals("disulfide bond")) - { - - renderFeature(g, seq, - seq.findIndex(sequenceFeatures[sfindex].begin) - 1, - seq.findIndex(sequenceFeatures[sfindex].begin) - 1, - getColour(sequenceFeatures[sfindex]) - // new Color(((Integer) av.featuresDisplayed - // .get(sequenceFeatures[sfindex].type)).intValue()) - , start, end, y1); - renderFeature(g, seq, - seq.findIndex(sequenceFeatures[sfindex].end) - 1, - seq.findIndex(sequenceFeatures[sfindex].end) - 1, - getColour(sequenceFeatures[sfindex]) - // new Color(((Integer) av.featuresDisplayed - // .get(sequenceFeatures[sfindex].type)).intValue()) - , start, end, y1); - - } - else if (showFeature(sequenceFeatures[sfindex])) - { - if (av.showSeqFeaturesHeight - && sequenceFeatures[sfindex].score != Float.NaN) - { - renderScoreFeature(g, seq, - seq.findIndex(sequenceFeatures[sfindex].begin) - 1, - seq.findIndex(sequenceFeatures[sfindex].end) - 1, - getColour(sequenceFeatures[sfindex]), start, end, y1, - normaliseScore(sequenceFeatures[sfindex])); - } - else - { - renderFeature(g, seq, - seq.findIndex(sequenceFeatures[sfindex].begin) - 1, - seq.findIndex(sequenceFeatures[sfindex].end) - 1, - getColour(sequenceFeatures[sfindex]), start, end, y1); - } - } - - } - - } - - if (transparency != 1.0f && g != null) - { - Graphics2D g2 = (Graphics2D) g; - g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, - 1.0f)); - } - } - - Hashtable minmax = new Hashtable(); - - /** - * normalise a score against the max/min bounds for the feature type. - * - * @param sequenceFeature - * @return byte[] { signed, normalised signed (-127 to 127) or unsigned - * (0-255) value. - */ - private final byte[] normaliseScore(SequenceFeature sequenceFeature) - { - float[] mm = ((float[][]) minmax.get(sequenceFeature.type))[0]; - final byte[] r = new byte[] - { 0, (byte) 255 }; - if (mm != null) - { - if (r[0] != 0 || mm[0] < 0.0) - { - r[0] = 1; - r[1] = (byte) ((int) 128.0 + 127.0 * (sequenceFeature.score / mm[1])); - } - else - { - r[1] = (byte) ((int) 255.0 * (sequenceFeature.score / mm[1])); - } - } - return r; - } - - char s; - - int i; - - void renderFeature(Graphics g, SequenceI seq, int fstart, int fend, - Color featureColour, int start, int end, int y1) - { - - if (((fstart <= end) && (fend >= start))) - { - if (fstart < start) - { // fix for if the feature we have starts before the sequence start, - fstart = start; // but the feature end is still valid!! - } - - if (fend >= end) - { - fend = end; - } - int pady = (y1 + av.charHeight) - av.charHeight / 5; - for (i = fstart; i <= fend; i++) - { - s = seq.getCharAt(i); - - if (jalview.util.Comparison.isGap(s)) - { - continue; - } - - g.setColor(featureColour); - - g.fillRect((i - start) * av.charWidth, y1, av.charWidth, - av.charHeight); - - if (offscreenRender || !av.validCharWidth) - { - continue; - } - - g.setColor(Color.white); - charOffset = (av.charWidth - fm.charWidth(s)) / 2; - g.drawString(String.valueOf(s), charOffset - + (av.charWidth * (i - start)), pady); - - } - } - } - - void renderScoreFeature(Graphics g, SequenceI seq, int fstart, int fend, - Color featureColour, int start, int end, int y1, byte[] bs) - { - - if (((fstart <= end) && (fend >= start))) - { - if (fstart < start) - { // fix for if the feature we have starts before the sequence start, - fstart = start; // but the feature end is still valid!! - } - - if (fend >= end) - { - fend = end; - } - int pady = (y1 + av.charHeight) - av.charHeight / 5; - int ystrt = 0, yend = av.charHeight; - if (bs[0] != 0) - { - // signed - zero is always middle of residue line. - if (bs[1] < 128) - { - yend = av.charHeight * (128 - bs[1]) / 512; - ystrt = av.charHeight - yend / 2; - } - else - { - ystrt = av.charHeight / 2; - yend = av.charHeight * (bs[1] - 128) / 512; - } - } - else - { - yend = av.charHeight * bs[1] / 255; - ystrt = av.charHeight - yend; - - } - for (i = fstart; i <= fend; i++) - { - s = seq.getCharAt(i); - - if (jalview.util.Comparison.isGap(s)) - { - continue; - } - - g.setColor(featureColour); - int x = (i - start) * av.charWidth; - g.drawRect(x, y1, av.charWidth, av.charHeight); - g.fillRect(x, y1 + ystrt, av.charWidth, yend); - - if (offscreenRender || !av.validCharWidth) - { - continue; - } - - g.setColor(Color.black); - charOffset = (av.charWidth - fm.charWidth(s)) / 2; - g.drawString(String.valueOf(s), charOffset - + (av.charWidth * (i - start)), pady); - - } - } - } - - boolean newFeatureAdded = false; - - /** - * Called when alignment in associated view has new/modified features to - * discover and display. - * - */ - public void featuresAdded() - { - lastSeq = null; - findAllFeatures(); - } - - boolean findingFeatures = false; - - /** - * search the alignment for all new features, give them a colour and display - * them. Then fires a PropertyChangeEvent on the changeSupport object. - * - */ - void findAllFeatures() - { - synchronized (firing) - { - if (firing.equals(Boolean.FALSE)) - { - firing = Boolean.TRUE; - findAllFeatures(true); // add all new features as visible - changeSupport.firePropertyChange("changeSupport", null, null); - firing = Boolean.FALSE; - } - } - } - - /** - * Searches alignment for all features and updates colours - * - * @param newMadeVisible - * if true newly added feature types will be rendered immediatly - */ - synchronized void findAllFeatures(boolean newMadeVisible) - { - newFeatureAdded = false; - - if (findingFeatures) - { - newFeatureAdded = true; - return; - } - - findingFeatures = true; - - if (av.getFeaturesDisplayed() == null) - { - av.setFeaturesDisplayed(new Hashtable()); - } - - allfeatures = new Vector(); - Vector oldfeatures = new Vector(); - if (renderOrder != null) - { - for (int i = 0; i < renderOrder.length; i++) - { - if (renderOrder[i] != null) - { - oldfeatures.addElement(renderOrder[i]); - } - } - } - if (minmax == null) - { - minmax = new Hashtable(); - } - AlignmentI alignment = av.getAlignment(); - for (int i = 0; i < alignment.getHeight(); i++) - { - SequenceFeature[] features = alignment.getSequenceAt(i) - .getDatasetSequence().getSequenceFeatures(); - - if (features == null) - { - continue; - } - - int index = 0; - while (index < features.length) - { - if (!av.getFeaturesDisplayed().containsKey(features[index].getType())) - { - - if (featureGroups.containsKey(features[index].getType())) - { - boolean visible = ((Boolean) featureGroups - .get(features[index].featureGroup)).booleanValue(); - - if (!visible) - { - index++; - continue; - } - } - - if (!(features[index].begin == 0 && features[index].end == 0)) - { - // If beginning and end are 0, the feature is for the whole sequence - // and we don't want to render the feature in the normal way - - if (newMadeVisible - && !oldfeatures.contains(features[index].getType())) - { - // this is a new feature type on the alignment. Mark it for - // display. - av.getFeaturesDisplayed().put(features[index].getType(), - new Integer(getColour(features[index].getType()) - .getRGB())); - setOrder(features[index].getType(), 0); - } - } - } - if (!allfeatures.contains(features[index].getType())) - { - allfeatures.addElement(features[index].getType()); - } - if (features[index].score != Float.NaN) - { - int nonpos = features[index].getBegin() >= 1 ? 0 : 1; - float[][] mm = (float[][]) minmax.get(features[index].getType()); - if (mm == null) - { - mm = new float[][] - { null, null }; - minmax.put(features[index].getType(), mm); - } - if (mm[nonpos] == null) - { - mm[nonpos] = new float[] - { features[index].score, features[index].score }; - - } - else - { - if (mm[nonpos][0] > features[index].score) - { - mm[nonpos][0] = features[index].score; - } - if (mm[nonpos][1] < features[index].score) - { - mm[nonpos][1] = features[index].score; - } - } - } - index++; - } - } - updateRenderOrder(allfeatures); - findingFeatures = false; - } - - protected Boolean firing = Boolean.FALSE; - - /** - * replaces the current renderOrder with the unordered features in - * allfeatures. The ordering of any types in both renderOrder and allfeatures - * is preserved, and all new feature types are rendered on top of the existing - * types, in the order given by getOrder or the order given in allFeatures. - * Note. this operates directly on the featureOrder hash for efficiency. TODO: - * eliminate the float storage for computing/recalling the persistent ordering - * New Cability: updates min/max for colourscheme range if its dynamic - * - * @param allFeatures - */ - private void updateRenderOrder(Vector allFeatures) - { - Vector allfeatures = new Vector(allFeatures); - String[] oldRender = renderOrder; - renderOrder = new String[allfeatures.size()]; - Object mmrange, fc = null; - boolean initOrders = (featureOrder == null); - int opos = 0; - if (oldRender != null && oldRender.length > 0) - { - for (int j = 0; j < oldRender.length; j++) - { - if (oldRender[j] != null) - { - if (initOrders) - { - setOrder(oldRender[j], (1 - (1 + (float) j) - / (float) oldRender.length)); - } - if (allfeatures.contains(oldRender[j])) - { - renderOrder[opos++] = oldRender[j]; // existing features always - // appear below new features - allfeatures.removeElement(oldRender[j]); - if (minmax != null) - { - mmrange = minmax.get(oldRender[j]); - if (mmrange != null) - { - fc = featureColours.get(oldRender[j]); - if (fc != null && fc instanceof GraduatedColor - && ((GraduatedColor) fc).isAutoScale()) - { - ((GraduatedColor) fc).updateBounds( - ((float[][]) mmrange)[0][0], - ((float[][]) mmrange)[0][1]); - } - } - } - } - } - } - } - if (allfeatures.size() == 0) - { - // no new features - leave order unchanged. - return; - } - int i = allfeatures.size() - 1; - int iSize = i; - boolean sort = false; - String[] newf = new String[allfeatures.size()]; - float[] sortOrder = new float[allfeatures.size()]; - Enumeration en = allfeatures.elements(); - // sort remaining elements - while (en.hasMoreElements()) - { - newf[i] = en.nextElement().toString(); - if (minmax != null) - { - // update from new features minmax if necessary - mmrange = minmax.get(newf[i]); - if (mmrange != null) - { - fc = featureColours.get(newf[i]); - if (fc != null && fc instanceof GraduatedColor - && ((GraduatedColor) fc).isAutoScale()) - { - ((GraduatedColor) fc).updateBounds(((float[][]) mmrange)[0][0], - ((float[][]) mmrange)[0][1]); - } - } - } - if (initOrders || !featureOrder.containsKey(newf[i])) - { - int denom = initOrders ? allfeatures.size() : featureOrder.size(); - // new unordered feature - compute persistent ordering at head of - // existing features. - setOrder(newf[i], i / (float) denom); - } - // set order from newly found feature from persisted ordering. - sortOrder[i] = 2 - ((Float) featureOrder.get(newf[i])).floatValue(); - if (i < iSize) - { - // only sort if we need to - sort = sort || sortOrder[i] > sortOrder[i + 1]; - } - i--; - } - if (iSize > 1 && sort) - { - jalview.util.QuickSort.sort(sortOrder, newf); - } - sortOrder = null; - System.arraycopy(newf, 0, renderOrder, opos, newf.length); - } - - /** - * get a feature style object for the given type string. Creates a - * java.awt.Color for a featureType with no existing colourscheme. TODO: - * replace return type with object implementing standard abstract colour/style - * interface - * - * @param featureType - * @return java.awt.Color or GraduatedColor - */ - public Object getFeatureStyle(String featureType) - { - Object fc = featureColours.get(featureType); - if (fc == null) - { - jalview.schemes.UserColourScheme ucs = new jalview.schemes.UserColourScheme(); - Color col = ucs.createColourFromName(featureType); - featureColours.put(featureType, fc = col); - } - return fc; - } - - /** - * return a nominal colour for this feature - * - * @param featureType - * @return standard color, or maximum colour for graduated colourscheme - */ - public Color getColour(String featureType) - { - Object fc = getFeatureStyle(featureType); - - if (fc instanceof Color) - { - return (Color) fc; - } - else - { - if (fc instanceof GraduatedColor) - { - return ((GraduatedColor) fc).getMaxColor(); - } - } - throw new Error(MessageManager.formatMessage("error.implementation_error_unrecognised_render_object_for_features_type", new String[]{fc.getClass().toString(),featureType})); - } - - /** - * calculate the render colour for a specific feature using current feature - * settings. - * - * @param feature - * @return render colour for the given feature - */ - public Color getColour(SequenceFeature feature) - { - Object fc = getFeatureStyle(feature.getType()); - if (fc instanceof Color) - { - return (Color) fc; - } - else - { - if (fc instanceof GraduatedColor) - { - return ((GraduatedColor) fc).findColor(feature); - } - } - throw new Error(MessageManager.formatMessage("error.implementation_error_unrecognised_render_object_for_features_type", new String[]{fc.getClass().toString(),feature.getType()})); - } - - private boolean showFeature(SequenceFeature sequenceFeature) - { - Object fc = getFeatureStyle(sequenceFeature.type); - if (fc instanceof GraduatedColor) - { - return ((GraduatedColor) fc).isColored(sequenceFeature); - } - else - { - return true; - } - } - // // ///////////// // // Feature Editing Dialog // // Will be refactored in next release. @@ -1235,7 +334,9 @@ public class FeatureRenderer implements jalview.api.FeatureRenderer lastDescriptionAdded = description.getText().replaceAll("\n", " "); // TODO: determine if the null feature group is valid if (lastFeatureGroupAdded.length() < 1) + { lastFeatureGroupAdded = null; + } } if (!newFeatures) @@ -1253,7 +354,7 @@ public class FeatureRenderer implements jalview.api.FeatureRenderer sf.description = lastDescriptionAdded; setColour(sf.type, fcol); - av.getFeaturesDisplayed().put(sf.type, getColour(sf.type)); + getFeaturesDisplayed().setVisible(sf.type); try { @@ -1274,27 +375,19 @@ public class FeatureRenderer implements jalview.api.FeatureRenderer for (int i = 0; i < sequences.length; i++) { features[i].type = lastFeatureAdded; - if (lastFeatureGroupAdded != null) - features[i].featureGroup = lastFeatureGroupAdded; + // fix for JAL-1538 - always set feature group here + features[i].featureGroup = lastFeatureGroupAdded; features[i].description = lastDescriptionAdded; sequences[i].addSequenceFeature(features[i]); ffile.parseDescriptionHTML(features[i], false); } - if (av.getFeaturesDisplayed() == null) - { - av.setFeaturesDisplayed(new Hashtable()); - } - if (lastFeatureGroupAdded != null) { - if (featureGroups == null) - featureGroups = new Hashtable(); - featureGroups.put(lastFeatureGroupAdded, new Boolean(true)); + setGroupVisibility(lastFeatureGroupAdded, true); } setColour(lastFeatureAdded, fcol); - av.getFeaturesDisplayed().put(lastFeatureAdded, - getColour(lastFeatureAdded)); + setVisible(lastFeatureAdded); findAllFeatures(false); @@ -1313,6 +406,7 @@ public class FeatureRenderer implements jalview.api.FeatureRenderer return true; } + /** * update the amend feature button dependent on the given style * @@ -1340,145 +434,4 @@ public class FeatureRenderer implements jalview.api.FeatureRenderer // colour.setForeground(colour.getBackground()); } } - - public void setColour(String featureType, Object col) - { - // overwrite - // Color _col = (col instanceof Color) ? ((Color) col) : (col instanceof - // GraduatedColor) ? ((GraduatedColor) col).getMaxColor() : null; - // Object c = featureColours.get(featureType); - // if (c == null || c instanceof Color || (c instanceof GraduatedColor && - // !((GraduatedColor)c).getMaxColor().equals(_col))) - { - featureColours.put(featureType, col); - } - } - - public void setTransparency(float value) - { - transparency = value; - } - - public float getTransparency() - { - return transparency; - } - - /** - * Replace current ordering with new ordering - * - * @param data - * { String(Type), Colour(Type), Boolean(Displayed) } - */ - public void setFeaturePriority(Object[][] data) - { - setFeaturePriority(data, true); - } - - /** - * - * @param data - * { String(Type), Colour(Type), Boolean(Displayed) } - * @param visibleNew - * when true current featureDisplay list will be cleared - */ - public void setFeaturePriority(Object[][] data, boolean visibleNew) - { - if (visibleNew) - { - if (av.getFeaturesDisplayed() != null) - { - av.getFeaturesDisplayed().clear(); - } - else - { - av.setFeaturesDisplayed(new Hashtable()); - } - } - if (data == null) - { - return; - } - - // The feature table will display high priority - // features at the top, but theses are the ones - // we need to render last, so invert the data - renderOrder = new String[data.length]; - - if (data.length > 0) - { - for (int i = 0; i < data.length; i++) - { - String type = data[i][0].toString(); - setColour(type, data[i][1]); // todo : typesafety - feature color - // interface object - if (((Boolean) data[i][2]).booleanValue()) - { - av.getFeaturesDisplayed().put(type, new Integer(getColour(type) - .getRGB())); - } - - renderOrder[data.length - i - 1] = type; - } - } - - } - - Map featureOrder = null; - - /** - * analogous to colour - store a normalized ordering for all feature types in - * this rendering context. - * - * @param type - * Feature type string - * @param position - * normalized priority - 0 means always appears on top, 1 means - * always last. - */ - public float setOrder(String type, float position) - { - if (featureOrder == null) - { - featureOrder = new Hashtable(); - } - featureOrder.put(type, new Float(position)); - return position; - } - - /** - * get the global priority (0 (top) to 1 (bottom)) - * - * @param type - * @return [0,1] or -1 for a type without a priority - */ - public float getOrder(String type) - { - if (featureOrder != null) - { - if (featureOrder.containsKey(type)) - { - return ((Float) featureOrder.get(type)).floatValue(); - } - } - return -1; - } - - /** - * @param listener - * @see java.beans.PropertyChangeSupport#addPropertyChangeListener(java.beans.PropertyChangeListener) - */ - public void addPropertyChangeListener(PropertyChangeListener listener) - { - changeSupport.addPropertyChangeListener(listener); - } - - /** - * @param listener - * @see java.beans.PropertyChangeSupport#removePropertyChangeListener(java.beans.PropertyChangeListener) - */ - public void removePropertyChangeListener(PropertyChangeListener listener) - { - changeSupport.removePropertyChangeListener(listener); - } } diff --git a/src/jalview/gui/FeatureSettings.java b/src/jalview/gui/FeatureSettings.java index 0f14bed..3475fe3 100644 --- a/src/jalview/gui/FeatureSettings.java +++ b/src/jalview/gui/FeatureSettings.java @@ -20,12 +20,8 @@ */ package jalview.gui; -import jalview.analysis.AlignmentSorter; import jalview.bin.Cache; -import jalview.commands.OrderCommand; -import jalview.datamodel.AlignmentI; import jalview.datamodel.SequenceFeature; -import jalview.datamodel.SequenceGroup; import jalview.datamodel.SequenceI; import jalview.gui.Help.HelpId; import jalview.io.JalviewFileChooser; @@ -56,10 +52,10 @@ import java.io.FileOutputStream; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.PrintWriter; -import java.util.ArrayList; import java.util.Hashtable; import java.util.Iterator; import java.util.List; +import java.util.Set; import java.util.Vector; import javax.help.HelpSetException; @@ -107,6 +103,8 @@ public class FeatureSettings extends JPanel Object[][] originalData; + private float originalTransparency; + final JInternalFrame frame; JScrollPane scrollPane = new JScrollPane(); @@ -123,8 +121,8 @@ public class FeatureSettings extends JPanel { this.af = af; fr = af.getFeatureRenderer(); - - transparency.setMaximum(100 - (int) (fr.transparency * 100)); + // allow transparency to be recovered + transparency.setMaximum(100 - (int) ((originalTransparency=fr.getTransparency()) * 100)); try { @@ -165,8 +163,8 @@ public class FeatureSettings extends JPanel if (SwingUtilities.isRightMouseButton(evt)) { popupSort(selectedRow, (String) table.getValueAt(selectedRow, 0), - table.getValueAt(selectedRow, 1), fr.minmax, evt.getX(), - evt.getY()); + table.getValueAt(selectedRow, 1), fr.getMinMax(), + evt.getX(), evt.getY()); } else if (evt.getClickCount() == 2) { @@ -185,7 +183,8 @@ public class FeatureSettings extends JPanel if (evt.isPopupTrigger()) { popupSort(selectedRow, (String) table.getValueAt(selectedRow, 0), - table.getValueAt(selectedRow, 1), fr.minmax, evt.getX(), + table.getValueAt(selectedRow, 1), fr.getMinMax(), + evt.getX(), evt.getY()); } } @@ -222,8 +221,7 @@ public class FeatureSettings extends JPanel dassourceBrowser = new DasSourceBrowser(this); dasSettingsPane.add(dassourceBrowser, BorderLayout.CENTER); - if (af.getViewport().getFeaturesDisplayed() == null - || fr.renderOrder == null) + if (af.getViewport().isShowSequenceFeatures() || !fr.hasRenderOrder()) { fr.findAllFeatures(true); // display everything! } @@ -288,7 +286,7 @@ public class FeatureSettings extends JPanel public void actionPerformed(ActionEvent e) { - me.sortByScore(new String[] + me.af.avc.sortAlignmentByFeatureScore(new String[] { type }); } @@ -300,7 +298,7 @@ public class FeatureSettings extends JPanel public void actionPerformed(ActionEvent e) { - me.sortByDens(new String[] + me.af.avc.sortAlignmentByFeatureDensity(new String[] { type }); } @@ -424,10 +422,6 @@ public class FeatureSettings extends JPanel synchronized public void setTableData() { - if (fr.featureGroups == null) - { - fr.featureGroups = new Hashtable(); - } Vector allFeatures = new Vector(); Vector allGroups = new Vector(); SequenceFeature[] tmpfeatures; @@ -458,10 +452,7 @@ public class FeatureSettings extends JPanel if (!allGroups.contains(group)) { allGroups.addElement(group); - if (group != null) - { - checkGroupState(group); - } + checkGroupState(group); } } @@ -479,21 +470,14 @@ public class FeatureSettings extends JPanel } /** + * Synchronise gui group list and check visibility of group * * @param group - * @return true if group has been seen before and is already added to set. + * @return true if group is visible */ private boolean checkGroupState(String group) { - boolean visible; - if (fr.featureGroups.containsKey(group)) - { - visible = ((Boolean) fr.featureGroups.get(group)).booleanValue(); - } - else - { - visible = true; // new group is always made visible - } + boolean visible = fr.checkGroupVisibility(group, true); if (groupPanel == null) { @@ -514,10 +498,8 @@ public class FeatureSettings extends JPanel if (alreadyAdded) { - return true; + return visible; } - - fr.featureGroups.put(group, new Boolean(visible)); final String grp = group; final JCheckBox check = new JCheckBox(group, visible); check.setFont(new Font("Serif", Font.BOLD, 12)); @@ -525,8 +507,7 @@ public class FeatureSettings extends JPanel { public void itemStateChanged(ItemEvent evt) { - fr.featureGroups.put(check.getText(), - new Boolean(check.isSelected())); + fr.setGroupVisibility(check.getText(), check.isSelected()); af.alignPanel.getSeqPanel().seqCanvas.repaint(); if (af.alignPanel.overviewPanel != null) { @@ -538,7 +519,7 @@ public class FeatureSettings extends JPanel } }); groupPanel.add(check); - return false; + return visible; } boolean resettingTable = false; @@ -582,13 +563,8 @@ public class FeatureSettings extends JPanel continue; } - if (group == null || fr.featureGroups.get(group) == null - || ((Boolean) fr.featureGroups.get(group)).booleanValue()) + if (group == null || checkGroupState(group)) { - if (group != null) - { - checkGroupState(group); - } type = tmpfeatures[index].getType(); if (!visibleChecks.contains(type)) { @@ -623,19 +599,20 @@ public class FeatureSettings extends JPanel Object[][] data = new Object[fSize][3]; int dataIndex = 0; - if (fr.renderOrder != null) + if (fr.hasRenderOrder()) { if (!handlingUpdate) - { + { fr.findAllFeatures(groupChanged != null); // prod to update + // colourschemes. but don't + // affect display + // First add the checks in the previous render order, + // in case the window has been closed and reopened } - // colourschemes. but don't - // affect display - // First add the checks in the previous render order, - // in case the window has been closed and reopened - for (int ro = fr.renderOrder.length - 1; ro > -1; ro--) + List frl = fr.getRenderOrder(); + for (int ro = frl.size() - 1; ro > -1; ro--) { - type = fr.renderOrder[ro]; + type = frl.get(ro); if (!visibleChecks.contains(type)) { @@ -644,8 +621,8 @@ public class FeatureSettings extends JPanel data[dataIndex][0] = type; data[dataIndex][1] = fr.getFeatureStyle(type); - data[dataIndex][2] = new Boolean( - af.getViewport().getFeaturesDisplayed().containsKey(type)); + data[dataIndex][2] = new Boolean(af.getViewport() + .getFeaturesDisplayed().isVisible(type)); dataIndex++; visibleChecks.removeElement(type); } @@ -663,7 +640,7 @@ public class FeatureSettings extends JPanel if (data[dataIndex][1] == null) { // "Colour has been updated in another view!!" - fr.renderOrder = null; + fr.clearRenderOrder(); return; } @@ -685,8 +662,8 @@ public class FeatureSettings extends JPanel if (groupPanel != null) { - groupPanel.setLayout(new GridLayout(fr.featureGroups.size() / 4 + 1, - 4)); + groupPanel.setLayout(new GridLayout( + fr.getFeatureGroupsSize() / 4 + 1, 4)); groupPanel.validate(); bigPanel.add(groupPanel, BorderLayout.NORTH); @@ -843,9 +820,10 @@ public class FeatureSettings extends JPanel PrintWriter out = new PrintWriter(new OutputStreamWriter( new FileOutputStream(choice), "UTF-8")); - Iterator e = fr.featureColours.keySet().iterator(); - float[] sortOrder = new float[fr.featureColours.size()]; - String[] sortTypes = new String[fr.featureColours.size()]; + Set fr_colours = fr.getAllFeatureColours(); + Iterator e = fr_colours.iterator(); + float[] sortOrder = new float[fr_colours.size()]; + String[] sortTypes = new String[fr_colours.size()]; int i = 0; while (e.hasNext()) { @@ -1068,7 +1046,7 @@ public class FeatureSettings extends JPanel { public void actionPerformed(ActionEvent e) { - sortByScore(null); + af.avc.sortAlignmentByFeatureScore(null); } }); sortByDens.setFont(JvSwingUtils.getLabelFont()); @@ -1078,7 +1056,22 @@ public class FeatureSettings extends JPanel { public void actionPerformed(ActionEvent e) { - sortByDens(null); + af.avc.sortAlignmentByFeatureDensity(null); + } + }); + help.setFont(JvSwingUtils.getLabelFont()); + help.setText(MessageManager.getString("action.help")); + help.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent e) + { + try + { + Help.showHelpWindow(HelpId.SequenceFeatureSettings); + } catch (HelpSetException e1) + { + e1.printStackTrace(); + } } }); help.setFont(JvSwingUtils.getLabelFont()); @@ -1102,6 +1095,7 @@ public class FeatureSettings extends JPanel { public void actionPerformed(ActionEvent e) { + fr.setTransparency(originalTransparency); updateFeatureRenderer(originalData); close(); } @@ -1198,131 +1192,6 @@ public class FeatureSettings extends JPanel settingsPane.add(buttonPanel, java.awt.BorderLayout.SOUTH); } - protected void sortByDens(String[] typ) - { - sortBy(typ, "Sort by Density", AlignmentSorter.FEATURE_DENSITY); - } - - protected void sortBy(String[] typ, String methodText, final String method) - { - if (typ == null) - { - typ = getDisplayedFeatureTypes(); - } - String gps[] = null; - gps = getDisplayedFeatureGroups(); - if (typ != null) - { - ArrayList types = new ArrayList(); - for (int i = 0; i < typ.length; i++) - { - if (typ[i] != null) - { - types.add(typ[i]); - } - typ = new String[types.size()]; - types.toArray(typ); - } - } - if (gps != null) - { - ArrayList grps = new ArrayList(); - - for (int i = 0; i < gps.length; i++) - { - if (gps[i] != null) - { - grps.add(gps[i]); - } - } - gps = new String[grps.size()]; - grps.toArray(gps); - } - AlignmentPanel alignPanel = af.alignPanel; - AlignmentI al = alignPanel.av.getAlignment(); - - int start, stop; - SequenceGroup sg = alignPanel.av.getSelectionGroup(); - if (sg != null) - { - start = sg.getStartRes(); - stop = sg.getEndRes(); - } - else - { - start = 0; - stop = al.getWidth(); - } - SequenceI[] oldOrder = al.getSequencesArray(); - AlignmentSorter.sortByFeature(typ, gps, start, stop, al, method); - af.addHistoryItem(new OrderCommand(methodText, oldOrder, alignPanel.av - .getAlignment())); - alignPanel.paintAlignment(true); - - } - - protected void sortByScore(String[] typ) - { - sortBy(typ, "Sort by Feature Score", AlignmentSorter.FEATURE_SCORE); - } - - private String[] getDisplayedFeatureTypes() - { - String[] typ = null; - if (fr != null) - { - synchronized (fr.renderOrder) - { - typ = new String[fr.renderOrder.length]; - System.arraycopy(fr.renderOrder, 0, typ, 0, typ.length); - for (int i = 0; i < typ.length; i++) - { - if (af.viewport.getFeaturesDisplayed().get(typ[i]) == null) - { - typ[i] = null; - } - } - } - } - return typ; - } - - private String[] getDisplayedFeatureGroups() - { - String[] gps = null; - ArrayList _gps = new ArrayList(); - if (fr != null) - { - - if (fr.featureGroups != null) - { - Iterator en = fr.featureGroups.keySet().iterator(); - int g = 0; - boolean valid = false; - while (en.hasNext()) - { - String gp = (String) en.next(); - Boolean on = (Boolean) fr.featureGroups.get(gp); - if (on != null && on.booleanValue()) - { - valid = true; - _gps.add(gp); - } - } - if (!valid) - { - return null; - } - else - { - gps = new String[_gps.size()]; - _gps.toArray(gps); - } - } - } - return gps; - } - public void fetchDAS_actionPerformed(ActionEvent e) { fetchDAS.setEnabled(false); diff --git a/src/jalview/gui/IdCanvas.java b/src/jalview/gui/IdCanvas.java index 6810fed..3bc3168 100755 --- a/src/jalview/gui/IdCanvas.java +++ b/src/jalview/gui/IdCanvas.java @@ -310,7 +310,7 @@ public class IdCanvas extends JPanel for (int i = starty; i < alheight; i++) { SequenceI s = av.getAlignment().getSequenceAt(i); - if (av.hasHiddenRows()) + if (av.isDisplayReferenceSeq() || av.hasHiddenRows()) { setHiddenFont(s); } @@ -350,7 +350,7 @@ public class IdCanvas extends JPanel continue; } - if (av.hasHiddenRows()) + if (av.isDisplayReferenceSeq() || av.hasHiddenRows()) { setHiddenFont(sequence); } diff --git a/src/jalview/gui/IdPanel.java b/src/jalview/gui/IdPanel.java index 3486f72..a22e918 100755 --- a/src/jalview/gui/IdPanel.java +++ b/src/jalview/gui/IdPanel.java @@ -111,7 +111,7 @@ public class IdPanel extends JPanel implements MouseListener, seqAnnotReport .createSequenceAnnotationReport(tip, sequence, av.isShowDbRefs(), av.isShowNpFeats(), - sp.seqCanvas.fr.minmax); + sp.seqCanvas.fr.getMinMax()); setToolTipText("" + sequence.getDisplayId(true) + " " + tip.toString() + ""); } diff --git a/src/jalview/gui/Jalview2XML.java b/src/jalview/gui/Jalview2XML.java index 728d2fc..102e463 100644 --- a/src/jalview/gui/Jalview2XML.java +++ b/src/jalview/gui/Jalview2XML.java @@ -74,6 +74,8 @@ import jalview.util.MessageManager; import jalview.util.Platform; import jalview.util.jarInputStreamProvider; import jalview.viewmodel.AlignmentViewport; +import jalview.viewmodel.seqfeatures.FeatureRendererSettings; +import jalview.viewmodel.seqfeatures.FeaturesDisplayed; import jalview.ws.jws2.Jws2Discoverer; import jalview.ws.jws2.dm.AAConSettings; import jalview.ws.jws2.jabaws2.Jws2Instance; @@ -1096,12 +1098,12 @@ public class Jalview2XML view.setFontSize(av.font.getSize()); view.setFontStyle(av.font.getStyle()); view.setRenderGaps(av.renderGaps); - view.setShowAnnotation(av.getShowAnnotation()); + view.setShowAnnotation(av.isShowAnnotation()); view.setShowBoxes(av.getShowBoxes()); view.setShowColourText(av.getColourText()); view.setShowFullId(av.getShowJVSuffix()); view.setRightAlignIds(av.isRightAlignIds()); - view.setShowSequenceFeatures(av.showSequenceFeatures); + view.setShowSequenceFeatures(av.isShowSequenceFeatures()); view.setShowText(av.getShowText()); view.setShowUnconserved(av.getShowUnconserved()); view.setWrapAlignment(av.getWrapAlignment()); @@ -1122,7 +1124,8 @@ public class Jalview2XML { jalview.schemabinding.version2.FeatureSettings fs = new jalview.schemabinding.version2.FeatureSettings(); - String[] renderOrder = ap.getSeqPanel().seqCanvas.getFeatureRenderer().renderOrder; + String[] renderOrder = ap.getSeqPanel().seqCanvas.getFeatureRenderer() + .getRenderOrder().toArray(new String[0]); Vector settingsAdded = new Vector(); Object gstyle = null; @@ -1153,8 +1156,8 @@ public class Jalview2XML .getColour(renderOrder[ro]).getRGB()); } - setting.setDisplay(av.getFeaturesDisplayed() - .containsKey(renderOrder[ro])); + setting.setDisplay(av.getFeaturesDisplayed().isVisible( + renderOrder[ro])); float rorder = ap.getSeqPanel().seqCanvas.getFeatureRenderer() .getOrder(renderOrder[ro]); if (rorder > -1) @@ -1167,8 +1170,8 @@ public class Jalview2XML } // Make sure we save none displayed feature settings - Iterator en = ap.getSeqPanel().seqCanvas.getFeatureRenderer().featureColours - .keySet().iterator(); + Iterator en = ap.getSeqPanel().seqCanvas.getFeatureRenderer() + .getFeatureColours().keySet().iterator(); while (en.hasNext()) { String key = en.next().toString(); @@ -1192,8 +1195,9 @@ public class Jalview2XML fs.addSetting(setting); settingsAdded.addElement(key); } - en = ap.getSeqPanel().seqCanvas.getFeatureRenderer().featureGroups - .keySet().iterator(); + // is groups actually supposed to be a map here ? + en = ap.getSeqPanel().seqCanvas.getFeatureRenderer().getFeatureGroups() + .iterator(); Vector groupsAdded = new Vector(); while (en.hasNext()) { @@ -1205,7 +1209,7 @@ public class Jalview2XML Group g = new Group(); g.setName(grp); g.setDisplay(((Boolean) ap.getSeqPanel().seqCanvas - .getFeatureRenderer().featureGroups.get(grp)) + .getFeatureRenderer().checkGroupVisibility(grp, false)) .booleanValue()); fs.addGroup(g); groupsAdded.addElement(grp); @@ -1226,8 +1230,8 @@ public class Jalview2XML for (int c = 0; c < av.getColumnSelection().getHiddenColumns() .size(); c++) { - int[] region = (int[]) av.getColumnSelection() - .getHiddenColumns().elementAt(c); + int[] region = av.getColumnSelection() + .getHiddenColumns().get(c); HiddenColumns hc = new HiddenColumns(); hc.setStart(region[0]); hc.setEnd(region[1]); @@ -1488,6 +1492,7 @@ public class Jalview2XML an.addProperty(prop); } } + AnnotationElement ae; if (aa[i].annotations != null) { @@ -3738,10 +3743,8 @@ public class Jalview2XML af.viewport.setColourAppliesToAllGroups(true); - if (view.getShowSequenceFeatures()) - { - af.viewport.showSequenceFeatures = true; - } + af.viewport.setShowSequenceFeatures(view.getShowSequenceFeatures()); + if (view.hasCentreColumnLabels()) { af.viewport.setCentreColumnLabels(view.getCentreColumnLabels()); @@ -3808,9 +3811,14 @@ public class Jalview2XML // recover featre settings if (jms.getFeatureSettings() != null) { - af.viewport.setFeaturesDisplayed(new Hashtable()); + FeaturesDisplayed fdi; + af.viewport.setFeaturesDisplayed(fdi = new FeaturesDisplayed()); String[] renderOrder = new String[jms.getFeatureSettings() .getSettingCount()]; + Hashtable featureGroups = new Hashtable(); + Hashtable featureColours = new Hashtable(); + Hashtable featureOrder = new Hashtable(); + for (int fs = 0; fs < jms.getFeatureSettings().getSettingCount(); fs++) { Setting setting = jms.getFeatureSettings().getSetting(fs); @@ -3837,41 +3845,42 @@ public class Jalview2XML gc.setColourByLabel(setting.getColourByLabel()); } // and put in the feature colour table. - af.alignPanel.getSeqPanel().seqCanvas.getFeatureRenderer().setColour( - setting.getType(), gc); + featureColours.put(setting.getType(), gc); } else { - af.alignPanel.getSeqPanel().seqCanvas.getFeatureRenderer().setColour( - setting.getType(), + featureColours.put(setting.getType(), new java.awt.Color(setting.getColour())); } renderOrder[fs] = setting.getType(); if (setting.hasOrder()) { - af.alignPanel.getSeqPanel().seqCanvas.getFeatureRenderer().setOrder( - setting.getType(), setting.getOrder()); + featureOrder.put(setting.getType(), setting.getOrder()); } else { - af.alignPanel.getSeqPanel().seqCanvas.getFeatureRenderer().setOrder( - setting.getType(), - fs / jms.getFeatureSettings().getSettingCount()); + featureOrder.put(setting.getType(), new Float(fs + / jms.getFeatureSettings().getSettingCount())); } if (setting.getDisplay()) { - af.viewport.getFeaturesDisplayed().put(setting.getType(), new Integer( - setting.getColour())); + fdi.setVisible(setting.getType()); } } - af.alignPanel.getSeqPanel().seqCanvas.getFeatureRenderer().renderOrder = renderOrder; - Hashtable fgtable; - af.alignPanel.getSeqPanel().seqCanvas.getFeatureRenderer().featureGroups = fgtable = new Hashtable(); + Hashtable fgtable = new Hashtable(); for (int gs = 0; gs < jms.getFeatureSettings().getGroupCount(); gs++) { Group grp = jms.getFeatureSettings().getGroup(gs); fgtable.put(grp.getName(), new Boolean(grp.getDisplay())); } + // FeatureRendererSettings frs = new FeatureRendererSettings(renderOrder, + // fgtable, featureColours, jms.getFeatureSettings().hasTransparency() ? + // jms.getFeatureSettings().getTransparency() : 0.0, featureOrder); + FeatureRendererSettings frs = new FeatureRendererSettings( + renderOrder, fgtable, featureColours, 1.0f, featureOrder); + af.alignPanel.getSeqPanel().seqCanvas.getFeatureRenderer() + .transferSettings(frs); + } if (view.getHiddenColumnsCount() > 0) @@ -4733,5 +4742,4 @@ public class Jalview2XML { skipList = skipList2; } - } diff --git a/src/jalview/gui/Jalview2XML_V1.java b/src/jalview/gui/Jalview2XML_V1.java index 033b6dc..586e2fa 100755 --- a/src/jalview/gui/Jalview2XML_V1.java +++ b/src/jalview/gui/Jalview2XML_V1.java @@ -40,6 +40,7 @@ import jalview.schemes.ResidueProperties; import jalview.structure.StructureSelectionManager; import jalview.util.MessageManager; import jalview.util.jarInputStreamProvider; +import jalview.viewmodel.seqfeatures.FeatureRendererSettings; import java.io.InputStreamReader; import java.util.Hashtable; @@ -411,29 +412,31 @@ public class Jalview2XML_V1 } af.viewport.setColourAppliesToAllGroups(true); - af.viewport.showSequenceFeatures = view.getShowSequenceFeatures(); + af.viewport.setShowSequenceFeatures(view.getShowSequenceFeatures()); if (jms.getFeatureSettings() != null) { - af.viewport.setFeaturesDisplayed(new Hashtable()); + Hashtable featuresDisplayed = new Hashtable(); + Hashtable featureColours = new Hashtable(); String[] renderOrder = new String[jms.getFeatureSettings() .getSettingCount()]; for (int fs = 0; fs < jms.getFeatureSettings().getSettingCount(); fs++) { Setting setting = jms.getFeatureSettings().getSetting(fs); - af.alignPanel.getSeqPanel().seqCanvas.getFeatureRenderer().setColour( + featureColours.put( setting.getType(), new java.awt.Color(setting.getColour())); renderOrder[fs] = setting.getType(); if (setting.getDisplay()) { - af.viewport.getFeaturesDisplayed().put(setting.getType(), new Integer( + featuresDisplayed.put(setting.getType(), new Integer( setting.getColour())); } } - af.alignPanel.getSeqPanel().seqCanvas.getFeatureRenderer().renderOrder = renderOrder; + FeatureRendererSettings frs = new FeatureRendererSettings(renderOrder, new Hashtable(), featureColours, 1.0f, null); + af.alignPanel.getSeqPanel().seqCanvas.getFeatureRenderer().transferSettings(frs); } af.setMenusFromViewport(af.viewport); diff --git a/src/jalview/gui/JalviewChimeraBindingModel.java b/src/jalview/gui/JalviewChimeraBindingModel.java index a2a3184..0dcde11 100644 --- a/src/jalview/gui/JalviewChimeraBindingModel.java +++ b/src/jalview/gui/JalviewChimeraBindingModel.java @@ -26,11 +26,11 @@ public class JalviewChimeraBindingModel extends JalviewChimeraBinding { AlignmentPanel ap = (alignment == null) ? cvf.getAlignmentPanel() : (AlignmentPanel) alignment; - if (ap.av.showSequenceFeatures) + if (ap.av.isShowSequenceFeatures()) { if (fr == null) { - fr = ap.cloneFeatureRenderer(); + fr = (jalview.gui.FeatureRenderer) ap.cloneFeatureRenderer(); } else { @@ -71,7 +71,7 @@ public class JalviewChimeraBindingModel extends JalviewChimeraBinding } if (!isLoadingFromArchive()) { - colourBySequence(ap.av.getShowSequenceFeatures(), ap); + colourBySequence(ap.av.isShowSequenceFeatures(), ap); } } diff --git a/src/jalview/gui/JvSwingUtils.java b/src/jalview/gui/JvSwingUtils.java index e433243..b4e0e00 100644 --- a/src/jalview/gui/JvSwingUtils.java +++ b/src/jalview/gui/JvSwingUtils.java @@ -20,11 +20,14 @@ */ package jalview.gui; +import jalview.util.MessageManager; + import java.awt.Color; import java.awt.Font; import java.awt.Rectangle; import java.awt.event.ActionListener; +import javax.swing.AbstractButton; import javax.swing.JButton; import javax.swing.JComponent; import javax.swing.JLabel; @@ -209,4 +212,24 @@ public final class JvSwingUtils } } + public static void jvInitComponent(AbstractButton comp, String i18nString) + { + setColorAndFont(comp); + if (i18nString != null && !i18nString.isEmpty()) + { + comp.setText(MessageManager.getString(i18nString)); + } + } + + public static void jvInitComponent(JComponent comp) + { + setColorAndFont(comp); + } + + private static void setColorAndFont(JComponent comp) + { + comp.setBackground(Color.white); + comp.setFont(JvSwingUtils.getLabelFont()); + } + } diff --git a/src/jalview/gui/OverviewPanel.java b/src/jalview/gui/OverviewPanel.java index 95e14b4..5df60d2 100755 --- a/src/jalview/gui/OverviewPanel.java +++ b/src/jalview/gui/OverviewPanel.java @@ -67,7 +67,7 @@ public class OverviewPanel extends JPanel implements Runnable // main visible SeqCanvas SequenceRenderer sr; - FeatureRenderer fr; + jalview.renderer.seqfeatures.FeatureRenderer fr; /** * Creates a new OverviewPanel object. @@ -85,7 +85,7 @@ public class OverviewPanel extends JPanel implements Runnable sr.renderGaps = false; sr.forOverview = true; fr = new FeatureRenderer(ap); - + // scale the initial size of overviewpanel to shape of alignment float initialScale = (float) av.getAlignment().getWidth() / (float) av.getAlignment().getHeight(); @@ -254,7 +254,7 @@ public class OverviewPanel extends JPanel implements Runnable { miniMe = null; - if (av.showSequenceFeatures) + if (av.isShowSequenceFeatures()) { fr.transferSettings(ap.getSeqPanel().seqCanvas.getFeatureRenderer()); } @@ -344,7 +344,7 @@ public class OverviewPanel extends JPanel implements Runnable { color = sr.getResidueBoxColour(seq, lastcol).getRGB(); - if (av.showSequenceFeatures) + if (av.isShowSequenceFeatures()) { color = fr.findFeatureColour(color, seq, lastcol); } diff --git a/src/jalview/gui/PopupMenu.java b/src/jalview/gui/PopupMenu.java index 4cc3d6a..8565f9f 100644 --- a/src/jalview/gui/PopupMenu.java +++ b/src/jalview/gui/PopupMenu.java @@ -29,6 +29,7 @@ import jalview.commands.EditCommand.Action; import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.AlignmentI; import jalview.datamodel.Annotation; +import jalview.datamodel.ColumnSelection; import jalview.datamodel.DBRefEntry; import jalview.datamodel.PDBEntry; import jalview.datamodel.Sequence; @@ -140,6 +141,8 @@ public class PopupMenu extends JPopupMenu JMenuItem sequenceDetails = new JMenuItem(); JMenuItem sequenceSelDetails = new JMenuItem(); + + JMenuItem makeReferenceSeq = new JMenuItem(); JMenuItem chooseAnnotations = new JMenuItem(); @@ -220,6 +223,8 @@ public class PopupMenu extends JPopupMenu JMenu groupLinksMenu; + JMenuItem hideInsertions = new JMenuItem(); + /** * Creates a new PopupMenu object. * @@ -322,6 +327,12 @@ public class PopupMenu extends JPopupMenu if (seq != null) { sequenceMenu.setText(sequence.getName()); + if (seq == ap.av.getAlignment().getSeqrep()) + { + makeReferenceSeq.setText("Unmark representative"); + } else { + makeReferenceSeq.setText("Mark as representative"); + } if (seq.getDatasetSequence().getPDBId() != null && seq.getDatasetSequence().getPDBId().size() > 0) @@ -369,7 +380,6 @@ public class PopupMenu extends JPopupMenu } // structureMenu.remove(colStructureMenu); } - if (ap.av.getAlignment().isNucleotide() == true) { AlignmentAnnotation[] aa = ap.av.getAlignment() @@ -441,7 +451,6 @@ public class PopupMenu extends JPopupMenu } } } - } menuItem = new JMenuItem( @@ -1507,7 +1516,28 @@ public class PopupMenu extends JPopupMenu editSequence_actionPerformed(actionEvent); } }); + makeReferenceSeq.setText(MessageManager + .getString("label.mark_as_representative")); + makeReferenceSeq.addActionListener(new ActionListener() + { + + @Override + public void actionPerformed(ActionEvent actionEvent) + { + makeReferenceSeq_actionPerformed(actionEvent); + + } + }); + hideInsertions.setText(MessageManager.getString("label.hide_insertions")); + hideInsertions.addActionListener(new ActionListener() + { + @Override + public void actionPerformed(ActionEvent e) + { + hideInsertions_actionPerformed(e); + } + }); /* * annotationMenuItem.setText("By Annotation"); * annotationMenuItem.addActionListener(new ActionListener() { public void @@ -1517,7 +1547,11 @@ public class PopupMenu extends JPopupMenu groupMenu.add(sequenceSelDetails); add(groupMenu); add(sequenceMenu); - this.add(structureMenu); + add(structureMenu); + if (sequence!=null) + { + add(hideInsertions); + } // annotations configuration panel suppressed for now // groupMenu.add(chooseAnnotations); @@ -1539,6 +1573,7 @@ public class PopupMenu extends JPopupMenu groupMenu.add(jMenu1); sequenceMenu.add(sequenceName); sequenceMenu.add(sequenceDetails); + sequenceMenu.add(makeReferenceSeq); colourMenu.add(textColour); colourMenu.add(noColourmenuItem); colourMenu.add(clustalColour); @@ -1913,6 +1948,43 @@ public class PopupMenu extends JPopupMenu refresh(); } + protected void makeReferenceSeq_actionPerformed(ActionEvent actionEvent) + { + if (!ap.av.getAlignment().hasSeqrep()) + { + // initialise the display flags so the user sees something happen + ap.av.setDisplayReferenceSeq(true); + ap.av.setColourByReferenceSeq(true); + ap.av.getAlignment().setSeqrep(sequence); + } + else + { + if (ap.av.getAlignment().getSeqrep() == sequence) + { + ap.av.getAlignment().setSeqrep(null); + } + else + { + ap.av.getAlignment().setSeqrep(sequence); + } + } + refresh(); + } + + protected void hideInsertions_actionPerformed(ActionEvent actionEvent) + { + if (sequence != null) + { + ColumnSelection cs = ap.av.getColumnSelection(); + if (cs == null) + { + cs = new ColumnSelection(); + } + cs.hideInsertionsFor(sequence); + ap.av.setColumnSelection(cs); + } + refresh(); + } protected void sequenceSelectionDetails_actionPerformed() { createSequenceDetailsReport(ap.av.getSequenceSelection()); @@ -1943,7 +2015,9 @@ public class PopupMenu extends JPopupMenu true, true, false, - (ap.getSeqPanel().seqCanvas.fr != null) ? ap.getSeqPanel().seqCanvas.fr.minmax + (ap.getSeqPanel().seqCanvas.fr != null) ? ap + .getSeqPanel().seqCanvas.fr + .getMinMax() : null); contents.append("

    "); } diff --git a/src/jalview/gui/ScalePanel.java b/src/jalview/gui/ScalePanel.java index 568062b..32773b9 100755 --- a/src/jalview/gui/ScalePanel.java +++ b/src/jalview/gui/ScalePanel.java @@ -20,14 +20,28 @@ */ package jalview.gui; -import java.awt.*; -import java.awt.event.*; - -import javax.swing.*; - -import jalview.datamodel.*; +import jalview.datamodel.ColumnSelection; +import jalview.datamodel.SequenceGroup; +import jalview.datamodel.SequenceI; import jalview.util.MessageManager; +import java.awt.Color; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.RenderingHints; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.MouseMotionListener; + +import javax.swing.JMenuItem; +import javax.swing.JPanel; +import javax.swing.JPopupMenu; +import javax.swing.SwingUtilities; +import javax.swing.ToolTipManager; + /** * DOCUMENT ME! * @@ -114,7 +128,7 @@ public class ScalePanel extends JPanel implements MouseMotionListener, }); pop.add(item); - if (av.getColumnSelection().getHiddenColumns().size() > 1) + if (av.getColumnSelection().hasHiddenColumns()) { item = new JMenuItem( MessageManager.getString("action.reveal_all")); @@ -355,25 +369,24 @@ public class ScalePanel extends JPanel implements MouseMotionListener, res = av.getColumnSelection().adjustForHiddenColumns(res); reveal = null; - for (int i = 0; i < av.getColumnSelection().getHiddenColumns().size(); i++) + if (av.getColumnSelection().getHiddenColumns() != null) { - int[] region = (int[]) av.getColumnSelection().getHiddenColumns() - .elementAt(i); - if (res + 1 == region[0] || res - 1 == region[1]) + for (int[] region : av.getColumnSelection().getHiddenColumns()) { - reveal = region; - ToolTipManager.sharedInstance().registerComponent(this); - this.setToolTipText(MessageManager - .getString("label.reveal_hidden_columns")); - break; - } - else - { - this.setToolTipText(null); + if (res + 1 == region[0] || res - 1 == region[1]) + { + reveal = region; + ToolTipManager.sharedInstance().registerComponent(this); + this.setToolTipText(MessageManager + .getString("label.reveal_hidden_columns")); + break; + } + else + { + this.setToolTipText(null); + } } - } - repaint(); } @@ -466,18 +479,18 @@ public class ScalePanel extends JPanel implements MouseMotionListener, } gg.drawLine( - (int) (((i - startx - 1) * av.charWidth) + (av.charWidth / 2)), + ((i - startx - 1) * av.charWidth) + (av.charWidth / 2), y + 2, - (int) (((i - startx - 1) * av.charWidth) + (av.charWidth / 2)), + ((i - startx - 1) * av.charWidth) + (av.charWidth / 2), y + (fm.getDescent() * 2)); } else { gg.drawLine( - (int) (((i - startx - 1) * av.charWidth) + (av.charWidth / 2)), + ((i - startx - 1) * av.charWidth) + (av.charWidth / 2), y + fm.getDescent(), - (int) (((i - startx - 1) * av.charWidth) + (av.charWidth / 2)), + ((i - startx - 1) * av.charWidth) + (av.charWidth / 2), y + (fm.getDescent() * 2)); } } @@ -486,7 +499,8 @@ public class ScalePanel extends JPanel implements MouseMotionListener, { gg.setColor(Color.blue); int res; - if (av.getShowHiddenMarkers()) + if (av.getShowHiddenMarkers() + && av.getColumnSelection().getHiddenColumns() != null) { for (int i = 0; i < av.getColumnSelection().getHiddenColumns() .size(); i++) diff --git a/src/jalview/gui/SeqCanvas.java b/src/jalview/gui/SeqCanvas.java index 54abcc2..5032f69 100755 --- a/src/jalview/gui/SeqCanvas.java +++ b/src/jalview/gui/SeqCanvas.java @@ -34,6 +34,7 @@ import java.awt.Graphics2D; import java.awt.RenderingHints; import java.awt.Shape; import java.awt.image.BufferedImage; +import java.util.List; import javax.swing.JComponent; @@ -637,7 +638,7 @@ public class SeqCanvas extends JComponent } else { - java.util.Vector regions = av.getColumnSelection().getHiddenColumns(); + List regions = av.getColumnSelection().getHiddenColumns(); int screenY = 0; int blockStart = startRes; @@ -645,7 +646,7 @@ public class SeqCanvas extends JComponent for (int i = 0; regions != null && i < regions.size(); i++) { - int[] region = (int[]) regions.elementAt(i); + int[] region = regions.get(i); int hideStart = region[0]; int hideEnd = region[1]; @@ -711,7 +712,7 @@ public class SeqCanvas extends JComponent sr.drawSequence(nextSeq, av.getAlignment().findAllGroups(nextSeq), startRes, endRes, offset + ((i - startSeq) * av.charHeight)); - if (av.showSequenceFeatures) + if (av.isShowSequenceFeatures()) { fr.drawSequence(g, nextSeq, startRes, endRes, offset + ((i - startSeq) * av.charHeight)); diff --git a/src/jalview/gui/SeqPanel.java b/src/jalview/gui/SeqPanel.java index fbe9ff8..7c6a202 100644 --- a/src/jalview/gui/SeqPanel.java +++ b/src/jalview/gui/SeqPanel.java @@ -243,45 +243,6 @@ public class SeqPanel extends JPanel implements MouseListener, return seq; } - SequenceFeature[] findFeaturesAtRes(SequenceI sequence, int res) - { - Vector tmp = new Vector(); - SequenceFeature[] features = sequence.getSequenceFeatures(); - if (features != null) - { - for (int i = 0; i < features.length; i++) - { - if (av.getFeaturesDisplayed() == null - || !av.getFeaturesDisplayed().containsKey( - features[i].getType())) - { - continue; - } - - if (features[i].featureGroup != null - && seqCanvas.fr.featureGroups != null - && seqCanvas.fr.featureGroups - .containsKey(features[i].featureGroup) - && !((Boolean) seqCanvas.fr.featureGroups - .get(features[i].featureGroup)).booleanValue()) - { - continue; - } - - if ((features[i].getBegin() <= res) - && (features[i].getEnd() >= res)) - { - tmp.addElement(features[i]); - } - } - } - - features = new SequenceFeature[tmp.size()]; - tmp.copyInto(features); - - return features; - } - void endEditing() { if (editCommand != null && editCommand.getSize() > 0) @@ -744,14 +705,14 @@ public class SeqPanel extends JPanel implements MouseListener, } // use aa to see if the mouse pointer is on a - if (av.showSequenceFeatures) + if (av.isShowSequenceFeatures()) { int rpos; - SequenceFeature[] features = findFeaturesAtRes( + List features = ap.getFeatureRenderer().findFeaturesAtRes( sequence.getDatasetSequence(), rpos = sequence.findPosition(res)); seqARep.appendFeatures(tooltipText, rpos, features, - this.ap.getSeqPanel().seqCanvas.fr.minmax); + this.ap.getSeqPanel().seqCanvas.fr.getMinMax()); } if (tooltipText.length() == 6) // { @@ -1390,21 +1351,21 @@ public class SeqPanel extends JPanel implements MouseListener, av.setSelectionGroup(null); } - SequenceFeature[] features = findFeaturesAtRes( + List features = seqCanvas.getFeatureRenderer().findFeaturesAtRes( sequence.getDatasetSequence(), sequence.findPosition(findRes(evt))); - if (features != null && features.length > 0) + if (features != null && features.size()> 0) { SearchResults highlight = new SearchResults(); - highlight.addResult(sequence, features[0].getBegin(), - features[0].getEnd()); + highlight.addResult(sequence, features.get(0).getBegin(), + features.get(0).getEnd()); seqCanvas.highlightSearchResults(highlight); } - if (features != null && features.length > 0) + if (features != null && features.size()> 0) { seqCanvas.getFeatureRenderer().amendFeatures(new SequenceI[] - { sequence }, features, false, ap); + { sequence }, features.toArray(new SequenceFeature[features.size()]), false, ap); seqCanvas.highlightSearchResults(null); } @@ -1519,16 +1480,16 @@ public class SeqPanel extends JPanel implements MouseListener, if (javax.swing.SwingUtilities.isRightMouseButton(evt)) { - SequenceFeature[] allFeatures = findFeaturesAtRes( + List allFeatures = ap.getFeatureRenderer().findFeaturesAtRes( sequence.getDatasetSequence(), sequence.findPosition(res)); Vector links = new Vector(); - for (int i = 0; i < allFeatures.length; i++) + for (SequenceFeature sf:allFeatures) { - if (allFeatures[i].links != null) + if (sf.links != null) { - for (int j = 0; j < allFeatures[i].links.size(); j++) + for (int j = 0; j < sf.links.size(); j++) { - links.addElement(allFeatures[i].links.elementAt(j)); + links.addElement(sf.links.elementAt(j)); } } } diff --git a/src/jalview/gui/SequenceRenderer.java b/src/jalview/gui/SequenceRenderer.java index 177fc83..438ef00 100755 --- a/src/jalview/gui/SequenceRenderer.java +++ b/src/jalview/gui/SequenceRenderer.java @@ -319,6 +319,7 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer } else { + boolean srep = av.isDisplayReferenceSeq(); boolean getboxColour = false; for (int i = start; i <= end; i++) { @@ -364,7 +365,7 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer if (currentSequenceGroup.getShowNonconserved()) // todo optimize { // todo - use sequence group consensus - s = getDisplayChar(av.getAlignmentConsensusAnnotation(), i, s, + s = getDisplayChar(srep, i, s, '.'); } @@ -407,7 +408,7 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer } if (av.getShowUnconserved()) { - s = getDisplayChar(av.getAlignmentConsensusAnnotation(), i, s, + s = getDisplayChar(srep, i, s, '.'); } @@ -422,10 +423,12 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer } } - private char getDisplayChar(AlignmentAnnotation consensus, int position, + private char getDisplayChar(final boolean usesrep, int position, char s, char c) { - char conschar = consensus.annotations[position].displayCharacter + // TODO - use currentSequenceGroup rather than alignemnt + // currentSequenceGroup.getConsensus() + char conschar = (usesrep) ? av.getAlignment().getSeqrep().getCharAt(position) : av.getAlignmentConsensusAnnotation().annotations[position].displayCharacter .charAt(0); if (conschar != '-' && s == conschar) { diff --git a/src/jalview/gui/TreePanel.java b/src/jalview/gui/TreePanel.java index ee0bfaf..6ce68b3 100755 --- a/src/jalview/gui/TreePanel.java +++ b/src/jalview/gui/TreePanel.java @@ -20,27 +20,47 @@ */ package jalview.gui; -import java.beans.*; -import java.io.*; -import java.util.*; -import java.util.List; - -import javax.imageio.*; - -import java.awt.*; -import java.awt.event.*; -import java.awt.image.*; -import javax.swing.*; - -import org.jibble.epsgraphics.*; -import jalview.analysis.*; +import jalview.analysis.AlignmentSorter; +import jalview.analysis.NJTree; +import jalview.api.analysis.ScoreModelI; +import jalview.api.analysis.ViewBasedAnalysisI; +import jalview.bin.Cache; import jalview.commands.CommandI; import jalview.commands.OrderCommand; -import jalview.datamodel.*; -import jalview.io.*; -import jalview.jbgui.*; +import jalview.datamodel.Alignment; +import jalview.datamodel.AlignmentI; +import jalview.datamodel.AlignmentView; +import jalview.datamodel.BinaryNode; +import jalview.datamodel.ColumnSelection; +import jalview.datamodel.DBRefEntry; +import jalview.datamodel.NodeTransformI; +import jalview.datamodel.SequenceFeature; +import jalview.datamodel.SequenceI; +import jalview.datamodel.SequenceNode; +import jalview.io.JalviewFileChooser; +import jalview.io.JalviewFileView; +import jalview.io.NewickFile; +import jalview.jbgui.GTreePanel; +import jalview.schemes.ResidueProperties; import jalview.util.MessageManager; +import java.awt.Font; +import java.awt.Graphics; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.image.BufferedImage; +import java.beans.PropertyChangeEvent; +import java.io.FileOutputStream; +import java.util.ArrayList; +import java.util.List; + +import javax.imageio.ImageIO; +import javax.swing.ButtonGroup; +import javax.swing.JMenuItem; +import javax.swing.JRadioButtonMenuItem; + +import org.jibble.epsgraphics.EpsGraphics2D; + /** * DOCUMENT ME! * @@ -293,8 +313,26 @@ public class TreePanel extends GTreePanel seqs = av.getSelectionGroup().getSequencesInOrder( av.getAlignment()); } - - tree = new NJTree(seqs, seqStrings, type, pwtype, start, end); + ScoreModelI sm = ResidueProperties.getScoreModel(pwtype); + if (sm instanceof ViewBasedAnalysisI) + { + try + { + sm = sm.getClass().newInstance(); + ((ViewBasedAnalysisI) sm) + .configureFromAlignmentView(treeCanvas.ap); + } catch (Exception q) + { + Cache.log.error("Couldn't create a scoremodel instance for " + + sm.getName()); + } + tree = new NJTree(seqs, seqStrings, type, pwtype, sm, start, end); + } + else + { + tree = new NJTree(seqs, seqStrings, type, pwtype, null, start, + end); + } showDistances(true); } diff --git a/src/jalview/io/AnnotationFile.java b/src/jalview/io/AnnotationFile.java index 7736332..8dc84b8 100755 --- a/src/jalview/io/AnnotationFile.java +++ b/src/jalview/io/AnnotationFile.java @@ -20,13 +20,34 @@ */ package jalview.io; -import java.io.*; -import java.net.*; -import java.util.*; - -import jalview.analysis.*; -import jalview.datamodel.*; -import jalview.schemes.*; +import jalview.analysis.Conservation; +import jalview.api.AlignViewportI; +import jalview.datamodel.AlignmentAnnotation; +import jalview.datamodel.AlignmentI; +import jalview.datamodel.Annotation; +import jalview.datamodel.ColumnSelection; +import jalview.datamodel.GraphLine; +import jalview.datamodel.HiddenSequences; +import jalview.datamodel.SequenceGroup; +import jalview.datamodel.SequenceI; +import jalview.schemes.ColourSchemeI; +import jalview.schemes.ColourSchemeProperty; +import jalview.schemes.ResidueProperties; +import jalview.schemes.UserColourScheme; + +import java.io.BufferedReader; +import java.io.FileReader; +import java.io.InputStreamReader; +import java.io.StringReader; +import java.net.URL; +import java.util.ArrayList; +import java.util.BitSet; +import java.util.Enumeration; +import java.util.Hashtable; +import java.util.List; +import java.util.Map; +import java.util.StringTokenizer; +import java.util.Vector; public class AnnotationFile { @@ -67,18 +88,18 @@ public class AnnotationFile } /** - * convenience method for pre-2.4 feature files which have no view, hidden + * convenience method for pre-2.9 annotation files which have no view, hidden * columns or hidden row keywords. * * @param annotations * @param list * @param properties - * @return feature file as a string. + * @return annotation file as a string. */ public String printAnnotations(AlignmentAnnotation[] annotations, List list, Hashtable properties) { - return printAnnotations(annotations, list, properties, null); + return printAnnotations(annotations, list, properties, null, null, null); } @@ -119,10 +140,56 @@ public class AnnotationFile * @return annotation file */ public String printAnnotations(AlignmentAnnotation[] annotations, - List list, Hashtable properties, ViewDef[] views) + List list, Hashtable properties, + ColumnSelection cs, AlignmentI al, ViewDef view) { - // TODO: resolve views issue : annotationFile could contain visible region, - // or full data + hidden region specifications for a view. + if (view != null) + { + if (view.viewname != null) + { + text.append("VIEW_DEF\t" + view.viewname + "\n"); + } + if (list == null) + { + list = view.visibleGroups; + } + if (cs == null) + { + cs = view.hiddencols; + } + if (al == null) + { + // add hidden rep sequences. + } + } + // first target - store and restore all settings for a view. + if (al != null && al.hasSeqrep()) + { + text.append("VIEW_SETREF\t" + al.getSeqrep().getName() + "\n"); + } + if (cs != null && cs.hasHiddenColumns()) + { + text.append("VIEW_HIDECOLS\t"); + List hc = cs.getHiddenColumns(); + boolean comma = false; + for (int[] r : hc) + { + if (!comma) + { + comma = true; + } + else + { + text.append(","); + } + text.append(r[0]); + text.append("-"); + text.append(r[1]); + } + text.append("\n"); + } + // TODO: allow efficient recovery of annotation data shown in several + // different views if (annotations != null) { boolean oneColour = true; @@ -320,7 +387,9 @@ public class AnnotationFile } if (row.hasScore()) + { text.append("\t" + row.score); + } text.append(newline); @@ -403,7 +472,8 @@ public class AnnotationFile text.append(properties.get(key)); } // TODO: output alignment visualization settings here if required - + // iterate through one or more views, defining, marking columns and rows as visible/hidden, and emmitting view properties. + // View specific annotation is } return text.toString(); @@ -590,9 +660,33 @@ public class AnnotationFile String refSeqId = null; + public boolean annotateAlignmentView(AlignViewportI viewport, + String file, String protocol) + { + ColumnSelection colSel = viewport.getColumnSelection(); + if (colSel == null) + { + colSel = new ColumnSelection(); + } + boolean rslt = readAnnotationFile(viewport.getAlignment(), colSel, + file, protocol); + if (rslt + && (colSel.hasSelectedColumns() || colSel.hasHiddenColumns())) + { + viewport.setColumnSelection(colSel); + } + + return rslt; + } public boolean readAnnotationFile(AlignmentI al, String file, String protocol) { + return readAnnotationFile(al, null, file, protocol); + } + + public boolean readAnnotationFile(AlignmentI al, ColumnSelection colSel, + String file, String protocol) + { BufferedReader in = null; try { @@ -619,7 +713,7 @@ public class AnnotationFile } if (in != null) { - return parseAnnotationFrom(al, in); + return parseAnnotationFrom(al, colSel, in); } } catch (Exception ex) @@ -642,7 +736,8 @@ public class AnnotationFile private static String GRAPHLINE = "GRAPHLINE", COMBINE = "COMBINE"; - public boolean parseAnnotationFrom(AlignmentI al, BufferedReader in) + public boolean parseAnnotationFrom(AlignmentI al, ColumnSelection colSel, + BufferedReader in) throws Exception { nlinesread = 0; @@ -834,6 +929,58 @@ public class AnnotationFile modified = true; continue; } + // else if (token.equalsIgnoreCase("VIEW_DEF")) + // { + // addOrSetView(al,st); + // modified = true; + // continue; + // } + else if (token.equalsIgnoreCase("VIEW_SETREF")) + { + if (refSeq != null) + { + al.setSeqrep(refSeq); + } + modified = true; + continue; + } + else if (token.equalsIgnoreCase("VIEW_HIDECOLS")) + { + if (st.hasMoreTokens()) + { + if (colSel == null) + { + colSel = new ColumnSelection(); + } + parseHideCols(colSel, st.nextToken()); + } + modified = true; + continue; + } + else if (token.equalsIgnoreCase("HIDE_INSERTIONS")) + { + SequenceI sr = refSeq == null ? al.getSeqrep() : refSeq; + if (sr == null) + { + sr = al.getSequenceAt(0); + } + if (sr != null) + { + if (colSel == null) + { + System.err + .println("Cannot process HIDE_INSERTIONS without an alignment view: Ignoring line: " + + line); + } + else + { + // consider deferring this till after the file has been parsed ? + colSel.hideInsertionsFor(sr); + } + } + modified = true; + continue; + } // Parse out the annotation row graphStyle = AlignmentAnnotation.getGraphValueFromString(token); @@ -852,7 +999,9 @@ public class AnnotationFile { description = line; if (st.hasMoreTokens()) + { line = st.nextToken(); + } } if (st.hasMoreTokens()) @@ -1004,7 +1153,7 @@ public class AnnotationFile (StringTokenizer) _deferred_args[1], // st (SequenceI) _deferred_args[2], // refSeq (_deferred_args[3] == null) ? null : groupRefLookup - .get((String) _deferred_args[3]) // the reference + .get(_deferred_args[3]) // the reference // group, or null ); } @@ -1024,7 +1173,7 @@ public class AnnotationFile (StringTokenizer) _combine_args[0], // st (SequenceI) _combine_args[1], // refSeq (_combine_args[2] == null) ? null : groupRefLookup - .get((String) _combine_args[2]) // the reference group, + .get(_combine_args[2]) // the reference group, // or null ); } @@ -1032,6 +1181,40 @@ public class AnnotationFile return modified; } + private void parseHideCols(ColumnSelection colSel, String nextToken) + { + StringTokenizer inval = new StringTokenizer(nextToken,","); + while (inval.hasMoreTokens()) + { + String range = inval.nextToken().trim(); + int from, to = range.indexOf("-"); + if (to == -1) + { + from = to = Integer.parseInt(range); + if (from >= 0) + { + colSel.hideColumns(from, to); + } + } + else + { + from = Integer.parseInt(range.substring(0, to)); + if (to < range.length() - 1) + { + to = Integer.parseInt(range.substring(to + 1)); + } + else + { + to = from; + } + if (from > 0 && to >= from) + { + colSel.hideColumns(from, to); + } + } + } + } + private Object autoAnnotsKey(AlignmentAnnotation annotation, SequenceI refSeq, String groupRef) { @@ -1602,4 +1785,19 @@ public class AnnotationFile } return sp.toString(); } + + public String printAnnotationsForView(AlignViewportI viewport) + { + return printAnnotations(viewport.isShowAnnotation() ? viewport + .getAlignment().getAlignmentAnnotation() : null, viewport + .getAlignment().getGroups(), viewport.getAlignment() + .getProperties(), viewport.getColumnSelection(), + viewport.getAlignment(), null); + } + + public String printAnnotationsForAlignment(AlignmentI al) + { + return printAnnotations(al.getAlignmentAnnotation(), al.getGroups(), + al.getProperties(), null, al, null); + } } diff --git a/src/jalview/io/AppletFormatAdapter.java b/src/jalview/io/AppletFormatAdapter.java index 505f609..89adead 100755 --- a/src/jalview/io/AppletFormatAdapter.java +++ b/src/jalview/io/AppletFormatAdapter.java @@ -64,16 +64,16 @@ public class AppletFormatAdapter * that are writable by the application. */ public static final String[] WRITABLE_EXTENSIONS = new String[] - { "fa, fasta, mfa, fastq", "aln", "pfam", "msf", "pir", "blc", "amsa", - "jvp", "sto,stk", "jar", PhylipFile.FILE_EXT }; + { "fa, fasta, mfa, fastq", "aln", "pfam", "msf", "pir", "blc", "amsa", + "sto,stk", PhylipFile.FILE_EXT, "jvp" }; /** * List of writable formats by the application. Order must correspond with the * WRITABLE_EXTENSIONS list of formats. */ public static final String[] WRITABLE_FNAMES = new String[] - { "Fasta", "Clustal", "PFAM", "MSF", "PIR", "BLC", "AMSA", "Jalview", - "STH", "Jalview", PhylipFile.FILE_DESC }; + { "Fasta", "Clustal", "PFAM", "MSF", "PIR", "BLC", "AMSA", "STH", + PhylipFile.FILE_DESC, "Jalview" }; /** * List of readable format file extensions by application in order diff --git a/src/jalview/io/BioJsHTMLOutput.java b/src/jalview/io/BioJsHTMLOutput.java index 772337a..db43a3f 100644 --- a/src/jalview/io/BioJsHTMLOutput.java +++ b/src/jalview/io/BioJsHTMLOutput.java @@ -1,5 +1,6 @@ package jalview.io; +import jalview.api.FeaturesDisplayedI; import jalview.datamodel.AlignmentI; import jalview.datamodel.SequenceFeature; import jalview.datamodel.SequenceI; @@ -13,13 +14,13 @@ import jalview.json.binding.v1.BioJsSeqPojo; import jalview.schemes.ColourSchemeProperty; import jalview.util.MessageManager; +import java.awt.Color; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.net.URL; import java.util.ArrayList; -import java.util.Hashtable; import com.json.JSONException; @@ -27,11 +28,11 @@ public class BioJsHTMLOutput { private AlignViewport av; - private FeatureRenderer fr; + private jalview.api.FeatureRenderer fr; private String globalColorScheme; - private Hashtable displayedFeatures; + private FeaturesDisplayedI displayedFeatures; private String jalviewVersion; @@ -50,12 +51,9 @@ public class BioJsHTMLOutput this.av = ap.av; this.globalColorScheme = ColourSchemeProperty.getColourName(av .getGlobalColourScheme()); - this.fr = new FeatureRenderer(ap); - fr.transferSettings(fr1); + this.fr = ap.cloneFeatureRenderer(); displayedFeatures = av.getFeaturesDisplayed(); - - exportJalviewAlignmentAsBioJsHtmlFile(); - } + } } private void exportJalviewAlignmentAsBioJsHtmlFile() @@ -147,10 +145,13 @@ public class BioJsHTMLOutput for (SequenceFeature sf : seqFeatures) { if (displayedFeatures != null - && displayedFeatures.get(sf.getType()) != null) + && displayedFeatures.isVisible(sf.getType())) { + + // TODO: translate graduated/complex colourschemes to biojs model String featureColour = jalview.util.Format.getHexString(fr - .getColour(sf)); + .findFeatureColour(Color.white, seq, + seq.findIndex(sf.getBegin()))); BioJsFeaturePojo bjsFeature = new BioJsFeaturePojo(); bjsFeature.setFillColor(featureColour); bjsFeature.setXstart(seq.findIndex(sf.getBegin()) - 1); diff --git a/src/jalview/io/FeaturesFile.java b/src/jalview/io/FeaturesFile.java index 87b829f..5b621e7 100755 --- a/src/jalview/io/FeaturesFile.java +++ b/src/jalview/io/FeaturesFile.java @@ -678,7 +678,7 @@ public class FeaturesFile extends AlignFile * hash of feature types and colours * @return features file contents */ - public String printJalviewFormat(SequenceI[] seqs, Hashtable visible) + public String printJalviewFormat(SequenceI[] seqs, Map visible) { return printJalviewFormat(seqs, visible, true, true); } @@ -697,7 +697,7 @@ public class FeaturesFile extends AlignFile * of group or type) * @return features file contents */ - public String printJalviewFormat(SequenceI[] seqs, Hashtable visible, + public String printJalviewFormat(SequenceI[] seqs, Map visible, boolean visOnly, boolean nonpos) { StringBuffer out = new StringBuffer(); @@ -714,11 +714,11 @@ public class FeaturesFile extends AlignFile // write feature colours only if we're given them and we are generating // viewed features // TODO: decide if feature links should also be written here ? - Enumeration en = visible.keys(); + Iterator en = visible.keySet().iterator(); String type, color; - while (en.hasMoreElements()) + while (en.hasNext()) { - type = en.nextElement().toString(); + type = en.next().toString(); if (visible.get(type) instanceof GraduatedColor) { @@ -926,12 +926,12 @@ public class FeaturesFile extends AlignFile * @param visible * @return */ - public String printGFFFormat(SequenceI[] seqs, Hashtable visible) + public String printGFFFormat(SequenceI[] seqs, Map visible) { return printGFFFormat(seqs, visible, true, true); } - public String printGFFFormat(SequenceI[] seqs, Hashtable visible, + public String printGFFFormat(SequenceI[] seqs, Map visible, boolean visOnly, boolean nonpos) { StringBuffer out = new StringBuffer(); diff --git a/src/jalview/io/FileParse.java b/src/jalview/io/FileParse.java index 8e9a49c..764715f 100755 --- a/src/jalview/io/FileParse.java +++ b/src/jalview/io/FileParse.java @@ -22,8 +22,17 @@ package jalview.io; import jalview.util.MessageManager; -import java.io.*; -import java.net.*; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; +import java.io.StringReader; +import java.net.MalformedURLException; +import java.net.URL; import java.util.zip.GZIPInputStream; /** @@ -99,7 +108,9 @@ public class FileParse throw new Error(MessageManager.getString("error.implementation_error_null_fileparse")); } if (from == this) + { return; + } index = ++from.index; inFile = from.inFile; suffixSeparator = from.suffixSeparator; @@ -157,7 +168,7 @@ public class FileParse { warningMessage = "Failed to resolve as a GZ stream (" + x.getMessage() + ")"; - x.printStackTrace(); + // x.printStackTrace(); } ; } @@ -281,7 +292,9 @@ public class FileParse { checkURLSource(fileStr); if (suffixSeparator == '#') + { extractSuffix(fileStr); // URL lref is stored for later reference. + } } catch (IOException e) { String suffixLess = extractSuffix(fileStr); @@ -323,7 +336,9 @@ public class FileParse { String suffixLess = extractSuffix(fileStr); if (suffixLess != null) + { is = getClass().getResourceAsStream("/" + suffixLess); + } } if (is != null) { @@ -371,7 +386,9 @@ public class FileParse public String nextLine() throws IOException { if (!error) + { return dataIn.readLine(); + } throw new IOException(MessageManager.formatMessage("exception.invalid_source_stream", new String[]{errormessage})); } diff --git a/src/jalview/io/HTMLOutput.java b/src/jalview/io/HTMLOutput.java index 50b07e4..2d2626f 100755 --- a/src/jalview/io/HTMLOutput.java +++ b/src/jalview/io/HTMLOutput.java @@ -34,7 +34,7 @@ public class HTMLOutput SequenceRenderer sr; - FeatureRenderer fr; + jalview.renderer.seqfeatures.FeatureRenderer fr; Color color; diff --git a/src/jalview/io/SequenceAnnotationReport.java b/src/jalview/io/SequenceAnnotationReport.java index 6fba9c6..1757239 100644 --- a/src/jalview/io/SequenceAnnotationReport.java +++ b/src/jalview/io/SequenceAnnotationReport.java @@ -22,6 +22,7 @@ package jalview.io; import java.util.ArrayList; import java.util.Hashtable; +import java.util.List; import java.util.Vector; import jalview.datamodel.DBRefEntry; @@ -54,30 +55,30 @@ public class SequenceAnnotationReport * TODO refactor to Jalview 'utilities' somehow. */ public void appendFeatures(final StringBuffer tooltipText2, int rpos, - SequenceFeature[] features) + List features) { appendFeatures(tooltipText2, rpos, features, null); } public void appendFeatures(final StringBuffer tooltipText2, int rpos, - SequenceFeature[] features, Hashtable minmax) + List features, Hashtable minmax) { String tmpString; if (features != null) { - for (int i = 0; i < features.length; i++) + for (SequenceFeature feature:features) { - if (features[i].getType().equals("disulfide bond")) + if (feature.getType().equals("disulfide bond")) { - if (features[i].getBegin() == rpos - || features[i].getEnd() == rpos) + if (feature.getBegin() == rpos + || feature.getEnd() == rpos) { if (tooltipText2.length() > 6) { tooltipText2.append("
    "); } - tooltipText2.append("disulfide bond " + features[i].getBegin() - + ":" + features[i].getEnd()); + tooltipText2.append("disulfide bond " + feature.getBegin() + + ":" + feature.getEnd()); } } else @@ -87,25 +88,25 @@ public class SequenceAnnotationReport tooltipText2.append("
    "); } // TODO: remove this hack to display link only features - boolean linkOnly = features[i].getValue("linkonly") != null; + boolean linkOnly = feature.getValue("linkonly") != null; if (!linkOnly) { - tooltipText2.append(features[i].getType() + " "); + tooltipText2.append(feature.getType() + " "); if (rpos != 0) { // we are marking a positional feature - tooltipText2.append(features[i].begin); + tooltipText2.append(feature.begin); } - if (features[i].begin != features[i].end) + if (feature.begin != feature.end) { - tooltipText2.append(" " + features[i].end); + tooltipText2.append(" " + feature.end); } - if (features[i].getDescription() != null - && !features[i].description.equals(features[i] + if (feature.getDescription() != null + && !feature.description.equals(feature .getType())) { - tmpString = features[i].getDescription(); + tmpString = feature.getDescription(); String tmp2up = tmpString.toUpperCase(); int startTag = tmp2up.indexOf(""); if (startTag > -1) @@ -150,27 +151,27 @@ public class SequenceAnnotationReport } } // check score should be shown - if (features[i].getScore() != Float.NaN) + if (feature.getScore() != Float.NaN) { float[][] rng = (minmax == null) ? null : ((float[][]) minmax - .get(features[i].getType())); + .get(feature.getType())); if (rng != null && rng[0] != null && rng[0][0] != rng[0][1]) { - tooltipText2.append(" Score=" + features[i].getScore()); + tooltipText2.append(" Score=" + feature.getScore()); } } - if (features[i].getValue("status") != null) + if (feature.getValue("status") != null) { - String status = features[i].getValue("status").toString(); + String status = feature.getValue("status").toString(); if (status.length() > 0) { - tooltipText2.append("; (" + features[i].getValue("status") + tooltipText2.append("; (" + feature.getValue("status") + ")"); } } } } - if (features[i].links != null) + if (feature.links != null) { if (linkImageURL != null) { @@ -178,7 +179,7 @@ public class SequenceAnnotationReport } else { - for (String urlstring : (Vector) features[i].links) + for (String urlstring : (Vector) feature.links) { try { @@ -364,7 +365,6 @@ public class SequenceAnnotationReport // ADD NON POSITIONAL SEQUENCE INFO SequenceFeature[] features = ds.getSequenceFeatures(); - SequenceFeature[] tfeat = new SequenceFeature[1]; if (showNpFeats && features != null) { for (int i = 0; i < features.length; i++) @@ -372,7 +372,8 @@ public class SequenceAnnotationReport if (features[i].begin == 0 && features[i].end == 0) { int sz = -tip.length(); - tfeat[0] = features[i]; + List tfeat = new ArrayList(); + tfeat.add(features[i]); appendFeatures(tip, 0, tfeat, minmax); sz += tip.length(); maxWidth = Math.max(maxWidth, sz); diff --git a/src/jalview/io/packed/ParsePackedSet.java b/src/jalview/io/packed/ParsePackedSet.java index df1acf1..8980e2c 100644 --- a/src/jalview/io/packed/ParsePackedSet.java +++ b/src/jalview/io/packed/ParsePackedSet.java @@ -123,8 +123,9 @@ public class ParsePackedSet { br = new BufferedReader(src.getReader()); } + // TODO: add columnSelection to context if (new jalview.io.AnnotationFile().parseAnnotationFrom( - context.getLastAlignment(), br)) + context.getLastAlignment(), null, br)) { context.updateSetModified(true); } diff --git a/src/jalview/javascript/MouseOverStructureListener.java b/src/jalview/javascript/MouseOverStructureListener.java index 465a672..2ecaf6c 100644 --- a/src/jalview/javascript/MouseOverStructureListener.java +++ b/src/jalview/javascript/MouseOverStructureListener.java @@ -202,7 +202,7 @@ public class MouseOverStructureListener extends JSFunctionExec implements SequenceRenderer sr = ((jalview.appletgui.AlignmentPanel) source) .getSequenceRenderer(); FeatureRenderer fr = ((jalview.appletgui.AlignmentPanel) source).av - .getShowSequenceFeatures() ? new jalview.appletgui.FeatureRenderer( + .isShowSequenceFeatures() ? new jalview.appletgui.FeatureRenderer( ((jalview.appletgui.AlignmentPanel) source).av) : null; if (fr != null) { diff --git a/src/jalview/jbgui/GAlignFrame.java b/src/jalview/jbgui/GAlignFrame.java index 4bf8176..4ecedaf 100755 --- a/src/jalview/jbgui/GAlignFrame.java +++ b/src/jalview/jbgui/GAlignFrame.java @@ -268,6 +268,8 @@ public class GAlignFrame extends JInternalFrame JMenuItem annotationColour = new JMenuItem(); + JMenuItem annotationColumn = new JMenuItem(); + protected JMenuItem rnahelicesColour = new JMenuItem(); JMenuItem associatedData = new JMenuItem(); @@ -1874,6 +1876,17 @@ public class GAlignFrame extends JInternalFrame } }); + annotationColumn.setText(MessageManager + .getString("action.select_by_annotation")); + annotationColumn.addActionListener(new ActionListener() + { + @Override + public void actionPerformed(ActionEvent e) + { + annotationColumn_actionPerformed(e); + } + }); + rnahelicesColour.setText(MessageManager .getString("action.by_rna_helixes")); rnahelicesColour.addActionListener(new ActionListener() @@ -2408,6 +2421,7 @@ public class GAlignFrame extends JInternalFrame selectMenu.add(unGroup); selectMenu.add(grpsFromSelection); selectMenu.add(deleteGroups); + selectMenu.add(annotationColumn); calculateMenu.add(expandAlignment); // TODO - determine if the listenToViewSelections button is needed : see bug // JAL-574 @@ -2986,6 +3000,11 @@ public class GAlignFrame extends JInternalFrame } + public void annotationColumn_actionPerformed(ActionEvent e) + { + + } + public void rnahelicesColour_actionPerformed(ActionEvent e) { diff --git a/src/jalview/renderer/seqfeatures/FeatureRenderer.java b/src/jalview/renderer/seqfeatures/FeatureRenderer.java new file mode 100644 index 0000000..5e6ac29 --- /dev/null +++ b/src/jalview/renderer/seqfeatures/FeatureRenderer.java @@ -0,0 +1,435 @@ +package jalview.renderer.seqfeatures; + +import jalview.datamodel.SequenceFeature; +import jalview.datamodel.SequenceI; + +import java.awt.AlphaComposite; +import java.awt.Color; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.image.BufferedImage; + +public class FeatureRenderer extends + jalview.viewmodel.seqfeatures.FeatureRendererModel +{ + + FontMetrics fm; + + int charOffset; + + boolean offscreenRender = false; + + /** + * DOCUMENT ME! + * + * @param g + * DOCUMENT ME! + * @param seq + * DOCUMENT ME! + * @param sg + * DOCUMENT ME! + * @param start + * DOCUMENT ME! + * @param end + * DOCUMENT ME! + * @param x1 + * DOCUMENT ME! + * @param y1 + * DOCUMENT ME! + * @param width + * DOCUMENT ME! + * @param height + * DOCUMENT ME! + */ + protected SequenceI lastSeq; + + char s; + + int i; + + int av_charHeight, av_charWidth; + + boolean av_validCharWidth, av_isShowSeqFeatureHeight; + + protected void updateAvConfig() + { + av_charHeight = av.getCharHeight(); + av_charWidth = av.getCharWidth(); + av_validCharWidth = av.isValidCharWidth(); + av_isShowSeqFeatureHeight = av.isShowSequenceFeaturesHeight(); + } + + void renderFeature(Graphics g, SequenceI seq, int fstart, int fend, + Color featureColour, int start, int end, int y1) + { + updateAvConfig(); + if (((fstart <= end) && (fend >= start))) + { + if (fstart < start) + { // fix for if the feature we have starts before the sequence start, + fstart = start; // but the feature end is still valid!! + } + + if (fend >= end) + { + fend = end; + } + int pady = (y1 + av_charHeight) - av_charHeight / 5; + for (i = fstart; i <= fend; i++) + { + s = seq.getCharAt(i); + + if (jalview.util.Comparison.isGap(s)) + { + continue; + } + + g.setColor(featureColour); + + g.fillRect((i - start) * av_charWidth, y1, av_charWidth, + av_charHeight); + + if (offscreenRender || !av_validCharWidth) + { + continue; + } + + g.setColor(Color.white); + charOffset = (av_charWidth - fm.charWidth(s)) / 2; + g.drawString(String.valueOf(s), charOffset + + (av_charWidth * (i - start)), pady); + + } + } + } + + void renderScoreFeature(Graphics g, SequenceI seq, int fstart, int fend, + Color featureColour, int start, int end, int y1, byte[] bs) + { + updateAvConfig(); + if (((fstart <= end) && (fend >= start))) + { + if (fstart < start) + { // fix for if the feature we have starts before the sequence start, + fstart = start; // but the feature end is still valid!! + } + + if (fend >= end) + { + fend = end; + } + int pady = (y1 + av_charHeight) - av_charHeight / 5; + int ystrt = 0, yend = av_charHeight; + if (bs[0] != 0) + { + // signed - zero is always middle of residue line. + if (bs[1] < 128) + { + yend = av_charHeight * (128 - bs[1]) / 512; + ystrt = av_charHeight - yend / 2; + } + else + { + ystrt = av_charHeight / 2; + yend = av_charHeight * (bs[1] - 128) / 512; + } + } + else + { + yend = av_charHeight * bs[1] / 255; + ystrt = av_charHeight - yend; + + } + for (i = fstart; i <= fend; i++) + { + s = seq.getCharAt(i); + + if (jalview.util.Comparison.isGap(s)) + { + continue; + } + + g.setColor(featureColour); + int x = (i - start) * av_charWidth; + g.drawRect(x, y1, av_charWidth, av_charHeight); + g.fillRect(x, y1 + ystrt, av_charWidth, yend); + + if (offscreenRender || !av_validCharWidth) + { + continue; + } + + g.setColor(Color.black); + charOffset = (av_charWidth - fm.charWidth(s)) / 2; + g.drawString(String.valueOf(s), charOffset + + (av_charWidth * (i - start)), pady); + + } + } + } + + BufferedImage offscreenImage; + + public Color findFeatureColour(Color initialCol, SequenceI seq, int res) + { + return new Color(findFeatureColour(initialCol.getRGB(), seq, res)); + } + + /** + * This is used by the Molecule Viewer and Overview to get the accurate + * colourof the rendered sequence + */ + public synchronized int findFeatureColour(int initialCol, final SequenceI seq, + int column) + { + if (!av.isShowSequenceFeatures()) + { + return initialCol; + } + + final SequenceI aseq = (seq.getDatasetSequence() != null) ? seq + .getDatasetSequence() : seq; + if (seq != lastSeq) + { + lastSeq = seq; + sequenceFeatures = aseq.getSequenceFeatures(); + if (sequenceFeatures != null) + { + sfSize = sequenceFeatures.length; + } + } + else + { + if (sequenceFeatures != aseq.getSequenceFeatures()) + { + sequenceFeatures = aseq.getSequenceFeatures(); + if (sequenceFeatures != null) + { + sfSize = sequenceFeatures.length; + } + } + } + + if (sequenceFeatures == null || sfSize == 0) + { + return initialCol; + } + + if (jalview.util.Comparison.isGap(lastSeq.getCharAt(column))) + { + return Color.white.getRGB(); + } + + // Only bother making an offscreen image if transparency is applied + if (transparency != 1.0f && offscreenImage == null) + { + offscreenImage = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB); + } + + currentColour = null; + // TODO: non-threadsafe - each rendering thread needs its own instance of + // the feature renderer - or this should be synchronized. + offscreenRender = true; + + if (offscreenImage != null) + { + offscreenImage.setRGB(0, 0, initialCol); + drawSequence(offscreenImage.getGraphics(), lastSeq, column, column, 0); + + return offscreenImage.getRGB(0, 0); + } + else + { + drawSequence(null, lastSeq, lastSeq.findPosition(column), -1, -1); + + if (currentColour == null) + { + return initialCol; + } + else + { + return ((Integer) currentColour).intValue(); + } + } + + } + + private volatile SequenceFeature[] sequenceFeatures; + + int sfSize; + + int sfindex; + + int spos; + + int epos; + + public synchronized void drawSequence(Graphics g, final SequenceI seq, + int start, int end, int y1) + { + final SequenceI aseq = (seq.getDatasetSequence() != null) ? seq + .getDatasetSequence() : seq; + if (aseq.getSequenceFeatures() == null + || aseq.getSequenceFeatures().length == 0) + { + return; + } + + if (g != null) + { + fm = g.getFontMetrics(); + } + + updateFeatures(); + + if (lastSeq == null || seq != lastSeq + || aseq.getSequenceFeatures() != sequenceFeatures) + { + lastSeq = seq; + sequenceFeatures = aseq.getSequenceFeatures(); + } + + if (transparency != 1 && g != null) + { + Graphics2D g2 = (Graphics2D) g; + g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, + transparency)); + } + + if (!offscreenRender) + { + spos = lastSeq.findPosition(start); + epos = lastSeq.findPosition(end); + } + + sfSize = sequenceFeatures.length; + String type; + for (int renderIndex = 0; renderIndex < renderOrder.length; renderIndex++) + { + type = renderOrder[renderIndex]; + + if (type == null || !showFeatureOfType(type)) + { + continue; + } + + // loop through all features in sequence to find + // current feature to render + for (sfindex = 0; sfindex < sfSize; sfindex++) + { + if (!sequenceFeatures[sfindex].type.equals(type)) + { + continue; + } + + if (featureGroups != null + && sequenceFeatures[sfindex].featureGroup != null + && sequenceFeatures[sfindex].featureGroup.length() != 0 + && featureGroups + .containsKey(sequenceFeatures[sfindex].featureGroup) + && !featureGroups + .get(sequenceFeatures[sfindex].featureGroup) + .booleanValue()) + { + continue; + } + + if (!offscreenRender + && (sequenceFeatures[sfindex].getBegin() > epos || sequenceFeatures[sfindex] + .getEnd() < spos)) + { + continue; + } + + if (offscreenRender && offscreenImage == null) + { + if (sequenceFeatures[sfindex].begin <= start + && sequenceFeatures[sfindex].end >= start) + { + // this is passed out to the overview and other sequence renderers + // (e.g. molecule viewer) to get displayed colour for rendered + // sequence + currentColour = new Integer( + getColour(sequenceFeatures[sfindex]).getRGB()); + // used to be retreived from av.featuresDisplayed + // currentColour = av.featuresDisplayed + // .get(sequenceFeatures[sfindex].type); + + } + } + else if (sequenceFeatures[sfindex].type.equals("disulfide bond")) + { + + renderFeature(g, seq, + seq.findIndex(sequenceFeatures[sfindex].begin) - 1, + seq.findIndex(sequenceFeatures[sfindex].begin) - 1, + getColour(sequenceFeatures[sfindex]) + // new Color(((Integer) av.featuresDisplayed + // .get(sequenceFeatures[sfindex].type)).intValue()) + , start, end, y1); + renderFeature(g, seq, + seq.findIndex(sequenceFeatures[sfindex].end) - 1, + seq.findIndex(sequenceFeatures[sfindex].end) - 1, + getColour(sequenceFeatures[sfindex]) + // new Color(((Integer) av.featuresDisplayed + // .get(sequenceFeatures[sfindex].type)).intValue()) + , start, end, y1); + + } + else if (showFeature(sequenceFeatures[sfindex])) + { + if (av_isShowSeqFeatureHeight + && sequenceFeatures[sfindex].score != Float.NaN) + { + renderScoreFeature(g, seq, + seq.findIndex(sequenceFeatures[sfindex].begin) - 1, + seq.findIndex(sequenceFeatures[sfindex].end) - 1, + getColour(sequenceFeatures[sfindex]), start, end, y1, + normaliseScore(sequenceFeatures[sfindex])); + } + else + { + renderFeature(g, seq, + seq.findIndex(sequenceFeatures[sfindex].begin) - 1, + seq.findIndex(sequenceFeatures[sfindex].end) - 1, + getColour(sequenceFeatures[sfindex]), start, end, y1); + } + } + + } + + } + + if (transparency != 1.0f && g != null && transparencyAvailable) + { + Graphics2D g2 = (Graphics2D) g; + g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, + 1.0f)); + } + } + + boolean transparencyAvailable = true; + + protected void setTransparencyAvailable(boolean isTransparencyAvailable) + { + transparencyAvailable = isTransparencyAvailable; + } + + @Override + public boolean isTransparencyAvailable() + { + return transparencyAvailable; + } + + /** + * Called when alignment in associated view has new/modified features to + * discover and display. + * + */ + public void featuresAdded() + { + lastSeq = null; + findAllFeatures(); + } +} diff --git a/src/jalview/schemes/AnnotationColourGradient.java b/src/jalview/schemes/AnnotationColourGradient.java index efad430..85ec3aec0 100755 --- a/src/jalview/schemes/AnnotationColourGradient.java +++ b/src/jalview/schemes/AnnotationColourGradient.java @@ -258,7 +258,7 @@ public class AnnotationColourGradient extends FollowerColourScheme public Color findColour(char c, int j, SequenceI seq) { Color currentColour = Color.white; - AlignmentAnnotation annotation = (seqAssociated ? seqannot.get(seq) + AlignmentAnnotation annotation = (seqAssociated && seqannot!=null ? seqannot.get(seq) : this.annotation); if (annotation == null) { diff --git a/src/jalview/schemes/ResidueProperties.java b/src/jalview/schemes/ResidueProperties.java index 8acf1f2..d13f0a9 100755 --- a/src/jalview/schemes/ResidueProperties.java +++ b/src/jalview/schemes/ResidueProperties.java @@ -20,6 +20,7 @@ */ package jalview.schemes; +import jalview.analysis.scoremodels.FeatureScoreModel; import jalview.analysis.scoremodels.PIDScoreModel; import jalview.api.analysis.ScoreModelI; @@ -1498,6 +1499,7 @@ public class ResidueProperties // scoreMatrices.put("Conservation EnhPos", new // ScoreMatrix("Conservation EnhPos",propMatrixEpos,0)); scoreMatrices.put("PID", new PIDScoreModel()); + scoreMatrices.put("Displayed Features", new FeatureScoreModel()); } private ResidueProperties() diff --git a/src/jalview/viewmodel/AlignmentViewport.java b/src/jalview/viewmodel/AlignmentViewport.java index 1b42faf..08b31fa 100644 --- a/src/jalview/viewmodel/AlignmentViewport.java +++ b/src/jalview/viewmodel/AlignmentViewport.java @@ -24,6 +24,7 @@ import jalview.analysis.Conservation; import jalview.api.AlignCalcManagerI; import jalview.api.AlignViewportI; import jalview.api.AlignmentViewPanel; +import jalview.api.FeaturesDisplayedI; import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.AlignmentI; import jalview.datamodel.AlignmentView; @@ -636,10 +637,6 @@ public abstract class AlignmentViewport implements AlignViewportI public void setHiddenColumns(ColumnSelection colsel) { this.colSel = colsel; - if (colSel.getHiddenColumns() != null) - { - hasHiddenColumns = true; - } } @Override @@ -648,9 +645,14 @@ public abstract class AlignmentViewport implements AlignViewportI return colSel; } + @Override public void setColumnSelection(ColumnSelection colSel) { this.colSel = colSel; + if (colSel != null) + { + updateHiddenColumns(); + } } /** @@ -670,15 +672,22 @@ public abstract class AlignmentViewport implements AlignViewportI this.hiddenRepSequences = hiddenRepSequences; } - protected boolean hasHiddenColumns = false; + @Override + public boolean hasHiddenColumns() + { + return colSel != null && colSel.hasHiddenColumns(); + } public void updateHiddenColumns() { - hasHiddenColumns = colSel.getHiddenColumns() != null; + // this method doesn't really do anything now. But - it could, since a + // column Selection could be in the process of modification + // hasHiddenColumns = colSel.hasHiddenColumns(); } protected boolean hasHiddenRows = false; + @Override public boolean hasHiddenRows() { return hasHiddenRows; @@ -696,6 +705,7 @@ public abstract class AlignmentViewport implements AlignViewportI sequenceSetID = new String(newid); } + @Override public String getSequenceSetId() { if (sequenceSetID == null) @@ -857,7 +867,6 @@ public abstract class AlignmentViewport implements AlignViewportI colSel.hideSelectedColumns(); setSelectionGroup(null); - hasHiddenColumns = true; } public void hideColumns(int start, int end) @@ -870,23 +879,17 @@ public abstract class AlignmentViewport implements AlignViewportI { colSel.hideColumns(start, end); } - - hasHiddenColumns = true; } public void showColumn(int col) { colSel.revealHiddenColumns(col); - if (colSel.getHiddenColumns() == null) - { - hasHiddenColumns = false; - } + } public void showAllHiddenColumns() { colSel.revealAllHiddenColumns(); - hasHiddenColumns = false; } // common hide/show seq stuff @@ -1029,8 +1032,8 @@ public abstract class AlignmentViewport implements AlignViewportI public boolean isHiddenRepSequence(SequenceI seq) { - return hiddenRepSequences != null - && hiddenRepSequences.containsKey(seq); + return alignment.getSeqrep()==seq || (hiddenRepSequences != null + && hiddenRepSequences.containsKey(seq)); } public SequenceGroup getRepresentedSequences(SequenceI seq) @@ -1039,32 +1042,24 @@ public abstract class AlignmentViewport implements AlignViewportI : hiddenRepSequences.get(seq)); } + @Override public int adjustForHiddenSeqs(int alignmentIndex) { return alignment.getHiddenSequences().adjustForHiddenSeqs( alignmentIndex); } - // Selection manipulation - /** - * broadcast selection to any interested parties - */ + @Override public abstract void sendSelection(); + @Override public void invertColumnSelection() { colSel.invertColumnSelection(0, alignment.getWidth()); } - /** - * This method returns an array of new SequenceI objects derived from the - * whole alignment or just the current selection with start and end points - * adjusted - * - * @note if you need references to the actual SequenceI objects in the - * alignment or currently selected then use getSequenceSelection() - * @return selection as new sequenceI objects - */ + + @Override public SequenceI[] getSelectionAsNewSequence() { SequenceI[] sequences; @@ -1093,12 +1088,7 @@ public abstract class AlignmentViewport implements AlignViewportI return sequences; } - /** - * get the currently selected sequence objects or all the sequences in the - * alignment. - * - * @return array of references to sequence objects - */ + @Override public SequenceI[] getSequenceSelection() { @@ -1114,31 +1104,16 @@ public abstract class AlignmentViewport implements AlignViewportI return sequences; } - /** - * This method returns the visible alignment as text, as seen on the GUI, ie - * if columns are hidden they will not be returned in the result. Use this for - * calculating trees, PCA, redundancy etc on views which contain hidden - * columns. - * - * @return String[] - */ + @Override public jalview.datamodel.CigarArray getViewAsCigars( boolean selectedRegionOnly) { - return new jalview.datamodel.CigarArray(alignment, - (hasHiddenColumns ? colSel : null), + return new jalview.datamodel.CigarArray(alignment, colSel, (selectedRegionOnly ? selectionGroup : null)); } - /** - * return a compact representation of the current alignment selection to pass - * to an analysis function - * - * @param selectedOnly - * boolean true to just return the selected view - * @return AlignmentView - */ + @Override public jalview.datamodel.AlignmentView getAlignmentView( boolean selectedOnly) @@ -1146,34 +1121,17 @@ public abstract class AlignmentViewport implements AlignViewportI return getAlignmentView(selectedOnly, false); } - /** - * return a compact representation of the current alignment selection to pass - * to an analysis function - * - * @param selectedOnly - * boolean true to just return the selected view - * @param markGroups - * boolean true to annotate the alignment view with groups on the - * alignment (and intersecting with selected region if selectedOnly - * is true) - * @return AlignmentView - */ + @Override public jalview.datamodel.AlignmentView getAlignmentView( boolean selectedOnly, boolean markGroups) { return new AlignmentView(alignment, colSel, selectionGroup, - hasHiddenColumns, selectedOnly, markGroups); + colSel != null && colSel.hasHiddenColumns(), selectedOnly, + markGroups); } - /** - * This method returns the visible alignment as text, as seen on the GUI, ie - * if columns are hidden they will not be returned in the result. Use this for - * calculating trees, PCA, redundancy etc on views which contain hidden - * columns. - * - * @return String[] - */ + @Override public String[] getViewAsString(boolean selectedRegionOnly) { @@ -1196,7 +1154,7 @@ public abstract class AlignmentViewport implements AlignViewportI } selection = new String[iSize]; - if (hasHiddenColumns) + if (colSel != null && colSel.hasHiddenColumns()) { selection = colSel.getVisibleSequenceStrings(start, end, seqs); } @@ -1211,15 +1169,8 @@ public abstract class AlignmentViewport implements AlignViewportI return selection; } - /** - * return visible region boundaries within given column range - * - * @param min - * first column (inclusive, from 0) - * @param max - * last column (exclusive) - * @return int[][] range of {start,end} visible positions - */ + + @Override public int[][] getVisibleRegionBoundaries(int min, int max) { Vector regions = new Vector(); @@ -1228,7 +1179,7 @@ public abstract class AlignmentViewport implements AlignViewportI do { - if (hasHiddenColumns) + if (colSel != null && colSel.hasHiddenColumns()) { if (start == 0) { @@ -1249,7 +1200,7 @@ public abstract class AlignmentViewport implements AlignViewportI regions.addElement(new int[] { start, end }); - if (hasHiddenColumns) + if (colSel != null && colSel.hasHiddenColumns()) { start = colSel.adjustForHiddenColumns(end); start = colSel.getHiddenBoundaryLeft(start) + 1; @@ -1286,18 +1237,15 @@ public abstract class AlignmentViewport implements AlignViewportI return ala; } - /** - * @return the padGaps - */ + + @Override public boolean isPadGaps() { return padGaps; } - /** - * @param padGaps - * the padGaps to set - */ + + @Override public void setPadGaps(boolean padGaps) { this.padGaps = padGaps; @@ -1309,6 +1257,7 @@ public abstract class AlignmentViewport implements AlignViewportI * * @param ap */ + @Override public void alignmentChanged(AlignmentViewPanel ap) { if (isPadGaps()) @@ -1470,6 +1419,7 @@ public abstract class AlignmentViewport implements AlignViewportI * * @see jalview.api.AlignViewportI#calcPanelHeight() */ + @Override public int calcPanelHeight() { // setHeight of panels @@ -1601,6 +1551,36 @@ public abstract class AlignmentViewport implements AlignViewportI } oldrfs.clear(); } + /** + * show the reference sequence in the alignment view + */ + private boolean displayReferenceSeq=false; + /** + * colour according to the reference sequence defined on the alignment + */ + private boolean colourByReferenceSeq=false; + + @Override + public boolean isDisplayReferenceSeq() + { + return alignment.hasSeqrep() && displayReferenceSeq; + } + + @Override + public void setDisplayReferenceSeq(boolean displayReferenceSeq) + { + this.displayReferenceSeq = displayReferenceSeq; + } + + public boolean isColourByReferenceSeq() + { + return alignment.hasSeqrep() && colourByReferenceSeq; + } + + public void setColourByReferenceSeq(boolean colourByReferenceSeq) + { + this.colourByReferenceSeq = colourByReferenceSeq; + } @Override public Color getSequenceColour(SequenceI seq) @@ -1659,4 +1639,90 @@ public abstract class AlignmentViewport implements AlignViewportI { sequenceColours = null; }; + + FeaturesDisplayedI featuresDisplayed = null; + + @Override + public FeaturesDisplayedI getFeaturesDisplayed() + { + return featuresDisplayed; + } + + @Override + public void setFeaturesDisplayed(FeaturesDisplayedI featuresDisplayedI) + { + featuresDisplayed = featuresDisplayedI; + } + + @Override + public boolean areFeaturesDisplayed() + { + return featuresDisplayed != null && featuresDisplayed.getRegisterdFeaturesCount()>0; + } + + /** + * display setting for showing/hiding sequence features on alignment view + */ + boolean showSequenceFeatures = false; + + /** + * set the flag + * + * @param b + * features are displayed if true + */ + @Override + public void setShowSequenceFeatures(boolean b) + { + showSequenceFeatures = b; + } + @Override + public boolean isShowSequenceFeatures() + { + return showSequenceFeatures; + } + + boolean showSeqFeaturesHeight; + + @Override + public void setShowSequenceFeaturesHeight(boolean selected) + { + showSeqFeaturesHeight = selected; + } + + @Override + public boolean isShowSequenceFeaturesHeight() + { + return showSeqFeaturesHeight; + } + + private boolean showAnnotation = true; + + private boolean rightAlignIds = false; + + + @Override + public void setShowAnnotation(boolean b) + { + showAnnotation = b; + } + + @Override + public boolean isShowAnnotation() + { + return showAnnotation; + } + + @Override + public boolean isRightAlignIds() + { + return rightAlignIds; + } + + @Override + public void setRightAlignIds(boolean rightAlignIds) + { + this.rightAlignIds = rightAlignIds; + } + } diff --git a/src/jalview/viewmodel/annotationfilter/AnnotationFilterParameter.java b/src/jalview/viewmodel/annotationfilter/AnnotationFilterParameter.java new file mode 100644 index 0000000..3cd4ef7 --- /dev/null +++ b/src/jalview/viewmodel/annotationfilter/AnnotationFilterParameter.java @@ -0,0 +1,101 @@ +package jalview.viewmodel.annotationfilter; + +import java.util.ArrayList; +import java.util.List; + +public class AnnotationFilterParameter +{ + public enum ThresholdType + { + NO_THRESHOLD, BELOW_THRESHOLD, ABOVE_THRESHOLD; + } + + public enum SearchableAnnotationField + { + DISPLAY_STRING, DESCRIPTION; + } + private ThresholdType thresholdType; + + private float thresholdValue; + + private boolean filterAlphaHelix = false; + + private boolean filterBetaSheet = false; + + private boolean filterTurn = false; + + private String regexString; + + private List regexSearchFields = new ArrayList(); + + public ThresholdType getThresholdType() + { + return thresholdType; + } + + public void setThresholdType(ThresholdType thresholdType) + { + this.thresholdType = thresholdType; + } + + public float getThresholdValue() + { + return thresholdValue; + } + + public void setThresholdValue(float thresholdValue) + { + this.thresholdValue = thresholdValue; + } + + public String getRegexString() + { + return regexString; + } + + public void setRegexString(String regexString) + { + this.regexString = regexString; + } + + public List getRegexSearchFields() + { + return regexSearchFields; + } + + public void addRegexSearchField(SearchableAnnotationField regexSearchField) + { + this.regexSearchFields.add(regexSearchField); + } + + public boolean isFilterAlphaHelix() + { + return filterAlphaHelix; + } + + public void setFilterAlphaHelix(boolean alphaHelix) + { + this.filterAlphaHelix = alphaHelix; + } + + public boolean isFilterBetaSheet() + { + return filterBetaSheet; + } + + public void setFilterBetaSheet(boolean betaSheet) + { + this.filterBetaSheet = betaSheet; + } + + public boolean isFilterTurn() + { + return filterTurn; + } + + public void setFilterTurn(boolean turn) + { + this.filterTurn = turn; + } + +} diff --git a/src/jalview/viewmodel/seqfeatures/FeatureRendererModel.java b/src/jalview/viewmodel/seqfeatures/FeatureRendererModel.java new file mode 100644 index 0000000..c7cee04 --- /dev/null +++ b/src/jalview/viewmodel/seqfeatures/FeatureRendererModel.java @@ -0,0 +1,949 @@ +package jalview.viewmodel.seqfeatures; + +import jalview.api.AlignViewportI; +import jalview.api.FeaturesDisplayedI; +import jalview.datamodel.AlignmentI; +import jalview.datamodel.SequenceFeature; +import jalview.datamodel.SequenceI; +import jalview.renderer.seqfeatures.FeatureRenderer; +import jalview.schemes.GraduatedColor; +import jalview.viewmodel.AlignmentViewport; + +import java.awt.Color; +import java.beans.PropertyChangeListener; +import java.beans.PropertyChangeSupport; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Hashtable; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; + +public abstract class FeatureRendererModel implements + jalview.api.FeatureRenderer +{ + + /** + * global transparency for feature + */ + protected float transparency = 1.0f; + + protected Map featureColours = new ConcurrentHashMap(); + + protected Map featureGroups = new ConcurrentHashMap(); + + protected Object currentColour; + + protected String[] renderOrder; + + protected PropertyChangeSupport changeSupport = new PropertyChangeSupport( + this); + + protected AlignmentViewport av; + + public AlignViewportI getViewport() + { + return av; + } + + public FeatureRendererSettings getSettings() + { + return new FeatureRendererSettings(this); + } + + public void transferSettings(FeatureRendererSettings fr) + { + this.renderOrder = fr.renderOrder; + this.featureGroups = fr.featureGroups; + this.featureColours = fr.featureColours; + this.transparency = fr.transparency; + this.featureOrder = fr.featureOrder; + } + + /** + * update from another feature renderer + * + * @param fr + * settings to copy + */ + public void transferSettings(jalview.api.FeatureRenderer _fr) + { + FeatureRenderer fr = (FeatureRenderer) _fr; + FeatureRendererSettings frs = new FeatureRendererSettings(fr); + this.renderOrder = frs.renderOrder; + this.featureGroups = frs.featureGroups; + this.featureColours = frs.featureColours; + this.transparency = frs.transparency; + this.featureOrder = frs.featureOrder; + if (av != null && av != fr.getViewport()) + { + // copy over the displayed feature settings + if (_fr.getFeaturesDisplayed() != null) + { + FeaturesDisplayedI fd = getFeaturesDisplayed(); + if (fd == null) + { + setFeaturesDisplayedFrom(_fr.getFeaturesDisplayed()); + } + else + { + synchronized (fd) + { + fd.clear(); + java.util.Iterator fdisp = _fr.getFeaturesDisplayed() + .getVisibleFeatures(); + while (fdisp.hasNext()) + { + fd.setVisible(fdisp.next()); + } + } + } + } + } + } + + public void setFeaturesDisplayedFrom(FeaturesDisplayedI featuresDisplayed) + { + av.setFeaturesDisplayed(new FeaturesDisplayed(featuresDisplayed)); + } + + @Override + public void setVisible(String featureType) + { + FeaturesDisplayedI fdi = av.getFeaturesDisplayed(); + if (fdi == null) + { + av.setFeaturesDisplayed(fdi = new FeaturesDisplayed()); + } + if (!fdi.isRegistered(featureType)) + { + pushFeatureType(Arrays.asList(new String[] + { featureType })); + } + fdi.setVisible(featureType); + } + + @Override + public void setAllVisible(List featureTypes) + { + FeaturesDisplayedI fdi = av.getFeaturesDisplayed(); + if (fdi == null) + { + av.setFeaturesDisplayed(fdi = new FeaturesDisplayed()); + } + List nft = new ArrayList(); + for (String featureType : featureTypes) + { + if (!fdi.isRegistered(featureType)) + { + nft.add(featureType); + } + } + if (nft.size() > 0) + { + pushFeatureType(nft); + } + fdi.setAllVisible(featureTypes); + } + + /** + * push a set of new types onto the render order stack. Note - this is a + * direct mechanism rather than the one employed in updateRenderOrder + * + * @param types + */ + private void pushFeatureType(List types) + { + + int ts = types.size(); + String neworder[] = new String[(renderOrder == null ? 0 + : renderOrder.length) + ts]; + types.toArray(neworder); + if (renderOrder != null) + { + System.arraycopy(neworder,0,neworder,renderOrder.length,ts); + System.arraycopy(renderOrder, 0, neworder, 0, renderOrder.length); + } + renderOrder = neworder; + } + + protected Hashtable minmax = new Hashtable(); + + public Hashtable getMinMax() + { + return minmax; + } + + /** + * normalise a score against the max/min bounds for the feature type. + * + * @param sequenceFeature + * @return byte[] { signed, normalised signed (-127 to 127) or unsigned + * (0-255) value. + */ + protected final byte[] normaliseScore(SequenceFeature sequenceFeature) + { + float[] mm = ((float[][]) minmax.get(sequenceFeature.type))[0]; + final byte[] r = new byte[] + { 0, (byte) 255 }; + if (mm != null) + { + if (r[0] != 0 || mm[0] < 0.0) + { + r[0] = 1; + r[1] = (byte) ((int) 128.0 + 127.0 * (sequenceFeature.score / mm[1])); + } + else + { + r[1] = (byte) ((int) 255.0 * (sequenceFeature.score / mm[1])); + } + } + return r; + } + + boolean newFeatureAdded = false; + + boolean findingFeatures = false; + + protected boolean updateFeatures() + { + if (av.getFeaturesDisplayed() == null || renderOrder == null + || newFeatureAdded) + { + findAllFeatures(); + if (av.getFeaturesDisplayed().getVisibleFeatureCount() < 1) + { + return false; + } + } + // TODO: decide if we should check for the visible feature count first + return true; + } + + /** + * search the alignment for all new features, give them a colour and display + * them. Then fires a PropertyChangeEvent on the changeSupport object. + * + */ + protected void findAllFeatures() + { + synchronized (firing) + { + if (firing.equals(Boolean.FALSE)) + { + firing = Boolean.TRUE; + findAllFeatures(true); // add all new features as visible + changeSupport.firePropertyChange("changeSupport", null, null); + firing = Boolean.FALSE; + } + } + } + + @Override + public List findFeaturesAtRes(SequenceI sequence, int res) + { + ArrayList tmp = new ArrayList(); + SequenceFeature[] features = sequence.getSequenceFeatures(); + + while (features == null && sequence.getDatasetSequence() != null) + { + sequence = sequence.getDatasetSequence(); + features = sequence.getSequenceFeatures(); + } + + if (features != null) + { + for (int i = 0; i < features.length; i++) + { + if (!av.areFeaturesDisplayed() + || !av.getFeaturesDisplayed().isVisible( + features[i].getType())) + { + continue; + } + + if (features[i].featureGroup != null + && featureGroups != null + && featureGroups.containsKey(features[i].featureGroup) + && !featureGroups.get(features[i].featureGroup) + .booleanValue()) + { + continue; + } + + if ((features[i].getBegin() <= res) + && (features[i].getEnd() >= res)) + { + tmp.add(features[i]); + } + } + } + return tmp; + } + + /** + * Searches alignment for all features and updates colours + * + * @param newMadeVisible + * if true newly added feature types will be rendered immediatly + * TODO: check to see if this method should actually be proxied so + * repaint events can be propagated by the renderer code + */ + @Override + public synchronized void findAllFeatures(boolean newMadeVisible) + { + newFeatureAdded = false; + + if (findingFeatures) + { + newFeatureAdded = true; + return; + } + + findingFeatures = true; + if (av.getFeaturesDisplayed() == null) + { + av.setFeaturesDisplayed(new FeaturesDisplayed()); + } + FeaturesDisplayedI featuresDisplayed = av.getFeaturesDisplayed(); + + ArrayList allfeatures = new ArrayList(); + ArrayList oldfeatures = new ArrayList(); + if (renderOrder != null) + { + for (int i = 0; i < renderOrder.length; i++) + { + if (renderOrder[i] != null) + { + oldfeatures.add(renderOrder[i]); + } + } + } + if (minmax == null) + { + minmax = new Hashtable(); + } + AlignmentI alignment = av.getAlignment(); + for (int i = 0; i < alignment.getHeight(); i++) + { + SequenceI asq = alignment.getSequenceAt(i); + SequenceI dasq = asq.getDatasetSequence(); + SequenceFeature[] features = dasq != null ? dasq + .getSequenceFeatures() : asq.getSequenceFeatures(); + + if (features == null) + { + continue; + } + + int index = 0; + while (index < features.length) + { + if (!featuresDisplayed.isRegistered(features[index].getType())) + { + String fgrp = features[index].getFeatureGroup(); + if (fgrp != null) + { + Boolean groupDisplayed = featureGroups.get(fgrp); + if (groupDisplayed == null) + { + groupDisplayed = Boolean.valueOf(newMadeVisible); + featureGroups.put(fgrp, groupDisplayed); + } + if (!groupDisplayed.booleanValue()) + { + index++; + continue; + } + } + if (!(features[index].begin == 0 && features[index].end == 0)) + { + // If beginning and end are 0, the feature is for the whole sequence + // and we don't want to render the feature in the normal way + + if (newMadeVisible + && !oldfeatures.contains(features[index].getType())) + { + // this is a new feature type on the alignment. Mark it for + // display. + featuresDisplayed.setVisible(features[index].getType()); + setOrder(features[index].getType(), 0); + } + } + } + if (!allfeatures.contains(features[index].getType())) + { + allfeatures.add(features[index].getType()); + } + if (features[index].score != Float.NaN) + { + int nonpos = features[index].getBegin() >= 1 ? 0 : 1; + float[][] mm = (float[][]) minmax.get(features[index].getType()); + if (mm == null) + { + mm = new float[][] + { null, null }; + minmax.put(features[index].getType(), mm); + } + if (mm[nonpos] == null) + { + mm[nonpos] = new float[] + { features[index].score, features[index].score }; + + } + else + { + if (mm[nonpos][0] > features[index].score) + { + mm[nonpos][0] = features[index].score; + } + if (mm[nonpos][1] < features[index].score) + { + mm[nonpos][1] = features[index].score; + } + } + } + index++; + } + } + updateRenderOrder(allfeatures); + findingFeatures = false; + } + + protected Boolean firing = Boolean.FALSE; + + /** + * replaces the current renderOrder with the unordered features in + * allfeatures. The ordering of any types in both renderOrder and allfeatures + * is preserved, and all new feature types are rendered on top of the existing + * types, in the order given by getOrder or the order given in allFeatures. + * Note. this operates directly on the featureOrder hash for efficiency. TODO: + * eliminate the float storage for computing/recalling the persistent ordering + * New Cability: updates min/max for colourscheme range if its dynamic + * + * @param allFeatures + */ + private void updateRenderOrder(List allFeatures) + { + List allfeatures = new ArrayList(allFeatures); + String[] oldRender = renderOrder; + renderOrder = new String[allfeatures.size()]; + Object mmrange, fc = null; + boolean initOrders = (featureOrder == null); + int opos = 0; + if (oldRender != null && oldRender.length > 0) + { + for (int j = 0; j < oldRender.length; j++) + { + if (oldRender[j] != null) + { + if (initOrders) + { + setOrder(oldRender[j], (1 - (1 + (float) j) + / oldRender.length)); + } + if (allfeatures.contains(oldRender[j])) + { + renderOrder[opos++] = oldRender[j]; // existing features always + // appear below new features + allfeatures.remove(oldRender[j]); + if (minmax != null) + { + mmrange = minmax.get(oldRender[j]); + if (mmrange != null) + { + fc = featureColours.get(oldRender[j]); + if (fc != null && fc instanceof GraduatedColor + && ((GraduatedColor) fc).isAutoScale()) + { + ((GraduatedColor) fc).updateBounds( + ((float[][]) mmrange)[0][0], + ((float[][]) mmrange)[0][1]); + } + } + } + } + } + } + } + if (allfeatures.size() == 0) + { + // no new features - leave order unchanged. + return; + } + int i = allfeatures.size() - 1; + int iSize = i; + boolean sort = false; + String[] newf = new String[allfeatures.size()]; + float[] sortOrder = new float[allfeatures.size()]; + for (String newfeat : allfeatures) + { + newf[i] = newfeat; + if (minmax != null) + { + // update from new features minmax if necessary + mmrange = minmax.get(newf[i]); + if (mmrange != null) + { + fc = featureColours.get(newf[i]); + if (fc != null && fc instanceof GraduatedColor + && ((GraduatedColor) fc).isAutoScale()) + { + ((GraduatedColor) fc).updateBounds(((float[][]) mmrange)[0][0], + ((float[][]) mmrange)[0][1]); + } + } + } + if (initOrders || !featureOrder.containsKey(newf[i])) + { + int denom = initOrders ? allfeatures.size() : featureOrder.size(); + // new unordered feature - compute persistent ordering at head of + // existing features. + setOrder(newf[i], i / (float) denom); + } + // set order from newly found feature from persisted ordering. + sortOrder[i] = 2 - ((Float) featureOrder.get(newf[i])).floatValue(); + if (i < iSize) + { + // only sort if we need to + sort = sort || sortOrder[i] > sortOrder[i + 1]; + } + i--; + } + if (iSize > 1 && sort) + { + jalview.util.QuickSort.sort(sortOrder, newf); + } + sortOrder = null; + System.arraycopy(newf, 0, renderOrder, opos, newf.length); + } + + /** + * get a feature style object for the given type string. Creates a + * java.awt.Color for a featureType with no existing colourscheme. TODO: + * replace return type with object implementing standard abstract colour/style + * interface + * + * @param featureType + * @return java.awt.Color or GraduatedColor + */ + public Object getFeatureStyle(String featureType) + { + Object fc = featureColours.get(featureType); + if (fc == null) + { + jalview.schemes.UserColourScheme ucs = new jalview.schemes.UserColourScheme(); + Color col = ucs.createColourFromName(featureType); + featureColours.put(featureType, fc = col); + } + return fc; + } + + /** + * return a nominal colour for this feature + * + * @param featureType + * @return standard color, or maximum colour for graduated colourscheme + */ + public Color getColour(String featureType) + { + Object fc = getFeatureStyle(featureType); + + if (fc instanceof Color) + { + return (Color) fc; + } + else + { + if (fc instanceof GraduatedColor) + { + return ((GraduatedColor) fc).getMaxColor(); + } + } + throw new Error("Implementation Error: Unrecognised render object " + + fc.getClass() + " for features of type " + featureType); + } + + /** + * calculate the render colour for a specific feature using current feature + * settings. + * + * @param feature + * @return render colour for the given feature + */ + public Color getColour(SequenceFeature feature) + { + Object fc = getFeatureStyle(feature.getType()); + if (fc instanceof Color) + { + return (Color) fc; + } + else + { + if (fc instanceof GraduatedColor) + { + return ((GraduatedColor) fc).findColor(feature); + } + } + throw new Error("Implementation Error: Unrecognised render object " + + fc.getClass() + " for features of type " + feature.getType()); + } + + protected boolean showFeature(SequenceFeature sequenceFeature) + { + Object fc = getFeatureStyle(sequenceFeature.type); + if (fc instanceof GraduatedColor) + { + return ((GraduatedColor) fc).isColored(sequenceFeature); + } + else + { + return true; + } + } + + protected boolean showFeatureOfType(String type) + { + return av.getFeaturesDisplayed().isVisible(type); + } + + public void setColour(String featureType, Object col) + { + // overwrite + // Color _col = (col instanceof Color) ? ((Color) col) : (col instanceof + // GraduatedColor) ? ((GraduatedColor) col).getMaxColor() : null; + // Object c = featureColours.get(featureType); + // if (c == null || c instanceof Color || (c instanceof GraduatedColor && + // !((GraduatedColor)c).getMaxColor().equals(_col))) + { + featureColours.put(featureType, col); + } + } + + public void setTransparency(float value) + { + transparency = value; + } + + public float getTransparency() + { + return transparency; + } + + Map featureOrder = null; + + /** + * analogous to colour - store a normalized ordering for all feature types in + * this rendering context. + * + * @param type + * Feature type string + * @param position + * normalized priority - 0 means always appears on top, 1 means + * always last. + */ + public float setOrder(String type, float position) + { + if (featureOrder == null) + { + featureOrder = new Hashtable(); + } + featureOrder.put(type, new Float(position)); + return position; + } + + /** + * get the global priority (0 (top) to 1 (bottom)) + * + * @param type + * @return [0,1] or -1 for a type without a priority + */ + public float getOrder(String type) + { + if (featureOrder != null) + { + if (featureOrder.containsKey(type)) + { + return ((Float) featureOrder.get(type)).floatValue(); + } + } + return -1; + } + + @Override + public Map getFeatureColours() + { + return new ConcurrentHashMap(featureColours); + } + + /** + * Replace current ordering with new ordering + * + * @param data + * { String(Type), Colour(Type), Boolean(Displayed) } + */ + public void setFeaturePriority(Object[][] data) + { + setFeaturePriority(data, true); + } + + /** + * + * @param data + * { String(Type), Colour(Type), Boolean(Displayed) } + * @param visibleNew + * when true current featureDisplay list will be cleared + */ + public void setFeaturePriority(Object[][] data, boolean visibleNew) + { + FeaturesDisplayedI av_featuresdisplayed = null; + if (visibleNew) + { + if ((av_featuresdisplayed = av.getFeaturesDisplayed()) != null) + { + av.getFeaturesDisplayed().clear(); + } + else + { + av.setFeaturesDisplayed(av_featuresdisplayed = new FeaturesDisplayed()); + } + } + else + { + av_featuresdisplayed = av.getFeaturesDisplayed(); + } + if (data == null) + { + return; + } + // The feature table will display high priority + // features at the top, but theses are the ones + // we need to render last, so invert the data + renderOrder = new String[data.length]; + + if (data.length > 0) + { + for (int i = 0; i < data.length; i++) + { + String type = data[i][0].toString(); + setColour(type, data[i][1]); // todo : typesafety - feature color + // interface object + if (((Boolean) data[i][2]).booleanValue()) + { + av_featuresdisplayed.setVisible(type); + } + + renderOrder[data.length - i - 1] = type; + } + } + + } + + /** + * @param listener + * @see java.beans.PropertyChangeSupport#addPropertyChangeListener(java.beans.PropertyChangeListener) + */ + public void addPropertyChangeListener(PropertyChangeListener listener) + { + changeSupport.addPropertyChangeListener(listener); + } + + /** + * @param listener + * @see java.beans.PropertyChangeSupport#removePropertyChangeListener(java.beans.PropertyChangeListener) + */ + public void removePropertyChangeListener(PropertyChangeListener listener) + { + changeSupport.removePropertyChangeListener(listener); + } + + public Set getAllFeatureColours() + { + return featureColours.keySet(); + } + + public void clearRenderOrder() + { + renderOrder = null; + } + + public boolean hasRenderOrder() + { + return renderOrder != null; + } + + public List getRenderOrder() + { + if (renderOrder == null) + { + return Arrays.asList(new String[] + {}); + } + return Arrays.asList(renderOrder); + } + + public int getFeatureGroupsSize() + { + return featureGroups != null ? 0 : featureGroups.size(); + } + + @Override + public List getFeatureGroups() + { + // conflict between applet and desktop - featureGroups returns the map in + // the desktop featureRenderer + return (featureGroups == null) ? Arrays.asList(new String[0]) : Arrays + .asList(featureGroups.keySet().toArray(new String[0])); + } + + public boolean checkGroupVisibility(String group, boolean newGroupsVisible) + { + if (featureGroups == null) + { + // then an exception happens next.. + } + if (featureGroups.containsKey(group)) + { + return featureGroups.get(group).booleanValue(); + } + if (newGroupsVisible) + { + featureGroups.put(group, new Boolean(true)); + return true; + } + return false; + } + + /** + * get visible or invisible groups + * + * @param visible + * true to return visible groups, false to return hidden ones. + * @return list of groups + */ + @Override + public List getGroups(boolean visible) + { + if (featureGroups != null) + { + ArrayList gp = new ArrayList(); + + for (Object grp : featureGroups.keySet()) + { + Boolean state = featureGroups.get(grp); + if (state.booleanValue() == visible) + { + gp.add(grp); + } + } + return gp; + } + return null; + } + + @Override + public void setGroupVisibility(String group, boolean visible) + { + featureGroups.put(group, new Boolean(visible)); + } + + @Override + public void setGroupVisibility(List toset, boolean visible) + { + if (toset != null && toset.size() > 0 && featureGroups != null) + { + boolean rdrw = false; + for (String gst : toset) + { + Boolean st = featureGroups.get(gst); + featureGroups.put(gst, new Boolean(visible)); + if (st != null) + { + rdrw = rdrw || (visible != st.booleanValue()); + } + } + if (rdrw) + { + // set local flag indicating redraw needed ? + } + } + } + + @Override + public Hashtable getDisplayedFeatureCols() + { + Hashtable fcols = new Hashtable(); + if (getViewport().getFeaturesDisplayed() == null) + { + return fcols; + } + Iterator en = getViewport().getFeaturesDisplayed() + .getVisibleFeatures(); + while (en.hasNext()) + { + String col = en.next(); + fcols.put(col, getColour(col)); + } + return fcols; + } + + @Override + public FeaturesDisplayedI getFeaturesDisplayed() + { + return av.getFeaturesDisplayed(); + } + + @Override + public String[] getDisplayedFeatureTypes() + { + String[] typ = null; + typ = getRenderOrder().toArray(new String[0]); + FeaturesDisplayedI feature_disp = av.getFeaturesDisplayed(); + if (feature_disp != null) + { + synchronized (feature_disp) + { + for (int i = 0; i < typ.length; i++) + { + if (!feature_disp.isVisible(typ[i])) + { + typ[i] = null; + } + } + } + } + return typ; + } + + @Override + public String[] getDisplayedFeatureGroups() + { + String[] gps = null; + ArrayList _gps = new ArrayList(); + Iterator en = getFeatureGroups().iterator(); + int g = 0; + boolean valid = false; + while (en.hasNext()) + { + String gp = (String) en.next(); + if (checkGroupVisibility(gp, false)) + { + valid = true; + _gps.add(gp); + } + if (!valid) + { + return null; + } + else + { + gps = new String[_gps.size()]; + _gps.toArray(gps); + } + } + return gps; + } + +} diff --git a/src/jalview/viewmodel/seqfeatures/FeatureRendererSettings.java b/src/jalview/viewmodel/seqfeatures/FeatureRendererSettings.java new file mode 100644 index 0000000..6e85b83 --- /dev/null +++ b/src/jalview/viewmodel/seqfeatures/FeatureRendererSettings.java @@ -0,0 +1,77 @@ +package jalview.viewmodel.seqfeatures; + +import jalview.schemes.GraduatedColor; + +import java.util.Arrays; +import java.util.Hashtable; +import java.util.Iterator; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +public class FeatureRendererSettings implements Cloneable +{ + String[] renderOrder; + + Map featureGroups; + + Map featureColours; + + float transparency; + + Map featureOrder; + + public FeatureRendererSettings(String[] renderOrder, + Hashtable featureGroups, Hashtable featureColours, + float transparency, Hashtable featureOrder) + { + super(); + this.renderOrder = Arrays.copyOf(renderOrder,renderOrder.length); + this.featureGroups = new ConcurrentHashMap(featureGroups); + this.featureColours = new ConcurrentHashMap(featureColours); + this.transparency = transparency; + this.featureOrder = new ConcurrentHashMap(featureOrder); + } + + /** + * create an independent instance of the feature renderer settings + * + * @param fr + */ + public FeatureRendererSettings( + jalview.viewmodel.seqfeatures.FeatureRendererModel fr) + { + renderOrder = null; + featureGroups = new ConcurrentHashMap(); + featureColours = new ConcurrentHashMap(); + featureOrder = new ConcurrentHashMap(); + if (fr.renderOrder != null) + { + this.renderOrder = new String[fr.renderOrder.length]; + System.arraycopy(fr.renderOrder, 0, renderOrder, 0, + fr.renderOrder.length); + } + if (fr.featureGroups != null) + { + this.featureGroups = new ConcurrentHashMap(fr.featureGroups); + } + if (fr.featureColours != null) + { + this.featureColours = new ConcurrentHashMap(fr.featureColours); + } + Iterator en = fr.featureColours.keySet().iterator(); + while (en.hasNext()) + { + Object next = en.next(); + Object val = featureColours.get(next); + if (val instanceof GraduatedColor) + { + featureColours.put(next, new GraduatedColor((GraduatedColor) val)); + } + } + this.transparency = fr.transparency; + if (fr.featureOrder != null) + { + this.featureOrder = new ConcurrentHashMap(fr.featureOrder); + } + } +} \ No newline at end of file diff --git a/src/jalview/viewmodel/seqfeatures/FeatureSettingsModel.java b/src/jalview/viewmodel/seqfeatures/FeatureSettingsModel.java new file mode 100644 index 0000000..57d57da --- /dev/null +++ b/src/jalview/viewmodel/seqfeatures/FeatureSettingsModel.java @@ -0,0 +1,8 @@ +package jalview.viewmodel.seqfeatures; + +import jalview.api.FeatureSettingsModelI; + +public class FeatureSettingsModel implements FeatureSettingsModelI +{ + +} diff --git a/src/jalview/viewmodel/seqfeatures/FeaturesDisplayed.java b/src/jalview/viewmodel/seqfeatures/FeaturesDisplayed.java new file mode 100644 index 0000000..b04764c --- /dev/null +++ b/src/jalview/viewmodel/seqfeatures/FeaturesDisplayed.java @@ -0,0 +1,94 @@ +package jalview.viewmodel.seqfeatures; + +import jalview.api.FeaturesDisplayedI; + +import java.util.Collection; +import java.util.HashSet; +import java.util.Iterator; + +public class FeaturesDisplayed implements FeaturesDisplayedI +{ + private HashSet featuresDisplayed = new HashSet(); + + private HashSet featuresRegistered = new HashSet(); + + public FeaturesDisplayed(FeaturesDisplayedI featuresDisplayed2) + { + Iterator fdisp = featuresDisplayed2.getVisibleFeatures(); + String ftype; + while (fdisp.hasNext()) + { + ftype = fdisp.next(); + featuresDisplayed.add(ftype); + featuresRegistered.add(ftype); + } + } + + public FeaturesDisplayed() + { + // TODO Auto-generated constructor stub + } + + @Override + public Iterator getVisibleFeatures() + { + return featuresDisplayed.iterator(); + } + + @Override + public boolean isVisible(String featureType) + { + return featuresDisplayed.contains(featureType); + } + + @Override + public boolean areVisible(Collection featureTypes) + { + return featuresDisplayed.containsAll(featureTypes); + } + + @Override + public void clear() + { + featuresDisplayed.clear(); + featuresRegistered.clear(); + } + + @Override + public void setAllVisible(Collection makeVisible) + { + featuresDisplayed.addAll(makeVisible); + featuresRegistered.addAll(makeVisible); + } + + @Override + public void setAllRegisteredVisible() + { + featuresDisplayed.addAll(featuresRegistered); + } + + @Override + public void setVisible(String featureType) + { + featuresDisplayed.add(featureType); + featuresRegistered.add(featureType); + } + + @Override + public boolean isRegistered(String type) + { + return featuresRegistered.contains(type); + } + + @Override + public int getVisibleFeatureCount() + { + return featuresDisplayed.size(); + } + + @Override + public int getRegisterdFeaturesCount() + { + return featuresRegistered.size(); + } +} diff --git a/src/jalview/ws/AWSThread.java b/src/jalview/ws/AWSThread.java index edb56a9..d3682d4 100644 --- a/src/jalview/ws/AWSThread.java +++ b/src/jalview/ws/AWSThread.java @@ -28,7 +28,7 @@ import jalview.datamodel.AlignmentView; import jalview.datamodel.SequenceI; import jalview.gui.AlignFrame; import jalview.gui.WebserviceInfo; -import jalview.gui.FeatureRenderer.FeatureRendererSettings; +import jalview.viewmodel.seqfeatures.FeatureRendererSettings; import jalview.util.MessageManager; public abstract class AWSThread extends Thread diff --git a/src/jalview/ws/jws2/AADisorderClient.java b/src/jalview/ws/jws2/AADisorderClient.java index 6c438be..929581d 100644 --- a/src/jalview/ws/jws2/AADisorderClient.java +++ b/src/jalview/ws/jws2/AADisorderClient.java @@ -351,7 +351,7 @@ public class AADisorderClient extends JabawsCalcWorker implements { if (dispFeatures) { - jalview.gui.FeatureRenderer fr = ((jalview.gui.AlignmentPanel) ap) + jalview.api.FeatureRenderer fr = ((jalview.gui.AlignmentPanel) ap) .cloneFeatureRenderer(); for (String ft : fc.keySet()) { diff --git a/src/jalview/ws/rest/params/AnnotationFile.java b/src/jalview/ws/rest/params/AnnotationFile.java index 0268c35..1820182 100644 --- a/src/jalview/ws/rest/params/AnnotationFile.java +++ b/src/jalview/ws/rest/params/AnnotationFile.java @@ -73,9 +73,8 @@ public class AnnotationFile extends InputType if (format.equals(JVANNOT)) { return new StringBody( - new jalview.io.AnnotationFile().printAnnotations( - al.getAlignmentAnnotation(), al.getGroups(), - al.getProperties())); + new jalview.io.AnnotationFile() + .printAnnotationsForAlignment(al)); } else { diff --git a/test/jalview/analysis/scoremodels/FeatureScoreModelTest.java b/test/jalview/analysis/scoremodels/FeatureScoreModelTest.java new file mode 100644 index 0000000..1dbaa4a --- /dev/null +++ b/test/jalview/analysis/scoremodels/FeatureScoreModelTest.java @@ -0,0 +1,74 @@ +package jalview.analysis.scoremodels; + +import jalview.datamodel.AlignmentI; +import jalview.datamodel.SequenceFeature; +import jalview.datamodel.SequenceI; +import jalview.gui.AlignFrame; +import jalview.io.FileLoader; +import jalview.io.FormatAdapter; + +import org.junit.Assert; +import org.junit.Test; + +public class FeatureScoreModelTest +{ + public static String alntestFile = "FER1_MESCR/72-76 DVYIL\nFER1_SPIOL/71-75 DVYIL\nFER3_RAPSA/21-25 DVYVL\nFER1_MAIZE/73-77 DVYIL\n"; + + int[] sf1 = new int[] + { 74, 74, 73, 73, 23, 23, -1, -1 }; + + int[] sf2 = new int[] + { -1, -1, 74, 75, -1, -1, 76, 77 }; + + int[] sf3 = new int[] + { -1, -1, -1, -1, -1, -1, 76, 77 }; + + @Test + public void testFeatureScoreModel() throws Exception + { + AlignFrame alf = new FileLoader(false).LoadFileWaitTillLoaded(alntestFile, + FormatAdapter.PASTE); + AlignmentI al = alf.getViewport().getAlignment(); + Assert.assertEquals(4, al.getHeight()); + Assert.assertEquals(5, al.getWidth()); + for (int i = 0; i < 4; i++) + { + SequenceI ds = al.getSequenceAt(i).getDatasetSequence(); + if (sf1[i * 2] > 0) + { + ds.addSequenceFeature(new SequenceFeature("sf1", "sf1", "sf1", + sf1[i * 2], sf1[i * 2 + 1], "sf1")); + } + if (sf2[i * 2] > 0) + { + ds.addSequenceFeature(new SequenceFeature("sf2", "sf2", "sf2", + sf2[i * 2], sf2[i * 2 + 1], "sf2")); + } + if (sf3[i * 2] > 0) + { + ds.addSequenceFeature(new SequenceFeature("sf3", "sf3", "sf3", + sf3[i * 2], sf3[i * 2 + 1], "sf3")); + } + } + alf.setShowSeqFeatures(true); + alf.getFeatureRenderer().setVisible("sf1"); + alf.getFeatureRenderer().setVisible("sf2"); + alf.getFeatureRenderer().setVisible("sf3"); + alf.getFeatureRenderer().findAllFeatures(true); + Assert.assertEquals("Number of feature types", 3, alf + .getFeatureRenderer().getDisplayedFeatureTypes().length); + Assert.assertTrue(alf.getCurrentView().areFeaturesDisplayed()); + FeatureScoreModel fsm = new FeatureScoreModel(); + Assert.assertTrue(fsm.configureFromAlignmentView(alf.getCurrentView() + .getAlignPanel())); + alf.selectAllSequenceMenuItem_actionPerformed(null); + float[][] dm = fsm.findDistances(alf.getViewport().getAlignmentView( + true)); + Assert.assertTrue("FER1_MESCR should be identical with RAPSA (2)", + dm[0][2] == 0f); + Assert.assertTrue( + "FER1_MESCR should be further from SPIOL (1) than it is from RAPSA (2)", + dm[0][1] > dm[0][2]); + + } +} diff --git a/test/jalview/datamodel/SequenceTest.java b/test/jalview/datamodel/SequenceTest.java index 3f91710..40476a0 100644 --- a/test/jalview/datamodel/SequenceTest.java +++ b/test/jalview/datamodel/SequenceTest.java @@ -12,7 +12,7 @@ import org.junit.Test; public class SequenceTest { - Sequence seq; + SequenceI seq; @Before public void setUp() @@ -20,6 +20,21 @@ public class SequenceTest seq = new Sequence("FER1", "AKPNGVL"); } @Test + public void testInsertGapsAndGapmaps() + { + SequenceI aseq = seq.deriveSequence(); + aseq.insertCharAt(2, 3, '-'); + aseq.insertCharAt(6, 3, '-'); + assertEquals("Gap insertions not correct", "AK---P---NGVL", + aseq.getSequenceAsString()); + List gapInt = aseq.getInsertions(); + assertEquals("Gap interval 1 start wrong", 2, gapInt.get(0)[0]); + assertEquals("Gap interval 1 end wrong", 4, gapInt.get(0)[1]); + assertEquals("Gap interval 2 start wrong", 6, gapInt.get(1)[0]); + assertEquals("Gap interval 2 end wrong", 8, gapInt.get(1)[1]); + } + + @Test public void testGetAnnotation() { // initial state returns null not an empty array @@ -94,7 +109,7 @@ public class SequenceTest @Test public void testAddAlignmentAnnotation() { - assertNull(seq.annotation); + assertNull(seq.getAnnotation()); final AlignmentAnnotation annotation = new AlignmentAnnotation("a", "b", 2d); assertNull(annotation.sequenceRef); diff --git a/test/jalview/io/AnnotationFileIOTest.java b/test/jalview/io/AnnotationFileIOTest.java index 18e008e..56e6cda 100644 --- a/test/jalview/io/AnnotationFileIOTest.java +++ b/test/jalview/io/AnnotationFileIOTest.java @@ -24,8 +24,11 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import jalview.datamodel.AlignmentI; +import jalview.datamodel.ColumnSelection; +import jalview.io.AnnotationFile.ViewDef; import java.io.File; +import java.util.Hashtable; import org.junit.Test; @@ -44,7 +47,9 @@ public class AnnotationFileIOTest "examples/uniref50.fa", "examples/testdata/uniref50_iupred.jva" }, { "Test group only annotation file parsing results in parser indicating annotation was parsed", - "examples/uniref50.fa", "examples/testdata/test_grpannot.jva" } }; + "examples/uniref50.fa", "examples/testdata/test_grpannot.jva" }, + { "Test hiding/showing of insertions on sequence_ref", + "examples/uniref50.fa", "examples/testdata/uniref50_seqref.jva" } }; @Test public void exampleAnnotationFileIO() throws Exception @@ -102,17 +107,20 @@ public class AnnotationFileIOTest try { AlignmentI al = readAlignmentFile(f); - + ColumnSelection cs = new ColumnSelection(); assertTrue( "Test " + testname + "\nAlignment was not annotated - annotation file not imported.", - new AnnotationFile().readAnnotationFile(al, af, + new AnnotationFile().readAnnotationFile(al, cs, af, FormatAdapter.FILE)); + AnnotationFile aff = new AnnotationFile(); + ViewDef v = aff.new ViewDef(null, al.getHiddenSequences(), cs, + new Hashtable()); String anfileout = new AnnotationFile().printAnnotations( al.getAlignmentAnnotation(), al.getGroups(), - al.getProperties()); + al.getProperties(), null, al, v); assertTrue( "Test " + testname diff --git a/test/jalview/io/BioJsHTMLOutputTest.java b/test/jalview/io/BioJsHTMLOutputTest.java index cbda794..4b817ab 100644 --- a/test/jalview/io/BioJsHTMLOutputTest.java +++ b/test/jalview/io/BioJsHTMLOutputTest.java @@ -32,8 +32,11 @@ public class BioJsHTMLOutputTest { String generatedJson = bioJsHtmlOuput .getJalviewAlignmentAsJsonString(al); - assert (generatedJson - .equalsIgnoreCase("{\"globalColorScheme\":\"zappo\",\"seqs\":[{\"id\":\"1\",\"start\":1,\"name\":\"name/1-26\",\"features\":[],\"seq\":\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\",\"end\":26}]}")); + org.junit.Assert + .assertEquals( + generatedJson.toLowerCase(), + "{\"globalColorScheme\":\"zappo\",\"seqs\":[{\"id\":\"1\",\"start\":1,\"name\":\"name/1-26\",\"features\":[],\"seq\":\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\",\"end\":26}]}" + .toLowerCase()); System.out.println("Output : " + generatedJson); } catch (IOException e) { diff --git a/test/jalview/ws/jabaws/DisorderAnnotExportImport.java b/test/jalview/ws/jabaws/DisorderAnnotExportImport.java index db7d505..1e47800 100644 --- a/test/jalview/ws/jabaws/DisorderAnnotExportImport.java +++ b/test/jalview/ws/jabaws/DisorderAnnotExportImport.java @@ -20,11 +20,9 @@ */ package jalview.ws.jabaws; -import static org.junit.Assert.*; - -import java.util.ArrayList; -import java.util.List; - +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.AlignmentI; import jalview.io.AnnotationFile; @@ -34,6 +32,9 @@ import jalview.ws.jws2.AADisorderClient; import jalview.ws.jws2.Jws2Discoverer; import jalview.ws.jws2.jabaws2.Jws2Instance; +import java.util.ArrayList; +import java.util.List; + import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; @@ -124,9 +125,8 @@ public class DisorderAnnotExportImport { String aligfileout = new FormatAdapter().formatSequences("PFAM", al.getSequencesArray()); - String anfileout = new AnnotationFile().printAnnotations( - al.getAlignmentAnnotation(), al.getGroups(), - al.getProperties()); + String anfileout = new AnnotationFile() + .printAnnotationsForAlignment(al); assertTrue( "Test " + testname diff --git a/test/jalview/ws/jabaws/JpredJabaStructExportImport.java b/test/jalview/ws/jabaws/JpredJabaStructExportImport.java index f47e542..0743581 100644 --- a/test/jalview/ws/jabaws/JpredJabaStructExportImport.java +++ b/test/jalview/ws/jabaws/JpredJabaStructExportImport.java @@ -33,7 +33,6 @@ import jalview.ws.jws2.JabaParamStore; import jalview.ws.jws2.Jws2Discoverer; import jalview.ws.jws2.SequenceAnnotationWSClient; import jalview.ws.jws2.jabaws2.Jws2Instance; -import jalview.ws.params.ArgumentI; import jalview.ws.params.AutoCalcSetting; import java.awt.Component; @@ -81,7 +80,9 @@ public class JpredJabaStructExportImport System.out.println("State of jpredws: " + jpredws); if (jpredws == null) + { System.exit(0); + } jalview.io.FileLoader fl = new jalview.io.FileLoader(false); @@ -186,9 +187,8 @@ public class JpredJabaStructExportImport String aligfileout = new FormatAdapter().formatSequences("PFAM", al.getSequencesArray()); - String anfileout = new AnnotationFile().printAnnotations( - al.getAlignmentAnnotation(), al.getGroups(), - al.getProperties()); + String anfileout = new AnnotationFile() + .printAnnotationsForAlignment(al); assertTrue( "Test " + testname diff --git a/test/jalview/ws/jabaws/RNAStructExportImport.java b/test/jalview/ws/jabaws/RNAStructExportImport.java index e74ebe7..5eeff50 100644 --- a/test/jalview/ws/jabaws/RNAStructExportImport.java +++ b/test/jalview/ws/jabaws/RNAStructExportImport.java @@ -20,33 +20,27 @@ */ package jalview.ws.jabaws; -import static org.junit.Assert.*; - -import java.awt.Component; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Vector; - -import javax.swing.JMenu; -import javax.swing.JMenuItem; - -import jalview.api.AlignCalcManagerI; -import jalview.datamodel.AlignmentAnnotation; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; import jalview.datamodel.AlignmentI; -import jalview.datamodel.Annotation; import jalview.gui.Jalview2XML; import jalview.io.AnnotationFile; import jalview.io.FormatAdapter; import jalview.io.StockholmFileTest; -import jalview.ws.jws2.AADisorderClient; import jalview.ws.jws2.Jws2Discoverer; import jalview.ws.jws2.RNAalifoldClient; import jalview.ws.jws2.SequenceAnnotationWSClient; -import jalview.ws.jws2.dm.JabaOption; import jalview.ws.jws2.jabaws2.Jws2Instance; import jalview.ws.params.AutoCalcSetting; +import java.awt.Component; +import java.util.ArrayList; +import java.util.List; + +import javax.swing.JMenu; +import javax.swing.JMenuItem; + import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; @@ -84,7 +78,9 @@ public class RNAStructExportImport System.out.println("State of rnaalifoldws: " + rnaalifoldws); if (rnaalifoldws == null) + { System.exit(0); + } jalview.io.FileLoader fl = new jalview.io.FileLoader(false); @@ -137,9 +133,8 @@ public class RNAStructExportImport String aligfileout = new FormatAdapter().formatSequences("PFAM", al.getSequencesArray()); - String anfileout = new AnnotationFile().printAnnotations( - al.getAlignmentAnnotation(), al.getGroups(), - al.getProperties()); + String anfileout = new AnnotationFile() + .printAnnotationsForAlignment(al); assertTrue( "Test " + testname