The challenge of software review
Our positive experience with Methods in Ecology and Evolution for the pavo 2 manuscript and package has just been sketched in blog posts at MEE blog and rOpenSci. I have tremendous respect for the work being done at rOpenSci, and it was great to see their software review guidelines spreading ‘in the wild’.
The manuscript sketching what we’ve been up to for the last few years is now out in Methods in Ecology and Evolution, and coincides with the release of version 2.1 of the package itself. It’s full of cool new stuff, and of course owes much to the hard work Rafael Maia and Hugo Gruson. As always, comments, suggestions, and bug reports are most welcome!
NEW FEATURES AND POTENTIALLY BREAKING CHANGES
- added the argument
procimg(), which allows users to interactively correct areas within images that have been misclassified
- added the rod sensitivity of Canis familiaris
peakshape() uses a completely different algorithm to find the FWHM. It now works as expected for spectra with multiple peaks. See PR #137 for a detailed overview of the changes.
- data used internally by pavo (
vissyst) is no longer exposed to users
MINOR FEATURES AND BUG FIXES
- new functions
is.colspace() are exported to test whether an object is of class
- fixed a bug where images would sometimes be wrongly detected as user-classified in
- the UV-sensitive cone is now only always named “u”, even for VS species (such as
sensdata()). This removes an unnecessary but harmless warning when
colspace() was used to place quantum catches of such species in the tetrahedral colour space.
achro argument in
coldist() has been changed for
achromatic to better match the arguments from
vismodel(). Older scripts that use
achro should not be affected and still work as before.
- the package
imager is no longer a dependency, and is only loaded if using some features of
- the package
mapproj is no longer a dependency, and is only loaded if using
- added the argument
plot.rspec, which allows the use of custom spectra labels in stacked plots.
- users now receive a warning when interpolating beyond the limits of the data using
as.rspec, and can control the behaviour with the new argument
- all deprecated functions and arguments have now been fully removed.
as.rspec() now accepts both numeric and character vectors to identify the wavelength column using
whichwl = "wl").
- Reference images in
classify() can now be specified using either a numeric vector (to identify by image position in a list) or character vector (to identify by image name).
- fixed a bug in
aggspec() when wavelength column was previously removed by the user.
- fixed a bug where
cocplot() would failed whenever
type graphical parameter was specified.
spec2rgb() has been simplified to rely more on
vismodel(). As a result, output values may be slightly different but upon testing, we found that differences between the old and the new version were barely noticeable.
- the vignette have been split into three smaller parts, which should help new users to get started with pavo
- numerous under-the-hood changes for stability and speed, with thanks to three reviewers and an associate editor at MEE.
An introduction to PCM
Luke Harmon has written and released an introductory textbook on phylogenetic comparative methods. It’s a tremendous resource, and I hope the open-source publishing model proves successful.
In this book, I describe methods to connect evolutionary processes to broad-scale patterns in the tree of life. I focus mainly — but not exclusively — on phylogenetic comparative methods. Comparative methods combine biology, mathematics, and computer science to learn about a wide variety of topics in evolution using phylogenetic trees and other associated data (see Harvey and Pagel 1991 for an early review). For example, we can find out which processes must have been common, and which rare, across clades in the tree of life; whether evolution has proceeded differently in some lineages compared to others; and whether the evolutionary potential that we see playing out in real time is sufficient to explain the diversity of life on earth, or whether we might need additional processes that may come into play only very rarely or over very long timescales, like adaptive radiation or species selection.
Following the 1.0 release, I came across this excellent introduction to Julia (& computer science in general) from Ben Lauwens and Allen Downey:
The goal of this book is to teach you to think like a computer scientist. This way of thinking combines some of the best features of mathematics, engineering, and natural science. Like mathematicians, computer scientists use formal languages to denote ideas (specifically computations). Like engineers, they design things, assembling components into systems and evaluating tradeoffs among alternatives. Like scientists, they observe the behavior of complex systems, form hypotheses, and test predictions.
Rise of the arthropods
The latest from the i5k initiative (seeking to sequence genomes of 5000 arthropods) is out, and draws on 76 genomes to identify some interesting genetic correlates of key innovations, among other things.
Arthropods comprise the largest and most diverse phylum on Earth and play vital roles in nearly every ecosystem. Their diversity stems in part from variations on a conserved body plan, resulting from and recorded in adaptive changes in the genome. Dissection of the genomic record of sequence change enables broad questions regarding genome evolution to be addressed, even across hyper-diverse taxa within arthropods. Using 76 whole genome sequences representing 21 orders spanning more than 500 million years of arthropod evolution, we document changes in gene and protein domain content and provide temporal and phylogenetic context for interpreting these innovations. We identify many novel gene families that arose early in the evolution of arthropods and during the diversification of insects into modern orders. We reveal unexpected variation in patterns of DNA methylation across arthropods and examples of gene family and protein domain evolution coincident with the appearance of notable phenotypic and physiological adaptations such as flight, metamorphosis, sociality and chemoperception. These analyses demonstrate how large-scale comparative genomics can provide broad new insights into the genotype to phenotype map and generate testable hypotheses about the evolution of animal diversity.
Digital open science
Toelch & Ostwald have published an interesting open-access framework for a course centred on teaching digital tools for reproducible and transparent research.
An important hallmark of science is the transparency and reproducibility of scientific results. Over the last few years, internet-based technologies have emerged that allow for a representation of the scientific process that goes far beyond traditional methods and analysis descriptions. Using these often freely available tools requires a suite of skills that is not necessarily part of a curriculum in the life sciences. However, funders, journals, and policy makers increasingly require researchers to ensure complete reproducibility of their methods and analyses. To close this gap, we designed an introductory course that guides students towards a reproducible science workflow. Here, we outline the course content and possible extensions, report encountered challenges, and discuss how to integrate such a course in existing curricula.
Julia 1.0 is now out in the wild. I’ve really enjoyed tinkering with past versions — it’s a powerful, snappy language for both scientific and general-purpose computing.
We want a language that’s open source, with a liberal license. We want the speed of C with the dynamism of Ruby. We want a language that’s homoiconic, with true macros like Lisp, but with obvious, familiar mathematical notation like Matlab. We want something as usable for general programming as Python, as easy for statistics as R, as natural for string processing as Perl, as powerful for linear algebra as Matlab, as good at gluing programs together as the shell. Something that is dirt simple to learn, yet keeps the most serious hackers happy. We want it interactive and we want it compiled.
The colour and the shape
Endler et al’s Boundary Strength Analysis is now out in the wild, and offers some interesting ideas on how to understand and analyse colour pattern geometry. The method, along with it predecessor the adjacency analysis, are implemented in the development version of pavo which should be released in the next month or so.
…2.Here we describe Boundary Strength Analysis (BSA), a novel way to combine the geometry of the edges (boundaries among the patch classes) with the receptor noise estimate (ΔS) of the intensity of the edges. The method is based upon known properties of vertebrate and invertebrate retinas. The mean and SD of ΔS (mΔS, sΔS) of a colour pattern can be obtained by weighting each edge class ΔS by its length, separately for chromatic and achromatic ΔS. This assumes those colour patterns, or parts of the patterns used in signalling, with larger mΔS and sΔS are more stimulating and hence more salient to the viewers. BSA can be used to examine both colour patterns and visual backgrounds…
A great read on the history and current state of R, from Nick Thieme.
August 2018 is the 25th anniversary of the creation of R, this lingua franca of the statistics and data science communities, and here we tell the story of its birth, growth and development. The story begins quite unexpectedly, with a chance meeting between two statistics professors ‐ Ross Ihaka, now retired from the University of Auckland, and Robert Gentleman, vice president of computational biology at 23andMe. As Gentleman explains: “There was no real intention to build anything other than a toy to play around with ideas.”
Splitting up the spectrum
It’s been an interesting week! Categorical perception of colour signals in a songbird from Caves et al.
In many contexts, animals assess each other using signals that vary continuously across individuals and, on average, reflect variation in the quality of the signaller. It is often assumed that signal receivers perceive and respond continuously to continuous variation in the signal. Alternatively, perception and response may be discontinuous, owing to limitations in discrimination, categorization or both. Discrimination is the ability to tell two stimuli apart (for example, whether one can tell apart colours close to each other in hue). Categorization concerns whether stimuli are grouped based on similarities (for example, identifying colours with qualitative similarities in hue as similar even if they can be distinguished). Categorical perception is a mechanism by which perceptual systems categorize continuously varying stimuli, making specific predictions about discrimination relative to category boundaries. Here we show that female zebra finches (Taeniopygia guttata) categorically perceive a continuously variable assessment signal: the orange to red spectrum of male beak colour. Both predictions of categorical perception were supported: females (1) categorized colour stimuli that varied along a continuum and (2) showed increased discrimination between colours from opposite sides of a category boundary compared to equally different colours from within a category. To our knowledge, this is the first demonstration of categorical perception of signal-based colouration in a bird, with implications for understanding avian colour perception and signal evolution in general.
Testing the bounds of colour vision
A new preprint from Cheney et al. details a modified Ishihara-style behavioural test for colour vision, with a great demonstration in Triggerfish. The granular control the method offers over spectral and spatial noise gives it broader utility for questions of ecology and evolution too, and I look forward to seeing it trialed among inverts (and hope to give it a run myself).
Colour vision mediates ecologically relevant tasks for many animals, such as mate choice, foraging and predator avoidance. However, our understanding of animal colour perception is largely derived from human psychophysics, even though animal visual systems differ from our own. Behavioural tests of non-human animals are required to understand how colour signals are perceived by them. Here we introduce a novel test of colour vision in animals inspired by the Ishihara colour charts, which are widely used to identify human colour deficiencies. These charts consist of dots that vary in colour, brightness and size, and are designed so that a numeral or letter is distinguishable from distractor dots for humans with normal colour vision. In our method, distractor dots have a fixed chromaticity (hue and saturation) but vary in luminance. Animals can be trained to find single target dots that differ from distractor dots in chromaticity. We provide Matlab code for creating these stimuli, which can be modified for use with different animals. We demonstrate the success of this method with triggerfish, Rhinecanthus aculeatus, and highlight behavioural parameters that can be measured, including success of finding the target dot, time to detect dot and error rate. Triggerfish quickly learnt to select target dots that differed from distractors dots regardless of the particular hue or saturation, and proved to use acute colour vision. We measured discrimination thresholds by testing the detection of target colours that were of increasing colour distances (ΔS) from distractor dots in different directions of colour space. At least for some colours, thresholds indicated better discrimination than expected from the Receptor Noise Limited (RNL) model assuming 5% Weber fraction for the long-wavelength cone. This methodology seems to be highly effective because it resembles natural foraging behavior for the triggerfish and may well be adaptable to a range of other animals, including mammals, birds, bees and freshwater fish. Other questions may be addressed using this methodology, including luminance thresholds, sensory bias, effects of sensory noise in detection tasks, colour categorization and saliency.
The coevolutionary arms race between bats and moth continues to bear fascinating fruit, with Juliette J. Rubin et al. showing that silk moths reflect bat sonar to generate an illusory echoic target.
Prey transmit sensory illusions to redirect predatory strikes, creating a discrepancy between what a predator perceives and reality. We use the acoustic arms race between bats and moths to investigate the evolution and function of a sensory illusion. The spinning hindwing tails of silk moths (Saturniidae) divert bat attack by reflecting sonar to create a misleading echoic target. We characterized geometric morphometrics of moth hindwings across silk moths, mapped these traits onto a new, robust phylogeny, and found that elaborated hindwing structures have converged on four adaptive shape peaks. To test the mechanism underlying these anti-bat traits, we pit bats against three species of silk moths with experimentally altered hindwings that created a representative gradient of ancestral and extant hindwing shapes. High-speed videography of battles reveals that moths with longer hindwings and tails more successfully divert bat attack. We postulate that sensory illusions are widespread and are underappreciated drivers of diversity across systems.
I agree that what we might consider ‘sensory illusions’ (though difficult to define) are likely widespread, and the illusion review of Kelley & Kelley gives an excellent sense of the state of play for visual communication.
Predictable adaptive trajectories of sexual coloration in the wild: evidence from replicate experimental guppy populations — some very cool experimental evolution using a classic model system.
The question of whether populations evolve predictably and consistently under similar selective regimes is fundamental to understanding how adaptation proceeds in the wild. We address this question with a replicated evolution experiment focused upon male sexual coloration in guppies (Poecilia reticulata). Fish were transplanted from a single high predation population in the Guanapo River to four replicate, guppy-free low predation headwater streams. Two streams had their canopies thinned to adjust the setting under which male coloration is displayed and perceived. We assessed evolutionary divergence using second-generation lab-bred offspring of fish sampled four to six years following translocation. A prior experiment of the same design, performed in an adjacent drainage, resulted in the evolution of more extensive orange, black and iridescent markings. We however found evidence for expansion only in structural coloration (iridescent blue/green), no change in orange, and a reduction in black. This response amplifies earlier findings for Guanapo fish, revealing that trajectories of color elaboration differ among drainages. We also found that color phenotypes evolved more greatly at the thinned-canopy sites. Our findings support the predictability of sexual trait evolution in the wild, and underscore the importance of signaling conditions and ornamental starting points in shaping adaptive trajectories.
How insects communicate
Kate Umbers, James O’Hanlon, and I contributed a chapter on visual communication to Insect Behaviour: From Mechanisms to Ecological and Evolutionary Consequences which has finally ground its way through the printing press. I haven’t seen the final product yet, but there looks to be some interesting work in there!
Giving warning signals the edge
Naomi Green et al. use differential appetitive-aversive conditioning with triggerfish to elegantly show that pattern edges are particularly salient cues when it comes to learning aposematic signals.
Edges are salient visual cues created by abrupt changes in luminance and color and are crucial in perceptual tasks such as motion detection and object recognition. Disruptively colored animals exploit edge detection mechanisms to obscure their body outline and/or to conceal themselves against their background. Conversely, aposematic species may use contrasting patterns with well-defined edges to create highly salient, memorable warning signals. In this study, we investigated how the amount of internal pattern edge, colored area, pattern type, or shape repetition of warning signals influenced avoidance learning in the triggerfish, Rhinecanthus aculeatus. Using 6 different warning signals, we found that fish learnt to avoid aposematic signals faster when they featured more internal pattern edge. We found little evidence that the amount of colored area or pattern type affected learning rates. An optimal amount of pattern edge within a warning signal may therefore improve how warning signals are learnt. These findings offer important insights into the evolution of prey warning signal evolution and predator psychology.
I recently had the pleasure of seeing the focal triggerfish in action –- they’re a strikingly intelligent group, and make for a wonderful system.
Deception by imitation
A neat behavioural demonstration of predator-masquerade from John Skelhorn has just arrived. It’s unsurprising that it works for predators as well as prey, and I didn’t realise it hadn’t actually been tested before, but it is an elegant study of a striking phenomenon.
Understanding how natural selection has shaped animals’ visual appearance to aid predator avoidance and prey capture has been an ongoing challenge since the conception of evolutionary theory [1,2] . Masquerade — animals resembling inedible objects common in the local environment (e.g. twigs, leaves, stones) — is one of a handful of strategies that has been suggested to serve both protective and aggressive functions (i.e. to work for both prey and predators)  . There is now good evidence for protective masquerade: predators detect masquerading prey but ignore them because they mistake them for the inedible objects they resemble  . However, there is no direct evidence that predators can benefit from aggressive masquerade [3,5] . Here, I tested the idea that prey detect masquerading predators but mistake them for the innocuous items that they resemble, making them less wary and easier for predators to catch. Because prey can only mistake masquerading predators for the objects they resemble if they have previous experience of those items, I manipulated house crickets’ (Acheta domesticus) experience with dead leaves, before placing them in tanks with dead-leaf-resembling Ghost mantises (Phyllocrania paradoxa). I found that mantises given crickets with experience of unmanipulated dead leaves caught crickets faster and after fewer attempts than mantises given crickets without experience of dead leaves, or crickets with experience of manipulated dead leaves that no longer resembled mantises. These findings demonstrate that predators can indeed benefit from aggressive masquerade.
Jones et al. detail a very cool example of introgression underlying adaptive colour polymorphism.
Snowshoe hares (Lepus americanus) maintain seasonal camouflage by molting to a white winter coat, but some hares remain brown during the winter in regions with low snow cover. We show that cis-regulatory variation controlling seasonal expression of the Agouti gene underlies this adaptive winter camouflage polymorphism. Genetic variation at Agouti clustered by winter coat color across multiple hare and jackrabbit species, revealing a history of recurrent interspecific gene flow. Brown winter coats in snowshoe hares likely originated from an introgressed black-tailed jackrabbit allele that has swept to high frequency in mild winter environments. These discoveries show that introgression of genetic variants that underlie key ecological traits can seed past and ongoing adaptation to rapidly changing environments.
Work work work work work
The University of Queensland is looking for a lecturer or senior lecturer in Wildlife Ecology, and the independent post-doctoral fellowship schemes at both RMIT and The University of Sydney are now open.
The road to fear
Holmes et al. detail a neat test of a recent hypothesis for the evolutionary route to conspicuous ‘deimatic’ (startle) displays.
Many prey species perform deimatic displays that are thought to scare or startle would-be predators, or elicit other reflexive responses that lead to attacks being delayed or abandoned. The form of these displays differs among species, but often includes prey revealing previously-hidden conspicuous visual components. The evolutionary route(s) to deimatism are poorly understood, but it has recently been suggested that the behavioural component of the displays evolves first followed by a conspicuous visual component. This is known as the “startle-first hypothesis”. Here we use an experimental system in which naïve domestic chicks forage for artificial deimatic prey to test the two key predictions of this hypothesis: (1) that movement can deter predators in the absence of conspicuously coloured display components; and, (2) that the combination of movement and conspicuously coloured display components is more effective than movement alone. We show that both these predictions hold, but only when the movement is fast. We thus provide evidence for the feasibility of ‘the startle-first hypothesis’ of the evolution of deimatism.
Version 1.4 of pavo is working its way through CRAN, and will become available over the next day or so. Lots of tweaks and fixes:
- getspec() can now read OceanOptics
- added the visual system of Ctenophorous ornatus, the (trichromatic) ornate dragon lizard
- getspecf (and the argument fast = TRUE in getspec) have been deprecated
- summary.rspec() returned incorrect values for S7. If you use S7, please re-run your analyses
MINOR FEATURES AND BUG FIXES
- summary.rspec() now properly outputs
NA for monotonically decreasing spectra
- fixed warning when subset.rspec was provided with a logical vector
- fixed harmless warning when summary.colspace() was used on a tcs object
by argument in merge.rspec() is no longer ignored
- fixed bug in voloverlap() when plot = TRUE
- fixed bug in vismodel() when transmission has more than one column
- fixed bug in vismodel() that applied von Kries correction to achromatic channel
- added argument fill=FALSE in voloverlap()
- fixed bug in jndplot() when suppressing the plotting of arrows
- better handling of subset data when using summary.colspace() and summary.vismodel()
- fixed bug in coldist() when
noise = "quantum" and
achro = TRUE were used
- fixed bug in jndplot() when
arrow = "none" and
achro = TRUE
- spec2rgb() now takes into account the 390-400 nm wavelength range into account when possible
- as.rspec() no longer fails with tibbles
- bin option of procspec() now works for all values of bins
- non-relative quantum catches from dataframe object were not correctly scaled in “di”, “tri”, “categorical” and “coc” colspaces
- fixed a bug in colspace where it would incorrectly infer a preference for a general trichromatic space, when a cie model is more appropriate
- fixed a bug so that cie color matching functions can be more easily be used in a general trichromatic space (i.e. maxwell triangle)
View the archives