Skip to content

Commit

Permalink
Simplified checking resolvability in max ambig fraction parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
dannovikov committed Feb 1, 2024
1 parent 290ab53 commit 5d3b2fa
Showing 1 changed file with 9 additions and 49 deletions.
58 changes: 9 additions & 49 deletions modules/gui-app/src/main/java/TN93/TN93.java
Original file line number Diff line number Diff line change
Expand Up @@ -469,55 +469,15 @@ public void tn93_sequential_pairs(ArrayList<Pair<Pair<String, Seq>, Pair<String,
}


private boolean resolveable(int c1, int c2) {
// like countNucl_resolve, but returns true if a non-average resolution is possible
if (c1 < 4 && c2 < 4) return false;
if (c1 == 17 || c2 == 17) return false;
if (c1 < 4) {
if (resolutions[c2][c1] == 1) {
return true;
}
for (int j=0; j<4; j++) {
if (resolutions[c2][j] == 1 && resolutions[c1][j] == 1) {
return true;
}
}
}
else if (c2 < 4) {
if (resolutions[c1][c2] == 1) {
return true;
}
for (int j=0; j<4; j++) {
if (resolutions[c1][j] == 1 && resolutions[c2][j] == 1) {
return true;
}
}
}
else {
double norm = resolutionsCount[c1] * resolutionsCount[c2];
if (norm > 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;
}

Expand All @@ -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) {
Expand Down

0 comments on commit 5d3b2fa

Please sign in to comment.