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 sample.Instances of
Ibs2are immutable.
-
-
Constructor Summary
Constructors Constructor Description Ibs2(GT targGT, MarkerMap map, FloatArray maf)Constructs a newIbs2instance from the specified data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanareIbs2(int targSample, int otherSample, int marker)Returnstrueif(otherSample < this.nTargSamples()and the specified samples are estimated to be IBS2 at the specified marker, and returnsfalseotherwise.booleanareIbs2(int targSample, int otherSample, int start, int inclEnd)Returnstrueif(0 <= otherSample && otherSample < this.nTargSamples())and the specified samples are estimated to be IBS2 within the specified interval and returnsfalseotherwise.intnIbs2Segments(int targSample)Returns the number of IBS2 segments for the specified target sampleintnMarkers()Returns the number of markers.intnTargSamples()Returns the number of target samples.
-
-
-
Constructor Detail
-
Ibs2
public Ibs2(GT targGT, MarkerMap map, FloatArray maf)
Constructs a newIbs2instance from the specified data.- Parameters:
targGT- the target genotype datamap- a list whosej-th element is the genetic map position of thej-th the markermaf- a list whosej-th element is the estimated minor allele frequency of thej-th the marker- Throws:
java.lang.IllegalArgumentException- iftargGT.nMarkers() != map.genPos().size()java.lang.IllegalArgumentException- iftargGT.nMarkers() != maf.size()java.lang.NullPointerException- if(targGT == null || map == null || maf == null)
-
-
Method Detail
-
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:
java.lang.IndexOutOfBoundsException- iftargSample < 0 || targSample >= this.nTargSamples()
-
areIbs2
public boolean areIbs2(int targSample, int otherSample, int marker)Returnstrueif(otherSample < this.nTargSamples()and the specified samples are estimated to be IBS2 at the specified marker, and returnsfalseotherwise.- Parameters:
targSample- a target sample indexotherSample- a 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.nTargSamples())java.lang.IndexOutOfBoundsException- ifotherSample < 0java.lang.IndexOutOfBoundsException- if(marker < 0 || marker >= this.nMarkers())
-
areIbs2
public boolean areIbs2(int targSample, int otherSample, int start, int inclEnd)Returnstrueif(0 <= otherSample && otherSample < this.nTargSamples())and the specified samples are estimated to be IBS2 within the specified interval and returnsfalseotherwise.- Parameters:
targSample- a target sample indexotherSample- a sample indexstart- the starting marker indexinclEnd- the ending marker index (inclusive)- Returns:
trueif(0 <= otherSample && otherSample < this.nTargSamples())and the specified samples are estimated to be IBS2 within the specified interval- Throws:
java.lang.IndexOutOfBoundsException- if(targSample < 0 || targSample >= this.nTargSamples())java.lang.IndexOutOfBoundsException- ifstart > inclEnd
-
-