Package phase
Class Ibs2
- java.lang.Object
-
- phase.Ibs2
-
public final class Ibs2 extends java.lang.ObjectClass
Ibs2stores IBS2 segments that any target sample shares with another target or reference sample.Instances of
Ibs2are immutable.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanareIbs2(int targSample, int otherSample, int marker)Returnstrueif the specified samples are estimated to be IBS2 at the specified marker, and the IBS2 interval is at leastthis.minCmIbs2()cM in length, and returnsfalseotherwise.intnSamples()Returns the total number of target and reference samples.GTrefGT()Returns the genotype data for the reference samples.GTtargGT()Returns the genotype data for the target samples.
-
-
-
Constructor Detail
-
Ibs2
public Ibs2(GT targGT, RefGT refGT, MarkerMap map)
Constructs a newIbs2instance from the specified data.- Parameters:
targGT- the target genotype datarefGT- the reference genotype data ornullif there are no reference datamap- an array with the genetic map positions of each marker- Throws:
java.lang.NullPointerException- if(targGT == null || map == null)java.lang.IllegalArgumentException- iftargGT.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. Returnsnullif 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)Returnstrueif the specified samples are estimated to be IBS2 at the specified marker, and the IBS2 interval is at leastthis.minCmIbs2()cM in length, and returnsfalseotherwise. Reference sample indices are must be indexed starting withthis.targGT().nSamples().- Parameters:
targSample- a target sample indexotherSample- a target or reference sample indexmarker- a marker index- Returns:
trueif 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())
-
-