@@ -56,7 +56,7 @@ protected void setUp() throws IOException
5656 assertEquals ("structure does not contain one chain " , 1 ,structure .size ());
5757
5858 // since biojava 5, chains contain either only polymers or only nonpolymers: here we get the first protein chain with 58 residues
59- Chain chain = structure .getChain (0 );
59+ Chain chain = structure .getChainByIndex (0 );
6060 assertEquals ("Wrong number of residues." ,58 ,chain .getAtomLength ());
6161
6262 inStream .close ();
@@ -104,12 +104,12 @@ public void testGetAtomsConsistency() throws IOException, StructureException{
104104
105105 Structure hivA = cache .getStructure ("1hiv.A" );
106106 Atom [] caSa = StructureTools .getRepresentativeAtomArray (hivA );
107- Atom [] caCa = StructureTools .getRepresentativeAtomArray (hivA .getChain (0 ));
107+ Atom [] caCa = StructureTools .getRepresentativeAtomArray (hivA .getChainByIndex (0 ));
108108 assertEquals ("did not find the same number of Atoms from structure and from chain.." ,
109109 caSa .length ,caCa .length );
110110 Structure hivB = cache .getStructure ("1hiv.B" );
111111 Atom [] caSb = StructureTools .getRepresentativeAtomArray (hivB );
112- Atom [] caCb = StructureTools .getRepresentativeAtomArray (hivB .getChain (0 ));
112+ Atom [] caCb = StructureTools .getRepresentativeAtomArray (hivB .getChainByIndex (0 ));
113113 assertEquals ("did not find the same number of Atoms from structure and from chain.." ,
114114 caSb .length ,caCb .length );
115115 //Both chains have to be the same size (A and B)
@@ -137,7 +137,7 @@ public void testGetSubRanges() throws StructureException {
137137 substr = StructureTools .getSubRanges (structure2 , range );
138138 assertEquals ("Wrong number of chains in " +range , 1 , substr .size ());
139139
140- chain = substr .getChain (0 );
140+ chain = substr .getChainByIndex (0 );
141141
142142 assertEquals ("Did not find the expected number of residues in " +range , 5 , chain .getAtomLength () );
143143
@@ -146,7 +146,7 @@ public void testGetSubRanges() throws StructureException {
146146 substr = StructureTools .getSubRanges (structure2 , range );
147147 assertEquals ("Wrong number of chains in " +range , 1 , substr .size ());
148148
149- chain = substr .getChain (0 );
149+ chain = substr .getChainByIndex (0 );
150150
151151 // since biojava 5, chains contain either only polymers or only nonpolymers: here we get the first protein chain with 408 residues
152152 assertEquals ("Did not find the expected number of residues in " +range , 408 , chain .getAtomLength () );
@@ -157,7 +157,7 @@ public void testGetSubRanges() throws StructureException {
157157 substr = StructureTools .getSubRanges (structure2 , range );
158158 assertEquals ("Wrong number of chains in " +range , 1 , substr .size ());
159159
160- chain = substr .getChain (0 );
160+ chain = substr .getChainByIndex (0 );
161161
162162 // since biojava 5, chains contain either only polymers or only nonpolymers: here we get the first protein chain with 408 residues
163163 assertEquals ("Did not find the expected number of residues in " +range , 408 , chain .getAtomLength () );
@@ -168,10 +168,10 @@ public void testGetSubRanges() throws StructureException {
168168 substr = StructureTools .getSubRanges (structure2 , range );
169169 assertEquals ("Wrong number of chains in " +range , 2 , substr .size ());
170170
171- chain = substr .getChain (0 );
171+ chain = substr .getChainByIndex (0 );
172172 assertEquals ("Did not find the expected number of residues in first chain of " +range , 5 , chain .getAtomLength () );
173173
174- chain = substr .getChain (1 );
174+ chain = substr .getChainByIndex (1 );
175175 assertEquals ("Did not find the expected number of residues in second chain of " +range , 5 , chain .getAtomLength () );
176176
177177 // combined ranges
@@ -180,25 +180,25 @@ public void testGetSubRanges() throws StructureException {
180180 assertEquals ("Wrong number of chains in " +range , 2 , substr .size ());
181181
182182 // since biojava 5, chains contain either only polymers or only nonpolymers: here we get the first protein chain with 408 residues
183- chain = substr .getChain (0 );
183+ chain = substr .getChainByIndex (0 );
184184 assertEquals ("Did not find the expected number of residues in first chain of " +range , 408 , chain .getAtomLength () );
185185
186- chain = substr .getChain (1 );
186+ chain = substr .getChainByIndex (1 );
187187 assertEquals ("Did not find the expected number of residues in second chain of " +range , 5 , chain .getAtomLength () );
188188
189189 // parentheses
190190 range = "(A:3-7)" ;
191191 substr = StructureTools .getSubRanges (structure2 , range );
192192 assertEquals ("Wrong number of chains in " +range , 1 , substr .size ());
193193
194- chain = substr .getChain (0 );
194+ chain = substr .getChainByIndex (0 );
195195 assertEquals ("Did not find the expected number of residues in " +range , 5 , chain .getAtomLength () );
196196
197197 // single residue
198198 range = "A:3" ;
199199 substr = StructureTools .getSubRanges (structure2 , range );
200200 assertEquals ("Wrong number of chains in " +range , 1 , substr .size ());
201- chain = substr .getChain (0 );
201+ chain = substr .getChainByIndex (0 );
202202 assertEquals ("Did not find the expected number of residues in " +range , 1 , chain .getAtomLength () );
203203
204204 // Special '-' case
@@ -212,7 +212,7 @@ public void testGetSubRanges() throws StructureException {
212212 assertEquals ("Wrong number of chains in " +range , 1 , substr .size ());
213213
214214 // since biojava 5, chains contain either only polymers or only nonpolymers: here we get the first protein chain with 58 residues
215- chain = substr .getChain (0 );
215+ chain = substr .getChainByIndex (0 );
216216 assertEquals ("Did not find the expected number of residues in first chain of " +range , 58 , chain .getAtomLength () );
217217
218218 // Test single-chain syntax in a multi-chain structure. Should give chain A.
@@ -221,7 +221,7 @@ public void testGetSubRanges() throws StructureException {
221221 assertEquals ("Wrong number of chains in " +range , 1 , substr .size ());
222222
223223 // since biojava 5, chains contain either only polymers or only nonpolymers: here we get the first protein chain with 408 residues
224- chain = substr .getChain (0 );
224+ chain = substr .getChainByIndex (0 );
225225 assertEquals ("Chain _ not converted to chain A." ,"A" ,chain .getChainID ());
226226 assertEquals ("Did not find the expected number of residues in first chain of " +range , 408 , chain .getAtomLength () );
227227
@@ -336,7 +336,7 @@ public void testGetSubRangesExtended() throws StructureException {
336336 substr = StructureTools .getSubRanges (structure2 , range );
337337 assertEquals ("Wrong number of chains in " +range , 1 , substr .size ());
338338
339- chain = substr .getChain (0 );
339+ chain = substr .getChainByIndex (0 );
340340
341341 // Note residue 0 is missing from 1lnl
342342 assertEquals ("Did not find the expected number of residues in " +range , 10 , chain .getAtomLength () );
@@ -346,7 +346,7 @@ public void testGetSubRangesExtended() throws StructureException {
346346 substr = StructureTools .getSubRanges (structure2 , range );
347347 assertEquals ("Wrong number of chains in " +range , 1 , substr .size ());
348348
349- chain = substr .getChain (0 );
349+ chain = substr .getChainByIndex (0 );
350350
351351 assertEquals ("Did not find the expected number of residues in " +range , 3 , chain .getAtomLength () );
352352
@@ -355,7 +355,7 @@ public void testGetSubRangesExtended() throws StructureException {
355355 substr = StructureTools .getSubRanges (structure2 , range );
356356 assertEquals ("Wrong number of chains in " +range , 1 , substr .size ());
357357
358- chain = substr .getChain (0 );
358+ chain = substr .getChainByIndex (0 );
359359
360360 assertEquals ("Did not find the expected number of residues in " +range , 4 , chain .getAtomLength () );
361361
@@ -364,7 +364,7 @@ public void testGetSubRangesExtended() throws StructureException {
364364 substr = StructureTools .getSubRanges (structure2 , range );
365365 assertEquals ("Wrong number of chains in " +range , 1 , substr .size ());
366366
367- chain = substr .getChain (0 );
367+ chain = substr .getChainByIndex (0 );
368368
369369 assertEquals ("Did not find the expected number of residues in " +range , 6 , chain .getAtomLength () );
370370
@@ -374,10 +374,10 @@ public void testGetSubRangesExtended() throws StructureException {
374374 substr = StructureTools .getSubRanges (structure2 , range );
375375 assertEquals ("Wrong number of chains in " +range , 2 , substr .size ());
376376
377- chain = substr .getChain (0 );
377+ chain = substr .getChainByIndex (0 );
378378 assertEquals ("Did not find the expected number of residues in first chain of " +range , 5 , chain .getAtomLength () );
379379
380- chain = substr .getChain (1 );
380+ chain = substr .getChainByIndex (1 );
381381 assertEquals ("Did not find the expected number of residues in second chain of " +range , 5 , chain .getAtomLength () );
382382
383383 }
@@ -397,7 +397,7 @@ public void testGetSubRangesInsertionCodes() throws StructureException {
397397 substr = StructureTools .getSubRanges (structure3 , range );
398398 assertEquals ("Wrong number of chains in " +range , 1 , substr .size ());
399399
400- chain = substr .getChain (0 );
400+ chain = substr .getChainByIndex (0 );
401401
402402 assertEquals ("Did not find the expected number of residues in " +range , 4 , chain .getAtomLength () );
403403
@@ -407,7 +407,7 @@ public void testGetSubRangesInsertionCodes() throws StructureException {
407407 substr = StructureTools .getSubRanges (structure3 , range );
408408 assertEquals ("Wrong number of chains in " +range , 1 , substr .size ());
409409
410- chain = substr .getChain (0 );
410+ chain = substr .getChainByIndex (0 );
411411
412412 assertEquals ("Did not find the expected number of residues in " +range , 3 , chain .getAtomLength () );
413413
@@ -416,7 +416,7 @@ public void testGetSubRangesInsertionCodes() throws StructureException {
416416 substr = StructureTools .getSubRanges (structure3 , range );
417417 assertEquals ("Wrong number of chains in " +range , 1 , substr .size ());
418418
419- chain = substr .getChain (0 );
419+ chain = substr .getChainByIndex (0 );
420420
421421 assertEquals ("Did not find the expected number of residues in " +range , 3 , chain .getAtomLength () );
422422
@@ -425,7 +425,7 @@ public void testGetSubRangesInsertionCodes() throws StructureException {
425425 substr = StructureTools .getSubRanges (structure3 , range );
426426 assertEquals ("Wrong number of chains in " +range , 1 , substr .size ());
427427
428- chain = substr .getChain (0 );
428+ chain = substr .getChainByIndex (0 );
429429
430430 assertEquals ("Did not find the expected number of residues in " +range , 12 , chain .getAtomLength () );
431431
@@ -434,7 +434,7 @@ public void testGetSubRangesInsertionCodes() throws StructureException {
434434 substr = StructureTools .getSubRanges (structure3 , range );
435435 assertEquals ("Wrong number of chains in " +range , 1 , substr .size ());
436436
437- chain = substr .getChain (0 );
437+ chain = substr .getChainByIndex (0 );
438438
439439 assertEquals ("Did not find the expected number of residues in " +range , 8 , chain .getAtomLength () );
440440 }
0 commit comments