Skip to contents

Creates a series of scatter plots showing the progression of ATAC-seq signal normalization steps, comparing each cell type against an anchor cell type. The plots are automatically saved to the specified directory if provided.

Usage

plot_normalization_scatters(obj, anchor_cell_type, figures_dir)

Arguments

obj

List. A preprocessed ATAC-seq data object, output from preprocess_data

anchor_cell_type

Character. The reference cell type to use for comparisons

figures_dir

Character or NULL. Directory path where plots should be saved. If NULL, plots are not saved to disk. Directory will be created if it doesn't exist.

Value

None (called for side effects)

Details

The function generates four visualization plots showing the progression of normalization:

  1. Raw signal comparison ("1_cell_type_scatter_before_norm.png")

    • Log2-transformed raw signals after basic library size normalization

  2. Regional normalization ("2_cell_type_scatter_region_norm.png")

    • Shows effects of local background correction

  3. Constitutive peak normalization ("3_cell_type_scatter_const_norm.png")

    • Displays signals after normalizing using constitutive peaks

    • Includes probability threshold line if specified

  4. Probability normalization ("4_cell_type_scatter_prob.png")

    • Shows final probability-scaled signals

Each plot compares all cell types against the anchor cell type, with points colored to distinguish constitutive from variable peaks.

Note

File names are automatically generated using a numerical prefix to maintain proper ordering when viewing in a file explorer.

See also

plot_cell_type_scatter for the underlying plotting function, normalize_regional, normalize_const, normalize_to_prob for the normalization methods being visualized

Examples

if (FALSE) { # \dontrun{
# Generate and save plots
plot_normalization_scatters(
    atac_obj,
    anchor_cell_type = "CD4_T",
    figures_dir = "analysis/normalization_plots"
)

# Generate plots without saving
plot_normalization_scatters(
    atac_obj,
    anchor_cell_type = "CD4_T",
    figures_dir = NULL
)
} # }