DuplicatesGTRec, GTRec, MarkerContainerLowMafRefDiallelicGT, LowMafRefGT, SeqCodedRefGTpublic interface RefGTRec extends GTRec
Interface GTRec represents represents genotype data for one
marker.
All instances of GTRec are required to be immutable.
| Modifier and Type | Method | Description |
|---|---|---|
static RefGTRec |
alleleCodedInstance(Marker marker,
Samples samples,
int[][] hapIndices) |
Constructs and returns a new allele-coded
RefGTRec instance
from the specified data. |
static RefGTRec |
alleleCodedInstance(RefGTRec rec) |
Returns an allele-coded
RefGTRec instance for the
specified data. |
static RefGTRec |
alleleCodedInstance(VcfRecGTParser gtp) |
Constructs and returns a new allele-coded
RefGTRec instance
from the specified data. |
default int |
alleleCount(int allele) |
Returns the number of haplotypes that carry the specified allele.
|
RefGTRec |
changeMarker(Marker marker) |
Returns a
RefGTRec instance with the specified marker and the
same samples and haplotype alleles as this. |
default int |
hapIndex(int allele,
int copy) |
Returns index of the haplotype that carries the specified copy of the
specified allele.
|
static int[][] |
hapIndices(RefGTRec rec) |
Returns an array whose
j-th element is null
if j is the major allele with lowest index, and otherwise is
an array of indices of haplotypes that carry the j-th allele
sorted in increasing order |
default IntArray |
hapToSeq() |
Returns an
IntArray mapping haplotype indices to
sequences. |
default boolean |
isAlleleCoded() |
Returns
true if this instance stores the indices of haplotypes
that carry non-major alleles, and returns false otherwise. |
default boolean |
isCarrier(int allele,
int hap) |
Returns
true if the specified haplotype carries the specified
allele and return false otherwise. |
default boolean |
isPhased() |
Returns
true. |
default boolean |
isPhased(int sample) |
Returns
true. |
default int |
majorAllele() |
Returns the index of the major allele.
|
default IntArray |
seqToAllele() |
Returns an
IntArray mapping the sequence indices
to alleles carried by the sequence for this record |
allele, allele1, allele2, alleles, nHaps, nSamplesmarker, nAllelesstatic RefGTRec alleleCodedInstance(RefGTRec rec)
RefGTRec instance for the
specified data.rec - the phased, non-missing genotype dataRefGTRec instance for the
specified datajava.lang.NullPointerException - if rec == nullstatic RefGTRec alleleCodedInstance(VcfRecGTParser gtp)
RefGTRec instance
from the specified data.gtp - a VCF record parser that extracts sample genotypesRefGTRec instancejava.lang.IllegalArgumentException - if the VCF record contains an
unphased genotype or missing allelejava.lang.IllegalArgumentException - if a format error is detected in the
VCF recordjava.lang.NullPointerException - if gtp == nullstatic RefGTRec alleleCodedInstance(Marker marker, Samples samples, int[][] hapIndices)
RefGTRec instance
from the specified data. The contract for this class is unspecified
if a haplotype index is duplicated in the specified hapIndices
array.marker - the markersamples - the sampleshapIndices - an array whose j-th element is null
if j is the major allele with lowest index, and otherwise is
an array of indices of haplotypes that carry the j-th allele
sorted in increasing orderRefGTRec instancejava.lang.IllegalArgumentException - if the (hapIndices[j] == null)
and j is not the major allele with lowest index, or if
(hapIndices[j] != null) and j is the major allele with
lowest indexjava.lang.IllegalArgumentException - if any element of hapIndices
is not not a sorted array of distinct haplotype indices
between 0 (inclusive) and 2*samples.nSamples() (exclusive)java.lang.IllegalArgumentException - if
marker.nAlleles() != hapIndices.lengthjava.lang.NullPointerException - if
marker == null || samples == null || hapIndices == nullstatic int[][] hapIndices(RefGTRec rec)
j-th element is null
if j is the major allele with lowest index, and otherwise is
an array of indices of haplotypes that carry the j-th allele
sorted in increasing orderrec - the phased, non-missing genotype dataj-th element is null
if j is the major allele with lowest index, and otherwise is
an array of indices of haplotypes that carry the j-th allele
sorted in increasing orderjava.lang.NullPointerException - if rec == nulldefault boolean isPhased(int sample)
true.isPhased in interface DuplicatesGTRecsample - the sample indextruejava.lang.IndexOutOfBoundsException - if
sample < 0 || sample >= this.nSamples()default boolean isPhased()
true.isPhased in interface DuplicatesGTRectrueRefGTRec changeMarker(Marker marker)
RefGTRec instance with the specified marker and the
same samples and haplotype alleles as this.marker - a markerRefGTRec instance with the specified marker and the
same samples and haplotype alleles as thisjava.lang.IllegalArgumentException - if
marker.nAlleles() < this.nAlleles()java.lang.NullPointerException - if marker == nulldefault boolean isAlleleCoded()
true if this instance stores the indices of haplotypes
that carry non-major alleles, and returns false otherwise.
The default implementation returns falsetrue if this instance stores the indices of haplotypes
that carry non-major allelesdefault int majorAllele()
java.lang.UnsupportedOperationException - if
isAlleleCoded() == falsedefault int alleleCount(int allele)
UnsupportedOperationExceptionallele - an allele indexjava.lang.IllegalArgumentException - if
allele == this.majorAllele()java.lang.IndexOutOfBoundsException - if
allele < 0 || allele >= this.nAlleles()java.lang.UnsupportedOperationException - if
isAlleleCoded() == falsedefault int hapIndex(int allele,
int copy)
UnsupportedOperationExceptionallele - an allele indexcopy - a copy indexjava.lang.IllegalArgumentException - if
allele == this.majorAllele()java.lang.IndexOutOfBoundsException - if
allele < 0 || allele >= this.nAlleles()java.lang.IndexOutOfBoundsException - if
copy < 0 || copy >= this.alleleCount(allele)java.lang.UnsupportedOperationException - if
isAlleleCoded() == falsedefault boolean isCarrier(int allele,
int hap)
true if the specified haplotype carries the specified
allele and return false otherwise.allele - an allele indexhap - a haplotype indextrue if the specified haplotype carries the specified
allelejava.lang.IndexOutOfBoundsException - if
hap < 0 || hap >= this.nHaps()java.lang.IndexOutOfBoundsException - if
allele < 0 || allele >= this.nAlleles()default IntArray hapToSeq()
IntArray mapping haplotype indices to
sequences.java.lang.UnsupportedOperationException - if
isAlleleCoded() == truedefault IntArray seqToAllele()
IntArray mapping the sequence indices
to alleles carried by the sequence for this recordjava.lang.UnsupportedOperationException - if
isAlleleCoded() == true