recodeGenoTable: Take a data.table genotype file and call 'recode' to convert...

Description Usage Arguments Value Author(s) Examples

Description

Expects rows are SNPs and columns are lines. Data.table shouldn't have any metadata columns. recode changes the most common base pair to be major, second most common to be minor. Anything else is a het, except N, which is coded as NA. Can call either recode for single letter IUPAC SNPs or recodeBiallele for 2 letter SNP calls.

Usage

1
recodeGenoTable(genoTable,coding="IUPAC")

Arguments

genoTable

Data.table with values to be converted. Expects rows are SNPs and columns are lines. Data.table shouldn't have any metadata columns.

coding

IUPAC or Biallele depending on if genoTable is coded with IUPAC SNPs or 2 letter SNP calls.

Value

Returns of vector of same length as input with translated values.

Author(s)

Greg Ziegler

Examples

1
2
3
4
5
6
7
8
recodeGenoTable(genoTable)

## The function is currently defined as
function(genoTable){
  require(data.table)
  genoTable[, (names(genoTable)) := as.list(recode(.SD)), by=1:nrow(genoTable)]
  return(genoTable)
}

gziegler/ionomicsUtils documentation built on June 20, 2019, 8:04 p.m.