write.POPDIST uses data from a
"genambig" object to write
a file formatted for the software POPDIST.
An optional character vector of samples to use. Must be a subset of
An optional character vector of loci to use. Must be a subset of
Character string. File path to which to write.
POPDIST is a program that calculates inter-population distance measures, some of which are available for polyploid samples with allele copy number ambiguity. Each population must be of uniform ploidy, but different populations may have different ploidies.
Two types of warning messages may be printed by
The first indicates that a population contains individuals of more than
one ploidy. In this case a file is still written, but POPDIST may not
be able to read it. Separate populations with different ploidies are
okay. The second type of warning indicates that an individual has more
alleles than its ploidy level. If this occurs, alleles are randomly
removed from the genotype that is written to the file.
write.POPDIST converts alleles into a two-digit
format, similarly to
write.Tetrasat. If the value of any allele
for a given locus is greater than 99, the function first checks to see
if the locus has a
Usatnts value greater than 1, and if so
divides all alleles by this value and rounds down. If the locus still
has alleles with more than two digits, a multiple of 10 is subtracted
from all alleles. A zero is placed in front of any allele with one digit.
A file is written but no value is returned.
Lindsay V. Clark
Tomiuk, J., Guldbrandtsen, B. and Loeschcke, B. (2009) Genetic similarity of polyploids: a new version of the computer program POPDIST (version 1.2.0) considers intraspecific genetic differentiation. Molecular Ecology Resources 9, 1364-1368.
Guldbrandtsen, B., Tomiuk, J. and Loeschcke, B. (2000) POPDIST version 1.1.1: A program to calculate population genetic distance and identity measures. Journal of Heredity 91, 178–179.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
# create a "genambig" object containing the dataset mygen <- new("genambig", samples=c("a", "b", "c", "d"), loci=c("loc1", "loc27")) mygen <- reformatPloidies(mygen, output="sample") Description(mygen) <- "Some example data for POPDIST" PopInfo(mygen) <- c(1,1,2,2) PopNames(mygen) <- c("Old Orchard Beach", "York Beach") Ploidies(mygen) <- c(2,2,4,4) Usatnts(mygen) <- c(2,2) Genotypes(mygen, loci="loc1") <- list(c(128, 134), c(130), Missing(mygen), c(126, 128, 132)) Genotypes(mygen, loci="loc27") <- list(c(209,211), c(207,217), c(207,209,215,221), c(211,223)) # write the file write.POPDIST(mygen, file="forPOPDIST.txt") # view the file cat(readLines("forPOPDIST.txt"), sep="\n")