spcoral.model.registration_by_downsampling

spcoral.model.registration_by_downsampling#

spcoral.model.registration_by_downsampling(adata_omics1, adata_omics2, adata_omics1_downsampled, adata_omics2_downsampled)#

Propagate coarse-grained registration from downsampled bins back to full-resolution spatial coordinates.

Parameters:
  • adata_omics1 (anndata.AnnData) – Full-resolution AnnData for omics1 (to be aligned).

  • adata_omics2 (anndata.AnnData) – Full-resolution AnnData for omics2 (reference).

  • adata_omics1_downsampled (anndata.AnnData) – Downsampled version of omics1 with registered coordinates in obsm['spatial_reg'].

  • adata_omics2_downsampled (anndata.AnnData) – Downsampled version of omics2 (usually unchanged spatial coordinates).

Returns:

  • Updated adata_omics1 with: - obsm['spatial_reg_bin']: alignment applied at bin level. - obsm['spatial_reg_raw']: final propagated alignment at original resolution.

  • Updated adata_omics2 with obsm['spatial_reg_bin'] (typically identity or minor adjustment).

Return type:

tuple of (anndata.AnnData, anndata.AnnData)