public class CombineGenotypeTable extends Object implements GenotypeTable
GenotypeTable.ALLELE_SORT_TYPE, GenotypeTable.GENOTYPE_TABLE_COMPONENT
ANNOTATION_DATA_SET_DESCRIPTION, ANNOTATION_DATA_SET_NAME, GENOTYPE_TABLE_ANNOTATIONS, RARE_ALLELE, RARE_ALLELE_STR, RARE_DIPLOID_ALLELE, UNKNOWN_ALLELE, UNKNOWN_ALLELE_CHAR, UNKNOWN_ALLELE_STR, UNKNOWN_DIPLOID_ALLELE, UNKNOWN_DIPLOID_ALLELE_STR
Modifier and Type | Method and Description |
---|---|
String[][] |
alleleDefinitions()
Returns allele values as strings for all sites.
|
String[] |
alleleDefinitions(int site)
Same as alleleDefinitions() for only one site.
|
BitSet |
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).
|
BitSet |
allelePresenceForAllTaxa(int site,
WHICH_ALLELE allele)
Returns sequence of true/false values indicating whether site at each
taxon matches a specific allele.
|
long[] |
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.
|
AlleleProbability |
alleleProbability()
Returns allele probability object (null if not present)
|
float |
alleleProbability(int taxon,
int site,
SiteScore.SITE_SCORE_TYPE type) |
byte[] |
alleles(int site)
Returns all alleles at given site in order of frequency.
|
byte[] |
allelesBySortType(GenotypeTable.ALLELE_SORT_TYPE scope,
int site)
Returns all alleles at given site in order defined by scope.
|
int[][] |
allelesSortedByFrequency(int site)
Return sorted list of alleles from highest frequency to lowest at given
site in genotype table.
|
byte |
alternateAllele(int site)
Return (haploid) alternate allele value at given site.
|
GeneralAnnotationStorage |
annotations()
Annotations of this Genotype Table.
|
BitStorage |
bitStorage(WHICH_ALLELE allele)
Returns BitStorage for this Genotype
|
int |
chromosomalPosition(int site)
Returns the physical position at given site.
|
Chromosome |
chromosome(int site)
Return Chromosome for given site.
|
Chromosome |
chromosome(String name)
Return Chromosome with matching name.
|
String |
chromosomeName(int site)
Return Chromosome Name for given site.
|
Chromosome[] |
chromosomes()
Return all chromosomes.
|
int |
chromosomeSiteCount(Chromosome locus)
Return number of sites for given chromosome.
|
int[] |
chromosomesOffsets()
Returns starting site for each chromosome.
|
GenotypeTable[] |
compositeAlignments()
Returns individual genotype tables within this genotype table.
|
AlleleDepth |
depth()
Returns allele depth object (null if not present)
|
int[] |
depthForAlleles(int taxon,
int site)
Returns depth count for each diploid allele at the given taxon and site.
|
String |
diploidAsString(int site,
byte value)
Returns String representation of diploid allele value at site.
|
Dosage |
dosage()
Returns dosage object (null if not present)
|
byte |
dosage(int taxon,
int site) |
int[] |
firstLastSiteOfChromosome(Chromosome chromosome)
Get the first (inclusive) and last (inclusive) site of the specified
chromosome in this genotype table.
|
Object[][] |
genoCounts()
Returns counts of all diploid combinations from highest frequency to
lowest for whole genotype table.
|
String |
genomeVersion()
Gets the Genome Assembly.
|
Object[][] |
genosSortedByFrequency(int site)
Return sorted list of diploid vales from highest frequency to lowest at
given site in genotype table.
|
byte |
genotype(int taxon,
Chromosome locus,
int physicalPosition)
Returns diploid values for given taxon, chromosome, and physical
position.
|
byte |
genotype(int taxon,
int site)
Returns diploid value (genotype) for a given taxon and site.
|
byte[] |
genotypeAllSites(int taxon)
Returns sequence of diploid allele values for all sites for given taxon.
|
byte[] |
genotypeAllTaxa(int site)
Returns sequence of diploid allele values for all taxa for given site.
|
byte[] |
genotypeArray(int taxon,
int site)
Returns diploid values for given taxon and site.
|
String |
genotypeAsString(int site,
byte value)
Returns String representation of allele value at site.
|
String |
genotypeAsString(int taxon,
int site)
Returns string representation of diploid values returned by genotype()
for given taxon and site.
|
String[] |
genotypeAsStringArray(int taxon,
int site)
Returns string representation of diploid values returned by
genotypeArray() for given taxon and site.
|
String |
genotypeAsStringRange(int taxon,
int startSite,
int endSite)
Returns string representation of diploid alleles for given taxon in
specified range (end site excluded).
|
String |
genotypeAsStringRow(int taxon)
Returns string representation of diploid alleles for given taxon for all
sites.
|
GenotypeCallTable |
genotypeMatrix()
Returns the immutable Genotype matrix.
|
byte[] |
genotypeRange(int taxon,
int startSite,
int endSite)
Returns sequence of diploid allele values for given taxon in specified
range (end site excluded).
|
static GenotypeTable |
getInstance(GenotypeTable[] genoTables)
This factory method combines given genoTables.
|
static GenotypeTable |
getInstance(GenotypeTable[] genoTables,
boolean isUnion)
This factory method combines given genoTables.
|
BitSet |
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.
|
BitSet |
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).
|
long[] |
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).
|
boolean |
hasAlleleProbabilities()
Returns true if this genotype table has allele probabilities.
|
boolean |
hasDepth()
Returns true if this genotype table has sequencing depth.
|
boolean |
hasDosage()
Returns true if this genotype table has dosage.
|
boolean |
hasGenotype()
Returns whether this Genotype Table has Genotype values.
|
boolean |
hasReference()
Return whether this genotype table has defined reference sequence.
|
boolean |
hasReferenceProbablity()
Returns true if this genotype table has reference probability.
|
boolean |
hasSiteTranslations() |
int |
heterozygousCount(int site)
Returns number of heterozygous taxa at given site.
|
int |
heterozygousCountForTaxon(int taxon)
Returns number of heterozygous sites at given taxon.
|
int |
indelSize(int site)
Return size of indel at given site.
|
boolean |
isAllPolymorphic()
Returns whether all sites are polymorphic.
|
boolean |
isHeterozygous(int taxon,
int site)
Returns whether allele values at given taxon and site are heterozygous.
|
boolean |
isIndel(int site)
Returns whether give site is an indel.
|
boolean |
isPhased()
Returns whether this genotype table is phased.
|
boolean |
isPolymorphic(int site)
Return whether given site is polymorphic.
|
boolean |
isPositiveStrand(int site)
Return whether is positive strand at given site.
|
byte |
majorAllele(int site)
Return most common allele at given site.
|
String |
majorAlleleAsString(int site)
Return most common allele at given site.
|
int |
majorAlleleCount(int site)
Returns the major allele count for given site.
|
double |
majorAlleleFrequency(int site)
Return frequency for major allele at given site.
|
Object[][] |
majorMinorCounts()
Returns counts of all major/minor allele combinations from highest
frequency to lowest for whole genotype table.
|
int |
maxNumAlleles()
Return max number of alleles defined for any given site.
|
byte |
minorAllele(int site)
Return most common minor allele at given site.
|
String |
minorAlleleAsString(int site)
Return most common minor allele at given site.
|
int |
minorAlleleCount(int site)
Returns the minor allele count for given site.
|
double |
minorAlleleFrequency(int site)
Return frequency for most common minor allele at given site.
|
byte[] |
minorAlleles(int site)
Return all minor alleles at given site.
|
int |
numberOfSites()
Returns total number of sites of this genotype table.
|
int |
numberOfTaxa()
Returns number of taxa
|
int |
numChromosomes()
Return number of chromosomes.
|
int[] |
physicalPositions()
Returns all physical positions.
|
PositionList |
positions()
Return the position list for the genotype table.
|
byte |
referenceAllele(int site)
Return (haploid) reference allele value at given site.
|
byte[] |
referenceAlleleForAllSites()
Returns (haploid) reference alleles for all sites.
|
byte[] |
referenceAlleles(int startSite,
int endSite)
Returns (haploid) reference alleles in specified range.
|
ReferenceProbability |
referenceProbability()
Returns reference probability object (null if not present)
|
float |
referenceProbability(int taxon,
int site) |
boolean |
retainsRareAlleles()
Returns true if this genotype table retains rare alleles.
|
String |
siteName(int site)
Get SNP ID for specified site.
|
int |
siteOfPhysicalPosition(int physicalPosition,
Chromosome locus)
Return site of given physical position in chromosome.
|
int |
siteOfPhysicalPosition(int physicalPosition,
Chromosome locus,
String snpName)
Return site of given physical position / SNP ID in chromosome.
|
Set<SiteScore.SITE_SCORE_TYPE> |
siteScoreTypes()
Return the site scores types that have value for this genotype table.
|
int[] |
siteTranslations() |
Stream<Byte> |
streamGenotype() |
Stream<Byte> |
streamGenotype(int taxon) |
TaxaList |
taxa()
Return taxa list of this genotype table.
|
String |
taxaName(int index)
Return taxa name at given index.
|
int |
totalGametesNonMissingForSite(int site)
Returns total number of non-missing allele values for given site.
|
int |
totalGametesNonMissingForTaxon(int taxon)
Returns total number of non-missing allele values for given taxon.
|
int |
totalNonMissingForSite(int site)
Returns total number of non-missing taxa for given site.
|
int |
totalNonMissingForTaxon(int taxon)
Returns total number of non-missing sites for given taxon.
|
int |
translateSite(int site)
Returns which genotypeTable to use.
|
public static GenotypeTable getInstance(GenotypeTable[] genoTables)
genoTables
- public static GenotypeTable getInstance(GenotypeTable[] genoTables, boolean isUnion)
genoTables
- genoTables to combineisUnion
- whether to union or intersect joinpublic byte genotype(int taxon, int site)
GenotypeTable
genotype
in interface GenotypeTable
taxon
- taxonsite
- sitepublic byte[] genotypeRange(int taxon, int startSite, int endSite)
GenotypeTable
genotypeRange
in interface GenotypeTable
taxon
- taxonstartSite
- start siteendSite
- end sitepublic byte genotype(int taxon, Chromosome locus, int physicalPosition)
GenotypeTable
genotype
in interface GenotypeTable
taxon
- taxonlocus
- chromosomephysicalPosition
- physical positionpublic int translateSite(int site)
site
- public boolean hasReference()
GenotypeTable
hasReference
in interface GenotypeTable
public String siteName(int site)
GenotypeTable
siteName
in interface GenotypeTable
site
- sitepublic int numberOfSites()
GenotypeTable
numberOfSites
in interface GenotypeTable
public int chromosomeSiteCount(Chromosome locus)
GenotypeTable
chromosomeSiteCount
in interface GenotypeTable
locus
- chromosomepublic int chromosomalPosition(int site)
GenotypeTable
chromosomalPosition
in interface GenotypeTable
site
- sitepublic int siteOfPhysicalPosition(int physicalPosition, Chromosome locus)
GenotypeTable
siteOfPhysicalPosition
in interface GenotypeTable
physicalPosition
- physical positionlocus
- chromosome. if null, the first chromosome is used.public int siteOfPhysicalPosition(int physicalPosition, Chromosome locus, String snpName)
GenotypeTable
siteOfPhysicalPosition
in interface GenotypeTable
physicalPosition
- physical positionlocus
- chromosome. if null, the first chromosome is used.snpName
- SNP IDpublic Chromosome chromosome(int site)
GenotypeTable
chromosome
in interface GenotypeTable
site
- sitepublic Chromosome[] chromosomes()
GenotypeTable
chromosomes
in interface GenotypeTable
public int numChromosomes()
GenotypeTable
numChromosomes
in interface GenotypeTable
public int indelSize(int site)
GenotypeTable
indelSize
in interface GenotypeTable
site
- sitepublic boolean isIndel(int site)
GenotypeTable
isIndel
in interface GenotypeTable
site
- sitepublic byte referenceAllele(int site)
GenotypeTable
referenceAllele
in interface GenotypeTable
site
- sitepublic byte alternateAllele(int site)
GenotypeTable
alternateAllele
in interface GenotypeTable
site
- sitepublic GenotypeTable[] compositeAlignments()
GenotypeTable
compositeAlignments
in interface GenotypeTable
public byte majorAllele(int site)
GenotypeTable
majorAllele
in interface GenotypeTable
site
- sitepublic byte minorAllele(int site)
GenotypeTable
minorAllele
in interface GenotypeTable
site
- sitepublic byte[] minorAlleles(int site)
GenotypeTable
minorAlleles
in interface GenotypeTable
site
- sitepublic byte[] alleles(int site)
GenotypeTable
alleles
in interface GenotypeTable
site
- sitepublic double minorAlleleFrequency(int site)
GenotypeTable
minorAlleleFrequency
in interface GenotypeTable
site
- sitepublic int[][] allelesSortedByFrequency(int site)
GenotypeTable
allelesSortedByFrequency
in interface GenotypeTable
site
- sitepublic byte[] genotypeArray(int taxon, int site)
GenotypeTable
genotypeArray
in interface GenotypeTable
taxon
- taxonsite
- sitepublic byte[] genotypeAllTaxa(int site)
GenotypeTable
genotypeAllTaxa
in interface GenotypeTable
site
- sitepublic byte[] genotypeAllSites(int taxon)
GenotypeTable
genotypeAllSites
in interface GenotypeTable
taxon
- taxonpublic BitSet allelePresenceForAllSites(int taxon, WHICH_ALLELE allele)
GenotypeTable
allelePresenceForAllSites
in interface GenotypeTable
taxon
- taxonallele
- allelepublic long[] allelePresenceForSitesBlock(int taxon, WHICH_ALLELE allele, int startBlock, int endBlock)
GenotypeTable
allelePresenceForSitesBlock
in interface GenotypeTable
taxon
- taxonallele
- allelestartBlock
- starting blockendBlock
- end blockpublic String genotypeAsString(int taxon, int site)
GenotypeTable
genotypeAsString
in interface GenotypeTable
taxon
- taxonsite
- sitepublic String[] genotypeAsStringArray(int taxon, int site)
GenotypeTable
genotypeAsStringArray
in interface GenotypeTable
taxon
- taxonsite
- sitepublic byte[] referenceAlleles(int startSite, int endSite)
GenotypeTable
referenceAlleles
in interface GenotypeTable
startSite
- start siteendSite
- end sitepublic byte[] referenceAlleleForAllSites()
GenotypeTable
referenceAlleleForAllSites
in interface GenotypeTable
public boolean isHeterozygous(int taxon, int site)
GenotypeTable
isHeterozygous
in interface GenotypeTable
taxon
- taxonsite
- sitepublic int[] physicalPositions()
GenotypeTable
physicalPositions
in interface GenotypeTable
public String chromosomeName(int site)
GenotypeTable
chromosomeName
in interface GenotypeTable
site
- sitepublic int[] chromosomesOffsets()
GenotypeTable
chromosomesOffsets
in interface GenotypeTable
public Set<SiteScore.SITE_SCORE_TYPE> siteScoreTypes()
GenotypeTable
siteScoreTypes
in interface GenotypeTable
public boolean isAllPolymorphic()
GenotypeTable
isAllPolymorphic
in interface GenotypeTable
public boolean isPolymorphic(int site)
GenotypeTable
isPolymorphic
in interface GenotypeTable
site
- sitepublic double majorAlleleFrequency(int site)
GenotypeTable
majorAlleleFrequency
in interface GenotypeTable
site
- sitepublic String genomeVersion()
GenotypeTable
genomeVersion
in interface GenotypeTable
public boolean isPositiveStrand(int site)
GenotypeTable
isPositiveStrand
in interface GenotypeTable
site
- sitepublic boolean isPhased()
GenotypeTable
isPhased
in interface GenotypeTable
public boolean retainsRareAlleles()
GenotypeTable
retainsRareAlleles
in interface GenotypeTable
public String[][] alleleDefinitions()
GenotypeTable
alleleDefinitions
in interface GenotypeTable
public String[] alleleDefinitions(int site)
GenotypeTable
alleleDefinitions
in interface GenotypeTable
site
- sitepublic String genotypeAsString(int site, byte value)
GenotypeTable
genotypeAsString
in interface GenotypeTable
site
- sitevalue
- allele valuepublic int maxNumAlleles()
GenotypeTable
maxNumAlleles
in interface GenotypeTable
public int totalGametesNonMissingForSite(int site)
GenotypeTable
totalGametesNonMissingForSite
in interface GenotypeTable
site
- sitepublic int heterozygousCount(int site)
GenotypeTable
heterozygousCount
in interface GenotypeTable
site
- sitepublic int minorAlleleCount(int site)
GenotypeTable
minorAlleleCount
in interface GenotypeTable
site
- sitepublic int majorAlleleCount(int site)
GenotypeTable
majorAlleleCount
in interface GenotypeTable
site
- sitepublic Object[][] genosSortedByFrequency(int site)
GenotypeTable
genosSortedByFrequency
in interface GenotypeTable
site
- sitepublic byte[] allelesBySortType(GenotypeTable.ALLELE_SORT_TYPE scope, int site)
GenotypeTable
allelesBySortType
in interface GenotypeTable
scope
- scopesite
- sitepublic BitSet allelePresenceForAllTaxa(int site, WHICH_ALLELE allele)
GenotypeTable
allelePresenceForAllTaxa
in interface GenotypeTable
site
- siteallele
- allelepublic BitSet haplotypeAllelePresenceForAllSites(int taxon, boolean firstParent, WHICH_ALLELE allele)
GenotypeTable
haplotypeAllelePresenceForAllSites
in interface GenotypeTable
taxon
- taxonfirstParent
- true for first parent (false for second parent)allele
- allelepublic BitSet haplotypeAllelePresenceForAllTaxa(int site, boolean firstParent, WHICH_ALLELE allele)
GenotypeTable
haplotypeAllelePresenceForAllTaxa
in interface GenotypeTable
site
- sitefirstParent
- true for first parent (false for second parent)allele
- allelepublic long[] haplotypeAllelePresenceForSitesBlock(int taxon, boolean firstParent, WHICH_ALLELE allele, int startBlock, int endBlock)
GenotypeTable
haplotypeAllelePresenceForSitesBlock
in interface GenotypeTable
taxon
- taxonfirstParent
- true for first parent (false for second parent)allele
- allelestartBlock
- starting blockendBlock
- end blockpublic String genotypeAsStringRange(int taxon, int startSite, int endSite)
GenotypeTable
genotypeAsStringRange
in interface GenotypeTable
taxon
- taxonstartSite
- start siteendSite
- end sitepublic String genotypeAsStringRow(int taxon)
GenotypeTable
genotypeAsStringRow
in interface GenotypeTable
taxon
- taxonpublic int[] firstLastSiteOfChromosome(Chromosome chromosome)
GenotypeTable
firstLastSiteOfChromosome
in interface GenotypeTable
chromosome
- chromosomepublic int numberOfTaxa()
GenotypeTable
numberOfTaxa
in interface GenotypeTable
public Chromosome chromosome(String name)
GenotypeTable
chromosome
in interface GenotypeTable
name
- namepublic String majorAlleleAsString(int site)
GenotypeTable
majorAlleleAsString
in interface GenotypeTable
site
- sitepublic String minorAlleleAsString(int site)
GenotypeTable
minorAlleleAsString
in interface GenotypeTable
site
- sitepublic TaxaList taxa()
GenotypeTable
taxa
in interface GenotypeTable
public String taxaName(int index)
GenotypeTable
taxaName
in interface GenotypeTable
public String diploidAsString(int site, byte value)
GenotypeTable
diploidAsString
in interface GenotypeTable
site
- sitevalue
- diploid allele valuepublic int totalNonMissingForSite(int site)
GenotypeTable
totalNonMissingForSite
in interface GenotypeTable
site
- sitepublic Object[][] genoCounts()
GenotypeTable
genoCounts
in interface GenotypeTable
public Object[][] majorMinorCounts()
GenotypeTable
majorMinorCounts
in interface GenotypeTable
public int totalGametesNonMissingForTaxon(int taxon)
GenotypeTable
totalGametesNonMissingForTaxon
in interface GenotypeTable
taxon
- taxonpublic int heterozygousCountForTaxon(int taxon)
GenotypeTable
heterozygousCountForTaxon
in interface GenotypeTable
taxon
- taxonpublic int totalNonMissingForTaxon(int taxon)
GenotypeTable
totalNonMissingForTaxon
in interface GenotypeTable
taxon
- taxonpublic boolean hasGenotype()
GenotypeTable
hasGenotype
in interface GenotypeTable
public boolean hasDepth()
GenotypeTable
hasDepth
in interface GenotypeTable
public boolean hasAlleleProbabilities()
GenotypeTable
hasAlleleProbabilities
in interface GenotypeTable
public boolean hasReferenceProbablity()
GenotypeTable
hasReferenceProbablity
in interface GenotypeTable
public boolean hasDosage()
GenotypeTable
hasDosage
in interface GenotypeTable
public AlleleDepth depth()
GenotypeTable
depth
in interface GenotypeTable
public int[] depthForAlleles(int taxon, int site)
GenotypeTable
depthForAlleles
in interface GenotypeTable
taxon
- taxonsite
- sitepublic BitStorage bitStorage(WHICH_ALLELE allele)
GenotypeTable
bitStorage
in interface GenotypeTable
allele
- allelepublic PositionList positions()
GenotypeTable
positions
in interface GenotypeTable
public GenotypeCallTable genotypeMatrix()
GenotypeTable
genotypeMatrix
in interface GenotypeTable
public AlleleProbability alleleProbability()
GenotypeTable
alleleProbability
in interface GenotypeTable
public float alleleProbability(int taxon, int site, SiteScore.SITE_SCORE_TYPE type)
alleleProbability
in interface GenotypeTable
public ReferenceProbability referenceProbability()
GenotypeTable
referenceProbability
in interface GenotypeTable
public float referenceProbability(int taxon, int site)
referenceProbability
in interface GenotypeTable
public Dosage dosage()
GenotypeTable
dosage
in interface GenotypeTable
public byte dosage(int taxon, int site)
dosage
in interface GenotypeTable
public GeneralAnnotationStorage annotations()
GenotypeTable
annotations
in interface GenotypeTable
public Stream<Byte> streamGenotype()
streamGenotype
in interface GenotypeTable
public Stream<Byte> streamGenotype(int taxon)
streamGenotype
in interface GenotypeTable
public boolean hasSiteTranslations()
hasSiteTranslations
in interface GenotypeTable
public int[] siteTranslations()
siteTranslations
in interface GenotypeTable
Copyright © 2018. All rights reserved.