make.snp.dummy {logicFS}R Documentation

SNPs to Dummy Variables

Description

Transforms SNPs into binary dummy variables

Usage

  make.snp.dummy(data)

Arguments

data a matrix containing only 1's, 2's and 3's (see details). Each column of data corresponds to a SNP and each row to an observation.

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. For each SNP, 2 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.

Author(s)

Holger Schwender, holger.schwender@udo.edu


[Package logicFS version 1.2.0 Index]