scvi.external.stereoscope.RNADeconv#

class scvi.external.stereoscope.RNADeconv(n_genes, n_labels, **model_kwargs)[source]#

Bases: BaseModuleClass

Model of single-cell RNA-sequencing data for deconvolution of spatial transriptomics.

Reimplementation of the ScModel module of Stereoscope [Andersson et al., 2020]: almaan/stereoscope.

Parameters:
  • n_genes (int) – Number of input genes

  • n_labels (int) – Number of input cell types

  • **model_kwargs – Additional kwargs

Attributes table#

training

Methods table#

generative(x, y)

Simply build the negative binomial parameters for every cell in the minibatch.

get_params()

Returns the parameters for feeding into the spatial data.

inference()

Inference.

loss(tensors, inference_outputs, ...[, ...])

Loss computation.

sample(tensors[, n_samples, library_size])

Sample from the model.

Attributes#

RNADeconv.training: bool#

Methods#

RNADeconv.generative(x, y)[source]#

Simply build the negative binomial parameters for every cell in the minibatch.

RNADeconv.get_params()[source]#

Returns the parameters for feeding into the spatial data.

Return type:

tuple[ndarray]

Returns:

type list of tensor

RNADeconv.inference()[source]#

Inference.

RNADeconv.loss(tensors, inference_outputs, generative_outputs, kl_weight=1.0)[source]#

Loss computation.

RNADeconv.sample(tensors, n_samples=1, library_size=1)[source]#

Sample from the model.