Skip to contents

# Open the Census

Source: `R/open.R`
`open_soma.Rd`

Open the Census

## Usage

    open_soma(
      census_version = "stable",
      uri = NULL,
      tiledbsoma_ctx = NULL,
      mirror = NULL
    )

## Arguments

census_version

  The version of the Census, e.g., "stable".

uri

  A URI containing the Census SOMA objects to open instead of a released version. (If supplied, takes precedence over `census_version`.)

tiledbsoma_ctx

  A `tiledbsoma::SOMATileDBContext` built using `new_SOMATileDBContext_for_census()`. Optional (created automatically) if using `census_version` and the context does not need to be reused.

mirror

  The Census mirror to access; one of `names(get_census_mirror_directory())`.

## Value

Top-level `tiledbsoma::SOMACollection` object. After use, the census should be closed to release memory and other resources, usually with `on.exit(census$close(), add = TRUE)`. Closing the top-level census will also close all SOMA objects accessed through it.

## Examples

    census <- open_soma()
    #> The stable Census release is currently 2024-07-01. Specify census_version = "2024-07-01" in future calls to open_soma() to ensure data consistency.
    as.data.frame(census$get("census_info")$get("summary")$read()$concat())
    #>   soma_joinid                      label      value
    #> 1           0      census_schema_version      2.0.1
    #> 2           1          census_build_date 2024-05-20
    #> 3           2     dataset_schema_version      5.0.0
    #> 4           3           total_cell_count  115556140
    #> 5           4          unique_cell_count   60597966
    #> 6           5 number_donors_homo_sapiens      17651
    #> 7           6 number_donors_mus_musculus       4216
    census$close()