Phylogenetic trees in R using ggtree

Recently, one R package which I like to use for visualizing phylogenetic trees got published. It’s called ggtree, and as you might guess from the name it is based on the popular ggplot2 package. With ggtree, plotting trees in R has become really simple and I would encourage even R beginners to give it a try! When you’ve gotten the hang of it, you can modify and annotate your trees in endless ways to suit your needs.

ggtree supports the two common tree formats Newick and Nexus. It also reads outputs from a range of tree-building software such as BEAST, EPA, HYPHY, PAML, PHYLDOG, pplacer, r8s, RAxML and RevBayes.

nwk <- system.file("extdata", "sample.nwk", package="ggtree")
tree <- read.tree(nwk)

After you’ve loaded your tree in R, visualization is really simple. The ggtree function directly plots a tree and support several layouts, such as rectangular, circular, slanted, cladogram, time-scaled, etc.

Continue reading

Posted in bioinformatics, howto, phylogenetics, R | Tagged , , , | Leave a comment

False detection of “true” species under the multi-species coalescent model

The multi-species coalescent model (MSCM) is the biggest name in the game (if the game is genetic species delimitation). But a new paper from Proceedings of the National Academy of Sciences asks: is the MSCM really doing what we think it’s doing?

Species or Population Structure Meme

Some background: The MSCM, usually implemented in the program BPP (Yang & Rannala 2010), models speciation as an instantaneous event under the birth-death process.

But we know that the biological reality is more complex. Within most species there is some amount of gene flow restriction (e.g., due to environmental or geographic barriers), not all of which will eventually lead to speciation. Depending on the extent and duration of isolation and the strength of selection, speciation can be a gradual and stochastic process.

Sukumaran & Knowles (2017) tested the performance of the MSCM using data simulated under the “protracted speciation model,” which includes a few more biologically relevant parameters compared to the simpler birth-death model. Two key components of the protracted speciation model are the species conversion rate (c, the rate at which incipient species develop into true species), and another parameter that accounts for incipient species going extinct or merging back into their parent species.

Figure 1 from Sukumaran & Knowles 2017. The multi-species coalescent model may over-estimate the “true” number of species on a phylogeny.

The authors used two different simulation schemes: a “fixed duration” scheme, where the simulations ran for a fixed amount of time and produced varying numbers of species, and a “fixed species number” scheme, where simulations ran until five species were generated.

Perhaps you’ve already guessed what happened: Sukumaran & Knowles found that the MSCM is great at identifying lineages, but it overestimates the number of species. In fact, the MSCM can estimate 5 to 13 times more than the true number of species. It is also worth noting that the errors are all positive; i.e., BPP never underestimated the number of true species but only overestimated them.

Figure 2 from Sukumaran & Knowles 2017. The multi-species coalescent model infers more than the true number of species, under a variety of simulation conditions (A). However, it does correctly estimate the number of lineages (B).

Why does it matter? These methods lead to inflated diversity estimates, with direct consequences for conservation and ecology research. For now, the authors suggest using morphological, ecological, ethological, or other classes of data to correctly attribute MSCM results to either species-level or population-level processes – a call that has been echoed by other researchers in the last 6 months (e.g., Freudenstein et al. 2016).

SukumaranTwitterExchangeThis study also served as a call for new methods for genetic species delimitation, and the researchers have already tweet-hinted at a new method that may be coming down the pipe soon. I imagine the new method will have some basis in protracted speciation model? I’m looking forward to reading it.


Sukumaran, J., & Knowles, L. L. (2017). Multispecies coalescent delimits structure, not species. Proceedings of the National Academy of Sciences, 201607921. doi: 10.1073/pnas.1607921114

Yang, Z., & Rannala, B. (2010). Bayesian species delimitation using multilocus sequence data. Proceedings of the National Academy of Sciences107(20), 9264-9269. doi: 10.1073/pnas.0913022107

Freudenstein, J. V., Broe, M. B., Folk, R. A., & Sinn, B. T. (2016). Biodiversity and the Species Concept—Lineages are not Enough. Systematic Biology. doi: 10.1093/sysbio/syw098

Posted in software, speciation | Tagged , , , , , | Leave a comment

That’s an H. erato of a different color!

