Description Usage Arguments Author(s) Examples
This function interconverts genetic data among matrix format (one locus or one allele per column) and list format (one locus or one allele per column).
1 2 3 4 5 6 7 8 9 10 11 |
X |
Input data. |
input |
Input data format. |
output |
Output data format. |
ncod |
Number of digits coding each allele. |
ploidy |
Ploidy of the data. |
sep.in |
Character separating alleles in the input data if present. |
sep.out |
Character separating alleles in the output data. Default option do not separate alleles. |
chk.names |
Defalult TRUE. The function makes checks of individuals and loci names during conversion. |
chk.plocod |
Defalult TRUE. The function checks coherence in/between ploidy and number of digits coding alleles for loci data during conversion. |
Leandro Roser learoser@gmail.com
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | ## Not run:
data(eco3)
# One allele per column
loc2al <- eco.convert(eco3[["G"]], "matrix", "alleles.matrix", ploidy = 2)
loc2al
# Inverse operation (collapse alleles into locus)
al2loc <- eco.convert(loc2al, "alleles.matrix", "matrix", ploidy = 2)
al2loc
# Separating alleles with a character string
loc2loc <- eco.convert(eco3[["G"]], "matrix", "matrix", ploidy = 2, sep.out = "/")
loc2loc
# Inverse operation (removing separator)
loc2loc.nosep <- eco.convert(loc2loc, "matrix", "matrix", ploidy = 2, sep.in = "/", sep.out = "")
loc2loc.nosep
# Locus to list
loc2list <- eco.convert(eco3[["G"]], "matrix", "list", ploidy = 2)
loc2list
# Locus to allele list
al2list <- eco.convert(eco3[["G"]], "matrix", "alleles.list", ploidy = 2)
al2list
# The inverse operations are also defined. All the formats are interconvertible.
# Locus operations have defined a within operation (matrix to matrix, list to list),
# with the purpose of put/remove separators between alleles. The program accepts any ploidy level.
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.