Showing posts with label Raphael. Show all posts
Showing posts with label Raphael. Show all posts

02 January 2013

All Known Great Ape Individuals (Messinian to Present)

Happy 2013, everyone!

Recently I announced a code package I was working on, called Haeckel, for generating vector-based charts related to evolutionary biology. Here's an image I've created using it:

Known Great Ape Individuals
This chart represents all known hominid individuals (Hominidae = great apes, including humans and stem-humans) from the Messinian to the present, erring on the conservative side when the material is too poor to determine the exact number.

If you've been following this blog for a few years you may remember an earlier version of this. I've done a lot of refinement to the data since then. The earlier versions were dissatisfying to me because the horizontal axis was essentially arbitrary. For this version I used matrices from a phylogenetic analysis (Strait and Grine 2004, Table 3 and Appendix C) of craniodental characters to generate a distance matrix, and then inferred positions for other taxa based on phylogenetic proximity and containing clade. This is similar to the metric I used in this chart, except that it incorporates Appendix C, uses inference, and averages distance from humans against distance from [Bornean] orangutans. Don't be mistaken  this is still arbitrary. But it's a bit closer to something real.

Stray notes:
  • I'm pretty sure there are Pliocene stem-orangutans somewhere, right? Might have some work left to do on that data.
  • The dot with no taxon above "Australopithecus" is an indeterminate stem-human from Laetoli. It should probably go further left.
  • The Ardipithecus bubble includes the poorly-known "Australopithecus" praegens. (Although in some runs it moves outside  there's a random element to the plotting.)
  • The Holocene is barely visible up at the top. What a worthless epoch.
  • Homo floresiensis (hobbits) are far to the left of Homo sapiens because I placed them outside Clade(Homo erectus  Homo sapiens).
  • You may recall Lufengpithecus? wushanensis as "Wushan Man", as it was originally placed in Homo erectus. (Hey, it's just teeth.)
  • A couple of fossil chimpanzees, lots of fossil orangutans, but no fossil gorillas. :(
    • (Unless you count Chororapithecus, but that's pre-Messinian. Very pre-Messinian. Suspiciously pre-Messinian....)
  • Look at all that overlap between Homo, Paranthropus, and Australopithecus!
    • I have a feeling, though, that if I added another dimension, Paranthropus and Homo would jut out in opposite directions.
    • Reclassifying Australopithecus sediba as Homo sediba would also decrease the overlap. (Although its position is inferred  actually scoring it might do the same thing.)
    • It's frustrating that the type species of Australopithecus and Paranthropus are also just about the most similar species across the two genera.
  • Kenyanthropus and Praeanthropus have been provisionally sunk into Australopithecus.
  • Should we just sink Orrorin and Sahelanthropus into Ardipithecus? Why not?
  • My guess is that if I added postcranial characters, the stem-humans would all shift right (humanward). Oh, for a good matrix of postcranial characters....
Update
Oh yeah, and if you want a peek at the data, go here.

02 December 2012

Haeckel: A Code Library for Browser-Based Evolutionary Diagrams

For a while now I've been writing posts with diagrams like this one, showing the evolution of cranial capacity in mangani over the past seven million years:


How did I make them? Originally it was all ad-hoc ActionScript code, but more recently I've begun to organize the code into a library and translate it into TypeScript (which, in turn, is automatically translated into JavaScript). Although this library is still in progress, I've decided it's at a stage where I can open it to the general public.

This library includes functionality for:

  • Modeling scientific concepts such as taxa, phylogeny, character states, stratigraphy, and geography.
  • Processing scientific data (notably calculating morphological distance and inferring unknown character states).
  • Rendering data into charts as Scalable Vector Graphics, using RaphaëlJS.
For a while I struggled with what to call this library. It's neither purely about science nor purely about graphics. Finally I got my inspiration from RaphaëlJS, a graphics library named after a great artist. I named my library after a man who was both a great artist and a great biologist:

19 October 2012

RaphaëlJS + TypeScript = RaphaëlTS

RaphaëlJS is a library, written in JavaScript, for creating vector graphics on the web. It's commonly used because it supports all web browsers, including the good ones (which use SVG) and Internet Explorer (which uses VML). Among other things, it's the rendering engine of the ExtJS and Sencha frameworks.

TypeScript is a new web language that extends JavaScript, adding optional strict typing. This is a big improvement on JavaScript because it allows more errors to be caught at compile-time rather than at run-time (for example, if you pass a number to a function that expects an array). However it's not as obnoxious as some strictly-typed languages, because the typing is optional and often implicit.

I've spent some time recently playing around with TypeScript and my verdict: it's wonderful. I only want to use this from now on (at least for large projects). It's a great language, and, since it's an extension (or superset) of JavaScript, all existing JavaScript code works just fine in it. (This is a big advantage it has over Dart, an otherwise excellent language as well.)

But while you can just include a JavaScript library in your TypeScript projects, you don't get the full benefit of the compile-time checking (or the code-hinting) unless that library's entities have been declared. TypeScript allows for ambient declarations: defining or partially defining an entity (class, interface, method, variable, etc.) without actually creating it. As an example (and a very useful one at that), here is a TypeScript declaration file for jQuery: jQuery.d.ts

Today I wondered if anyone had made something like this for RaphaëlJS. I wasn't able to find one, so ... I made one. Here you go: https://bitbucket.org/keesey/raphaelts/src

If you're using the Visual Studio plugin or the TypeScript playground (other editors are bound to come out soon), you can now program type-safe RaphaëlJS code with auto-complete (=IntelliSense).

I've verified that it compiles, but I haven't fully tested it—if anyone experiences issues please let me know. (Or feel free to fork the project).

Hope someone else finds it useful ... I know I will!