Modified from Figure 1 (Belleghem et al., 2017). Sample of diversity among H. erato.

What drives different coloration among birds, insects, flowers? One of the major goals in evolutionary studies is understanding what is going on in DNA that makes organisms different. A fancy way to say this is studying how an organism’s genotype (the genome) influences the phenotype (observed characteristics).

Modified from Figure 1 (Belleghem et al., 2017). Geographical distribution, phylogeny and color pattern diversity among H. erato individuals

From yeast to Darwin’s finches (and everything in between), there are a variety of models that provide study systems to tease apart the link between genotype and phenotype. In particular, it’s helpful when the model system has undergone a recent adaptive radiation, so that there are a bunch of representatives that look diverse.

Continue reading

Posted in evolution, genomics, phylogeography | Tagged , , | Leave a comment

Friday Action Item: Get ready to #MarchForScience

On Fridays while the current administration is in office we’re posting small, concrete things you can do to help make things better. Got a suggestion for an Action Item? E-mail us!

It’s been an exhausting two weeks.

Since Donald Trump was innaugurated, many of us have marched in what was probably the largest protest in US history, and scientists nationwide were jolted into action when the new administration froze grant funding at the Environmental Protection Agency, clamped down on public communication by Federal scientific and conservation agencies, and imposed an almost certainly unconstitutional ban on immigration from a selection of Muslim-majority countries, destroying the travel and career plans of scientists and medical professionals. Many of us have gotten a crash course in calling our Members of Congress, too. All of this has been making a difference — most recently, as of this writing, a House bill to privatize millions of acres of public lands has been withdrawn, and the EPA funding freeze is supposed to lift today. Still, there are plenty of continuing reasons for concern — as of this writing, the travel ban is still in place, the Senate committee charged with vetting the head of the EPA has just bypassed normal procedures to move forward with an avowedly anti-environment nominee who seems likely to dramatically reduce the agency’s staffing and support.

So, what are your plans for Earth Day 2017? Quickly after the science agency gag order last week, scientists and science supporters began mobilizing for another big, international march. The March for Science is now scheduled for April 22, in Washington, DC and at sites across the US and the world. Though it’s had all the growing pains of a large event put together rapidly, the March’s stated mission is one we can all get behind:

The March for Science champions publicly funded and publicly communicated science as a pillar of human freedom and prosperity. We unite as a diverse, nonpartisan group to call for science that upholds the common good, and for political leaders and policymakers to enact evidence-based policies in the public interest.

Scientists are often politically minded — we’re people, just like everyone else — but we don’t like to think of the work we do in the lab and field as political. (In fact, it’s arguable that the worst misuses of the scientific method have happened when scientists couldn’t see past prevailing social attitudes.) Still, we’re not the ones who have decided that the facts of climate change, medecine, and basic biology are politically charged. As meteorologist and climate journalist Eric Holthaus lays out in his ringing call to the March for Science, the independence of empirical fact itself is what we now must defend:

We are now living in a country where our head of state routinely utters falsehoods about even mundane things — about things that can’t possibly have happened the way he says they did. As a scientist and journalist and someone who has dedicated my life to pursuing truth, it is deeply, deeply offensive to me that the idea of truth itself is being called into question. How are we supposed to carry on as normal? The answer is that we don’t. The answer is that we march.

So that’s your action item at the end of this grueling introduction to the new normal: sign up for updates, and start planning your trip to Washington or pick a satellite march closer to you. We’ll see you on Earth Day.

Posted in Action Item | Tagged | Leave a comment

The seeds of speciation

A red crossbill, photographed in Oregon. (Flickr: Rahul Alvares)

You don’t have to get very far into an evolution textbook before you bump into Darwin’s finches, the birds descended from South American finches that colonized the Galapagos Islands and “radiated” into an array of different species, each with a beak adapted to different food sources across the archipelago. Another, equally interesting case of avian adaptation is found in North America, on a different sort of archipelago. It’s found in patches of lodgepole pine forest that cloak the slopes and foothills of the Rocky Mountains, in the hooked beaks of red crossbills.

