triku.utils._triku_tl_utils

Module Contents

triku.utils._triku_tl_utils.return_proportion_zeros(mat: scipy.sparse.csr.csr_matrix)

Returns a 1D array with the percentages. We have to do it using methods both for sparse arrays and dense arrays, which limits the options to do it.

Parameters

mat ([np.ndarray, scipy.sparse.csr_matrix, other sparse matrices]) – Array of cells x genes.

Returns

prop_zeros – Array with proportion of zeros per gene

Return type

np.1darray

triku.utils._triku_tl_utils.return_mean(mat: scipy.sparse.csr.csr_matrix)

Returns a 1D array with the mean of the array. We have to do it using methods both for sparse arrays and dense arrays, which limits the options to do it.

Parameters

mat ([np.ndarray, scipy.sparse.csr_matrix, other sparse matrices]) – Array of cells x genes.

Returns

prop_zeros – Array with mean expression per gene.

Return type

np.1darray

triku.utils._triku_tl_utils.check_count_mat(mat: scipy.sparse.csr.csr_matrix)

This function outputs a warning if we suspect the matrix is in logarithm value

triku.utils._triku_tl_utils.check_null_genes(arr_counts: numpy.ndarray)

Removes columns (genes) that have zero sum. These genes interfere in the analysis and are not useful at all.

triku.utils._triku_tl_utils.assert_genes_unique(arr)
triku.utils._triku_tl_utils.return_arr_counts_genes(object_triku, get_from_raw=None)
triku.utils._triku_tl_utils.get_arr_counts_and_genes(object_triku, use_raw)