Learn R Programming

AgeTopicModels (version 0.1.0)

simulate_genetic_disease_from_topic: Simulate genetic-disease-topic structure (step 2)

Description

Second step of the two-step simulation. Consumes outputs from simulate_topics() and generates disease outcomes under several genetic/topic-effect configurations.

Usage

simulate_genetic_disease_from_topic(
  para,
  genetics_population,
  causal_disease,
  disease_number,
  ds_per_idv = 6.1,
  itr_effect = 0,
  topic2disease = 2,
  v2t = 20,
  liability_thre = 0.8
)

Value

A list with four elements:

  • rec_data: Simulated disease records (primary output).

  • ds_list: Auxiliary data objects used in the simulation.

  • interact_disease: Binary disease outcomes for configuration 2.

  • pleiotropy_disease: Binary disease outcomes for configuration 3.

Arguments

para

Simulated topic parameters; the first element returned by simulate_topics().

genetics_population

Simulated genotypes; the second element returned by simulate_topics().

causal_disease

Simulated causal disease; the third element returned by simulate_topics().

disease_number

Number of additional diseases to simulate from the topic. The total number of diseases will be disease_number + 5.

ds_per_idv

Mean number of diseases per individual (default 6.1, as observed in UKB).

itr_effect

Interaction effect size to simulate (default 0).

topic2disease

Topic-to-disease effect size (default 2).

v2t

Number of variants that affect topic 1 (must match the value used in simulate_topics()).

liability_thre

Liability threshold for simulating disease: the proportion set to healthy. For example, 0.8 means the top 20% of liability are set to diseased (default 0.8).

Details

Five configurations across three SNP sets:

  1. SNP -> disease -> topic: SNP IDs 1-20; disease ID para$D + 1; topic ID 1.

  2. SNP * topic -> disease: SNP IDs 41-60; disease ID para$D + 2; topic ID 1.

  3. SNP -> topic -> disease; SNP -> disease: SNP IDs 21-(20 + v2t); disease ID para$D + 3; topic ID 1.

  4. SNP -> topic -> disease; SNP + SNP^2 -> disease: SNP IDs 21-(20 + v2t); disease ID para$D + 4; topic ID 1.

  5. SNP -> topic + topic^2 -> disease; SNP -> disease: SNP IDs 21-(20 + v2t); disease ID para$D + 5; topic ID 1.

See Also

simulate_topics()

Examples

Run this code
set.seed(1)
# Minimal, fast example
rslts <- simulate_topics(topic_number = 2, pop_sz = 1000,
                         disease2topic = 0.1, v2t = 20)
para_sim            <- rslts[[1]]
genetics_population <- rslts[[2]]
causal_disease      <- rslts[[3]]

reslt_ds <- simulate_genetic_disease_from_topic(
  para_sim, genetics_population, causal_disease,
  disease_number = 20, itr_effect = 1,
  topic2disease = 2, v2t = 20
)
rec_data <- reslt_ds[[1]]

Run the code above in your browser using DataLab