MarkerMap, PlinkGenMap, PositionMappublic interface GeneticMap
Interface GeneticMap represents a genetic map for one or more
chromosomes.
Instances of class GeneticMap are immutable.
| Modifier and Type | Method | Description |
|---|---|---|
int |
basePos(int chrom,
double geneticPosition) |
Returns the base position corresponding to the specified genetic map
position.
|
static GeneticMap |
geneticMap(java.io.File file,
ChromInterval chromInt) |
Constructs and returns a genetic map from the specified data.
|
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.
|
default double[] |
genPos(Markers markers) |
Returns the an array of length
hapPairs.nMarkers() whose
whose j-th element is the genetic map position
of the j-th marker. |
default float[] |
pRecomb(Markers markers,
double intensity) |
Returns the an array of length
hapPairs.nMarkers() whose
whose j-th element for j > 0 is the
probability of recombination between marker j - 1
and marker j. |
java.lang.String |
toString() |
Returns a string representation of this genetic map.
|
int basePos(int chrom,
double geneticPosition)
chrom - the chromosome indexgeneticPosition - the genetic position on the chromosomejava.lang.IllegalArgumentException - if the calculated base position
exceeds Integer.MAX_VALUEjava.lang.IllegalArgumentException - if this genetic map has no
map positions for the specified chromosomejava.lang.IndexOutOfBoundsException - if
chrom < 0 || chrom >= ChromIds.instance().size()double genPos(Marker marker)
marker - a genetic markerjava.lang.IllegalArgumentException - if this genetic map has no
map positions for the specified chromosomejava.lang.NullPointerException - if marker == nulldouble genPos(int chrom,
int basePosition)
chrom - the chromosome indexbasePosition - the base coordinate on the chromosomejava.lang.IllegalArgumentException - if this genetic map has no
map positions for the specified chromosomejava.lang.IndexOutOfBoundsException - if
chrom < 0 || chrom >= ChromIds.instance().size()java.lang.String toString()
toString in class java.lang.Objectstatic GeneticMap geneticMap(java.io.File file, ChromInterval chromInt)
null, the returned genetic map
will convert genome coordinates to genetic units by dividing by
1,000,000. If (chromInt != null) the genetic map will
be restricted to chromosome chromInt.chrom().file - a PLINK-format genetic map file with cM unitschromInt - a chromosome intervaljava.lang.IllegalArgumentException - if any map position is infinite
or NaNjava.lang.NumberFormatException - if the base position on any line of the map
file is not a parsable integerjava.lang.NumberFormatException - if the genetic map position on any
line of the map file is not a parsable doublejava.lang.IllegalArgumentException - if a non-empty line of the specified
genetic map file does not contain 4 fieldsjava.lang.IllegalArgumentException - if the map positions on each
chromosome are not sorted in ascending orderjava.lang.IllegalArgumentException - if there are duplicate
base positions on a chromosomejava.lang.IllegalArgumentException - if all base positions on a chromosome
have the same genetic map positiondefault double[] genPos(Markers markers)
hapPairs.nMarkers() whose
whose j-th element is the genetic map position
of the j-th marker.markers - the list of markersjava.lang.IllegalArgumentException - if this genetic map does not contain a
map position for any specified markerjava.lang.NullPointerException - if markers == nulldefault float[] pRecomb(Markers markers, double intensity)
hapPairs.nMarkers() whose
whose j-th element for j > 0 is the
probability of recombination between marker j - 1
and marker j. The initial marker on a chromosome has
recombination probability 0.
Any inter-marker genetic distances less than 1e-7 cM are
increased to 1e-7 cM.markers - the list of markersintensity - the reciprocal of the expected length of the
longest IBD segment at a locusjava.lang.IllegalArgumentException - if
intensity <= 0.0 || Double.isFinite(intensity)==falsejava.lang.IllegalArgumentException - if this genetic map does not contain a
map position for any specified markerjava.lang.NullPointerException - if markers == null