Helper function transforming experiment counts to selected inheritance_model.

applyInheritanceModel(
  experiment,
  inheritance_model = c("dominant", "recessive", "additive", "overdominant")
)

# S3 method for matrix
applyInheritanceModel(
  experiment,
  inheritance_model = c("dominant", "recessive", "additive", "overdominant")
)

# S3 method for SummarizedExperiment
applyInheritanceModel(
  experiment,
  inheritance_model = c("dominant", "recessive", "additive", "overdominant")
)

Arguments

experiment

Matrix or SummarizedExperiment object.

inheritance_model

String specifying inheritance model to use. Available choices are "dominant", "recessive", "additive".

Value

experiment converted to specified inheritance model.

Details

Under "dominant" model homozygotes and heterozygotes are coded as 1. In "recessive" model homozygotes are coded as 1 and other as 0. In "additive" model homozygotes are coded as 2 and heterozygotes as 1. In "overdominant" homozygotes (both 0 and 2) are coded as 0 and heterozygotes as 1.