Repository navigation
Expand file tree
/
Copy pathStrucAligParameters.java
More file actions
390 lines (289 loc) · 8.94 KB
/
Copy pathStrucAligParameters.java
File metadata and controls
390 lines (289 loc) · 8.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
/*
* BioJava development code
*
* This code may be freely distributed and modified under the
* terms of the GNU Lesser General Public Licence. This should
* be distributed with the code. If you do not have a copy,
* see:
*
* http://www.gnu.org/copyleft/lesser.html
*
* Copyright for this code is held jointly by the individual
* authors. These should be listed in @author doc comments.
*
* For more information on the BioJava project and its aims,
* or to join the biojava-l mailing list, visit the home page
* at:
*
* http://www.biojava.org/
*
* Created on May 21, 2006
*
*/
package org.biojava.nbio.structure.align;
import org.biojava.nbio.structure.StructureTools;
/** A class that contains all the parameters of the structure alignment algorithm.
*
* @author Andreas Prlic
* @since 1.5
* @version %I% %G%
*/
public class StrucAligParameters {
int initialK;
String[] usedAtomNames = { StructureTools.CA_ATOM_NAME, } ;
// step 1
int seedFragmentLength; // seed fragment length
float seedRmsdCutoff;
int fragmentLength;
int diagonalDistance;
int diagonalDistance2; // set to < 1 if not used.
boolean reduceInitialFragments;
// step 2
float fragmentMiniDistance;
float fragCompat; // fragment compatibility cutoff
int maxrefine; // max number of JointFragments to be refined
boolean joinPlo; // joining according to BioPython variant
boolean joinFast; // apply a fast procedure for extending the alignments
// joininf of fragments - checks
boolean doAngleCheck ;
boolean doDistanceCheck;
boolean doDensityCheck;
boolean doRMSCheck;
float densityCutoff;
int angleDiff; // directional difference
double joinRMSCutoff; // rms cutoff to be applied during joining of fragments.
// step 4
float create_co; // alignment generation cutoff
int maxIter; // # max number of iterations in refinement
float gapOpen;// gap open penalty
float gapExtension; // gap extensionpenalty
int permutationSize; // minimal size for a permutated fragment ( -1 means no circular permutation search)
float evalCutoff; // alignment evaluation cutoff
public StrucAligParameters() {
super();
setDefault();
}
public static StrucAligParameters getDefaultParameters(){
StrucAligParameters n = new StrucAligParameters();
return n;
}
private void setDefault() {
initialK = 6;
// step 1
seedFragmentLength = 8;
seedRmsdCutoff = 3.0f; // orig 2.0 - better?
fragmentLength = 10;
diagonalDistance = 3;
diagonalDistance2 = 9; // this helps a lot in 1buz vs 1aua
fragmentMiniDistance = 3.5f; // orig 2
angleDiff = 10;
fragCompat = 6.0f; // orig 4.0
maxrefine = 20; // orig 20
// step 2
reduceInitialFragments = true; // if this is disabled, you might want to also disable doRMSCheck for large structures...
joinRMSCutoff = 5.0; // orig 4
joinPlo = false;
joinFast = false;
// 3 joint fragments
doAngleCheck = true;
doDistanceCheck = true;
doRMSCheck = true;
doDensityCheck = false; // hm this one needs improvements before being used
densityCutoff = 7.0f;
// step 3
create_co = 6.0f;
maxIter = 4; // number of times dynamic programming is run. set to zero for quick search (but imprecise)
gapOpen = 20.0f;
gapExtension = 0.0f;
permutationSize = 20;
evalCutoff = 6.0f;
}
@Override
public String toString() {
StringBuffer buf = new StringBuffer();
String t = " ";
Object[] params = new Object[]{new Integer(initialK) ,new Integer(seedFragmentLength),
new Float(seedRmsdCutoff),
new Integer(fragmentLength),
new Integer(diagonalDistance), new Integer(diagonalDistance2), new Float(fragmentMiniDistance),
new Integer(angleDiff),
new Float(fragCompat), new Integer(maxrefine),
new Boolean(reduceInitialFragments), new Double(joinRMSCutoff), new Boolean(joinPlo),
new Boolean(doAngleCheck), new Boolean(doDistanceCheck), new Boolean(doRMSCheck),
new Boolean(doDensityCheck), new Float(densityCutoff), new Float(create_co), new Integer(maxIter),
new Float(gapOpen), new Float(gapExtension), new Integer(permutationSize), new Float(evalCutoff)};
for (int i=0 ; i< params.length ; i++){
buf.append(params[i]);
buf.append(t);
}
return buf.toString();
}
public static StrucAligParameters getDBSearchParameters(){
StrucAligParameters params = new StrucAligParameters();
params.setMaxIter(0); // not so nice alignments, but significant similarities should already be found,
// one could do a second interation later over the top ranking hits and make a nicer alignment.
return params;
}
public float getDensityCutoff() {
return densityCutoff;
}
public void setDensityCutoff(float densityCutoff) {
this.densityCutoff = densityCutoff;
}
public int getInitialK() {
return initialK;
}
public void setInitialK(int initialK) {
this.initialK = initialK;
}
public int getSeedFragmentLength() {
return seedFragmentLength;
}
public boolean isJoinFast(){
return joinFast;
}
public void setJoinFast(boolean fastJoin){
joinFast = fastJoin;
}
public boolean isJoinPlo() {
return joinPlo;
}
public void setJoinPlo(boolean joinPlo) {
this.joinPlo = joinPlo;
}
public void setSeedFragmentLength(int seedFragmentLength) {
this.seedFragmentLength = seedFragmentLength;
}
public float getSeedRmsdCutoff() {
return seedRmsdCutoff;
}
public void setSeedRmsdCutoff(float seedRmsdCutoff) {
this.seedRmsdCutoff = seedRmsdCutoff;
}
public boolean isDoAngleCheck() {
return doAngleCheck;
}
public void setDoAngleCheck(boolean doAngleCheck) {
this.doAngleCheck = doAngleCheck;
}
public boolean isDoDensityCheck() {
return doDensityCheck;
}
public void setDoDensityCheck(boolean doDensityCheck) {
this.doDensityCheck = doDensityCheck;
}
public boolean isDoDistanceCheck() {
return doDistanceCheck;
}
public void setDoDistanceCheck(boolean doDistanceCheck) {
this.doDistanceCheck = doDistanceCheck;
}
public boolean isDoRMSCheck() {
return doRMSCheck;
}
public void setDoRMSCheck(boolean doRMSCheck) {
this.doRMSCheck = doRMSCheck;
}
public double getJoinRMSCutoff() {
return joinRMSCutoff;
}
public void setJoinRMSCutoff(double joinRMSCutoff) {
this.joinRMSCutoff = joinRMSCutoff;
}
public float getEvalCutoff() {
return evalCutoff;
}
public void setEvalCutoff(float evalCutoff) {
this.evalCutoff = evalCutoff;
}
public int getPermutationSize() {
return permutationSize;
}
public void setPermutationSize(int permutationSize) {
this.permutationSize = permutationSize;
}
public float getGapExtension() {
return gapExtension;
}
public void setGapExtension(float gapExtension) {
this.gapExtension = gapExtension;
}
public float getGapOpen() {
return gapOpen;
}
public void setGapOpen(float gapOpen) {
this.gapOpen = gapOpen;
}
public int getMaxIter() {
return maxIter;
}
public void setMaxIter(int maxIter) {
this.maxIter = maxIter;
}
public float getCreate_co() {
return create_co;
}
public void setCreate_co(float create_co) {
this.create_co = create_co;
}
/** if this is set to false, the time spent to joint the initial fragments (step 2)
* is increased. - particular for large structures this increases calc. time a lot.
* advantage: more combinations of fragments are used.
*
* @return a flag if the inital fragments should be reduced
*/
public boolean reduceInitialFragments() {
return reduceInitialFragments;
}
public void setReduceInitialFragments(boolean reduceInitialFragments) {
this.reduceInitialFragments = reduceInitialFragments;
}
public int getAngleDiff() {
return angleDiff;
}
public void setAngleDiff(int angleDiff) {
this.angleDiff = angleDiff;
}
public float getFragCompat() {
return fragCompat;
}
public void setFragCompat(float fragCompat) {
this.fragCompat = fragCompat;
}
public int getMaxrefine() {
return maxrefine;
}
public void setMaxrefine(int maxrefine) {
this.maxrefine = maxrefine;
}
public String[] getUsedAtomNames() {
return usedAtomNames;
}
public void setUsedAtomNames(String[] usedAtomNames) {
this.usedAtomNames = usedAtomNames;
}
public int getFragmentLength() {
return fragmentLength;
}
public void setFragmentLength(int fragmentLength) {
this.fragmentLength = fragmentLength;
}
public int getDiagonalDistance() {
return diagonalDistance;
}
public void setDiagonalDistance(int diagonalDistance) {
this.diagonalDistance = diagonalDistance;
}
public int getDiagonalDistance2() {
return diagonalDistance2;
}
public void setDiagonalDistance2(int diagonalDistance2) {
this.diagonalDistance2 = diagonalDistance2;
}
public float getFragmentMiniDistance() {
return fragmentMiniDistance;
}
public void setFragmentMiniDistance(float fragmentMiniDistance) {
this.fragmentMiniDistance = fragmentMiniDistance;
}
}