Data sharing, reproducibility and peer review

I just reviewed my first manuscript where the authors provided a reproducible analysis (i.e., they shared their data and analysis script with the reviewers). This is something my coauthors and I have tried to provide with our recent studies, but it was my first time experiencing it as a referee.

I think it really helped, but it also raised new questions about traditional peer review.

Continue reading →

Troubleshooting and iteration in science

The scientific method is taught as far back as elementary school. But students almost never get to experience what I think is the best part: what you do when something goes wrong. That’s too bad because self-correction is a hallmark of science.

In ecology and evolution, most graduate students don’t get to experience iteration firsthand, because they are often collecting data right up until the end of their degree. I didn’t experience it until my postdoc, when we failed to repeat a previous experiment. It took several experiments and a lot of time  – two years! – to figure out why. In the end, it was one of the most rewarding things I’ve done.

Wouldn’t it be great if undergraduate students actually got to do this as part of their lab courses (i.e., revise and repeat an experiment), rather than just writing about it?

One thing that can come close – teaching you how to revise and repeat when something doesn’t work – is learning to code.

How to mentor

Yesterday I was asked about how I mentor in research. This is an area where I still have a lot to learn, however, there are at least four things that I think are really important:

1. Confidence**.
Instilling confidence is probably the most important thing a mentor can do. Science is about unknowns and learning how to become an expert. And that requires confidence.

So how do you instill confidence?

2. Basic programming and learning how to “script”.
This was a real catalyst for me and a huge boost to my confidence. Once I had mastered some basic programming in R, it allowed me to start treating data like an experimental subject. Want to understand what happens when you ignore pseudoreplication in your data? What about how collinearity might influence the results of your analysis? It’s not too hard to write a simulation to figure that out. A lot of basic programming is troubleshooting, a useful and transferable skill. Acting like an experimenter also comes naturally – I see it all the time with my 4-month-old daughter!

Learning how to write scripts is also key to making your workflow efficient and reproducible. Filtering, tidying, and graphing your data is 90% of the work. Doing that through code is way more efficient and leaves a record of what you did, making it easier to correct errors later on. And if you can generate publication-quality graphs purely through code, it will save you a huge amount of time making tweaks. And believe me, you will need have to make a lot of tweaks. Finally, scripting means your work can be used by others (including, and perhaps especially, your future self).

3. Students are scientists, too.
There is nothing I’ve done that couldn’t be done by an undergraduate, if they had enough time. One of the best things grad school was our weekly seminar series. We’d have an MSc exit seminar one week followed by a distinguished visiting professor the next. As a student, your work is every bit as important.

4. Treating feedback as an opportunity.
I think it’s important to provide students with lots of constructive feedback – and also, to help them develop an ability to deal with it. In science (and in life), rejection happens. I got another huge boost when I stopped worrying about negative feedback and started looking at it as a problem-solving opportunity. This is a broadly transferable skill.

Taken together, the points above are pretty circular: it takes confidence to handle feedback, but also dealing with feedback forces you to gain confidence. So “fake it until you make it” really works. As a mentor, I think it’s important to treat students as fellow scientists, to provide them with lots of opportunities to act as peer reviewers and reviewees, and to model the process of using feedback to solve problems.

Update to #1 above, on confidence: I also try to emphasize that the value of science is based on the quality of the data collected and clear dissemination of the results – and not whether it supports a particular hypothesis, or has a p-value < 0.05. I think this is a major stumbling block for a lot of students. Your thesis does not hang on the results of one test! The cure to this kind of thinking includes a better understanding of what p-values really mean and the limitations of null hypothesis statistical testing (NHST), and a focus on reporting the data (including effect sizes, confidence intervals, and individual variation).

** Related: I think a lack of confidence is a major cause of the leaky pipeline for women in STEM (and perhaps other under-represented groups). Many women choose careers outside of science despite aptitude (see for example this 2009 study by Ceci et al.). There’s some very recent evidence that gender stereotypes about aptitude – which could shape children’s interests as well as their confidence – begin as early as 6 years old (see here).

