View source: R/genotypes2alleles.R
genotypes2alleles | R Documentation |
A function that will return a data frame in allele per column format from genotype per column format.
genotypes2alleles(df, loci, fixed_A = NULL, delim = NULL, name_sep = ".")
df |
Data frame that contains genotypic data and metadata |
loci |
Numeric column positions or names of loci |
fixed_A |
The number of characters of alleles in input. A diploid genotype "AT" has a fixed_A=1. Only use when the delimiter between alleles is "". |
delim |
A non-zero length character string separating alleles in input. For example, ":" for "A:T" or "-" 114-116" |
name_sep |
The desired locus allele name separator for output column names e.g., "_" for Loc1_A1. Defaults to "." |
This function is meant to conveniently wrap tidyr and dplyr operations to convert data between two common wide formats. At present, it's just set up for diploid data.
Data frame in allele per column format
Zak Robinson, Contact: <zrobinson@critfc.org>
alleles2genotypes
data("wgp_example")
alleles <- genotypes2alleles(wgp_example,loci = grep("locus",colnames(wgp_example)),fixed_A = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.