Package vcf
Class MarkerMap
- java.lang.Object
-
- vcf.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 newMarkerMap
instance that is constructed from the specified datadouble[]
genPos()
Returns the array of genetic map positions whosek
-th element equalsthis.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
-
Methods inherited from interface vcf.GeneticMap
genPos, pRecomb, toString
-
-
-
-
Method Detail
-
create
public static MarkerMap create(GeneticMap genMap, Markers markers)
Returns a newMarkerMap
instance that is constructed from the specified data- Parameters:
genMap
- the genetic mapmarkers
- a list of markers- Returns:
- a returns new
MarkerMap
instance - Throws:
java.lang.IllegalArgumentException
- ifmarkers.marker(0).chromIndex() != markers.marker(markers.nMarkers()-1).chromIndex()
java.lang.NullPointerException
- ifgenMap == 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 interfaceGeneticMap
- Parameters:
chrom
- the chromosome indexgeneticPosition
- 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 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
-
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
- ifmarker < 0 || marker >= this.nMarkers()
-
genPos
public double[] genPos()
Returns the array of genetic map positions whosek
-th element equalsthis.genPos(k)
.- Returns:
- the array of genetic map positions
-
-