Recoding of Affymetrix SNP Values
Recodes the values used on Affymetrix SNP chips to code the genotypes to other values – required, e.g., by other functions of this package.
recodeAffySNP(mat, refAA = FALSE, geno = 1:3)
mat |
a matrix or data frame consisting of the character strings |
refAA |
codes |
geno |
a numeric or character vector of length 3 giving the three values that
should be used to recode the genotypes. By default, |
A matrix of the same size as mat
containing the recoded genotypes. (Missing values are
coded by NA
.)
## Not run: # Generate a sample data set consisting of 10 rows and 12 columns, # and randomly replace 5 of the values by "NN". mat <- matrix("", 10, 12) mat[1:5,] <- sample(c("AA", "AB", "BB"), 60, TRUE, prob = c(0.49, 0.42, 0.09)) mat[6:10,] <- sample(c("AA", "AB", "BB"), 60, TRUE, prob = c(0.09, 0.42, 0.49)) mat[sample(120, 5)] <- "NN" mat # Recode the SNPs. recodeAffySNP(mat) # Recode the SNPs assuming that "A" is always the major allele. recodeAffySNP(mat, refAA = TRUE) ## End(Not run)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.