create_demo_assoc_qt_data: Create a set of assoc_qt data to demonstrate PLINKs...

View source: R/create_demo_assoc_qt_data.R

create_demo_assoc_qt_dataR Documentation

Create a set of assoc_qt data to demonstrate PLINKs --assoc_qt functionality

Description

This function creates:

  • Individuals that have all combinations of SNPs exactly once, as created by the create_demo_ped_table function

  • All SNPs that are on different chromosomes as created by the 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 calc_additive_phenotype_values for the exact calculation

    • epistatic: a trait that is epistatic, see calc_epistatic_phenotype_values for the exact calculation

Usage

create_demo_assoc_qt_data(n_individuals = 3, traits = create_demo_traits())

Arguments

n_individuals

the number of individuals. Use check_n_individuals to check if this is a valid value

traits

one or more traits with a clear genetic architecture and a known minor allele frequency, as, for example, created by create_demo_traits.

Author(s)

Richèl J.C. Bilderbeek

Examples

# Default
create_demo_assoc_qt_data()

# Add more individuals
create_demo_assoc_qt_data(n_individuals = 5)

# Use a random trait
create_demo_assoc_qt_data(
  traits = create_random_trait()
)

# Use an additive trait
create_demo_assoc_qt_data(
  traits = create_additive_trait()
)

# Use an epistatic trait
create_demo_assoc_qt_data(
  traits = create_epistatic_trait()
)

# Use an additive and random trait
create_demo_assoc_qt_data(
  traits = list(
    create_additive_trait(),
    create_random_trait()
   )
)

# Use three random traits
# Don't forget to put the trait in a list, else 'rep' will
# concatenate the traits in one list
create_demo_assoc_qt_data(
  traits = rep(list(create_random_trait()), 3)
)

# Use two additive traits with different minor allele frequencies
create_demo_assoc_qt_data(
  traits = list(
    create_additive_trait(maf = 0.01),
    create_additive_trait(maf = 0.10)
  )
)

richelbilderbeek/plinkr documentation built on March 25, 2024, 3:18 p.m.