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.AirrCell
objects and merges them on a chain-level. If both objects contain the same cell-id, and the same chains, the corresponding row inadata.obs
will 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 asambiguous
using thescirpy.tl.chain_qc()
function.The function performs a “left join”, i.e. all cells not present in
adata
will be discarded. Ofadata2
the function only retains information fromobs
.To simply add IR information onto an existing
AnnData
object with transcriptomics data, seemerge_with_ir()
(this function can do this, too, butmerge_with_ir
is more efficient).Modifies
adata
inplace.