tracts.driver_utils.InferenceConfig#

class InferenceConfig(**data)#

Bases: BaseModel

Configuration for the inference process. This determines the list of parameteres that can be processed from the driver file, together with their types and default values. Only parameters specified in this class will be processed and additional parameters in the driver file will rise an error. This is to ensure that the driver file is correctly specified and to provide clear error messages for missing or misspelled parameters. See online documentation for details on how to specify parameters in the driver file.

unknown_labels_for_smoothing#

A list of population labels for which to apply smoothing to the tract length distribution. Defaults to an empty list.

Type:

List[str]

samples#

The configuration for the samples used in the inference.

Type:

SamplesConfig

model_filename#

The filename of the demographic model to use for the inference.

Type:

str

start_params#

The configuration for the starting parameters used in the optimization.

Type:

StartParamsConfig

repetitions#

The number of repetitions to perform for the optimization. Defaults to 1.

Type:

int

seed#

The random seed to use for the optimization.

Type:

int

maximum_iterations#

The maximum number of iterations to perform for the optimization. Defaults to None, which means no limit on the number of iterations.

Type:

int | None

npts#

The number of grid points to use to define the tract length histogram. Defaults to 50.

Type:

int

exclude_tracts_below_cm#

The minimum tract length in centiMorgans to include in the analysis. Tracts shorter than this length will be excluded. Defaults to 1 cM.

Type:

float

fix_parameters_from_ancestry_proportions#

A list of parameter names to fix based on the ancestry proportions. See online documentation for details.

Type:

List[str]

output_directory#

The directory where the output files will be saved.

Type:

str | None

output_filename_format#

The format of the output filenames.

Type:

str

log_filename#

The filename of the log file to write to. If None, no log file will be created. Defaults to “tracts.log”.

Type:

str, Optional

ad_model_autosomes#

The admixture model to use for the autosomes. Must be one in [“M”, “DC”, “DF”, “H-DC”, “H-DF]. See online documentation for details. Defaults to “M”.

Type:

str

ad_model_allosomes#

The admixture model to use for the allosomes. Must be one in [“DC”, “DF”, “H-DC”, “H-DF]. See online documentation for details. Defaults to “DC”.

Type:

str

verbose_log#

The verbosity level for logging. Defaults to 1.

Type:

int

verbose_screen#

The verbosity level for screen prints. Defaults to 30.

Type:

int

log_scale#

Whether to use log scale to plot the tract length distribution. Defaults to True.

Type:

bool

two_steps_optimization#

Whether to perform a two-step optimization process, where the first step optimizes only the non-sex-bias parameters on autosomal data and the second step optimizes sex-bias parameters using both autosomal and allosomal data. Defaults to True.

Type:

bool

model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].