Answering Biological Questions Using Circular Data and Analysis in R

Project Summary

This Data Expedition introduced hypothesis-driven data analysis in R and the concept of circular data, while providing some tools for importing it and analyzing it in R.

Themes and Categories

After exploring a simple dataset to learn these tools, we applied what we learned to two real examples of circular datasets: one testing for magnetoreception in salmon (based on Putman et al. 2014), and the other testing for visual orientation in deep-sea squids (Thomas et al. 2017). The lesson was designed to be a code after me, step-by-step journey through data analysis for undergraduate students.

Graduate Students: Julia Notar and Katie Thomas

Faculty: Tom Mitchell-Olds

Course: Bio 304, Biological Data Analysis

This lesson was done entirely in R, an open-source, free programming environment, and provided a rich opportunity for teaching students to explore, manipulate, and statistically analyze data using R and connect it to biological principles and questions. We did this through the introduction and analysis of circular datasets. Circular data is data that indicates an angular orientation (for example, which way an animal is facing or moving, which can be measured in degrees or radians) or a periodic event (for example, circadian rhythms). We took students from raw biological data to publication-quality figures and statistical analyses to demonstrate the broad applications of computing software and the benefits of learning a flexible, open-source programming language.

After an introduction to circular data, students were presented with two different datasets to address two different biological questions using similar circular data analyses.

  1. Do salmon use an inherited magnetic map to navigate using the Earth’s magnetic field?
  2. Do cockeyed squids orient their different sized eyes in different directions to look at different light sources?

See the full lesson.


The first dataset is a transformation (for copyright purposes) of the results of an experiment testing the effect of varying magnetic fields on juvenile salmon orientation (Putman et al. 2014). It contains the results of two experimental treatments and one control treatment, each in a column, with rows indicating the circular orientation (in degrees) of each juvenile salmon in the experiment. The data are from a published study on how naïve juvenile salmon navigate hundreds to thousands of kilometers to feeding areas, and support the hypothesis that salmon use magneto-reception to help in migrations.

The second dataset is raw data on in situ visual orientation among deep-sea cockeyed squids (Thomas et al. 2017). The measurements come from 30 years of deep-sea video data that were analyzed for squid eye orientations. Columns indicate the species, left eye orientation, and right eye orientation for each individual squid measured. The data are from a published study on the functions of different sized eyes in cockeyed squids, and support the hypothesis that the larger left eye looks upward toward dim, downwelling sunlight and the smaller right eye looks downward for flashes of bioluminescence.

Class Format

We designed this to be a first introduction to circular data analysis in R. We chose to use two different datasets so that students could first be led through data import, sub-setting, transformation, plotting, and statistical analysis by the instructors. Students are given only the data files at the beginning of class, and then are walked through coding and structuring analyses by the instructor. Then, we ask them to apply these methods and skills to a different dataset answering a completely different biological question on their own.

Student Feedback

“Very clear explanations of why circular data needed to be treated differently”

“They were really understanding of our knowledge of R, but also really helped out in letting us know other features of R and Data Analysis that the class may not have explored”

“The explanations were very thorough and helped me truly understand what I was doing when I started to write the code on my own”

“The pace was good! Really appreciated both lecturers who repeated things over and over so we could follow along!”

“It was helpful getting to use some of the programming language in a different style of questions”

“Very interesting to learn about circular data”

“I thought the lectures were very interesting, applicable, and well-taught!”


Putman, N. F., M. M. Scanlan, E. J. Billman, J. P. O’Neil, R. B. Couture, T. P. Quinn, K. J. Lohmann, and D. L. G. Noakes. 2014. An inherited magnetic map guides ocean navigation in juvenile pacific salmon. Curr. Biol. 24:446–450. Elsevier Ltd.

Thomas, K., B. Robison, and S. Johnsen. 2017. Two eyes for two purposes: in situ evidence for asymmetric vision in the cockeyed squids Histioteuthis heteropsis and Stigmatoteuthis dofleini. Philos. Trans. R. Soc. B-Biological Sci. 372:20160069.

Related Projects

This data expeditions module used three full course sessions to introduce undergraduate hydrology students with minimal programming background to:

  • Public water data (water quantity and chemistry)

  • Spatial analysis of water data

  • 2 core, spatial datasets produced by the USGS that enable spatial analysis

  • The programming language R

  • R based tools for water data

  • Spatial analysis and maps in R

Exposure to local pathogens is a significant selective pressure on the human genome: the strongest selective forces identified in modern human populations are for mutations that confer increased resistance to malaria infection. Understanding how human genetic variation impacts susceptibility to pathogens can reveal important aspects of disease biology and reveal novel treatment targets. By using genome-wide association of infection-related cellular traits, we can connect human genetic variation to disease susceptibility in a controlled laboratory environment. Identification of the variants, genes, and cellular pathways involved in infectious disease pathogenesis can inform host-directed therapeutics, clinically effective risk stratification, and epidemiological prediction. This data expedition explores the effect of host genetic variation on chemokine response to Chlamydia infection.

How does human habitation relate to patterns in the natural environment? How do species respond to the presence of, and changes in, habitation? In this Data Expedition, students make use of public datasets from the Census and the Global Biodiversity Information Facility to examine relationships between individual species and human settlements. Students develop introductory skills in spatial data manipulation and visualization in R, exposure to powerful datasets and tools, and critical thinking skills in assessing dataset quality and bias.