make.snp.dummy: SNPs to Dummy Variables

Description Usage Arguments Details Value Note Author(s)

View source: R/make.snp.dummy.R

Description

Transforms SNPs into binary dummy variables.

Usage

1

Arguments

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 logic.bagging nor logicFS can handle missing values so that the missing values need to be imputed (preferably before an application of make.snp.dummy.

Details

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:

SNP.1

At least one of the bases explaining the SNP are of the recessive type.

SNP.2

Both bases are of the recessive type.

Value

A matrix with 2*ncol(data) columns containing 2 dummy variables for each SNP.

Note

See the R package scrime for more general functions for recoding SNPs.

Author(s)

Holger Schwender, holger.schwender@hhu.de


holgerschw/logicFS documentation built on April 15, 2020, 10:42 p.m.