In the Rockies, crossbills feed on lodgepole pine seeds, using the tips of those hooked beaks to prise open the scales of seed cones. You might think that the trees would object to this, and they do, so to speak — but across most of the area where lodgepole pines face off with crossbills, they’re also under attack by an even more pernicious threat, red squirrels. Unlike crossbills, which get into pine cones while they’re attached to the tree, squirrels gnaw whole cones free from the branches, and they target larger cones, which contain more seeds. The result is that most lodgepole pine populations have evolved small, squat cones with thickened bases that protect against harvesting squirrels. However, in the South Hills of Idaho, some patches of lodgepole pine are free of squirrels — and in those sites, the pines’ cones are longer and narrower, with thickened scales at the tip, where crossbills prefer to start their prying. Those differences make an effective defense against the birds, and South Hills crossbills have evolved deeper beaks to cope.

This situation is a classic “geographic mosaic of coevolution”, a landscape of populations in which crossbills and lodgepole pine have the potential to shape each others’ evolution, but only do so in the right kind of (squirrel-free) environment. The details of the crossbill-lodgepole mosaic have been studied extensively, but it’s not been clear whether South Hills crossbills are genetically isolated by coevolution with pine in that one tile of the mosaic. If they are, the birds’ adaptation to the tree’s defenses might be setting the South Hills crossbills on the road to the origin of a new species.

Continue reading

Posted in adaptation, birds, Coevolution, evolution, genomics, population genetics, speciation | Tagged , | Leave a comment

Tuesday action item: Help thaw the EPA freeze

While the current administration is in office we’re posting small, concrete things you can do to help make things better, every Friday. (And, when it’s urgent, on other days too.) Got a suggestion for an Action Item? E-mail us!

This morning, news broke that the US Environmental Protection Agency (EPA) has been instructed to freeze all current contracts and grants. The contracts used by the EPA provide a multitude of benefits to Americans, from funding waste cleanup to monitoring drinking water quality. The EPA also funds a wide array of research projects that allow them to make science-based decisions on environmental regulations.

This extensive spending freeze has interrupted and endangered millions of dollars in scientific research — jeopardizing data that could influence the health of current and future generations and the people who devote their careers to collecting and sharing it.

Importantly, as one of the pillars of federal science funding, the EPA provides an example of what could happen at any moment to other funding bodies. Without warning or oversight, the President can halt the progress of science.

Do you care about science funding? Do you care about basing public policy on sound science? Then now is the time to contact those who represent you in Washington. Here are some specific EPA points you can mention:

  • If you’re a scientist, let your representative know! You may be directly influenced by these decisions or have several colleagues who are devastated by this news.
  • Make it personal! Here is a great tool for knowing exactly how the EPA is benefitting your district:

As a reminder, calling the local office of a Member of Congress is effective even if you think you already know the Member’s position. If they’re on the wrong side, it’s good for them to hear directly from constituents who disagree. If they’re on the right side, it still helps them to know you think this is a priority and they have your support to take action.

Posted in Action Item, funding | Tagged , , | Leave a comment

Resurrecting our ghosts: Helen Pilcher’s Bring Back the King

Thylacine pups, illustrated in Proceedings of the Royal Zoological Society, 1850 (Flickr: Biodiversity Heritage Library)

On September 7, 1936, at the Beaumaris Zoo in Hobart, Tasmania, a wolf-like creature named Benjamin paced up and down in his cage. As night fell, temperatures grew cooler. The keepers, underpaid and struggling themselves, had forgotten to open the sliding wooden door that would allow Benjamin to move from the outside enclosure into his protected nighttime pen. Benjamin, dehydrated, exhausted, and neglected, died during the night.

The story might sound like a sad but typical event during the Great Depression: with limited resources, many zoos had trouble tending to their creatures. Benjamin’s story was especially tragic, though, because he was the final thylacine—also called a Tasmanian wolf or Tasmanian tiger—on Earth.

But what if we could resurrect him?

The thylacine’s story is just one of the many that Helen Pilcher delves into in her new work, Bring Back the King: The New Science of De-Extinction (Bloomsbury Sigma, $27 in hardback). Alternating between captivating stories about the loss of some of Earth’s most majestic species, and the details of how we could bring them back to life, the book is both a thoughtful analysis of the revolutionary science of “de-extinction” and a consideration of our moral responsibilities towards the ghosts of our past.

Continue reading

Posted in book review, conservation, genomics | Tagged , , | Leave a comment