Learning to science

From Alison Gopnik’s The Gardener and the Carpenter:

Imagine if we taught baseball the way we teach science. Until they were twelve, children would read about baseball technique and history, and occasionally hear inspirational stories of the great baseball players. They would fill out quizzes about baseball rules. College undergraduates might be allowed, under strict supervision, to reproduce famous historic baseball plays. But only in the second or third year of graduate school, would they, at last, actually get to play a game.

How hummingbirds control flight

We have a new study out on how birds use visual cues in flight. Here is a summary:

Thanks to Charlie for helping to capture the video footage! The study is a collaboration with Tyee Fellows and Doug Altshuler at UBC.

For the experiments, we used eight high-speed black & white cameras to capture the entire length of the 5.5 metre-long flight tunnel (I only had space to show two in the Youtube video above). The cameras were part of an automated tracking system that tracked the birds’ motion, and determined the birds’ 3D flight paths from the different camera views. This works similar to the way multiple cameras are used to make 3D movies.

Hummingbirds were great subjects, not only because they are incredible fliers, but also because they are sugar fiends! They have to feed every 10-15 minutes throughout the day. This meant that we were able to design big experiments and test a wide range of visual conditions.

Here are two other clips that illustrate the data from the tracking system:

The best part about this project was that we started with a pilot study that seemed like a failure, at first. We tried to repeat what had been previously shown for other birds (based on a pioneering study of budgies), but we did not see the same results. At first, that can be pretty disappointing. But it also gives you the chance to think of new ideas, and then figure out ways to test them. I think this evolution from failed experiments to ones that work is the most exciting part of science! The catch is that it can take years to get there. I really started to appreciate this once I began working with birds in the lab.

Dakin, Fellows & Altshuer. 2016. Visual guidance of forward flight in hummingbirds reveals control based on image features instead of pattern velocity. PNAS, in press.

A bad year for birds

June 2013 was bad for tree swallows. At the Queen’s University Biological Station, over 90% of nests failed as a result of persistent cold, rainy weather.

This happened to be the same year we were conducting an experiment on the hormonal mechanisms of parental care in these birds. The bad weather made for a disastrous field season. Just a couple of weeks in, and we were turning up cold lifeless chicks in nearly every nest. The upside was that it led to some potential insights into the way stress hormones and tough weather conditions interact. My coauthors Jenny Ouyang and Ádám Lendvai were invited to write an excellent blog post about it here:

Terrible weather provides insight into a bird’s life

It was remarkable how closely the nest failure rates tracked the fluctuating air temperature. This could be caused by a couple of factors, with a major one being that tree swallows rely on flying insects to feed their young, and the ability of insects to fly depends on temperature. Persistent cold weather means that parent tree swallows cannot find enough food to support their offspring.

The corticosterone hormone implants made the treatment birds more susceptible to faster brood mortality, even during benign weather. It should be noted that the implants were deployed before the bad weather struck, and we would not have performed this experiment if we had known in advance that this would be such a tough year! Hopefully, though, the results provide some insight into the role of stress hormones as mediators of a sensitive period in the life history of these birds.

Read the study here:

Ouyang et al. 2015. Weathering the storm: parental effort and experimental manipulation of stress hormones predict brood survival

Science is flawed. So what?

The results of the Reproducibility Project – a very cool endeavour to repeat a bunch of published studies in psychology – came out this week [1]. The authors (a team of psychologists from around to world) found that they were able to successfully replicate the results of 39 out of 100 studies, leaving 61% unreplicated. This seems like an awful lot of negatives, but the authors argue that it’s more or less what you’d expect. A good chunk of published research is wrong, because of sampling error, experimenter bias, an emphasis on publishing surprising findings that turn out to be false, or more than one of the above. No one study can ever represent the truth – nor is it intended to. The idea is that with time and collective effort, scientific knowledge progresses towards certainty.

So science crowd-sources certainty.

Continue reading →

Animating time series in R

