Description Usage Arguments Details Value Note Author(s)
View source: R/make.snp.dummy.R
Transforms SNPs into binary dummy variables.
1 |
data |
a matrix in which each column corresponds to a SNP and each row to an observation.
The genotypes of all SNPs must be either coded by 1 (for the homozygous reference genotype),
2 (heterozygous), and 3 (homozygous variant) or by 0, 1, 2. It is not allowed that some SNPs following the 1, 2, 3
coding scheme and some SNPs the 0, 1, 2 coding. Missing values are allowed, but please note that
neither |
make.snp.dummy
assumes that the homozygous dominant genotype
is coded by 1, the heterozygous genotype by 2, and the homozygous
recessive genotype by 3. Alternatively, the three genotypes can be coded
by the number of minor alleles, i.e. by 0, 1, and 2.
For each SNP, two dummy variables are generated:
At least one of the bases explaining the SNP are of the recessive type.
Both bases are of the recessive type.
A matrix with 2*ncol(data)
columns containing 2 dummy variables
for each SNP.
See the R
package scrime
for more general functions for recoding SNPs.
Holger Schwender, holger.schwender@hhu.de
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.