tracts.driver_utils._save_ancestry_proportions_table#
- _save_ancestry_proportions_table(ancestor_labels, observed_autosome_proportions, predicted_autosome_proportions, output_dir, output_filename_format, observed_allosome_proportions=None, predicted_allosome_proportions=None, allosome_label=None)#
Writes a fixed-width text table of observed and predicted ancestry proportions (for autosomes and, optionally, allosomes) to the output directory.
- Parameters:
ancestor_labels – Ordered iterable of source-population names (columns of the table).
observed_autosome_proportions (
ndarray) – Observed autosomal ancestry proportions, one value per source population.predicted_autosome_proportions (
ndarray|None) – Predicted autosomal ancestry proportions from the optimal model parameters, orNoneif not available.output_dir – Path to the directory where the file will be written.
output_filename_format (
str) – Theoutput_filename_formatstring from the driver file (must contain a{label}placeholder).observed_allosome_proportions (
ndarray|None) – Observed allosomal ancestry proportions, orNoneif no allosomes are present in the sample.predicted_allosome_proportions (
ndarray|None) – Predicted allosomal ancestry proportions from the optimal model parameters, orNoneif not available.allosome_label (
str|None) – The allosome identifier (e.g.'X'), used as the row label suffix. Required whenobserved_allosome_proportionsorpredicted_allosome_proportionsis provided.
- Return type:
None