@@ -65,8 +65,82 @@ Several internal BioJava classes use ```ScopFactory.getSCOP()``` when they encou
6565Several versions of SCOP are available.
6666
6767 // Use Steven Brenner's updated version of SCOP
68- scop = ScopFactory.getSCOP(ScopFactory.VERSION_1_75B );
68+ scop = ScopFactory.getSCOP(ScopFactory.VERSION_1_75C );
6969 // Use an old version globally, perhaps for an older benchmark
7070 ScopFactory.setScopDatabase(ScopFactory.VERSION_1_69);
7171
72+ CATH
73+ ----
74+
75+ Cath can be accessed in a very similar fashion to SCOP. In parallel to the ScopInstallation class, there is a CathInstallation. Also, the StructureIO class allows to request by CATH ID.
76+
77+ ``` java
78+
79+ private static final String DEFAULT_SCRIPT = " select * ; cartoon on; spacefill off; wireframe off; select ligands; wireframe on; spacefill on;" ;
80+ private static final String [] colors = new String []{" red" ," green" ," blue" ," yellow" };
81+
82+ public static void main(String args[]){
83+
84+ UserConfiguration config = new UserConfiguration ();
85+ config. setPdbFilePath(" /tmp/" );
86+
87+ String pdbID = " 1DAN" ;
88+
89+ CathDatabase cath = new CathInstallation (config. getPdbFilePath());
90+
91+ List<CathDomain > domains = cath. getDomainsForPdb(pdbID);
92+
93+ try {
94+
95+ // show the structure in 3D
96+ BiojavaJmol jmol = new BiojavaJmol ();
97+ jmol. setStructure(StructureIO . getStructure(pdbID));
98+ jmol. evalString(DEFAULT_SCRIPT );
99+
100+ System . out. println(" got " + domains. size() + " domains" );
101+
102+ // now color the domains on the structure
103+ int colorpos = - 1 ;
104+
105+ for ( CathDomain domain : domains){
106+
107+ colorpos++ ;
108+
109+ showDomain(jmol, domain,colorpos);
110+ }
111+
112+
113+ } catch (Exception e) {
114+ // TODO Auto-generated catch block
115+ e. printStackTrace();
116+ }
117+
118+ }
119+
120+
121+
122+ private static void showDomain(BiojavaJmol jmol, CathDomain domain, int colorpos) {
123+ List<CathSegment > segments = domain. getSegments();
124+
125+ StructureName key = new StructureName (domain. getDomainName());
126+ String chainId = key. getChainId();
127+
128+ String color = colors[colorpos];
129+
130+ System . out. println(" * domain " + domain. getDomainName() + " has # segments: " + domain. getSegments(). size() + " color: " + color);
131+
132+ for ( CathSegment segment : segments){
133+ System . out. println(" * " + segment);
134+ String start = segment. getStart();
135+
136+ String stop = segment. getStop();
137+
138+ String script = " select " + start + " -" + stop+ " :" + chainId + " ; color " + color + " ;" ;
139+
140+ jmol. evalString(script );
141+ }
142+
143+ }
144+ ```
72145
146+
0 commit comments