ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/owl/trunk/src/checkChirality.java
Revision: 1005
Committed: Wed Mar 31 12:29:26 2010 UTC (14 years, 6 months ago) by hstehr
File size: 1204 byte(s)
Log Message:
refactoring: renaming proteinstructure to structure and tools to util; moving connections,features,runners,sequence,structure,util to owl.core
Line User Rev File contents
1 duarte 957 import java.io.File;
2    
3 hstehr 1005 import owl.core.structure.Pdb;
4     import owl.core.structure.PdbfilePdb;
5     import owl.core.structure.Residue;
6 duarte 957
7 hstehr 1005
8 duarte 957 /**
9     * Executable class to check the chirality of amino acids of a given PDB file
10     * @author duarte
11     *
12     */
13     public class checkChirality {
14    
15     public static void main(String[] args) throws Exception {
16     if (args.length==0) {
17     System.err.println("Usage: checkChirality <pdb_file_name>");
18     System.exit(1);
19     }
20    
21     File file = new File(args[0]);
22     Pdb pdb = new PdbfilePdb(file.getAbsolutePath());
23     String[] chains = pdb.getChains();
24    
25     for (String chain:chains) {
26     System.out.println("Chain "+chain+". D-form residues:");
27     pdb.load(chain);
28     int dcount=0;
29     int lcount=0;
30     int ucount=0;
31     for (int resser:pdb.getAllSortedResSerials()) {
32     Residue res = pdb.getResidue(resser);
33     Residue.Chirality chir = res.getChirality();
34     if (chir == Residue.Chirality.D) {
35     //System.out.println(res+" "+chir.getAbbrev());
36     dcount++;
37     } else if (chir == Residue.Chirality.L) {
38     lcount++;
39     } else if (chir == Residue.Chirality.U) {
40     ucount++;
41     }
42     }
43     System.out.println("L-form: "+lcount+" D-form: "+dcount+" Undetermined: "+ucount);
44     }
45    
46     }
47    
48     }