# Sharing OBS between modalities

**URL:** https://discourse.scverse.org/t/sharing-obs-between-modalities/1566
**Category:** muon
**Created:** [June 29, 2023, 5:22pm UTC](https://discourse.scverse.org/t/sharing-obs-between-modalities/1566 "2023-06-29T17:22:23Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![djlisko01](https://avatars.discourse-cdn.com/v4/letter/d/34f0e0/32.png) [@djlisko01](https://discourse.scverse.org/u/djlisko01)
#### Post date: [June 29, 2023, 5:22pm UTC](https://discourse.scverse.org/t/sharing-obs-between-modalities/1566/1 "2023-06-29T17:22:23Z")

</div>

Hello, all,

I’m new to the scverse and I love it so far! Just one quick question with muon object. I’m trying to load .obs with data for RNA and abt after I’ve already created the muon data object. My question is will I have to set each modalities .obs (even though they share the same data)? I’ve run mdata.update(), but that seems to only work on filtering/update index names?

Curious to know if there’s a better way other than setting each modalities .obs.

Thank you,

Daniel

---

<div class="post-metadata">

### Author: ![gtca](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/gtca/32/1199_2.png) [@gtca](https://discourse.scverse.org/u/gtca)
#### Post date: [June 30, 2023, 12:14pm UTC](https://discourse.scverse.org/t/sharing-obs-between-modalities/1566/2 "2023-06-30T12:14:54Z")

</div>

Hey @djlisko01,

Global metadata can be stored in `mdata.obs` rather than in individual modalities. There’s no API to “push down” global metadata to individual modalities at the moment but I am not sure if that was part of the question.

If there’s a code snippet that you might need more help with, feel free to share it!

---

<div class="post-metadata">

### Author: ![djlisko01](https://avatars.discourse-cdn.com/v4/letter/d/34f0e0/32.png) [@djlisko01](https://discourse.scverse.org/u/djlisko01)
#### Post date: [July 3, 2023, 4:39pm UTC](https://discourse.scverse.org/t/sharing-obs-between-modalities/1566/3 "2023-07-03T16:39:02Z")

</div>

Hey @gtca,

Thanks for the response. Yeah, you answered my question thank you! So I guess the follow up question is, if I filter observations from one modality, I’ll have to manually do that for another? For example I remove poor quality reads from RNA - Seq data, I’ll then I have to use those indexes from RNA-seq data to filter ATAC-seq data?

Cheers,

Daniel

---

<div class="post-metadata">

### Author: ![gtca](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/gtca/32/1199_2.png) [@gtca](https://discourse.scverse.org/u/gtca)
#### Post date: [May 9, 2024, 12:47am UTC](https://discourse.scverse.org/t/sharing-obs-between-modalities/1566/4 "2024-05-09T00:47:52Z")

</div>

@djlisko01, you can do that, or you can just slice the whole MuData object, which will slice all the modalities inside:

```python
mdata_filtered_view = mdata[obs_names_to_keep]
# .copy() to make another MuData object

```

Alternatively you can use [`muon.pp.filter_obs`](https://muon.readthedocs.io/en/latest/api/generated/muon.pp.filter_obs.html) to avoid extra copies:

```python
mu.pp.filter_obs(mdata, obs_names_to_keep)

```
