scirpy.pp.merge_airr_chains¶
-
scirpy.pp.merge_airr_chains(adata, adata2)¶ Merge two AnnData objects with IR information (e.g. BCR with TCR).
Decomposes the IR information back into
scirpy.io.AirrCellobjects and merges them on a chain-level. If both objects contain the same cell-id, and the same chains, the corresponding row inadata.obswill be unchanged. If both objects contain the same cell-id, but different chains, the chains will be merged into a single cell such that it can be annotated as ambiguous or multi-chain if appropriate. If a cell contains both TCR and BCR chains, they will both be kept and can be identified asambiguoususing thescirpy.tl.chain_qc()function.The function performs a “left join”, i.e. all cells not present in
adatawill be discarded. Ofadata2the function only retains information fromobs.To simply add IR information onto an existing
AnnDataobject with transcriptomics data, seemerge_with_ir()(this function can do this, too, butmerge_with_iris more efficient).Modifies
adatainplace.