DT2RADdata | R Documentation |
Used to generate the RADdata class object from the polyRAD
package
described in Clark et al. (2019).
DT2RADdata(
dat,
chromCol = "CHROM",
posCol = "POS",
locusCol = "LOCUS",
sampCol = "SAMPLE",
refCol = "REF",
roCol = "RO",
altCol = "ALT",
aoCol = "AO",
possPloidy = list(2L),
sampPloidy = 2L,
contamRate = 0.001
)
dat |
Data.table: A data table of read counts for genotypes loci. Expects the columns:
|
chromCol |
Character: The column name with the chromosome information.
Default = |
posCol |
Character: The column name with the position information.
Default = |
locusCol |
Character: The column name with the locus information.
Default = |
sampCol |
Character: The column name with the sampled individual information.
Default = |
refCol |
Character: The column with the reference allele nucleotide information.
Default = |
roCol |
Character: The column with the reference allele read count information.
Default = |
altCol |
Character: The column with the alternate allele nucleotide information.
Default = |
aoCol |
Character: The column with the alternate allele read count information.
Default = |
possPloidy |
List: A list of integers or numerics that represent the unique
ploidy values in the dataset. Default is |
sampPloidy |
Integer/Numeric: Either a single value or a named vector of values
for each sample. Default is a single value, 2, i.e., all samples have a ploidy
of 2. A vector |
contamRate |
Numeric: The contamination rate. Default is 0.001. |
Clark et al. (2019). G3. DOI: 10.1534/g3.118.200913
library(genomalicious)
data(data_Genos)
# Using a single ploidy
RD1 <- DT2RADdata(data_Genos, sampPloidy=2)
# Using a vector of ploidies.
samps_uniq <- unique(data_Genos$SAMPLE)
samps_ploid <- rep(2, length(samps_uniq))
names(samps_ploid) <- samps_uniq
samps_ploid
RD2 <- DT2RADdata(data_Genos, sampPloidy=samps_ploid)
Specifying multiple ploidies.
samps_ploid[20:40] <- 4
samps_ploid %>% table
RD3 <- DT2RADdata(data_Genos, possPloidy=list(2, 4), sampPloidy=samps_ploid)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.