bento.tl.colocation

bento.tl.colocation(sdata, ranks, instance_key='cell_boundaries', feature_key='feature_name', iterations=3, plot_error=True)

Decompose a tensor of pairwise colocalization quotients into signatures.

Parameters:
  • sdata (SpatialData) – Spatial formatted SpatialData object.

  • ranks (list) – List of ranks to decompose the tensor.

  • instance_key (str) – Key that specifies cell_boundaries instance in sdata.

  • feature_key (str) – Key that specifies genes in sdata.

  • iterations (int) – Number of iterations to run the decomposition.

  • plot_error (bool) – Whether to plot the error of the decomposition.

Returns:

sdata – .table.uns[‘factors’]: Decomposed tensor factors. .table.uns[‘factors_error’]: Decomposition error.

Return type:

SpatialData