scviva.tools.vision.get_normalized_copy#

scviva.tools.vision.get_normalized_copy(X, method='znorm_columns')[source]#

Log2-transform then normalise X using the chosen method.

Mirrors R VISION’s getNormalizedCopy: always applies matLog2 (i.e. log2(x+1)) first, then the chosen normalisation. Sparse inputs are densified after the log transform.

Parameters:
X ndarray | spmatrix

Raw or pre-normalised expression matrix, cells × genes.

method Literal['none', 'znorm_columns', 'znorm_rows', 'znorm_rows_then_columns', 'rank_norm_columns']

One of "none", "znorm_columns", "znorm_rows", "znorm_rows_then_columns", "rank_norm_columns".

Return type:

ndarray

Returns:

np.ndarray of shape (n_cells, n_genes) Dense normalised matrix.

Raises:

ValueError – If method is not one of the recognised strings.