Description Usage Arguments Details Value Author(s) References See Also Examples
Writes genotype data encoded in an annotated data frame of class
genalex
to a Genepop-format text file.
included immediately to the right of genotype columns. Genepop
and its documentation are available at
http://kimura.univ-montp2.fr/~rousset/ and
http://kimura.univ-montp2.fr/~rousset/Genepop.pdf.
1 | writeGenepop(x, file, eol = "\n", check.annotation = TRUE)
|
x |
Annotated data frame of class |
file |
File name or connection for writing. If given as |
eol |
End-of-line character used for output (defaults to |
check.annotation |
If |
Although the GenAlEx and Genepop formats encode nearly the same data, there are flexibilities and limitations on both sides. For example, Genepop allows for a maximum of 3 digits to encode each allele, and only haploid or diploid data, while allowing for some mixing of diploid and haploid encodings. GenAlEx allows for more digits per allele and higher ploidy, although numeric data is still required, and only allows for a single ploidy per data file. Perhaps future extensions to this function will allow for additional haploid data to be written.
An attempt is made to produce output with useful whitespace. The locus names and each set of individual genotypes are aligned at a column determined by the longest sample name.
GenAlEx format components that are attributes of class genalex
are translated to components in the Genepop file as so:
The dataset title from the "dataset.title"
attribute is
written as the first line
The locus names from the "locus.names"
attribute are
written comma-separated as the second line
For each population listed in the "pop.labels"
attribute,
a single line containing Pop popname
is written
For each sample from a population, the sample identifier is written, then a space, comma and space, then the individual genotypes encoded as two or three digits per allele. Alleles for each locus are concatenated, and successive loci are separated by a single space.
Populations are written in the order in which they appear in
the "pop.labels"
attribute
Missing alleles are coded as zeroes "00"
or "000"
The same number of digits are used for encoding each allele of all loci
For Genepop ploidy is indicated by the number of digits used for encoding each locus. Two or three digits for the entire locus indicates haploidy, while four or six digits indicates diploidy with each allele using two or three digits, respectively.
For Genepop there is no provision for encoding additional non-genetic data
No value is returned.
Douglas G. Scofield
Rousset, F. (2008) GENEPOP '007: a complete reimplementation of the GENEPOP software for Windows and Linux. Molecular Ecology Resources 8, 103-106. http://onlinelibrary.wiley.com/doi/10.1111/j.1471-8286.2007.01931.x/abstract.
1 2 3 4 | data(Qagr_pericarp_genotypes)
# lots of output to terminal
dd <- as.genalex(head(Qagr_pericarp_genotypes, 40), force = TRUE)
writeGenepop(dd, file = "")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.