dropFeatures
dropFeatures ¶
dropFeatures(
data,
dropMarkers=None,
dropCells=None,
dropMetaColumns=None,
dropGroups=None,
groupsColumn=None,
subsetRaw=True,
verbose=True,
outputDir=None,
sdataTable=None,
)
Drop markers, cells, metadata columns, or phenotype groups.
Everything you pass is dropped in one pass, in this order: groups, then cells,
then markers, then obs columns. Dropping markers also prunes .raw when
subsetRaw=True, which keeps .X and .raw.X describing the same variables —
forget that and later calls with layer='raw' will disagree with .X.
SpatialData tables need their annotation columns
For SpatialData input, keep the table's region_key and instance_key
obs columns. Dropping them makes the table fail TableModel validation on
write-back.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
(AnnData | SpatialData | str, required)
|
The cell table. An |
required |
dropMarkers
|
str | list
|
Markers to remove from |
None
|
dropCells
|
str | list
|
Cell names ( |
None
|
dropMetaColumns
|
str | list
|
Columns to remove from |
None
|
dropGroups
|
str | list
|
Values of |
None
|
groupsColumn
|
str
|
Column in |
None
|
subsetRaw
|
bool
|
Apply |
True
|
verbose
|
bool
|
Print the resulting shape. |
True
|
outputDir
|
str
|
Directory to write the updated object to. With |
None
|
sdataTable
|
str
|
Which |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
adata |
AnnData | SpatialData | None
|
The reduced object. |
Raises:
| Type | Description |
|---|---|
ValueError
|
When |