sakura.dataset.rna_count_sparse.SCRNASeqCountDataSparse.expr_set_pre_slice

SCRNASeqCountDataSparse.expr_set_pre_slice()

Pre-slices the expression matrix based on gene metadata.

This function iterates over the keys in the <gene_meta> dictionary, and for each key, it retrieves the corresponding metadata to determine how to slice the expression matrix. The results are stored in the <expr_mat_pre_sliced> attribute.

gene_list:
  • list or numpy array: the function extracts the corresponding rows from the gene_expr_mat;

  • ‘*’: the entire expression matrix is copied;

  • ‘-’: the function drops the rows specified in <exclude_list> from the expression matrix.

After execution, the flag <flag_expr_set_pre_sliced> is set to True.

Returns:

None