spamosaic.preprocessing.harmony

spamosaic.preprocessing.harmony(latent, batch_labels, use_gpu=True)[source]

Batch correction using Harmony.

Parameters:
  • latent (np.ndarray) – Low-dimensional representation (e.g., PCA).

  • batch_labels (list or array) – Corresponding batch annotations.

  • use_gpu (bool, default=True) – Whether to use GPU acceleration.

Returns:

Batch-corrected latent representation.

Return type:

np.ndarray