Package phase

Class Ibs2

java.lang.Object
phase.Ibs2

public final class Ibs2 extends Object

Class Ibs2 stores IBS2 segments that any target sample shares with another target sample.

Instances of Ibs2 are immutable.

  • Constructor Summary

    Constructors
    Constructor
    Description
    Ibs2(GT targGT, MarkerMap map, FloatArray maf)
    Constructs a new Ibs2 instance from the specified data.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    areIbs2(int targSample, int otherSample, int marker)
    Returns true if (otherSample < this.nTargSamples() and the specified samples are estimated to be IBS2 at the specified marker, and returns false otherwise.
    boolean
    areIbs2(int targSample, int otherSample, int start, int inclEnd)
    Returns true if (0 <= otherSample && otherSample < this.nTargSamples()) and the specified samples are estimated to be IBS2 within the specified interval and returns false otherwise.
    int
    nIbs2Segments(int targSample)
    Returns the number of IBS2 segments for the specified target sample
    int
    Returns the number of markers.
    int
    Returns the number of target samples.

    Methods inherited from class java.lang.Object

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

    • Ibs2

      public Ibs2(GT targGT, MarkerMap map, FloatArray maf)
      Constructs a new Ibs2 instance from the specified data.
      Parameters:
      targGT - the target genotype data
      map - a list whose j-th element is the genetic map position of the j-th the marker
      maf - a list whose j-th element is the estimated minor allele frequency of the j-th the marker
      Throws:
      IllegalArgumentException - if targGT.nMarkers() != map.genPos().size()
      IllegalArgumentException - if targGT.nMarkers() != maf.size()
      NullPointerException - if (targGT == null || map == null || maf == null)
  • Method Details

    • nMarkers

      public int nMarkers()
      Returns the number of markers.
      Returns:
      the number of markers
    • nTargSamples

      public int nTargSamples()
      Returns the number of target samples.
      Returns:
      the number of target samples
    • nIbs2Segments

      public int nIbs2Segments(int targSample)
      Returns the number of IBS2 segments for the specified target sample
      Parameters:
      targSample - a target sample index
      Returns:
      the number of IBS2 segments for the specified target sample
      Throws:
      IndexOutOfBoundsException - if targSample < 0 || targSample >= this.nTargSamples()
    • areIbs2

      public boolean areIbs2(int targSample, int otherSample, int marker)
      Returns true if (otherSample < this.nTargSamples() and the specified samples are estimated to be IBS2 at the specified marker, and returns false otherwise.
      Parameters:
      targSample - a target sample index
      otherSample - a sample index
      marker - a marker index
      Returns:
      true if the specified samples are estimated to be IBD2 at the specified marker
      Throws:
      IndexOutOfBoundsException - if (targSample < 0 || targSample >= this.nTargSamples())
      IndexOutOfBoundsException - if otherSample < 0
      IndexOutOfBoundsException - if (marker < 0 || marker >= this.nMarkers())
    • areIbs2

      public boolean areIbs2(int targSample, int otherSample, int start, int inclEnd)
      Returns true if (0 <= otherSample && otherSample < this.nTargSamples()) and the specified samples are estimated to be IBS2 within the specified interval and returns false otherwise.
      Parameters:
      targSample - a target sample index
      otherSample - a sample index
      start - the starting marker index
      inclEnd - the ending marker index (inclusive)
      Returns:
      true if (0 <= otherSample && otherSample < this.nTargSamples()) and the specified samples are estimated to be IBS2 within the specified interval
      Throws:
      IndexOutOfBoundsException - if (targSample < 0 || targSample >= this.nTargSamples())
      IndexOutOfBoundsException - if start > inclEnd