java.lang.Object
org.monarchinitiative.lirical.core.analysis.TestResult
All Implemented Interfaces:
Comparable<TestResult>

public class TestResult extends Object implements Comparable<TestResult>
This class organizes information about the result of a test. The class is intended to be used together with the class AnalysisData, which contains lists of observed and excluded HPO terms. For each disease in the database, the likelihood ratios of these phenotypes is calculated, and the result for each disease is stored in an object of this class. This object can include the result of a likelihood ratio for a genotype test. However, not every disease is associated with a known disease gene. Therefore, if no genotype is available, genotypeLr is null.
Version:
0.4.5 (2019-10-28)
Author:
Peter Robinson
  • Method Details

    • of

      public static TestResult of(org.monarchinitiative.phenol.ontology.data.TermId diseaseId, double pretestProbability, List<LrWithExplanation> observedResults, List<LrWithExplanation> excludedResults, GenotypeLrWithExplanation genotypeLr)
    • observedResults

      public List<LrWithExplanation> observedResults()
    • observedTerms

      public List<org.monarchinitiative.phenol.ontology.data.TermId> observedTerms()
    • excludedResults

      public List<LrWithExplanation> excludedResults()
    • excludedTerms

      public List<org.monarchinitiative.phenol.ontology.data.TermId> excludedTerms()
    • getCompositeLR

      public double getCompositeLR()
      Returns:
      the composite likelihood ratio (product of the LRs of the individual tests).
    • getNumberOfTests

      public int getNumberOfTests()
      Returns:
      the total count of tests performed (excluding genotype).
    • pretestOdds

      public double pretestOdds()
      Returns:
      the pretest odds.
    • posttestOdds

      public double posttestOdds()
      Returns:
      the post-test odds.
    • pretestProbability

      public double pretestProbability()
    • posttestProbability

      public double posttestProbability()
    • compareTo

      public int compareTo(TestResult other)
      Compare two TestResult objects based on their compositeLR value.
      Specified by:
      compareTo in interface Comparable<TestResult>
      Parameters:
      other - the "other" TestResult being compared.
      Returns:
      comparison result
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getObservedPhenotypeRatio

      public double getObservedPhenotypeRatio(int i)
      Parameters:
      i - index of the test we are interested in for an observed phenotype
      Returns:
      the likelihood ratio of the i'th test
    • getExcludedPhenotypeRatio

      public double getExcludedPhenotypeRatio(int i)
      Parameters:
      i - index of the test we are interested in for an excluded phenotype
      Returns:
      the likelihood ratio of the i'th test
    • diseaseId

      public org.monarchinitiative.phenol.ontology.data.TermId diseaseId()
      Returns:
      name of the disease being tested.
    • genotypeLr

      public Optional<GenotypeLrWithExplanation> genotypeLr()
    • getMaximumIndividualLR

      public double getMaximumIndividualLR()
      Calculate the maximum absolute value of any individual likelihood ratio. This is used to help layout the SVG
      Returns:
      maximum abs(LR)