Skip to content

Commit 19a7a1e

Browse files
committed
update args module wrapper
1 parent 44ba3e9 commit 19a7a1e

File tree

1 file changed

+45
-44
lines changed

1 file changed

+45
-44
lines changed

examples/wrappers/1_pipeline_parameter.py

Lines changed: 45 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -9,77 +9,78 @@
99

1010
# ================== Mandatory Configuration ==================
1111
# The absolute path to the raw data directory. Update this path accordingly.
12-
raw_data_directory = '/path/to/your/raw_data_directory/'
12+
params = {}
13+
params["raw_data_path"] = '/path/to/your/raw_data_directory/'
1314

1415
# ================== Required Raw Data Directory Structure ==================
1516
# The ExSeq-Toolbox currently assumes the following directory structure:
1617
#
1718
# raw_data_directory/
1819
# ├── code0/
19-
# │ ├── Channel405 SD_Seq0004.nd2
20-
# │ ├── Channel488 SD_Seq0003.nd2
21-
# │ ├── Channel561 SD_Seq0002.nd2
22-
# │ ├── Channel594 SD_Seq0001.nd2
23-
# │ ├── Channel604 SD_Seq0000.nd2
20+
# │ ├── raw_fov0.h5
21+
# │ ├── raw_fov1.h5
22+
# │ ├── raw_fov2.h5
23+
# │ ├── raw_fov3.h5
24+
# │ ├── raw_fov4.h5
2425
# ├── code1/
25-
# │ ├── Channel405 SD_Seq0004.nd2
26+
# │ ├── raw_fov0.h5
2627
# │ ├── ...
2728
# ├── ...
28-
#
29+
#
30+
# Important: Each of the raw_fov{}.h5 assumed to contain different datasets for each channel. The dataset name needs to be the channel wavelength, e.g., '640', '594', '561', '488', '405'.
31+
#
2932
# Ensure that your raw data adheres to this directory structure before running the package.
3033

3134
# ================== Optional Configuration ==================
3235

33-
# List of integers representing specific codes. Default: integers 0-6.
34-
codes_list = list(range(7))
36+
# Optional: Number of imaging rounds in targeted sequencing data.
37+
params["codes"] = list(range(7)) # Default value: 7
3538

3639
# Optional: List of integers specifying which fields of view to analyze.
37-
# If not provided, all available FOVs will be analyzed.
38-
fov_list = list(range(12)) # Example values
40+
# If not provided, all available FOVs in the raw_data_directory will be analyzed.
41+
42+
# Uncomment to set the number of FOVs and their list explicitly.
43+
# number_of_fovs = 12
44+
# fov_list = list(range(number_of_fovs))
45+
# params["fovs"] = fov_list
46+
47+
# Optional: The absolute path to the processed data directory.
48+
# processed_data_directory = '/path/to/processed/data_directory/'
49+
# params["processed_data_path"] = processed_data_directory
3950

40-
# The absolute path to the processed data directory.
41-
# By default, a 'processed_data' subdirectory inside the raw_data_path is used.
42-
processed_data_directory = '/path/to/processed/data_directory/'
51+
# Optional: Directory name to store puncta analysis results.
52+
# puncta_dir_name = "puncta/"
53+
# params["puncta_dir_name"] = puncta_dir_name
4354

44-
# Spacing between pixels in the format [Z, Y, X].
45-
pixel_spacing = [0.4, 1.625, 1.625]
55+
# Optional: Spacing between pixels in the format [Z, Y, X].
56+
params["spacing"] = [0.4, 1.625, 1.625] # Default value: [0.4, 1.625, 1.625]
4657

47-
# Set the names of channels in the ND2 file.
48-
channel_names_list = ['640', '594', '561', '488', '405']
58+
# Optional: Set the names of channels in the ND2 file.
59+
params["channel_names"] = ['640', '594', '561', '488', '405'] # Default names
4960

50-
# Specifies which code to use as the reference round. Default: 0.
51-
reference_code = 0
61+
# Optional: Specifies which code to use as the reference round.
62+
params["ref_code"] = 0 # Default value: 0
5263

53-
# Specifies which channel to use as the reference for alignment.
54-
reference_channel = '405'
64+
# Optional: Specifies which channel to use as the reference for alignment.
65+
params["ref_channel"] = '405' # Default value: '405'
5566

56-
# Absolute path to the CSV file containing the gene list.
67+
# Optional: Absolute path to the CSV file containing the gene list.
5768
gene_digit_file = './gene_list.csv'
69+
params["gene_digit_csv"] = gene_digit_file
5870

59-
# If set to True, changes permission of the raw_data_path to allow other users to read and write on the generated files (Only for Linux and MacOS users).
71+
# Optional: Changes permission of the raw_data_path for other users (Linux/Mac).
6072
permissions_flag = False
73+
params["permission"] = permissions_flag
6174

62-
# If set to True, creates the directory structure in the specified project path.
75+
# Optional: Creates the directory structure in the specified project path.
6376
create_directory_structure_flag = True
77+
params["create_directroy_structure"] = create_directory_structure_flag
6478

65-
# The name of the JSON file where the project arguments will be stored.
79+
# Optional: The name of the JSON file where the project arguments will be stored.
6680
args_file = "ExSeq_toolbox_args"
81+
params["args_file_name"] = args_file
6782

68-
# Set the parameters using the set_params method
69-
args.set_params(
70-
raw_data_path=raw_data_directory,
71-
processed_data_path=processed_data_directory,
72-
codes=codes_list,
73-
fovs=fov_list,
74-
spacing=pixel_spacing,
75-
channel_names=channel_names_list,
76-
ref_code=reference_code,
77-
ref_channel=reference_channel,
78-
gene_digit_csv=gene_digit_file,
79-
permission=permissions_flag,
80-
create_directroy_structure=create_directory_structure_flag,
81-
args_file_name=args_file
82-
)
83-
84-
# Note: Always ensure that the paths and other configuration parameters are correct before running the script.
83+
# Call set_params with the parameters
84+
args.set_params(**params)
8585

86+
# Note: Always ensure that the paths and other configuration parameters are correct before running the script.

0 commit comments

Comments
 (0)