Package vcf
Class MarkerMap
- java.lang.Object
-
- vcf.MarkerMap
-
- All Implemented Interfaces:
GeneticMap
public class MarkerMap extends java.lang.Object implements GeneticMap
Class
MarkerMaprepresents genetic map positions for a list of markers.Instances of class
MarkerMapare immutable.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intbasePos(int chrom, double geneticPosition)Returns the base position corresponding to the specified genetic map position.java.lang.Stringchrom()Returns the chromosome corresponding to the list of markers.intchromIndex()Returns the index of the chromosome corresponding to the list of markers.static MarkerMapcreate(GeneticMap genMap, Markers markers)Returns a newMarkerMapinstance that is constructed from the specified datadouble[]genPos()Returns the array of genetic map positions whosek-th element equalsthis.genPos(k).doublegenPos(int marker)Returns the genetic map position of the specified marker.doublegenPos(int chrom, int basePosition)Returns the genetic map position of the specified genome coordinate.doublegenPos(Marker marker)Returns the genetic map position of the specified marker.Markermarker(int marker)Returns the specified marker.Markersmarkers()Returns the list of markers.intnMarkers()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 newMarkerMapinstance that is constructed from the specified data- Parameters:
genMap- the genetic mapmarkers- a list of markers- Returns:
- a returns new
MarkerMapinstance - 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: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
public double genPos(Marker marker)
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
-
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
-
-