ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/owl/trunk/src/checkChirality.java
Revision: 1392
Committed: Thu May 19 14:27:50 2011 UTC (13 years, 4 months ago) by jmduarteg
File size: 1202 byte(s)
Log Message:
MAJOR CHANGE: now able to read and treat properly HETATMS and nucleotides from PDB entries. All tests pass. Anyway surely there will be some bugs to iron out still.
Line File contents
1 import java.io.File;
2
3 import owl.core.structure.PdbChain;
4 import owl.core.structure.PdbAsymUnit;
5 import owl.core.structure.Residue;
6 import owl.core.structure.AaResidue;
7
8
9 /**
10 * Executable class to check the chirality of amino acids of a given PDB file
11 * @author duarte
12 *
13 */
14 public class checkChirality {
15
16 public static void main(String[] args) throws Exception {
17 if (args.length==0) {
18 System.err.println("Usage: checkChirality <pdb_file_name>");
19 System.exit(1);
20 }
21
22 File file = new File(args[0]);
23 PdbAsymUnit pdb = new PdbAsymUnit(file);
24
25 for (PdbChain chain:pdb.getPolyChains()) {
26 System.out.println("Chain "+chain+". D-form residues:");
27 int dcount=0;
28 int lcount=0;
29 int ucount=0;
30 for (Residue res : chain) {
31 if (!(res instanceof AaResidue)) continue;
32 AaResidue.Chirality chir = ((AaResidue)res).getChirality();
33 if (chir == AaResidue.Chirality.D) {
34 //System.out.println(res+" "+chir.getAbbrev());
35 dcount++;
36 } else if (chir == AaResidue.Chirality.L) {
37 lcount++;
38 } else if (chir == AaResidue.Chirality.U) {
39 ucount++;
40 }
41 }
42 System.out.println("L-form: "+lcount+" D-form: "+dcount+" Undetermined: "+ucount);
43 }
44
45 }
46
47 }