public class IBSDistanceMatrix extends Object
Please note that when heterozygous genotypes are used, Het to Het distance is 0.5 NOT 0.0. The default along the identity diagonal is 0 (isTrueIBS = false), but changing isTrueIBS = true will calculate the identity.
The distance estimates become wildly inaccurate when too few sites are used to calculate distance. The minSiteComp parameter can be used to control the minimum number of sites used for a calculation. If there are insufficient sites in the estimate, then Double.NaN is returned.
Modifier and Type | Method and Description |
---|---|
static double[] |
computeHetBitDistances(GenotypeTable theTBA,
int taxon1,
int taxon2)
Compute distance for a pair of taxa.
|
static double[] |
computeHetBitDistances(GenotypeTable theTBA,
int taxon1,
int taxon2,
int minSitesCompared)
Compute distance for a pair of taxa.
|
static double[] |
computeHetBitDistances(GenotypeTable theTBA,
int taxon1,
int taxon2,
int minSitesCompared,
int firstWord,
int lastWord,
BitSet maskBadSet)
Compute distance for a pair of taxa.
|
static double[] |
computeHetBitDistances(long[] iMj,
long[] iMn,
long[] jMj,
long[] jMn,
int minSitesCompared)
Calculation of distance using the bit vector of major and minor alleles.
|
static double[] |
computeHetBitDistances(long[] iMj,
long[] iMn,
long[] jMj,
long[] jMn,
int minSitesCompared,
int firstWord,
int lastWord)
Calculation of distance using the bit vector of major and minor alleles.
|
static double[] |
computeHetBitDistancesThirdState(long[] iMj,
long[] iMn,
long[] iMn2,
long[] jMj,
long[] jMn,
long[] jMn2,
int minSitesCompared)
Calculation of distance using the bit vector of the first three alleles.
|
static double[] |
computeHetBitDistancesThirdState(long[] iMj,
long[] iMn,
long[] iMn2,
long[] jMj,
long[] jMn,
long[] jMn2,
int minSitesCompared,
int firstWord,
int lastWord)
Calculation of distance using the bit vectors of the first three alleles.
|
static double[] |
computeHetDistances(byte[] first,
byte[] second,
int minSitesComp) |
static DistanceMatrix |
getInstance(GenotypeTable theAlignment)
Compute observed distances for all taxa.
|
static DistanceMatrix |
getInstance(GenotypeTable theAlignment,
int minSiteComp,
boolean trueIBS,
ProgressListener listener,
boolean useThirdState)
Compute observed distances for all taxa.
|
static DistanceMatrix |
getInstance(GenotypeTable theAlignment,
int minSiteComp,
ProgressListener listener)
Compute observed distances for all taxa.
|
static DistanceMatrix |
getInstance(GenotypeTable theAlignment,
ProgressListener listener)
Compute observed distances for all taxa.
|
public static DistanceMatrix getInstance(GenotypeTable theAlignment)
theAlignment
- Alignment used to computed distancespublic static DistanceMatrix getInstance(GenotypeTable theAlignment, ProgressListener listener)
theAlignment
- Alignment used to computed distanceslistener
- Listener to track progress in calculationspublic static DistanceMatrix getInstance(GenotypeTable theAlignment, int minSiteComp, ProgressListener listener)
theAlignment
- Alignment used to computed distancesminSiteComp
- Minimum number of sites needed to estimate distancelistener
- Listener to track progress in calculationspublic static DistanceMatrix getInstance(GenotypeTable theAlignment, int minSiteComp, boolean trueIBS, ProgressListener listener, boolean useThirdState)
theAlignment
- Alignment used to computed distancesminSiteComp
- Minimum number of sites needed to estimate distancetrueIBS
- estimate diagonal distance based IBS (default = false,
i=i=0.0)listener
- Listener to track progress in calculationsuseThirdState
- public static double[] computeHetDistances(byte[] first, byte[] second, int minSitesComp)
public static double[] computeHetBitDistances(GenotypeTable theTBA, int taxon1, int taxon2)
theTBA
- input alignmenttaxon1
- index of taxon 1taxon2
- index of taxon 2public static double[] computeHetBitDistances(GenotypeTable theTBA, int taxon1, int taxon2, int minSitesCompared)
theTBA
- input alignmenttaxon1
- index of taxon 1taxon2
- index of taxon 2minSitesCompared
- Minimum number of sites needed to estimate
distancepublic static double[] computeHetBitDistances(GenotypeTable theTBA, int taxon1, int taxon2, int minSitesCompared, int firstWord, int lastWord, BitSet maskBadSet)
theTBA
- input alignmenttaxon1
- index of taxon 1taxon2
- index of taxon 2minSitesCompared
- Minimum number of sites needed to estimate
distancefirstWord
- starting word for calculating distance
site=(firstWord*64)lastWord
- ending word for calculating distance inclusive
site=(lastWord*64+63)maskBadSet
- Optional mask for sites (those set to 1 are kept)public static double[] computeHetBitDistances(long[] iMj, long[] iMn, long[] jMj, long[] jMn, int minSitesCompared)
iMj
- Vector of major alleles for taxon iiMn
- Vector of minor alleles for taxon ijMj
- Vector of major alleles for taxon jjMn
- Vector of minor alleles for taxon jminSitesCompared
- Minimum number of sites needed to estimate
distancepublic static double[] computeHetBitDistancesThirdState(long[] iMj, long[] iMn, long[] iMn2, long[] jMj, long[] jMn, long[] jMn2, int minSitesCompared)
iMj
- Vector of major alleles for taxon iiMn
- Vector of minor alleles for taxon ijMj
- Vector of major alleles for taxon jjMn
- Vector of minor alleles for taxon jminSitesCompared
- Minimum number of sites needed to estimate
distancepublic static double[] computeHetBitDistances(long[] iMj, long[] iMn, long[] jMj, long[] jMn, int minSitesCompared, int firstWord, int lastWord)
iMj
- Vector of major alleles for taxon iiMn
- Vector of minor alleles for taxon ijMj
- Vector of major alleles for taxon jjMn
- Vector of minor alleles for taxon jminSitesCompared
- Minimum number of sites needed to estimate
distancefirstWord
- first world for calculating distancelastWord
- last word for calculating distance inclusive
site=(endWord*64+63)public static double[] computeHetBitDistancesThirdState(long[] iMj, long[] iMn, long[] iMn2, long[] jMj, long[] jMn, long[] jMn2, int minSitesCompared, int firstWord, int lastWord)
iMj
- Vector of major alleles for taxon iiMn
- Vector of minor alleles for taxon iiMn2
- Vector of second minor alleles for taxon ijMj
- Vector of major alleles for taxon jjMn
- Vector of minor alleles for taxon jjMn2
- Vector of second minor alleles for taxon jminSitesCompared
- Minimum number of sites needed to estimate
distancefirstWord
- first world for calculating distancelastWord
- last word for calculating distance inclusive
site=(endWord*64+63)Copyright © 2018. All rights reserved.