Package beagleutil
Class CompHapSegment
- java.lang.Object
-
- beagleutil.CompHapSegment
-
- All Implemented Interfaces:
java.lang.Comparable<CompHapSegment>
public class CompHapSegment extends java.lang.Object implements java.lang.Comparable<CompHapSegment>
Class
CompHapSegment
represents a copied haplotype segment in a composite reference haplotype.Instances of class
CompHapSegment
are not thread-safe.
-
-
Constructor Summary
Constructors Constructor Description CompHapSegment(int hap, int start, int ibsStep, int compHapIndex)
Constructs a newCompHapSegment
from the specified data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(CompHapSegment seg)
Compares the specified segment tothis
for order.int
compHapIndex()
Returns the composite haplotype index.int
hap()
Returns the haplotype.int
ibsStep()
Returns the last recorded IBS ibsStep forthis.hap()
.int
startMarker()
Returns the first marker in the haplotype segmentvoid
updateSegment(int hap, int start, int ibsStep)
Update the haplotype, the first marker in the haplotype segment, and the last recorded IBS ibsStep.void
updateStep(int ibsStep)
Updates the last recorded IBS ibsStep to the specified value
-
-
-
Constructor Detail
-
CompHapSegment
public CompHapSegment(int hap, int start, int ibsStep, int compHapIndex)
Constructs a newCompHapSegment
from the specified data.- Parameters:
hap
- the haplotypestart
- the index of the first marker in the haplotype segmentibsStep
- the last recorded IBS ibsStepcompHapIndex
- the composite haplotype index
-
-
Method Detail
-
updateSegment
public void updateSegment(int hap, int start, int ibsStep)
Update the haplotype, the first marker in the haplotype segment, and the last recorded IBS ibsStep.- Parameters:
hap
- the haplotypestart
- the index of the first marker in the haplotype segmentibsStep
- the last recorded IBS ibsStep
-
updateStep
public void updateStep(int ibsStep)
Updates the last recorded IBS ibsStep to the specified value- Parameters:
ibsStep
- the last recorded IBS ibsStep
-
hap
public int hap()
Returns the haplotype.- Returns:
- the haplotype
-
startMarker
public int startMarker()
Returns the first marker in the haplotype segment- Returns:
- the first marker in the haplotype segment
-
ibsStep
public int ibsStep()
Returns the last recorded IBS ibsStep forthis.hap()
.- Returns:
- the last recorded IBS ibsStep for
this.hap()
-
compHapIndex
public int compHapIndex()
Returns the composite haplotype index.- Returns:
- the composite haplotype index
-
compareTo
public int compareTo(CompHapSegment seg)
Compares the specified segment tothis
for order. Returns -1, 0, or 1 according to whetherthis.end()
is less than, equal, or greater thanseg.end()
.- Specified by:
compareTo
in interfacejava.lang.Comparable<CompHapSegment>
- Parameters:
seg
- the object to be compared- Returns:
- -1, 0, or 1 according to whether
this.end()
is less than, equal, or greater thanseg.end()
-
-