1818 * http://www.biojava.org/
1919 *
2020 */
21- package org .biojava .nbio .structure .xtal ;
21+ package org .biojava .nbio .structure .test . xtal ;
2222
2323import org .biojava .nbio .structure .Structure ;
2424import org .biojava .nbio .structure .StructureException ;
2525import org .biojava .nbio .structure .StructureIO ;
2626import org .biojava .nbio .structure .align .util .AtomCache ;
2727import org .biojava .nbio .structure .contact .StructureInterfaceList ;
28+ import org .biojava .nbio .structure .xtal .CrystalBuilder ;
2829import org .junit .Test ;
2930
3031import java .io .IOException ;
3132
32- import static org .junit .Assert .assertTrue ;
33+ import static org .junit .Assert .* ;
3334
3435public class TestCrystalBuilder {
3536
@@ -42,7 +43,7 @@ public void test1NMR() throws IOException, StructureException {
4243
4344 StructureIO .setAtomCache (cache );
4445
45- cache .setUseMmCif (false );
46+ cache .setUseMmCif (true );
4647 Structure s1 = StructureIO .getStructure ("1NMR" );
4748
4849 CrystalBuilder cb = new CrystalBuilder (s1 );
@@ -60,7 +61,7 @@ public void test1B8G() throws IOException, StructureException {
6061
6162 StructureIO .setAtomCache (cache );
6263
63- cache .setUseMmCif (false );
64+ cache .setUseMmCif (true );
6465 Structure s1 = StructureIO .getStructure ("1B8G" );
6566 CrystalBuilder cb = new CrystalBuilder (s1 );
6667 StructureInterfaceList interfaces = cb .getUniqueInterfaces (5.5 );
@@ -78,7 +79,7 @@ public void test2MFZ() throws IOException, StructureException {
7879
7980 StructureIO .setAtomCache (cache );
8081
81- cache .setUseMmCif (false );
82+ cache .setUseMmCif (true );
8283 Structure s1 = StructureIO .getStructure ("2MFZ" );
8384 CrystalBuilder cb = new CrystalBuilder (s1 );
8485 StructureInterfaceList interfaces = cb .getUniqueInterfaces (5.5 );
@@ -95,7 +96,7 @@ public void test4MF8() throws IOException, StructureException {
9596
9697 StructureIO .setAtomCache (cache );
9798
98- cache .setUseMmCif (false );
99+ cache .setUseMmCif (true );
99100 Structure s1 = StructureIO .getStructure ("4MF8" );
100101 CrystalBuilder cb = new CrystalBuilder (s1 );
101102 StructureInterfaceList interfaces = cb .getUniqueInterfaces (5.5 );
@@ -115,11 +116,30 @@ public void test2H2Z() throws IOException, StructureException {
115116
116117 StructureIO .setAtomCache (cache );
117118
118- cache .setUseMmCif (false );
119+ cache .setUseMmCif (true );
119120 Structure s1 = StructureIO .getStructure ("2H2Z" );
120121 CrystalBuilder cb = new CrystalBuilder (s1 );
121122 StructureInterfaceList interfaces = cb .getUniqueInterfaces (5.5 );
122123 assertTrue (interfaces .size ()>=3 );
123124
124125 }
126+
127+ @ Test
128+ public void test4HHB () throws IOException , StructureException {
129+
130+ // 4hhb is a very old entry with a non-standard coordinate frame convention, we should calculate only AU contacts
131+
132+ AtomCache cache = new AtomCache ();
133+
134+ StructureIO .setAtomCache (cache );
135+
136+ cache .setUseMmCif (true );
137+ Structure s1 = StructureIO .getStructure ("4HHB" );
138+ CrystalBuilder cb = new CrystalBuilder (s1 );
139+ StructureInterfaceList interfaces = cb .getUniqueInterfaces (5.5 );
140+ // 5 interfaces in the AU: the 4 of the tetramer + 1 cross-interface
141+ assertEquals (5 , interfaces .size ());
142+
143+ }
144+
125145}
0 commit comments