tacco.preprocessing.filter

filter(adata, min_counts_per_gene=None, min_counts_per_cell=None, min_cells_per_gene=None, min_genes_per_cell=None, remove_constant_genes=False, remove_zero_cells=False, assume_valid_counts=False, return_view=True)[source]

Filter one or more AnnData to satisfy simple quality criteria. In contrast to scanpy.pp.filter_cells() and scanpy.pp.filter_genes() this function iterates the filters until convergence.

Parameters:
  • adata – An AnnData containing the expression to filter. It can also be an iterable of AnnData to apply the filter to all instances and use the intersection of genes for all.

  • min_counts_per_gene – The minimum count (per AnnData) genes must have to be kept.

  • min_counts_per_cell – The minimum count (per AnnData) cells must have to be kept.

  • min_cells_per_gene – The minimum number of cells (per AnnData) genes must have to be kept.

  • min_genes_per_cell – The minimum number of genes (per AnnData) cells must have to be kept.

  • remove_constant_genes – Whether to remove genes which do not show any variation between cells

  • remove_zero_cells – Whether to remove cells without non-zero genes

  • assume_valid_counts – Disable checking for invalid counts (e.g. non-integer or negative).

  • return_view – Instead of AnnData instances, return filtered views into the original adata. If nothing is filtered or permuted, return the original adata.

Returns:

Returns the filtered adata.