CellScope.cs.Normalization

CellScope.cs. Normalization (self, fea_raw : np.ndarray | csr_matrix, data_type : str)

Normalization performs logarithmic transformation on the raw data and applies row normalization, ensuring that the norm of each cell equals 1.

Parameters

  • fea_raw (ndarray | csr_matrix):

    The data matrix of shape (n_cell, n_gene), where rows correspond to cells and columns to genes.

Return

  • fea_raw (ndarray | csr_matrix):

    A data matrix with dimensions (n_cell, n_gene), where rows represent cells and columns represent genes.

  • fea_log (ndarray | csr_matrix):

    A transformed version of fea_raw. If the maximum value in fea_raw is less than 1000, then fea_log = log2(fea_raw + 1); otherwise, fea_log = fea_raw.

  • fea (ndarray | csr_matrix):

    A row-normalized version of fea_log, where the norm of each row is scaled to 1.