1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
package jalview.structure; |
22 |
|
|
23 |
|
import java.io.PrintStream; |
24 |
|
import java.util.ArrayList; |
25 |
|
import java.util.Arrays; |
26 |
|
import java.util.Collections; |
27 |
|
import java.util.Enumeration; |
28 |
|
import java.util.HashMap; |
29 |
|
import java.util.IdentityHashMap; |
30 |
|
import java.util.List; |
31 |
|
import java.util.Locale; |
32 |
|
import java.util.Map; |
33 |
|
import java.util.Vector; |
34 |
|
|
35 |
|
import jalview.analysis.AlignSeq; |
36 |
|
import jalview.api.StructureSelectionManagerProvider; |
37 |
|
import jalview.bin.Cache; |
38 |
|
import jalview.bin.Console; |
39 |
|
import jalview.commands.CommandI; |
40 |
|
import jalview.commands.EditCommand; |
41 |
|
import jalview.commands.OrderCommand; |
42 |
|
import jalview.datamodel.AlignedCodonFrame; |
43 |
|
import jalview.datamodel.AlignmentAnnotation; |
44 |
|
import jalview.datamodel.AlignmentI; |
45 |
|
import jalview.datamodel.Annotation; |
46 |
|
import jalview.datamodel.ContiguousI; |
47 |
|
import jalview.datamodel.HiddenColumns; |
48 |
|
import jalview.datamodel.PDBEntry; |
49 |
|
import jalview.datamodel.SearchResults; |
50 |
|
import jalview.datamodel.SearchResultsI; |
51 |
|
import jalview.datamodel.SequenceI; |
52 |
|
import jalview.ext.jmol.JmolParser; |
53 |
|
import jalview.gui.IProgressIndicator; |
54 |
|
import jalview.gui.Preferences; |
55 |
|
import jalview.io.AppletFormatAdapter; |
56 |
|
import jalview.io.DataSourceType; |
57 |
|
import jalview.io.StructureFile; |
58 |
|
import jalview.structure.StructureImportSettings.TFType; |
59 |
|
import jalview.util.MappingUtils; |
60 |
|
import jalview.util.MessageManager; |
61 |
|
import jalview.util.Platform; |
62 |
|
import jalview.ws.sifts.SiftsClient; |
63 |
|
import jalview.ws.sifts.SiftsException; |
64 |
|
import jalview.ws.sifts.SiftsSettings; |
65 |
|
import mc_view.Atom; |
66 |
|
import mc_view.PDBChain; |
67 |
|
import mc_view.PDBfile; |
68 |
|
|
|
|
| 55.6% |
Uncovered Elements: 333 (750) |
Complexity: 215 |
Complexity Density: 0.48 |
|
69 |
|
public class StructureSelectionManager |
70 |
|
{ |
71 |
|
public final static String NEWLINE = System.lineSeparator(); |
72 |
|
|
73 |
|
static IdentityHashMap<StructureSelectionManagerProvider, StructureSelectionManager> instances; |
74 |
|
|
75 |
|
private List<StructureMapping> mappings = new ArrayList<>(); |
76 |
|
|
77 |
|
private boolean processSecondaryStructure = false; |
78 |
|
|
79 |
|
private boolean secStructServices = false; |
80 |
|
|
81 |
|
private boolean addTempFacAnnot = false; |
82 |
|
|
83 |
|
|
84 |
|
|
85 |
|
|
86 |
|
private List<AlignedCodonFrame> seqmappings = new ArrayList<>(); |
87 |
|
|
88 |
|
private List<CommandListener> commandListeners = new ArrayList<>(); |
89 |
|
|
90 |
|
private List<SelectionListener> sel_listeners = new ArrayList<>(); |
91 |
|
|
92 |
|
|
93 |
|
@return |
94 |
|
|
95 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
96 |
0 |
public boolean isSecStructServices()... |
97 |
|
{ |
98 |
0 |
return secStructServices; |
99 |
|
} |
100 |
|
|
101 |
|
|
102 |
|
|
103 |
|
|
104 |
|
@param |
105 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
106 |
127 |
public void setSecStructServices(boolean secStructServices)... |
107 |
|
{ |
108 |
127 |
this.secStructServices = secStructServices; |
109 |
|
} |
110 |
|
|
111 |
|
|
112 |
|
|
113 |
|
|
114 |
|
@return |
115 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
116 |
0 |
public boolean isAddTempFacAnnot()... |
117 |
|
{ |
118 |
0 |
return addTempFacAnnot; |
119 |
|
} |
120 |
|
|
121 |
|
|
122 |
|
|
123 |
|
|
124 |
|
@param |
125 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
126 |
129 |
public void setAddTempFacAnnot(boolean addTempFacAnnot)... |
127 |
|
{ |
128 |
129 |
this.addTempFacAnnot = addTempFacAnnot; |
129 |
|
} |
130 |
|
|
131 |
|
|
132 |
|
|
133 |
|
@return |
134 |
|
|
135 |
|
|
136 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
137 |
0 |
public boolean isProcessSecondaryStructure()... |
138 |
|
{ |
139 |
0 |
return processSecondaryStructure; |
140 |
|
} |
141 |
|
|
142 |
|
|
143 |
|
|
144 |
|
|
145 |
|
|
146 |
|
@param |
147 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
148 |
129 |
public void setProcessSecondaryStructure(boolean enable)... |
149 |
|
{ |
150 |
129 |
processSecondaryStructure = enable; |
151 |
|
} |
152 |
|
|
153 |
|
|
154 |
|
|
155 |
|
|
|
|
| 0% |
Uncovered Elements: 8 (8) |
Complexity: 2 |
Complexity Density: 0.33 |
|
156 |
0 |
public void reportMapping()... |
157 |
|
{ |
158 |
0 |
if (mappings.isEmpty()) |
159 |
|
{ |
160 |
0 |
jalview.bin.Console |
161 |
|
.errPrintln("reportMapping: No PDB/Sequence mappings."); |
162 |
|
} |
163 |
|
else |
164 |
|
{ |
165 |
0 |
jalview.bin.Console.errPrintln( |
166 |
|
"reportMapping: There are " + mappings.size() + " mappings."); |
167 |
0 |
int i = 0; |
168 |
0 |
for (StructureMapping sm : mappings) |
169 |
|
{ |
170 |
0 |
jalview.bin.Console |
171 |
|
.errPrintln("mapping " + i++ + " : " + sm.pdbfile); |
172 |
|
} |
173 |
|
} |
174 |
|
} |
175 |
|
|
176 |
|
|
177 |
|
|
178 |
|
|
179 |
|
|
180 |
|
Map<String, String> pdbIdFileName = new HashMap<>(); |
181 |
|
|
182 |
|
Map<String, String> pdbFileNameId = new HashMap<>(); |
183 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
184 |
277 |
public void registerPDBFile(String idForFile, String absoluteFile)... |
185 |
|
{ |
186 |
277 |
pdbIdFileName.put(idForFile, absoluteFile); |
187 |
277 |
pdbFileNameId.put(absoluteFile, idForFile); |
188 |
|
} |
189 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
190 |
254 |
public String findIdForPDBFile(String idOrFile)... |
191 |
|
{ |
192 |
254 |
String id = pdbFileNameId.get(idOrFile); |
193 |
254 |
return id; |
194 |
|
} |
195 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
196 |
1 |
public String findFileForPDBId(String idOrFile)... |
197 |
|
{ |
198 |
1 |
String id = pdbIdFileName.get(idOrFile); |
199 |
1 |
return id; |
200 |
|
} |
201 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
202 |
135 |
public boolean isPDBFileRegistered(String idOrFile)... |
203 |
|
{ |
204 |
135 |
return pdbFileNameId.containsKey(idOrFile) |
205 |
|
|| pdbIdFileName.containsKey(idOrFile); |
206 |
|
} |
207 |
|
|
208 |
|
private static StructureSelectionManager nullProvider = null; |
209 |
|
|
|
|
| 92.6% |
Uncovered Elements: 2 (27) |
Complexity: 7 |
Complexity Density: 0.47 |
|
210 |
5146 |
public static StructureSelectionManager getStructureSelectionManager(... |
211 |
|
StructureSelectionManagerProvider context) |
212 |
|
{ |
213 |
5146 |
if (context == null) |
214 |
|
{ |
215 |
508 |
if (nullProvider == null) |
216 |
|
{ |
217 |
47 |
if (instances != null) |
218 |
|
{ |
219 |
0 |
throw new Error(MessageManager.getString( |
220 |
|
"error.implementation_error_structure_selection_manager_null"), |
221 |
|
new NullPointerException(MessageManager |
222 |
|
.getString("exception.ssm_context_is_null"))); |
223 |
|
} |
224 |
|
else |
225 |
|
{ |
226 |
47 |
nullProvider = new StructureSelectionManager(); |
227 |
|
} |
228 |
47 |
return nullProvider; |
229 |
|
} |
230 |
|
} |
231 |
5099 |
if (instances == null) |
232 |
|
{ |
233 |
54 |
instances = new java.util.IdentityHashMap<>(); |
234 |
|
} |
235 |
5099 |
StructureSelectionManager instance = instances.get(context); |
236 |
5099 |
if (instance == null) |
237 |
|
{ |
238 |
122 |
if (nullProvider != null) |
239 |
|
{ |
240 |
115 |
instance = nullProvider; |
241 |
|
} |
242 |
|
else |
243 |
|
{ |
244 |
7 |
instance = new StructureSelectionManager(); |
245 |
|
} |
246 |
122 |
instances.put(context, instance); |
247 |
|
} |
248 |
5099 |
return instance; |
249 |
|
} |
250 |
|
|
251 |
|
|
252 |
|
|
253 |
|
|
254 |
|
|
255 |
|
boolean relaySeqMappings = true; |
256 |
|
|
257 |
|
|
258 |
|
|
259 |
|
|
260 |
|
|
261 |
|
|
262 |
|
@param |
263 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
264 |
0 |
public void setRelaySeqMappings(boolean relay)... |
265 |
|
{ |
266 |
0 |
relaySeqMappings = relay; |
267 |
|
} |
268 |
|
|
269 |
|
|
270 |
|
|
271 |
|
|
272 |
|
@return |
273 |
|
|
274 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
275 |
0 |
public boolean isRelaySeqMappingsEnabled()... |
276 |
|
{ |
277 |
0 |
return relaySeqMappings; |
278 |
|
} |
279 |
|
|
280 |
|
Vector listeners = new Vector(); |
281 |
|
|
282 |
|
|
283 |
|
|
284 |
|
|
285 |
|
@param |
286 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
287 |
525 |
public void addStructureViewerListener(Object svl)... |
288 |
|
{ |
289 |
525 |
if (!listeners.contains(svl)) |
290 |
|
{ |
291 |
523 |
listeners.addElement(svl); |
292 |
|
} |
293 |
|
} |
294 |
|
|
295 |
|
|
296 |
|
|
297 |
|
|
298 |
|
|
299 |
|
@param |
300 |
|
@return |
301 |
|
|
|
|
| 66.7% |
Uncovered Elements: 2 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
302 |
1 |
public String alreadyMappedToFile(String pdbid)... |
303 |
|
{ |
304 |
1 |
for (StructureMapping sm : mappings) |
305 |
|
{ |
306 |
1 |
if (sm.getPdbId().equalsIgnoreCase(pdbid)) |
307 |
|
{ |
308 |
0 |
return sm.pdbfile; |
309 |
|
} |
310 |
|
} |
311 |
1 |
return null; |
312 |
|
} |
313 |
|
|
314 |
|
|
315 |
|
|
316 |
|
|
317 |
|
|
318 |
|
@param |
319 |
|
|
320 |
|
@param |
321 |
|
|
322 |
|
|
323 |
|
@param |
324 |
|
|
325 |
|
@param |
326 |
|
|
327 |
|
@return |
328 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
329 |
90 |
synchronized public StructureFile setMapping(SequenceI[] sequence,... |
330 |
|
String[] targetChains, String pdbFile, DataSourceType protocol, |
331 |
|
IProgressIndicator progress) |
332 |
|
{ |
333 |
90 |
return computeMapping(true, sequence, targetChains, pdbFile, protocol, |
334 |
|
progress, null, null, true); |
335 |
|
} |
336 |
|
|
337 |
|
|
338 |
|
|
339 |
|
|
340 |
|
|
341 |
|
|
342 |
|
@param |
343 |
|
|
344 |
|
@param |
345 |
|
|
346 |
|
@param |
347 |
|
|
348 |
|
|
349 |
|
@param |
350 |
|
|
351 |
|
@param |
352 |
|
|
353 |
|
@return |
354 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
355 |
3 |
synchronized public StructureFile setMapping(boolean forStructureView,... |
356 |
|
SequenceI[] sequenceArray, String[] targetChainIds, |
357 |
|
String pdbFile, DataSourceType sourceType, TFType tft, |
358 |
|
String paeFilename) |
359 |
|
{ |
360 |
3 |
return setMapping(forStructureView, sequenceArray, targetChainIds, |
361 |
|
pdbFile, sourceType, tft, paeFilename, true); |
362 |
|
} |
363 |
|
|
364 |
|
|
365 |
|
|
366 |
|
|
367 |
|
|
368 |
|
|
369 |
|
@param |
370 |
|
|
371 |
|
|
372 |
|
@param |
373 |
|
|
374 |
|
@param |
375 |
|
|
376 |
|
|
377 |
|
|
378 |
|
|
379 |
|
@param |
380 |
|
|
381 |
|
@param |
382 |
|
|
383 |
|
@param |
384 |
|
|
385 |
|
|
386 |
|
@param |
387 |
|
|
388 |
|
|
389 |
|
@param |
390 |
|
|
391 |
|
|
392 |
|
@return |
393 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
394 |
58 |
synchronized public StructureFile setMapping(boolean forStructureView,... |
395 |
|
SequenceI[] sequenceArray, String[] targetChainIds, |
396 |
|
String pdbFile, DataSourceType sourceType, TFType tft, |
397 |
|
String paeFilename, boolean doXferSettings) |
398 |
|
{ |
399 |
58 |
return computeMapping(forStructureView, sequenceArray, targetChainIds, |
400 |
|
pdbFile, sourceType, null, tft, paeFilename, doXferSettings); |
401 |
|
} |
402 |
|
|
403 |
|
|
404 |
|
|
405 |
|
|
406 |
|
|
407 |
|
|
408 |
|
@param |
409 |
|
|
410 |
|
|
411 |
|
@param |
412 |
|
|
413 |
|
@param |
414 |
|
|
415 |
|
|
416 |
|
|
417 |
|
|
418 |
|
@param |
419 |
|
|
420 |
|
@param |
421 |
|
|
422 |
|
@param |
423 |
|
|
424 |
|
|
425 |
|
@param |
426 |
|
|
427 |
|
|
428 |
|
@param |
429 |
|
|
430 |
|
|
431 |
|
@param |
432 |
|
|
433 |
|
|
434 |
|
@return |
435 |
|
|
|
|
| 61.4% |
Uncovered Elements: 64 (166) |
Complexity: 38 |
Complexity Density: 0.31 |
|
436 |
150 |
synchronized public StructureFile computeMapping(boolean forStructureView,... |
437 |
|
SequenceI[] sequenceArray, String[] targetChainIds, |
438 |
|
String pdbFile, DataSourceType sourceType, |
439 |
|
IProgressIndicator progress, TFType tft, String paeFilename, |
440 |
|
boolean doXferSettings) |
441 |
|
{ |
442 |
150 |
long progressSessionId = System.currentTimeMillis() * 3; |
443 |
|
|
444 |
|
|
445 |
|
|
446 |
|
|
447 |
|
|
448 |
|
|
449 |
150 |
boolean parseSecStr = processSecondaryStructure |
450 |
|
&& !isStructureFileProcessed(pdbFile, sequenceArray); |
451 |
|
|
452 |
150 |
StructureFile pdb = null; |
453 |
150 |
boolean isMapUsingSIFTs = SiftsSettings.isMapWithSifts(); |
454 |
150 |
try |
455 |
|
{ |
456 |
|
|
457 |
150 |
sourceType = AppletFormatAdapter.checkProtocol(pdbFile); |
458 |
150 |
pdb = new JmolParser(false, pdbFile, sourceType); |
459 |
150 |
if (paeFilename != null) |
460 |
|
{ |
461 |
36 |
pdb.setPAEMatrix(paeFilename); |
462 |
|
} |
463 |
150 |
pdb.setTemperatureFactorType(tft); |
464 |
150 |
pdb.addSettings(parseSecStr && processSecondaryStructure, |
465 |
|
parseSecStr && addTempFacAnnot, |
466 |
|
parseSecStr && secStructServices); |
467 |
|
|
468 |
150 |
boolean temp = pdb.getDoXferSettings(); |
469 |
150 |
pdb.setDoXferSettings(doXferSettings); |
470 |
150 |
pdb.doParse(); |
471 |
150 |
pdb.setDoXferSettings(temp); |
472 |
150 |
if (pdb.getId() != null && pdb.getId().trim().length() > 0 |
473 |
|
&& DataSourceType.FILE == sourceType) |
474 |
|
{ |
475 |
138 |
registerPDBFile(pdb.getId().trim(), pdbFile); |
476 |
|
} |
477 |
|
|
478 |
|
|
479 |
|
|
480 |
|
|
481 |
150 |
boolean isProtein = false; |
482 |
150 |
for (SequenceI s : sequenceArray) |
483 |
|
{ |
484 |
150 |
if (s.isProtein()) |
485 |
|
{ |
486 |
150 |
isProtein = true; |
487 |
150 |
break; |
488 |
|
} |
489 |
|
} |
490 |
150 |
isMapUsingSIFTs = isMapUsingSIFTs && pdb.isPPDBIdAvailable() |
491 |
|
&& !pdb.getId().startsWith("AF-") && isProtein; |
492 |
|
|
493 |
|
} catch (Exception ex) |
494 |
|
{ |
495 |
0 |
ex.printStackTrace(); |
496 |
0 |
return null; |
497 |
|
} |
498 |
|
|
499 |
|
|
500 |
|
|
501 |
150 |
SiftsClient siftsClient = null; |
502 |
150 |
try |
503 |
|
{ |
504 |
150 |
if (isMapUsingSIFTs) |
505 |
|
{ |
506 |
0 |
siftsClient = new SiftsClient(pdb); |
507 |
|
} |
508 |
|
} catch (SiftsException e) |
509 |
|
{ |
510 |
0 |
isMapUsingSIFTs = false; |
511 |
0 |
Console.error("SIFTS mapping failed", e); |
512 |
0 |
Console.error("Falling back on Needleman & Wunsch alignment"); |
513 |
0 |
siftsClient = null; |
514 |
|
} |
515 |
|
|
516 |
150 |
String targetChainId; |
517 |
345 |
for (int s = 0; s < sequenceArray.length; s++) |
518 |
|
{ |
519 |
195 |
boolean infChain = true; |
520 |
195 |
final SequenceI seq = sequenceArray[s]; |
521 |
195 |
SequenceI ds = seq; |
522 |
388 |
while (ds.getDatasetSequence() != null) |
523 |
|
{ |
524 |
193 |
ds = ds.getDatasetSequence(); |
525 |
|
} |
526 |
|
|
527 |
195 |
if (targetChainIds != null && targetChainIds[s] != null) |
528 |
|
{ |
529 |
40 |
infChain = false; |
530 |
40 |
targetChainId = targetChainIds[s]; |
531 |
|
} |
532 |
155 |
else if (seq.getName().indexOf("|") > -1) |
533 |
|
{ |
534 |
59 |
targetChainId = seq.getName() |
535 |
|
.substring(seq.getName().lastIndexOf("|") + 1); |
536 |
59 |
if (targetChainId.length() > 1) |
537 |
|
{ |
538 |
1 |
if (targetChainId.trim().length() == 0) |
539 |
|
{ |
540 |
0 |
targetChainId = " "; |
541 |
|
} |
542 |
|
else |
543 |
|
{ |
544 |
|
|
545 |
1 |
targetChainId = ""; |
546 |
|
} |
547 |
|
} |
548 |
|
} |
549 |
|
else |
550 |
|
{ |
551 |
96 |
targetChainId = ""; |
552 |
|
} |
553 |
|
|
554 |
|
|
555 |
|
|
556 |
|
|
557 |
|
|
558 |
195 |
float max = -10; |
559 |
195 |
AlignSeq maxAlignseq = null; |
560 |
195 |
String maxChainId = " "; |
561 |
195 |
PDBChain maxChain = null; |
562 |
195 |
boolean first = true; |
563 |
195 |
for (PDBChain chain : pdb.getChains()) |
564 |
|
{ |
565 |
247 |
if (targetChainId.length() > 0 && !targetChainId.equals(chain.id) |
566 |
|
&& !infChain) |
567 |
|
{ |
568 |
16 |
continue; |
569 |
|
} |
570 |
|
|
571 |
|
|
572 |
231 |
final String type = chain.isNa ? AlignSeq.DNA : AlignSeq.PEP; |
573 |
231 |
AlignSeq as = AlignSeq.doGlobalNWAlignment(seq, chain.sequence, |
574 |
|
type); |
575 |
|
|
576 |
|
|
577 |
|
|
578 |
|
|
579 |
|
|
580 |
231 |
if (first || as.maxscore > max |
581 |
|
|| (as.maxscore == max && chain.id.equals(targetChainId))) |
582 |
|
{ |
583 |
203 |
first = false; |
584 |
203 |
maxChain = chain; |
585 |
203 |
max = as.maxscore; |
586 |
203 |
maxAlignseq = as; |
587 |
203 |
maxChainId = chain.id; |
588 |
|
} |
589 |
|
} |
590 |
195 |
if (maxChain == null) |
591 |
|
{ |
592 |
0 |
continue; |
593 |
|
} |
594 |
|
|
595 |
195 |
if (sourceType == DataSourceType.PASTE) |
596 |
|
{ |
597 |
16 |
pdbFile = "INLINE" + pdb.getId(); |
598 |
|
} |
599 |
|
|
600 |
195 |
List<StructureMapping> seqToStrucMapping = new ArrayList<>(); |
601 |
195 |
if (isMapUsingSIFTs && seq.isProtein()) |
602 |
|
{ |
603 |
0 |
if (progress != null) |
604 |
|
{ |
605 |
0 |
progress.setProgressBar( |
606 |
|
MessageManager |
607 |
|
.getString("status.obtaining_mapping_with_sifts"), |
608 |
|
progressSessionId); |
609 |
|
} |
610 |
0 |
jalview.datamodel.Mapping sqmpping = maxAlignseq |
611 |
|
.getMappingFromS1(false); |
612 |
0 |
if (targetChainId != null && !targetChainId.trim().isEmpty()) |
613 |
|
{ |
614 |
0 |
StructureMapping siftsMapping; |
615 |
0 |
try |
616 |
|
{ |
617 |
0 |
siftsMapping = getStructureMapping(seq, pdbFile, targetChainId, |
618 |
|
pdb, maxChain, sqmpping, maxAlignseq, siftsClient); |
619 |
0 |
seqToStrucMapping.add(siftsMapping); |
620 |
0 |
maxChain.makeExactMapping(siftsMapping, seq); |
621 |
0 |
maxChain.transferRESNUMFeatures(seq, "IEA: SIFTS", |
622 |
|
pdb.getId().toLowerCase(Locale.ROOT)); |
623 |
0 |
maxChain.transferResidueAnnotation(siftsMapping, null); |
624 |
0 |
ds.addPDBId(maxChain.sequence.getAllPDBEntries().get(0)); |
625 |
|
|
626 |
|
} catch (SiftsException e) |
627 |
|
{ |
628 |
|
|
629 |
0 |
Console.error(e.getMessage()); |
630 |
0 |
StructureMapping nwMapping = getNWMappings(seq, pdbFile, |
631 |
|
targetChainId, maxChain, pdb, maxAlignseq); |
632 |
0 |
seqToStrucMapping.add(nwMapping); |
633 |
0 |
maxChain.makeExactMapping(maxAlignseq, seq); |
634 |
0 |
maxChain.transferRESNUMFeatures(seq, "IEA:Jalview", |
635 |
|
pdb.getId().toLowerCase(Locale.ROOT)); |
636 |
|
|
637 |
|
|
638 |
0 |
maxChain.transferResidueAnnotation(nwMapping, sqmpping); |
639 |
0 |
ds.addPDBId(maxChain.sequence.getAllPDBEntries().get(0)); |
640 |
|
} |
641 |
|
} |
642 |
|
else |
643 |
|
{ |
644 |
0 |
List<StructureMapping> foundSiftsMappings = new ArrayList<>(); |
645 |
0 |
for (PDBChain chain : pdb.getChains()) |
646 |
|
{ |
647 |
0 |
StructureMapping siftsMapping = null; |
648 |
0 |
try |
649 |
|
{ |
650 |
0 |
siftsMapping = getStructureMapping(seq, pdbFile, chain.id, |
651 |
|
pdb, chain, sqmpping, maxAlignseq, siftsClient); |
652 |
0 |
foundSiftsMappings.add(siftsMapping); |
653 |
0 |
chain.makeExactMapping(siftsMapping, seq); |
654 |
0 |
chain.transferRESNUMFeatures(seq, "IEA: SIFTS", |
655 |
|
pdb.getId().toLowerCase(Locale.ROOT)); |
656 |
|
|
657 |
0 |
chain.transferResidueAnnotation(siftsMapping, null); |
658 |
|
} catch (SiftsException e) |
659 |
|
{ |
660 |
0 |
jalview.bin.Console.errPrintln(e.getMessage()); |
661 |
|
} catch (Exception e) |
662 |
|
{ |
663 |
0 |
jalview.bin.Console.errPrintln( |
664 |
|
"Unexpected exception during SIFTS mapping - falling back to NW for this sequence/structure pair"); |
665 |
0 |
jalview.bin.Console.errPrintln(e.getMessage()); |
666 |
|
} |
667 |
|
} |
668 |
0 |
if (!foundSiftsMappings.isEmpty()) |
669 |
|
{ |
670 |
0 |
seqToStrucMapping.addAll(foundSiftsMappings); |
671 |
0 |
ds.addPDBId(sqmpping.getTo().getAllPDBEntries().get(0)); |
672 |
|
} |
673 |
|
else |
674 |
|
{ |
675 |
0 |
StructureMapping nwMapping = getNWMappings(seq, pdbFile, |
676 |
|
maxChainId, maxChain, pdb, maxAlignseq); |
677 |
0 |
seqToStrucMapping.add(nwMapping); |
678 |
0 |
maxChain.transferRESNUMFeatures(seq, null, |
679 |
|
pdb.getId().toLowerCase(Locale.ROOT)); |
680 |
|
|
681 |
0 |
maxChain.transferResidueAnnotation(nwMapping, sqmpping); |
682 |
0 |
ds.addPDBId(maxChain.sequence.getAllPDBEntries().get(0)); |
683 |
|
} |
684 |
|
} |
685 |
|
} |
686 |
|
else |
687 |
|
{ |
688 |
195 |
if (progress != null) |
689 |
|
{ |
690 |
0 |
progress.setProgressBar( |
691 |
|
MessageManager.getString( |
692 |
|
"status.obtaining_mapping_with_nw_alignment"), |
693 |
|
progressSessionId); |
694 |
|
} |
695 |
195 |
StructureMapping nwMapping = getNWMappings(seq, pdbFile, maxChainId, |
696 |
|
maxChain, pdb, maxAlignseq); |
697 |
195 |
seqToStrucMapping.add(nwMapping); |
698 |
195 |
ds.addPDBId(maxChain.sequence.getAllPDBEntries().get(0)); |
699 |
|
} |
700 |
195 |
if (forStructureView) |
701 |
|
{ |
702 |
138 |
for (StructureMapping sm : seqToStrucMapping) |
703 |
|
{ |
704 |
138 |
addStructureMapping(sm); |
705 |
|
} |
706 |
|
} |
707 |
195 |
if (progress != null) |
708 |
|
{ |
709 |
0 |
progress.setProgressBar(null, progressSessionId); |
710 |
|
} |
711 |
|
} |
712 |
150 |
return pdb; |
713 |
|
} |
714 |
|
|
715 |
|
|
716 |
|
|
717 |
|
|
718 |
|
|
719 |
|
@param |
720 |
|
@param |
721 |
|
@return |
722 |
|
|
|
|
| 90% |
Uncovered Elements: 2 (20) |
Complexity: 5 |
Complexity Density: 0.42 |
|
723 |
135 |
private boolean isStructureFileProcessed(String pdbFile,... |
724 |
|
SequenceI[] sequenceArray) |
725 |
|
{ |
726 |
135 |
boolean processed = false; |
727 |
135 |
if (isPDBFileRegistered(pdbFile)) |
728 |
|
{ |
729 |
84 |
for (SequenceI sq : sequenceArray) |
730 |
|
{ |
731 |
125 |
SequenceI ds = sq; |
732 |
250 |
while (ds.getDatasetSequence() != null) |
733 |
|
{ |
734 |
125 |
ds = ds.getDatasetSequence(); |
735 |
|
} |
736 |
125 |
; |
737 |
125 |
if (ds.getAnnotation() != null) |
738 |
|
{ |
739 |
103 |
for (AlignmentAnnotation ala : ds.getAnnotation()) |
740 |
|
{ |
741 |
|
|
742 |
|
|
743 |
|
|
744 |
254 |
if (PDBfile.isCalcIdForFile(ala, findIdForPDBFile(pdbFile))) |
745 |
|
{ |
746 |
0 |
processed = true; |
747 |
|
} |
748 |
|
} |
749 |
|
} |
750 |
|
} |
751 |
|
} |
752 |
135 |
return processed; |
753 |
|
} |
754 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
755 |
145 |
public void addStructureMapping(StructureMapping sm)... |
756 |
|
{ |
757 |
145 |
if (!mappings.contains(sm)) |
758 |
|
{ |
759 |
78 |
mappings.add(sm); |
760 |
|
} |
761 |
|
} |
762 |
|
|
763 |
|
|
764 |
|
|
765 |
|
|
766 |
|
|
767 |
|
@param |
768 |
|
@param |
769 |
|
@param |
770 |
|
@param |
771 |
|
@param |
772 |
|
@param |
773 |
|
@param |
774 |
|
@param |
775 |
|
|
776 |
|
@return |
777 |
|
@throws |
778 |
|
|
|
|
| 0% |
Uncovered Elements: 9 (9) |
Complexity: 3 |
Complexity Density: 0.43 |
|
779 |
0 |
private StructureMapping getStructureMapping(SequenceI seq,... |
780 |
|
String pdbFile, String targetChainId, StructureFile pdb, |
781 |
|
PDBChain maxChain, jalview.datamodel.Mapping sqmpping, |
782 |
|
AlignSeq maxAlignseq, SiftsClient siftsClient) |
783 |
|
throws SiftsException |
784 |
|
{ |
785 |
0 |
StructureMapping curChainMapping = siftsClient |
786 |
|
.getSiftsStructureMapping(seq, pdbFile, targetChainId); |
787 |
0 |
try |
788 |
|
{ |
789 |
0 |
PDBChain chain = pdb.findChain(targetChainId); |
790 |
0 |
if (chain != null) |
791 |
|
{ |
792 |
0 |
chain.transferResidueAnnotation(curChainMapping, null); |
793 |
|
} |
794 |
|
} catch (Exception e) |
795 |
|
{ |
796 |
0 |
e.printStackTrace(); |
797 |
|
} |
798 |
0 |
return curChainMapping; |
799 |
|
} |
800 |
|
|
|
|
| 97.4% |
Uncovered Elements: 1 (39) |
Complexity: 6 |
Complexity Density: 0.18 |
|
801 |
195 |
private StructureMapping getNWMappings(SequenceI seq, String pdbFile,... |
802 |
|
String maxChainId, PDBChain maxChain, StructureFile pdb, |
803 |
|
AlignSeq maxAlignseq) |
804 |
|
{ |
805 |
195 |
final StringBuilder mappingDetails = new StringBuilder(128); |
806 |
195 |
mappingDetails.append(NEWLINE) |
807 |
|
.append("Sequence \u27f7 Structure mapping details"); |
808 |
195 |
mappingDetails.append(NEWLINE); |
809 |
195 |
mappingDetails |
810 |
|
.append("Method: inferred with Needleman & Wunsch alignment"); |
811 |
195 |
mappingDetails.append(NEWLINE).append("PDB Sequence is :") |
812 |
|
.append(NEWLINE).append("Sequence = ") |
813 |
|
.append(maxChain.sequence.getSequenceAsString()); |
814 |
195 |
mappingDetails.append(NEWLINE).append("No of residues = ") |
815 |
|
.append(maxChain.residues.size()).append(NEWLINE) |
816 |
|
.append(NEWLINE); |
817 |
195 |
PrintStream ps = new PrintStream(System.out) |
818 |
|
{ |
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
819 |
195 |
@Override... |
820 |
|
public void print(String x) |
821 |
|
{ |
822 |
195 |
mappingDetails.append(x); |
823 |
|
} |
824 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
825 |
0 |
@Override... |
826 |
|
public void println() |
827 |
|
{ |
828 |
0 |
mappingDetails.append(NEWLINE); |
829 |
|
} |
830 |
|
}; |
831 |
|
|
832 |
195 |
maxAlignseq.printAlignment(ps); |
833 |
|
|
834 |
195 |
mappingDetails.append(NEWLINE).append("PDB start/end "); |
835 |
195 |
mappingDetails.append(String.valueOf(maxAlignseq.seq2start)) |
836 |
|
.append(" "); |
837 |
195 |
mappingDetails.append(String.valueOf(maxAlignseq.seq2end)); |
838 |
195 |
mappingDetails.append(NEWLINE).append("SEQ start/end "); |
839 |
195 |
mappingDetails |
840 |
|
.append(String |
841 |
|
.valueOf(maxAlignseq.seq1start + (seq.getStart() - 1))) |
842 |
|
.append(" "); |
843 |
195 |
mappingDetails.append( |
844 |
|
String.valueOf(maxAlignseq.seq1end + (seq.getStart() - 1))); |
845 |
195 |
mappingDetails.append(NEWLINE); |
846 |
195 |
maxChain.makeExactMapping(maxAlignseq, seq); |
847 |
195 |
jalview.datamodel.Mapping sqmpping = maxAlignseq |
848 |
|
.getMappingFromS1(false); |
849 |
195 |
maxChain.transferRESNUMFeatures(seq, null, |
850 |
|
pdb.getId().toLowerCase(Locale.ROOT)); |
851 |
|
|
852 |
195 |
HashMap<Integer, int[]> mapping = new HashMap<>(); |
853 |
195 |
int resNum = -10000; |
854 |
195 |
int index = 0; |
855 |
195 |
char insCode = ' '; |
856 |
|
|
857 |
195 |
do |
858 |
|
{ |
859 |
21404 |
Atom tmp = maxChain.atoms.elementAt(index); |
860 |
21404 |
if ((resNum != tmp.resNumber || insCode != tmp.insCode) |
861 |
|
&& tmp.alignmentMapping != -1) |
862 |
|
{ |
863 |
21354 |
resNum = tmp.resNumber; |
864 |
21354 |
insCode = tmp.insCode; |
865 |
21354 |
if (tmp.alignmentMapping >= -1) |
866 |
|
{ |
867 |
21354 |
mapping.put(tmp.alignmentMapping + 1, |
868 |
|
new int[] |
869 |
|
{ tmp.resNumber, tmp.atomIndex }); |
870 |
|
} |
871 |
|
} |
872 |
|
|
873 |
21404 |
index++; |
874 |
21404 |
} while (index < maxChain.atoms.size()); |
875 |
|
|
876 |
195 |
StructureMapping nwMapping = new StructureMapping(seq, pdbFile, |
877 |
|
pdb.getId(), maxChainId, mapping, mappingDetails.toString()); |
878 |
195 |
maxChain.transferResidueAnnotation(nwMapping, sqmpping); |
879 |
195 |
return nwMapping; |
880 |
|
} |
881 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (36) |
Complexity: 9 |
Complexity Density: 0.45 |
|
882 |
529 |
public void removeStructureViewerListener(Object svl, String[] pdbfiles)... |
883 |
|
{ |
884 |
529 |
listeners.removeElement(svl); |
885 |
529 |
if (svl instanceof SequenceListener) |
886 |
|
{ |
887 |
1330 |
for (int i = 0; i < listeners.size(); i++) |
888 |
|
{ |
889 |
824 |
if (listeners.elementAt(i) instanceof StructureListener) |
890 |
|
{ |
891 |
42 |
((StructureListener) listeners.elementAt(i)) |
892 |
|
.releaseReferences(svl); |
893 |
|
} |
894 |
|
} |
895 |
|
} |
896 |
|
|
897 |
529 |
if (pdbfiles == null) |
898 |
|
{ |
899 |
506 |
return; |
900 |
|
} |
901 |
|
|
902 |
|
|
903 |
|
|
904 |
|
|
905 |
|
|
906 |
23 |
List<String> pdbs = new ArrayList<>(Arrays.asList(pdbfiles)); |
907 |
|
|
908 |
23 |
StructureListener sl; |
909 |
76 |
for (int i = 0; i < listeners.size(); i++) |
910 |
|
{ |
911 |
53 |
if (listeners.elementAt(i) instanceof StructureListener) |
912 |
|
{ |
913 |
6 |
sl = (StructureListener) listeners.elementAt(i); |
914 |
6 |
for (String pdbfile : sl.getStructureFiles()) |
915 |
|
{ |
916 |
7 |
pdbs.remove(pdbfile); |
917 |
|
} |
918 |
|
} |
919 |
|
} |
920 |
|
|
921 |
|
|
922 |
|
|
923 |
|
|
924 |
|
|
925 |
23 |
if (pdbs.size() > 0) |
926 |
|
{ |
927 |
22 |
List<StructureMapping> tmp = new ArrayList<>(); |
928 |
22 |
for (StructureMapping sm : mappings) |
929 |
|
{ |
930 |
37 |
if (!pdbs.contains(sm.pdbfile)) |
931 |
|
{ |
932 |
7 |
tmp.add(sm); |
933 |
|
} |
934 |
|
} |
935 |
|
|
936 |
22 |
mappings = tmp; |
937 |
|
} |
938 |
|
} |
939 |
|
|
940 |
|
|
941 |
|
|
942 |
|
|
943 |
|
@param |
944 |
|
@param |
945 |
|
|
946 |
|
@param |
947 |
|
@param |
948 |
|
|
|
|
| 0% |
Uncovered Elements: 24 (24) |
Complexity: 5 |
Complexity Density: 0.31 |
|
949 |
0 |
public void highlightPositionsOn(SequenceI sequenceRef, int[][] is,... |
950 |
|
Object source) |
951 |
|
{ |
952 |
0 |
boolean hasSequenceListeners = handlingVamsasMo |
953 |
|
|| !seqmappings.isEmpty(); |
954 |
0 |
SearchResultsI results = null; |
955 |
0 |
ArrayList<Integer> listOfPositions = new ArrayList<Integer>(); |
956 |
0 |
for (int[] s_e : is) |
957 |
|
{ |
958 |
0 |
for (int p = s_e[0]; p <= s_e[1]; listOfPositions.add(p++)) |
959 |
0 |
; |
960 |
|
} |
961 |
0 |
int seqpos[] = new int[listOfPositions.size()]; |
962 |
0 |
int i = 0; |
963 |
0 |
for (Integer p : listOfPositions) |
964 |
|
{ |
965 |
0 |
seqpos[i++] = p; |
966 |
|
} |
967 |
|
|
968 |
0 |
for (i = 0; i < listeners.size(); i++) |
969 |
|
{ |
970 |
0 |
Object listener = listeners.elementAt(i); |
971 |
0 |
if (listener == source) |
972 |
|
{ |
973 |
|
|
974 |
|
|
975 |
0 |
continue; |
976 |
|
} |
977 |
0 |
if (listener instanceof StructureListener) |
978 |
|
{ |
979 |
0 |
highlightStructure((StructureListener) listener, sequenceRef, |
980 |
|
seqpos); |
981 |
|
} |
982 |
|
|
983 |
|
} |
984 |
|
} |
985 |
|
|
986 |
|
|
987 |
|
|
988 |
|
|
989 |
|
@param |
990 |
|
@param |
991 |
|
@param |
992 |
|
@return |
993 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
994 |
1 |
public String mouseOverStructure(int pdbResNum, String chain,... |
995 |
|
String pdbfile) |
996 |
|
{ |
997 |
1 |
AtomSpec atomSpec = new AtomSpec(pdbfile, chain, pdbResNum, 0); |
998 |
1 |
List<AtomSpec> atoms = Collections.singletonList(atomSpec); |
999 |
1 |
return mouseOverStructure(atoms); |
1000 |
|
} |
1001 |
|
|
1002 |
|
|
1003 |
|
|
1004 |
|
|
1005 |
|
@param |
1006 |
|
|
|
|
| 78.6% |
Uncovered Elements: 6 (28) |
Complexity: 7 |
Complexity Density: 0.44 |
|
1007 |
1 |
public String mouseOverStructure(List<AtomSpec> atoms)... |
1008 |
|
{ |
1009 |
1 |
if (listeners == null) |
1010 |
|
{ |
1011 |
|
|
1012 |
0 |
return null; |
1013 |
|
} |
1014 |
1 |
boolean hasSequenceListener = false; |
1015 |
3 |
for (int i = 0; i < listeners.size(); i++) |
1016 |
|
{ |
1017 |
2 |
if (listeners.elementAt(i) instanceof SequenceListener) |
1018 |
|
{ |
1019 |
1 |
hasSequenceListener = true; |
1020 |
|
} |
1021 |
|
} |
1022 |
1 |
if (!hasSequenceListener) |
1023 |
|
{ |
1024 |
0 |
return null; |
1025 |
|
} |
1026 |
|
|
1027 |
1 |
SearchResultsI results = findAlignmentPositionsForStructurePositions( |
1028 |
|
atoms); |
1029 |
1 |
String result = null; |
1030 |
1 |
for (Object li : listeners) |
1031 |
|
{ |
1032 |
2 |
if (li instanceof SequenceListener) |
1033 |
|
{ |
1034 |
1 |
String s = ((SequenceListener) li).highlightSequence(results); |
1035 |
1 |
if (s != null) |
1036 |
|
{ |
1037 |
0 |
result = s; |
1038 |
|
} |
1039 |
|
} |
1040 |
|
} |
1041 |
1 |
return result; |
1042 |
|
} |
1043 |
|
|
1044 |
|
|
1045 |
|
|
1046 |
|
|
1047 |
|
|
1048 |
|
|
1049 |
|
@param |
1050 |
|
@return |
1051 |
|
|
|
|
| 88.9% |
Uncovered Elements: 2 (18) |
Complexity: 5 |
Complexity Density: 0.36 |
|
1052 |
1 |
public SearchResultsI findAlignmentPositionsForStructurePositions(... |
1053 |
|
List<AtomSpec> atoms) |
1054 |
|
{ |
1055 |
1 |
SearchResultsI results = new SearchResults(); |
1056 |
1 |
for (AtomSpec atom : atoms) |
1057 |
|
{ |
1058 |
1 |
SequenceI lastseq = null; |
1059 |
1 |
int lastipos = -1; |
1060 |
1 |
for (StructureMapping sm : mappings) |
1061 |
|
{ |
1062 |
2 |
if (sm.pdbfile.equals(atom.getPdbFile()) |
1063 |
|
&& sm.pdbchain.equals(atom.getChain())) |
1064 |
|
{ |
1065 |
1 |
int indexpos = sm.getSeqPos(atom.getPdbResNum()); |
1066 |
1 |
if (lastipos != indexpos || lastseq != sm.sequence) |
1067 |
|
{ |
1068 |
1 |
results.appendResult(sm.sequence, indexpos, indexpos); |
1069 |
1 |
lastipos = indexpos; |
1070 |
1 |
lastseq = sm.sequence; |
1071 |
|
|
1072 |
1 |
for (AlignedCodonFrame acf : seqmappings) |
1073 |
|
{ |
1074 |
0 |
acf.markMappedRegion(sm.sequence, indexpos, results); |
1075 |
|
} |
1076 |
|
} |
1077 |
|
} |
1078 |
|
} |
1079 |
|
} |
1080 |
1 |
return results; |
1081 |
|
} |
1082 |
|
|
1083 |
|
|
1084 |
|
|
1085 |
|
|
1086 |
|
@param |
1087 |
|
|
1088 |
|
@param |
1089 |
|
|
1090 |
|
@param |
1091 |
|
|
1092 |
|
|
1093 |
|
|
|
|
| 0% |
Uncovered Elements: 48 (48) |
Complexity: 15 |
Complexity Density: 0.62 |
|
1094 |
0 |
public void mouseOverSequence(SequenceI seq, int indexpos, int seqPos,... |
1095 |
|
VamsasSource source) |
1096 |
|
{ |
1097 |
0 |
boolean hasSequenceListeners = handlingVamsasMo |
1098 |
|
|| !seqmappings.isEmpty(); |
1099 |
0 |
SearchResultsI results = null; |
1100 |
0 |
if (seqPos == -1) |
1101 |
|
{ |
1102 |
0 |
seqPos = seq.findPosition(indexpos); |
1103 |
|
} |
1104 |
0 |
for (int i = 0; i < listeners.size(); i++) |
1105 |
|
{ |
1106 |
0 |
Object listener = listeners.elementAt(i); |
1107 |
0 |
if (listener == source) |
1108 |
|
{ |
1109 |
|
|
1110 |
|
|
1111 |
0 |
continue; |
1112 |
|
} |
1113 |
0 |
if (listener instanceof StructureListener) |
1114 |
|
{ |
1115 |
0 |
highlightStructure((StructureListener) listener, seq, seqPos); |
1116 |
|
} |
1117 |
|
else |
1118 |
|
{ |
1119 |
0 |
if (listener instanceof SequenceListener) |
1120 |
|
{ |
1121 |
0 |
final SequenceListener seqListener = (SequenceListener) listener; |
1122 |
0 |
if (hasSequenceListeners |
1123 |
|
&& seqListener.getVamsasSource() != source) |
1124 |
|
{ |
1125 |
0 |
if (relaySeqMappings) |
1126 |
|
{ |
1127 |
0 |
if (results == null) |
1128 |
|
{ |
1129 |
0 |
results = MappingUtils.buildSearchResults(seq, seqPos, |
1130 |
|
seqmappings); |
1131 |
|
} |
1132 |
0 |
if (handlingVamsasMo) |
1133 |
|
{ |
1134 |
0 |
results.addResult(seq, seqPos, seqPos); |
1135 |
|
|
1136 |
|
} |
1137 |
0 |
if (!results.isEmpty()) |
1138 |
|
{ |
1139 |
0 |
seqListener.highlightSequence(results); |
1140 |
|
} |
1141 |
|
} |
1142 |
|
} |
1143 |
|
} |
1144 |
0 |
else if (listener instanceof VamsasListener && !handlingVamsasMo) |
1145 |
|
{ |
1146 |
0 |
((VamsasListener) listener).mouseOverSequence(seq, indexpos, |
1147 |
|
source); |
1148 |
|
} |
1149 |
0 |
else if (listener instanceof SecondaryStructureListener) |
1150 |
|
{ |
1151 |
0 |
((SecondaryStructureListener) listener).mouseOverSequence(seq, |
1152 |
|
indexpos, seqPos); |
1153 |
|
} |
1154 |
|
} |
1155 |
|
} |
1156 |
|
} |
1157 |
|
|
1158 |
|
|
1159 |
|
|
1160 |
|
|
1161 |
|
|
1162 |
|
@param |
1163 |
|
@param |
1164 |
|
@param |
1165 |
|
|
|
|
| 0% |
Uncovered Elements: 17 (17) |
Complexity: 7 |
Complexity Density: 0.64 |
|
1166 |
0 |
public void highlightStructure(StructureListener sl, SequenceI seq,... |
1167 |
|
int... positions) |
1168 |
|
{ |
1169 |
0 |
if (!sl.isListeningFor(seq)) |
1170 |
|
{ |
1171 |
0 |
return; |
1172 |
|
} |
1173 |
0 |
int atomNo; |
1174 |
0 |
List<AtomSpec> atoms = new ArrayList<>(); |
1175 |
0 |
for (StructureMapping sm : mappings) |
1176 |
|
{ |
1177 |
0 |
if (sm.sequence == seq || sm.sequence == seq.getDatasetSequence() |
1178 |
|
|| (sm.sequence.getDatasetSequence() != null && sm.sequence |
1179 |
|
.getDatasetSequence() == seq.getDatasetSequence())) |
1180 |
|
{ |
1181 |
0 |
for (int index : positions) |
1182 |
|
{ |
1183 |
0 |
atomNo = sm.getAtomNum(index); |
1184 |
|
|
1185 |
0 |
if (atomNo > 0) |
1186 |
|
{ |
1187 |
0 |
atoms.add(new AtomSpec(sm.pdbfile, sm.pdbchain, |
1188 |
|
sm.getPDBResNum(index), atomNo)); |
1189 |
|
} |
1190 |
|
} |
1191 |
|
} |
1192 |
|
} |
1193 |
0 |
sl.highlightAtoms(atoms); |
1194 |
|
} |
1195 |
|
|
|
|
| 0% |
Uncovered Elements: 37 (37) |
Complexity: 12 |
Complexity Density: 0.57 |
|
1196 |
0 |
public void highlightStructureRegionsFor(StructureListener sl,... |
1197 |
|
SequenceI[] seqs, int... columns) |
1198 |
|
{ |
1199 |
0 |
List<SequenceI> to_highlight = new ArrayList<SequenceI>(); |
1200 |
0 |
for (SequenceI seq : seqs) |
1201 |
|
{ |
1202 |
0 |
if (sl.isListeningFor(seq)) |
1203 |
|
{ |
1204 |
0 |
to_highlight.add(seq); |
1205 |
|
} |
1206 |
|
} |
1207 |
0 |
if (to_highlight.size() == 0) |
1208 |
|
{ |
1209 |
0 |
return; |
1210 |
|
} |
1211 |
0 |
List<AtomSpec> atoms = new ArrayList<>(); |
1212 |
0 |
for (SequenceI seq : to_highlight) |
1213 |
|
{ |
1214 |
0 |
int atomNo; |
1215 |
0 |
for (StructureMapping sm : mappings) |
1216 |
|
{ |
1217 |
0 |
if (sm.sequence == seq || sm.sequence == seq.getDatasetSequence() |
1218 |
|
|| (sm.sequence.getDatasetSequence() != null && sm.sequence |
1219 |
|
.getDatasetSequence() == seq.getDatasetSequence())) |
1220 |
|
{ |
1221 |
|
|
1222 |
0 |
for (int i = 0; i < columns.length; i += 2) |
1223 |
|
{ |
1224 |
0 |
ContiguousI positions = seq.findPositions(columns[i] + 1, |
1225 |
|
columns[i + 1] + 1); |
1226 |
0 |
if (positions == null) |
1227 |
|
{ |
1228 |
0 |
continue; |
1229 |
|
} |
1230 |
0 |
for (int index = positions.getBegin(); index <= positions |
1231 |
|
.getEnd(); index++) |
1232 |
|
{ |
1233 |
|
|
1234 |
0 |
atomNo = sm.getAtomNum(index); |
1235 |
|
|
1236 |
0 |
if (atomNo > 0) |
1237 |
|
{ |
1238 |
0 |
atoms.add(new AtomSpec(sm.pdbfile, sm.pdbchain, |
1239 |
|
sm.getPDBResNum(index), atomNo)); |
1240 |
|
} |
1241 |
|
} |
1242 |
|
} |
1243 |
|
} |
1244 |
|
} |
1245 |
0 |
if (atoms.size() > 0) |
1246 |
|
{ |
1247 |
0 |
sl.highlightAtoms(atoms); |
1248 |
|
} |
1249 |
|
} |
1250 |
|
} |
1251 |
|
|
1252 |
|
|
1253 |
|
|
1254 |
|
|
1255 |
|
|
1256 |
|
boolean handlingVamsasMo = false; |
1257 |
|
|
1258 |
|
long lastmsg = 0; |
1259 |
|
|
1260 |
|
|
1261 |
|
|
1262 |
|
|
1263 |
|
@param |
1264 |
|
@param |
1265 |
|
|
1266 |
|
|
|
|
| 0% |
Uncovered Elements: 8 (8) |
Complexity: 2 |
Complexity Density: 0.33 |
|
1267 |
0 |
public void mouseOverVamsasSequence(SequenceI sequenceI, int position,... |
1268 |
|
VamsasSource source) |
1269 |
|
{ |
1270 |
0 |
handlingVamsasMo = true; |
1271 |
0 |
long msg = sequenceI.hashCode() * (1 + position); |
1272 |
0 |
if (lastmsg != msg) |
1273 |
|
{ |
1274 |
0 |
lastmsg = msg; |
1275 |
0 |
mouseOverSequence(sequenceI, position, -1, source); |
1276 |
|
} |
1277 |
0 |
handlingVamsasMo = false; |
1278 |
|
} |
1279 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1280 |
0 |
public Annotation[] colourSequenceFromStructure(SequenceI seq,... |
1281 |
|
String pdbid) |
1282 |
|
{ |
1283 |
0 |
return null; |
1284 |
|
|
1285 |
|
|
1286 |
|
|
1287 |
|
|
1288 |
|
|
1289 |
|
|
1290 |
|
|
1291 |
|
|
1292 |
|
|
1293 |
|
|
1294 |
|
|
1295 |
|
|
1296 |
|
|
1297 |
|
|
1298 |
|
|
1299 |
|
|
1300 |
|
|
1301 |
|
|
1302 |
|
|
1303 |
|
|
1304 |
|
|
1305 |
|
|
1306 |
|
|
1307 |
|
|
1308 |
|
|
1309 |
|
|
1310 |
|
|
1311 |
|
|
1312 |
|
|
1313 |
|
} |
1314 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
1315 |
0 |
public void structureSelectionChanged()... |
1316 |
|
{ |
1317 |
|
} |
1318 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
1319 |
0 |
public void sequenceSelectionChanged()... |
1320 |
|
{ |
1321 |
|
} |
1322 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (9) |
Complexity: 3 |
Complexity Density: 0.6 |
|
1323 |
2733 |
public void sequenceColoursChanged(Object source)... |
1324 |
|
{ |
1325 |
2733 |
StructureListener sl; |
1326 |
12656 |
for (int i = 0; i < listeners.size(); i++) |
1327 |
|
{ |
1328 |
9923 |
if (listeners.elementAt(i) instanceof StructureListener) |
1329 |
|
{ |
1330 |
891 |
sl = (StructureListener) listeners.elementAt(i); |
1331 |
891 |
sl.updateColours(source); |
1332 |
|
} |
1333 |
|
} |
1334 |
|
} |
1335 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
1336 |
622 |
public StructureMapping[] getMapping(String pdbfile)... |
1337 |
|
{ |
1338 |
622 |
List<StructureMapping> tmp = new ArrayList<>(); |
1339 |
622 |
for (StructureMapping sm : mappings) |
1340 |
|
{ |
1341 |
641 |
if (sm.pdbfile.equals(pdbfile)) |
1342 |
|
{ |
1343 |
446 |
tmp.add(sm); |
1344 |
|
} |
1345 |
|
} |
1346 |
622 |
return tmp.toArray(new StructureMapping[tmp.size()]); |
1347 |
|
} |
1348 |
|
|
1349 |
|
|
1350 |
|
|
1351 |
|
|
1352 |
|
|
1353 |
|
@param |
1354 |
|
@param |
1355 |
|
@return |
1356 |
|
|
|
|
| 0% |
Uncovered Elements: 15 (15) |
Complexity: 6 |
Complexity Density: 0.55 |
|
1357 |
0 |
public String printMappings(String pdbfile, List<SequenceI> seqs)... |
1358 |
|
{ |
1359 |
0 |
if (pdbfile == null || seqs == null || seqs.isEmpty()) |
1360 |
|
{ |
1361 |
0 |
return ""; |
1362 |
|
} |
1363 |
|
|
1364 |
0 |
StringBuilder sb = new StringBuilder(64); |
1365 |
0 |
for (StructureMapping sm : mappings) |
1366 |
|
{ |
1367 |
0 |
if (Platform.pathEquals(sm.pdbfile, pdbfile) |
1368 |
|
&& seqs.contains(sm.sequence)) |
1369 |
|
{ |
1370 |
0 |
sb.append(sm.mappingDetails); |
1371 |
0 |
sb.append(NEWLINE); |
1372 |
|
|
1373 |
0 |
sb.append("====================="); |
1374 |
0 |
sb.append(NEWLINE); |
1375 |
|
} |
1376 |
|
} |
1377 |
0 |
sb.append(NEWLINE); |
1378 |
|
|
1379 |
0 |
return sb.toString(); |
1380 |
|
} |
1381 |
|
|
1382 |
|
|
1383 |
|
|
1384 |
|
|
1385 |
|
@param |
1386 |
|
|
|
|
| 87.5% |
Uncovered Elements: 1 (8) |
Complexity: 4 |
Complexity Density: 1 |
|
1387 |
27 |
public void deregisterMapping(AlignedCodonFrame acf)... |
1388 |
|
{ |
1389 |
27 |
if (acf != null) |
1390 |
|
{ |
1391 |
27 |
boolean removed = seqmappings.remove(acf); |
1392 |
27 |
if (removed && seqmappings.isEmpty()) |
1393 |
|
{ |
1394 |
2 |
jalview.bin.Console.outPrintln("All mappings removed"); |
1395 |
|
} |
1396 |
|
} |
1397 |
|
} |
1398 |
|
|
1399 |
|
|
1400 |
|
|
1401 |
|
|
1402 |
|
@param |
1403 |
|
|
|
|
| 80% |
Uncovered Elements: 1 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
1404 |
554 |
public void registerMappings(List<AlignedCodonFrame> mappings)... |
1405 |
|
{ |
1406 |
554 |
if (mappings != null) |
1407 |
|
{ |
1408 |
554 |
for (AlignedCodonFrame acf : mappings) |
1409 |
|
{ |
1410 |
152 |
registerMapping(acf); |
1411 |
|
} |
1412 |
|
} |
1413 |
|
} |
1414 |
|
|
1415 |
|
|
1416 |
|
|
1417 |
|
|
|
|
| 85.7% |
Uncovered Elements: 1 (7) |
Complexity: 3 |
Complexity Density: 1 |
|
1418 |
161 |
public void registerMapping(AlignedCodonFrame acf)... |
1419 |
|
{ |
1420 |
161 |
if (acf != null) |
1421 |
|
{ |
1422 |
161 |
if (!seqmappings.contains(acf)) |
1423 |
|
{ |
1424 |
38 |
seqmappings.add(acf); |
1425 |
|
} |
1426 |
|
} |
1427 |
|
} |
1428 |
|
|
1429 |
|
|
1430 |
|
|
1431 |
|
|
1432 |
|
|
|
|
| 75% |
Uncovered Elements: 8 (32) |
Complexity: 9 |
Complexity Density: 0.56 |
|
1433 |
237 |
public void resetAll()... |
1434 |
|
{ |
1435 |
237 |
if (mappings != null) |
1436 |
|
{ |
1437 |
237 |
mappings.clear(); |
1438 |
|
} |
1439 |
237 |
if (seqmappings != null) |
1440 |
|
{ |
1441 |
237 |
seqmappings.clear(); |
1442 |
|
} |
1443 |
237 |
if (sel_listeners != null) |
1444 |
|
{ |
1445 |
237 |
sel_listeners.clear(); |
1446 |
|
} |
1447 |
237 |
if (listeners != null) |
1448 |
|
{ |
1449 |
237 |
listeners.clear(); |
1450 |
|
} |
1451 |
237 |
if (commandListeners != null) |
1452 |
|
{ |
1453 |
237 |
commandListeners.clear(); |
1454 |
|
} |
1455 |
237 |
if (view_listeners != null) |
1456 |
|
{ |
1457 |
237 |
view_listeners.clear(); |
1458 |
|
} |
1459 |
237 |
if (pdbFileNameId != null) |
1460 |
|
{ |
1461 |
237 |
pdbFileNameId.clear(); |
1462 |
|
} |
1463 |
237 |
if (pdbIdFileName != null) |
1464 |
|
{ |
1465 |
237 |
pdbIdFileName.clear(); |
1466 |
|
} |
1467 |
|
} |
1468 |
|
|
|
|
| 75% |
Uncovered Elements: 1 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
1469 |
478 |
public void addSelectionListener(SelectionListener selecter)... |
1470 |
|
{ |
1471 |
478 |
if (!sel_listeners.contains(selecter)) |
1472 |
|
{ |
1473 |
478 |
sel_listeners.add(selecter); |
1474 |
|
} |
1475 |
|
} |
1476 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
1477 |
506 |
public void removeSelectionListener(SelectionListener toremove)... |
1478 |
|
{ |
1479 |
506 |
if (sel_listeners.contains(toremove)) |
1480 |
|
{ |
1481 |
253 |
sel_listeners.remove(toremove); |
1482 |
|
} |
1483 |
|
} |
1484 |
|
|
|
|
| 80% |
Uncovered Elements: 1 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
1485 |
23 |
public synchronized void sendSelection(... |
1486 |
|
jalview.datamodel.SequenceGroup selection, |
1487 |
|
jalview.datamodel.ColumnSelection colsel, HiddenColumns hidden, |
1488 |
|
SelectionSource source) |
1489 |
|
{ |
1490 |
23 |
for (SelectionListener slis : sel_listeners) |
1491 |
|
{ |
1492 |
104 |
if (slis != source) |
1493 |
|
{ |
1494 |
104 |
slis.selection(selection, colsel, hidden, source); |
1495 |
|
} |
1496 |
|
} |
1497 |
|
} |
1498 |
|
|
1499 |
|
Vector<AlignmentViewPanelListener> view_listeners = new Vector<>(); |
1500 |
|
|
|
|
| 0% |
Uncovered Elements: 13 (13) |
Complexity: 5 |
Complexity Density: 0.71 |
|
1501 |
0 |
public synchronized void sendViewPosition(... |
1502 |
|
jalview.api.AlignmentViewPanel source, int startRes, int endRes, |
1503 |
|
int startSeq, int endSeq) |
1504 |
|
{ |
1505 |
|
|
1506 |
0 |
if (view_listeners != null && view_listeners.size() > 0) |
1507 |
|
{ |
1508 |
0 |
Enumeration<AlignmentViewPanelListener> listeners = view_listeners |
1509 |
|
.elements(); |
1510 |
0 |
while (listeners.hasMoreElements()) |
1511 |
|
{ |
1512 |
0 |
AlignmentViewPanelListener slis = listeners.nextElement(); |
1513 |
0 |
if (slis != source) |
1514 |
|
{ |
1515 |
0 |
slis.viewPosition(startRes, endRes, startSeq, endSeq, source); |
1516 |
|
} |
1517 |
0 |
; |
1518 |
|
} |
1519 |
|
} |
1520 |
|
} |
1521 |
|
|
1522 |
|
|
1523 |
|
|
1524 |
|
|
1525 |
|
@param |
1526 |
|
|
|
|
| 0% |
Uncovered Elements: 10 (10) |
Complexity: 4 |
Complexity Density: 0.67 |
|
1527 |
0 |
public static void release(StructureSelectionManagerProvider jalviewLite)... |
1528 |
|
{ |
1529 |
|
|
1530 |
|
{ |
1531 |
0 |
if (instances == null) |
1532 |
|
{ |
1533 |
0 |
return; |
1534 |
|
} |
1535 |
0 |
StructureSelectionManager mnger = (instances.get(jalviewLite)); |
1536 |
0 |
if (mnger != null) |
1537 |
|
{ |
1538 |
0 |
instances.remove(jalviewLite); |
1539 |
0 |
try |
1540 |
|
{ |
1541 |
|
|
1542 |
|
|
1543 |
|
|
1544 |
|
|
1545 |
|
} catch (Throwable x) |
1546 |
|
{ |
1547 |
|
} |
1548 |
|
} |
1549 |
|
} |
1550 |
|
} |
1551 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 3 |
Complexity Density: 1.5 |
|
1552 |
359 |
public void registerPDBEntry(PDBEntry pdbentry)... |
1553 |
|
{ |
1554 |
359 |
if (pdbentry.getFile() != null |
1555 |
|
&& pdbentry.getFile().trim().length() > 0) |
1556 |
|
{ |
1557 |
139 |
registerPDBFile(pdbentry.getId(), pdbentry.getFile()); |
1558 |
|
} |
1559 |
|
} |
1560 |
|
|
|
|
| 75% |
Uncovered Elements: 1 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
1561 |
6 |
public void addCommandListener(CommandListener cl)... |
1562 |
|
{ |
1563 |
6 |
if (!commandListeners.contains(cl)) |
1564 |
|
{ |
1565 |
6 |
commandListeners.add(cl); |
1566 |
|
} |
1567 |
|
} |
1568 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1569 |
0 |
public boolean hasCommandListener(CommandListener cl)... |
1570 |
|
{ |
1571 |
0 |
return this.commandListeners.contains(cl); |
1572 |
|
} |
1573 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1574 |
253 |
public boolean removeCommandListener(CommandListener l)... |
1575 |
|
{ |
1576 |
253 |
return commandListeners.remove(l); |
1577 |
|
} |
1578 |
|
|
1579 |
|
|
1580 |
|
|
1581 |
|
|
1582 |
|
|
1583 |
|
@param |
1584 |
|
|
1585 |
|
@param |
1586 |
|
|
1587 |
|
@param |
1588 |
|
|
|
|
| 50% |
Uncovered Elements: 1 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
1589 |
1 |
public void commandPerformed(CommandI command, boolean undo,... |
1590 |
|
VamsasSource source) |
1591 |
|
{ |
1592 |
1 |
for (CommandListener listener : commandListeners) |
1593 |
|
{ |
1594 |
0 |
listener.mirrorCommand(command, undo, this, source); |
1595 |
|
} |
1596 |
|
} |
1597 |
|
|
1598 |
|
|
1599 |
|
|
1600 |
|
|
1601 |
|
|
1602 |
|
|
1603 |
|
@param |
1604 |
|
@param |
1605 |
|
@param |
1606 |
|
@param |
1607 |
|
@return |
1608 |
|
|
|
|
| 0% |
Uncovered Elements: 9 (9) |
Complexity: 3 |
Complexity Density: 0.6 |
|
1609 |
0 |
public CommandI mapCommand(CommandI command, boolean undo,... |
1610 |
|
final AlignmentI mapTo, char gapChar) |
1611 |
|
{ |
1612 |
0 |
if (command instanceof EditCommand) |
1613 |
|
{ |
1614 |
0 |
return MappingUtils.mapEditCommand((EditCommand) command, undo, mapTo, |
1615 |
|
gapChar, seqmappings); |
1616 |
|
} |
1617 |
0 |
else if (command instanceof OrderCommand) |
1618 |
|
{ |
1619 |
0 |
return MappingUtils.mapOrderCommand((OrderCommand) command, undo, |
1620 |
|
mapTo, seqmappings); |
1621 |
|
} |
1622 |
0 |
return null; |
1623 |
|
} |
1624 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1625 |
15 |
public List<AlignedCodonFrame> getSequenceMappings()... |
1626 |
|
{ |
1627 |
15 |
return seqmappings; |
1628 |
|
} |
1629 |
|
|
1630 |
|
|
1631 |
|
|
1632 |
|
|
1633 |
|
|
1634 |
|
@param |
1635 |
|
@param |
1636 |
|
|
1637 |
|
@param |
1638 |
|
|
1639 |
|
|
|
|
| 66.7% |
Uncovered Elements: 4 (12) |
Complexity: 4 |
Complexity Density: 0.67 |
|
1640 |
8 |
public void highlightPositionsOnMany(SequenceI[] sequencesArray, int[] is,... |
1641 |
|
Object source) |
1642 |
|
{ |
1643 |
16 |
for (int i = 0; i < listeners.size(); i++) |
1644 |
|
{ |
1645 |
8 |
Object listener = listeners.elementAt(i); |
1646 |
8 |
if (listener == source) |
1647 |
|
{ |
1648 |
|
|
1649 |
|
|
1650 |
0 |
continue; |
1651 |
|
} |
1652 |
8 |
if (listener instanceof StructureListener) |
1653 |
|
{ |
1654 |
0 |
highlightStructureRegionsFor((StructureListener) listener, |
1655 |
|
sequencesArray, is); |
1656 |
|
} |
1657 |
|
} |
1658 |
|
} |
1659 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1660 |
0 |
public Map<String, String> getPdbFileNameIdMap()... |
1661 |
|
{ |
1662 |
0 |
return pdbFileNameId; |
1663 |
|
} |
1664 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1665 |
0 |
public Map<String, String> getPdbIdFileNameMap()... |
1666 |
|
{ |
1667 |
0 |
return pdbIdFileName; |
1668 |
|
} |
1669 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1670 |
127 |
public static void doConfigureStructurePrefs(... |
1671 |
|
StructureSelectionManager ssm) |
1672 |
|
{ |
1673 |
127 |
doConfigureStructurePrefs(ssm, |
1674 |
|
Cache.getDefault(Preferences.ADD_SS_ANN, true), |
1675 |
|
Cache.getDefault(Preferences.ADD_TEMPFACT_ANN, true), |
1676 |
|
Cache.getDefault(Preferences.STRUCT_FROM_PDB, true), |
1677 |
|
Cache.getDefault(Preferences.USE_RNAVIEW, false)); |
1678 |
|
} |
1679 |
|
|
|
|
| 55.6% |
Uncovered Elements: 4 (9) |
Complexity: 2 |
Complexity Density: 0.29 |
|
1680 |
127 |
public static void doConfigureStructurePrefs(... |
1681 |
|
StructureSelectionManager ssm, boolean add_ss_ann, |
1682 |
|
boolean add_tempfact_ann, boolean struct_from_pdb, |
1683 |
|
boolean use_rnaview) |
1684 |
|
{ |
1685 |
127 |
if (add_ss_ann) |
1686 |
|
{ |
1687 |
127 |
ssm.setAddTempFacAnnot(add_tempfact_ann); |
1688 |
127 |
ssm.setProcessSecondaryStructure(struct_from_pdb); |
1689 |
|
|
1690 |
127 |
ssm.setSecStructServices(use_rnaview); |
1691 |
|
} |
1692 |
|
else |
1693 |
|
{ |
1694 |
0 |
ssm.setAddTempFacAnnot(false); |
1695 |
0 |
ssm.setProcessSecondaryStructure(false); |
1696 |
0 |
ssm.setSecStructServices(false); |
1697 |
|
} |
1698 |
|
} |
1699 |
|
|
1700 |
|
} |