Lawrence Slobodkin: Trophic Pioneer

I just learned that Lawrence Slobodkin passed away last week. Slobodkin was one of the authors of the infamous HSS paper in 1960 that has shaped how we think of the role of predators in ecosystems for decades. Indeed, it is one of the very origins of the modern concept of trophic cascades. More than that, though, this was a man with broad ranging interests in biology. I think the New York Times Obit has some interesting points about his contribution to our understanding of the world, and includes this quote from Slobodkin:

Sometimes I chose research problems for their presumed importance, but often I was attracted by their beauty. My research and that of most of my friends is not a story of triumph but rather of fascination by nature.

A good model for us all.

Sea Stars on Acid

ResearchBlogging.org

As an ecologist working in temperate climes, I’ve been following the ocean acidification field with some interest. It’s always been obvious to me how acidification has enormous ramifications for coral reefs and other tropical marine ecosystems. They exist in warm waters already, often close to their thermal maxima. Acidifying the water around them at any creatures using calcium carbonate seems like a recipe for disaster.

How not to do acidification research on Pacific salmon.  Photo from <a href='http://www.simpledailyrecipes.com'>simple daily recipes</a>.

How not to do acidification research on Pacific salmon. Photo from simple daily recipes.

But what about up north in colder climes? There, what is the relative importance of acidification versus changes in temperature? Do changes in physiological rates due to warming compensate for costs of acidification due to CO2 increase? This is particularly interesting along the Pacific Coast of North America, as in many regions, upwelling already drives annual fluctuations in pH – sometimes to levels not predicted to be widespread until 2050 (Feeley et al 2005 Science).

The recent paper by Gooding, Harley, and Tang in PNAS puts an interesting spin on this. Their work shows that, under scenarios where both temperature and CO2 increase, the feeding and growth rates of sea stars actually increases.

Sadly, some folk in the non-science world seem to be taking this as evidence that either global warming is a lie, or will make the world a shiny happier place. The real answer is far from it.

The truth lies in the fact that the sea stars used here don’t have a ton of calcified body parts. Indeed, they may just be compensating with more wet tissue mass, although this currently remains unclear.

With respect to organisms that rely on calcified skeletons (e.g., sea urchins) we know that their larvae floating about in the ocean will react more poorly than expected to increased heat stress if they grow up in a high CO2 world (O’Donnell, Hammond, and Hoffman 2009 Marine Biology). And if hard-bodied prey (i.e. mussels) react more poorly to acidification than they gain from increased physiological rates due to heightened temperature, things get tricky. The particular sea star studied here, Pisaster ochraceus, for example, is already a voracious consumer of hard bodied prey. If it gets a boost while it’s prey is weakened, the consequences could be quite large.

The future of the intertidal?  Image modified from <a href='http://www.marinebio.net/marinescience/03ecology/tpmid.htm'>marinebio.net</a>.

The future of the intertidal? Image modified from marinebio.net.

I do wonder if there is hope, though. If in some regions there are already regular pulses of acidified waters, one would guess that organisms possess some machinery for dealing with this annual event. While they may not possess adaptations that allow them to deal with long-term acidification – not yet – perhaps these may serve as Gould’s Spandrels. While on average calcifying organisms may not perform well underacidified conditions – even with a boost from temperature – one wonders if the raw genetic variation is out there waiting to be tapped. A hopeful thought for some grim research.

Gooding, R., Harley, C., & Tang, E. (2009). Elevated water temperature and carbon dioxide concentration increase the growth of a keystone echinoderm Proceedings of the National Academy of Sciences, 106 (23), 9316-9321 DOI: 10.1073/pnas.0811143106

Let’s All Go Down to the Barplot!

I’m back for another pean to ANOVA-loving experimental ecology. Barplots (or point-range plots – but which is better is a discussion for a different time) are the thing! And a friend of mine was recently asking me how to do a decent barplot with ggplot2 for data of moderate complexity (e.g., a 2-way ANOVA).

So I tried it.

And then I hit my head against a wall for a little while.

And then I think I figured it out, so, I figured I’d post it so that there is less head-smashing in the world.

To do a boxplot is simple. And may statisticians would argue that they are more informative, so, really, we should abandon barplots. Take the following example which looks at the highway milage of cars of various classes in two years.

library(ggplot2)
data(mpg)

#a simple qplot with a boxplot geometry - n.b., I like the bw theme
qplot(class, hwy, fill=factor(year), data=mpg, geom="boxplot", position="dodge")+theme_bw()

A few notes. The x-axis her is class. The fill attribute splits things by year (which is continuous, so we need to make it look like a factor). And the final position=”dodge” really is the key. It splits the bars for different years apart, and it shall come into play again in a moment.

This code produces a perfectly nice boxplot:

Lovely! Unless you want a barplot. For this, two things must happen. First, you need to get the average and standard error values that you desire. I do this using ddply (natch). Second, you’ll need to add in some error bars using geom_errorbar. In your geom_errorbar, you’ll need to invoke the position statement again.

#create a data frame with averages and standard deviations
hwy.avg<-ddply(mpg, c("class", "year"), function(df)
return(c(hwy.avg=mean(df$hwy), hwy.sd=sd(df$hwy))))

#create the barplot component
avg.plot<-qplot(class, hwy.avg, fill=factor(year), data=hwy.avg, geom="bar", position="dodge")

#add error bars
avg.plot+geom_errorbar(aes(ymax=hwy.avg+hwy.sd, ymin=hwy.avg-hwy.sd), position="dodge")+theme_bw()

This produces a perfectly serviceable and easily intelligible boxplot. Only. Only... well, it's time for a confession.

I hate the whiskers on error bars. Those weird horizontal things, they make my stomach uneasy. And the default for geom_errorbar makes them huge and looming. What purpose do they really serve? OK, don't answer that. Still, they offend the little Edward Tufte in me (that must be very little, as I'm using barplots).

So, I set about playing with width and other things to make whisker-less error bars. Fortunately for me, there is geom_linerange, that does the same thing, but with a hitch. It's "dodge" needs to be told just how far to dodge. I admit, here, I played about with values until I found ones that worked, so your milage may vary depending on how many treatment levels you have. Either way, the resulting graph was rather nice.

#first, define the width of the dodge
dodge <- position_dodge(width=0.9) 

#now add the error bars to the plot
avg.plot+geom_linerange(aes(ymax=hwy.avg+hwy.sd, ymin=hwy.avg-hwy.sd), position=dodge)+theme_bw()

And voila! So, enjoy yet another nifty capability of ggplot2!

Great! I will say this, though. I have also played around with data with unequal representation of treatments (e.g., replace year with class or something in the previous example) - and, aside from making empty rows for missing treatment combinations, the plots are a little funny. Bars expand to fill up space left by vacant treatments. Try qplot(class, hwy, data=mpg, fill= manufacturer, geom="boxplot") to see what I mean. If anyone knows how to change this, so all bar widths are the same, I'd love to hear it.