well_qc_plot()

Build a compact per-well QC figure (histogram + scatter + cell-cycle bar).

Usage

Source

well_qc_plot(
    df,
    *,
    title=None,
    dna_norm_col=None,
    fig_size=(12, 7),
    size_units="cm",
    save=False,
    path=None,
    file_format="png",
    dpi=300
)

Layout — 2×2 GridSpec matching the legacy per-well QC plot:

  • Top-left: DNA-content histogram (log₂ x-axis).
  • Bottom-left: DNA vs EdU scatter coloured by cell-cycle phase, with KDE overlay and threshold lines.
  • Right (spans both rows): stacked cell-cycle phase barplot.

The caller is expected to pass a DataFrame that contains a single well’s cells already filtered down (or trust the resolver / the underlying primitives to filter via the well column). The figure does not sample cells — the histogram and scatter use all rows passed in.

Parameters

df: pd.DataFrame

Single-cell DataFrame with cell-cycle columns (cell_cycle, intensity_mean_EdU_nucleus_norm, and the normalised DNA-content column).

title: str | None = None

Figure-level suptitle. If None, no title is drawn.

dna_norm_col: str | None = None

Normalised DNA-content column to plot on the x-axis. Auto-resolved via find_dna_norm_column() when None.

fig_size: tuple[float, float] = (12, 7)

Figure size in size_units (default: cm).

size_units: str = "cm"

"cm" (default) or "inches".

save: bool = False

Save the figure to path.

path: Path | None = None

Directory to save the figure into when save=True.

file_format: str = "png"

Save format.

dpi: int = 300
Save resolution.

Returns

Figure
The composed matplotlib Figure.