#' Create a set of \code{assoc_qt_covar} parameters
#' to demonstrate PLINKs \code{--assoc} and \code{--covar} functionality
#'
#' This function creates:
#' * Individuals that have all combinations of SNPs exactly once,
#' as created by the \link{create_demo_ped_table} function
#' * All SNPs that are on different chromosomes
#' as created by the \link{create_demo_map_table} function
#' * Traits that follow different genotype to phenotype mapping:
#' * `control`: a trait that is random
#' * `additive`: a trait that is perfectly additive,
#' see \link{calc_additive_phenotype_values} for the exact calculation
#' * `epistatic`: a trait that is epistatic,
#' see \link{calc_epistatic_phenotype_values} for the exact calculation
#'
#' @note This function is named after the \code{--assoc}
#' and \code{--covar} PLINK flags.
#' @examples
#' create_demo_assoc_qt_covar_data()
#' @inheritParams default_params_doc
#' @author Richèl J.C. Bilderbeek
#' @export
create_demo_assoc_qt_covar_data <- function( # nolint indeed a long function name
n_individuals = 3,
traits = create_demo_traits()
) {
plinkr::check_n_individuals(n_individuals)
plinkr::check_traits(traits)
# Add a demo covariates table to the
assoc_qt_data <- create_demo_assoc_qt_data(
n_individuals = n_individuals,
traits = traits
)
cov_table <- plinkr::create_cov_table_from_ped_table(
assoc_qt_data$data$ped_table
)
cov_table[, 3] <- stats::runif(n = nrow(cov_table))
plinkr::create_assoc_qt_covar_data(
data = assoc_qt_data$data,
phenotype_data = assoc_qt_data$phenotype_data,
cov_table = cov_table
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.