dynamo.pp.filter_cells

dynamo.pp.filter_cells(adata, filter_bool=None, layer='all', keep_filtered=False, min_expr_genes_s=50, min_expr_genes_u=25, min_expr_genes_p=1, max_expr_genes_s=inf, max_expr_genes_u=inf, max_expr_genes_p=inf, shared_count=None, spliced_key='spliced', unspliced_key='unspliced', protein_key='protein', obs_store_key='pass_basic_filter')

Select valid cells based on a collection of filters including spliced, unspliced and protein min/max vals.

Parameters
  • adata (AnnData) – AnnData object.

  • filter_bool (ndarray (default: None)) – A boolean array from the user to select cells for downstream analysis.

  • layer (str (default: all)) – The data from a particular layer (include X) used for feature selection. Use ‘all’ or a set/list to filter by shared counts of a set/list of layers.

  • keep_filtered (bool (default: False)) – Whether to keep cells that don’t pass the filtering in the adata object.

  • min_expr_genes_s (int (default: 50)) – Minimal number of genes with expression for a cell in the data from the spliced layer (also used for X).

  • min_expr_genes_u (int (default: 25)) – Minimal number of genes with expression for a cell in the data from the unspliced layer.

  • min_expr_genes_p (int (default: 1)) – Minimal number of genes with expression for a cell in the data from in the protein layer.

  • max_expr_genes_s (float (default: np.inf)) – Maximal number of genes with expression for a cell in the data from the spliced layer (also used for X).

  • max_expr_genes_u (float (default: np.inf)) – Maximal number of genes with expression for a cell in the data from the unspliced layer.

  • max_expr_genes_p (float (default: np.inf)) – Maximal number of protein with expression for a cell in the data from the protein layer.

  • shared_count (int or None (default: None)) – The minimal shared number of counts for each cell across genes between layers.

Returns

adata – An updated AnnData object with use_for_pca as a new column in obs to indicate the selection of cells for downstream analysis. adata will be subsetted with only the cells pass filtering if keep_filtered is set to be False.

Return type

AnnData