# Bar plot using muon between scRNA-seq and scTCR-seq&scBCR-seq?

**URL:** <https://discourse.scverse.org/t/bar-plot-using-muon-between-scrna-seq-and-sctcr-seq-scbcr-seq/1573>\
**Category:** scirpy\
**Tags:** integration\
**Created:** [July 5, 2023, 7:27am UTC](https://discourse.scverse.org/t/bar-plot-using-muon-between-scrna-seq-and-sctcr-seq-scbcr-seq/1573 "2023-07-05T07:27:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![zhouzhendiao](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/zhouzhendiao/32/731_2.png) [@zhouzhendiao](https://discourse.scverse.org/u/zhouzhendiao)\
**Post date:** [July 5, 2023, 7:27am UTC](https://discourse.scverse.org/t/bar-plot-using-muon-between-scrna-seq-and-sctcr-seq-scbcr-seq/1573/1 "2023-07-05T07:27:17Z")

</div>

I want to annotate scTCR-seq/scBCR-seq information to scRNA-seq, umap or bar plot. It is convinient do this by just add adaptor immune receptor(AIR) information in adata\_gex.obs.But if I want to use muon to create a mudata which contains multple model omics data, some analysis become confusing. For example, if I want to annotate AIR information on a gex umap, it’s convinient using function `mu.pl.embedding(mdata, basis="gex:umap", color=["gex:CD79A", "bcr:chain_pairing", "tcr:chain_pairing"])`. But If I want to draw a stacked bar plot which x-axis is different celltypes and y-axis is proportion of different types of “bcr:chain\_pairing”, there is no function like `mu.pl.barplot(mdata, groupby="gex:cell_type", value="bcr:chain_pairing")`. So how can I annotate scTCR-seq&scBCR-seq data to scRNA-seq data and draw a stacked plot using muon?

---

<div class="post-metadata">

**Author:** ![grst](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/grst/32/17_2.png) [@grst](https://discourse.scverse.org/u/grst)\
**Post date:** [July 6, 2023, 8:20am UTC](https://discourse.scverse.org/t/bar-plot-using-muon-between-scrna-seq-and-sctcr-seq-scbcr-seq/1573/2 "2023-07-06T08:20:55Z")

</div>

I think you are looking for the [`ir.pl.group_abundance`](https://scirpy.scverse.org/en/latest/generated/scirpy.pl.group_abundance.html) function, which is implemented in scirpy, rather than muon.

For more customized plots, `mdata.obs` is just a pandas dataframe that can be used for plotting with e.g. [seaborn](https://seaborn.pydata.org/index.html) or [altair](https://altair-viz.github.io/).

---

<div class="post-metadata">

**Author:** ![zhouzhendiao](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/zhouzhendiao/32/731_2.png) [@zhouzhendiao](https://discourse.scverse.org/u/zhouzhendiao)\
**Post date:** [July 6, 2023, 8:38am UTC](https://discourse.scverse.org/t/bar-plot-using-muon-between-scrna-seq-and-sctcr-seq-scbcr-seq/1573/3 "2023-07-06T08:38:47Z")

</div>

Hi gregor,

I think ir.pl.group\_abundance is about cells detected by scTCR-seq rather than scRNA-seq, however I want to annotate cell detected by scRNA-seq which is detected by scTCR-seq, too.

`mdata.obs` sounds like the thing I’m looking for. I will try this recently, thanks!

Best,  
Zhendiao Zhou

---

<div class="post-metadata">

**Author:** ![grst](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/grst/32/17_2.png) [@grst](https://discourse.scverse.org/u/grst)\
**Post date:** [July 6, 2023, 8:51am UTC](https://discourse.scverse.org/t/bar-plot-using-muon-between-scrna-seq-and-sctcr-seq-scbcr-seq/1573/4 "2023-07-06T08:51:22Z")

</div>

`group_abundance` just reads `mdata.obs` as well. It doesn’t care if cells come from scRNA-seq or scTCR-seq. But I’m also not entirely sure if you are trying to do something that couldn’t be accomplished with `group_abundance`.

---

<div class="post-metadata">

**Author:** ![zhouzhendiao](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/zhouzhendiao/32/731_2.png) [@zhouzhendiao](https://discourse.scverse.org/u/zhouzhendiao)\
**Post date:** [July 6, 2023, 9:04am UTC](https://discourse.scverse.org/t/bar-plot-using-muon-between-scrna-seq-and-sctcr-seq-scbcr-seq/1573/5 "2023-07-06T09:04:08Z")

</div>

This is informative. Thanks!
