Description Usage Arguments Value Author(s) Examples
Split loci stored in one column to two columns for each allele in a matrix of diploid data.
1 | alleleSplit(x, sep = NULL)
|
x |
a matrix or data.frame containing diploid data. Every column represents one locus with two alleles. |
sep |
separator used between alleles of a locus. If |
matrix with alleles for each locus in one column split into separate columns.
Eric Archer eric.archer@noaa.gov
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | # A sample SNP data set with no separators between nucleotides in a genotype
snps <- do.call(cbind, lapply(1:3, function(i) {
a1 <- sample(c("A", "G"), 10, rep = TRUE)
a2 <- sample(c("A", "G"), 10, rep = TRUE)
paste(a1, a2, sep = "")
}))
colnames(snps) <- paste("Loc", LETTERS[1:3], sep = "_")
snps
alleleSplit(snps)
# A sample microsatellie data set with alleles separated by "/"
alleles <- seq(100, 150, 2)
msats <- do.call(cbind, lapply(1:3, function(i) {
a1 <- sample(alleles, 10, rep = TRUE)
a2 <- sample(alleles, 10, rep = TRUE)
paste(a1, "/", a2, sep = "")
}))
colnames(msats) <- paste("Loc", LETTERS[1:3], sep = "_")
msats
alleleSplit(msats, sep = "/")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.