glue_genes.glue_single_cell.qt.summarize_gene_subset.do_calculation_over_gene_subset#

glue_genes.glue_single_cell.qt.summarize_gene_subset.do_calculation_over_gene_subset(data_with_Xarray, genesubset, calculation='Means')#

Calculate a summary statistic for cells based on genesubset

Currently this code is a bit of a mess because the slicing we are doing here implicitly? uses the new todense() cast on the X array which causes all this fragile code originally deal with sparse arrays to fail. Of course, in theory we would like to keep the benefit of sparse arrays here. I think the call to get_data() is inside the slice opperation? Or possibly in the to_index_list() call? I am not sure. It might even be in our call to data_with_Xarray.Xdata. But… I don’t think so.

Parameters:
data_with_XarrayDataAnnData

The expression matrix (X) used for the calculation

genesubsetglue.core.subset.Subset

The subset of genes to use for the calculation

calculationstr

The type of calculation to perform: [PCA, Module, Means]