tracts.driver_utils.parse_individual_filenames#

parse_individual_filenames(individual_names, filename_string, script_dir, labels=['A', 'B'], directory='', absolute_driver_yaml_path=None)#

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

Parameters:
  • individual_names (List[str]) – A list of individual names corresponding to the sample files.

  • filename_string (str) – The format of the sample filenames. This should include placeholders for the individual name and haploid copy (e.g. “{name}_{label}.txt”).

  • script_dir (str | Path | None) – The directory containing the script.

  • labels (List[str]) – A list of labels for the haploid copies.

  • directory (str) – The directory containing the sample files.

  • absolute_driver_yaml_path (str | None) – The absolute path to the driver yaml file

Returns:

A dictionary mapping individual names to a list of file paths.

Return type:

dict[str, list[str]]