Skip to content

Commit 35ff5a4

Browse files
committed
Better docs and an empty test
1 parent 892c03d commit 35ff5a4

File tree

2 files changed

+63
-4
lines changed

2 files changed

+63
-4
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
package org.biojava.nbio.structure.test.io;
2+
3+
//import static org.junit.Assert.*;
4+
5+
import java.io.IOException;
6+
7+
8+
import org.biojava.nbio.structure.StructureException;
9+
import org.biojava.nbio.structure.StructureIO;
10+
import org.biojava.nbio.structure.align.util.AtomCache;
11+
import org.biojava.nbio.structure.io.FileParsingParameters;
12+
import org.junit.Ignore;
13+
import org.junit.Test;
14+
15+
/**
16+
* Test for a difficult large mmCIF file (a ribosome) with many 2-letter chain ids.
17+
* Both tests are set to Ignore because the parsing of the file takes too long.
18+
*
19+
* @author Jose Duarte
20+
*
21+
*/
22+
public class Test4v5a {
23+
24+
@Test @Ignore
25+
public void test4v5a() throws StructureException, IOException {
26+
AtomCache cache = new AtomCache();
27+
28+
FileParsingParameters params = cache.getFileParsingParams();
29+
params.setUseInternalChainId(false);
30+
params.setCreateAtomBonds(true);
31+
StructureIO.setAtomCache(cache);
32+
33+
StructureIO.getStructure("4v5a");
34+
35+
36+
}
37+
38+
@Test @Ignore
39+
public void test4v5aInternalChainIds() throws StructureException, IOException {
40+
AtomCache cache = new AtomCache();
41+
42+
FileParsingParameters params = cache.getFileParsingParams();
43+
params.setUseInternalChainId(true);
44+
params.setCreateAtomBonds(true);
45+
StructureIO.setAtomCache(cache);
46+
47+
48+
// this would throw an exception when making ss bonds from struct_conn because
49+
// chain id "AD" is both an author chain id and an asym chain id and the chains were
50+
// getting mixed
51+
StructureIO.getStructure("4v5a");
52+
53+
//for (Chain c : s.getChains()) {
54+
// System.out.println(c.getChainID()+" "+c.getInternalChainID()+" "+c.getAtomLength());
55+
//}
56+
57+
58+
}
59+
}

biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/SimpleMMcifConsumer.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,11 +287,11 @@ else if (aminoCode1 != null ) {
287287
return group ;
288288
}
289289

290-
/** test if the chain is already known (is in current_model
291-
* ArrayList) and if yes, returns the chain
292-
* if no -> returns null
290+
/**
291+
* Test if the given chainID is already present in the list of chains given. If yes, returns the chain
292+
* otherwise returns null.
293293
*/
294-
private Chain isKnownChain(String chainID, List<Chain> chains){
294+
private static Chain isKnownChain(String chainID, List<Chain> chains){
295295

296296
for (int i = 0; i< chains.size();i++){
297297
Chain testchain = chains.get(i);

0 commit comments

Comments
 (0)