# Sorting of taxa in Taxon tree

**URL:** <https://speciforum.org/t/sorting-of-taxa-in-taxon-tree/2240>\
**Category:** New Feature Requests\
**Created:** [January 7, 2025, 1:00pm UTC](https://speciforum.org/t/sorting-of-taxa-in-taxon-tree/2240 "2025-01-07T13:00:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![NielsKlazenga](https://avatars.discourse-cdn.com/v4/letter/n/47e85d/32.png) [@NielsKlazenga](https://speciforum.org/u/NielsKlazenga)\
**Post date:** [January 7, 2025, 1:00pm UTC](https://speciforum.org/t/sorting-of-taxa-in-taxon-tree/2240/1 "2025-01-07T13:00:30Z")

</div>

I have been doing a lot of mucking around in our Taxon tree in the last few weeks and yesterday I added just under 10,000 new (to our database) taxa of Fungi to the Taxon tree. The classification of Fungi is very incomplete and there are many taxa with missing intermediate main ranks in their higher classification. In the past, I have been using ‘Incertae sedis’ placeholders, but they make it a pain to work with the data and it turns out that Specify does not need them, even when the missing ranks are required. So, I have not added them for the taxa I added yesterday, and today I took out the placeholders that had been added earlier. The tree structure has become a lot clearer without the placeholders.

In Specify 6, tree elements are sorted by `NodeNumber`, which I can influence, so in Specify 6 the tree looks nice and clean and like I think it should look (mind you, a ‘Repair tree’ job might scramble the children again):

 ![image](https://canada1.discourse-cdn.com/flex029/uploads/specifysoftware/original/2X/a/a17d08f9625e4f61368c6c9cb7df1d621a0c67da.png)

However, Specify 7 does not use `NodeNumber`, but sorts the children of a parent alphabetically by `Name` only. So, in Specify 7, a branch with missing intermediate ranks looks a bit messier:

 ![image](https://canada1.discourse-cdn.com/flex029/uploads/specifysoftware/original/2X/c/c8f58ae65f84ab7c22103ae3a4dfde3a6d0e2c31.jpeg)

It’s a small thing, but is there any chance we can get Specify 7 to sort children of a parent by `RankID` first and then by `Name`?

---

<div class="post-metadata">

**Author:** ![Grant](https://yyz1.discourse-cdn.com/flex029/user_avatar/speciforum.org/grant/32/4255_2.png) [@Grant](https://speciforum.org/u/Grant)\
**Post date:** [January 8, 2025, 1:53pm UTC](https://speciforum.org/t/sorting-of-taxa-in-taxon-tree/2240/2 "2025-01-08T13:53:06Z")

</div>

Hi @NielsKlazenga,

I’ve created an enhancement request to track this:

> <https://github.com/specify/specify7/issues/6043>
>
> \*\*Is your feature request related to a problem? Please describe.\*\*  
> I would li…ke Specify 7 to sort the children of a parent by RankID first and then by Name, instead of only sorting alphabetically by Name. This would enhance the organization of the Taxon tree, since it is currently \*\*only\*\* ordered alphabetically and cannot be configured.
> 
> \*\*Requirements\*\*
> 1. New user preference enabling the user to pick how they want the tree ordered
> 2. Order by \`Name\`, \`Node Number\`, or \`Rank ID\`
> 
> \*\*Describe alternatives you've considered\*\*  
> Currently, Specify 6 allows sorting by \`NodeNumber\`, which offers a clearer tree structure. However, this sorting method is not available in Specify 7.
> 
> \*\*Reported By\*\*  
> Niels at the Royal Botanic Gardens Victoria
> 
> \*\*Additional context\*\*  
> The current alphabetical sorting in Specify 7 leads to a disorganized appearance for branches with missing intermediate ranks.
> 
> !\[image\](https://github.com/user-attachments/assets/7bc73090-34e8-4bed-be74-523eba2b00ea)
> 
> !\[image\](https://github.com/user-attachments/assets/43d2215b-d5ff-4f45-b8bf-9fe69792bbf7)

Thank you for reaching out!

---

<div class="post-metadata">

**Author:** ![NielsKlazenga](https://avatars.discourse-cdn.com/v4/letter/n/47e85d/32.png) [@NielsKlazenga](https://speciforum.org/u/NielsKlazenga)\
**Post date:** [January 9, 2025, 12:14am UTC](https://speciforum.org/t/sorting-of-taxa-in-taxon-tree/2240/3 "2025-01-09T00:14:23Z")

</div>

Thanks Grant!

---

<div class="post-metadata">

**Author:** ![Grant](https://yyz1.discourse-cdn.com/flex029/user_avatar/speciforum.org/grant/32/4255_2.png) [@Grant](https://speciforum.org/u/Grant)\
**Post date:** [January 13, 2025, 4:15pm UTC](https://speciforum.org/t/sorting-of-taxa-in-taxon-tree/2240/4 "2025-01-13T16:15:03Z")

</div>

Hi @NielsKlazenga et al.,

I have great news. This functionality will be included in the next Specify 7 release!

**Before**

 ![image](https://canada1.discourse-cdn.com/flex029/uploads/specifysoftware/original/2X/1/13234598ae368cc8cea3a912462c4779076695ed.jpeg)

**After**

 ![image](https://canada1.discourse-cdn.com/flex029/uploads/specifysoftware/original/2X/b/bada382049233c9047121160b2c513725c2aa100.jpeg)

The sorting behavior will be customizable via User Preferences between ‘Rank ID’ (default), ‘Name’, ‘Full Name’, and ‘Node Number’.

 ![Order By](https://canada1.discourse-cdn.com/flex029/uploads/specifysoftware/original/2X/7/7706e4d966e775d3028f5c68934be65c161b0c36.png)

Thank you for making this request. We hope you and others will find this to be a significant improvement when working with trees in Specify!

---

<div class="post-metadata">

**Author:** ![NielsKlazenga](https://avatars.discourse-cdn.com/v4/letter/n/47e85d/32.png) [@NielsKlazenga](https://speciforum.org/u/NielsKlazenga)\
**Post date:** [January 14, 2025, 2:34am UTC](https://speciforum.org/t/sorting-of-taxa-in-taxon-tree/2240/5 "2025-01-14T02:34:18Z")

</div>

Thanks @Grant, that is good news.
