tiledbsoma.Experiment.var_axis_delete¶
- Experiment.var_axis_delete(measurement_name: str, coords: Sequence[None | bytes | Slice[bytes] | Sequence[bytes] | float | Slice[float] | Sequence[float] | int | Slice[int] | Sequence[int] | slice | Slice[slice] | Sequence[slice] | str | Slice[str] | Sequence[str] | datetime64 | Slice[datetime64] | Sequence[datetime64] | TimestampType | Slice[TimestampType] | Sequence[TimestampType] | Array | ChunkedArray | ndarray[tuple[Any, ...], dtype[integer]] | ndarray[tuple[Any, ...], dtype[datetime64]]] = (), *, value_filter: str | None = None, platform_config: Dict[str, Mapping[str, Any]] | object | None = None) None¶
Delete variables (
varaxis elements only) from all predefined sub-objects within a single user-specified Measurement.Deleted features are specified:
by
varDataFrame joinid: a sequence of joinid or a sliceby
varDataFrame value filter / query condition
Sub-objects affected by this operation, given a named Measurement (ms_name):
exp.ms[ms_name].var - delete matching DataFrame elements
exp.ms[ms_name].var_spatial_presence - delete matching DataFrame elements, joining on the soma_joinid dimension
exp.ms[ms_name].X[*] - delete matching SparseNDMatrix values, joining on the soma_dim_1 dimension
exp.ms[ms_name].varm[*] - delete matching SparseNDMatrix values, joining on the soma_dim_0 dimension
exp.ms[ms_name].varp[*] - delete matching SparseNDMatrix values, joining on the soma_dim_0 and soma_dim_1 dimensions
exp.spatial[*].varl[ms_name][*] - delete matching PointCloudDataFrame/GeometryDataFrame elements, joining on the soma_joinid dimension
The following Measurement sub-objects are unaffected by this operation:
exp.ms[ms_name].obsm[*]
exp.ms[ms_name].obsp[*]
If any affected sub-objects are a DenseNDArray (dense TileDB array), the entire operation results in an error.
Either
coordsorvalue_filtermust be provided. When bothcoordsandvalue_filterare provided, the variables that match both constraints will be removed.- For example, to delete observations where
feature_biotype == 'gene': >>> with tiledbsoma.Experiment.open(experiment_uri, mode="d") as exp: ... exp.var_axis_delete(value_filter="feature_biotype == 'gene'")
Note: Deleting variables does not change the size of the current domain or possible enumeration values.
- Parameters:
coords – A per-dimension
Sequenceof scalar, slice, sequence of scalar or Arrow IntegerArray <https://arrow.apache.org/docs/python/generated/pyarrow.IntegerArray.html> values defining the region to read.value_filter – An optional [value filter] to apply to the results. Defaults to no filter.