Merge Workflow
The merge workflow combines processed FOV results into sample-specific CSV files for analysis. This is essential when you have multiple experimental conditions or time points.
When to Use Merge
Multiple experiments: Different samples or conditions
Time series: Different time points as separate samples
Technical replicates: Multiple slides analyzed as separate samples
Spatial samples: Different regions or positions
Overview
Assign FOVs to samples - Define which FOVs belong to each sample
Save sample configuration - Create YAML file for reproducibility
Configure merge paths - Select input and output directories
Run merge - Generate per-sample CSV files
Verify results - Check merged files before analysis
Step-by-Step Guide
1. Assign FOVs to Samples
Using the Processing Tab:
In the Processing tab, find the Assign FOVs section (right side)
Click Add Sample to create new rows
Fill in each row:
Sample Name: Descriptive name (e.g.,
control,treatment,timepoint_1)FOVs: Range or list of FOV indices
FOV Specification Formats:
Format |
Example |
Description |
|---|---|---|
Single FOV |
|
Individual FOV |
Range |
|
FOVs 0 through 10 (inclusive) |
Multiple ranges |
|
Two separate ranges |
Mixed |
|
Individual FOVs and ranges |
Example Sample Assignments:
Sample Name | FOVs
---------------|---------
control_01 | 0-9
control_02 | 10-19
treatment_01 | 20-29
treatment_02 | 30-39
edge_control | 95-99
Managing Samples:
Add Sample: Creates new row for another sample
Remove Selected: Deletes selected rows (check boxes to select)
Rows can be edited by clicking directly in cells
2. Save Sample Configuration
After defining all samples, click Save to YAML
Choose a location and filename (e.g.,
samples.yaml)Why save YAML?
Reuse for later analyses
Share with collaborators
Documentation of sample organization
Prevent mistakes in large projects
3. Configure Merge Settings
File Path Configuration:
Sample YAML:
Click Browse next to “Sample YAML:”
Select your saved
.yamlfileLoaded samples appear in table
Folder of processed FOVs:
Click Browse next to “Folder of processed FOVs:”
Select directory containing
fov_000/,fov_001/, etc.Must be the same directory used for processing
Output folder:
Click Browse next to “Output folder:”
Choose where merged CSVs will be saved
Usually same as processing directory for organization
Verification:
Check that all sample paths exist
Verify FOV ranges don’t overlap
Ensure output directory has write permissions
4. Run Merge
Verify all paths are correct
Click Run Merge button
Progress appears:
Status message updates
Processing shows current sample
Completion:
“Merge completed successfully”
Shows location of created files
5. Verify Results
Check Created Files:
Navigate to output directory
Verify files exist:
output_dir/ ├── control_01_merged.csv ├── control_02_merged.csv ├── treatment_01_merged.csv ├── treatment_02_merged.csv └── edge_control_merged.csv
Spot-check files:
Open in spreadsheet software
Verify expected number of cells
Check FOV values in data
CSV Format:
fov,cell,frame,good,position_x,position_y,area_ch_0,intensity_total_ch_1
0,0,0,True,100.5,200.3,450,1234.5
0,0,1,True,101.2,199.8,455,1356.2
...
fov: Original FOV index (preserved for reference)
cell: Cell ID within original FOV
frame: Time frame index
good: Quality flag from Visualization tab
position_x/y: Cell centroid coordinates
area_ch_X: Morphological features from phase contrast
intensity_*_ch_X: Fluorescence features
Advanced Usage
Using Inspected Data
If you performed quality control in the Visualization tab:
Save inspected CSV:
traces_inspected.csvRun merge with inspected file
Only “good” traces will be included in merged results
Benefit: Higher quality data for fitting, as bad traces are excluded
Batch Processing Multiple Experiments
For multiple experiments:
Process all experiments to separate folders
Create separate sample YAML for each experiment
Run merge for each experiment
Combine all CSVs in Analysis tab if needed
FOV Verification
Before merging:
# Check available FOVs
ls your_processing_folder/ | grep "fov_"
# Should show: fov_000, fov_001, ..., fov_099
Ensure your YAML ranges match existing FOVs to avoid errors.
YAML File Format
Example samples.yaml:
samples:
- name: control
positions: "0-10"
- name: treatment
positions: "11-20"
- name: timepoint_1
positions: "0, 5, 10-15"
- name: timepoint_2
positions: "16-25"
Manual Editing:
Can edit YAML in text editor
Follow format exactly (dashes, spaces)
FOV strings use same specification as UI
Best Practices
Sample Naming
Use descriptive, consistent names
Include time points or conditions
Avoid spaces (use underscores or hyphens)
Examples:
cell_line_A_time0experiment_1_dose_10uMreplicate_1
FOV Assignment
Keep biological samples together:
Same slide/experiment = different time points may be separate samples
Technical replicates = separate samples
Maintain spatial context:
Edge FOVs often have different behavior
Consider edge effects in biology
Balance sample sizes:
Similar number of cells per sample
Adjust if natural variation exists
File Organization
experiment_2024_01/
├── raw/
│ └── *.nd2 files
├── processing/
│ ├── samples.yaml
│ ├── processing_config.yaml
│ ├── fov_000/
│ ├── fov_001/
│ └── ...
└── merged/
├── control_01_merged.csv
├── treatment_01_merged.csv
└── samples.yaml # copy for reference
Troubleshooting
Common Errors
“Specified FOV range is invalid”:
Check if FOV numbers exist (0-based indexing)
Verify no negative numbers
Ensure no overlaps between samples
“CSV file not found for FOV X”:
Verify processing completed for that FOV
Check
fov_X/traces.csvexistsRe-run processing if needed
“Output directory not accessible”:
Check directory permissions
Ensure path exists
Try different output location
Recovery Strategies
Merge Failed Partially:
Check which files were created
Identify problematic sample in YAML
Remove or fix problematic assignment
Run merge again
Wrong Sample Assignment:
Edit YAML file to correct assignments
Delete incorrect merged files
Run merge with updated YAML
Next Steps
Load merged CSVs in Analysis tab for fitting
Compare parameters across conditions
Use consistent naming for downstream analysis
The merge workflow is crucial for organizing your data before statistical analysis. Take care to document your sample assignments for reproducible science.