Package vcf

Class MarkerMap

  • All Implemented Interfaces:
    GeneticMap

    public class MarkerMap
    extends java.lang.Object
    implements GeneticMap

    Class MarkerMap represents genetic map positions for a list of markers.

    Instances of class MarkerMap are immutable.

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int basePos​(int chrom, double geneticPosition)
      Returns the base position corresponding to the specified genetic map position.
      java.lang.String chrom()
      Returns the chromosome corresponding to the list of markers.
      int chromIndex()
      Returns the index of the chromosome corresponding to the list of markers.
      static MarkerMap create​(GeneticMap genMap, Markers markers)
      Returns a new MarkerMap instance that is constructed from the specified data
      double[] genPos()
      Returns the array of genetic map positions whose k-th element equals this.genPos(k).
      double genPos​(int marker)
      Returns the genetic map position of the specified marker.
      double genPos​(int chrom, int basePosition)
      Returns the genetic map position of the specified genome coordinate.
      double genPos​(Marker marker)
      Returns the genetic map position of the specified marker.
      Marker marker​(int marker)
      Returns the specified marker.
      Markers markers()
      Returns the list of markers.
      int nMarkers()
      Returns the number of markers.
      • Methods inherited from class java.lang.Object

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

      • create

        public static MarkerMap create​(GeneticMap genMap,
                                       Markers markers)
        Returns a new MarkerMap instance that is constructed from the specified data
        Parameters:
        genMap - the genetic map
        markers - a list of markers
        Returns:
        a returns new MarkerMap instance
        Throws:
        java.lang.IllegalArgumentException - if markers.marker(0).chromIndex() != markers.marker(markers.nMarkers()-1).chromIndex()
        java.lang.NullPointerException - if genMap == null || markers == null
      • chrom

        public java.lang.String chrom()
        Returns the chromosome corresponding to the list of markers.
        Returns:
        the chromosome corresponding to the list of markers
      • chromIndex

        public int chromIndex()
        Returns the index of the chromosome corresponding to the list of markers.
        Returns:
        the index of the chromosome corresponding to the list of markers
      • basePos

        public int basePos​(int chrom,
                           double geneticPosition)
        Description copied from interface: GeneticMap
        Returns the base position corresponding to the specified genetic map position. If the genetic position is not a map position then the base position is estimated from the nearest genetic map positions using linear interpolation.
        Specified by:
        basePos in interface GeneticMap
        Parameters:
        chrom - the chromosome index
        geneticPosition - the genetic position on the chromosome
        Returns:
        the base position corresponding to the specified genetic map position
      • genPos

        public double genPos​(Marker marker)
        Description copied from interface: GeneticMap
        Returns the genetic map position of the specified marker. The genetic map position is estimated using linear interpolation.
        Specified by:
        genPos in interface GeneticMap
        Parameters:
        marker - a genetic marker
        Returns:
        the genetic map position of the specified marker
      • genPos

        public double genPos​(int chrom,
                             int basePosition)
        Description copied from interface: GeneticMap
        Returns the genetic map position of the specified genome coordinate. The genetic map position is estimated using linear interpolation.
        Specified by:
        genPos in interface GeneticMap
        Parameters:
        chrom - the chromosome index
        basePosition - the base coordinate on the chromosome
        Returns:
        the genetic map position of the specified genome coordinate
      • nMarkers

        public int nMarkers()
        Returns the number of markers.
        Returns:
        the number of markers
      • markers

        public Markers markers()
        Returns the list of markers.
        Returns:
        the list of markers
      • marker

        public Marker marker​(int marker)
        Returns the specified marker.
        Parameters:
        marker - a marker index
        Returns:
        the specified marker
      • genPos

        public double genPos​(int marker)
        Returns the genetic map position of the specified marker.
        Parameters:
        marker - a marker index
        Returns:
        the genetic map position of the specified marker
        Throws:
        java.lang.IndexOutOfBoundsException - if marker < 0 || marker >= this.nMarkers()
      • genPos

        public double[] genPos()
        Returns the array of genetic map positions whose k-th element equals this.genPos(k).
        Returns:
        the array of genetic map positions