spacec.helperfunctions package

Module contents

spacec.helperfunctions.check_for_gpu()[source]

Check if a GPU is available for use by TensorFlow and PyTorch.

This function checks if a GPU is available for use by TensorFlow and PyTorch. It prints a message indicating whether a GPU is available for each library, and returns a boolean indicating whether a GPU is available for PyTorch.

Returns:

True if a GPU is available for PyTorch, False otherwise.

Return type:

bool

spacec.helperfunctions.downscale_tissue(file_path, DNAslice=0, downscale_factor=64, sigma=5.0, padding=50, savefig=False, showfig=True, output_dir='./', output_fname='', figsize=(10, 5))[source]
spacec.helperfunctions.make_anndata(df_nn, col_sum, nonFuncAb_list)[source]

Convert a denoised DataFrame into anndata format.

Parameters:
  • df_nn (pandas.DataFrame) – Denoised data frame.

  • col_sum (int) – Column index of the last protein feature.

  • nonFuncAb_list (list) – List of markers that did not work in the clustering step.

Returns:

Anndata object containing the converted data.

Return type:

AnnData