paste3.visualization.generalized_procrustes_analysis

paste3.visualization.generalized_procrustes_analysis(source_coordinates, target_coordinates, pi, is_partial=False)[source]

Finds and applies optimal rotation between spatial coordinates of two layers (may also do a reflection).

Parameters:
  • source_coordinates -- np array of spatial coordinates (ex: sliceA.obs['spatial'])

  • target_coordinates -- np array of spatial coordinates (ex: sliceB.obs['spatial'])

  • pi -- mapping between the two layers output by PASTE

  • return_params -- Boolean of whether to return rotation angle and translations along with spatial coordiantes.

  • return_as_matrix -- Boolean of whether to return the rotation as a matrix or an angle.

  • is_partial -- Boolean of whether this is partial pairwise analysis or a total one

Returns:

Aligned spatial coordinates of X, Y, rotation angle, translation of X, translation of Y.