mantispy.pp.filter_features#

mantispy.pp.filter_features(adata, drop_nan=True, min_variance=0.0, blocklist='default', copy=False)[source]#

Drop all-NaN, low-variance and blocklisted features.

Parameters:
adata AnnData

Object to filter.

drop_nan bool (default: True)

Drop features that are missing everywhere.

min_variance float (default: 0.0)

Drop features whose variance is at or below this, as feature_select() and sklearn’s VarianceThreshold do. 0 disables the check.

blocklist str | Sequence[str] | None (default: 'default')

"default" for the bundled CellProfiler blocklist, an explicit list of names, or None to skip. Matched against the current names and against var["original_name"], so it works either side of standardize_feature_names().

copy bool (default: False)

Return a filtered copy instead of filtering in place.

Return type:

AnnData | None

Returns:

None, or the filtered copy. Subsets var to the surviving features, and reports how many were dropped.