simba.pp.filter_samples

simba.pp.filter_samples(adata, min_n_features=1, max_n_features=None, min_pct_features=None, max_pct_features=None, min_n_counts=None, max_n_counts=None, expr_cutoff=1)[source]

Filter out samples based on different metrics.

Parameters:
  • adata (AnnData) – Annotated data matrix.

  • min_n_features (int, optional (default: None)) – Minimum number of features expressed

  • min_pct_features (float, optional (default: None)) – Minimum percentage of features expressed

  • min_n_counts (int, optional (default: None)) – Minimum number of read count for one cell

  • expr_cutoff (float, optional (default: 1)) – Expression cutoff. If greater than expr_cutoff,the gene is considered ‘expressed’

  • assay (str, optional (default: ‘rna’)) – Choose from {{‘rna’,’atac’}},case insensitive

Returns:

  • updates adata with a subset of cells that pass the filtering.

  • updates adata with the following fields if cal_qc() was not performed.

  • n_counts (pandas.Series (adata.obs[‘n_counts’],dtype int)) – The number of read count each cell has.

  • n_genes (pandas.Series (adata.obs[‘n_genes’],dtype int)) – The number of genes expressed in each cell.

  • pct_genes (pandas.Series (adata.obs[‘pct_genes’],dtype float)) – The percentage of genes expressed in each cell.

  • n_peaks (pandas.Series (adata.obs[‘n_peaks’],dtype int)) – The number of peaks expressed in each cell.

  • pct_peaks (pandas.Series (adata.obs[‘pct_peaks’],dtype int)) – The percentage of peaks expressed in each cell.