transform_snp is a function that transforms a SNP into a matrix for binomial naive bayes.

transform_snp(pat, binomial_n, levels = c(), get = c("levels", "transformed"))

Arguments

pat

A string of a SNP

binomial_n

The number of classes for the binomial naive bayes, default to 1 - bernoulli, 2 - binomial (support heterozygous SNPs)

levels

Existing transformation levels, if not provided, it will be inferred from the SNP

get

What to return, either "levels" or "transformed", or both

Value

A vector of either the transformation levels or the transformed SNP or a list containing both