Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

1. Process SBS

scripts/1.process-SBS.py

Reads SBS foci from CellProfiler outputs, matches called barcodes to the library (if match_to_library is true), assigns barcodes and genes to cells, scores the quality of each cell’s assignment, and writes per-site SBS metrics.

Respects overwrite_files and can be resumed: sites whose output folder already exists are skipped when overwrite_files is false.

Inputs

InputDescription
{file_location}/{batch}/{plate}-{well}-{site}/Foci.csvFoci (SBS spots) with barcode calls and Parent_{compartments[0]}
{file_location}/{batch}/{plate}-{well}-{site}/BarcodeFoci.csvOnly when match_to_library is false; barcode matches made during image analysis
{external_foci_location}/.../*Foci.csv, *BarcodeFoci.csvUsed instead of the above when external_foci_location is set. The Foci.csv in file_location must have the same number of rows and provides the cell parent relationship.
library_locationBarcode library .csv; only when match_to_library is true
summary_data/Inferred_Empty_Sites_{data_set_name}.csvFrom step 0, if present; these sites are skipped

Config used: file_location, external_foci_location, drop_barcodes, control_genes, data_sets, overwrite_files, compartments, cell_quality_method, match_to_library, library_structure, library_location (experiment); process_SBS.*, core.cell_quality_*, core.cell_id_cols (defaults). See Configuration.

Outputs

Per site, in SBS/{plate}-{well}-{site}/:

OutputDescription
processed_SBS.tsv.gzOne row per barcode/spot assigned to a cell, with gene, barcode, match score, location, and cell quality category
cell_perturbation_category_summary_counts.tsvCell counts per cell quality category per gene and guide
site_stats.jsonPer-site metrics: spots in/outside cells, unique genes and guides, assigned cells, cells with one spot, percent perfect spots, and counts per cell and spot quality category

Per data set, in summary_data/:

OutputDescription
No_SBS_Foci_Sites_{data_set_name}.csvSites with no foci, or no foci within parent cells
No_Assigned_Cells_Sites_{data_set_name}.csvSites where no cells were assigned a barcode

Sites listed in either file are not an error and are skipped by later steps.