Generates a synthetic genetic distance matrix and metadata using hierarchical population structure, admixture and bottleneck options.
simulate_genetic_distances(
n_pops = 50,
n_major_groups = 5,
n_subgroups = 12,
geo_dims = 2,
genetic_dims = 2,
group_separation = 15,
subgroup_separation = 5,
pop_dispersion = 0.5,
isolation_factor = 0.8,
admixture_prob = 0.1,
bottleneck_prob = 0.05,
noise_level = 0.1,
nonlinear_factor = 0.7,
use_subgroups = TRUE,
use_genetic_dims = TRUE,
use_admixture = TRUE,
use_bottlenecks = TRUE,
use_isolation_by_distance = TRUE,
use_nonlinear = TRUE,
use_noise = TRUE,
seed = NULL,
verbose = TRUE
)A list with distance_matrix, population_info, position_matrix, and parameters.
Number of populations
Number of major groups
Number of subgroups
Geographic dimensions
Additional genetic drift dimensions
Separation between major groups
Separation between subgroups
Within-subgroup dispersion
Weight for geography in isolation-by-distance model (0-1)
Proportion of admixed populations
Proportion of bottlenecked populations
Noise level in transformation
Nonlinearity factor in transformation
Whether to create subgroups
Whether to include genetic dimensions
Whether to include admixture
Whether to include bottlenecks
Whether to weight geographic distance
Whether to apply nonlinear transformation
Whether to add noise
Optional seed for reproducibility (NULL leaves the RNG state unchanged)
Print diagnostics