Continuing from my last post about building the Encyclopedia of mtDNA Origins… I have been working on the part that shows the current and historic definitions of a branch under Phylotree.

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.

Encyclopedia of mtDNA Origins - Phylotree

Encyclopedia of mtDNA Origins – Phylotree

What does this mean for an actual tool? What is Phylotree? Why is it important?

Phylotree Background & History

Mona Lisas and Mad Hatters
While Mona Lisas and Mad Hatters
Sons of bankers, sons of lawyers
Turn around and say good morning to the night
For unless they see the sky
But they can’t and that is why
They know not if it’s dark outside or light – Bernie Taupin

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 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.

mtDNA Phylogenetics Cup of Tea

mtDNA Phylogenetics is not everyone’s cup of tea.

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.

Encyclopedia of mtDNA Origins - phylotree_branches

Encyclopedia of mtDNA Origins – The phylotree_branch Post Type

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.

Encyclopedia of mtDNA Origins - Story Relationship

Encyclopedia of mtDNA Origins – Story Relationship

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.

Encyclopedia of mtDNA Origins - Phylotree Branch Entries

Encyclopedia of mtDNA Origins – Phylotree Branch Entries

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.

Encyclopedia of mtDNA Origins - Get Phylotree Log Template

Encyclopedia of mtDNA Origins – Get Phylotree Log Template

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.

Encyclopedia of mtDNA Origins - Add Phylotree Log to mtDNA Story Template

Encyclopedia of mtDNA Origins – Add Phylotree Log to mtDNA Story 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.

Encyclopedia of mtDNA Origins - Add Phylotree Log on Page

Encyclopedia of mtDNA Origins – Add Phylotree Log on Page

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.

Encyclopedia of mtDNA Origins - Add Phylotree Log A4a to A1

Encyclopedia of mtDNA Origins – Add Phylotree Log A4a to A1

Thus, finally, I need to do quality assurance on those 38,865 entries. To be continued…