From 5d3b2fa503889056b8792b2e910ea28c3bd97212 Mon Sep 17 00:00:00 2001 From: Dan Novikov Date: Thu, 1 Feb 2024 15:20:41 -0500 Subject: [PATCH] Simplified checking resolvability in max ambig fraction parameter --- modules/gui-app/src/main/java/TN93/TN93.java | 58 +++----------------- 1 file changed, 9 insertions(+), 49 deletions(-) diff --git a/modules/gui-app/src/main/java/TN93/TN93.java b/modules/gui-app/src/main/java/TN93/TN93.java index 504232a..2227bd1 100644 --- a/modules/gui-app/src/main/java/TN93/TN93.java +++ b/modules/gui-app/src/main/java/TN93/TN93.java @@ -469,55 +469,15 @@ public void tn93_sequential_pairs(ArrayList, Pair 0.0) { - int matched = 0; - boolean[] positive_match = new boolean[4]; - for (int j=0; j<4; j++) { - if (resolutions[c1][j] == 1 && resolutions[c2][j] == 1) { - positive_match[j] = true; - matched++; - } - } - if (matched > 0) { + private boolean resolvable(int c1, int c2) { + if (c1 < 4 && c2 < 4) + return false; + if (c1 == 17 || c2 == 17) + return false; + else + for (int j = 0; j < 4; j++) + if (resolutions[c1][j] == 1 && resolutions[c2][j] == 1) return true; - } - for (int j=0; j<4; j++) { - if (resolutions[c1][j] == 1) { - for (int k=0; k<4; k++) { - if (resolutions[c2][k] == 1) { - return true; - } - } - } - } - } - } return false; } @@ -528,7 +488,7 @@ private boolean exceeds_ambig_threshold(Seq s1, Seq s2, double max_ambiguity_fra for (int i = 0; i < scan_length; ++i) { int c1 = s1.getSeq_enc()[i]; int c2 = s2.getSeq_enc()[i]; - if (resolveable(c1, c2)) { + if (resolvable(c1, c2)) { ambigs_count++; } if (c1 != 17 && c2 != 17) {