Climate change, phenology match and the big unknown

This year was crazy in Seville with plants flowering 2-3 months earlier than last year. So we went to sample, and guess what: bees were there too. Despite expectations about phenological “mis-match” are raised here and there, we don’t find a big phenological mismatch between plants and pollinators*. I am not talking here of specific species, but taking a community approach. However, this is not the end of the story. Is good that plants and pollinators are in sync, but this alone doesn’t warrants a healthy ecosystem functioning.

Why not? My main worry is that after a mild January and beginning of February, we have now “normal cold days” again. Consequently, we also find little bee activity (today we are sampling at 14ºC just to make sure this is true). Hence, both plants and bees are likely to suffer. The demographic implications of this are hard to predict, maybe is not a big deal if it happens only one year, but if it happens often, I presume can be quite bad. All in all its hard to quantify, but I suspect that we need to go back to population dynamics if we want to understand climate change impacts beyond phenological overlaps.

*Don’t take this blog as word, there are plenty of good papers showing it (here and here), including my own (here and here), and very little showing a clear mismatch, most of those on specialized systems.

Ecoflor 2016

Ecoflor is an annual Spanish meeting on everything related to flowers (from evolution to pollinators). The level is amazingly high for being a small “unorganized” local meeting and the most important part is that is a fun forum to discuss crazy ideas, and not just finished work. Here there are some of the things I learnt this year in no particular order:

  • You can do biogeography using Arabidobsis taliana. Moreover, flowering time can be regulated by photoperiod or vernalization and you can map responsible gens across regions (by X. Picò).
  • Plants can cooperate or be selfish depending on its genotype (by R. Torices).
  • The coolest talk was on epigenetics, which can redirect the course of evolution. With experimental data on radish exposed to herbivory. (by M. Sobral).
  • Invasive Oxalis pes-caprae was thought to have only one morph in its invasive rage and hance reproduce vegetatively only, but the second morph has arrived (and its here to stay) (by S. Castro)
  • Plant-pollinator networks can be better plotted than with bipartite (by J. Galeano)
  • And it was the first time one of my students talked in public. Definitively a great talk by Miguel Angel Collado on pollinator habitat preferences.

Next year will be in Seville, join us*!

*You need probably to know some spanish, but some talks are always in english an all slides are english.

Fun Data for teaching R

I’ll be running an R course soon and I am looking for fun (public) datasets to use in data manipulation and visualization. I would like to use a single dataset that has some easy variables for the first days, but also some more challenging ones for the final days. And I want that when I put exercises, the students* are curious about finding out the answer.

[*in this case students are not ecologists]


-Movies. How many movies has Woody Allen? Is the number of movies per year increasing linearly or exponentially? That is a good theme with lots of options. IMDB releases some data, AND processing their terribly formatted txt files and assembling them would be an excellent exercise for an advanced class, but not for beginners. OMDB has an API to make searches and if you donate you can get the full database. And of course, there is an R package to use the API. This is better option for beginners.

-Music. Everyone likes music and there are 300Gb of data here. You can get also just a chunk, though, but still 2 Gb of data is probably too much for beginers.

-Football: I discarded this one for me because I know nothing about it, but I am sure it will be highly popular in Spain. An open database here.

Kaggel datasets are also awesome. To download them you just have to register. I may use the baby names per year and US state. Everyone is curious about the most popular name the year of your birthday, for example.

Earthquakes: This one also needs some parsing of the txt files (easier than IMDB) and will do for pretty visualizations.

-Datasets already in R: Along with the classic datasets on Iris flowers (used by Fisher!) or the cars dataset there are cooler options. For example there are lots of datasets for econometrics (some are curious), and Rstudio also released some cool ones recently (e.g. flights).

-Other: Internet is full of data like real time series, lots of small data examples, M&M’s colors by bag, Jeopardy questions, Marvel social networks, Dolphins social networks, …

Please, add your ideas in the comments, especially if you have used them with success for teaching R. Thanks!



Where are the kids born in December?

This is the question Xavier Sala i Martín made in a catalan TV show about economic sciences (yes, pretty cool you can talk about that in the TV!). In a nutshell, he described the relative age effect. A pattern for which most elite football and hockey players are born in the first 6 months of the year because young kids from a given age are put to compete together and the older ones are bigger and stronger. Then coaches dedicate more time to them, and by the time the physical capabilities are even among all kids born the same year, kids born in January have trained more, get more positive reinforcement, etc…

