cellxgene_census.get_default_soma_context

cellxgene_census.get_default_soma_context(tiledb_config: dict[str, Any] | None = None) SOMATileDBContext

Return a tiledbsoma.SOMATileDBContext with sensible defaults that can be further customized by the user. The customized context can then be passed to cellxgene_census.open_soma() with the context argument or to somacore.SOMAObject.open() with the context argument, such as tiledbsoma.Experiment.open(). Use the tiledbsoma.SOMATileDBContext.replace() method on the returned object to customize its settings further.

Parameters:

tiledb_config – A dictionary of TileDB configuration parameters. If specified, the parameters will override the defaults. If not specified, the default configuration will be returned.

Returns:

A tiledbsoma.SOMATileDBContext object with sensible defaults.

Examples

To reduce the amount of memory used by TileDB-SOMA I/O operations:

ctx = cellxgene_census.get_default_soma_context(
    tiledb_config={"py.init_buffer_bytes": 128 * 1024**2,
                   "soma.init_buffer_bytes": 128 * 1024**2})
c = census.open_soma(uri="s3://my-private-bucket/census/soma", context=ctx)

To access a copy of the Census located in a private bucket that is located in a different S3 region, use:

ctx = cellxgene_census.get_default_soma_context(
    tiledb_config={"vfs.s3.no_sign_request": "false",
                   "vfs.s3.region": "us-east-1"})
c = census.open_soma(uri="s3://my-private-bucket/census/soma", context=ctx)

Lifecycle

experimental