11package org .biojava .nbio .structure .align .quaternary ;
22
3+ import static org .junit .Assert .*;
4+
35import java .io .IOException ;
46
7+ import org .biojava .nbio .structure .Structure ;
58import org .biojava .nbio .structure .StructureException ;
9+ import org .biojava .nbio .structure .StructureIO ;
10+ import org .biojava .nbio .structure .cluster .SubunitClustererParameters ;
611import org .junit .Test ;
712
813/**
1621public class TestQsAlign {
1722
1823 /**
19- * Identity: test hemoglobin against itself.
24+ * Identity: test hemoglobin (4HHB) against itself.
2025 */
2126 @ Test
2227 public void testIdentity () throws StructureException , IOException {
2328
29+ Structure s1 = StructureIO .getStructure ("4hhb" );
30+ Structure s2 = s1 ;
31+
32+ SubunitClustererParameters clusterParams = new SubunitClustererParameters ();
33+ QsAlignParameters alignParams = new QsAlignParameters ();
34+
35+ QsAlignResult result = QsAlign
36+ .align (s1 , s2 , clusterParams , alignParams );
37+
38+ assertEquals (result .length (), 4 );
39+ assertEquals (result .getRelation (), QsRelation .EQUIVALENT );
40+ assertEquals (result .getAlignedSubunits1 (), result .getAlignedSubunits2 ());
41+ assertEquals (result .getRmsd (), 0.0 , 0.01 );
42+
43+ }
44+
45+ /**
46+ * Different: test two completely different proteins (4HHB, 3IFV).
47+ */
48+ @ Test
49+ public void testDifferent () throws StructureException , IOException {
50+
51+ Structure s1 = StructureIO .getStructure ("4hhb" );
52+ Structure s2 = StructureIO .getStructure ("3ifv" );
53+
54+ SubunitClustererParameters clusterParams = new SubunitClustererParameters ();
55+ QsAlignParameters alignParams = new QsAlignParameters ();
56+
57+ QsAlignResult result = QsAlign
58+ .align (s1 , s2 , clusterParams , alignParams );
59+
60+ assertEquals (result .length (), 0 );
61+ assertEquals (result .getRelation (), QsRelation .DIFFERENT );
62+
2463 }
2564
2665 /**
27- * Proliferating cell nuclear antigens (1PLR , 3HI8) are structurally
66+ * Proliferating cell nuclear antigens (3IFV , 3HI8) are structurally
2867 * equivalent C3 homotrimers.
2968 */
3069 @ Test
3170 public void testHomoEquivalent () throws StructureException , IOException {
3271
72+ Structure s1 = StructureIO .getStructure ("3ifv" );
73+ Structure s2 = StructureIO .getStructure ("BIO:3hi8:1" );
74+
75+ SubunitClustererParameters clusterParams = new SubunitClustererParameters ();
76+ QsAlignParameters alignParams = new QsAlignParameters ();
77+
78+ QsAlignResult result = QsAlign
79+ .align (s1 , s2 , clusterParams , alignParams );
80+
81+ assertEquals (result .length (), 3 );
82+ assertEquals (result .getRelation (), QsRelation .EQUIVALENT );
83+ assertTrue (result .getRmsd () < 10.0 );
84+
3385 }
3486
3587 /**
@@ -39,16 +91,63 @@ public void testHomoEquivalent() throws StructureException, IOException {
3991 @ Test
4092 public void testHeteroEquivalent () throws StructureException , IOException {
4193
94+ Structure s1 = StructureIO .getStructure ("2vml" );
95+ Structure s2 = StructureIO .getStructure ("2bv8" );
96+
97+ SubunitClustererParameters clusterParams = new SubunitClustererParameters ();
98+ QsAlignParameters alignParams = new QsAlignParameters ();
99+
100+ QsAlignResult result = QsAlign
101+ .align (s1 , s2 , clusterParams , alignParams );
102+
103+ assertEquals (result .length (), 12 );
104+ assertEquals (result .getRelation (), QsRelation .EQUIVALENT );
105+ assertTrue (result .getRmsd () < 10.0 );
106+ }
107+
108+ /**
109+ * Hydratases (2B3M dimer, 1Q6W hexamer). The C2 dimer is
110+ * triplicated into a D3 assembly.
111+ */
112+ @ Test
113+ public void testPartialComplete () throws StructureException ,
114+ IOException {
115+
116+ Structure s1 = StructureIO .getStructure ("BIO:2b3m:1" );
117+ Structure s2 = StructureIO .getStructure ("BIO:1Q6W:7" );
118+
119+ SubunitClustererParameters clusterParams = new SubunitClustererParameters ();
120+ QsAlignParameters alignParams = new QsAlignParameters ();
121+
122+ QsAlignResult result = QsAlign
123+ .align (s1 , s2 , clusterParams , alignParams );
124+
125+ assertEquals (result .length (), 3 );
126+ assertEquals (result .getRelation (), QsRelation .PARTIAL_COMPLETE );
127+ assertTrue (result .getRmsd () < 10.0 );
128+
42129 }
43130
44131 /**
45132 * Cytochrome bc1 complexes (1BCC, 1KB9) have some equivalent Chains and
46133 * some unmatched.
47134 */
48135 @ Test
49- public void testHeteroPartialComplete () throws StructureException ,
136+ public void testPartialIncomplete () throws StructureException ,
50137 IOException {
51138
139+ Structure s1 = StructureIO .getStructure ("1bcc" );
140+ Structure s2 = StructureIO .getStructure ("1kb9" );
141+
142+ SubunitClustererParameters clusterParams = new SubunitClustererParameters ();
143+ QsAlignParameters alignParams = new QsAlignParameters ();
144+
145+ QsAlignResult result = QsAlign
146+ .align (s1 , s2 , clusterParams , alignParams );
147+
148+ assertEquals (result .length (), 8 );
149+ assertEquals (result .getRelation (), QsRelation .PARTIAL_INCOMPLETE );
150+ assertTrue (result .getRmsd () < 10.0 );
52151 }
53152
54153}
0 commit comments