Skip to content

Commit

Permalink
Solve scoring ties with NOPRED
Browse files Browse the repository at this point in the history
General solution for DNA helix described in #161
  • Loading branch information
lafita committed Jan 30, 2017
1 parent 7a78658 commit 85600e8
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions eppic-cli/src/main/java/eppic/assembly/CrystalAssemblies.java
Original file line number Diff line number Diff line change
Expand Up @@ -587,19 +587,36 @@ public void score() {
indx++;
}

// This is done when multiple assemblies are high scoring
indx = 0;
List<Integer> indices = new ArrayList<Integer>();
for (Assembly a:uniques) {
if (a.getScore() == maxScore){
indices.add(indx);
}
indx++;
}

// Warn if low probability density of valid assemblies
if (sumProbs < 0.5) {
logger.warn("The total probability of valid assemblies is only {}. "
+ "Assembly ennumeration may be incomplete.", String.format("%.2f", sumProbs));
}

// Do not normalize the score (easy to do afterwards though)
// Do not normalize the score (easy to do afterwards in the DB though)
//for (Assembly a:uniques)
// a.normalizeScore(sumProbs);

// 3 Assign the BIO call to the highest probability
if (uniques.size() > 0)
uniques.get(maxIndx).setCall(CallType.BIO);
// 3 Assign the BIO call to the highest probability, if unique assembly
if (uniques.size() > 0) {
if (indices.size() == 1) {
uniques.get(maxIndx).setCall(CallType.BIO);
} else {
for (Integer i:indices) {
uniques.get(i).setCall(CallType.NO_PREDICTION);
}
}
}

// 4 Compute call confidence
for (Assembly a:uniques)
Expand Down

0 comments on commit 85600e8

Please sign in to comment.