stereo.core.StPipeline.filter_genes

StPipeline.filter_genes(min_cells=None, max_cells=None, min_counts=None, max_counts=None, gene_list=None, mean_umi_gt=None, filter_raw=True, excluded=False, filter_mt_genes=False, inplace=True, **kwargs)[source]

Filter genes based on the numbers of cells or counts.

Parameters:
  • min_cells (Optional[int]) – minimum number of cells expressed required for a gene to pass filering.

  • max_cells (Optional[int]) – maximum number of cells expressed required for a gene to pass filering.

  • min_counts (Optional[int]) – minimum number of counts expressed required for a gene to pass filtering.

  • max_counts (Optional[int]) – maximum number of counts expressed required for a gene to pass filtering.

  • gene_list (Union[ndarray, list, None]) – the list of genes to be retained.

  • mean_umi_gt (Optional[float]) – mean counts greater than this value for a gene to pass filtering.

  • filter_raw (Optional[bool]) – whether to filter raw data meanwhile.

  • excluded (Optional[bool]) – set it to True to exclude the genes which are specified by parameter gene_list while False to include.

  • filter_mt_genes (Optional[bool]) – whether to filter out mitochondrial genes.

  • inplace (bool) – whether to replace the previous data or return a new data.

Returns:

  • An object of StereoExpData.

  • Depending on inplace, if True, the data will be replaced by those filtered.