# Can you collapse a detail tax.summary file to simple format

**URL:** https://forum.mothur.org/t/can-you-collapse-a-detail-tax-summary-file-to-simple-format/20547
**Category:** Commands in mothur
**Created:** [May 30, 2020, 2:58pm UTC](https://forum.mothur.org/t/can-you-collapse-a-detail-tax-summary-file-to-simple-format/20547 "2020-05-30T14:58:02Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![mkoch1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@mkoch1](https://forum.mothur.org/u/mkoch1)
#### Post date: [May 30, 2020, 2:58pm UTC](https://forum.mothur.org/t/can-you-collapse-a-detail-tax-summary-file-to-simple-format/20547/1 "2020-05-30T14:58:02Z")

</div>

Hi there,

Just wondering if there’s a command that will allow me to change my tax.summary file from detail to simple format without re-classifying the sequences. What I’m actually trying to do it get a simple format tax.summary file after using merge.taxsummary. I could use tax.summary on the individual taxonomy files again, but then merge.taxsummary only works on detail formatted tax.summary files. Just wondering if there’s a way I can merge all my tax.summaries and then collapse the tax.summary file after merging them.

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: [June 2, 2020, 12:32pm UTC](https://forum.mothur.org/t/can-you-collapse-a-detail-tax-summary-file-to-simple-format/20547/2 "2020-06-02T12:32:35Z")

</div>

Hi - do you mean something like [summary.tax](https://mothur.org/wiki/summary.tax/)?

Pat

---

<div class="post-metadata">

### Author: ![mkoch1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@mkoch1](https://forum.mothur.org/u/mkoch1)
#### Post date: [June 2, 2020, 3:53pm UTC](https://forum.mothur.org/t/can-you-collapse-a-detail-tax-summary-file-to-simple-format/20547/3 "2020-06-02T15:53:36Z")

</div>

Hi,

Ideally yes, but summary.tax doesn’t seem to work on a tax.summary file, only a taxonomy file. The merge.taxsummary output file can only be output in a detail format, but then I’m trying to get that tax.summary into simple format.

Thanks.

---

<div class="post-metadata">

### Author: ![Kendra](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.mothur.org/kendra/32/112_2.png) [@Kendra](https://forum.mothur.org/u/Kendra)
#### Post date: [June 3, 2020, 5:32pm UTC](https://forum.mothur.org/t/can-you-collapse-a-detail-tax-summary-file-to-simple-format/20547/4 "2020-06-03T17:32:56Z")

</div>

can you give an example of what you want? simple format can mean pretty much anything.

---

<div class="post-metadata">

### Author: ![mkoch1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@mkoch1](https://forum.mothur.org/u/mkoch1)
#### Post date: [June 4, 2020, 8:34pm UTC](https://forum.mothur.org/t/can-you-collapse-a-detail-tax-summary-file-to-simple-format/20547/5 "2020-06-04T20:34:55Z")

</div>

Hi Kendra,

Yep sure. Essentially I want to change a tax.summary file that looks like this:

| taxlevel | rankID | taxon | daughterlevels | total |
| --- | --- | --- | --- | --- |
| 0 | 0 | Root | 1 | 1882862 |
| 1 | 0.1 | Bacteria | 54 | 1882862 |
| 2 | 0.1.1 | 10bav-F6 | 1 | 35 |
| 3 | 0.1.1.1 | 10bav-F6\_cl | 1 | 35 |
| 4 | 0.1.1.1.1 | 10bav-F6\_or | 1 | 35 |
| 5 | 0.1.1.1.1.1 | 10bav-F6\_fa | 1 | 35 |
| 6 | 0.1.1.1.1.1.1 | 10bav-F6\_ge | 0 | 35 |

to look like this:

| taxlevel | rankID | taxon | daughterlevels | total |
| --- | --- | --- | --- | --- |
| taxonomy | total | L32B7 | | |
| Root | 110 | 110 | | |
| Bacteria;Actinobacteriota;Acidimicrobiia;Acidimicrobiia\_unclassified;Acidimicrobiia\_unclassified;Acidimicrobiia\_unclassified; | 1 | 1 | | |
| Bacteria;Actinobacteriota;Actinobacteria;Actinobacteria\_unclassified;Actinobacteria\_unclassified;Actinobacteria\_unclassified; | 35 | 35 | | |
| Bacteria;Actinobacteriota;Actinobacteria;Micrococcales;Micrococcaceae;Micrococcaceae\_unclassified; | 2 | 2 | | |
| Bacteria;Actinobacteriota;Actinobacteria;Propionibacteriales;Propionibacteriaceae;Cutibacterium; | 9 | 9 | | |

I know the taxon names don’t match in the two examples but they’re just copy/pasted from two separate files as examples. The first is a tax.summary file outputted from merge.taxsummary and the second is a tax.summary file outputted from classify.seqs. I know I could classify.seqs all my samples together and then the tax.summary would be outputted in my preferred format for that. But for samples/fasta that were processed separately, if you want to compare the relative abundance of each taxon between those samples (using merge.taxsummary), then the output comes out as the first example.  
The reason I ask is that it’s so much easier getting the second example format into an excel sheet for phyloseq/downstream R analysis (pretty much copy/paste)! Seems like a lot to re-classify all the seqs again which can take a while.

Thanks for the replies hope this makes sense. 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: [June 5, 2020, 11:33am UTC](https://forum.mothur.org/t/can-you-collapse-a-detail-tax-summary-file-to-simple-format/20547/6 "2020-06-05T11:33:00Z")

</div>

I’m confused. Why are you going through the summary file rather than through the \*.taxonomy or \*cons.taxonomy files? I’m not sure what’s in your second table that isn’t in those files.

Pat

---

<div class="post-metadata">

### Author: ![Kendra](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.mothur.org/kendra/32/112_2.png) [@Kendra](https://forum.mothur.org/u/Kendra)
#### Post date: [June 9, 2020, 8:36pm UTC](https://forum.mothur.org/t/can-you-collapse-a-detail-tax-summary-file-to-simple-format/20547/7 "2020-06-09T20:36:14Z")

</div>

Agree with Pat (though I don’t use phyloseq so not sure on the format required) but it seems like you just want to use the .taxonomy file. The point of the tax.summary (in my opinion) is to show the nestedness

---

<div class="post-metadata">

### Author: ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.mothur.org/system/32/2_2.png) [@system](https://forum.mothur.org/u/system)
#### Post date: [June 19, 2020, 8:36pm UTC](https://forum.mothur.org/t/can-you-collapse-a-detail-tax-summary-file-to-simple-format/20547/8 "2020-06-19T20:36:21Z")

</div>

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