# help understanding Unifrac

**URL:** <https://forum.mothur.org/t/help-understanding-unifrac/1817>\
**Category:** Theory behind mothur\
**Created:** [April 29, 2014, 3:19pm UTC](https://forum.mothur.org/t/help-understanding-unifrac/1817 "2014-04-29T15:19:06Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![notoriousjbb](https://avatars.discourse-cdn.com/v4/letter/n/47e85d/32.png) [@notoriousjbb](https://forum.mothur.org/u/notoriousjbb)\
**Post date:** [April 29, 2014, 3:19pm UTC](https://forum.mothur.org/t/help-understanding-unifrac/1817/1 "2014-04-29T15:19:06Z")

</div>

Hello,  
I was wondering if someone can help me understand the proper way to use the Unifrac command in mothur. I understand Unifrac to be a distance measurement for looking at phylogenetic information. It would make sense to me that you could use a tree made with clearcut (from a phylip-formatted distance matrix) and then run the Unifrac commands on it. I am confused about how (as in the 454 SOP) we are putting a dissimilarity tree made using the thetayc calculator (or any other one) into the Unifrac command. Since thetayc weights for relative abundance, how does it make sense to then apply another weighted formula on top of it with Unifrac weighted? Aren’t we sort of…double weighting things?  
I have spent some time trying to figure this out and I am getting deep in the weeds. I would appreciate any help!

---

<div class="post-metadata">

**Author:** ![pschloss](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.mothur.org/pschloss/32/4_2.png) [@pschloss](https://forum.mothur.org/u/pschloss)\
**Post date:** [May 1, 2014, 4:35pm UTC](https://forum.mothur.org/t/help-understanding-unifrac/1817/2 "2014-05-01T16:35:41Z")

</div>

It can be used in two ways. The first is as you mention, to calculate a beta-diversity metric. The second is as a hypothesis test where the input is a tree and you want to see whether the clustering/branching length in the tree is significantly different between groups.

---

<div class="post-metadata">

**Author:** ![notoriousjbb](https://avatars.discourse-cdn.com/v4/letter/n/47e85d/32.png) [@notoriousjbb](https://forum.mothur.org/u/notoriousjbb)\
**Post date:** [May 5, 2014, 7:10pm UTC](https://forum.mothur.org/t/help-understanding-unifrac/1817/3 "2014-05-05T19:10:21Z")

</div>

Ok. But then how does the weighted vs unweighted unifrac add in when you are inputting an already “weighted” distance tree such as thetayc?

---

<div class="post-metadata">

**Author:** ![pschloss](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.mothur.org/pschloss/32/4_2.png) [@pschloss](https://forum.mothur.org/u/pschloss)\
**Post date:** [May 7, 2014, 11:30am UTC](https://forum.mothur.org/t/help-understanding-unifrac/1817/4 "2014-05-07T11:30:49Z")

</div>

The weighted refers to how the branch length is portioned in the analysis. Frankly, I’m not sure why you would use the unifracs as a hypothesis test instead of amova/homova since unifrac requires converting the distance matrix to a tree, which causes you to lose information. amova/homova just use the distance matrix.

Pat

---

<div class="post-metadata">

**Author:** ![notoriousjbb](https://avatars.discourse-cdn.com/v4/letter/n/47e85d/32.png) [@notoriousjbb](https://forum.mothur.org/u/notoriousjbb)\
**Post date:** [May 7, 2014, 4:01pm UTC](https://forum.mothur.org/t/help-understanding-unifrac/1817/5 "2014-05-07T16:01:40Z")

</div>

Thanks, I was wondering the same thing. It seems to make much more sense to just use AMOVA/HOMOVA.

---

<div class="post-metadata">

**Author:** ![oalzahal](https://avatars.discourse-cdn.com/v4/letter/o/e9bcb4/32.png) [@oalzahal](https://forum.mothur.org/u/oalzahal)\
**Post date:** [May 26, 2014, 7:55pm UTC](https://forum.mothur.org/t/help-understanding-unifrac/1817/6 "2014-05-26T19:55:50Z")

</div>

> [@pschloss](#):
>
> … Frankly, I’m not sure why you would use the unifracs as a hypothesis test instead of amova/homova since unifrac requires converting the distance matrix to a tree, which causes you to lose information. amova/homova just use the distance matrix.
> 
> Pat

Pat, in the 454 SOP for the Phylogeny-based analysis, you used  
mothur \> unifrac.unweighted(tree=final.phylip.tre, …  
if i understand you correctly, it will be better to do the following instead:

mothur \> amova(phylip=final.phylip.dist, …)

  
O.

many thanks

---

<div class="post-metadata">

**Author:** ![pschloss](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.mothur.org/pschloss/32/4_2.png) [@pschloss](https://forum.mothur.org/u/pschloss)\
**Post date:** [May 27, 2014, 12:40pm UTC](https://forum.mothur.org/t/help-understanding-unifrac/1817/7 "2014-05-27T12:40:23Z")

</div>

The commands in the SOP describe the many ways you can use mothur to do common analyses. The alpha/beta/phylog. based analyses are not meant to be a cook book for how to do an analysis.

Pat

---

<div class="post-metadata">

**Author:** ![oalzahal](https://avatars.discourse-cdn.com/v4/letter/o/e9bcb4/32.png) [@oalzahal](https://forum.mothur.org/u/oalzahal)\
**Post date:** [May 27, 2014, 1:56pm UTC](https://forum.mothur.org/t/help-understanding-unifrac/1817/8 "2014-05-27T13:56:24Z")

</div>

it is a “learn-as-you-go” process, and the SOP and forum are great start. 😃
