ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/owl/trunk/compareCMs.java
Revision: 492
Committed: Wed Jan 2 13:18:57 2008 UTC (16 years, 9 months ago) by duarte
File size: 1158 byte(s)
Log Message:
Copied the aglappe-jung branch into trunk.

Line File contents
1 import proteinstructure.*;
2 import java.util.HashMap;
3
4
5 public class compareCMs {
6
7 /**
8 * @param args
9 */
10 public static void main(String[] args) throws Exception {
11
12 String onlyIn1File="onlyin1.graph";
13 String onlyIn2File="onlyin2.graph";
14 String commonFile="common.graph";
15
16
17 String pdbcode1="1ses";
18 String chaincode1="A";
19 String pdbcode2="1set";
20 String chaincode2="A";
21
22
23 System.out.println("loading structures from pdbase");
24 Pdb pdb1 = new PdbasePdb(pdbcode1);
25 pdb1.load(chaincode1);
26 Pdb pdb2 = new PdbasePdb(pdbcode2);
27 pdb2.load(chaincode2);
28
29 System.out.println("getting graphs");
30 RIGraph graph1 = pdb1.get_graph("ALL", 4.2);
31 RIGraph graph2 = pdb2.get_graph("ALL", 4.2);
32
33 HashMap<String,RIGraph> comparison = graph1.compare(graph2);
34
35 RIGraph onlyIn1 = comparison.get("onlythis");
36 RIGraph onlyIn2 = comparison.get("onlyother");
37 RIGraph 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 }