scripts/0.image-qc.py
Generates QC plots and reports from the CellProfiler Image.csv of each site: cell count and confluency, stack alignment between phenotyping and SBS images, segmentation thresholds, image focus, and image saturation.
Also infers which sites are empty (completely black) so later steps do not count them as errors.
Does not respect overwrite_files; outputs are always regenerated.
Inputs¶
| Input | Description |
|---|---|
{file_location}/{batch}/{plate}-{well}-{site}/Image.csv | CellProfiler image-level measurements for every site in data_sets |
{file_location}/{batch}/{plate}-{well}-{site}/{compartments[0]}.csv | Only read to decide if a site that failed to load is empty (header-only) |
Config used: file_location, data_sets, compartments (experiment); qc.allowed_skips, qc.infer_empty_sites, qc.stack_alignment_chans (defaults). See Configuration.
Outputs¶
Per {data_set_name}:
| Output | Description |
|---|---|
single_cell/{plate}_alignments_{data_set_name}.csv | Align_* columns of every site, used to add alignment info to by-gene normalized output |
summary_figures/plate_layout_cells_count_{data_set_name}.png | Cell count per site, laid out as the plate |
summary_figures/plate_layout_percent_confluent_{data_set_name}.png | Percent confluent regions per site |
summary_figures/plate_layout_image_stack_alignment_{data_set_name}.png | Correlation between phenotyping and SBS images |
summary_figures/plate_layout_compartment_threshold_{compartment}_{data_set_name}.png | Final segmentation threshold per site for each compartment |
summary_figures/Image_Focus_{data_set_name}.png | PowerLogLogSlope (focus proxy) per site, channel, and well |
summary_figures/Image_Saturation_phenotyping_{data_set_name}.png | Percent saturated vs. intensity spread per channel (only if any site is saturated) |
summary_figures/Image_Saturation_SBS_{data_set_name}.png | Same, per SBS cycle (only if any site is saturated) |
summary_data/Sites_With_Confluent_Regions_{data_set_name}.csv | Sites with Math_PercentConfluent > 0 |
summary_data/Sites_With_Saturation_{data_set_name}.csv | Sites failing saturation thresholds (phenotyping >1% saturated, SBS >0.2% saturated) |
summary_data/Inferred_Empty_Sites_{data_set_name}.csv | Sites whose Image.csv could not be used and whose parent compartment file is header-only. Read by steps 1 and 2 to skip these sites. A stale file is removed if no empty sites are found. |
Failure to make an individual plot or table is logged and does not stop the step.