Skip to contents

The operator [ loads a specified row of an odm object into memory. The odm object can be indexed either by integer or feature ID.

Usage

# S4 method for odm,ANY,missing,missing
[(x, i, j, drop)

Arguments

x

an object of class odm

i

the index of the row to load into memory. i can be either an integer (specifying the integer-based index of the row to load into memory) or a string (specifying the feature ID of the row to load into memory).

j

not used

drop

not used

Value

an expression vector (of class numeric)

Examples

library(sceptredata)
directories_to_load <- paste0(
 system.file("extdata", package = "sceptredata"),
 "/highmoi_example/gem_group_", c(1, 2)
)
directory_to_write <- tempdir()
out_list <- create_odm_from_cellranger(
  directories_to_load = directories_to_load,
  directory_to_write = directory_to_write,
)
#> Round 1/2 processing of the input files.
#> 	Processing file 1 of 2.
#> 	Processing file 2 of 2.
#> Round 2/2 processing of the input files.
#> 	Processing file 1 of 2. Computing cellwise covariates. Writing to disk.
#> 	Processing file 2 of 2. Computing cellwise covariates. Writing to disk.
gene_odm <- out_list$gene
# extract rows into memory by index and ID
v1 <- gene_odm[10L,]
v2 <- gene_odm["ENSG00000173825",]