ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/owl/trunk/src/compareCMs.java
Revision: 1372
Committed: Wed Mar 30 09:55:49 2011 UTC (13 years, 6 months ago) by jmduarteg
File size: 1357 byte(s)
Log Message:
MAJOR INTERFACE CHANGE: the main PDB data loading interface has changed. Now all loading of data occurs through PdbAsymUnit. Refactoring of some classes: Pdb is now PdbChain.
Line User Rev File contents
1 duarte 189 import java.util.HashMap;
2    
3 hstehr 1005 import owl.core.structure.*;
4 hstehr 1009 import owl.core.structure.graphs.RIGraph;
5 jmduarteg 1372 import owl.core.util.MySQLConnection;
6 duarte 189
7 hstehr 1005
8 duarte 189 public class compareCMs {
9    
10     /**
11     * @param args
12     */
13 duarte 441 public static void main(String[] args) throws Exception {
14 duarte 189
15     String onlyIn1File="onlyin1.graph";
16     String onlyIn2File="onlyin2.graph";
17     String commonFile="common.graph";
18    
19    
20     String pdbcode1="1ses";
21     String chaincode1="A";
22     String pdbcode2="1set";
23     String chaincode2="A";
24    
25    
26     System.out.println("loading structures from pdbase");
27 jmduarteg 1372 PdbAsymUnit fullpdb1 = new PdbAsymUnit(pdbcode1,new MySQLConnection(),"pdbase");
28     PdbChain pdb1 = fullpdb1.getChain(chaincode1);
29     PdbAsymUnit fullpdb2 = new PdbAsymUnit(pdbcode2,new MySQLConnection(),"pdbase");
30     PdbChain pdb2 = fullpdb2.getChain(chaincode2);
31 duarte 189
32     System.out.println("getting graphs");
33 duarte 950 RIGraph graph1 = pdb1.getRIGraph("ALL", 4.2);
34     RIGraph graph2 = pdb2.getRIGraph("ALL", 4.2);
35 duarte 189
36 duarte 423 HashMap<String,RIGraph> comparison = graph1.compare(graph2);
37 duarte 189
38 duarte 423 RIGraph onlyIn1 = comparison.get("onlythis");
39     RIGraph onlyIn2 = comparison.get("onlyother");
40     RIGraph common = comparison.get("common");
41 duarte 189
42     System.out.println("writing output files "+onlyIn1File+", "+onlyIn2File+", "+commonFile);
43 duarte 953 onlyIn1.writeToFile(onlyIn1File);
44     onlyIn2.writeToFile(onlyIn2File);
45     common.writeToFile(commonFile);
46 duarte 189
47    
48    
49     }
50    
51     }