SOAPy_st.tl.TensorDecomposition

class SOAPy_st.tl.TensorDecomposition

Function:

The data of anndata type is assembled tensor and tensor decomposition is carried out

It supports the construction of high-dimensional tensors in count form using attributes in obs and the construction of high-dimensional tensors in expression value form using attributes in obs matching genes

The constructed tensor can use Z-score, 0-1 regularization or proportional form for data balancing

Tensor decomposition provides two forms of CP decomposition and tucker decomposition, both of which can choose the non-negative form of decomposition to assemble tensors of anndata type and conduct tensor decomposition

__init__()

Initialize the tensorDecomposition object.

Methods

CP_decomposition(rank[, non_negative])

Perform CP decomposition on the tensor.

__init__()

Initialize the tensorDecomposition object.

highly_variable(factor_name, top_num)

input_tensor(tensor, factor_name, ticks_list)

Set the input tensor, factor names, and supporting dictionary.

normalization(factor_name[, method])

Normalize the tensor along a specified factor.

tensor_with_gene(adata, obs_factor[, ...])

Construct a tensor using observation factors and gene expression values from an AnnData object.

tensor_with_obs(adata, obs_factor)

Construct a tensor using observation factors from an AnnData object.

tucker_decomposition(rank[, non_negative])

Perform Tucker decomposition on the tensor.

Attributes

get_tensor

Get the current tensor.