Package vcf
Class RestrictedGT
- java.lang.Object
-
- vcf.RestrictedGT
-
-
Constructor Summary
Constructors Constructor Description RestrictedGT(GT gt, Markers markers, int[] indices)Constructs a newNoPhaseGTWrapperinstance from the specified data
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intallele(int marker, int hap)Returns the allele on the specified haplotype for the specified marker or return -1 if the allele is missing.intallele1(int marker, int sample)Returns the first allele for the specified marker and sample or return -1 if the allele is missing.intallele2(int marker, int sample)Returns the second allele for the specified marker and sample or return -1 if the allele is missing.booleanisPhased()Returnstrueif the genotype for each marker and sample is a phased, non-missing genotype, and returnsfalseotherwise.Markermarker(int marker)Returns the specified marker.Markersmarkers()Returns the list of markers.intnHaps()Returns the number of haplotypes.intnMarkers()Returns the number of markers.intnSamples()Returns the number of samples.GTrestrict(Markers markers, int[] indices)Returns aGTinstance restricted to genotype data for the specified markers.Samplessamples()Returns the list of samples.java.lang.StringtoString()
-
-
-
Constructor Detail
-
RestrictedGT
public RestrictedGT(GT gt, Markers markers, int[] indices)
Constructs a newNoPhaseGTWrapperinstance from the specified data- Parameters:
gt- the genotypes to be wrappedmarkers- the list of markers in the returned instanceindices- the mapping of marker indices frommarkerstogt.markers()- Throws:
java.lang.IndexOutOfBoundsException- if there existsjsuch that(0 <= j && j < indices.length)such that(indices[j] < 0 || indices[j] >= gt.nMarkers())java.lang.IllegalArgumentException- if there existsjsuch that(1 <= j && j < indices.length)such that(indices[j] <= indice[j - 1])java.lang.IllegalArgumentException- if there existsjsuch that(0 <= j && j < indices.length)such that(gt.marker(indices[j]).equals(markers.marker(j)) == false)java.lang.NullPointerException- if(gt == null || markers == null || include == null)
-
-
Method Detail
-
isPhased
public boolean isPhased()
Description copied from interface:GTReturnstrueif the genotype for each marker and sample is a phased, non-missing genotype, and returnsfalseotherwise.
-
allele1
public int allele1(int marker, int sample)Description copied from interface:GTReturns 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:GTReturns 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:GTReturns 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.
-
nMarkers
public int nMarkers()
Description copied from interface:GTReturns the number of markers.
-
marker
public Marker marker(int marker)
Description copied from interface:GTReturns the specified marker.
-
nHaps
public int nHaps()
Description copied from interface:GTReturns the number of haplotypes. The returned value is equal to2*this.nSamples().
-
nSamples
public int nSamples()
Description copied from interface:GTReturns the number of samples.
-
restrict
public GT restrict(Markers markers, int[] indices)
Description copied from interface:GTReturns aGTinstance restricted to genotype data for the specified markers.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-