public GenotypeTable
A representation of the SNP and indel variation for a set of taxa and genomic positions.
GenotypeTable always consist of a TaxaList, PositionList, and GenotypeCallTable. Additionally, as needed they also can represent allele in a bit form, with sequencing depth, or other scores (e.g. quality scores).
Use GenotypeTableBuilder to create GenotypeTable.
static byte RARE_ALLELE
This encoding is used to lump together allele values with frequencies too low to be retained as one of the maximum number of alleles.
static byte RARE_DIPLOID_ALLELE
static java.lang.String RARE_ALLELE_STR
static byte UNKNOWN_ALLELE
static byte UNKNOWN_DIPLOID_ALLELE
static java.lang.String UNKNOWN_ALLELE_STR
static java.lang.String UNKNOWN_DIPLOID_ALLELE_STR
static char UNKNOWN_ALLELE_CHAR
static java.lang.String ANNOTATION_DATA_SET_NAME
Annotations
static java.lang.String ANNOTATION_DATA_SET_DESCRIPTION
static java.lang.String[] GENOTYPE_TABLE_ANNOTATIONS
boolean hasGenotype()
Returns whether this Genotype Table has Genotype values.
GenotypeCallTable genotypeMatrix()
Returns the immutable Genotype matrix. Taxa and Positions are not part of the matrix. This method is used for copying Genotype tables, when either the Taxa or Positions have changed.
byte 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 - sitebyte genotype(int taxon,
Chromosome chromosome,
int physicalPosition)
Returns diploid values for given taxon, chromosome, and physical position. The chromosome and physical position should map to an unique site.
taxon - taxonchromosome - chromosomephysicalPosition - physical positionkotlin.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 - taxonkotlin.Array[] genotypeAllTaxa(int site)
Returns sequence of diploid allele values for all taxa for given site. Each value in array is what would be returned by genotype().
site - siteBitSet allelePresenceForAllSites(int taxon, WHICH_ALLELE allele)
Returns sequence of true/false values indicating whether taxon at each site matches a specific allele (based on frequency). Allele number of value 0 would be the major allele. Allele number of value 1 would be the minor allele. Allele number of value 2 would be the third most frequent allele value and so on.
taxon - taxonallele - allelekotlin.Array[] allelePresenceForSitesBlock(int taxon,
WHICH_ALLELE allele,
int startBlock,
int endBlock)
Returns sequence of true/false values indicating whether taxon at sites (in given blocks, 64 sites per block including start block but excluding end block) matches a specific allele.
taxon - taxonallele - allelestartBlock - starting blockendBlock - end blockBitSet haplotypeAllelePresenceForAllSites(int taxon, boolean firstParent, WHICH_ALLELE allele)
Returns sequence of true/false values indicating whether taxon at each site for given parent matches a specific allele.
taxon - taxonfirstParent - true for first parent (false for second parent)allele - alleleBitSet haplotypeAllelePresenceForAllTaxa(int site, boolean firstParent, WHICH_ALLELE allele)
Returns sequence of true/false values indicating whether site at each taxon for given parent matches a specific allele (based on frequency). Allele number of value 0 would be the major allele. Allele number of value 1 would be the minor allele. Allele number of value 2 would be the third most frequent allele value and so on.
site - sitefirstParent - true for first parent (false for second parent)allele - allelekotlin.Array[] haplotypeAllelePresenceForSitesBlock(int taxon,
boolean firstParent,
WHICH_ALLELE allele,
int startBlock,
int endBlock)
Returns sequence of true/false values indicating whether taxon at sites (in given blocks, 64 sites per block including start block but excluding end block) for given parent matches a specific allele (based on frequency). Allele number of value 0 would be the major allele. Allele number of value 1 would be the minor allele. Allele number of value 2 would be the third most frequent allele value and so on.
taxon - taxonfirstParent - true for first parent (false for second parent)allele - allelestartBlock - starting blockendBlock - end blockjava.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 - sitebyte referenceAllele(int site)
Return (haploid) reference allele value at given site.
site - sitebyte alternateAllele(int site)
Return (haploid) alternate allele value at given site.
site - sitekotlin.Array[] referenceAlleles(int startSite,
int endSite)
Returns (haploid) reference alleles in specified range. End site not included.
startSite - start siteendSite - end sitekotlin.Array[] referenceAlleleForAllSites()
Returns (haploid) reference alleles for all sites.
boolean hasReference()
Return whether this genotype table has defined reference sequence.
boolean 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 - sitejava.lang.String siteName(int site)
Get SNP ID for specified site.
site - siteint numberOfSites()
Returns total number of sites of this genotype table.
int chromosomeSiteCount(Chromosome chromosome)
Return number of sites for given chromosome.
chromosome - chromosomekotlin.Array[] firstLastSiteOfChromosome(Chromosome chromosome)
Get the first (inclusive) and last (inclusive) site of the specified chromosome in this genotype table.
chromosome - chromosomeint numberOfTaxa()
Returns number of taxa
PositionList positions()
Return the position list for the genotype table.
int chromosomalPosition(int site)
Returns the physical position at given site.
site - siteint siteOfPhysicalPosition(int physicalPosition,
Chromosome chromosome)
Return site of given physical position in chromosome. If the physical position doesn't exist, (-(insertion point) - 1) is returned. If chromosome is not found, an exception is thrown.
physicalPosition - physical positionchromosome - chromosome. if null, the first chromosome is used.int siteOfPhysicalPosition(int physicalPosition,
Chromosome chromosome,
java.lang.String snpName)
Return site of given physical position / SNP ID in chromosome. If the physical position doesn't exist, (-(insertion point) - 1) is returned. If chromosome is not found, an exception is thrown. This is to support multiple sites with the same physical position but different SNP IDs.
physicalPosition - physical positionchromosome - chromosome. if null, the first chromosome is used.snpName - SNP IDkotlin.Array[] physicalPositions()
Returns all physical positions.
java.lang.String chromosomeName(int site)
Return Chromosome Name for given site.
site - siteChromosome chromosome(int site)
Return Chromosome for given site.
site - siteChromosome chromosome(java.lang.String name)
Return Chromosome with matching name. First to match will be returned.
name - nameChromosome[] chromosomes()
Return all chromosomes.
int numChromosomes()
Return number of chromosomes.
kotlin.Array[] chromosomesOffsets()
Returns starting site for each chromosome.
boolean hasDepth()
Returns true if this genotype table has sequencing depth.
boolean hasAlleleProbabilities()
Returns true if this genotype table has allele probabilities.
boolean hasReferenceProbablity()
Returns true if this genotype table has reference probability.
boolean hasDosage()
Returns true if this genotype table has dosage.
java.util.Set<net.maizegenetics.dna.snp.score.SiteScore.SITE_SCORE_TYPE> siteScoreTypes()
Return the site scores types that have value for this genotype table.
AlleleProbability alleleProbability()
Returns allele probability object (null if not present)
float alleleProbability(int taxon,
int site,
net.maizegenetics.dna.snp.score.SiteScore.SITE_SCORE_TYPE type)
ReferenceProbability referenceProbability()
Returns reference probability object (null if not present)
float referenceProbability(int taxon,
int site)
Dosage dosage()
Returns dosage object (null if not present)
byte dosage(int taxon,
int site)
int indelSize(int site)
Return size of indel at given site.
site - siteboolean isIndel(int site)
Returns whether give site is an indel.
site - siteboolean isAllPolymorphic()
Returns whether all sites are polymorphic.
boolean isPolymorphic(int site)
Return whether given site is polymorphic.
site - sitebyte 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 - 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 - 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 - siteTaxaList taxa()
Return taxa list of this genotype table.
java.lang.String taxaName(int index)
Return taxa name at given index.
index - java.lang.String genomeVersion()
Gets the Genome Assembly.
boolean isPositiveStrand(int site)
Return whether is positive strand at given site.
site - siteGenotypeTable[] compositeAlignments()
Returns individual genotype tables within this genotype table.
kotlin.Array[] allelesSortedByFrequency(int site)
Return sorted list of alleles from highest frequency to lowest at given site in genotype table. 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 genotype table. Resulting double dimension array holds diploids (Strings) in result[0]. And the counts are in result[1] (Integers).
site - siteboolean isPhased()
Returns whether this genotype table is phased.
boolean retainsRareAlleles()
Returns true if this genotype table 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 alleleDefinitions() 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 genotype table. 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 genotype table. 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 - taxonAlleleDepth depth()
Returns allele depth object (null if not present)
kotlin.Array[] depthForAlleles(int taxon,
int site)
Returns depth count for each diploid allele at the given taxon and site.
taxon - taxonsite - sitekotlin.Array[] allelesBySortType(net.maizegenetics.dna.snp.GenotypeTable.ALLELE_SORT_TYPE scope,
int site)
Returns all alleles at given site in order defined by scope.
scope - scopesite - siteBitSet allelePresenceForAllTaxa(int site, WHICH_ALLELE allele)
Returns sequence of true/false values indicating whether site at each taxon matches a specific allele.
site - siteallele - alleleBitStorage bitStorage(WHICH_ALLELE allele)
Returns BitStorage for this Genotype
allele - alleleGeneralAnnotationStorage annotations()
Annotations of this Genotype Table. Null if there are none.
java.util.stream.Stream<java.lang.Byte> streamGenotype()
java.util.stream.Stream<java.lang.Byte> streamGenotype(int taxon)
boolean hasSiteTranslations()
kotlin.Array[] siteTranslations()