ImmunData: ImmunData: A Unified Structure for Immune Receptor Repertoire...

ImmunDataR Documentation

ImmunData: A Unified Structure for Immune Receptor Repertoire Data

Description

ImmunData is an abstract R6 class for managing and transforming immune receptor repertoire data. It supports flexible backends (e.g., Arrow, DuckDB, dbplyr) and lazy evaluation, and provides tools for filtering, aggregation, and receptor-to-repertoire mapping.

Public fields

schema_receptor

A named list describing how to interpret receptor-level data. This includes the fields used for aggregation (e.g., CDR3, V_gene, J_gene), and optionally unique identifiers for each receptor row. Used to ensure consistency across processing steps.

schema_repertoire

A named list defining how barcodes or annotations should be grouped into repertoires. This may include sample-level metadata (e.g., sample_id, donor_id) used to define unique repertoires.

Active bindings

receptors

Accessor for the dynamically-created table with receptors.

annotations

Accessor for the annotation-level table (.annotations).

repertoires

Get a table of repertoires and their basic statistics.

metadata

Get a table of repertoires without their basic statistics.

provenance

Read-only accessor for snapshot provenance metadata.

Methods

Public methods


Method new()

Creates a new ImmunData object. This constructor expects receptor-level and barcode-level data, along with a receptor schema defining aggregation and identity fields.

Usage
ImmunData$new(schema, annotations, repertoires = NULL, provenance = NULL)
Arguments
schema

A character vector specifying the receptor schema (e.g., aggregate fields, ID columns).

annotations

A cell/barcode-level dataset mapping barcodes to receptor rows.

repertoires

A repertoire table, created inside the body of agg_repertoires.

provenance

Internal provenance metadata for snapshot lineage.


Method clone()

The objects of this class are cloneable with this method.

Usage
ImmunData$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

See Also

read_repertoires(), read_immundata()


immundata documentation built on April 4, 2026, 9:09 a.m.