Description Usage Arguments Value See Also Examples
Recodes the values used to specify the genotypes of the SNPs to other values. Such a recoding might be required to use other functions contained in this package.
1 | recodeSNPs(mat, first.ref = FALSE, geno = 1:3, snp.in.col = FALSE)
|
mat |
a matrix or data frame consisting of character strings of length 2 that
specify the genotypes of the SNPs. Each of these character strings
must be a combination of the letters A, T, C, and G. Missing values can
be specified by |
first.ref |
does the first letter in the string coding the heterozygous
genotype always stands for the more frequent allele? E.g., codes |
geno |
a numeric or character vector of length 3 giving the three values that
should be used to recode the genotypes. By default, |
snp.in.col |
does each column of |
A matrix of the same size as mat
containing the recoded genotypes. (Missing values are
coded by NA
).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ## Not run:
# Generate an example data set consisting of 5 rows and 12 columns,
# where it is assumed that each row corresponds to a SNP.
mat <- matrix("", 10, 12)
mat[c(1, 4, 6),] <- sample(c("AA", "AT", "TT"), 18, TRUE)
mat[c(2, 3, 10),] <- sample(c("CC", "CG", "GG"), 18, TRUE)
mat[c(5, 8),] <- sample(c("GG", "GT", "TT"), 12, TRUE)
mat[c(7, 9),] <- sample(c("AA", "AC", "CC"), 12, TRUE)
mat
# Recode the SNPs
recodeSNPs(mat)
# Recode the SNPs by assuming that the first letter in
# the heterogyzous genotype refers to the major allele.
recodeSNPs(mat, first.ref = TRUE)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.