Description Usage Arguments Value Note Author(s) Examples
This function converts loci into data frames consisting of alleles, stratum, frequencies, etc.
1 2 3 4 5 6 7 8 9 10 | frequencies(x, loci, stratum, ...)
## Default S3 method:
frequencies(x, ...)
## S3 method for class 'locus'
frequencies(x, loci, ...)
## S3 method for class 'data.frame'
frequencies(x, loci, stratum, ...)
|
x |
Either a vector of types |
loci |
The loci to get frequencies from (default is all). |
stratum |
Partition of the data based upon this stratum (default is no partitions). |
... |
Ignored |
A data frame with Frequencies, Alleles, Loci, and perhaps Stratum columns (Allele and Frequencies are at a minimum).
A data frame with Frequencies, Alleles, Loci, and perhaps Stratum columns (Allele and Frequencies are at a minimum).
A data frame with Frequencies, Alleles, Loci, and perhaps Stratum columns (Allele and Frequencies are at a minimum).
A data frame with Frequencies, Alleles, Loci, and perhaps Stratum columns (Allele and Frequencies are at a minimum).
You can submit RAD-seq genotypes in a normal data.frame
to this function BUT it must be formatted as follows. Each locus
is represented by three columns of probabilities (must sum to 1).
You must label the columns of your data frame with the name of the locus
and a column number separated by an underscore '_' (e.g., Loc1_1, Loc1_2,
Loc1_3, Loc2_1, Loc2_2, Loc2_3, etc). The function will name the locus
the part before the dash (e.g., Loc1). The frequencies of the heterozygote
genotype frequency represented in the middle position.
Rodney J. Dyer rjdyer@vcu.edu
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | AA <- locus( c("A","A") )
AB <- locus( c("A","B") )
BB <- locus( c("B","B") )
loc1 <- c(AA,AB,AB,AA,BB)
frequencies(loc1)
loc2 <- c(BB,BB,AB,AA,BB)
df <- data.frame(Population=c(rep("A",3), rep("B",2)), TPI=loc1, PGM=loc2)
frequencies(df)
frequencies(df,stratum="Population")
# RAD-seq example
m <- matrix(abs(rnorm(30)),nrow=10)
m <- m / rowSums(m)
df <- data.frame(m)
names(df) <- c("Loc1_1","Loc1_2","Loc1_3")
frequencies(df)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.