Package beagleutil

Class CompHapSegment

java.lang.Object
beagleutil.CompHapSegment
All Implemented Interfaces:
Comparable<CompHapSegment>

public class CompHapSegment extends Object implements 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 startMarker, int ibsStep, int compHapIndex)
    Constructs a new CompHapSegment from the specified data.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Compares the specified segment to this for order.
    int
    Returns the composite haplotype index.
    int
    hap()
    Returns the haplotype.
    int
    Returns the last recorded IBS step for this.hap().
    void
    setLastIbsStep(int ibsStep)
    Updates the last recorded IBS step to the specified value
    int
    Returns the first marker in the haplotype segment
    void
    updateSegment(int hap, int startMarker, int lastIbsStep)
    Update the haplotype, the first marker in the haplotype segment, and the last recorded IBS step.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CompHapSegment

      public CompHapSegment(int hap, int startMarker, int ibsStep, int compHapIndex)
      Constructs a new CompHapSegment from the specified data.
      Parameters:
      hap - the haplotype
      startMarker - the index of the first marker in the haplotype segment
      ibsStep - the last recorded IBS step
      compHapIndex - the composite haplotype index
  • Method Details

    • updateSegment

      public void updateSegment(int hap, int startMarker, int lastIbsStep)
      Update the haplotype, the first marker in the haplotype segment, and the last recorded IBS step.
      Parameters:
      hap - the haplotype
      startMarker - the first marker in the haplotype segment
      lastIbsStep - the last recorded IBS step
    • setLastIbsStep

      public void setLastIbsStep(int ibsStep)
      Updates the last recorded IBS step to the specified value
      Parameters:
      ibsStep - the last recorded IBS Step
    • 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
    • lastIbsStep

      public int lastIbsStep()
      Returns the last recorded IBS step for this.hap().
      Returns:
      the last recorded IBS step 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 to this for order. Returns -1, 0, or 1 according to whether this.end() is less than, equal, or greater than seg.end().
      Specified by:
      compareTo in interface 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 than seg.end()