ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/owl/trunk/compareCMs.java
Revision: 215
Committed: Thu Jun 28 15:43:04 2007 UTC (17 years, 3 months ago) by stehr
File size: 1273 byte(s)
Log Message:
some clean up of exceptions in Pdb and Graph classes:
merged PdbAcCodeNotFoundError and MsdAcCodeNotFoundError into PdbCodeNotFoundError,
created new PdbChainCodeNotFound, got rid of stderr output, throwing exceptions with informative messages instead
Line User Rev File contents
1 duarte 189 import java.io.IOException;
2    
3 duarte 207 import proteinstructure.*;
4 duarte 189 import java.util.HashMap;
5    
6    
7     public class compareCMs {
8    
9     /**
10     * @param args
11     */
12 stehr 215 public static void main(String[] args) throws Exception, IOException, PdbaseInconsistencyError, PdbCodeNotFoundError, PdbChainCodeNotFoundError, MsdsdInconsistentResidueNumbersError{
13 duarte 189
14     String onlyIn1File="onlyin1.graph";
15     String onlyIn2File="onlyin2.graph";
16     String commonFile="common.graph";
17    
18    
19     String pdbcode1="1ses";
20     String chaincode1="A";
21     String pdbcode2="1set";
22     String chaincode2="A";
23    
24    
25     System.out.println("loading structures from pdbase");
26 duarte 207 Pdb pdb1 = new PdbasePdb(pdbcode1,chaincode1);
27     Pdb pdb2 = new PdbasePdb(pdbcode2,chaincode2);
28 duarte 189
29     System.out.println("getting graphs");
30     Graph graph1 = pdb1.get_graph("ALL", 4.2);
31     Graph graph2 = pdb2.get_graph("ALL", 4.2);
32    
33     HashMap<String,Graph> comparison = graph1.compare(graph2);
34    
35     Graph onlyIn1 = comparison.get("onlythis");
36     Graph onlyIn2 = comparison.get("onlyother");
37     Graph common = comparison.get("common");
38    
39     System.out.println("writing output files "+onlyIn1File+", "+onlyIn2File+", "+commonFile);
40     onlyIn1.write_graph_to_file(onlyIn1File);
41     onlyIn2.write_graph_to_file(onlyIn2File);
42     common.write_graph_to_file(commonFile);
43    
44    
45    
46     }
47    
48     }