Frame-blending is a great way to illustrate animal behaviour and other things that change over time. This got me thinking about ways to animate time series data. In R, the animation package has lots of options, but you can also build your own just by plotting over the same device window. If you save each iteration in a loop, the resulting images can be used as frames in a video or gif.

Hummingbirds deviate away from vertical stripe patterns

 Click the image to see a larger version

Here is an example using recordings that track hummingbirds flying in our tunnel here at UBC. This animation shows a bird’s eye view of 50 flights by 10 birds. In half of the flights (the red ones), the birds had horizontal stripes on their left side and vertical stripes on their right, and the other half (blue) had the reverse. The subtle difference between the red and blue trajectories (red ones tend to have more positive y values) shows that on average, birds tend to deviate away from vertical stripes, and towards horizontal ones. The histogram that builds up on the right side of the figure shows the mean lateral (y) position for each trajectory as it finishe

Continue reading →

What will you have to take with you?

My guest post for my university’s School of Graduate Studies blog is up! (You can read it here.) The inspiration was a new radio podcast that we have in the works on research here at Queen’s – scientific and otherwise. I’ve been working on the concept with Vee, an English PhD, and Savita, an undergraduate student who is keen to make top-notch radio documentaries.

I wrote the blog post to try to drum up some interest in being a subject of the radio show, but I hope it has a few nuggets of advice for those finishing and/or considering grad school as well.

Is animal care due for an update?

Canadians will fiercely defend nearly any Canadian-made thing, and we have an uncanny ability to keep track. Insulin? Discovered by a Canadian. The telephone? Also Canadian. Sir Sandford Fleming and his time zones? Canadian too. Tom Cruise? Spent his childhood here.

At the philosophy symposium here in September on ethics and animals, I learned of yet another point of pride: our national body governing the care of animals in research was one of the first in the world. Although the first official law to prevent cruelty to animals was passed in Britain in 1876, and the US had its Animal Welfare Act a few years before Canada’s Council on Animal Care (CCAC) was official, the CCAC had its beginning in the early 1960s – and it was revolutionary at the time.

But is it due for an update?

Continue reading →

Chicken of the trees

This month has been an eye-opener for me. Two weeks ago, I was rubbing shoulders with animal rights activists. One week later, I was hunting at the Croskery farm. And last night, we dined on the spoils – a fantastic squirrel stew that gave Thanksgiving dinner a run for its money.

How did it happen?

Continue reading →

A microscopic predator-prey chase

In terms of behaviour, animals have plants beat – though some would argue that plants have their own brand of intelligence.

Not all photosynthesizing beasts are firmly planted, though, and many that live in the water can move. Aquatic algae, for instance, often have whip-like structures (called cilia and flagella) that they can use to propel themselves along in the water. Some land plants also produce flagellated sperm that can move on their own volition.

H. akashiwo

A single-celled marine algae with flagella for getting around. From Wikimedia.

In the ocean, the ability to move can be beneficial, allowing algal cells to find food or move to a suitable environment. Motile cells can also avoid their predators by swimming away – something land plants definitely cannot do. Swimming algae incredibly slow, topping out at about half a centimetre per minute – but a new study suggests that the slow race between algae and their predators might be responsible for a far bigger, more dangerous phenomenon.

Continue reading →

Pitting science against media

Laysan albatross pair

Photo by Dick Daniels from Wikimedia Commons.

Odds are that the Laysan albatrosses in the photo above are a male and his female mate, but it’s worth checking their sex chromosomes to be sure. The reason? In this long-lived species, most of the adults are females, and two females often pair up to raise chicks (fertilized by other males of course). In some populations, up to a third of the nesting couples are female-female pairs1.

They’re not alone – plenty of other organisms engage in same-sex courtship, copulation and even long-term pairing. And it’s often for a good reason. Take the deep sea squid Octopoteuthis deletron. Researchers from the Monterey Bay Aquarium recently took to the deep in submarines to study their sex lives. They observed sperm packets attached to the bodies of both male and female squid, suggesting that males inseminate every other squid they can, “indiscriminately and swiftly” – a good strategy in a dark habitat where it may be hard to tell who you’re looking at2.

