Are you playing Secret Santa? a R function

We’re playing Secret Santa in my family: you are giving a present to only one other person, and their identity is only known to you. You need to give them a handmade present or a present bought in a second-hand store. Well that last part is our own variation of the concept.

You might be playing Secret Santa in your lab.

Here is a little R function to sort the draw without anyone seeing the outcome, and without the need to involve an external participant. The only inputs are:

-a vector of names of participants; for example c(“Patrick”,”Nicole”,”Maria”,”Pablo”)

-the folder where you want the output files; for example “C:/Users/Maria/SecretSanta”

After you’ve run the function, send to each person the output file named after them.

The function:

for (i in 1:length(names)){
 if (names[i]%in% chosen){
 write.table(paste(directory,"/",names[i],", you will give a present to ",choice,sep=""),
 return("Done! the files are in the provided directory. Merry Christmas.")


Load the function into R by entering the code above, and then run the function with your input:

secretsanta(names=c("Patrick","Nicole","Maria","Pablo"), directory="C:/Users/Maria/SecretSanta")


Merry Christmas!



Scouring coastal Alaskan forests : a journey through the past (Part 2)

Two wonderful weeks of hard work on the Kodiak Archipelago resulted in a truck loaded with 350 silica-dried needle samples and about as many tree cores from Sitka spruce forests. Happy and satisfied with the amount and spatial distribution of these tree samples, I embark on the ferry full of confidence about the second part of the trip: Sampling on the Kenai Peninsula.

Kodiak Island from the ferry

Bye-bye Kodiak!

Back on the continent, my main objective is to find old-growth forests of Sitka spruce and apply the same sampling design. By doing so, I will be able to compare the genetic make-up of a long-established forest to the young forests of the Kodiak Archipelago. I chose the Kenai Peninsula because it is the most likely origin of the trees that established on Afognak and Kodiak Island.


Just to remind you the general direction of Sitka spruce expansion.

This second chapter to the Alaska journey will provide the essential baseline data for my project and will help answering the following questions:


To what extent is population expansion linked to a drop in genetic diversity?

Are trees at the front of expansion experiencing higher levels of inbreeding than trees in core populations? Are they subject to lower levels of selective pressure?

Do deleterious / advantageous mutations spread more easily during population expansion?

Team number 2 is waiting for me in Anchorage: Jon and Vincent, fresh out of the plane. Two highly motivated Aitken Lab members. Two masters of tree-spotting, mushroom-picking, blueberry-gathering, and wild-cooking. Already on the first day I am tempted to re-name them Witty and Cheeky. But they ended up being “Yonathaaan” (with the strongest German accent you can adopt) and “Young Padawan”.

Jon and Vincent.

The crème de la crème of mushroom pickers.

While the difficulty on Kodiak was to get to big trees before the loggers, the difficulty on the Kenai was to get to big trees before the bark beetle. A devastating outbreak in the 1990s left very little of the pristine, old-growth spruce forest I was looking for. A lot of remaining old-growth lies in a thin strip of wet lowland crunched between the sea and the gigantic Harding Icefield, an impossible target for us and Bean, who likes roads more than glaciers and waves.

But thanks to the help of Ed Berg, bark beetle expert, John Morton, wildlife biologist, and our flawless determination, we finally manage to find beautiful, road-accessible stands of pure Sitka or mixed Sitka spruce-western hemlock forests around the Seward Inlet.

Kenai sampling areas

Sampling locations around Seward

After stalling a few times due to excessive scenic landscapes, we’re back in the coring-trunks-and-snipping-twigs business! We keep the same sampling scheme as on the Kodiak Archipelago: collecting equal numbers of tree needle and tree cores among 4 levels of forest structure (see previous post for details) in several locations, and keeping a distance of at least 50 m between sampled trees. The most striking difference in forest structure with Kodiak Island is that there is no “proper” tree of level 5. For sure there are very large trees (winning DBH: 138cm!), but none of them shows signs of open-growth (large lower branches). To me, this confirms that the canopy on the Kenai is way older than the oldest trees, unlike the canopy of Kodiak Island.


On the left, a Kodiak #5. On the right, a Kenai #5. Note: the scale on both pictures is represented by a normal-sized human being.

Although finding stands with no sign of recent disturbances was a real challenge on this part of the field trip, we managed to find four suitable sampling areas around the Seward inlet and added 197 trees to the collection. Early August, more than six weeks after having left from Vancouver with Ian, Bean and Jethro, it is time to return home. With a few kilometers added to Bean’s odometer, new or reinforced friendship bounds, beautiful memories of wild landscapes, a total of 550 tree samples and exciting prospects for my PhD research, I can’t wait to process all the data…. and go back on more adventures!


A last evening up North, somewhere on the Alaska highway


Scouring coastal Alaskan forests : a journey through the past (Part 1)

What does an expanding forest look like?

How hard is it to tell how old a natural forest is?

At what stage during the afforestation of a landscape can we say: “This is a forest.”?

Team #1 at its best.

These are some of the questions I had in mind when I started the 4000-km long road trip to Alaska, with my friend and labmate Ian, also member of the Aitken group, Bean, the famous and beloved Aitkenlab truck, and Jethro the rescued dog toy that has become our mascot over the years.

My goal: reaching the edge of the coastal Sitka spruce forest on the Kodiak Archipelago, and sampling several stands at different distances from the front of expansion. Below is a map showing the Alaskan range of Sitka spruce forest. The arrow indicates the historical route of migration of spruces after the last ice age. Beyond the green line,  You’ll have to look very hard to find any conifer tree, or even any tree taller than you.


Once arrived in Kodiak city, the journey is not over. The forest stands we want to work in require an additional floatplane ride and several miles of dangerous driving on dirtroads. And a dive into welcoming devil’s club bushes.

Spruces from above, loaded with last year’s cone crop. Spot our shadow!

Happy bunny on a flight.


On the plus side, the forests are stunning!



There we are, finally. We can start sampling! But wait… sampling what? and how?

Here is what I decided to do:

  1. Find a forest stand (by this I mean a reasonably large continuous undisturbed patch of forest)

    Come on, Ian, look harder

  2. Visually assess the different structural levels (or “cohorts”) of the forest and put them into categories


    The typical cohorts of a mature Sitka spruce stand on the Kodiak archipelago

  3. Randomly select an equal amount of trees (typically 4) per structure level per stand, with a spacing of at least 50m between trees


    Ian, we said TREES. Pretty orchids do not fit into the protocol.

  4. From each tree, extract a few needles or bark disk for DNA extraction, and a tree core for age determination.

    A bark sample (there is a thin slice of multiplying cells in there) and a freshly extracted tree core

  5. Go find the next stand

    …before the loggers, if possible (these trees were standing two days earlier).

  6. Somewhere along this iterative process, pick up an additional, valuable team member.

Hey Sally! Come get bushed with us!


I ended up with a slightly structured distribution of stands (Mother Nature wasn’t told about the statistical advantages of spatial uniformity)…


Each pink dot is a sampled stand. (One pink dot might be hiding another)


…and occasionally, some fresh fish for dinner (thank you Ian)

Spot the beer… We’re so local.

By matching the age of sampled trees with their genotype across several stands , I will be able to directly monitor the evolution of the genetic makeup of the forest and answer the following questions:

How quickly do newly formed forests accumulate genetic diversity?

How many trees colonised the area, and from where?

Does relatedness among trees increase or decrease as we approach the front of expansion?


However, to properly answer these questions, I also need at least one “reference” Sitka spruce population that established a long time ago and can be considered to be in an equilibrium state in terms of genetic structure and diversity. The closest Sitka spruce forest that matches these requirements is on the Kenai Peninsula. That’s where the trip continues! Different landscapes, different challenges, different team, and so, very logically,…. different blogpost.



To be continued…


A picture is worth a thousand words

We’ve all seen those photos that illustrate local adaptation better than a graph, text or an equation, and as a result get used in talk after talk (think benthic and limnetic sticklebacks, mouse coat colours in different environments, or peppered moths). Our Sitka spruce common garden materials with populations from across the species range has been studied by three PhD students in our lab (Makiko Mimura, Jason Holliday and Joane Elleouet), and we have shown lots of graphs of the dramatic differences in growth, phenology and cold hardiness among populations. However, we decided it was time to take advantage of the need to thin the experiment by setting up individuals for a photo shoot. We cut an average-sized, representative tree from each of nine selected populations that were roughly evenly distributed across the range, set those up against a uniform wall of the Forest Sciences Centre. We enlisted the Faculty of Forestry’s graphic artist and photographer Jamie Meyers to take the photo.

From left to right, ordered by mean annual temperature: Redwood (CA), Columbia river (OR), Vancouver (Southern BC), Ocean Falls (Central BC), Prince Ruppert (Northern BC), Kodiak Island (South-central AK), Icy Bay (South-eastern AK), Rocky Bay (South-central AK), Valdez (South-central AK).

Finally, for fun and for illustration, we had lab members dress as if they were in the home environments for each population. Here is the result:

We wear our clothes, they wear their genes.

We hope these photos will be useful to our group and to others for years to come.

Written by Sally Aitken.