Package vcf
Class BasicRefGT
- java.lang.Object
-
- vcf.BasicRefGT
-
-
Constructor Summary
Constructors Constructor Description BasicRefGT(Markers markers, Samples samples, RefGTRec[] refVcfRecs)Constructs a newRefHapPairsinstance.BasicRefGT(RefGTRec[] refVcfRecs)Constructs a newRefHapPairsinstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intallele(int marker, int haplotype)Returns the allele on the specified haplotype for the specified marker or return -1 if the allele is missing.intallele1(int marker, int hapPair)Returns the first allele for the specified marker and sample or return -1 if the allele is missing.intallele2(int marker, int hapPair)Returns the second allele for the specified marker and sample or return -1 if the allele is missing.RefGTRecget(int marker)Returns theRefGTRecfor the specified marker.booleanisPhased()Returnstrueif the genotype for each marker and sample is a phased, non-missing genotype, and returnsfalseotherwise.booleanisPhased(int sample)Returnstrueif the genotype for each marker for the specified sample is a phased, nonmissing genotype, and returnsfalseotherwise.booleanisPhased(int marker, int sample)Returnstrueif the genotype for the specified marker and sample is a phased, nonmissing 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.Samplessamples()Returns the list of samples.
-
-
-
Constructor Detail
-
BasicRefGT
public BasicRefGT(Markers markers, Samples samples, RefGTRec[] refVcfRecs)
Constructs a newRefHapPairsinstance.- Parameters:
markers- the sequence of markerssamples- the sequence of samplesrefVcfRecs- the sequence of per-marker genotype data- Throws:
java.lang.IllegalArgumentException- ifmarkers.nMarkers() != refVcfRecs.lengthjava.lang.IllegalArgumentException- ifrefVcfRecs[k].samples().equals(samples) == falsefor anyksatisfying0 <= k && k < refVcfRecs.lengthjava.lang.IllegalArgumentException- ifrefVcfRecs[k].marker().equals(markers.marker(k)) == falsefor anyksatisfying0 <= k && k < refVcfRecs.lengthjava.lang.IllegalArgumentException- ifrefVcfRecs[k].isPhased() == falsefor anyksatisfying0 <= k && k < refVcfRecs.lengthjava.lang.NullPointerException- ifmarkers == null || samples == null || refVcfRecs == null || refVcfRecs[k] == nullfor anyksatisfying0 <= k && k <= refVcfRecs.length
-
BasicRefGT
public BasicRefGT(RefGTRec[] refVcfRecs)
Constructs a newRefHapPairsinstance.- Parameters:
refVcfRecs- the sequence of per-marker genotype data- Throws:
java.lang.IllegalArgumentException- ifrefVcfRecs.length == 0java.lang.IllegalArgumentException- ifrefVcfRecs[k].samples().equals(samples) == falsefor anyksatisfying0 <= k && k < refVcfRecs.lengthjava.lang.IllegalArgumentException- ifrefVcfRecs[k].isPhased() == falsefor anyksatisfying0 <= k && k < refVcfRecs.lengthjava.lang.NullPointerException- ifsamples == null || refVcfRecs == nulljava.lang.NullPointerException- if(refVcfRecs[k] == null)for anyksatisfying(0 <= k && k <= refVcfRecs.length)
-
-
Method Detail
-
isPhased
public boolean isPhased(int marker, int sample)Description copied from interface:GTReturnstrueif the genotype for the specified marker and sample is a phased, nonmissing genotype, and returnsfalseotherwise.
-
isPhased
public boolean isPhased(int sample)
Description copied from interface:GTReturnstrueif the genotype for each marker for the specified sample is a phased, nonmissing genotype, and returnsfalseotherwise.
-
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 hapPair)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 hapPair)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 haplotype)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.
-
-