Phylogeny Coding (API)

The source code of this site is written in PHP, and the main phylogeny is displayed as a series of nested tables with a repeating background to achieve the phylogeny bars. <table>s are used instead of <div> to make forced, repeated positions and the alignment of various polytomies slightly easier.

Reading this documentation works best with the source code open.


The page also accepts a form of "tagging" for the search function. Inside the function, and inside the quotes, you can use the (X)HTML tag <tt> to insert tags for the search engine to read.

For example, openphylo("Felidae<tt>cat,tiger,lion</tt>") will display "Felidae" as normal on the main page, but searches for "cat", "tiger", or "lion" will still return results.

Using CSS, the contents of the <tt> tag are hidden, but they are still visible to the search engine and will influence search results.

To write code for the page, there are three main constructive elements (functions):

openphylo("NODE");

This element opens a table, spaces it, and places a line out with the name NODE affixed. While openphylo() does NOT need any child elements, since the table is left open, subgroups can be added before using the next element:

closephylo("NODE");

This element uses an angled line to represent a closed / uncontinuable outgroup, consisting of one group or representative named NODE. This element closes the table opened up with openphylo().

However, there are many cases where there is a dichotomous branching that you want to have its own outgroup. For that, the following function is used:

buildendoutgroup("NODE");

Which functions exactly like openphylo() but has the symbolic display of closeoutgroup(). It is used ONLY in conjuction with its companion function

closeoutgroup();

Which closes the elements used for buildendoutgroup(). Note that closeoutgroup() takes no parameters.

You can see all of these in the following image:

Example 1

Here, (1) is a buildendoutgroup() (note the angled symbol), (2) is an openphylo() with no child elements, and (3) and (4) are both closephylo() elements. (1) is closed with a closeoutgroup() function after the closephylo() function is called for Holocephali.

The remaining edge cases are one of the following elements:

singlephylo("NODE");
singleoutgroup("NODE");

Both of these elements only apply when the parent node has a single child, and thus using closephylo() would add a superfluous line. singlephylo() generally occurs when the single child is a relatively precise node, such as family or genus (IE, Sphenodon) and thus closes the <table> tag. singleoutgroup() is very similar, but does not close the <table> element, so it can have nested items below it. singlephylo(), by contrast, can have no child elements. Note this means that singleoutgroup() then requires a closeoutgroup() to end the element.

In the unfortunate but unavoidable case of unresolved phylogenies (polytomies), just insert (after openphylo() but before closephylo()):

buildoutgroup("NODE");

buildoutgroup() can take child elements, such as Phoenicopteriformes (as of 2009-09-13).

To build a collapsable node, inside of the argument for the appropriate element, in place of the node name, use the following function:

cladecollapse("NODE",NUMBER);

Where NODE is the node name as usual, but NUMBER is the numeric identifier of the collapsed region. When submitting, please provide the nummber of the collapse (it is easier for bookkeeping to keep them in order through the page), the first node inside, and the last node inside. These are enclosed in the following code block manually when I accept your submission:

/*** Note Anapsida has a single child in this example, so we use singleoutgroup() here ***/
singleoutgroup(cladecollapse("? Turtles & Tortises (Testudines)",17));
 if ($_REQUEST['17']!="")
 {
   //Items inside the collapse; turtle phylogeny in this case.
 }
closeoutgroup();

Finally, the variable $extinct is used to place the dagger to indicate an extinct lineage. If you use a node that has no organizational name, please use "(Unnamed)" (including case) to label it. This will ensure it is displayed properly.