View source: R/genos2indAlleles.R
genos2indAlleles | R Documentation |
A long-format data table of genotypes is converted into a wide-format data table of alleles, where each locus is represented by two columns: one for the first allele, the other for the second allele.
genos2indAlleles(dat, sampCol = "SAMPLE", locusCol = "LOCUS", genoCol = "GT")
dat |
Data.table: Contains samples and loci in rows, with a separate column endcoding genotypes, where each allele is separated by a '/'. |
sampCol |
Character: Column with sample information. Default = |
locusCol |
Character: Column with locus information. Default = |
genoCol |
Character: Column with genotype information. Default = |
A data frame in wide format, with a sample column $SAMPLE
and
2 * number of loci additional columns containing alleles for each locus.
For example, $locus1_1
and $locus1_2
will contain the first and
second allele for "locus1".
library(genomalicious)
data(data_Genos)
data_Genos
alle_dt <- genos2indAlleles(data_Genos)
# The first three loci, with count of allele 1 and 2.
alle_dt[1:4, 1:7]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.