genoDoses2genoClasses | R Documentation |
Convert SNP genotypes from "allele doses" into "genotypic classes".
Let us denote by "A" (or A1) the first allele, and "B" (or A2) the second allele.
The specific nucleotides (A, C, G or T) corresponding to "A" and "B" are specified via the allele
argument to the function.
Moreover, whether A is the major (most frequent) allele or not, doesn't matter for the function to work.
At a given SNP, genotypes being homozygous for the first allele are coded as "0" in allele dose, and will be converted into "AA" in genotypic class.
Those being heterozygous are "1" and will be "AB".
Finally, those being homozygous for the second allele are "2" and will be "BB".
The code is not particularly efficient, but at least it exists.
genoDoses2genoClasses(
X = NULL,
tX = NULL,
alleles,
na.string = "--",
nb.cores = 1,
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,1,2, with genotypes in rows and SNPs in columns; the "second" allele is arbitrary, it corresponds to the second column of |
tX |
matrix with SNPs in rows and genotypes in columns |
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 |
na.string |
character used to replace NA values |
nb.cores |
the number of cores to use, i.e. at most how many child processes will be run simultaneously (not on Windows) |
verbose |
verbosity level (0/1) |
data.frame with SNPs in rows and genotypes in columns
Timothee Flutre
genoClasses2genoDoses
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.