recode.genotypes: Switch between character and numeric representations of...

Description Usage Arguments Details Value

Description

Switch between character and numeric representations of genotype calls

Usage

1
2
3
## S3 method for class 'genotypes'
recode(gty, mode = c("pass", "01", "native", "relative"),
  allowed = c("A", "C", "G", "T", "H"), alleles = NULL, ...)

Arguments

gty

a genotypes object

mode

conversion mode (see Details)

allowed

a vector of allowable alleles for character-encoded genotypes

alleles

a 2-column character matrix containing the reference and alternate allele at each marker in the input object; if null, obtained from marker map

...

ignored

Details

Genotypes on Illumina Infinium arrays are assumed to correspond to biallelic SNPs. Although the BeadStudio software reports calls in character form, the numeric representation (coded 0/1/2 for homozygous reference / heterozygous / homozygous alternate) is computationally much more convenient. This function performs the character-to-numeric conversion or its inverse.

When mode == "pass" (the default); the input is returned unchanged. When mode == "01", conversion from character to numeric is performed. If alleles is supplied or reference alleles are provided in the marker map, the coding will be with respect to the reference (A1) or alternate (A2) alleles. If reference alleles are not provided, the recoding falls back to mode == "relative". When mode == "relative", conversion from character to numeric is performed, and the coding is with respect to the minor allele in the current dataset. This can be a problem if the dataset is small, and obviously hampers comparisons to other datasets. Use this option with caution. (On the other hand, the concept of a minor allele may be very useful in the context of true population samples.) When mode == "native", conversion from numeric back to character is attempted. If the input had mode "relative", an error occurs – that conversion is too error-prone. Otherwise the converison uses the supplied reference alleles.

Value

a copy of gty with alleles converted to the requested encoding


andrewparkermorgan/argyle documentation built on May 10, 2019, 11:08 a.m.