Package vcf

Class MarkerMap

java.lang.Object
vcf.MarkerMap

public class MarkerMap extends Object

Class MarkerRecombMap represents genetic map positions and inter-marker genetic distances for a sequence of genomic loci.

Instances of class MarkerRecombMap are immutable.

  • Method Summary

    Modifier and Type
    Method
    Description
    static MarkerMap
    create(GeneticMap genMap, double minGenDist, Markers markers)
    Returns a new MarkerMap instance constructed from the specified data.
    static MarkerMap
    create(GeneticMap genMap, Markers markers)
    Returns a new MarkerMap instance constructed from the specified data.
    Return a FloatArray of size this.markers().nMarkers() whose k-th element is the genetic distance between the k-th target marker and the previous marker, or 0.0 if (k == 0).
    Returns a DoubleArray of size this.markers().nMarkers() whose k-th element is the genetic map position of the k-th marker.
    static double
    Returns the mean genetic distance between two consecutive base positions.
    pRecomb(float recombIntensity)
    Returns a map of marker index to the probability of recombination in the interval between the marker and the preceding marker.
    restrict(int[] indices)
    Return a marker map restricted to the specified markers
    restrict(IntArray indices)
    Return a marker map restricted to the specified markers

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • create

      public static MarkerMap create(GeneticMap genMap, Markers markers)
      Returns a new MarkerMap instance constructed from the specified data.
      Parameters:
      genMap - the genetic map
      markers - a list of markers
      Returns:
      a returns new MarkerMap instance
      Throws:
      IllegalArgumentException - if markers.marker(0).chromIndex() != markers.marker(markers.nMarkers() - 1).chromIndex()
      IllegalArgumentException - if the specified genetic map has no map positions for the specified chromosome
      NullPointerException - if genMap == null || markers == null
    • create

      public static MarkerMap create(GeneticMap genMap, double minGenDist, Markers markers)
      Returns a new MarkerMap instance constructed from the specified data.
      Parameters:
      genMap - the genetic map
      minGenDist - the required minimum cM distance between successive markers
      markers - a list of markers
      Returns:
      a returns new MarkerMap instance
      Throws:
      IllegalArgumentException - if markers.marker(0).chromIndex() != markers.marker(markers.nMarkers() - 1).chromIndex()
      IllegalArgumentException - if Double.isFinite(minDist) == false
      IllegalArgumentException - if the specified genetic map has no map positions for the specified chromosome
      NullPointerException - if genMap == null || markers == null
    • meanSingleBaseGenDist

      public static double meanSingleBaseGenDist(GeneticMap genMap, Markers markers)
      Returns the mean genetic distance between two consecutive base positions.
      Parameters:
      genMap - the genetic map
      markers - a list of markers
      Returns:
      the mean genetic distance between two consecutive base positions
      Throws:
      IllegalArgumentException - if markers.marker(0).chromIndex() != markers.marker(markers.nMarkers() - 1).chromIndex()
      IllegalArgumentException - if markers.marker(0).pos() == markers.marker(markers.nMarkers() - 1).pos()
      IllegalArgumentException - if the specified genetic map has no map positions for the specified chromosome
      NullPointerException - if genMap == null || markers == null
    • restrict

      public MarkerMap restrict(int[] indices)
      Return a marker map restricted to the specified markers
      Parameters:
      indices - a list of distinct marker indices in increasing order
      Returns:
      a marker map restricted to the specified markers
      Throws:
      IndexOutOfBoundsException - if there exists j such that (0 <= j && j < indices.length) such that (indices[j] < 0 || indices[j] >= this.nMarkers())
      IllegalArgumentException - if there exists j such that (1 <= j && j < indices.length) such that (indices[j] <= indice[j - 1])
      NullPointerException - if indices == null
    • restrict

      public MarkerMap restrict(IntArray indices)
      Return a marker map restricted to the specified markers
      Parameters:
      indices - a list of distinct marker indices in increasing order
      Returns:
      a marker map restricted to the specified markers
      Throws:
      IndexOutOfBoundsException - if there exists j such that (0 <= j && j < indices.length) such that (indices.get(j) < 0 || indices.get(j) >= this.nMarkers())
      IllegalArgumentException - if there exists j such that (1 <= j && j < indices.length) such that (indices.get(j) <= indice.get(j - 1))
      NullPointerException - if indices == null
    • genPos

      public DoubleArray genPos()
      Returns a DoubleArray of size this.markers().nMarkers() whose k-th element is the genetic map position of the k-th marker.
      Returns:
      the array of genetic map positions
    • genDist

      public FloatArray genDist()
      Return a FloatArray of size this.markers().nMarkers() whose k-th element is the genetic distance between the k-th target marker and the previous marker, or 0.0 if (k == 0).
      Returns:
      a FloatArray of size this.nTargMarkers() whose k-th element is the genetic distance between the k-th target marker and the previous marker,
    • pRecomb

      public FloatArray pRecomb(float recombIntensity)
      Returns a map of marker index to the probability of recombination in the interval between the marker and the preceding marker.
      Parameters:
      recombIntensity - the intensity of the exponential distribution that gives the probability of transitioning to a random HMM state in a specified cM distance
      Returns:
      a map of marker index to the probability of recombination in the interval between the marker and the preceding marker
      Throws:
      IllegalArgumentException - if intensity <= 0.0 || Float.isFinite(intensity)==false