1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
package jalview.io; |
22 |
|
|
23 |
|
import static org.testng.Assert.assertEquals; |
24 |
|
import static org.testng.Assert.assertTrue; |
25 |
|
|
26 |
|
import jalview.datamodel.SequenceI; |
27 |
|
|
28 |
|
import java.io.IOException; |
29 |
|
|
30 |
|
import org.testng.annotations.Test; |
31 |
|
|
|
|
| 0% |
Uncovered Elements: 20 (20) |
Complexity: 2 |
Complexity Density: 0.11 |
|
32 |
|
public class ClustalFileTest |
33 |
|
{ |
|
|
| 0% |
Uncovered Elements: 9 (9) |
Complexity: 1 |
Complexity Density: 0.11 |
4-
|
|
34 |
0 |
@Test(groups = "Functional")... |
35 |
|
public void testParse_withNumbering() throws IOException |
36 |
|
{ |
37 |
|
|
38 |
0 |
String data = "CLUSTAL\n\n" |
39 |
|
+ "FER_CAPAA/1-8 -----------------------------------------------------------A\t1\n" |
40 |
|
+ "FER_CAPAN/1-55 MA------SVSATMISTSFMPRKPAVTSL-KPIPNVGE--ALFGLKS-A--NGGKVTCMA 48\n" |
41 |
|
+ "FER1_SOLLC/1-55 MA------SISGTMISTSFLPRKPAVTSL-KAISNVGE--ALFGLKS-G--RNGRITCMA 48\n" |
42 |
|
+ "Q93XJ9_SOLTU/1-55 MA------SISGTMISTSFLPRKPVVTSL-KAISNVGE--ALFGLKS-G--RNGRITCMA 48\n" |
43 |
|
+ "FER1_PEA/1-60 MATT---PALYGTAVSTSFLRTQPMPMSV-TTTKAFSN--GFLGLKT-SLKRGDLAVAMA 53\n\n" |
44 |
|
+ "FER_CAPAA/1-8 SYKVKLI 8\n" |
45 |
|
+ "FER_CAPAN/1-55 SYKVKLI 55\n" |
46 |
|
+ "FER1_SOLLC/1-55 SYKVKLI 55\n" |
47 |
|
+ "Q93XJ9_SOLTU/1-55 SYKVKLI 55\n" |
48 |
|
+ "FER1_PEA/1-60 SYKVKLV 60\n" |
49 |
|
+ " .* .:....*******..** ..........** ********...*:::* ...\n" |
50 |
|
+ "\t\t.:.::. *\n"; |
51 |
|
|
52 |
0 |
ClustalFile cf = new ClustalFile(data, DataSourceType.PASTE); |
53 |
0 |
cf.parse(); |
54 |
0 |
SequenceI[] seqs = cf.getSeqsAsArray(); |
55 |
0 |
assertEquals(seqs.length, 5); |
56 |
0 |
assertEquals(seqs[0].getName(), "FER_CAPAA"); |
57 |
0 |
assertEquals(seqs[0].getStart(), 1); |
58 |
0 |
assertEquals(seqs[0].getEnd(), 8); |
59 |
0 |
assertTrue(seqs[0].getSequenceAsString().endsWith("ASYKVKLI")); |
60 |
|
} |
61 |
|
|
|
|
| 0% |
Uncovered Elements: 9 (9) |
Complexity: 1 |
Complexity Density: 0.11 |
4-
|
|
62 |
0 |
@Test(groups = "Functional")... |
63 |
|
public void testParse_noNumbering() throws IOException |
64 |
|
{ |
65 |
|
|
66 |
0 |
String data = "CLUSTAL\n\n" |
67 |
|
+ "FER_CAPAA/1-8 -----------------------------------------------------------A\n" |
68 |
|
+ "FER_CAPAN/1-55 MA------SVSATMISTSFMPRKPAVTSL-KPIPNVGE--ALFGLKS-A--NGGKVTCMA\n" |
69 |
|
+ "FER1_SOLLC/1-55 MA------SISGTMISTSFLPRKPAVTSL-KAISNVGE--ALFGLKS-G--RNGRITCMA\n" |
70 |
|
+ "Q93XJ9_SOLTU/1-55 MA------SISGTMISTSFLPRKPVVTSL-KAISNVGE--ALFGLKS-G--RNGRITCMA\n" |
71 |
|
+ "FER1_PEA/1-60 MATT---PALYGTAVSTSFLRTQPMPMSV-TTTKAFSN--GFLGLKT-SLKRGDLAVAMA\n\n" |
72 |
|
+ "FER_CAPAA/1-8 SYKVKLI\n" |
73 |
|
+ "FER_CAPAN/1-55 SYKVKLI\n" |
74 |
|
+ "FER1_SOLLC/1-55 SYKVKLI\n" |
75 |
|
+ "Q93XJ9_SOLTU/1-55 SYKVKLI\n" |
76 |
|
+ "FER1_PEA/1-60 SYKVKLV\n"; |
77 |
|
|
78 |
0 |
ClustalFile cf = new ClustalFile(data, DataSourceType.PASTE); |
79 |
0 |
cf.parse(); |
80 |
0 |
SequenceI[] seqs = cf.getSeqsAsArray(); |
81 |
0 |
assertEquals(seqs.length, 5); |
82 |
0 |
assertEquals(seqs[0].getName(), "FER_CAPAA"); |
83 |
0 |
assertEquals(seqs[0].getStart(), 1); |
84 |
0 |
assertEquals(seqs[0].getEnd(), 8); |
85 |
0 |
assertTrue(seqs[0].getSequenceAsString().endsWith("ASYKVKLI")); |
86 |
|
} |
87 |
|
} |