ovrlpy.compute_VSI

ovrlpy.compute_VSI(df, pca_components, min_expression=None, KDE_bandwidth=1, patch_length=500, n_workers=8, dtype=np.float32)

Calculate the vertical signal integrity (VSI).

Parameters:
  • df (DataFrame) – The spatial transcriptomics dataset. This dataframe should contain a gene, x, y, and z column. Needs to be prepared by calling pre_process_coordinates

  • pca_components (DataFrame) – PCA components from fitted local maxima.

  • min_expression (float, optional) – Minimal gene expression level to include in the VSI computation. Defaults to the 110% of the maximum expression profile of two molecules in the KDE.

  • KDE_bandwidth (float, optional) – Bandwidth for the kernel density estimation.

  • patch_length (int, optional) – Data will be processed in patches. Upperbound for the length in x/y of a patch.

  • n_workers (int, optional) – Number of threads to use for processing.

  • dtype – Datatype used for the calculations.

Returns:

  • VSI (numpy.ndarray) – The vertical signal integrity score.

  • signal (numpy.ndarray) – The total gene expression signal.