tracts.driver_utils.load_demographic_model_from_driver#
- load_demographic_model_from_driver(driver_spec, script_dir, driver_path, allosome_label=None)#
Loads the demographic model based on the specifications in the driver file. The model is expected to be defined in a separate yaml file, whose path is specified in the driver file under “models.model_filename”. See online documentation for details on how to specify the model yaml file and its contents.
- Parameters:
driver_spec (
InferenceConfig) – The configuration for the inference process, as specified in the driver file.script_dir (
str|Path|None) – The directory containing the script.driver_path (
str) – The path to the driver yaml file.allosome_label (
str|None) – The label of the allosome chromosome, if any. This is used to determine whether allosomal admixture is modelled.
- Returns:
A tuple
(demographic_model, model_param_names, sex_bias_param_names, non_sex_bias_param_names), where:demographic_modelis the loaded demographic model, which can be either aParametrizedDemographyor aParametrizedDemographySexBiaseddepending on whether allosomal admixture is modelled.model_param_namesis the list of all parameter names ofdemographic_model, in the order given bydemographic_model.model_base_params.sex_bias_param_namesis the subset ofmodel_param_namescorresponding to sex-bias parameters.non_sex_bias_param_namesis the remaining subset ofmodel_param_names, excluding sex-bias parameters.
- Return type:
tuple[ParametrizedDemography | ParametrizedDemographySexBiased, list[str], list[str], list[str]]