stereo.core.StPipeline.filter_cells¶
- StPipeline.filter_cells(min_counts=None, max_counts=None, min_genes=None, max_genes=None, pct_counts_mt=None, cell_list=None, excluded=False, filter_raw=True, use_raw=None, layer=None, inplace=True, **kwargs)[source]¶
Filter cells based on counts or the numbers of genes expressed.
- Parameters:
min_counts (
Optional[int]) – minimum number of counts required for a cell to pass fitlering.max_counts (
Optional[int]) – maximum number of counts required for a cell to pass fitlering.min_genes (
Optional[int]) – minimum number of genes expressed required for a cell to pass filtering.max_genes (
Optional[int]) – maximum number of genes expressed required for a cell to pass filtering.pct_counts_mt (
Optional[float]) – maximum number ofpct_counts_mtrequired for a cell to pass filtering.cell_list (
Optional[list]) – the list of cells to be retained.excluded (
Optional[bool]) – set it to True to exclude the cells specified by parametercell_listwhile False to include.filter_raw (
Optional[bool]) – whether to filter raw data meanwhile.use_raw (
Optional[bool]) – whether to use raw data to calculate QC indicators, by default, use raw data if it exists.layer (
Optional[str]) – the key of layer to be used for calculating QC indicators, if gave, theuse_rawwill be ignored.inplace (
bool) – whether to replace the previous data or return a new data.
- Returns:
An object of StereoExpData.
Depending on
inplace, ifTrue, the data will be replaced by those filtered.