msmu.pp.add_filter
Adds a filter to the specified modality in the MuData object based on the given condition.
Missing source values never pass, including for negated conditions. Matrix
filters use names prefixed with varm[key]. or obsm[key]. (key repr)
to distinguish their source from ordinary .obs/.var columns.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mdata
|
MuData
|
|
required |
modality
|
str
|
The modality within the |
required |
column
|
str
|
The column in the selected table to apply the filter on. |
required |
keep
|
Literal['eq', 'ne', 'lt', 'le', 'gt', 'ge', 'contains', 'not_contains']
|
The condition to apply for filtering. |
required |
value
|
str | float | None
|
The value to compare against for filtering. |
required |
on
|
Literal['var', 'obs', 'varm', 'obsm']
|
Target table to filter on. One of |
'var'
|
key
|
str | None
|
Key to select table from |
None
|
name
|
str | None
|
Optional filter name for selection with |
None
|
Returns:
| Type | Description |
|---|---|
MuData
|
|