diff --git a/eppic-cli/src/main/java/eppic/assembly/CrystalAssemblies.java b/eppic-cli/src/main/java/eppic/assembly/CrystalAssemblies.java index c1880a2f5..dd99f80c1 100644 --- a/eppic-cli/src/main/java/eppic/assembly/CrystalAssemblies.java +++ b/eppic-cli/src/main/java/eppic/assembly/CrystalAssemblies.java @@ -587,19 +587,36 @@ public void score() { indx++; } + // This is done when multiple assemblies are high scoring + indx = 0; + List indices = new ArrayList(); + 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) diff --git a/eppic-cli/src/main/java/eppic/predictors/CombinedClusterPredictor.java b/eppic-cli/src/main/java/eppic/predictors/CombinedClusterPredictor.java index 084de67db..7578f3d71 100644 --- a/eppic-cli/src/main/java/eppic/predictors/CombinedClusterPredictor.java +++ b/eppic-cli/src/main/java/eppic/predictors/CombinedClusterPredictor.java @@ -11,8 +11,8 @@ public class CombinedClusterPredictor implements InterfaceTypePredictor { private CallType call; private String callReason; - private double probability; - private double confidence; + private double probability = 0.5; + private double confidence = 0.5; public CombinedClusterPredictor(List lcp) { @@ -35,12 +35,16 @@ public void computeScores() { // 1) BIO call if (probability > 0.5) { - callReason = String.format("P(BIO) = %.2f > 0.5", probability); + callReason = String.format( + "Probability of the interface being biologically relevant is %.2f.", + probability); call = CallType.BIO; - } + } // 2) XTAL call else if (probability <= 0.5) { - callReason = String.format("P(BIO) = %.2f < 0.5", probability); + callReason = String.format( + "Probability of the interface being biologically relevant is %.2f.", + probability); call = CallType.CRYSTAL; } @@ -69,7 +73,7 @@ public double getScore() { } @Override - public double getScore1() { + public double getScore1() { return SCORE_UNASSIGNED; } @@ -93,7 +97,7 @@ private void calcConfidence() { confidence = 1 - probability; break; case NO_PREDICTION: - confidence = CONFIDENCE_UNASSIGNED; + confidence = 0.5; } diff --git a/eppic-cli/src/main/java/eppic/predictors/CombinedPredictor.java b/eppic-cli/src/main/java/eppic/predictors/CombinedPredictor.java index ed98e8ec2..fefc84db5 100644 --- a/eppic-cli/src/main/java/eppic/predictors/CombinedPredictor.java +++ b/eppic-cli/src/main/java/eppic/predictors/CombinedPredictor.java @@ -47,8 +47,8 @@ public class CombinedPredictor implements InterfaceTypePredictor { private CallType call; - private double probability; - private double confidence; + private double probability = 0.5; + private double confidence = 0.5; public CombinedPredictor(InterfaceEvolContext iec, GeometryPredictor gp, EvolCoreRimPredictor ecrp, EvolCoreSurfacePredictor ecsp) { @@ -106,7 +106,7 @@ public void computeScores() { LOGGER.info("Interface {} is not protein in either side, can't score it",iec.getInterface().getId()); callReason = "Both sides are not protein, can't score"; call = CallType.NO_PREDICTION; - probability = -1; + probability = 0.5; return; } @@ -115,12 +115,16 @@ public void computeScores() { // 1) BIO call if (probability > 0.5) { - callReason = String.format("P(BIO) = %.2f > 0.5", probability); + callReason = String.format( + "Probability of the interface being biologically relevant is %.2f.", + probability); call = CallType.BIO; } // 2) XTAL call else if (probability <= 0.5) { - callReason = String.format("P(BIO) = %.2f < 0.5", probability); + callReason = String.format( + "Probability of the interface being biologically relevant is %.2f.", + probability); call = CallType.CRYSTAL; } @@ -186,7 +190,7 @@ private void calcConfidence() { confidence = 1 - probability; break; case NO_PREDICTION: - confidence = CONFIDENCE_UNASSIGNED; + confidence = 0.5; }