But he did not answer where are the kids born in december. I speculated that those “bad” at sports would have more time to do arts, like play music. Lets test the hypothesis! I found a list of Musicians by birthday in wikipedia and @vgaltes scrap it for me*. Amazing! 57% of musicians in wikipedia are born in the latests 6 months of the year (yes, a chi square is highly significant with this sample size), and january is the only month that goes against our prediction.


Each bar is the number of musics per month starting in January. Black line is the expected number. Sorry for the terrible graph with no axes.

We should have stopped here. Publish it and be famous. Unfortunatelly we got excited. @vgaltes found this web page with lots of birthday summaries by profession and by eyeballing the numbers there is no clear pattern for musicians. Then @dukjb started pointing out that we should correct for number of days that each months has, and more importantly, for the natural birth rate per month, which is likely not uniform. Then we lost momentum, we got distracted by other things and the conversation fade out. But at least we had some fun, no excuse for being bad at sports** and this post!

*I am ashamed, but It would be too time consuming to do in R for me for a side, side, side, side project.

**I was born in early April.

Power analysis for mixed models

[Update: An updated version of pamm has been submitted to CRAN. See below for his author comments.]

This is a quick note that may be useful for some people. I was interested in knowing how many years of monitoring we need to detect a trend. This is a long term monitoring project, so we already have 7 years of data to play with. For a simple design, you can use the pwr library in R to answer your question, but for nested designs (i.e. random factors) things get hairy. In this and this paper they suggest building your own simulation and both has quite complex supplementary material with R code. I didn’t spent enough time to make sense of them. I also found thanks to @frod_san two packages that do it for you. The first, PAMM,  is broken (lme4 keep evolving, while the package didn’t, so even the example they use don’t work). The second (SimR) is not published yet, but is amazingly simple. All its code is in github and they are fast at fixing any bug you may detect (they fixed a small bug I found in no time). You can find a gist with an example of my question and how I calculate power here:


Lab decalogue

A while ago I wrote a lab decalog and I was not brave enough to post it. I was afraid of being judged as silly, or idealist, or naive, but here it is. I may not always accomplish to follow the following decalog, but trying is the first step.

Lab members should aim to (in no particular order):
  1. Be passionate and curious, enjoy science. We dedicate a lot of time to science, regardless of the low job stability and relatively low salaries, so we should love what we do.
  2. Be nice. You may think science is about ideas and data, but at the end its about the people who is behind. A good rule of thumb in case of conflict is to always assume good faith. The best way to solve problems is to talk about it. Even among labs (but specially within), we are not competitors, but team mates.
  3. Support open science in the degree it is possible for you. Assure reproducibility of your results, deposit you data and code (use Git!), engage with the scientific community, participate of the peer review process and sign your reviews.
  4. Think big. Which is the relevant question that science and/or society needs an answer. Then think how you can contribute. Resources in science are scarce, so we should focus on answering relevant questions (from small applied problems to big unifying theories, but relevant)
  5. Talk a lot. Gain confidence to say what you think. Ask for help when needed, offer collaboration when you can. Know new people and see new points of view. Best ideas can come from anyone.
  6. Go for quality, not quantity. Good experimental designs, solid datasets, well developed methods take time and I understand there is pressure for publishing, but I believe it pays off in the long run.
  7. Never stop learning. And take your time to think about what you learned in each project and make it count.
  8. Prioritize. Be engaged, but say “No” when you don’t have the time to dedicate. Prioritize your goals and do not compromise if you can’t. There is also lots of good things to do in life beside work, and those needs time too.
  9. Read broadly and read a lot. Part of our job is reading papers. Having a holistic view require time to read. Learn how to read, while in some papers you would need to focus in the introduction, others you would like to dissect the methods, do not treat all papers equal.
  10. Start side projects. Even better if you finish them. I explicitly encourage you to make use of the 20% rule. Use up to one day a week for other activities not directly related with your PhD/main project. You can involve me in it or not, you can learn something new, draw bees, have a blog, do an outreach project, develop and test a new method that may not work, collaborate in a crazy idea with someone else, read about a topic out of your area. In the long run, it pays off.
  11. Above all, be flexible. As scientists we require the flexibility to have eleven items in a  decalog. To change our mind on how to best be productive. To adapt to the new challenges.

New paper out: Pollinators, pests and soil properties interactively shape oilseed rape yield

We have a new paper showing that processes like pollination or pest attacks are not independent process, but one process affects the other. But the title and abstract are quite explicative, so I’ll explain a few other things here.

