Package vcf

Class PositionMap

  • All Implemented Interfaces:
    GeneticMap

    public class PositionMap
    extends java.lang.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

      All 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.
      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 scaleFactor()
      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
    • Constructor Detail

      • 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:
        java.lang.IllegalArgumentException - if scaleFactor <= 0d || Double.isFinite(scaleFactor) == false
    • Method Detail

      • 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