Skip to contents

# Read the feature dataset presence matrix.

Source: `R/get_helpers.R`
`get_presence_matrix.Rd`

Read the feature dataset presence matrix.

## Usage

    get_presence_matrix(census, organism, measurement_name = "RNA")

## Arguments

census

  The census object from `cellxgene.census::open_soma()`.

organism

  The organism to query, usually one of `Homo sapiens` or `Mus musculus`

measurement_name

  The measurement object to query. Defaults to `RNA`.

## Value

A `tiledbsoma::matrixZeroBasedView` object with dataset join id & feature join id dimensions, filled with 1s indicating presence. The sparse matrix is accessed with zero-based indexes since the join id's may be zero.

## 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.
    on.exit(census$close(), add = TRUE)
    print(get_presence_matrix(census, "Homo sapiens")$dim())
    #> Error in private$check_open_for_read_or_write(): Item must be open for read or write. s3://cellxgene-census-public-us-west-2/cell-census/2024-07-01/soma/