# Compute core microbiome

**URL:** <https://forum.qiime2.org/t/compute-core-microbiome/3607>\
**Category:** User Support\
**Tags:** core-features\
**Created:** [March 29, 2018, 8:42pm UTC](https://forum.qiime2.org/t/compute-core-microbiome/3607 "2018-03-29T20:42:22Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![CarlyRae](https://forum.qiime2.org/user_avatar/forum.qiime2.org/carlyrae/32/12745_2.png) [@CarlyRae](https://forum.qiime2.org/u/CarlyRae)\
**Post date:** [March 29, 2018, 8:42pm UTC](https://forum.qiime2.org/t/compute-core-microbiome/3607/1 "2018-03-29T20:42:22Z")

</div>

Is there a compute\_core\_microbiome.py equivalent for QIIME 2? A search didn't turn up anything. It was great to use in QIIME 1. Thanks!

---

<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:** [March 29, 2018, 8:50pm UTC](https://forum.qiime2.org/t/compute-core-microbiome/3607/2 "2018-03-29T20:50:32Z")

</div>



---

<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:** [March 29, 2018, 8:52pm UTC](https://forum.qiime2.org/t/compute-core-microbiome/3607/3 "2018-03-29T20:52:13Z")

</div>

Hi @CarlyRae! Have you seen [`feature-table core-features`](https://docs.qiime2.org/2018.2/plugins/available/feature-table/core-features/)? I think this is the Q2 equivalent of that Q1 script. Keep us posted! 🦖

---

<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:** [March 29, 2018, 8:52pm UTC](https://forum.qiime2.org/t/compute-core-microbiome/3607/4 "2018-03-29T20:52:14Z")

</div>



---

<div class="post-metadata">

**Author:** ![CarlyRae](https://forum.qiime2.org/user_avatar/forum.qiime2.org/carlyrae/32/12745_2.png) [@CarlyRae](https://forum.qiime2.org/u/CarlyRae)\
**Post date:** [March 30, 2018, 4:15pm UTC](https://forum.qiime2.org/t/compute-core-microbiome/3607/5 "2018-03-30T16:15:39Z")

</div>

Perfect. That looks like the equivalent! Thanks

---

<div class="post-metadata">

**Author:** ![CarlyRae](https://forum.qiime2.org/user_avatar/forum.qiime2.org/carlyrae/32/12745_2.png) [@CarlyRae](https://forum.qiime2.org/u/CarlyRae)\
**Post date:** [March 30, 2018, 4:20pm UTC](https://forum.qiime2.org/t/compute-core-microbiome/3607/6 "2018-03-30T16:20:42Z")

</div>

Follow up question: previous command in QIIME 1 could run this from the tutorial website [compute\_core\_microbiome.py – Identify the core microbiome. — Homepage](http://qiime.org/scripts/compute_core_microbiome.html)

Identify the core OTUs in otu\_table.biom, defined as the OTUs that are present in all of the samples in the ‘Fast’ treatment (as specified in the mapping file). Write the list of core OTUs to a text file.

compute\_core\_microbiome.py -i otu\_table.biom -o otu\_table\_core\_fast --mapping\_fp map.txt --valid\_states "Treatment:Fast"

I don't see an equivalent in core-features. Is there a way to specify mapping file categories to look at?

---

<div class="post-metadata">

**Author:** ![Mehrbod\_Estaki](https://forum.qiime2.org/user_avatar/forum.qiime2.org/mehrbod_estaki/32/4001_2.png) [@Mehrbod\_Estaki](https://forum.qiime2.org/u/Mehrbod_Estaki)\
**Post date:** [March 30, 2018, 11:56pm UTC](https://forum.qiime2.org/t/compute-core-microbiome/3607/7 "2018-03-30T23:56:37Z")

</div>

Hi @CarlyRae,

This sounds like a handy option to have! Not sure if that is directly available using the `core-features` function yet. While you wait for one of the expert's to confirm that, I can suggest a couple of alternative (though not very graceful) ways to get what you want.

You can create a new feature table with only the samples from the treatment group of interest using the `feature-table filter-samples` function as shown in this tutorial [here](https://docs.qiime2.org/2018.2/tutorials/filtering/#metadata-based-filtering). Once you have that new feature table you can simply run the core features function with whatever fraction setting you need on the new table.

Alternatively, if you are more comfortable with the qiime1 workflow for this option, you can [export](https://docs.qiime2.org/2018.2/tutorials/exporting/?highlight=export) your biom table and carry out those commands in qiime1. The downside to this is if you decide to re-import anything back to qiime2 they will be missing the previous provenance attached to them.

Hope that helps!

---

<div class="post-metadata">

**Author:** ![ebolyen](https://forum.qiime2.org/user_avatar/forum.qiime2.org/ebolyen/32/11_2.png) [@ebolyen](https://forum.qiime2.org/u/ebolyen)\
**Post date:** [April 2, 2018, 3:19pm UTC](https://forum.qiime2.org/t/compute-core-microbiome/3607/8 "2018-04-02T15:19:20Z")

</div>



---

<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:** [April 2, 2018, 7:01pm UTC](https://forum.qiime2.org/t/compute-core-microbiome/3607/9 "2018-04-02T19:01:34Z")

</div>

Thanks @Mehrbod_Estaki - I think your approach is consistent with what I would recommend in this case. @CarlyRae, you could also [`group`](https://docs.qiime2.org/2018.2/plugins/available/feature-table/group/) your feature table using your metadata - YMMV. Let us know how that works out for you! 🦖

---

<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:** [April 2, 2018, 7:01pm UTC](https://forum.qiime2.org/t/compute-core-microbiome/3607/10 "2018-04-02T19:01:37Z")

</div>



---

<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:** [May 4, 2018, 1:01am UTC](https://forum.qiime2.org/t/compute-core-microbiome/3607/11 "2018-05-04T01:01:39Z")

</div>

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