Package vcf

Class PositionMap

java.lang.Object
vcf.PositionMap
All Implemented Interfaces:
GeneticMap

public class PositionMap extends Object implements GeneticMap

Class PositionMap represents a genetic map obtained by multiplying chromosome position by a scale factor.

Instances of class PositionMap are immutable.

  • Constructor Summary

    Constructors
    Constructor
    Description
    PositionMap(double scaleFactor)
    Constructs a new PositionMap instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    basePos(int chrom, double geneticPosition)
    Returns the base position corresponding to the specified genetic map position.
    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.
    double
    Returns the scale factor that is multiplied by the chromosome position to obtain the corresponding genetic map position

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface vcf.GeneticMap

    toString
  • Constructor Details

    • PositionMap

      public PositionMap(double scaleFactor)
      Constructs a new PositionMap instance.
      Parameters:
      scaleFactor - the factor that is multiplied by a base position to obtain the corresponding genetic map position
      Throws:
      IllegalArgumentException - if scaleFactor <= 0d || Double.isFinite(scaleFactor) == false
  • Method Details

    • scaleFactor

      public double scaleFactor()
      Returns the scale factor that is multiplied by the chromosome position to obtain the corresponding genetic map position
      Returns:
      the scale factor.
    • 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