tracts.driver_utils#

Functions

_get_display_param_indices(...[, steps])

Compute which parameter columns should be shown in starting-parameter tables.

_get_optimization_subtitle(...[, steps])

Build the user-readable optimization subtitle for the active run phase.

_normalize_multi_init_result(result)

Normalize outputs from multi-initialization optimization runs.

_print_run_intro(parameter_handler, model, ...)

Print the optimization subtitle and starting-parameter table for a run.

_print_step_header_block(parameter_handler)

Print starting-parameter information before optimization runs begin.

_summarize_step_results(params_found, ...[, ...])

Print per-run optimization results and select the best run.

collapse_identical_start_params(...)

Collapse repeated identical starting-parameter sets to a single repetition.

get_time_scaled_model_bounds(model[, verbose])

Computes a function that takes in optimizer parameters, converts them to physical parameters using the model's parameter handler, and returns the violation score for those parameters.

get_time_scaled_model_func(model)

Computes a function that takes in optimizer parameters, converts them to physical parameters using the model's parameter handler, and returns the migration matrices for those parameters.

load_driver_file(driver_path)

Loads the driver file and validates that it contains all required parameters for the inference.

load_model_from_driver(driver_spec, ...[, ...])

Loads the demographic model based on the specifications in the driver file.

load_population(driver_path, driver_spec[, ...])

Loads the population data based on the specifications in the driver file.

locate_file_path(filename, script_dir[, ...])

Locates the file path for a given filename by searching in multiple locations.

output_simulation_data_sex_biased(...[, ...])

Creates output graphs to compare data and the theoretical tract length distribution inferred by the model.

parse_chromosomes(chromosome_spec[, chromosomes])

Parses a chromosome specification and returns a list of chromosome numbers.

parse_individual_filenames(individual_names, ...)

Parses the individual filenames based on the provided format and locates their paths.

parse_start_params(start_param_bounds, model)

Produces starting parameters for optimization in physical units.

scale_select_indices(arr, indices_to_scale)

Classes

InferenceConfig(**data)

Configuration for the inference process.

SamplesConfig(**data)

Configuration for the samples used in the inference.

StartParamsConfig(**data)

Configuration for the starting parameters used in the optimization.