# How can get same results after qiime diversity core-metrics-phylogenetic

**URL:** https://forum.qiime2.org/t/how-can-get-same-results-after-qiime-diversity-core-metrics-phylogenetic/11831
**Category:** User Support
**Tags:** rarefaction
**Created:** [October 4, 2019, 7:23pm UTC](https://forum.qiime2.org/t/how-can-get-same-results-after-qiime-diversity-core-metrics-phylogenetic/11831 "2019-10-04T19:23:26Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![guojun\_wu](https://forum.qiime2.org/user_avatar/forum.qiime2.org/guojun_wu/32/5089_2.png) [@guojun\_wu](https://forum.qiime2.org/u/guojun_wu)
#### Post date: [October 4, 2019, 7:23pm UTC](https://forum.qiime2.org/t/how-can-get-same-results-after-qiime-diversity-core-metrics-phylogenetic/11831/1 "2019-10-04T19:23:27Z")

</div>

Hi there,  
I used qiime2 (qiime2-2019.4) in my research. By chance, I ran "qiime diversity core-metrics-phylogenetic" several times for the same dataset but can not get the same rarefied tables. I just wonder is it true that every time run "qiime diversity core-metrics-phylogenetic" will get slightly different rarefied tables because of the random permutation process in it? If so, is it possible to fix the random permutation and get reproducible results? Thank you!

The command I used as below:

qiime diversity core-metrics-phylogenetic   
--i-phylogeny 3.filtered\_DADA2\_rep-seqs-rooted-tree.qza   
--i-table 3.filtered\_DADA2\_table.qza   
--p-sampling-depth 13000   
--m-metadata-file 0.sample-metadata.txt   
--output-dir 4.core-metrics-results

qiime tools export   
--input-path 4.core-metrics-results/rarefied\_table.qza   
--output-path outputdir  
mv outputdir/feature-table.biom 4.rarefied\_table.biom  
biom convert -i 4.rarefied\_table.biom -o 4.rarefied\_table.txt --to-tsv

---

<div class="post-metadata">

### Author: ![colinbrislawn](https://forum.qiime2.org/user_avatar/forum.qiime2.org/colinbrislawn/32/6221_2.png) [@colinbrislawn](https://forum.qiime2.org/u/colinbrislawn)
#### Post date: [October 4, 2019, 7:58pm UTC](https://forum.qiime2.org/t/how-can-get-same-results-after-qiime-diversity-core-metrics-phylogenetic/11831/2 "2019-10-04T19:58:10Z")

</div>

Good afternoon,

> [@guojun\_wu](#):
>
> I just wonder is it true that every time run “qiime diversity core-metrics-phylogenetic” will get slightly different rarefied tables because of the random permutation process in it?

That's right!

> [@guojun\_wu](#):
>
> If so, is it possible to fix the random permutation and get reproducible results?

I'm not sure how to do that within Qiime 2, but it's an interesting idea!  
(I know you can do this in Phyloseq, or avoid this issue totally using jackknifed PCoA)

Colin

---

<div class="post-metadata">

### Author: ![Nicholas\_Bokulich](https://forum.qiime2.org/user_avatar/forum.qiime2.org/nicholas_bokulich/32/19937_2.png) [@Nicholas\_Bokulich](https://forum.qiime2.org/u/Nicholas_Bokulich)
#### Post date: [October 4, 2019, 10:36pm UTC](https://forum.qiime2.org/t/how-can-get-same-results-after-qiime-diversity-core-metrics-phylogenetic/11831/3 "2019-10-04T22:36:06Z")

</div>

> [@colinbrislawn](#):
>
> I’m not sure how to do that within Qiime 2, but it’s an interesting idea!

Not yet possible in QIIME 2. We have thrown around the idea of exposing a parameter for setting a random seed to make this reproducible, but I think it is a very low priority because, in general, if you are sampling at a reasonably high rarefaction depth then your results should converge fairly well at that sequencing depth so results should not vary too much. If you rarefy twice and get vastly different results it is a pretty good indication you need to sample at a higher depth!

> [@colinbrislawn](#):
>
> avoid this issue totally using jackknifed PCoA

Such as with `qiime diversity beta-rarefaction`

---

<div class="post-metadata">

### Author: ![guojun\_wu](https://forum.qiime2.org/user_avatar/forum.qiime2.org/guojun_wu/32/5089_2.png) [@guojun\_wu](https://forum.qiime2.org/u/guojun_wu)
#### Post date: [October 6, 2019, 2:33pm UTC](https://forum.qiime2.org/t/how-can-get-same-results-after-qiime-diversity-core-metrics-phylogenetic/11831/4 "2019-10-06T14:33:24Z")

</div>

@colinbrislawn Thank you.

---

<div class="post-metadata">

### Author: ![guojun\_wu](https://forum.qiime2.org/user_avatar/forum.qiime2.org/guojun_wu/32/5089_2.png) [@guojun\_wu](https://forum.qiime2.org/u/guojun_wu)
#### Post date: [October 6, 2019, 2:44pm UTC](https://forum.qiime2.org/t/how-can-get-same-results-after-qiime-diversity-core-metrics-phylogenetic/11831/5 "2019-10-06T14:44:20Z")

</div>

[quote="Nicholas\_Bokulich, post:3, topic:11831, full:true"]

> [@colinbrislawn](#):
>
> I’m not sure how to do that within Qiime 2, but it’s an interesting idea!

Not yet possible in QIIME 2. We have thrown around the idea of exposing a parameter for setting a random seed to make this reproducible, but I think it is a very low priority because, in general, if you are sampling at a reasonably high rarefaction depth then your results should converge fairly well at that sequencing depth so results should not vary too much. If you rarefy twice and get vastly different results it is a pretty good indication you need to sample at a higher depth!

@Nicholas_Bokulich Thank you for you reply. I just wonder in some situation, we may need such reproducibility such as for workshop or compare the results from two students. Just a little suggestion for your consideration. Is it possible to add the seed parameter in next version?

---

<div class="post-metadata">

### Author: ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)
#### Post date: [October 7, 2019, 11:30pm UTC](https://forum.qiime2.org/t/how-can-get-same-results-after-qiime-diversity-core-metrics-phylogenetic/11831/6 "2019-10-07T23:30:12Z")

</div>

> [@guojun\_wu](#):
>
> Is it possible to add the seed parameter in next version?

No, it is not currently planned for the [upcoming 2019.10 release](https://forum.qiime2.org/t/preview-qiime-2-2019-10-development-changelog/10922). As @Nicholas_Bokulich said, this is very low priority for us at the moment. Regarding the "workshop" example --- we teach QIIME 2 workshops very often, and don't see this being an issue with the tutorial datasets we use. In fact, the small bit of variability between different runs is a useful talking point for emphasizing what rarefaction is!

---

<div class="post-metadata">

### Author: ![system](https://forum-qiime2-org.s3.dualstack.us-west-2.amazonaws.com/original/3X/2/1/21af5fe23cb6f4579467c66a9ed94e55274ca7bd.svg) [@system](https://forum.qiime2.org/u/system)
#### Post date: [November 8, 2019, 5:30am UTC](https://forum.qiime2.org/t/how-can-get-same-results-after-qiime-diversity-core-metrics-phylogenetic/11831/7 "2019-11-08T05:30:13Z")

</div>

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
