44# Configure logger for ExSeq-Toolbox
55logger = configure_logger ('ExSeq-Toolbox' )
66
7- # Initialize the configuration object.
7+ # Initialize the configuration object
88args = Args ()
99
1010# ================== Mandatory Configuration ==================
1111# The absolute path to the raw data directory. Update this path accordingly.
1212params = {}
1313params ["raw_data_path" ] = '/path/to/your/raw_data_directory/'
1414
15+ # ================== Processing Parameters ==================
16+ # Memory and performance optimization
17+ params ["chunk_size" ] = 150 # Adjust based on your system memory (default: 100)
18+ params ["parallel_processes" ] = 4 # Auto-detected if not specified
19+ params ["use_gpu_processing" ] = True # Enable GPU if available
20+ params ["gpu_memory_fraction" ] = 0.8 # Use 80% of GPU memory
21+ params ["auto_cleanup_memory" ] = True # Automatic memory cleanup
22+
23+ # Puncta extraction parameters (previously hardcoded)
24+ params ["puncta_thresholds" ] = [200 , 300 , 300 , 200 ] # Custom thresholds per channel
25+ params ["puncta_min_distance" ] = 7 # Minimum distance between puncta
26+ params ["puncta_gaussian_sigma" ] = 1.0 # Gaussian filter sigma
27+ params ["puncta_exclude_border" ] = False # Exclude border puncta
28+ params ["consolidation_distance_threshold" ] = 8.0 # Distance for consolidation
29+
30+ # Alignment parameters (previously hardcoded)
31+ params ["alignment_downsample_factors" ] = (2 , 4 , 4 ) # Downsampling factors
32+ params ["alignment_low_percentile" ] = 1.0 # Intensity normalization
33+ params ["alignment_high_percentile" ] = 99.0
34+
35+ # System parameters
36+ params ["permission_mode" ] = 0o777 # Permission mode for created files
37+
1538# ================== Required Raw Data Directory Structure ==================
1639# The ExSeq-Toolbox currently assumes the following directory structure:
1740#
80103args_file = "ExSeq_toolbox_args"
81104params ["args_file_name" ] = args_file
82105
83- # Call set_params with the parameters
106+ # Call enhanced set_params with all parameters
84107args .set_params (** params )
85108
86- # Note: Always ensure that the paths and other configuration parameters are correct before running the script.
109+ # ================== New Enhanced Features ==================
110+
111+ # Get processing recommendations based on your system
112+ recommendations = args .get_processing_recommendations ()
113+ logger .info ("Processing recommendations for your system:" )
114+ for key , value in recommendations .items ():
115+ logger .info (f" { key } : { value } " )
116+
117+ # Save configuration in YAML format for easy editing and sharing
118+ yaml_config_path = args .processed_data_path + "/config.yaml"
119+ args .save_config_yaml (yaml_config_path )
120+ logger .info (f"Configuration saved to { yaml_config_path } " )
121+
122+ # Get memory configuration object
123+ memory_config = args .get_memory_config ()
124+ if memory_config :
125+ memory_info = memory_config .get_memory_info ()
126+ logger .info (f"Memory configuration: { memory_info } " )
127+
128+ # ================== Configuration Loading Example ==================
129+ # You can also load configuration from a YAML file:
130+ # args.load_config_yaml("examples/config_examples/high_memory_config.yaml")
131+ # args.load_config_yaml("examples/config_examples/low_memory_config.yaml")
132+
133+ logger .info ("Enhanced configuration completed successfully!" )
134+ logger .info (f"Using chunk size: { args .chunk_size } " )
135+ logger .info (f"Parallel processes: { args .parallel_processes } " )
136+ logger .info (f"GPU processing enabled: { args .use_gpu_processing } " )
137+ logger .info (f"Auto memory cleanup: { args .auto_cleanup_memory } " )
138+
139+ # Note: Configuration parameters are now fully customizable and hardware-aware.
140+ # Check the generated config.yaml file to see all available options.
0 commit comments