snp.recode: recode snps

Description Usage Arguments Value Note

View source: R/snp.R

Description

recode snps

Usage

1
snp.recode(x, cols = NULL, recodes = c(2, 1, 0))

Arguments

x

df or vector (char or factor of char)

cols

evaluated as cols=ez.selcol(x,cols), ignored if x is a vector

recodes

vector with three elements corresponding to (minor-minor, minor-major or major-minor, major-major). Could be c(0,1,2), c(2,1,0), c(-1,0,1), c(1,2,3), c(0,1,1), c(1,0,0), c('AA','AB','BB')

Value

returns a new df or vector. Regardless of input data type, if recodes are number, then the returned is also numeric; if recodes are char, then always factor of char.

Note

assume biallelic, otherwise error. minor/major bases are calculated based on the actual input data


jerryzhujian9/bz documentation built on Jan. 12, 2022, 9:45 a.m.