First, this an example of a cost-opportunity paper. Vesna was already planing to collect data on pests, so she already had selected the fields, contacted the farmers, etc… so adding the pollinator (and soil) surveys was really cost effective, and allowed talking an important question (in addition to her studies on pest control).

Second, I posted a pre-print of this paper 11 months ago. This is how long it took to submit it to a couple of journals (which didn’t review it and rejected it quickly), and to go through the review process (three reviewers, two rounds!) and editorial typesetting. During this time not only I could share a citable pre-print with a couple of interested colleagues, but also get > 500 views and > 200 Downloads from bioRxive. Moreover, the preprint allows you to compare the submitted version with the accepted version. We removed one analysis and added a couple more. The main conclusions are unaltered, but its nice to see the process from an historical point of view.

About motivation

My wife and I are getting really concerned regarding the education system our kids are in. Ken Robinson summarises the main points in his TED talks, like this one. I agree with him that current schools kill creativity and do not set the conditions to let talent flourish. However is hard to change the system from scratch. Then I realised this scales up to higher degree education (e.g. PhD) where I do have the power to change things (at least for my three PhD students).

During the PhD, the conditions are way better than in primary school. You learn by doing. Your effort has a clear purpose of advancing Science. You have flexibility in schedules and to some degree on topics. However, is not rare that PhD students are not highly motivated. How can we set the right conditions (i.e. motivate them) to maximise the learning experience during a PhD? This is a discussion I have no answer, but we should have. A good place to start are Uri Alon talks and papers (here and here).

One thing I already talk about is the idea of self-organizing teams and adopting “agile /scrum” ideas. Frequent stand-up meetings, or encourage side-projects that reflect what you are really passionate about, are things help keeping motivation high.

Another powerful idea is the concept of “flow“. The term “flow” was created by psychologist and father of Positive Psychology, Mihaly Csikszentmihalyi and I learnt about it when I used to climb big walls. You flow when doing difficult things that you master, and its great. The following graph shows the idea.

Vertical Rock Indoor Climbing Center – A Discussion Of “The Flow State” In Rock Climbing

The problem is that its tricky to suggest increasing challenges to PhD students that don’t become “boring”, but do not create anxiety. However, it’s worth trying to think with them along this lines. We are practicing to ring the alarm bell early on if they get anxious, so we can work on getting the skills first.

Any other things that work for you?

Why do we need to protect bees?

This is a very tricky question. Recent media coverage and policy makers are increasingly using the “ecosystem services” argument to justify the conservation of bee populations. Bees are indeed providing us with a precious service, the pollination of 75% of our crops. However, “bees” are a diverse group of more than 20.000 species. David Kleijn had the wonderful idea to check how many of those bee species are responsible of crop pollination and I was more than happy to help him find out. This is the resulting paper. Surprisingly very few species made most of the crop pollination job. Moreover, those species are the ones of least conservation concern, as I already showed here.

What does this means? We should enhance agro-ecosystems to maximize crop pollination by bees. There is no doubt about this and repeated papers had shown that more green infrastructure enhance pollinator densities and thereby pollination. BUT if we want to protect the bee species that really need our help, other measures and incentives are needed beyond ecosystem service delivery. Those threatened species pollinate wild plants, parasite other bees (potentially regulating populations) or are part of larger food webs. Conserving rare bees and other animals should be done without an economical incentive in mind, otherwise, conservationists selling the idea that biodiversity should be conserved because it provide us with services may end up shooting them selfs in the foot by allowing policy makers to protect only the species that are of any immediate use.

Book: A sting in the tale (D. Goulson)

I don’t even remember why I chose to read the book, but I did. I thought I know quite a lot about bumblebees, and I am familiar with Goulson papers, so I was not expecting much. I was wrong. I learnt a lot about bumblebee biology (e.g. bumblebees has 16 ovaries!). And Goulson explains his research with bumblebees with such a passion that got me hooked for two weeks, devouring all 11 chapters. Things I like include that he explains several failed experiments, and not only the ones that worked, and that he explains stories from which I know the protagonist first hand, so you can perfectly picture Jane Stout, with whom I collaborated, in the middle of Tazmania. But the best part is possibly the feeling you end up with. A feeling that saving bumblebees (and other pollinators) is possible with some effort from the society.

Here in Spain we lack the UK tradition of valuing natural history, but in the other hand we conserve more natural habitats. Today I am encouraged that a generalized love through nature will arrive here sooner than the destruction of the remaining (semi-) natural habitats. I am already thinking on how to encourage bee friendly Spanish gardens.