View source: R/individual_distance.R
Bruvo2.distance | R Documentation |
This is an inter-individual distance measure similar to
Bruvo.distance
, except that where genotypes have different
numbers of alleles, virtual alleles are equal to those from the longer
and/or shorter genotype, rather than being equal to infinity.
Bruvo2.distance(genotype1, genotype2, maxl = 7, usatnt = 2, missing = -9, add = TRUE, loss = TRUE)
genotype1 |
A numeric vector representing the genotype of one individual at one
locus. This type of vector is produced by the |
genotype2 |
The second genotype for the distance calculation, in the same format as
|
maxl |
The maximum number of alleles that either genotype can have. If it is
exceeded, |
usatnt |
The microsatellite repeat type for the locus. |
missing |
The symbol that indicates missing data for a given sample and locus.
See |
add |
|
loss |
|
Bruvo et al. (2004) describe multiple methods for calculating
genetic distances between individuals of different ploidy. (See
“Special cases” starting on page 2102 of the paper.) The
original Bruvo.distance
function in polysat uses the method
described for systems with complex changes in ploidy, adding virtual
alleles equal to infinity to the shorter genotype to make it the same
length as the longer genotype. This method, however, can exaggerate
distances between individuals of different ploidy, particularly when
used with meandistance.matrix2
as opposed to
meandistance.matrix
.
Bruvo2.distance
calculates distances between individuals under
the models of genome addition and genome loss. If add = TRUE
and
loss = TRUE
, the distance produced is equal to that of equation 6
in the paper.
If add = TRUE
and loss = FALSE
, the distance calculated is
that under genome addition only. Likewise if add = FALSE
and
loss = TRUE
the distance is calculated under genome loss only.
The latter distance should be greater than the former. If both were averaged
together, they would give the identical result to that produced when
add = TRUE
and loss = TRUE
. All three distances will be
less than that produced by Bruvo.distance
.
If both genotypes have the same number of alleles, they are passed to
Bruvo.distance
for the calculation. This also happens if
add = FALSE
and loss = FALSE
. Otherwise, if the genotypes have
different numbers of alleles, all possible genotypes with virtual
alleles are enumerated and passed to Bruvo.distance
one by one, and
the results averaged.
The number of different genotypes simulated under genome loss or genome addition is l^d, where l is the length of the genotype from which virtual alleles are being taken, and d is the difference in length between the longer and shorter genotype. For example, under genome addition for a diploid individual with alleles 1 and 2 being compared to a tetraploid individual, the genotypes 1211, 1212, 1221, and 1222 will each be used once to represent the diploid individual.
A decimal between 0 and 1, with 0 indicating complete identity of two
genotypes, and 1 indicating maximum dissimilarity. NA
is
returned if one or both genotypes are missing or if maxl
is exceeded.
Figure 1B and 1C of Bruvo et al. (2004) illustrate an example of this distance measure. To perform the identical calculation to that listed directly under equation 6, you would type:
Bruvo2.distance(c(20,23,24), c(20,24,26,43), usatnt=1)
However, you will notice that the result, 0.401, is slightly different from that given in the paper. This is due to an error in the paper. For the distance under genome loss when the virtual allele is 26, the result should be 1 instead of 1.75.
Lindsay V. Clark
Bruvo, R., Michiels, N. K., D'Sousa, T. G., and Schulenberg, H. (2004) A simple method for calculation of microsatellite genotypes irrespective of ploidy level. Molecular Ecology 13, 2101–2106.
Lynch.distance
, Bruvo.distance
,
meandistance.matrix2
Bruvo2.distance(c(102,104), c(104,104,106,110)) Bruvo2.distance(c(102,104), c(104,104,106,110), add = FALSE) Bruvo2.distance(c(102,104), c(104,104,106,110), loss = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.