polyrad_DT2RADdata: Convert a long-format genotype data table into polyRAD's...

View source: R/polyrad_DT2RADdata.R

polyrad_DT2RADdataR Documentation

Convert a long-format genotype data table into polyRAD's RADdata class

Description

For a data table with samples and loci as rows (long-format data table), create a RADdata object as required for the R package, polyRAD (Clark et al 2019).

Usage

polyrad_DT2RADdata(
  dat,
  chromCol = "CHROM",
  posCol = "POS",
  refCol = "REF",
  altCol = "ALT",
  roCol = "RO",
  aoCol = "AO",
  sampCol = "SAMPLE"
)

Arguments

dat

Data.table: A long-format data.table with columns specified in chromCol, posCol, refCol, altCol, locusCol, and in sampCol.

chromCol

Character: Column with chromosome (or contig) information. Default = 'CHROM'.

posCol

Character: Column with position information. Default = 'POS'.

refCol

Character: Column with reference allele information. Default = 'REF'

altCol

Character: Column with alternate allele information. Default = 'ALT'

roCol

Character: Column with reference observed read counts information. Default = 'RO'

aoCol

Character: Column with alternate observed read information. Default = 'AO'

sampCol

Character: Column with sample information. Default = 'SAMPLE'.

Value

Returns a RADdata object class.

References

Clark et al (2019). polyRAD: Genotype calling with uncertainty from sequencing data in polyploids and diploids. G3. doi.org/10.1534/g3.118.200913

Examples

data(data_Genos)

genoRADdata <- polyrad_DT2RADdata(data_Genos)

genoRADdata


j-a-thia/genomalicious documentation built on Oct. 19, 2024, 7:51 p.m.