1 |
import java.io.IOException; |
2 |
|
3 |
import proteinstructure.*; |
4 |
import java.util.HashMap; |
5 |
|
6 |
|
7 |
public class compareCMs { |
8 |
|
9 |
/** |
10 |
* @param args |
11 |
*/ |
12 |
public static void main(String[] args) throws Exception, IOException, PdbaseInconsistencyError, PdbCodeNotFoundError, PdbChainCodeNotFoundError, MsdsdInconsistentResidueNumbersError{ |
13 |
|
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 |
Pdb pdb1 = new PdbasePdb(pdbcode1,chaincode1); |
27 |
Pdb pdb2 = new PdbasePdb(pdbcode2,chaincode2); |
28 |
|
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 |
} |