spacec.helperfunctions package

Module contents

spacec.helperfunctions.check_for_gpu(tensorflow=False, torch=True)[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.

Returns:

True if
a GPU is available for PyTorch

and pytorch=True (default),

a GPU is available for tensorflow

and tensorflow=True,

a GPU is available for PyTorch AND tensorflow

and pytorch=True and tensorflow=True

otherwise it returns False.

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