Package haplotype
Class BitHapPair
- java.lang.Object
-
- haplotype.BitHapPair
-
-
Constructor Summary
Constructors Constructor Description BitHapPair(Markers markers, int idIndex, int[] alleles1, int[] alleles2)
Constructs a newBitHapPair
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
allele1(int marker)
Returns the first allele for the specified marker.int
allele2(int marker)
Returns the second allele for the specified marker.int
idIndex()
Returns the sample identifier index.Marker
marker(int marker)
Returns the specified marker.Markers
markers()
Returns the markers.int
nMarkers()
Returns the number of markers.java.lang.String
toString()
Returns a string representation ofthis
.
-
-
-
Constructor Detail
-
BitHapPair
public BitHapPair(Markers markers, int idIndex, int[] alleles1, int[] alleles2)
Constructs a newBitHapPair
instance.- Parameters:
markers
- the sequence of markersidIndex
- the sample identifier indexalleles1
- the sequence of allele indices for the first haplotypealleles2
- the sequence of alleles indices for the second haplotype- Throws:
java.lang.IllegalArgumentException
- ifalleles1.length != markers.nMarkers() || alleles2.length != markers.nMarkers()
java.lang.IllegalArgumentException
- ifalleles1[k] < 0 || allele1[k] >= markers.marker(k).nAlleles()
for somek
satisfying0 <= k && k < markers.nMarkers()
java.lang.IllegalArgumentException
- ifalleles2[k] < 0 || allele2[k] >= markers.marker(k).nAlleles()
for somek
satisfying0 <= k && k < markers.nMarkers()
java.lang.IndexOutOfBoundsException
- ifidIndex < 0
java.lang.NullPointerException
- ifmarker == null || alleles1 == null || allele2 == null
-
-
Method Detail
-
allele1
public int allele1(int marker)
Description copied from interface:HapPair
Returns the first allele for the specified marker.
-
allele2
public int allele2(int marker)
Description copied from interface:HapPair
Returns the second allele for the specified marker.
-
marker
public Marker marker(int marker)
Description copied from interface:HapPair
Returns the specified marker.
-
nMarkers
public int nMarkers()
Description copied from interface:HapPair
Returns the number of markers.
-
idIndex
public int idIndex()
Description copied from interface:HapPair
Returns the sample identifier index.
-
toString
public java.lang.String toString()
Returns a string representation ofthis
. The exact details of the representation are unspecified and subject to change.- Overrides:
toString
in classjava.lang.Object
- Returns:
- a string representation of
this
-
-