@@ -373,16 +373,24 @@ class HIVTxNetwork {
373
373
this . json . Nodes ,
374
374
this . json . Edges
375
375
) ;
376
+
376
377
let complete_clusters = misc . hivtrace_cluster_depthwise_traversal (
377
378
this . json . Nodes ,
378
379
this . json . Edges ,
379
380
( d ) => d . length <= reduce_distance_within
380
381
) ;
382
+
381
383
let adjacency = misc . hivtrace_compute_adjacency (
382
384
this . json . Nodes ,
383
385
this . json . Edges ,
384
386
( d ) => d . length <= reduce_distance_between
385
387
) ;
388
+
389
+ let adjacency05 = misc . hivtrace_compute_adjacency (
390
+ this . json . Nodes ,
391
+ this . json . Edges ,
392
+ ( d ) => d . length <= 0.005
393
+ ) ;
386
394
let nodes_to_delete = new Set ( ) ;
387
395
388
396
_ . each ( clusters , ( cluster , cluster_index ) => {
@@ -412,6 +420,7 @@ class HIVTxNetwork {
412
420
_ . each ( uel , ( dup_seqs , uid ) => {
413
421
if ( dup_seqs . length > 1 ) {
414
422
let dup_ids = new Set ( _ . map ( dup_seqs , ( d ) => d . id ) ) ;
423
+
415
424
let neighborhood = new Set (
416
425
_ . map (
417
426
_ . filter (
@@ -420,6 +429,14 @@ class HIVTxNetwork {
420
429
)
421
430
)
422
431
) ;
432
+ let neighborhood05 = new Set (
433
+ _ . map (
434
+ _ . filter (
435
+ [ ...adjacency05 [ dup_seqs [ 0 ] . id ] ] ,
436
+ ( d ) => ! dup_ids . has ( d )
437
+ )
438
+ )
439
+ ) ;
423
440
let reduce = true ;
424
441
425
442
//if (neighborhood.size > 0) {
@@ -432,11 +449,23 @@ class HIVTxNetwork {
432
449
)
433
450
)
434
451
) ;
452
+ let other_nbhd05 = new Set (
453
+ _ . map (
454
+ _ . filter (
455
+ [ ...adjacency05 [ dup_seqs [ idx ] . id ] ] ,
456
+ ( d ) => ! dup_ids . has ( d )
457
+ )
458
+ )
459
+ ) ;
435
460
436
461
if (
437
462
! (
438
463
other_nbhd . isSubsetOf ( neighborhood ) &&
439
464
neighborhood . isSubsetOf ( other_nbhd )
465
+ ) ||
466
+ ! (
467
+ other_nbhd . isSubsetOf ( neighborhood05 ) &&
468
+ neighborhood . isSubsetOf ( other_nbhd05 )
440
469
)
441
470
) {
442
471
reduce = false ;
0 commit comments