, include_fields=None)

Convert a collection of AirrCell objects to AnnData.

This is useful for converting arbitrary data formats into the scirpy Data structure.


Reading data into Scirpy has the following constraints:
  • Each cell can have up to four productive chains chains (Dual IR): two VJ and two VDJ chains.

  • Excess chains are ignored (those with lowest read count/UMI count) and cells flagged as Multichain-cell.

  • Non-productive chains are ignored.

  • Chain loci must be valid IMGT locus names.

  • Excess chains, non-productive chains, chains without a CDR3 sequence, or chains with invalid loci are serialized to JSON and stored in the extra_chains column. They are not used by scirpy except when exporting the AnnData object to AIRR format.

For more information, see Immune receptor (IR) model.

airr_cells : Iterable[AirrCell]

A list of AirrCell objects

include_fields : Collection[str] | NoneOptional[Collection[str]] (default: None)

A list of field names that are to be transferred to adata. If None (the default), transfer all fields. Use this option to avoid cluttering of adata.obs by irrelevant columns.

Return type



AnnData object with IR information in obs.