From e9c752522f4b0b9ef072e7c1f198f9ec59de957d Mon Sep 17 00:00:00 2001 From: tcofoegbu Date: Thu, 9 Jul 2015 12:21:26 +0100 Subject: [PATCH] JAL-1769 added test for commandline input operations --- examples/uniref50_test_annot | 11 ++ examples/uniref50_test_features | 5 + examples/uniref50_test_tree | 1 + src/jalview/bin/Jalview.java | 67 ++++++- test/jalview/bin/CommandLineOperations.java | 260 +++++++++++++++++---------- 5 files changed, 241 insertions(+), 103 deletions(-) create mode 100644 examples/uniref50_test_annot create mode 100644 examples/uniref50_test_features create mode 100644 examples/uniref50_test_tree diff --git a/examples/uniref50_test_annot b/examples/uniref50_test_annot new file mode 100644 index 0000000..fd60c65 --- /dev/null +++ b/examples/uniref50_test_annot @@ -0,0 +1,11 @@ +JALVIEW_ANNOTATION +# Created: Wed Jul 08 18:48:01 BST 2015 + +NO_GRAPH Test Annotation Test Annotation ||||H,α|H,α|H,α|H,α|H,α|H,α|H,α|H,α|H,α|H,α|H,α|H,α|H,α|H,α|H,α|H,α|H,α|H,α|H,α|H,α|H,α|H,α|||||||||||E,β|E,β|E,β|E,β|E,β|E,β|E,β|E,β|E,β|E,β|E,β|E,β|E,β|E,β|E,β|E,β|E,β|||||||||||||||||||||||||||||||||||||||||||||||||E,β|E,β|E,β|E,β|E,β|||||||||||||||H,α|H,α|H,α|H,α|H,α|H,α|H,α|H,α|H,α|H,α|H,α|H,α|H,α|H,α|H,α|H,α|||||||||||||||||E,β|E,β|||| +BAR_GRAPH Conservation Conservation of total alignment less than 25% gaps 1.0,1,hydrophobic ,[5d1500]|3.0,3,small hydrophobic tiny ,[7d3f00]|0.0,-,[4d0000]|0.0,-,[4d0000]|0.0,-,[4d0000]|0.0,-,[4d0000]|0.0,-,[4d0000]|0.0,-,[4d0000]|0.0,-,[4d0000]|0.0,-,[4d0000]|0.0,-,[4d0000]|0.0,-,[4d0000]|0.0,-,[4d0000]|0.0,-,[4d0000]|1.0,1,hydrophobic ,[5d1500]|2.0,2,small tiny ,[6d2a00]|0.0,0,[4d0000]|1.0,1,small ,[5d1500]|0.0,0,[4d0000]|1.0,1,hydrophobic ,[5d1500]|0.0,0,[4d0000]|0.0,-,[4d0000]|0.0,-,[4d0000]|0.0,-,[4d0000]|0.0,0,[4d0000]|1.0,1,small ,[5d1500]|0.0,0,[4d0000]|0.0,0,[4d0000]|0.0,0,[4d0000]|0.0,-,[4d0000]|0.0,-,[4d0000]|0.0,0,[4d0000]|0.0,0,[4d0000]|0.0,0,[4d0000]|0.0,0,[4d0000]|0.0,0,[4d0000]|0.0,0,[4d0000]|0.0,0,[4d0000]|0.0,-,[4d0000]|0.0,-,[4d0000]|2.0,2,small tiny ,[6d2a00]|1.0,1,hydrophobic ,[5d1500]|1.0,1,hydrophobic ,[5d1500]|1.0,1,hydrophobic ,[5d1500]|0.0,0,[4d0000]|0.0,0,[4d0000]|1.0,1,small ,[5d1500]|0.0,-,[4d0000]|2.0,2,small tiny ,[6d2a00]|0.0,-,[4d0000]|0.0,-,[4d0000]|0.0,-,[4d0000]|0.0,-,[4d0000]|0.0,-,[4d0000]|0.0,0,[4d0000]|0.0,0,[4d0000]|0.0,0,[4d0000]|1.0,1,small ,[5d1500]|0.0,0,[4d0000]|11.0,*,small hydrophobic tiny !polar !aromatic !negative !charged !positive !aliphatic !proline,[ffe600]|7.0,7,small !aromatic !negative !charged !positive !aliphatic !proline,[be9200]|11.0,*,hydrophobic aromatic polar !tiny !negative !charged !small !positive !aliphatic !proline,[ffe600]|6.0,6,polar !tiny !aromatic !negative !aliphatic !proline,[ae7d00]|11.0,*,aliphatic small hydrophobic !tiny !polar !aromatic !negative !charged !positive !proline,[ffe600]|6.0,6,polar !tiny !aromatic !negative !aliphatic !proline,[ae7d00]|8.0,8,hydrophobic !tiny !polar !negative !charged !small !positive !proline,[cea700]|9.0,9,aliphatic hydrophobic !tiny !polar !aromatic !negative !charged !positive !proline,[dfbc00]|11.0,*,small polar !tiny !aromatic !hydrophobic !negative !charged !positive !aliphatic !proline,[ffe600]|11.0,*,proline small !tiny !polar !aromatic !hydrophobic !negative !charged !positive !aliphatic,[ffe600]|7.0,7,polar !tiny !aromatic !hydrophobic !positive !aliphatic !proline,[be9200]|11.0,*,small hydrophobic tiny !polar !aromatic !negative !charged !positive !aliphatic !proline,[ffe600]|3.0,3, !tiny !aromatic !aliphatic,[7d3f00]|6.0,6, !tiny !aromatic !negative !charged !positive !proline,[ae7d00]|11.0,*,charged negative polar !tiny !aromatic !hydrophobic !small !positive !aliphatic !proline,[ffe600]|7.0,7,hydrophobic !tiny !polar !negative !charged !positive !proline,[be9200]|7.0,7,polar !tiny !aromatic !hydrophobic !positive !aliphatic !proline,[be9200]|9.0,9,small hydrophobic !tiny !polar !aromatic !negative !charged !positive !proline,[dfbc00]|5.0,5, !tiny !aromatic !hydrophobic !positive !aliphatic,[9e6800]|6.0,6,polar !aromatic !hydrophobic !positive !aliphatic !proline,[ae7d00]|8.0,8,small polar !tiny !aromatic !hydrophobic !positive !aliphatic !proline,[cea700]|11.0,*,aliphatic small hydrophobic !tiny !polar !aromatic !negative !charged !positive !proline,[ffe600]|11.0,*,hydrophobic aromatic polar !tiny !negative !charged !small !positive !aliphatic !proline,[ffe600]|9.0,9,aliphatic hydrophobic !tiny !polar !aromatic !negative !charged !positive !proline,[dfbc00]|11.0,*,aliphatic hydrophobic !tiny !polar !aromatic !negative !charged !small !positive !proline,[ffe600]|11.0,*,small charged negative polar !tiny !aromatic !hydrophobic !positive !aliphatic !proline,[ffe600]|3.0,3, !negative !aliphatic !proline,[7d3f00]|11.0,*,small hydrophobic tiny !polar !aromatic !negative !charged !positive !aliphatic !proline,[ffe600]|11.0,*,charged negative polar !tiny !aromatic !hydrophobic !small !positive !aliphatic !proline,[ffe600]|11.0,*,charged negative polar !tiny !aromatic !hydrophobic !small !positive !aliphatic !proline,[ffe600]|3.0,3, !aromatic !positive !proline,[7d3f00]|11.0,*,small hydrophobic tiny !polar !aromatic !negative !charged !positive !aliphatic !proline,[ffe600]|5.0,5,hydrophobic !tiny !negative !small !proline,[9e6800]|9.0,9,charged negative polar !tiny !aromatic !hydrophobic !positive !aliphatic !proline,[dfbc00]|11.0,*,aliphatic hydrophobic !tiny !polar !aromatic !negative !charged !small !positive !proline,[ffe600]|11.0,*,proline small !tiny !polar !aromatic !hydrophobic !negative !charged !positive !aliphatic,[ffe600]|9.0,9,hydrophobic aromatic !tiny !negative !charged !small !positive !aliphatic !proline,[dfbc00]|11.0,*,small polar tiny !aromatic !hydrophobic !negative !charged !positive !aliphatic !proline,[ffe600]|11.0,*,small hydrophobic !tiny !polar !aromatic !negative !charged !positive !aliphatic !proline,[ffe600]|11.0,*,positive charged polar !tiny !aromatic !hydrophobic !negative !small !aliphatic !proline,[ffe600]|11.0,*,small hydrophobic tiny !polar !aromatic !negative !charged !positive !aliphatic !proline,[ffe600]|11.0,*,small hydrophobic tiny !polar !aromatic !negative !charged !positive !aliphatic !proline,[ffe600]|11.0,*,small polar tiny !aromatic !hydrophobic !negative !charged !positive !aliphatic !proline,[ffe600]|11.0,*,small hydrophobic !tiny !polar !aromatic !negative !charged !positive !aliphatic !proline,[ffe600]|11.0,*,small polar tiny !aromatic !hydrophobic !negative !charged !positive !aliphatic !proline,[ffe600]|11.0,*,small polar tiny !aromatic !hydrophobic !negative !charged !positive !aliphatic !proline,[ffe600]|11.0,*,small hydrophobic !tiny !polar !aromatic !negative !charged !positive !aliphatic !proline,[ffe600]|11.0,*,small hydrophobic tiny !polar !aromatic !negative !charged !positive !aliphatic !proline,[ffe600]|11.0,*,small hydrophobic tiny !polar !aromatic !negative !charged !positive !aliphatic !proline,[ffe600]|11.0,*,positive charged hydrophobic polar !tiny !aromatic !negative !small !aliphatic !proline,[ffe600]|9.0,9,aliphatic hydrophobic !tiny !polar !aromatic !negative !charged !positive !proline,[dfbc00]|3.0,3, !aromatic !negative !proline,[7d3f00]|7.0,7,small !aromatic !negative !charged !positive !aliphatic !proline,[be9200]|11.0,*,small hydrophobic tiny !polar !aromatic !negative !charged !positive !aliphatic !proline,[ffe600]|3.0,3, !positive !aliphatic !proline,[7d3f00]|9.0,9,aliphatic hydrophobic !tiny !polar !aromatic !negative !charged !positive !proline,[dfbc00]|8.0,8,small polar !tiny !aromatic !hydrophobic !positive !aliphatic !proline,[cea700]|11.0,*,polar !tiny !aromatic !hydrophobic !negative !charged !small !positive !aliphatic !proline,[ffe600]|6.0,6,polar !aromatic !hydrophobic !positive !aliphatic !proline,[ae7d00]|11.0,*,small charged negative polar !tiny !aromatic !hydrophobic !positive !aliphatic !proline,[ffe600]|4.0,4, !aromatic !positive !aliphatic !proline,[8d5300]|5.0,5,polar !aromatic !negative !aliphatic !proline,[9e6800]|9.0,9,hydrophobic aromatic !tiny !negative !charged !small !positive !aliphatic !proline,[dfbc00]|11.0,*,aliphatic hydrophobic !tiny !polar !aromatic !negative !charged !small !positive !proline,[ffe600]|8.0,8,small polar !tiny !aromatic !hydrophobic !positive !aliphatic !proline,[cea700]|9.0,9,charged negative polar !tiny !aromatic !hydrophobic !positive !aliphatic !proline,[dfbc00]|0.0,0,[4d0000]|1.0,1,polar ,[5d1500]|0.0,0,[4d0000]|0.0,0,[4d0000]|0.0,0,[4d0000]|3.0,3,small hydrophobic tiny ,[7d3f00]|2.0,2,hydrophobic aromatic ,[6d2a00]|3.0,3,aliphatic small hydrophobic ,[7d3f00]|2.0,2,aliphatic hydrophobic ,[6d2a00]|2.0,2,small polar ,[6d2a00]|2.0,2,small hydrophobic ,[6d2a00]|1.0,1,hydrophobic ,[5d1500]|3.0,3,small hydrophobic tiny ,[7d3f00]|2.0,2,hydrophobic aromatic ,[6d2a00]|2.0,2,proline small ,[6d2a00]|0.0,0,[4d0000]|1.0,1,small ,[5d1500]|4.0,4,small charged negative polar ,[8d5300]|3.0,3,aliphatic small hydrophobic ,[7d3f00]|1.0,1,small ,[5d1500]|2.0,2,aliphatic hydrophobic ,[6d2a00]|3.0,3,charged negative polar ,[7d3f00]|2.0,2,small polar ,[6d2a00]|5.0,5,positive charged hydrophobic aromatic polar ,[9e6800]|3.0,3,positive charged polar ,[7d3f00]|3.0,3,charged negative polar ,[7d3f00]|0.0,0,[4d0000]|0.0,0,[4d0000]|1.0,1,hydrophobic ,[5d1500]|0.0,0,[4d0000]|0.0,-,[4d0000]|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%|6.6666665,L,L 6%|6.6666665,G,G 6%|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%|6.6666665,F,F 6%|6.6666665,P,P 6%|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%|6.6666665,V,V 6%|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%|6.6666665,A,A 6%| + +SEQUENCE_GROUP JGroup:666531415 14 37 -1 FER_CAPAN FER1_SOLLC Q93XJ9_SOLTU FER1_PEA Q7XA98_TRIPR +PROPERTIES JGroup:666531415 colour=Zappo outlineColour=000000 displayBoxes=true displayText=true colourText=false showUnconserved=false + diff --git a/examples/uniref50_test_features b/examples/uniref50_test_features new file mode 100644 index 0000000..60f995f --- /dev/null +++ b/examples/uniref50_test_features @@ -0,0 +1,5 @@ +FER1_SOLLC Jalview test_feature 34 47 0.0 . . +Q93XJ9_SOLTU Jalview test_feature 34 47 0.0 . . +FER1_PEA Jalview test_feature 37 52 0.0 . . +Q7XA98_TRIPR Jalview test_feature 39 55 0.0 . . +FER1_MESCR Jalview test_feature 37 51 0.0 . . diff --git a/examples/uniref50_test_tree b/examples/uniref50_test_tree new file mode 100644 index 0000000..585b68b --- /dev/null +++ b/examples/uniref50_test_tree @@ -0,0 +1 @@ +(((FER_BRANA:112.15387,FER3_RAPSA:110.84613):46.4375,FER_CAPAA:144.0625):177.2998,(O80429_MAIZE:184.40039,(FER1_MAIZE:195.79102,(((FER1_SPIOL:111.687515,FER1_MESCR:84.312485):51.929688,((Q93Z60_ARATH:398.14285,(FER2_ARATH:53.65625,FER1_ARATH:48.34375):0.0):86.725006,(Q7XA98_TRIPR:78.65277,FER1_PEA:68.34723):63.774994):7.7578125):0.58332825,((Q93XJ9_SOLTU:23.647736,FER1_SOLLC:20.352264):31.71875,FER_CAPAN:52.28125):101.7448):41.498047):37.208984):177.2998); diff --git a/src/jalview/bin/Jalview.java b/src/jalview/bin/Jalview.java index f6d0099..8ad4cbd 100755 --- a/src/jalview/bin/Jalview.java +++ b/src/jalview/bin/Jalview.java @@ -109,7 +109,14 @@ public class Jalview System.setProperty("java.awt.headless", "true"); headless = true; } - Cache.loadProperties(aparser.getValue("props")); // must do this before + String usrPropsFile = aparser.getValue("props"); + Cache.loadProperties(usrPropsFile); // must do this before + if (usrPropsFile != null) + { + System.out.println("CMD [-props " + usrPropsFile + + "] executed successfully!"); + } + // anything else! final String jabawsUrl = aparser.getValue("jabaws"); @@ -118,6 +125,8 @@ public class Jalview try { Jws2Discoverer.getDiscoverer().setPreferredUrl(jabawsUrl); + System.out.println("CMD [-jabaws " + jabawsUrl + + "] executed successfully!"); } catch (MalformedURLException e) { System.err.println("Invalid jabaws parameter: " + jabawsUrl @@ -195,6 +204,11 @@ public class Jalview { startUsageStats(desktop); } + else + { + System.err.println("CMD [-nousagestats] executed successfully!"); + } + if (!aparser.contains("noquestionnaire")) { String url = aparser.getValue("questionnaire"); @@ -204,6 +218,8 @@ public class Jalview // questionnaire Cache.log.debug("Starting questionnaire url at " + url); desktop.checkForQuestionnaire(url); + System.out.println("CMD questionnaire[-" + url + + "] executed successfully!"); } else { @@ -222,6 +238,11 @@ public class Jalview } } } + else + { + System.err +.println("CMD [-noquestionnaire] executed successfully!"); + } desktop.checkForNews(); } @@ -340,7 +361,7 @@ public class Jalview desktop.setProgressBar(MessageManager.getString("status.processing_commandline_args"), progress = System.currentTimeMillis()); } - System.out.println("Opening file: " + file); + System.out.println("CMD [-open " + file + "] executed successfully!"); if (!file.startsWith("http://")) { @@ -382,8 +403,11 @@ public class Jalview ucs.parseAppletParameter(data); cs = ucs; } - - System.out.println("colour is " + data); + else + { + System.out.println("CMD [-color " + data + + "] executed successfully!"); + } af.changeColour(cs); } @@ -393,34 +417,55 @@ public class Jalview { af.parseFeaturesFile(data, jalview.io.AppletFormatAdapter.checkProtocol(data)); - System.out.println("Added " + data); + // System.out.println("Added " + data); + System.out.println("CMD groups[-" + data + + "] executed successfully!"); } data = aparser.getValue("features", true); if (data != null) { af.parseFeaturesFile(data, jalview.io.AppletFormatAdapter.checkProtocol(data)); - System.out.println("Added " + data); + // System.out.println("Added " + data); + System.out.println("CMD [-features " + data + + "] executed successfully!"); } data = aparser.getValue("annotations", true); if (data != null) { af.loadJalviewDataFile(data, null, null, null); - System.out.println("Added " + data); + // System.out.println("Added " + data); + System.out.println("CMD [-annotations " + data + + "] executed successfully!"); } // set or clear the sortbytree flag. if (aparser.contains("sortbytree")) { af.getViewport().setSortByTree(true); + if (af.getViewport().getSortByTree()) + { + System.out +.println("CMD [-sortbytree] executed successfully!"); + } } if (aparser.contains("no-annotation")) { af.getViewport().setShowAnnotation(false); + if (!af.getViewport().isShowAnnotation()) + { + System.out +.println("CMD no-annotation executed successfully!"); + } } if (aparser.contains("nosortbytree")) { af.getViewport().setSortByTree(false); + if (!af.getViewport().getSortByTree()) + { + System.out + .println("CMD [-nosortbytree] executed successfully!"); + } } data = aparser.getValue("tree", true); if (data != null) @@ -428,13 +473,14 @@ public class Jalview jalview.io.NewickFile fin = null; try { + System.out.println("CMD [-tree " + data + + "] executed successfully!"); fin = new jalview.io.NewickFile(data, jalview.io.AppletFormatAdapter.checkProtocol(data)); if (fin != null) { af.getViewport().setCurrentTree( af.ShowNewickTree(fin, data).getTree()); - System.out.println("Added tree " + data); } } catch (IOException ex) { @@ -475,6 +521,9 @@ public class Jalview System.out.println("Executing script " + groovyscript); executeGroovyScript(groovyscript, new Object[] { desktop, af }); + + System.out.println("CMD groovy[" + groovyscript + + "] executed successfully!"); } else { @@ -930,6 +979,8 @@ public class Jalview } source.addElement(nickname); } + System.out.println("CMD [-dasserver " + data + + "] executed successfully!"); } // loop until no more server entries are found. if (locsources != null && locsources.indexOf('|') > -1) { diff --git a/test/jalview/bin/CommandLineOperations.java b/test/jalview/bin/CommandLineOperations.java index 3582dc5..70f6079 100644 --- a/test/jalview/bin/CommandLineOperations.java +++ b/test/jalview/bin/CommandLineOperations.java @@ -24,11 +24,10 @@ import java.io.BufferedReader; import java.io.File; import java.io.IOException; import java.io.InputStreamReader; +import java.util.ArrayList; import org.testng.Assert; import org.testng.FileAssert; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeTest; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -36,15 +35,7 @@ import org.testng.annotations.Test; public class CommandLineOperations { - @BeforeClass - public static void setUpBeforeClass() throws Exception - { - } - - @AfterClass - public static void tearDownAfterClass() throws Exception - { - } + private ArrayList successfulCMDs = new ArrayList(); /*** * from @@ -57,7 +48,8 @@ public class CommandLineOperations private static class Worker extends Thread { private final Process process; - + private BufferedReader outputReader; + private BufferedReader errorReader; private Integer exit; private Worker(Process process) @@ -75,36 +67,63 @@ public class CommandLineOperations return; } } + + public BufferedReader getOutputReader() + { + return outputReader; + } + + public void setOutputReader(BufferedReader outputReader) + { + this.outputReader = outputReader; + } + + public BufferedReader getErrorReader() + { + return errorReader; + } + + public void setErrorReader(BufferedReader errorReader) + { + this.errorReader = errorReader; + } } private Worker jalviewDesktopRunner(boolean withAwt, String cmd, - int timeout) throws InterruptedException, IOException + int timeout) { String _cmd = "java " + (withAwt ? "-Djava.awt.headless=true" : "") + " -Djava.ext.dirs=./lib -classpath ./classes jalview.bin.Jalview "; - System.out.println("############ Testing Jalview CMD: " + _cmd + cmd); - Process ls2_proc = Runtime.getRuntime().exec(_cmd + cmd); - BufferedReader outputReader = new BufferedReader(new InputStreamReader( - ls2_proc.getInputStream())); - - BufferedReader errorReader = new BufferedReader(new InputStreamReader( - ls2_proc.getErrorStream())); - Worker worker = new Worker(ls2_proc); - worker.start(); - worker.join(timeout); - // System.out.println("Output: "); - // String ln = null; - // while ((ln = outputReader.readLine()) != null) - // { - // System.out.println(ln); - // } - // - // System.out.println("Error: "); - // while ((ln = errorReader.readLine()) != null) - // { - // System.out.println(ln); - // } + System.out.println("CMD [" + cmd + "]"); + Process ls2_proc = null; + Worker worker = null; + try + { + ls2_proc = Runtime.getRuntime().exec(_cmd + cmd); + } catch (IOException e1) + { + e1.printStackTrace(); + } + if (ls2_proc != null) + { + BufferedReader outputReader = new BufferedReader( + new InputStreamReader(ls2_proc.getInputStream())); + + BufferedReader errorReader = new BufferedReader( + new InputStreamReader(ls2_proc.getErrorStream())); + worker = new Worker(ls2_proc); + worker.start(); + try + { + worker.join(timeout); + } catch (InterruptedException e) + { + // e.printStackTrace(); + } + worker.setOutputReader(outputReader); + worker.setErrorReader(errorReader); + } return worker; } @@ -114,25 +133,65 @@ public class CommandLineOperations new CommandLineOperations(); } - @Test(groups = - { "Functional" }, dataProvider = "headlessModeOutputParams") - public void testHeadlessModeOutputs(String harg, String type, - String fileName, boolean withAWT, int expectedMinFileSize) + + @BeforeTest + public void setUpForHeadlessCommandLineInputOperations() + throws IOException { - String cmd = harg + type + " " + fileName; - // System.out.println(">>>>>>>>>>>>>>>> Command : " + cmd); - File file = new File(fileName); - Worker worker = null; - try + String cmds = "nodisplay -open examples/uniref50.fa -sortbytree -props FILE -colour zappo " + + "-jabaws http://www.compbio.dundee.ac.uk/jabaws -nosortbytree -dasserver nickname=www.test.com " + + "-features uniref50_test_features -annotations uniref50_test_annot -tree uniref50_test_tree"; + Worker worker = jalviewDesktopRunner(true, cmds, 9000); + String ln = null; + while ((ln = worker.getOutputReader().readLine()) != null) { - worker = jalviewDesktopRunner(withAWT, cmd, 9000); - } catch (InterruptedException e) + System.out.println(ln); + successfulCMDs.add(ln); + } + } + + @BeforeTest + public void setUpForCommandLineInputOperations() throws IOException + { + String cmds = "-open examples/uniref50.fa -noquestionnaire -nousagestats"; + Worker worker = jalviewDesktopRunner(false, cmds, 9000); + String ln = null; + int count = 0; + while ((ln = worker.getErrorReader().readLine()) != null) { - e.printStackTrace(); - } catch (IOException e) + System.out.println(ln); + successfulCMDs.add(ln); + if (++count > 5) + { + break; + } + } + if (worker != null && worker.exit == null) { - e.printStackTrace(); + worker.interrupt(); + Thread.currentThread().interrupt(); + worker.process.destroy(); } + } + + @Test(groups = + { "Functional" }, dataProvider = "allInputOpearationsData") + public void testAllInputOperations(String expectedString, + String failureMsg) + { + Assert.assertTrue(successfulCMDs.contains(expectedString), failureMsg); + } + + @Test(groups = + { "Functional" }, dataProvider = "headlessModeOutputOperationsData") + public void testHeadlessModeOutputOperations(String harg, String type, + String fileName, boolean withAWT, int expectedMinFileSize, + int timeout) + { + String cmd = harg + type + " " + fileName; + // System.out.println(">>>>>>>>>>>>>>>> Command : " + cmd); + File file = new File(fileName); + Worker worker = jalviewDesktopRunner(withAWT, cmd, timeout); FileAssert.assertFile(file, "Didn't create an output" + type + " file.[" + harg + "]"); @@ -142,7 +201,7 @@ public class CommandLineOperations worker.interrupt(); Thread.currentThread().interrupt(); worker.process.destroy(); - Assert.fail("Jalview did not exit after " + Assert.fail("Jalview did not exit after " + type + " generation (try running test again to verify - timeout at 9000ms). [" + harg + "]"); @@ -150,69 +209,80 @@ public class CommandLineOperations new File(fileName).delete(); } - @DataProvider(name = "headlessModeOutputParams") - public static Object[][] headlessModeOutput() + + @DataProvider(name = "allInputOpearationsData") + public Object[][] getHeadlessModeInputParams() + { + return new Object[][] + { + // headless mode input operations + { "CMD [-color zappo] executed successfully!", + "Failed command : -color zappo" }, + { "CMD [-props FILE] executed successfully!", + "Failed command : -props File" }, + { "CMD [-sortbytree] executed successfully!", + "Failed command : -sortbytree" }, + { + "CMD [-jabaws http://www.compbio.dundee.ac.uk/jabaws] executed successfully!", + "Failed command : -jabaws http://www.compbio.dundee.ac.uk/jabaws" }, + { "CMD [-open examples/uniref50.fa] executed successfully!", + "Failed command : -open examples/uniref50.fa" }, + { "CMD [-nosortbytree] executed successfully!", + "Failed command : -nosortbytree" }, + { "CMD [-dasserver nickname=www.test.com] executed successfully!", + "Failed command : -dasserver nickname=www.test.com" }, + { "CMD [-features uniref50_test_features] executed successfully!", + "Failed command : -features uniref50_test_features" }, + { "CMD [-annotations uniref50_test_annot] executed successfully!", + "Failed command : -annotations uniref50_test_annot" }, + { "CMD [-tree uniref50_test_tree] executed successfully!", + "Failed command : -tree uniref50_test_tree" }, + // non headless mode input operations + { "CMD [-nousagestats] executed successfully!", + "Failed command : -nousagestats" }, + { "CMD [-noquestionnaire] executed successfully!", + "Failed command : -noquestionnaire nickname=www.test.com" } + }; + + } + + @DataProvider(name = "headlessModeOutputOperationsData") + public static Object[][] getHeadlessModeOutputParams() { return new Object[][] { { "nodisplay -open examples/uniref50.fa", " -eps", - "test_uniref50_out.eps", true, 4096 }, + "test_uniref50_out.eps", true, 4096, 3000 }, { "nodisplay -open examples/uniref50.fa", " -eps", - "test_uniref50_out.eps", false, 4096 }, - { "headless -open examples/uniref50.fa", " -eps", - "test_uniref50_out.eps", true, 4096 }, - { "headless -open examples/uniref50.fa", " -eps", - "test_uniref50_out.eps", false, 4096 }, + "test_uniref50_out.eps", false, 4096, 3000 }, { "nogui -open examples/uniref50.fa", " -eps", - "test_uniref50_out.eps", true, 4096 }, + "test_uniref50_out.eps", true, 4096, 3000 }, { "nogui -open examples/uniref50.fa", " -eps", - "test_uniref50_out.eps", false, 4096 }, - { "headless -open examples/uniref50.fa", " -svg", - "test_uniref50_out.svg", true, 4096 }, + "test_uniref50_out.eps", false, 4096, 3000 }, + { "headless -open examples/uniref50.fa", " -eps", + "test_uniref50_out.eps", true, 4096, 3000 }, { "headless -open examples/uniref50.fa", " -svg", - "test_uniref50_out.svg", false, 4096 }, + "test_uniref50_out.svg", false, 4096, 3000 }, { "headless -open examples/uniref50.fa", " -png", - "test_uniref50_out.png", true, 4096 }, - { "headless -open examples/uniref50.fa", " -png", - "test_uniref50_out.png", false, 4096 }, - { "headless -open examples/uniref50.fa", " -html", - "test_uniref50_out.html", true, 4096 }, + "test_uniref50_out.png", true, 4096, 3000 }, { "headless -open examples/uniref50.fa", " -html", - "test_uniref50_out.html", false, 4096 }, + "test_uniref50_out.html", true, 4096, 3000 }, { "headless -open examples/uniref50.fa", " -fasta", - "test_uniref50_out.mfa", true, 2096 }, - { "headless -open examples/uniref50.fa", " -fasta", - "test_uniref50_out.mfa", false, 2096 }, - { "headless -open examples/uniref50.fa", " -clustal", - "test_uniref50_out.aln", true, 2096 }, + "test_uniref50_out.mfa", true, 2096, 3000 }, { "headless -open examples/uniref50.fa", " -clustal", - "test_uniref50_out.aln", false, 2096 }, - { "headless -open examples/uniref50.fa", " -msf", - "test_uniref50_out.msf", true, 2096 }, + "test_uniref50_out.aln", true, 2096, 3000 }, { "headless -open examples/uniref50.fa", " -msf", - "test_uniref50_out.msf", false, 2096 }, + "test_uniref50_out.msf", true, 2096, 3000 }, { "headless -open examples/uniref50.fa", " -pileup", - "test_uniref50_out.aln", true, 2096 }, - { "headless -open examples/uniref50.fa", " -pileup", - "test_uniref50_out.aln", false, 2096 }, - { "headless -open examples/uniref50.fa", " -pir", - "test_uniref50_out.pir", true, 2096 }, + "test_uniref50_out.aln", true, 2096, 3000 }, { "headless -open examples/uniref50.fa", " -pir", - "test_uniref50_out.pir", false, 2096 }, + "test_uniref50_out.pir", true, 2096, 3000 }, { "headless -open examples/uniref50.fa", " -pfam", - "test_uniref50_out.pfam", true, 2096 }, - { "headless -open examples/uniref50.fa", " -pfam", - "test_uniref50_out.pfam", false, 2096 }, - { "headless -open examples/uniref50.fa", " -blc", - "test_uniref50_out.blc", true, 2096 }, + "test_uniref50_out.pfam", true, 2096, 3000 }, { "headless -open examples/uniref50.fa", " -blc", - "test_uniref50_out.blc", false, 2096 }, - { "headless -open examples/uniref50.fa", " -jalview", - "test_uniref50_out.jvp", true, 2096 }, + "test_uniref50_out.blc", true, 2096, 3000 }, { "headless -open examples/uniref50.fa", " -jalview", - "test_uniref50_out.jvp", false, 2096 }, + "test_uniref50_out.jvp", true, 2096, 3000 }, }; } - - } -- 1.7.10.2