recodeGenosMinorSnpAllele | R Documentation |
Recode bi-allelic SNP genotypes in terms of the number of copies of the minor allele.
Let be a bi-allelic SNP with two alleles, A, the first allele, and B, the second allele.
Here, "first" and "second" are arbitrary, meaning that "A" as "B" can be the minor (least frequent) allele.
The SNP genotypes are originally coded in number of copies of the second allele: that is, if a genotype is "AA", its allele dose is 0
; if "AB", then 1
; and if "BB", then 2
.
Let us now assume that, in fact, "A" is the minor (least frequent) allele, then, when recoding SNP genotypes in terms of minor alleles, "AA" will correspond to 2
, "AB" to 1
and "BB" to 0
.
recodeGenosMinorSnpAllele(X, alleles, verbose = 1)
X |
matrix of bi-allelic SNP genotypes encoded, for each SNP, in number of copies of its second allele, i.e. as allele doses in [0,2], with genotypes in rows and SNPs in columns; missing values should be encoded as NA; the "second" allele is arbitrary, it corresponds to the second column of |
alleles |
data.frame with SNPs in rows (names as row names) and alleles in columns (exactly 2 columns are required); the second column should correspond to the allele which number of copies is counted at each SNP in |
verbose |
verbosity level (0/1) |
list with a matrix of SNP genotypes encoded, for each SNP, in number of copies of its minor allele, with genotypes in rows and SNPs in columns, a data.frame of alleles which columns are named "minor" and "major", and a vector of logicals indicating which SNPs have been recoded
Timothee Flutre
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.