Package phase
Class Ibs2
- java.lang.Object
-
- phase.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.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
areIbs2(int targSample, int otherSample, int marker)
Returnstrue
if the specified samples are estimated to be IBS2 at the specified marker, and the IBS2 interval is at leastthis.minCmIbs2()
cM in length, and returnsfalse
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.
-
-
-
Constructor Detail
-
Ibs2
public Ibs2(GT targGT, RefGT refGT, MarkerMap map)
Constructs a newIbs2
instance from the specified data.- Parameters:
targGT
- the target genotype datarefGT
- the reference genotype data ornull
if 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. Returnsnull
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)
Returnstrue
if the specified samples are estimated to be IBS2 at the specified marker, and the IBS2 interval is at leastthis.minCmIbs2()
cM in length, and returnsfalse
otherwise. 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:
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())
-
-