Package vcf
Class SplicedGT
java.lang.Object
vcf.SplicedGT
- All Implemented Interfaces:
GT
Class SplicedGT
represents genotypes for a set of samples
that are obtained by replacing the initial markers of one GT
instance with phased genotypes from another GT
instance.
Instances of class SplicedGT
are immutable.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
allele
(int marker, int hap) Returns the allele on the specified haplotype for the specified marker or return -1 if the allele is missing.boolean
isPhased()
Returnstrue
if the genotype for each marker and sample has non-missing alleles and is either haploid or diploid with a phased allele separator, and returnsfalse
otherwise.boolean
Returnstrue
if the markers are ordered by decreasing chromosome base position, and returnsfalse
otherwise.marker
(int marker) Returns the specified marker.markers()
Returns the list of markers in order of increasing chromosome position.int
nHaps()
Returns the number of haplotypes.int
nMarkers()
Returns the number of markers.int
nSamples()
Returns the number of samples.restrict
(int start, int end) Returns a newGT
instance restricted to genotype data for the specified markers.Returns aGT
instance restricted to genotype data for the specified markers.samples()
Returns the list of samples.toString()
-
Constructor Details
-
SplicedGT
Constructs a newSplicedGL
instance.- Parameters:
phasedOverlap
- sample haplotype pairs for the initial markersgt
- genotype emission probabilities for all markers- Throws:
IllegalArgumentException
- ifphasedOverlaps.nMarkers() >= gt.nMarkers()
IllegalArgumentException
- ifphasedOverlaps.marker(j).equals(gt.marker(j)) == false
for anyj
satisfying0 <= j && j < phasedOverlaps.nMarkers()
IllegalArgumentException
- ifphasedOverlaps.samples().equals(gt.samples()) == false
IllegalArgumentException
- ifphasedOverlap.isPhased() == false
NullPointerException
- ifphasedOverlap == null || gt == null
-
-
Method Details
-
isReversed
public boolean isReversed()Description copied from interface:GT
Returnstrue
if the markers are ordered by decreasing chromosome base position, and returnsfalse
otherwise.- Specified by:
isReversed
in interfaceGT
- Returns:
true
if the markers are ordered by decreasing chromosome base position
-
marker
Description copied from interface:GT
Returns the specified marker. -
markers
Description copied from interface:GT
Returns the list of markers in order of increasing chromosome position. If(this.isReversed() == false)
then(this.markers().marker(j).equals(this.marker(j)) == true)
for all(0 <= j && j < this.nMarkers())
. If(this.isReversed() == true)
then(this.markers().marker(this.nMarkers() - 1 - j).equals(this.marker(j)) == true)
for all(0 <= j && j < this.nMarkers())
-
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. -
samples
Description copied from interface:GT
Returns the list of samples. -
isPhased
public boolean isPhased()Description copied from interface:GT
Returnstrue
if the genotype for each marker and sample has non-missing alleles and is either haploid or diploid with a phased allele separator, and returnsfalse
otherwise. -
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 order of the two alleles is unspecified ifthis.isPhased() == false
. -
restrict
Description copied from interface:GT
Returns aGT
instance restricted to genotype data for the specified markers. -
restrict
Description copied from interface:GT
Returns a newGT
instance restricted to genotype data for the specified markers. -
toString
-