scmorph.qc.filter_outliers

scmorph.qc.filter_outliers#

scmorph.qc.filter_outliers(adata, outliers=0.05, fraction=None, n_obs=None, detect_only=False, n_cores=1)#

Filter outlier observations from an AnnData object.

Note

The outliers argument determines how many cells will be classified as outlier cells. Since it is an arbitrary threshold this will depend on your dataset and downstream analysis. We encourage you to try different values and see which one works best for your dataset.

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

  • outliers (float (default: 0.05)) – Expected fraction of outlier cells.

  • fraction (float) – During training, subsample to this fraction of the number of observations.

  • n_obs (Optional[int] (default: None)) – During training, subsample to this number of observations. We recommend 10,000 or fewer, as this results in faster training with adequate accuracy.

  • detect_only (bool (default: False)) – Whether to only detect outliers but not filter them.

  • n_cores (int (default: 1)) – Number of cores to use for parallelization. -1 for all cores.

Return type:

AnnData

Returns:

adata