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
Year
2018

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.

Datasets

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!”

Sources

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

A large and growing trove of patient, clinical, and organizational data is collected as a part of the “Help Desk” program at Durham’s Lincoln Community Health Center. Help Desk is a group of student volunteers who connect with patients over the phone and help them navigate to community resources (like food assistance programs, legal aid, or employment centers). Data-driven approaches to identifying service gaps, understanding the patient population, and uncovering unseen trends are important for improving patient health and advocating for the necessity of these resources. Disparities in food security, economic stability, education, neighborhood and physical environment, community and social context, and access to the healthcare system are crucial social determinants of health, which studies indicate account for nearly 70% of all health outcomes.

We led a 75-minute class session for the Marine Mammals course at the Duke University Marine Lab that introduced students to strengths and challenges of using aerial imagery to survey wildlife populations, and the growing use of machine learning to address these "big data" tasks.

Most phenomena that data scientists seek to analyze are either spatially or temporally correlated. Examples of spatial and temporal correlation include political elections, contaminant transfer, disease spread, housing market, and the weather. A question of interest is how to incorporate the spatial correlation information into modeling such phenomena.

 

In this project, we focus on the impact of environmental attributes (such as greenness, tree cover, temperature, etc.) along with other socio-demographics and home characteristics on housing prices by developing a model that takes into account the spatial autocorrelation of the response variable. To this aim, we introduce a test to diagnose spatial autocorrelation and explain how to integrate spatial autocorrelation into a regression model

 

 

In this data exploration, students are provided with data collected from remote sensing, census, and Zillow sources. Students are tasked with conducting a regression analysis of real-estate estimates against environmental amenities and other control variables which may or may not include the spatial autocorrelation information.