Skip to contents

Building reference and query objects

somalign_train_reference()
Train a reference SOM and build a somalign reference
somalign_reference()
Build a reference object from an existing SOM and old data
somalign_reference_from_nodes()
Build a reference object from saved node-level artifacts
somalign_reference_from_som()
Build a reference object directly from a trained kohonen SOM
somalign_query()
Prepare query data and attach or train a query SOM
somalign_query_from_som()
Build a query object from a pre-trained kohonen SOM

Preprocessing

somalign_normalize()
Global pre-correction of query data to match the reference distribution
somalign_quantile_normalize()
Divide each feature column by its upper quantile

Fitting

somalign_fit()
Align a query SOM to a reference SOM
somalign_fit_anchored()
Align a query SOM to a reference SOM using anchor sample pairs
somalign_fit_two_pass()
Two-pass alignment decomposing correction into global and local components

Correcting expression

Dedicated auxiliary expression correction paths for anchored or two-pass fits.

somalign_correct_expression()
Batch-correct query marker expression for downstream analysis

Results

somalign_results()
Return per-sample somalign results

Soft labels and abundance

Probabilistic reference projection for label probabilities and per-sample frequencies.

somalign_soft_labels()
Soft (probabilistic) label projection for query cells
somalign_soft_frequencies()
Per-group soft label frequencies for query cells

Validation and tuning

somalign_label_metrics()
Label-transfer accuracy metrics
somalign_calibration()
Confidence calibration of label transfer
somalign_cross_validate()
Cross-validate label transfer on held-out cells
somalign_tune()
Tune transport-plan knobs against label-transfer accuracy
somalign_anchor_benefit()
Quantify the label-transfer benefit of anchor (repeat) samples

Diagnostics and sensitivity

somalign_diagnostics()
Extract somalign diagnostics
somalign_epsilon_sweep()
Epsilon phase-transition sweep for principled epsilon selection
somalign_select_epsilon()
Select epsilon from an epsilon-sweep curve
somalign_sensitivity_grid()
Run an OT sensitivity grid
somalign_som_stability()
Assess alignment stability across query SOM random seeds
somalign_topology_audit()
Compute a persistent-homology topology audit for a somalign fit
somalign_subspace_sensitivity()
Subspace sensitivity analysis for anchored batch correction
somalign_exclusion_test()
Anchor exclusion-restriction test
somalign_worst_nodes()
Return worst-projecting query SOM nodes
somalign_check_codebook_alignment()
Check query-reference codebook alignment before cell-level computation

Plots

somalign_plot_codebook_range()
Plot query vs reference SOM code ranges per marker
somalign_plot_correction()
Plot per-node correction norms
somalign_plot_label_confusion()
Plot label transfer confusion heatmap
somalign_plot_marker_distributions()
Plot per-marker cell distributions before projection
somalign_plot_mass_balance()
Plot node mass balance
somalign_plot_match_fraction()
Plot per-node match fraction
somalign_plot_outside_fraction()
Plot fraction of cells outside reference thresholds
print(<somalign_anchored_fit>)
Print a somalign_anchored_fit object
print(<somalign_fit>)
Print a somalign_fit object
print(<somalign_query>)
Print a somalign_query object
print(<somalign_reference>)
Print a somalign_reference object
print(<somalign_subspace_sensitivity>)
Print a somalign_subspace_sensitivity object
print(<somalign_topology>)
Print a somalign_topology object
print(<somalign_exclusion_test>)
Print a somalign_exclusion_test object
summary(<somalign_fit>)
Summarise a somalign_fit's label transfer