Phylotree Log Requirement
From the first post, we have a user story –What the user wants. As a user with mtDNA results, I would like to know how the named branch is defined in the current Phylotree build and has been in past ones.
What does this mean for an actual tool? What is Phylotree? Why is it important?
Phylotree Background & History
Once long long ago before 2008, the details for individual branches of the maternal tree were part of published academic papers. To research new branches on the tree, you had to keep copies of all relevant papers. It was ever so easy to miss one, and multiple versions of tree sections existed.
This made updating information hard for testing companies and life even harder for the average person who just wanted to understand their results. After all, not everyone wants to learn the details of mtDNA phylogenetics just to learn about their origins.
Dr. Mannis Van Oven addressed this with the Phylotree.org website. He brought together all the different trees and partial trees ever published, and he organized them into a single tree. He then used published sequences to confirm the branches and add new ones. All of the information is sourced and freely available.
Acceptance was not instant or without friction, but eight years and several journal article later, we are all most grateful for his efforts.
After eight years, we are also on the 17th build (version) of the tree. Each version revised definitions of branches, added new ones, removed others, and sometimes changed names. When researching the maternal origins and reviewing published literature, it is important to know when each change took place.
It was easy enough to pull archived versions of the tree from Phylotree to look at old information, but making the information readily available for any one branch in a maintainable way required something more.
- What was the build number used?
- What was the branch called?
- How was it defined?
- When was the build released?
- Was there anything significant about the release?
Building the Phylotree Log
To make the information maintainable, I created another custom post type, Phylotree Branch. Each branch has these fields: Title, Build, Mutations, Notes, and Story.
The first four were to answer the previous questions, but the last is a bit more complex and one of the advantages of working with the Pods framework. Story is a relationship between each new Phylotree Branch entry and an mtDNA Story entry.
Thus, it is possible to add a new set of Phylotree Branches and link them to the right mtDNA Stories when a new build is released.
The next task was getting the information into WordPress. In theory, entry could be done through the WordPress dashboard. However, for the 17 builds of Phylotree, there are a total of 38,865 branches. WordPress is built on a mySQL database. Thus, it is more practical to use the phpMyAdmin interface to the database to directly upload the data records. I will not boor you with the details….
For the initial upload, I matched branch names to story names, which will be true most of the time.
Phylotree Log Display
With data entered, I went back to the Pods template system to display the details. For the Phylotree Log, there are two parts, fetching Phylotree Branches and extending the mtDNA Story template to include Phylotree Log information.
The Phylotree Log is going to show on the page as a table, so I created the Get Phylotree Log template to generate a table.
For it, I used the Pods Templates Before and After codes. In a template, these are codes for areas that are only processed once. The first before the main fetch loop and the other after the main fetch loop. I used the Before for the leading part of the table. Then I requested all the data for the table. Last, I used the After for the ending part of the table.
After saving, it is time to add to the mtDNA Story template. I added a section heading and an introductory paragraph then the shortcode that calls the Get Phylotree Log template.
Now it was time to see how it looked. Here is an example for K, that my friend Bill Hurst says is a most interesting branch.
Done! Well, not really… Remember that I said sometimes branch names have changed? Sometimes that happened in a big way.
Phylotree Quality Assurance
For example, A4a changed into A1.
Thus, finally, I need to do quality assurance on those 38,865 entries. To be continued…