SPACEL.Scube.gpr.GPRmodel

class SPACEL.Scube.gpr.GPRmodel(expr, loc, loc_resample, used_genes, use_gpu=False, output_dir=None, **kwargs)

The GPR model class.

The GPR model class for prediction of 3D spatial transcriptomic data.

used_genes

A list of gene names used for selecting genes as input.

log_bf

The log Bayes factor (BF) value indicating the variation of each gene in 3D spatial data.

use_gpu

A boolean value indicating whether to use the GPU for training.

subset

An integer value indicating the number of spots/cells to be downsampled for training.

lengthscale_prior

The prior value of the lengthscale parameter in the Gaussian Process Regression (GPR) model.

outputscale_prior

The prior value of the outputscale parameter in the GPR model.

noise_prior

The prior value of the noise parameter in the GPR model.

output_dir

The path where the outputs will be saved.

__init__(expr, loc, loc_resample, used_genes, use_gpu=False, output_dir=None, **kwargs)

Initializes the instance of GPR model class.

Parameters:
  • expr – A matrix of expression values at each location in the spatial transcriptomic data.

  • loc – A matrix of coordinate values at each location in the spatial transcriptomic data.

  • loc_resample – A matrix of coordinate values at each location in the resampled data.

  • used_genes – A list of gene names used for selecting genes as input.

  • use_gpu – A boolean value indicating whether to use the GPU for training.

  • output_dir – The path where the outputs will be saved.

Methods

__init__(expr, loc, loc_resample, used_genes)

Initializes the instance of GPR model class.

eval_model()

init_model(model[, noise, lengthscale, ...])

load_gene_model(gene, training_iter, lr)

optim_lengthscale(model[, lr, l_range, ...])

plot_gpr_expr(gene, training_iter, lr[, ...])

Plotting predicted expression values.

predict_resampled_spot([gene, data, ...])

prepare_gpr_data(X, y, subset)

prepare_gpr_model([lengthscale_prior, ...])

train([lr, training_iter, save_model, ...])

Training GPR model

train_single_model(model[, lr, ...])