# Beta diversity in metaphlan 4.2.4 doesn't work becuase of rbiom upgrade?

**URL:** <https://forum.biobakery.org/t/beta-diversity-in-metaphlan-4-2-4-doesnt-work-becuase-of-rbiom-upgrade/8911>\
**Category:** MetaPhlAn\
**Created:** [May 11, 2026, 1:47pm UTC](https://forum.biobakery.org/t/beta-diversity-in-metaphlan-4-2-4-doesnt-work-becuase-of-rbiom-upgrade/8911 "2026-05-11T13:47:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Irc47](https://avatars.discourse-cdn.com/v4/letter/i/e480ec/32.png) [@Irc47](https://forum.biobakery.org/u/Irc47)\
**Post date:** [May 11, 2026, 1:47pm UTC](https://forum.biobakery.org/t/beta-diversity-in-metaphlan-4-2-4-doesnt-work-becuase-of-rbiom-upgrade/8911/1 "2026-05-11T13:47:27Z")

</div>

Hello!

I’m using metphlan 4.2.4 to profile long reads and things are going well, but I’m trying to use the provided tool to calculate beta diversity and get the error “beta.div’ is not an exported object from ‘namespace:rbiom’”. I used conda for install and so I have rbiom 3.1.0 which doesn’t seem to use the beta.div function any more.

I’m working around this by replacing the code in the calculate\_diversity.R script with the newer function bdiv\_matrix, here’s an example:

```auto
if (opt$diversity == "beta"){
  
  # Bray-Curtis
  if (opt$metric == "bray-curtis"){
    mat <- rbiom::bdiv_matrix(as.matrix(mpa_table), bdiv="bray-curtis", weighted=TRUE)
  }
  

```

--Ilana

---

<div class="post-metadata">

**Author:** ![Claudia\_Mengoni](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/claudia_mengoni/32/2871_2.png) [@Claudia\_Mengoni](https://forum.biobakery.org/u/Claudia_Mengoni)\
**Post date:** [May 22, 2026, 12:58pm UTC](https://forum.biobakery.org/t/beta-diversity-in-metaphlan-4-2-4-doesnt-work-becuase-of-rbiom-upgrade/8911/2 "2026-05-22T12:58:15Z")

</div>

Thank you @Irc47, I have updated the code on github so that this change will be included in the next release.
