mantispy.pp.filter_cells

Contents

mantispy.pp.filter_cells#

mantispy.pp.filter_cells(adata, min_cells_per_well=50, qc_pass=True, copy=False)#

Drop cells that fail QC or sit in under-populated wells.

Parameters:
  • adata (AnnData) – Object to filter.

  • min_cells_per_well (int (default: 50)) – Wells with fewer cells than this are dropped entirely, counted over the cells that survive the other checks in this call so that the cells being dropped cannot hold a well above the floor. 0 disables the check.

  • qc_pass (bool (default: True)) – Also require obs["qc_pass"], which calculate_qc_metrics() writes.

  • copy (bool (default: False)) – Return a filtered copy instead of filtering in place.

Return type:

AnnData | None

Returns:

None, or the filtered copy. Subsets obs to the surviving cells, and warns when that leaves none.

Raises:

KeyError – If qc_pass is requested but obs has no such column.