Skip to contents

This is the bixverse-based SingleCells class for multiple modalities. Under the hood it uses a DuckDB for obs and vars storing, and a Rust-based binarised file format to store the raw and normalised counts for single cell RNAseq. In both cases, the idea is not to hold any data that is not needed at a given point of time in memory, but leverage speedy on-disk computations and streaming engines powered by Rust and DuckDB to run the analysis.

Usage

SingleCellsMultiModal(dir_data)

Arguments

dir_data

String. This is the directory in which the experimental files will be

Value

Returns the SingleCellsMultiModal class for further operations.

Properties

db_connection

This contains an R6 class with DuckDB pointers and wrappers to interact with the table-like data for this experiment.

count_connection

This contains an R6-like environment that points to Rust functions that can work on the RNAseq counts more specifically.

adt_counts

...

peak_connection

Future feature: to store ATAC Seq counts in the future.

dir_data

Path to the directory in which the data will be saved on disk.

sc_cache

Class with cached data. Contains less memory-heavy objects such as embeddings, kNN information or sNN graphs for the single cell RNAseq.

adt_cache

Class with cached data. Contains less memory-heavy objects such as embeddings, kNN information or sNN graphs for the single cell Antibody-Derived Tags.

atac_cache

Class with cached data. Contains less memory-heavy objects such as embeddings, kNN information or sNN graphs for the single cell chromatin accessability.

sc_map

Class containing various mapping information such as HVG indices, cells to keep, etc.

other_data

List that contains additional data and results, such as for example the WNN graph.

dims

Dimensions of the original data.

Examples

# an empty multi-modal handle with the RNA modality ingested into it
rna <- generate_single_cell_test_data()
dir <- tempfile("bixverse_mm")
dir.create(dir)
object <- load_r_data(
  SingleCellsMultiModal(dir_data = dir),
  counts = rna$counts,
  obs = rna$obs,
  var = rna$var,
  sc_qc_param = params_sc_min_quality(min_unique_genes = 5L),
  .verbose = FALSE
)
object
#> Single cell experiment (Multi-modal).
#>   No cells (original): 1000
#>    To keep n: 1000
#>   RNA:
#>     No genes: 100
#>     HVG calculated: FALSE
#>     PCA calculated: FALSE
#>     Other embeddings: none
#>     KNN generated: FALSE
#>     SNN generated: FALSE
#>   ADT:
#>     Present: FALSE
#>     No features: 0
#>     PCA calculated: FALSE
#>     Other embeddings: none
#>     KNN generated: FALSE
#>     SNN generated: FALSE
#>   ATAC: not yet implemented
#>   Stale artefacts: none

unlink(dir, recursive = TRUE, force = TRUE)