Package vcf
Class XBasicGT1
- java.lang.Object
-
- vcf.XBasicGT1
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
allele1(int marker)
Returns the first allele for the specified marker if the observed data include a non-missing allele, and returns -1 otherwise.int
allele2(int marker)
Returns the second allele for the specified marker if the observed data include a non-missing allele, and returns -1 otherwise.float
gl(int marker, int a1, int a2)
Returns the probability of the observed data for the specified marker if the specified pair of ordered alleles is the true ordered genotype.int
idIndex()
Returns the sample identifier index.boolean
isPhased(int marker)
Returnstrue
if the observed data for the specified marker includes a phased genotype, and returnsfalse
otherwise.boolean
isRefSample()
Returnstrue
if the observed data for each marker includes a phased genotype that has no missing alleles, and returnsfalse
otherwise.Marker
marker(int markerIndex)
Returns the specified marker.Markers
markers()
Returns the list of markers.int
nMarkers()
Returns the number of markers.java.lang.String
toString()
Returns a string representation ofthis
.
-
-
-
Constructor Detail
-
XBasicGT1
public XBasicGT1(GT gl, int sample)
Constructs aXBasicGL1
instance from the specified data.- Parameters:
gl
- the genotype likelihoodssample
- the sample index- Throws:
java.lang.IndexOutOfBoundsException
- ifsamples < 0 || sample >= gl.nSamples()
java.lang.NullPointerException
- ifgl == null
-
XBasicGT1
public XBasicGT1(GT gt, int sample, int father, int mother)
Constructs aXBasicGL1
instance from the specified data.- Parameters:
gt
- the genotype datasample
- the sample indexfather
- the sample index of the sample's father, or -1 if the father is not genotypedmother
- the sample index of the sample's mother, or -1 if the mother is not genotyped- Throws:
java.lang.IndexOutOfBoundsException
- ifsamples < 0 || sample >= gl.nSamples()
java.lang.NullPointerException
- ifgl == null
-
-
Method Detail
-
isRefSample
public boolean isRefSample()
Description copied from interface:XGT1
Returnstrue
if the observed data for each marker includes a phased genotype that has no missing alleles, and returnsfalse
otherwise.- Specified by:
isRefSample
in interfaceXGT1
- Returns:
true
if the observed data for each marker includes a phased genotype that has no missing alleles, andfalse
otherwise
-
gl
public float gl(int marker, int a1, int a2)
Description copied from interface:XGT1
Returns the probability of the observed data for the specified marker if the specified pair of ordered alleles is the true ordered genotype.
-
isPhased
public boolean isPhased(int marker)
Description copied from interface:XGT1
Returnstrue
if the observed data for the specified marker includes a phased genotype, and returnsfalse
otherwise.
-
allele1
public int allele1(int marker)
Description copied from interface:XGT1
Returns the first allele for the specified marker if the observed data include a non-missing allele, and returns -1 otherwise. Alleles are arbitrarily ordered if the genotype is unphased.
-
allele2
public int allele2(int marker)
Description copied from interface:XGT1
Returns the second allele for the specified marker if the observed data include a non-missing allele, and returns -1 otherwise. Alleles are arbitrarily ordered if the genotype is unphased.
-
nMarkers
public int nMarkers()
Description copied from interface:XGT1
Returns the number of markers.
-
marker
public Marker marker(int markerIndex)
Description copied from interface:XGT1
Returns the specified marker.
-
markers
public Markers markers()
Description copied from interface:XGT1
Returns the list of markers.
-
idIndex
public int idIndex()
Description copied from interface:XGT1
Returns the sample identifier index.
-
toString
public java.lang.String toString()
Description copied from interface:XGT1
Returns a string representation ofthis
. The exact details of the representation are unspecified and subject to change.
-
-