Package vcf
Class PositionMap
java.lang.Object
vcf.PositionMap
- All Implemented Interfaces:
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 -
Method Summary
Modifier and TypeMethodDescriptionintbasePos(int chrom, double geneticPosition) Returns the base position corresponding to the specified genetic map position.doublegenPos(int chrom, int basePosition) Returns the genetic map position of the specified genome coordinate.doubleReturns the genetic map position of the specified marker.doubleReturns the scale factor that is multiplied by the chromosome position to obtain the corresponding genetic map positionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface vcf.GeneticMap
toString
-
Constructor Details
-
PositionMap
public PositionMap(double scaleFactor) Constructs a newPositionMapinstance.- Parameters:
scaleFactor- the factor that is multiplied by a base position to obtain the corresponding genetic map position- Throws:
IllegalArgumentException- ifscaleFactor <= 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:GeneticMapReturns 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:
basePosin interfaceGeneticMap- Parameters:
chrom- the chromosome indexgeneticPosition- the genetic position on the chromosome- Returns:
- the base position corresponding to the specified genetic map position
-
genPos
Description copied from interface:GeneticMapReturns the genetic map position of the specified marker. The genetic map position is estimated using linear interpolation.- Specified by:
genPosin interfaceGeneticMap- 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:GeneticMapReturns the genetic map position of the specified genome coordinate. The genetic map position is estimated using linear interpolation.- Specified by:
genPosin interfaceGeneticMap- Parameters:
chrom- the chromosome indexbasePosition- the base coordinate on the chromosome- Returns:
- the genetic map position of the specified genome coordinate
-