|
28 | 28 | import org.biojava.nbio.structure.align.util.AtomCache; |
29 | 29 | import org.biojava.nbio.structure.io.FileParsingParameters; |
30 | 30 | import org.biojava.nbio.structure.secstruc.DSSPParser; |
| 31 | +import org.biojava.nbio.structure.secstruc.SecStrucCalc; |
31 | 32 | import org.biojava.nbio.structure.secstruc.SecStrucInfo; |
32 | 33 | import org.biojava.nbio.structure.secstruc.SecStrucTools; |
33 | 34 |
|
@@ -61,21 +62,28 @@ public static void main(String[] args) throws IOException, |
61 | 62 |
|
62 | 63 | // Print the Author's assignment (from PDB file) |
63 | 64 | System.out.println("Author's assignment: "); |
64 | | - List<SecStrucInfo> ssi = SecStrucTools.getSecStrucInfo(s); |
65 | | - for (SecStrucInfo ss : ssi) { |
66 | | - System.out.println(ss.getGroup().getChain().getName() + " " |
67 | | - + ss.getGroup().getResidueNumber() + " " |
68 | | - + ss.getGroup().getPDBName() + " -> " + ss.toString()); |
69 | | - } |
| 65 | + printSecStruc(s); |
70 | 66 |
|
71 | 67 | // If the more detailed DSSP prediction is required call this |
72 | 68 | DSSPParser.fetch(pdbID, s, true); |
73 | 69 |
|
74 | 70 | // Print the assignment residue by residue |
75 | 71 | System.out.println("DSSP assignment: "); |
76 | | - ssi = SecStrucTools.getSecStrucInfo(s); |
| 72 | + printSecStruc(s); |
| 73 | + |
| 74 | + // finally use BioJava's built in DSSP-like secondary structure assigner |
| 75 | + SecStrucCalc secStrucCalc = new SecStrucCalc(); |
| 76 | + |
| 77 | + // calculate and assign |
| 78 | + secStrucCalc.calculate(s,true); |
| 79 | + printSecStruc(s); |
| 80 | + |
| 81 | + } |
| 82 | + |
| 83 | + public static void printSecStruc(Structure s){ |
| 84 | + List<SecStrucInfo> ssi = SecStrucTools.getSecStrucInfo(s); |
77 | 85 | for (SecStrucInfo ss : ssi) { |
78 | | - System.out.println(ss.getGroup().getChain().getName() + " " |
| 86 | + System.out.println(ss.getGroup().getChain().getChainID() + " " |
79 | 87 | + ss.getGroup().getResidueNumber() + " " |
80 | 88 | + ss.getGroup().getPDBName() + " -> " + ss.toString()); |
81 | 89 | } |
|
0 commit comments