java.lang.Object
org.broadinstitute.hellbender.tools.copynumber.utils.optimization.PersistenceOptimizer

public final class PersistenceOptimizer extends Object
Given 1-dimensional data, finds all local minima sorted by decreasing topological persistence. This can be useful for finding the most significant local minima in noisy data and can be used to smooth out less significant local minima that may be induced by noise. Algorithm is adapted from https://www.csc.kth.se/~weinkauf/notes/persistence1d.html.
  • Constructor Details

    • PersistenceOptimizer

      public PersistenceOptimizer(double[] data)
      Identifies the local minima of data based on topological persistence upon construction. Note that for a region where the data takes constant values that occurs either to the right of a local maximum or at the beginning of the data, the leftmost point in the region is considered a local minimum.
      Parameters:
      data - values of a one-dimensional function evaluated at points in left-to-right order
  • Method Details

    • getMinimaIndices

      public List<Integer> getMinimaIndices()
      Returns an unmodifiable list of the indices of the local minima, sorted first by decreasing topological persistence and then by increasing index. The first element is the index of the global minimum.
    • getPersistences

      public List<Double> getPersistences()
      Returns the corresponding unmodifiable list of the topological persistences of the local minima given by getMinimaIndices().