Learn R Programming

DataFusionGDM (version 1.3.2)

run_genetic_simulation: Run a high-level genetic simulation with configurable model

Description

Run a high-level genetic simulation with configurable model

Usage

run_genetic_simulation(
  n_pops = 30,
  n_major_groups = 4,
  n_subgroups = 8,
  model = "mixed",
  geo_dims = NULL,
  isolation_factor = NULL,
  genetic_dims = NULL,
  group_separation = 15,
  subgroup_separation = NULL,
  pop_dispersion = 0.5,
  admixture_prob = 0.15,
  bottleneck_prob = 0.1,
  use_subgroups = TRUE,
  use_genetic_dims = NULL,
  use_admixture = TRUE,
  use_bottlenecks = TRUE,
  use_isolation_by_distance = NULL,
  use_nonlinear = TRUE,
  use_noise = TRUE,
  seed = NULL,
  output_file = NULL,
  verbose = TRUE
)

Value

List with results and plots (functions to print plots)

Arguments

n_pops

Number of populations

n_major_groups

Number of major groups

n_subgroups

Number of subgroups

model

One of "mixed", "geography", "genetics", or "custom"

geo_dims

Geographic dimensions (overrides default based on model if set)

isolation_factor

Geography-genetics balance (overrides default based on model if set)

genetic_dims

Genetic dimensions (overrides default based on model if set)

group_separation

Separation between major groups

subgroup_separation

Separation between subgroups (default: group_separation/3 when NULL)

pop_dispersion

Within-subgroup dispersion

admixture_prob

Proportion of admixed populations

bottleneck_prob

Proportion of bottlenecked populations

use_subgroups

Whether to create subgroups

use_genetic_dims

Whether to include genetic dimensions

use_admixture

Whether to include admixture

use_bottlenecks

Whether to include bottlenecks

use_isolation_by_distance

Whether to weight geographic distance

use_nonlinear

Whether to apply nonlinear transformation

use_noise

Whether to add noise

seed

Optional seed forwarded to simulate_genetic_distances()

output_file

Optional CSV file path to write the distance matrix

verbose

Print diagnostics