The media response was predictable, calling the squid bisexual, sex-starved, same-sex swingers. Promiscuous? Maybe. Indiscriminate? Yes. But pervy? I’m not so sure.

It’s an issue that Andrew Barron and Mark Brown commented on recently in the journal Nature3. Sensationalized coverage of research, especially when it makes great leaps to compare animal behaviour to human sex, can do real damage – to science and to society as well, by dredging up tired stereotypes about sex.

That was Barron and Brown’s main point, and I certainly agree. But their article got me far more worked up than the sex-starved squid.

Continue reading →

Innovative, naturally

bluegill sunfish field work

Chandra Rodgers sampling bluegill sunfish on Lake Opinicon.

This spring I had the opportunity to write a feature article on the Queen’s University Biological Station, a site just north of Kingston where researchers have a long history of major scientific breakthroughs involving modest Ontario wildlife. Several of these discoveries have proved to be as useful as they are compelling. The story was published in the Kingston Whig Standard, and on the web through the Queen’s Alumni Review and InnovationCanada.ca. Funding for photography was provided by the CFI’s 2011 Emerging Science Journalists Award.

Talking to scientists about their research was by far the best part of this project – much more fun than I expected! And even the toughest interviews were a gold mine of ideas. Thanks to everyone who participated. The full story is posted below…

Continue reading →

To save trees, major rethink is needed

When you stop to think about it, few things are weirder than a tree. Like us, they’re largish organisms made up of many cells, each with a central nucleus – but we have little else in common. Plants diverged from our early ancestors well before there was anything bigger than a single cell around. They split from the animal lineage even before fungi, which leads to a shocking conclusion. That spot of mould in the vegetable drawer? It’s more closely related to you than the plants upon which you both depend.

Small wonder, then, that plants don’t live and die by the same rules as animals – but this could have dire implications. That’s the message of a new study by Jonathan Davies of McGill University, published in PLoS Biology. Davies and his international collaborators have shown that the factors causing extinction in plants are entirely unexpected, and the upshot is that the current IUCN Red List criteria for listing endangered species – which are based on animal studies – might be useless when it comes to plants.

Davies and his team used the latest the comprehensive Red List data for all flowering plant species in two locations: the United Kingdom and the South African Cape. The Cape is a biodiversity hotspot with thousands of endemic species: plants that evolved there, and that can be found nowhere else. The UK flora, in contrast, is made up of species from other regions that moved in after the retreat of Pleistocene glaciers.

Previous work has shown that among mammals, we are most likely to lose species with large body sizes and long generation times – giant pandas and elephants are classic examples. But according to the new analysis, plants break the mold. Davies and coauthors found that the kinds of plants most at risk in the UK are different from those at risk of extinction in the Cape, indicating that basic traits like size have nothing to do with it. Using a detailed evolutionary history of the Cape species, the team also found evidence that extinction risk in plants is tightly linked to mode of speciation: the Cape species most at risk tend to be ones from the younger, rapidly-evolving lineages.

This implies that in plants, extinction is pruning the tips of the evolutionary tree. The authors suggest an explanation: unlike animals, new plant species tend to arise from small isolated populations that are at the extremes of a much larger ancestral range. Thus, a new plant starts off with a limited distribution, and because range size is an important criteria for Red List risk, it is also highly vulnerable.

The team’s analysis of anthropogenic factors turned up an additional surprise. For the Cape flora, human-induced habitat changes such as urbanization and agriculture cannot explain extinction risk of local plants. In other words, there is no simple geographic correspondence between human activity and plant decline. As the authors put it, places like the South African Cape might therefore be both “cradles and graveyards of diversity”, regardless of human activities.

This study suggests that a major strategy revision is in order if we want to conserve the world’s plants – a group that we all depend upon for oxygen and energy. More generally, risk criteria for one taxonomic group cannot necessarily be applied to another, since the pathways to rarity may be as foreign as the species themselves.

Further Reading

Davies, J. T. et al. 2011. PLoS Biology: 9(5): e1000620.