public class CurrentData
extends java.lang.Object
Class CurrentData
represents input data for the current marker
window. All marker indices returned my methods of class CurrentData
are indexed with respect to the current marker window.
Instances of class CurrentData
are immutable.
Constructor and Description |
---|
CurrentData(Par par,
GeneticMap genMap,
Data data,
SampleHapPairs overlapHaps,
NuclearFamilies families)
Constructs a new
CurrentData instance from the specified
data. |
Modifier and Type | Method and Description |
---|---|
void |
addRestrictedRefHapPairs(java.util.List<HapPair> list)
Add the reference haplotype pairs that are restricted
to the target data markers to the specified list.
|
Samples |
allSamples()
Returns a list of all target and reference samples.
|
NuclearFamilies |
families()
Returns the parent-offspring relationships.
|
SampleHapPairs |
initHaps()
Returns the target data haplotype pairs in the segment of the current
marker window preceding the splice point with the previous marker window:
this.targetMarkers().restrict(0, this.prevTargetSplice()) |
int |
markerIndex(int targetMarker)
Returns the index of the specified marker in the reference data markers.
|
int[] |
markerIndices()
Returns an array of length
this.nTargetMarkers() which maps
the k -th marker in the list of target data markers to the
index of the marker in the list of reference data markers. |
Markers |
markers()
Returns the list of reference data markers.
|
int |
nAllSamples()
Returns the number of reference and target samples.
|
int |
nextOverlapStart()
Returns the first marker index in the overlap between this
marker window and the next marker window, or
returns
this.nMarkers() there is no overlap. |
int |
nextSpliceStart()
Returns the first marker index after the splice point between this
marker window and the next marker window, or returns
this.nMarkers() if there is no overlap or if there are
no markers after the splice point. |
int |
nextTargetOverlapStart()
Returns the first target marker index in the overlap between this
marker window and the next marker window, or
returns
this.nMarkers() if there is no overlap or if there are
no target markers in the overlap. |
int |
nextTargetSpliceStart()
Returns the first target marker index after the splice point between this
marker window and the next marker window, or returns
this.nTargetMarkers() if there is no overlap or if there are
no target markers after the splice point |
int |
nMarkers()
Returns the number of reference data markers.
|
int |
nRefSamples()
Returns the number of reference samples.
|
int |
nTargetMarkers()
Returns the number of target data markers.
|
int |
nTargetSamples()
Returns the number of target samples.
|
int |
prevSpliceStart()
Returns the first marker index after the splice point with
the previous marker window.
|
int |
prevTargetSpliceStart()
Returns the first target marker index after the splice point with
the previous marker window.
|
float[] |
recombRate()
Returns an array whose initial element is
0 and whose
j -th element for j > 0 is the recombination rate
between the target markers with indices (j - 1) and j . |
SampleHapPairs |
refSampleHapPairs()
Returns a list of reference haplotype pairs, or returns
null
if there are no reference samples. |
Samples |
refSamples()
Returns the list of reference samples, or
null if
there are no reference samples. |
SampleHapPairs |
restrictedRefSampleHapPairs()
Returns a list of reference haplotype pairs that are restricted
to the target data markers, or returns
null
if there are no reference samples. |
GL |
targetGL()
Returns the genotype likelihoods for the
target samples at the target data markers.
|
int |
targetMarkerIndex(int marker)
Returns the index of the specified marker in the target data, or
returns -1 if the marker is not present in the target data.
|
int[] |
targetMarkerIndices()
Returns an array of length
this.nMarkers() whose k -th
element is the index of the k -th marker in the list of target
markers or is -1 if the marker is not present in the target data. |
Markers |
targetMarkers()
Returns the list of target data markers.
|
Samples |
targetSamples()
Returns the list of target samples.
|
Weights |
weights()
Returns the per-haplotype weights.
|
int |
window()
Returns the marker window index.
|
public CurrentData(Par par, GeneticMap genMap, Data data, SampleHapPairs overlapHaps, NuclearFamilies families)
CurrentData
instance from the specified
data.par
- the analysis parametersgenMap
- the genetic map or null
if no
genetic map is specifieddata
- input data for the current marker windowoverlapHaps
- haplotype constraints in the overlap with previous
window or null
if no such constraints existfamilies
- the parent-offspring relationshipsjava.lang.IllegalArgumentException
- if
data.targetSamples().equals(families.samples()) == false
java.lang.IllegalArgumentException
- if
(overlapHaps != null
&& data.targetSamples().equals(overlapHaps.samples()) == false)
java.lang.IllegalArgumentException
- if
(overlapHaps != null &&
overlapHaps.marker(j).equals(data.targetGL().marker(j) == false)
for some j
satisfying
(0 <= j && j <= overlapHaps.nMarkers())
java.lang.NullPointerException
- if any parameter is null
public int window()
public int nextOverlapStart()
this.nMarkers()
there is no overlap.public int nextTargetOverlapStart()
this.nMarkers()
if there is no overlap or if there are
no target markers in the overlap.public int prevSpliceStart()
public int nextSpliceStart()
this.nMarkers()
if there is no overlap or if there are
no markers after the splice point.public int prevTargetSpliceStart()
public int nextTargetSpliceStart()
this.nTargetMarkers()
if there is no overlap or if there are
no target markers after the splice pointpublic SampleHapPairs initHaps()
this.targetMarkers().restrict(0, this.prevTargetSplice())
public NuclearFamilies families()
public Weights weights()
public int nRefSamples()
public Samples refSamples()
null
if
there are no reference samples.null
if
there are no reference samplespublic int nTargetSamples()
public Samples targetSamples()
public int nAllSamples()
public Samples allSamples()
this.targetSamples()
. Reference samples are listed last
in the same order as the list returned by this.refSamples()
.public int nTargetMarkers()
public Markers targetMarkers()
public int nMarkers()
public Markers markers()
public int markerIndex(int targetMarker)
targetMarker
- index of a marker in the list of target data markersjava.lang.IndexOutOfBoundsException
- if
targetMarker < 0 || targetMarker >= this.nTargetMarkers()
public int[] markerIndices()
this.nTargetMarkers()
which maps
the k
-th marker in the list of target data markers to the
index of the marker in the list of reference data markers.this.nTargetMarkers()
which maps
the k
-th marker in the list of target data markers to the
index of the marker in the list of reference data markerspublic int targetMarkerIndex(int marker)
marker
- index of a marker in the reference datajava.lang.IndexOutOfBoundsException
- if
marker < 0 || marker >= this.nMarkers()
.public int[] targetMarkerIndices()
this.nMarkers()
whose k
-th
element is the index of the k
-th marker in the list of target
markers or is -1 if the marker is not present in the target data.this.nMarkers()
whose k
-th
element is the index of the k
-th marker in the list of target
markers or is -1 if the marker is not present in the target datapublic void addRestrictedRefHapPairs(java.util.List<HapPair> list)
list
- a list of haplotype pairs for target data markersjava.lang.NullPointerException
- if list == null
public SampleHapPairs restrictedRefSampleHapPairs()
null
if there are no reference samples.public SampleHapPairs refSampleHapPairs()
null
if there are no reference samples.public GL targetGL()
public float[] recombRate()
0
and whose
j
-th element for j > 0
is the recombination rate
between the target markers with indices (j - 1)
and j
.