Package vcf
Class SplicedGT
- java.lang.Object
-
- vcf.SplicedGT
-
- All Implemented Interfaces:
GT
public final class SplicedGT extends java.lang.Object implements GT
Class
SplicedGT
represents genotype emission probabilities for a set of samples. The genotype emission probabilities are determined by aRefGTWindow
instance for the initial markers, and are determined by aGT
instance for the remaining markers. TheisPhased()
andisPhased(sample)
methods of theSplicedGT
class return the same values as the corresponding methods of theGT
instance.Instances of class
SplicedGT
are immutable.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
allele(int marker, int hap)
Returns the allele on the specified haplotype for the specified marker or return -1 if the allele is missing.int
allele1(int marker, int sample)
Returns the first allele for the specified marker and sample or return -1 if the allele is missing.int
allele2(int marker, int sample)
Returns the second allele for the specified marker and sample or return -1 if the allele is missing.float
gl(int marker, int sample, int allele1, int allele2)
Returns the probability of the observed data for the specified marker and sample if the specified pair of ordered alleles is the true ordered genotype.boolean
isGTData()
Returnstrue
if the value returned bythis.gl()
is determined by a called or missing genotype, and returnsfalse
otherwise.boolean
isPhased()
Returnstrue
if the genotype for each marker and sample is a phased, non-missing genotype, and returnsfalse
otherwise.boolean
isPhased(int sample)
Returnstrue
if the genotype for each marker for the specified sample is a phased, nonmissing genotype, and returnsfalse
otherwise.boolean
isPhased(int marker, int sample)
Returnstrue
if the genotype for the specified marker and sample is a phased, nonmissing genotype, and returnsfalse
otherwise.Marker
marker(int marker)
Returns the specified marker.Markers
markers()
Returns the list of markers.int
nHaps()
Returns the number of haplotypes.int
nMarkers()
Returns the number of markers.int
nSamples()
Returns the number of samples.Samples
samples()
Returns the list of samples.java.lang.String
toString()
-
-
-
Constructor Detail
-
SplicedGT
public SplicedGT(GT phasedOverlap, GT gt)
Constructs a newSplicedGL
instance.- Parameters:
phasedOverlap
- sample haplotype pairs for the initial markersgt
- genotype emission probabilities for all markers- Throws:
java.lang.IllegalArgumentException
- ifphasedOverlaps.nMarkers() >= gt.nMarkers()
java.lang.IllegalArgumentException
- ifphasedOverlaps.marker(j).equals(gt.marker(j)) == false
for anyj
satisfying0 <= j && j < phasedOverlaps.nMarkers()
java.lang.IllegalArgumentException
- ifphasedOverlaps.samples().equals(gt.samples()) == false
java.lang.IllegalArgumentException
- ifphasedOverlap.isPhased() == false
java.lang.NullPointerException
- ifphasedOverlap == null || gt == null
-
-
Method Detail
-
isPhased
public boolean isPhased()
Description copied from interface:GT
Returnstrue
if the genotype for each marker and sample is a phased, non-missing genotype, and returnsfalse
otherwise.
-
isGTData
public boolean isGTData()
Description copied from interface:GT
Returnstrue
if the value returned bythis.gl()
is determined by a called or missing genotype, and returnsfalse
otherwise.
-
isPhased
public boolean isPhased(int sample)
Description copied from interface:GT
Returnstrue
if the genotype for each marker for the specified sample is a phased, nonmissing genotype, and returnsfalse
otherwise.
-
gl
public float gl(int marker, int sample, int allele1, int allele2)
Description copied from interface:GT
Returns the probability of the observed data for the specified marker and sample if the specified pair of ordered alleles is the true ordered genotype.- Specified by:
gl
in interfaceGT
- Parameters:
marker
- the marker indexsample
- the sample indexallele1
- the first allele indexallele2
- the second allele index- Returns:
- the probability of the observed data for the specified marker and sample if the specified pair of ordered alleles is the true ordered genotype
-
isPhased
public boolean isPhased(int marker, int sample)
Description copied from interface:GT
Returnstrue
if the genotype for the specified marker and sample is a phased, nonmissing genotype, and returnsfalse
otherwise.
-
allele1
public int allele1(int marker, int sample)
Description copied from interface:GT
Returns the first allele for the specified marker and sample or return -1 if the allele is missing. The two alleles for a sample are arbitrarily ordered ifthis.unphased(marker, sample) == false
.
-
allele2
public int allele2(int marker, int sample)
Description copied from interface:GT
Returns the second allele for the specified marker and sample or return -1 if the allele is missing. The two alleles for a sample are arbitrarily ordered ifthis.unphased(marker, sample) == false
.
-
allele
public int allele(int marker, int hap)
Description copied from interface:GT
Returns the allele on the specified haplotype for the specified marker or return -1 if the allele is missing. The two alleles for an individual are arbitrarily ordered ifthis.unphased(marker, hap/2) == false
.
-
marker
public Marker marker(int marker)
Description copied from interface:GT
Returns the specified marker.
-
nMarkers
public int nMarkers()
Description copied from interface:GT
Returns the number of markers.
-
nHaps
public int nHaps()
Description copied from interface:GT
Returns the number of haplotypes. The returned value is equal to2*this.nSamples()
.
-
nSamples
public int nSamples()
Description copied from interface:GT
Returns the number of samples.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-