public GenotypeCallTable
Interface for genotype calls for a table of taxa and sites. GenotypeCallTable only contain information on the genotype calls - the call table does not have the TaxaList or PositionList. The calls are diploid genotype calls stored and retrieved as bytes. Conversions to string are also provided.
Generally these methods are accessed through the GenotypeTable interface.
interface GenotypeTablebyte genotype(int taxon,
int site)
Returns diploid value (genotype) for a given taxon and site.
taxon - taxonsite - sitekotlin.Array[] genotypeArray(int taxon,
int site)
Returns diploid values for given taxon and site. Same values as genotype(), except two values are already separated into two bytes.
taxon - taxonsite - sitekotlin.Array[] genotypeRange(int taxon,
int startSite,
int endSite)
Returns sequence of diploid allele values for given taxon in specified range (end site excluded). Each value in array is what would be returned by genotype().
taxon - taxonstartSite - start siteendSite - end sitekotlin.Array[] genotypeAllSites(int taxon)
Returns sequence of diploid allele values for all sites for given taxon. Each value in array is what would be returned by genotype().
taxon - taxonjava.lang.String genotypeAsString(int taxon,
int site)
Returns string representation of diploid values returned by genotype() for given taxon and site. The default implementation separates The two allele values with a colon (:) delimiter. Nucleotide data will be represented by a single letter IUPAC code.
taxon - taxonsite - sitejava.lang.String genotypeAsStringRange(int taxon,
int startSite,
int endSite)
Returns string representation of diploid alleles for given taxon in specified range (end site excluded). Each value in string is what would be returned by genotypeAsString().
taxon - taxonstartSite - start siteendSite - end sitejava.lang.String genotypeAsStringRow(int taxon)
Returns string representation of diploid alleles for given taxon for all sites. Each value in string is what would be returned by genotypeAsString().
taxon - taxonjava.lang.String[] genotypeAsStringArray(int taxon,
int site)
Returns string representation of diploid values returned by genotypeArray() for given taxon and site. Same two allele values as genotypeAsString(), except already separated into two Strings.
taxon - taxonsite - sitejava.lang.String[] genotypeAsStringArray(int site,
byte value)
Same as genotypeAsStringArray(taxon, site), except given value is converted for given site.
site - sitevalue - diploid allele valueboolean isHeterozygous(int taxon,
int site)
Returns whether allele values at given taxon and site are heterozygous. If two values returned by genotype() are different, this will return false.
taxon - taxonsite - siteint heterozygousCount(int site)
Returns number of heterozygous taxa at given site.
site - siteboolean isAllPolymorphic()
Returns whether all sites are polymorphic.
boolean isPolymorphic(int site)
Return whether given site is polymorphic.
site - siteboolean isPhased()
Returns whether this alignment is phased.
boolean retainsRareAlleles()
Returns true if this Alignment retains rare alleles. If false, rare alleles are recorded as unknown.
java.lang.String[] alleleDefinitions()
Returns allele values as strings for all sites. The first dimension of the array indexes the sites. The second dimension indexes the allele values for given site. The indices for the allele values are used as the codes to store data. These codes (indices) are returned by the genotype() methods. If only one array of allele values is returned, that is the encoding for all sites.
java.lang.String[] alleleDefinitions(int site)
Same as getAlleleEncodings() for only one site.
site - sitejava.lang.String genotypeAsString(int site,
byte value)
Returns String representation of allele value at site.
site - sitevalue - allele valuejava.lang.String diploidAsString(int site,
byte value)
Returns String representation of diploid allele value at site.
site - sitevalue - diploid allele valueint maxNumAlleles()
Return max number of alleles defined for any given site.
int totalGametesNonMissingForSite(int site)
Returns total number of non-missing allele values for given site. This can be twice the number of taxa, as diploid values are supported.
site - siteint totalNonMissingForSite(int site)
Returns total number of non-missing taxa for given site. Taxa are considered missing only if both allele values are Unknown (N).
site - siteint minorAlleleCount(int site)
Returns the minor allele count for given site.
site - siteint majorAlleleCount(int site)
Returns the major allele count for given site.
site - sitejava.lang.Object[] genoCounts()
Returns counts of all diploid combinations from highest frequency to lowest for whole alignment. Resulting double dimension array holds diploids (Strings) in result[0]. And the counts are in result[1] (Longs).
java.lang.Object[] majorMinorCounts()
Returns counts of all major/minor allele combinations from highest frequency to lowest for whole alignment. Resulting double dimension array holds major/minor allele (Strings) in result[0]. And the counts are in result[1] (Longs).
int totalGametesNonMissingForTaxon(int taxon)
Returns total number of non-missing allele values for given taxon. This can be twice the number of sites, as diploid values are supported.
taxon - taxonint heterozygousCountForTaxon(int taxon)
Returns number of heterozygous sites at given taxon.
taxon - taxonint totalNonMissingForTaxon(int taxon)
Returns total number of non-missing sites for given taxon. Sites are considered missing only if both allele values are Unknown (N).
taxon - taxonkotlin.Array[] allelesSortedByFrequency(int site)
Return sorted list of alleles from highest frequency to lowest at given site in alignment. Resulting double dimension array holds alleles (bytes) in result[0]. And the counts are in result[1]. Counts haploid values twice and diploid values once. Higher ploids are not supported.
site - sitejava.lang.Object[] genosSortedByFrequency(int site)
Return sorted list of diploid vales from highest frequency to lowest at given site in alignment. Resulting double dimension array holds diploids (Strings) in result[0]. And the counts are in result[1] (Integers).
site - sitekotlin.Array[] alleles(int site)
Returns all alleles at given site in order of frequency. Gap is included as state. Heterozygous count one for each allele value. Homozygous counts two for the allele value.
site - sitekotlin.Array[] majorAlleleForAllSites()
Returns major allele for all sites.
kotlin.Array[] minorAlleleForAllSites()
Returns minor allele for all sites.
byte thirdAllele(int site)
Return the second minor allele at given site (Third allele state). Gap is included as state. Heterozygous count one for each allele value. Homozygous counts two for the allele value.
site - sitekotlin.Array[] thirdAlleleForAllSites()
Returns third (second minor) allele for all sites.
byte majorAllele(int site)
Return most common allele at given site. Gap is included as state. Heterozygous count one for each allele value. Homozygous counts two for the allele value.
site - sitejava.lang.String majorAlleleAsString(int site)
Return most common allele at given site. Gap is included as state. Heterozygous count one for each allele value. Homozygous counts two for the allele value.
site - sitebyte minorAllele(int site)
Return most common minor allele at given site. Gap is included as state. Heterozygous count one for each allele value. Homozygous counts two for the allele value.
site - sitejava.lang.String minorAlleleAsString(int site)
Return most common minor allele at given site. Gap is included as state. Heterozygous count one for each allele value. Homozygous counts two for the allele value.
site - sitekotlin.Array[] minorAlleles(int site)
Return all minor alleles at given site. Gap is included as state. Heterozygous count one for each allele value. Homozygous counts two for the allele value.
site - sitedouble minorAlleleFrequency(int site)
Return frequency for most common minor allele at given site. Gap is included as state. Heterozygous count one for each allele value. Homozygous counts two for the allele value.
site - sitedouble majorAlleleFrequency(int site)
Return frequency for major allele at given site. Gap is included as state. Heterozygous count one for each allele value. Homozygous counts two for the allele value.
site - siteint numberOfTaxa()
Returns number of taxa (samples) in this genotype
int numberOfSites()
Returns total number of sites in this genotype.
kotlin.Array[] genotypeForAllSites(int taxon)
Get all genotypes for given taxon.
taxon - taxonkotlin.Array[] genotypeForSiteRange(int taxon,
int start,
int end)
Get all genotypes for given taxon from start site (inclusive) to end site (exclusive).
taxon - taxonstart - startend - endkotlin.Array[] genotypeForAllTaxa(int site)
Get all genotypes for given site.
site - siteStats siteStats(int site)
Stats taxonStats(int taxon)
void transposeData(boolean siteInnerLoop)
Tells this Genotype to transpose it's data to optimize performance for given iteration nesting. If siteInnerLoop is true, performance better when looping through sites inside taxa loop. If false, performance better when looping through taxa inside site loop.
siteInnerLoop - flag for which iterationboolean isSiteOptimized()
This returns true if this Genotype performs better when processing whole sites at a time. Return false if performance is better when processing whole taxa.
java.util.stream.Stream<java.lang.Byte> stream()
Returns a Stream over the genotype calls.
java.util.stream.Stream<java.lang.Byte> stream(int taxon)