Materials from the R workshop at #AAPA2016

For last week’s AAPA conference, my friend and colleague David Pappano organized a workshop teaching about the many uses of the R programming language for biological anthropology (I’m listed as co-organizer, but really David did everything). After introducing the basics, we broke into small groups focusing on specific aspects of using R. I devised some lessons for basic statistics, writing functions, and resampling. Since each of the lessons could have easily taken up an hour and most people didn’t get to go through the activities fully, I’m posting up the R codes here for people to mess around with.

The basic stats lesson utilized Francis Galton’s height data for hundreds of families, courtesy of Dr. Ryan Raaum. To load in these data you just need to type into R: galton = read.csv(url(“http://bit.ly/galtondata“)). The code simply shows how to do basic statistics that are built into R, such as  t-test and linear regression.

Example of some summary stats for the Galton height data.

Some summary stats for the Galton  data. The code is in blue and the output in black.

Here is the Basic Stats code, download and paste it into an R file, then buckle up!

The lesson on functions and resampling was based on limb length data for apes, fossil hominins and modern humans (from Dr. Herman Pontzer). The csv file with the data can be downloaded from David’s website. R has lots of great built-in functions (see basic stats, above), and even if you’re looking to do something more than the basics, chances are you can find what you’re looking for in one of the myriad packages that researchers have developed and published over the years. But sometimes it’s necessary to write a function on your own, and with fossil samples you may find yourself needing to do resampling with a specific function or test statistic.

For example, you can ask whether a small sample of “anatomically modern” fossil humans (n=12) truly differs in femur length from a small sample of Neandertals (n=9). Traditional statistics require certain assumptions about the size and distribution of the data, which fossils fail to meet. Another way to ask the question is, “If the two groups come from the same distribution (e.g. population), would random samples of sizes n=12 and n=9 have so great an average difference as we see between the fossil samples?” A permutation test, shuffling the group membership of the fossils and then calculating the difference between the new “group” means, allows you to quickly and easily ask this question:

R code for a simple permutation test.

R code for a simple permutation test. The built-in function “sample()” is your best friend.

Although simply viewing the data suggests the two groups are different (boxplot on the left, below), the permutation test confirms that there is a very low probability of sampling so great a difference as is seen between the two fossil samples.

Left: Femur lengths of anatomically modern humans (AMH) and Neandertals. Right: distribution of resampled group differences. Dashed lines bracket 95% of the resampled distribution, and the red line is the observed difference between AMH and Neandertal femur lengths. Only about 1% of the resampled differences are as great as the observed fossil difference.

Left: Femur lengths of anatomically modern humans (AMH) and Neandertals. Right: distribution of resampled group differences. Dashed lines bracket 95% of the resampled distribution, and the red line is the observed difference between AMH and Neandertal femur lengths. Only about 1% of the resampled differences are as great as the observed fossil difference.

Here’s the code for the functions & resampling lesson. There are a bunch of examples of different resampling tests, way more than we possibly could’ve done in the brief time for the workshop. It’s posted here so you can wade through it yourself, it should keep you busy for a while if you’re new to R. Good luck!

R workshop at #AAPA2016

The 85th annual meeting of the American Association of Physical Anthropologists, in Hottlanta this year, is only a few short weeks away. The preliminary program is up, and there’s really a lot to look forward to at this year’s conference. There’s a session dedicated to Homo naledi on Saturday morning (16 April), and I’ll be presenting on dental development in Homo naledi at the very end of the last session of the day. Leading up to the conference, I’ll be tweeting teasers as I put together my talk.

My colleague David Pappano and I are also organizing a workshop on using R in biological anthropology, which will take place on Friday 15 April from 9:30-11:30 am. The goal of the workshop isn’t to make you an expert in R by the end of the two short hours, but rather to introduce you to the basic functions and potential uses of the powerful, free statistical software. So if you’Re Ready to leaRn some R basics, come to Room A601 on FRiday moRning – it’s fRee and no RegistRation is RequiRed.

Hopefully we’ll see you in Atlanta in a few weeks!

mtDNA sucks for inferring hominin relationships

Ancient DNA studies keep on delivering awesome findings about human evolution. Continuing this trend, Matthias Meyer and colleagues report today in Nature nuclear DNA (nDNA) sequenced from  ~430,000 year old humans from the Sima de los Huesos (SH) site in Spain. SH is badass not only because the name translates as “pit of bones,” but also because the pit has yielded hordes of fossils comprising at least 28 people (Bermudez de Castro et al., 2004), and some of these bones preserve the oldest human DNA yet recovered (Meyer et al., 2013).

Point 1 in Northern Spain, is Sima de los Huesos. The rest of the points are other sites where hominin fossils preserve ancient DNA. Figure 1. From Meyer et al. 2013.

Point 1 in Northern Spain, is Sima de los Huesos. The rest of the points are other sites where hominin fossils preserve ancient DNA. Figure 1. From Meyer et al. 2013.

Anatomically, the SH hominins have been interpreted as “pre-Neandertals,” having many, but not all, of the characteristics of geologically younger fossils we know as Neandertals. Mitochondrial DNA (mtDNA) obtained from one of the SH femurs was found, surprisingly,to be more similar to Densivan than to Neandertal mtDNA (Meyer et al., 2013), not what would be expected if the SH hominins were early members of the Neandertal lineage. Meyer et al. interpreted this to mean that perhaps the SH hominins were ancestral to both Neandertals and Denisovans, though they noted that nDNA would be necessary to uncover the true relationships between these fossil groups.

Writing about the SH mtDNA in 2013, I noted that mtDNA has failed to reflect hominin relationships before. The distinctiveness of Denisovan mtDNA initially led to the idea that they branched off before the Neandertal-modern human population divergence (Kraus et al. 2010), and therefore that humans and Neandertals formed a clade. Later, nDNA proved Denisovans and Neandertals to be more closely related to one another than to humans (Reich et al., 2010). Then I’m all like, “Hopefully we’ll be able to get human nuclear DNA from Sima de los Huesos. When we do, I predict we’ll see the same kind of twist as with the Denisova DNA, with SH being more similar to Neandertals.”

I made that prediction right before telling Josh Baskin he’d be big.

And lo, Meyer et al. (2016) managed to wring a little bit more DNA out of this sample, and what do they find: “nuclear DNA sequences from two specimens … show that the Sima de los Huesos hominins were related to Neandertals rather than Denisovans” (from the paper abstract).

This is not a surprising outcome. The SH hominins look like Neandertals, and mtDNA acts a single genetic locus – the gene tree is unlikely to reflect the species tree. What’s more, this is similar to the story mtDNA told about human and Neandertal admixture. The lack of Neandertal mtDNA in any living (or fossil) humans was taken to reflect a lack of admixture between early humans and derelict Neandertals, but more recent nDNA analysis have clearly shown that our ancestors couldn’t help but become overcome with lust at the sight of Neandertals (and Denisovans) in Eurasia.

So here ancient DNA corroborates the anatomy that suggested the SH hominins were early members of the Neandertal lineage. This new study also raises the question as to what’s going on with mtDNA lineages – Meyer et al. suggest that the SH mtDNA was characteristic of early Neandertals, later to be replaced by the mtDNA lineage possessed by known Neandertals. They suggest an African origin for this new mtDNA, though I don’t see what that has to be the case. It also raises the question whether the difference in early (SH) vs. later Neandertal mtDNA reflects local population turnover/replacement, or a selective sweep of an adaptive mtDNA variant. Either way, Meyer et al. have done a remarkable job of making astounding discoveries from highly degraded, very short bits of super old DNA. I can’t wait to see what ancient DNA surprises are yet to come.

ResearchBlogging.orgReferences
Bermudez de Castro, JM., Martinón-Torres, M., Lozano, M., Sarmiento, S., & Muela, A. (2004). Paleodemography of the Atapuerca: Sima De Los Huesos Hominin Sample: A Revision and New Approaches to the Paleodemography of the European Middle Pleistocene Population Journal of Anthropological Research, 60 (1), 5-26 DOI: 10.1086/jar.60.1.3631006

Krause, J., Fu, Q., Good, J., Viola, B., Shunkov, M., Derevianko, A., & Pääbo, S. (2010). The complete mitochondrial DNA genome of an unknown hominin from southern Siberia Nature, 464 (7290), 894-897 DOI: 10.1038/nature08976

Meyer, M., Fu, Q., Aximu-Petri, A., Glocke, I., Nickel, B., Arsuaga, J., Martínez, I., Gracia, A., de Castro, J., Carbonell, E., & Pääbo, S. (2013). A mitochondrial genome sequence of a hominin from Sima de los Huesos Nature, 505 (7483), 403-406 DOI: 10.1038/nature12788

Meyer, M., Arsuaga, J., de Filippo, C., Nagel, S., Aximu-Petri, A., Nickel, B., Martínez, I., Gracia, A., de Castro, J., Carbonell, E., Viola, B., Kelso, J., Prüfer, K., & Pääbo, S. (2016). Nuclear DNA sequences from the Middle Pleistocene Sima de los Huesos hominins Nature DOI: 10.1038/nature17405

Reich, D., Green, R., Kircher, M., Krause, J., Patterson, N., Durand, E., Viola, B., Briggs, A., Stenzel, U., Johnson, P., Maricic, T., Good, J., Marques-Bonet, T., Alkan, C., Fu, Q., Mallick, S., Li, H., Meyer, M., Eichler, E., Stoneking, M., Richards, M., Talamo, S., Shunkov, M., Derevianko, A., Hublin, J., Kelso, J., Slatkin, M., & Pääbo, S. (2010). Genetic history of an archaic hominin group from Denisova Cave in Siberia Nature, 468 (7327), 1053-1060 DOI: 10.1038/nature09710

Sunday mornings

Usually I use my PowerPoint skills only for evil, like putting together lectures and talks. But sometimes I get distracted. Today, for instance, instead of grading and prepping next week’s lectures on Eugenics and Spine Evo-devo (don’t worry, they’re for different classes), I spent half an hour making this:

A spirited twist on Jane Austen's classic novel.

A spirited twist on Jane Austen’s classic novel. Why am I devoting my life to research and teaching when I could go to where the real money is?

This is surely the project that will land me tenure in a few years.

Osteology Everywhere: Cakes or canines?

I’ve been looking at so many teeth lately, I’m starting to feel like a sadist but with newer magazines.

Between putting together a talk about dental development in Homo naledi and teaching teeth in my human evo-devo class last week . . .

After these drawings, my students were fully trained and ready to tackle the odontological world.

After these drawings, my students are now fully trained and ready to tackle the odontological world.

. . . I’ve got dentition on the brain. WHICH IS NOT THEIR ANATOMICAL POSITION.

So last weekend some friends and I hit a local pub,  a life jacket for my dental inundation. Surely, a pint and a snack will expunge enamel, dissolve dentine, exhume zuby from my brain! We ordered some beer and baursaki, delicious fried bread made out here in Kazakhstan, the perfect snack to go with beer and chechil. Tearing into the pastry, I started to feel at peace, but then was horrified to look down and find myself hoist with my own petard:

Baursak or bite?

Baursak with a bite taken out? Our a hominin canine?

Seeing the snack, I saw the very thing I’d been fleeing – a hominin canine tooth. Inadvertently, I’d almost exactly replicated Sts 50, a lower left canine crown and broken root from the South African site of Sterkfontein.

Left: Sts 50, lower left canine. Right: bitten fried bread. Images not to scale.

Left: Sts 50, lower left canine. Right: bitten fried bread. Images not to scale. ANTIMERES?

They’re nearly identical but from opposite sides (the fancy word for which is “antimeres”). Note the tall-shouldered, sharp apex of the crown, and the little distal tubercle, the little ‘bump’ at the far left in the left picture above. The mesial, or front, crown shoulder is notably taller than the distal tubercle. At probably around 3 million years ago, Sts 50 likely belongs to Australopithecus africanus, and retains an ape-like asymmetrical crown shape compared to the more incisor-shaped canines we humans have today.

Left to right: Homo baursaki, three South African canines, and a modern human (from White et al. 2012). Images not to scale.

Hominin canines and definitely no cakes. Left to right: Homo baursaki, three canines from early Pleistocene South Africa, and a modern human (from White et al. 2011). Images not to scale. Note how much less asymmetrical the modern human canine crown (far right) is compared to the fossil hominins. Teeth 1, 2, 4, and 5 are from the right side while the center, Sts 50, is from the left.

 

Apparently all you need to go back in time is some beer and baursaki.

Bioanthro Lab Activity: Chimpanzee Developmental Osteology

We’ve just done the first lab activity in my Human Evo Devo course. My current university is young, and so we haven’t yet acquired good skeletal materials for teaching. Fortunately, the good people at Kyoto University’s Primate Research Institute have made a large, open access database of primate CT scans. For this first lab, students compare skeletons of neonate and adult chimpanzees, getting a crash-course in osteology, CT data, growth-related changes,  and chimps.

Screen Shot 2016-02-12 at 10.56.48 AM

Neonatal chimpanzee. Three windows give 2D slices in anatomical planes, while the 4th window contains the reconstructed 3D volume that can be rotated and analyzed.

The activity requires a computer lab with the freeware CT analysis program InVesalius. CT files (dicom stacks) can be downloaded from the KUPRI database, but they are massive (100s of MBs), so I recommend some preprocessing before starting the class. I downloaded the specimens we were to use, opened each one in InVesalius, and saved as an .inv3 file. These are on the order of 50-80 Mb each. With smaller, prepared files, it’s faster and easier for students to download and start using them. While the neonate skeleton was small enough to fit into a single dicom stack, the adult scans were so large that I had to use separate files for the the skull, scapula, pelvis, and limbs (pre-separated on the KUPRI database).

Students examined one neonate and adult, making qualitative observations and taking a few cranial and postcranial measurements on each individual.

Screen Shot 2016-02-12 at 11.06.15 AM

It’s pretty easy to take linear and angular measurements on both the 3D volume and the 2D slices in InVesalius.

One goal of the assignment is to show students how bones change with growth, in terms of both gross anatomy and overall size. By measuring the diaphyseal lengths, they see what limb bones look like with and without epiphyses.

Picture1

Measuring diaphyseal, rather than maximum, lengths. Left figure from Jungers and Susman (1984).

Students examine how much size change occurs between birth and adulthood in chimpanzees. They then compare these skeletal sizes and proportional changes with comparable human data (well, up to age 12), taken from Scheuer and Black (2000). This will help get them started thinking about how postnatal growth might lead to differences between adults of each species, or how developmental modifications effect evolutionary changes.

Here’s the lab activity handout in case you want to use it in your own class: Lab 1 Handout-Chimp Development.

ResearchBlogging.orgReferences

Scheuer L and Black L. 2000. Developmental Juvenile Osteology. Academic Press.

Jungers WL and Susman RL. (1984). Body size and skeletal allometry in African Apes. The Pygmy Chimpanzee: Evolutionary Biology and Behavior, 131-177 DOI: 10.1007/978-1-4757-0082-4_7

Osteology Everywhere: Vertebral Incidens

Try as I might, I can never escape osteology. Never. Just the other day, I was walking through my school’s expansive, boneless atrium, when these haphazardly scattered letters stopped me in my tracks:

2016-02-09 16.26.31

DЯSTUDENSN

Amidst this alphabet soup, there it was, calling out to me. Whispering. Longing….

Untitled

Ah, the dens. What is the “dens” you ask? It is a special little projection on a special little bone, the second cervical vertebra (C2). Why is it special? Well, most vertebrae look pretty similar to one another, with a body in the front being held in awkward embrace by a bony neural arch in the back.

 

But not the first two vertebrae, C1 and C2. No, these rebels are spinal celebrities. C1, whose rock name is “Atlas” (presumably in honor of its favorite episode of Wishbone) cradles the skull’s occipital condyles on its concave shoulders. Lacking a true body or centrum, Atlas viewed from the top resembles the gaping maw of a manta ray:

Top: Manta ray. Bottom: Atlas viewed from top, anterior is on the bottom (from Scheuer and Black, 200). A and F refer to the age at which the bony portions appear and fuse, respectively.

Top: Manta ray. Bottom: Atlas viewed from top, anterior is on the bottom (from Scheuer and Black, 2000). A and F refer to the age at which the bony portions appear and fuse, respectively.

Atlas is a jerk and so it sits right on top of C2, whose rock name is Axis (after the second album by the Jimi Hendrix Experience). More gawky and angsty than Atlas, Axis differs from the rest of the vertebrae in having an extension, the dens, which reaches skyward to boop the inside of Atlas’ maw:

Top: Axis viewed from the front. Bottom: Axis getting pwnd by Atlas. Modified from White et al. 2012.

Top: Axis viewed from the front. Bottom: Axis getting pwnd by Atlas. Modified from White et al. (2012).

The most distinctive feature of Axis, aside from its smoldering adolescent rage, is the dens (or odontoid process). If you find a bone fragment that is verily vertebral and has a perpendicular projection, you can bet good tenge you’ve got an Axis. Even a densless fragment can be distinguished from all other vertebrae by its superior articular facets, which are rather flat and face mostly superiorly.

What I thought would be a casual jaunt after class last week turned out to be a horrific reminder of the most amazing vertebrae. This must be  how Scott Williams always feels.