Args Module

Pipeline Parameters

class exm.args.Args[source]

A class used to represent and manage the configuration for ExSeq-Toolbox.

Attributes are set using the set_params method, and the configuration can be saved to or loaded from a JSON file. Directory structures for the project can also be created, and file permissions can be modified as needed.

Methods:
  • set_params: Sets various parameters for the ExSeq-Toolbox.

  • save_params: Saves the current parameters to a JSON file.

  • load_params: Loads parameters from a JSON file.

  • create_directory_structure: Creates the necessary directory structure for the project.

  • set_permissions: Sets file permissions for the project directory.

  • print: Prints all current parameters.

create_directroy_structure()[source]

Creates the directory structure in the specified project path.

get_memory_config()[source]

Get memory configuration dictionary.

get_processing_recommendations()[source]

Get processing recommendations based on current configuration.

Return type:

Dict[str, Any]

load_config_yaml(filename)[source]

Load configuration from YAML file.

Parameters:

filename (str)

Return type:

None

load_params(param_path)[source]

Loads and sets the configuration parameters from a previously saved .json file.

Parameters:

param_path (str) – The path to the ‘.json’ file containing the serialized parameters. This is typically the ‘exseq_toolbox_args.json’ file generated by the set_params call, located within the processed data directory.

Return type:

None

print()[source]

Prints all attributes of the Args object.

Return type:

None

save_config_yaml(filename)[source]

Save configuration in YAML format for better readability.

Parameters:

filename (str)

Return type:

None

save_params(args_file_name)[source]

Saves the parameters to a .json file.

Parameters:

args_file_name (str) – Name of the parameters file.

set_params(raw_data_path, processed_data_path=None, puncta_dir_name='puncta/', codes=[0, 1, 2, 3, 4, 5, 6], fovs=None, spacing=[0.4, 1.625, 1.625], channel_names=['640', '594', '561', '488', '405'], ref_code=0, ref_channel='405', gene_digit_csv='./gene_list.csv', permission=False, create_directroy_structure=True, args_file_name='exseq_toolbox_args', chunk_size=None, gpu_memory_fraction=None, parallel_processes=None, use_gpu_processing=None, puncta_thresholds=None, auto_cleanup_memory=None, **kwargs)[source]

Sets parameters for running ExSeq ToolBox.

Parameters:
  • raw_data_path (str) – The absolute path to the project’s raw data directory (.nd2 files). There is no default value, this must be provided.

  • processed_data_path (Optional[str]) – The absolute path to the processed data directory. Default is a ‘processed_data’ subdirectory inside the raw_data_path.

  • puncta_dir_name (Optional[str]) – The directory name to store the puncta analysis in the processed data directory. Default is a ‘puncta’ subdirectory inside the processed_data_path.

  • codes (List[int]) – A list of integers, each representing a specific code. Default: integers 0-6.

  • fovs (Optional[List[int]]) – A list of integers, each representing a specific field of view. Default: None.

  • spacing (List[float]) – Spacing between pixels in the format [Z,Y,X]. Default: [4.0, 1.625, 1.625].

  • channel_names (List[str]) – Names of channels in the ND2 file in the correct sequence. Default is [‘640’,’594’,’561’,’488’,’405’].

  • ref_code (int) – Specifies which code to use as the reference round. Default: 0.

  • ref_channel (str) – Specifies which channel to use as the reference for alignment. Default is ‘405’.

  • gene_digit_csv (str) – absolute path of the CSV file containing gene list. Default: ‘./gene_list.csv’.

  • permission (Optional[bool]) – If set to True, changes permission of the raw_data_path to allow other users to read and write on the generated files. Default is False. Only for Linux and MacOS users

  • create_directroy_structure (Optional[bool]) – If set to True, creates the directory structure in the specified processed_data_path. Default: True.

  • args_file_name (Optional[str]) – The name of the JSON file to store the project arguments. Default: ‘exseq_toolbox_args’.

  • chunk_size (int | None)

  • gpu_memory_fraction (float | None)

  • parallel_processes (int | None)

  • use_gpu_processing (bool | None)

  • puncta_thresholds (List[int] | None)

  • auto_cleanup_memory (bool | None)

Return type:

None

set_permissions()[source]

Changes permission of the processed_data_path to allow other users to read and write on the generated files.