Package phase

Class Ibs2


  • public final class Ibs2
    extends java.lang.Object

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

    Instances of Ibs2 are immutable.

    • Constructor Summary

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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean areIbs2​(int targSample, int otherSample, int marker)
      Returns true if the specified samples are estimated to be IBS2 at the specified marker, and the IBS2 interval is at least this.minCmIbs2() cM in length, and returns false otherwise.
      int nSamples()
      Returns the total number of target and reference samples.
      GT refGT()
      Returns the genotype data for the reference samples.
      GT targGT()
      Returns the genotype data for the target samples.
      • Methods inherited from class java.lang.Object

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

      • Ibs2

        public Ibs2​(GT targGT,
                    RefGT refGT,
                    MarkerMap map)
        Constructs a new Ibs2 instance from the specified data.
        Parameters:
        targGT - the target genotype data
        refGT - the reference genotype data or null if there are no reference data
        map - an array with the genetic map positions of each marker
        Throws:
        java.lang.NullPointerException - if (targGT == null || map == null)
        java.lang.IllegalArgumentException - if targGT.nMarkers() != map.genPos().size()
        java.lang.IllegalArgumentException - if (refGT != null && refGT.markers().equals(targGT.markers())==false)
        java.lang.IllegalArgumentException - if (minCmIbs2 <= 0 || Double.isFinite(minCmIbs2) == false)
    • Method Detail

      • targGT

        public GT targGT()
        Returns the genotype data for the target samples.
        Returns:
        the genotype data for the target samples
      • refGT

        public GT refGT()
        Returns the genotype data for the reference samples. Returns null if there are no reference samples.
        Returns:
        the genotype data for the reference samples
      • nSamples

        public int nSamples()
        Returns the total number of target and reference samples.
        Returns:
        the total number of target and reference samples
      • areIbs2

        public boolean areIbs2​(int targSample,
                               int otherSample,
                               int marker)
        Returns true if the specified samples are estimated to be IBS2 at the specified marker, and the IBS2 interval is at least this.minCmIbs2() cM in length, and returns false otherwise. Reference sample indices are must be indexed starting with this.targGT().nSamples().
        Parameters:
        targSample - a target sample index
        otherSample - a target or reference sample index
        marker - a marker index
        Returns:
        true if the specified samples are estimated to be IBD2 at the specified marker
        Throws:
        java.lang.IndexOutOfBoundsException - if (targSample < 0 || targSample >= this.targGT().nSamples())
        java.lang.IndexOutOfBoundsException - if (otherSample < 0 || otherSample >= this.nSamples())
        java.lang.IndexOutOfBoundsException - if (marker < 0 || marker >= this.targGT().nMarkers())