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 |
} |