Skip to content

Commit

Permalink
Enable labeling of isotypically included B cells as receptor_subtype
Browse files Browse the repository at this point in the history
  • Loading branch information
MKanetscheider committed Aug 9, 2024
1 parent 6160f37 commit 54aca6f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/scirpy/tl/_chain_qc.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ def chain_qc(
* `IGH` (all cells that have only IGH chains, but no IGL or IGK)
* `IGH+IGL` (all cells that have only IGH and IGL chains)
* `IGH+IGK` (all cells that have only IGH and IGK chains)
* `IGH+IGK/L` (isotypically included B cell i.e. IGH+IGK as the primary and
IGH+IGL as the secondary receptor or vice versa)
* `multichain` (all cells with more than two VJ or more than two VDJ chains)
* `ambiguous` (all cells that are none of the above, e.g. TRA+TRD, TRA+IGH or,
IGH+IGK as the primary and IGH+IGL as the secondary receptor)
* `ambiguous` (all cells that are none of the above, e.g. TRA+TRD, TRA+IGH)
* `no IR` (all cells without any detected immune receptor)
`chain_pairing` can be one of the following
Expand Down Expand Up @@ -109,6 +110,7 @@ def chain_qc(
subtype_is_tgd = (has_trg | has_trd) & ~(has_tra | has_trb | has_ig)
subtype_is_ighk = (has_igk) & ~(has_tr | has_igl)
subtype_is_ighl = (has_igl) & ~(has_tr | has_igk)
subtype_is_ighkl = (has_igl) & (has_igk) & ~(has_tr) & (has_igh)
# orphan IGH
subtype_is_igh = (has_igh) & ~(has_igk | has_igl | has_tr)

Expand All @@ -127,6 +129,7 @@ def chain_qc(
res_receptor_subtype[subtype_is_igh] = "IGH"
res_receptor_subtype[subtype_is_ighl] = "IGH+IGL"
res_receptor_subtype[subtype_is_ighk] = "IGH+IGK"
res_receptor_subtype[subtype_is_ighkl] = "IGH+IGK/L"
res_receptor_subtype[mask_multichain] = "multichain"

res_chain_pairing = _chain_pairing(params, res_receptor_subtype == "ambiguous", mask_has_ir, mask_multichain)
Expand Down

0 comments on commit 54aca6f

Please sign in to comment.