@Test public void getScoreWithParentlessTermDoesntThrowException() throws ComponentLookupException { VocabularyTerm hp10 = mock(VocabularyTerm.class); when(this.hpo.getTerm("HP:10")).thenReturn(hp10); when(hp10.getId()).thenReturn("HP:10"); when(hp10.getParents()).thenReturn(Collections.<VocabularyTerm>emptySet()); when(this.omim.count(Collections.singletonMap("symptom", "HP:10"))).thenReturn(0L); Feature feature = mock(Feature.class); when(feature.getId()).thenReturn("HP:10"); when(feature.isPresent()).thenReturn(true); Mockito.doReturn(Collections.singleton(feature)).when(this.patient).getFeatures(); Assert.assertEquals(0.0, this.mocker.getComponentUnderTest().getScore(this.patient), 0.0); }
@Override public double getScore(Patient patient) { Pair<Double, Integer> symptomsScore = process(patient, true); Pair<Double, Integer> negativeSymptomsScore = process(patient, false); double score = 0; if (symptomsScore.getRight() + negativeSymptomsScore.getRight() > 0) { score = 2 * Math.atan(symptomsScore.getLeft() / 10 + negativeSymptomsScore.getLeft() / 20) / Math.PI; } return score; }
OmimInformationContentPatientScorer implements PatientScorer, Initializable { @Override public double getScore(Patient patient) { Pair<Double, Integer> symptomsScore = process(patient, true); Pair<Double, Integer> negativeSymptomsScore = process(patient, false); double score = 0; if (symptomsScore.getRight() + negativeSymptomsScore.getRight() > 0) { score = 2 * Math.atan(symptomsScore.getLeft() / 10 + negativeSymptomsScore.getLeft() / 20) / Math.PI; } return score; } }
OmimInformationContentPatientScorer implements PatientScorer, Initializable { @Override public double getScore(Patient patient) { Pair<Double, Integer> symptomsScore = process(patient, true); Pair<Double, Integer> negativeSymptomsScore = process(patient, false); double score = 0; if (symptomsScore.getRight() + negativeSymptomsScore.getRight() > 0) { score = 2 * Math.atan(symptomsScore.getLeft() / 10 + negativeSymptomsScore.getLeft() / 20) / Math.PI; } return score; }  }
OmimInformationContentPatientScorer implements PatientScorer, Initializable { @Override public double getScore(Patient patient) { Pair<Double, Integer> symptomsScore = process(patient, true); Pair<Double, Integer> negativeSymptomsScore = process(patient, false); double score = 0; if (symptomsScore.getRight() + negativeSymptomsScore.getRight() > 0) { score = 2 * Math.atan(symptomsScore.getLeft() / 10 + negativeSymptomsScore.getLeft() / 20) / Math.PI; } return score; }  @Override void initialize(); @Override PatientSpecificity getSpecificity(Patient patient); @Override double getScore(Patient patient); }
OmimInformationContentPatientScorer implements PatientScorer, Initializable { @Override public double getScore(Patient patient) { Pair<Double, Integer> symptomsScore = process(patient, true); Pair<Double, Integer> negativeSymptomsScore = process(patient, false); double score = 0; if (symptomsScore.getRight() + negativeSymptomsScore.getRight() > 0) { score = 2 * Math.atan(symptomsScore.getLeft() / 10 + negativeSymptomsScore.getLeft() / 20) / Math.PI; } return score; }  @Override void initialize(); @Override PatientSpecificity getSpecificity(Patient patient); @Override double getScore(Patient patient);  }