24
24
* into the <em>target</em>.
25
25
*
26
26
* Please note that this class is in its beta state.
27
+ *
28
+ * @author Ozgun Babur
29
+ * @author Emek Demir
30
+ *
31
+ * @deprecated it's experimetal, only for Level2, and seems not tested/maintained
27
32
*/
33
+ @ Deprecated
28
34
public class Integrator {
29
35
30
36
private static final Logger log = LoggerFactory .getLogger (Integrator .class );
@@ -48,10 +54,7 @@ public class Integrator {
48
54
* C | | | |
49
55
* ------------------------------
50
56
*/
51
- private Map <physicalEntityParticipant ,
52
- Map <physicalEntityParticipant , Double >> pepScoreMatrix
53
- = new HashMap <physicalEntityParticipant ,
54
- Map <physicalEntityParticipant , Double >>();
57
+ private Map <physicalEntityParticipant , Map <physicalEntityParticipant , Double >> pepScoreMatrix = new HashMap <>();
55
58
56
59
/**
57
60
* This is the pool where the scores and relevant conversions
@@ -114,17 +117,13 @@ public Integrator(EditorMap editorMap, Model target, Model... sources) {
114
117
log .info ("Merging finished." );
115
118
116
119
if ( isNormalizeModels () ) {
117
- log .info ("Normalizing models." );
118
-
119
120
log .info ("Normaling XREFs." );
120
121
normalizeXrefs (target );
121
122
normalizeXrefs (mergedSources );
122
123
log .info ("Normaling OCVs." );
123
124
normalizeOpenControlledVocabulary (mergedSources );
124
125
log .info ("Normaling cellular locations." );
125
126
normalizeCellularLocations (mergedSources );
126
-
127
- log .info ("Normalization completed." );
128
127
}
129
128
}
130
129
@@ -296,21 +295,18 @@ public List<ConversionScore> integrate(List<ConversionScore> alternativeScores)
296
295
* Instead, we are going to copy them, and modify their copies.
297
296
*/
298
297
log .info ("Creating a copy of the PEP scores." );
299
- Map <physicalEntityParticipant ,
300
- Map <physicalEntityParticipant , Double >> copyMatrix
301
- = new HashMap <physicalEntityParticipant , Map <physicalEntityParticipant , Double >>();
298
+ Map <physicalEntityParticipant , Map <physicalEntityParticipant , Double >> copyMatrix = new HashMap <>();
302
299
// Copy the contents of the matrix
303
300
for (physicalEntityParticipant pepKey : pepScoreMatrix .keySet ()) {
304
- copyMatrix .put (pepKey ,
305
- new HashMap <physicalEntityParticipant , Double >(pepScoreMatrix .get (pepKey )));
301
+ copyMatrix .put (pepKey , new HashMap <>(pepScoreMatrix .get (pepKey )));
306
302
}
307
303
// We want to use the copy now
308
304
pepScoreMatrix = copyMatrix ;
309
305
log .info ("PEP scores copied." );
310
306
311
307
similarConversions = (alternativeScores == null )
312
- ? new ArrayList <>(this .similarConversions )
313
- : alternativeScores ;
308
+ ? new ArrayList <>(this .similarConversions )
309
+ : alternativeScores ;
314
310
315
311
log .info ("Conversion scores copied." );
316
312
/* End of copies */
@@ -347,7 +343,7 @@ private void equalizeEntities(List<ConversionScore> similarConversions) {
347
343
348
344
for (ConversionScore convScore : similarConversions ) {
349
345
// Since we sorted the list, we are safe to break
350
- // But a continue will also do the trick, mostly
346
+ // But a " continue;" would also do the trick, mostly
351
347
// requiring little more time
352
348
if ( convScore .getScore () < getThreshold () )
353
349
break ;
@@ -420,25 +416,8 @@ private void equalizeEntities(List<ConversionScore> similarConversions) {
420
416
}
421
417
}
422
418
423
- /**
424
- * @deprecated setRDFId/setUri is not available anymore
425
- */
426
- @ Deprecated
427
419
private void equalize (BioPAXElement e1 , BioPAXElement e2 ) {
428
- // Operation below is enough for the time being
429
- // TODO re-factoring: setRDFId/setUri is not available anymore! (changing URIs directly is dangerous)
430
- //e2.setUri(e1.getUri());
431
-
432
- throw new UnsupportedOperationException ("This needs re-factoring: bpe.setUri is not available anymore!" );
433
-
434
- //TODO ? use some alternative way to store that a1 equals e2, e.g., Set<String> matched,
435
- //matched.add(e1.getUri()+e2.getUri()); matched.add(e2.getUri()+e1.getUri());
436
- }
437
-
438
- private boolean equals (BioPAXElement a , BioPAXElement b ) {
439
- throw new UnsupportedOperationException ("not implemented yet." );
440
- // TODO ? implement equals(BioPAXElement a, BioPAXElement b): can be smth. like the following... and use below
441
- //return (a == null) ? b == null : a.equals(b) || matched.contains(a.getUri()+b.getUri());
420
+ ModelUtils .updateUri (null , e2 , e1 .getUri ());
442
421
}
443
422
444
423
private void equalizePEP (physicalEntityParticipant controller1 , physicalEntityParticipant controller2 ) {
0 commit comments