JAL-2103 - refactored msa transformation routines and added (failing) test for new...
[jalview.git] / test / jalview / ws / jws1 / JPredWSUtilsTest.java
1 package jalview.ws.jws1;
2
3 import jalview.datamodel.Alignment;
4 import jalview.datamodel.AlignmentI;
5 import jalview.datamodel.Sequence;
6 import jalview.datamodel.SequenceI;
7
8 import org.testng.Assert;
9 import org.testng.annotations.Test;
10
11 public class JPredWSUtilsTest
12 {
13   @Test(groups = { "Functional" })
14   public void testSingleSeqPrediction()
15   {
16
17   }
18
19   @Test(groups = { "Functional" })
20   public void testSingleSeqPredictionHiddenRegion()
21   {
22
23   }
24
25   @Test(groups = { "Functional" })
26   public void testMsaPrediction()
27   {
28
29   }
30
31   @Test(groups = { "Functional" })
32   public void testMsaPredictionHiddenRegion()
33   {
34
35   }
36
37   @Test(groups = { "Functional" })
38   public void testInsertHiddenResidues()
39   {
40     // orig: asdfPPPPPPPasdfPPPPasdf
41     // pred: PPPPPPPPPPP
42     // al: -----P-P-P---P---P----P---P-P--PP---P---
43     // s1: SSSSSSS-SS---S---SSSSSS---S-S--SSSSSSSSS
44     // s2: SSSSSSS-SSSSSSSSSSS----SSS-S-SSS-----SSS
45     SequenceI orig = new Sequence("orig", "asdfPPPPPPPasdfPPPPasdf"), pred = new Sequence(
46             "pred", "PPPPPPPPPPP"), al = new Sequence("al/5-23",
47             "-----P-P-P---P---P----P---P-P--PP---P---"), s1 = new Sequence(
48             "s1", "SSSSSSS-SS---S---SSSSSS---S-S--SSSSSSSSS"), s2 = new Sequence(
49             "s2", "SSSSSSS-SSSSSSSSSSS----SSS-S-SSS-----SSS");
50
51     AlignmentI alpred = new Alignment(new SequenceI[] { al, s1, s2 });
52     JPredWSUtils.insertHiddenResidues(alpred, '.', new int[] { 5, 6, 7, 8,
53         9, 10, 11, 16, 17, 18, 19 }, orig);
54     Assert.assertEquals(alpred.getSequenceAt(2).getSequenceAsString(),
55             "....SSSSSSS-SS---S---SSSSSS---S....-S--SSSSSSSSS....");
56     Assert.assertEquals(alpred.getSequenceAt(1).getSequenceAsString(),
57             "....SSSSSSS-SSSSSSSSSSS----SSS-....S-SSS-----SSS....");
58     Assert.assertEquals(alpred.getSequenceAt(0).getSequenceAsString(),
59             "asdf-----P-P-P---P---P----P---Pasdf-P--PP---P---asdf");
60
61     // result:
62     //
63     // al: asdf-----P-P-P---P---P----P---Pasdf-P--PP---P---asdf
64     // s1: ....SSSSSSS-SS---S---SSSSSS---S....-S--SSSSSSSSS....
65     // s2: ....SSSSSSS-SSSSSSSSSSS----SSS-....S-SSS-----SSS....
66   }
67 }