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 TypeMethodDescriptionint
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
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 positionMethods 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 newPositionMap
instance.- 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: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 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:GeneticMap
Returns the genetic map position of the specified marker. The genetic map position is estimated using linear interpolation.- Specified by:
genPos
in 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:GeneticMap
Returns the genetic map position of the specified genome coordinate. The genetic map position is estimated using linear interpolation.- Specified by:
genPos
in interfaceGeneticMap
- Parameters:
chrom
- the chromosome indexbasePosition
- the base coordinate on the chromosome- Returns:
- the genetic map position of the specified genome coordinate
-