tracts.driver_utils#

Functions

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[, ...])

Produces a 1-dimensional array of starting parameters for optimization in physical units, for every parameter in base_model_parameters.

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.