test_class.declarator: objDist
test_class.modifier: private
test_class.original_string: private ObjectScoreDistribution objDist;
test_class.type: ObjectScoreDistribution
test_class.var_name: objDist
test_class.declarator: numTerms = 2
test_class.modifier: private final
test_class.original_string: private final int numTerms = 2;
test_class.type: int
test_class.var_name: numTerms
test_class.declarator: sampleSize = 10
test_class.modifier: private final
test_class.original_string: private final int sampleSize = 10;
test_class.type: int
test_class.var_name: sampleSize
test_class.file: phenol-core/src/test/java/org/monarchinitiative/phenol/ontology/scoredist/ObjectScoreDistributionTest.java
test_class.identifier: ObjectScoreDistributionTest
test_case.body: @Test
    public void testEstimatePValue() {
      assertEquals(1.0, objDist.estimatePValue(0.0), 0.01);
      assertEquals(1.0, objDist.estimatePValue(0.1), 0.01);
      assertEquals(0.82, objDist.estimatePValue(0.2), 0.01);
      assertEquals(0.82, objDist.estimatePValue(0.4), 0.01);
      assertEquals(0.42, objDist.estimatePValue(0.6), 0.01);
      assertEquals(0.42, objDist.estimatePValue(0.8), 0.01);
      assertEquals(0.0, objDist.estimatePValue(0.99), 0.01);
    }
test_case.class_method_signature: ObjectScoreDistributionTest.testEstimatePValue()
test_case.full_signature: @Test public void testEstimatePValue()
test_case.identifier: testEstimatePValue
test_case.invocations: assertEquals estimatePValue assertEquals estimatePValue assertEquals estimatePValue assertEquals estimatePValue assertEquals estimatePValue assertEquals estimatePValue assertEquals estimatePValue
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testEstimatePValue()
focal_class.declarator: serialVersionUID = 1L
focal_class.modifier: private static final
focal_class.original_string: private static final long serialVersionUID = 1L;
focal_class.type: long
focal_class.var_name: serialVersionUID
focal_class.declarator: objectId
focal_class.modifier: private final
focal_class.original_string: private final TermId objectId;
focal_class.type: TermId
focal_class.var_name: objectId
focal_class.declarator: numTerms
focal_class.modifier: private final
focal_class.original_string: private final int numTerms;
focal_class.type: int
focal_class.var_name: numTerms
focal_class.declarator: sampleSize
focal_class.modifier: private final
focal_class.original_string: private final int sampleSize;
focal_class.type: int
focal_class.var_name: sampleSize
focal_class.declarator: cumulativeFrequencies
focal_class.modifier: private final
focal_class.original_string: private final SortedMap<Double, Double> cumulativeFrequencies;
focal_class.type: SortedMap<Double, Double>
focal_class.var_name: cumulativeFrequencies
focal_class.file: phenol-core/src/main/java/org/monarchinitiative/phenol/ontology/scoredist/ObjectScoreDistribution.java
focal_class.identifier: ObjectScoreDistribution
focal_class.interfaces: implements Serializable
focal_class.class_method_signature: ObjectScoreDistribution.ObjectScoreDistribution(TermId objectId, int numTerms, int sampleSize, SortedMap<Double, Double> cumulativeFrequencies)
focal_class.full_signature: public  ObjectScoreDistribution(TermId objectId, int numTerms, int sampleSize, SortedMap<Double, Double> cumulativeFrequencies)
focal_class.identifier: ObjectScoreDistribution
focal_class.modifiers: public
focal_class.parameters: (TermId objectId, int numTerms, int sampleSize, SortedMap<Double, Double> cumulativeFrequencies)
focal_class.signature:  ObjectScoreDistribution(TermId objectId, int numTerms, int sampleSize, SortedMap<Double, Double> cumulativeFrequencies)
focal_class.class_method_signature: ObjectScoreDistribution.estimatePValue(double score)
focal_class.full_signature: public double estimatePValue(double score)
focal_class.identifier: estimatePValue
focal_class.modifiers: public
focal_class.parameters: (double score)
focal_class.return: double
focal_class.signature: double estimatePValue(double score)
focal_class.class_method_signature: ObjectScoreDistribution.observedScores()
focal_class.full_signature: public List<Double> observedScores()
focal_class.identifier: observedScores
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: List<Double>
focal_class.signature: List<Double> observedScores()
focal_class.class_method_signature: ObjectScoreDistribution.getCumulativeFrequencies()
focal_class.full_signature: public SortedMap<Double, Double> getCumulativeFrequencies()
focal_class.identifier: getCumulativeFrequencies
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: SortedMap<Double, Double>
focal_class.signature: SortedMap<Double, Double> getCumulativeFrequencies()
focal_class.class_method_signature: ObjectScoreDistribution.getObjectId()
focal_class.full_signature: public TermId getObjectId()
focal_class.identifier: getObjectId
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: TermId
focal_class.signature: TermId getObjectId()
focal_class.class_method_signature: ObjectScoreDistribution.getNumTerms()
focal_class.full_signature: public int getNumTerms()
focal_class.identifier: getNumTerms
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getNumTerms()
focal_class.class_method_signature: ObjectScoreDistribution.getSampleSize()
focal_class.full_signature: public int getSampleSize()
focal_class.identifier: getSampleSize
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getSampleSize()
focal_class.class_method_signature: ObjectScoreDistribution.toString()
focal_class.full_signature: @Override public String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_method.body: public double estimatePValue(double score) {
      Entry<Double, Double> previous = null;
      for (Entry<Double, Double> entry : cumulativeFrequencies.entrySet()) {
        if (previous == null && score <= entry.getKey()) {
          return 1.0; // smaller than all
        }
        if (previous != null && previous.getKey() <= score && score < entry.getKey()) {
          // interpolate and return
          final double dx = (entry.getKey() - previous.getKey()) / 2.0;
          return 1 - (previous.getValue() + dx * (entry.getValue() - previous.getValue()));
        }
        previous = entry;
      }
      // If we reach here, p value is 0.0
      return 0.0;
    }
focal_method.class_method_signature: ObjectScoreDistribution.estimatePValue(double score)
focal_method.full_signature: public double estimatePValue(double score)
focal_method.identifier: estimatePValue
focal_method.invocations: entrySet getKey getKey getKey getKey getKey getValue getValue getValue
focal_method.modifiers: public
focal_method.parameters: (double score)
focal_method.return: double
focal_method.signature: double estimatePValue(double score)