By Karen Lohman, Masters Student in Wildlife Science, Cetacean Conservation and Genomics Lab, Oregon State University
My name is Karen Lohman, and I’m a first-year student in Dr. Scott Baker’s Cetacean Conservation and Genomics Lab at OSU. Dr. Leigh Torres is serving on my committee and has asked me to contribute to the GEMM lab blog from time to time. For my master’s project, I’ll be applying population genetics and genomics techniques to better understand the degree of population mixing and breeding ground assignment of feeding humpback whales in the eastern North Pacific. In other words, I’ll be trying to determine where the humpback whales off the U.S. West Coast are migrating from, and at what frequency.
Earlier this month I joined the GEMM lab members in attending the Northwest Student Society of Marine Mammalogy Conference in Seattle. The GEMM lab members and I made the trip up to the University of Washington to present our work to our peers from across the Pacific Northwest. All five GEMM lab graduate students, plus GEMM lab intern Acacia Pepper, and myself gave talks presenting our research to our peers. I was able to present preliminary results on the population structure of feeding humpback whales across shared feeding habitat by multiple breeding groups in the eastern North Pacific using mitochondria DNA haplotype frequencies. In the end GEMM lab’s Dawn Barlow took home the “Best Oral Presentation” prize. Way to go Dawn!
While conferences have a strong networking component, this one feels unique. It is a chance to network with our peers, who are working through the same challenges in graduate school and will hopefully be our future research collaborators in marine mammal research when we finish our degrees. It’s also one of the few groups of people that understand the challenges of studying marine mammals. Not every day is full of dolphins and rainbows; for me, it’s mostly labwork or writing code to overcome small and/or patchy sample size problems.
On the way back from Seattle we stopped to hear the one and only Dr. Sylvia Earle, talk in Portland. With 27 honorary doctorates and over 200 publications, Dr. Sylvia Earle is a legend in marine science. Hearing a distinguished marine researcher talk about her journey in research and to present such an inspiring message of ocean advocacy was a great way to end our weekend away from normal grad school responsibilities. While the entirety of her talk was moving, one of her final comments really stood out. Near the end of her talk she called the audience to action by saying “Look at your abilities and have confidence that you can and must make a difference. Do whatever you’ve got.” As a first-year graduate student trying to figure out my path forward in research and conservation, I couldn’t think of better advice to end the weekend on.
By Leila Lemos, PhD Candidate, Fisheries and Wildlife Department, Oregon State University
After three years of fieldwork and analyzing a large dataset, it is time to finally start compiling the results, create plots and see what the trends are. The first dataset I am analyzing is the photogrammetry data (more on our photogrammetry method here), which so far has been full of unexpected results.
Our first big expectation was to find a noticeable intra-year variation. Gray whales spend their winter in the warm waters of Baja California, Mexico, period while they are fasting. In the spring, they perform a big migration to higher latitudes. Only when they reach their summer feeding grounds, that extends from Northern California to the Bering and Chukchi seas, Alaska, do they start feeding and gaining enough calories to support their migration back to Mexico and subsequent fasting period.
Thus, we expected to see whales arriving along the Oregon coast with a skinny body condition that would gradually improve over the months, during the feeding season. Some exceptions are reasonable, such as a lactating mother or a debilitated individual. However, datasets can be more complex than we expect most of the times, and many variables can influence the results. Our photogrammetry dataset is no different!
In addition, I need to decide what are the best plots to display the results and how to make them. For years now I’ve been hearing about the wonders of R, but I’ve been skeptical about learning a whole new programming/coding language “just to make plots”, as I first thought. I have always used statistical programs such as SPSS or Prism to do my plots and they were so easy to work with. However, there is a lot more we can do in R than “just plots”. Also, it is not just because something seems hard that you won’t even try. We need to expose ourselves sometimes. So, I decided to give it a try (and I am proud of myself I did), and here are some of the results:
Plot 1: Body Area Index (BAI) vs Day of the Year (DOY)
In this plot, we wanted to assess the annual Body Area Index (BAI) trends that describe how skinny (low number) or fat (higher number) a whale is. BAI is a simplified version of the BMI (Body Mass Index) used for humans. If you are interested about this method we have developed at our lab in collaboration with the Aerial Information Systems Laboratory/OSU, you can read more about it in our publication.
The plots above are three versions of the same data displayed in different ways. The first plot on the left shows all the data points by year, with polynomial best fit lines, and the confidence intervals (in gray). There are many overlapping observation points, so for the middle plot I tried to “clean up the plot” by reducing the size of the points and taking out the gray confidence interval range around the lines. In the last plot on the right, I used a linear regression best fit line, instead of polynomial.
We can see a general trend that the BAI was considerably higher in 2016 (red line), when compared to the following years, which makes us question the accuracy of the dataset for that year. In 2016, we also didn’t sample in the month of July, which is causing the 2016 polynomial line to show a sharp decrease in this month (DOY: ~200-230). But it is also interesting to note that the increasing slope of the linear regression line in all three years is very similar, indicating that the whales gained weight at about the same rate in all years.
Plot 2: Body Area Index (BAI) vs Body Condition Score (BCS)
In addition to the photogrammetry method of assessing whale body condition, we have also performed a body condition scoring method for all the photos we have taken in the field (based on the method described by Bradford et al. 2012). Thus, with this second set of plots, we wanted to compare both methods of assessing whale body condition in order to evaluate when the methods agree or not, and which method would be best and in which situation. Our hypothesis was that whales with a ‘fair’ body condition would have a lower BAI than whales with a ‘good’ body condition.
The plots above illustrate two versions of the same data, with data in the left plot grouped by year, and the data in the right plot grouped by month. In general, we see that no whales were observed with a poor body condition in the last analysis months (August to October), with both methods agreeing to this fact. Additionally, there were many whales that still had a fair body condition in August and September, but less whales in the month of October, indicating that most whales gained weight over the foraging seasons and were ready to start their Southbound migration and another fasting period. This result is important information regarding monitoring and conservation issues.
However, the 2016 dataset is still a concern, since the whales appear to have considerable higher body condition (BAI) when compared to other years.
Plot 3:Temporal Body Area Index (BAI) for individual whales
In this last group of plots, we wanted to visualize BAI trends over the season (using day of year – DOY) on the x-axis) for individuals we measured more than once. Here we can see the temporal patterns for the whales “Bit”, “Clouds”, “Pearl”, “Scarback, “Pointy”, and “White Hole”.
We expected to see an overall gradual increase in body condition (BAI) over the seasons, such as what we can observe for Pointy in 2018. However, some whales decreased their condition, such as Bit in 2018. Could this trend be accurate? Furthermore, what about BAI measurements that are different from the trend, such as Scarback in 2017, where the last observation point shows a lower BAI than past observation points? In addition, we still observe a high BAI in 2016 at this individual level, when compared to the other years.
My next step will be to check the whole dataset again and search for inconsistencies. There is something causing these 2016 values to possibly be wrong and I need to find out what it is. The overall quality of the measured photogrammetry images was good and in focus, but other variables could be influencing the quality and accuracy of the measurements.
For instance, when measuring images, I often struggled with glare, water splash, water turbidity, ocean swell, and shadows, as you can see in the photos below. All of these variables caused the borders of the whale body to not be clearly visible/identifiable, which may have caused measurements to be wrong.
Thus, I will need to check all of these variables to identify the causes for bad measurements and “clean the dataset”. Only after this process will I be able to make these plots again to look at the trends (which will be easy since I already have my R code written!). Then I’ll move on to my next hypothesis that the BAI of individual whales varied by demographics including sex, age and reproductive state.
To carry out robust science that produces results we can trust, we can’t simply collect data, perform a basic analysis, create plots and believe everything we see. Data is often messy, especially when developing new methods like we have done here with drone based photogrammetry and the BAI. So, I need to spend some important time checking my data for accuracy and examining confounding variables that might affect the dataset. Science can be challenging, both when interpreting data or learning a new command language, but it is all worth it in the end when we produce results we know we can trust.
I’ve never sworn so much in my life. I stared at a computer screen for hours trying to fix a bug in my script. The cause of the error escaped me, pushing me into a cycle of tension, self-loathing, and keyboard smashing.
The cause of the error? A typo in the filename.
When I finally fixed the error in my filename and my code ran perfectly – my mood quickly changed. I felt invincible; like I had just won the World Cup. I did a quick victory dance in my kitchen and high-fived my roommate, and then sat down and moved on the next task that needed to be conquered with code. Just like that, programming has quickly become a drug that makes me come back for more despite the initial pain I endure.
I had never opened a computer programming software until my first year of graduate school. Before then Matlab was just the subject of a muttered complaint by my college engineering roommate. As a biology major, I blew it off as something (thank goodness!) I would never need to use. Needless to say, that set me up for a rude awakening just one year later.
The time has finally come for me to, *gulp*, learn how to code. I honestly think I went through all 5 stages of grief before I realized I was at the point where I could no longer put it off.
By now you are familiar with the GEMM Lab updating you with photos of our charismatic study species in our beautiful study areas. However, summer is over. My field work is complete, and I’m enrolled in my last course of my master’s career. So what does this mean? Winter. And with winter comes data analysis. So, instead of spending my days out on a boat in calm seas, watching humpbacks breach, or tagging along with Florence to watch gray whales forage along the Oregon coast, I’ve reached the point of my graduate career that we don’t often tell you about: Figuring out what story our data is telling us. This stage requires lots of coffee and patience.
However, in just two short weeks of learning how to code, I feel like I’ve climbed mountains. I tackle task after task, each allowing me to learn new things, revise old knowledge, and make it just a little bit closer to my goals. One of the most striking things about learning how to code is that it teaches you how to problem solve. It forces you to think in a strategic and conceptual way, and to be honest, I think I like it.
For example, this week I mapped the percent of my harbor porpoise detections over tidal cycles. One of the most important factors explaining the distribution and behavior of coastal marine mammals are tides. Tidal forces drive a number of preliminary and secondary oceanographic processes like changes in water depth, salinity, temperature, and the speed and direction of currents. It’s often difficult to unravel which part of the tidal process is most influential to a species due to the several covariates related to the change in tides , how inter-related those covariates are, and the elusive nature of the species (like the cryptic harbor porpoise). However, while the analysis is preliminary, if we map the acoustic detections of harbor porpoise over the tidal cycle, we can already start to see some interesting trends between the number of porpoise detections and the phases of the tide. Check it out!
Now, I won’t promise that I’ll be an excellent coder by the end of the winter, but I think I might have a good chance at being able to mark the “proficient” box next to Matlab and R on my first job application. Yet, whatever your reason for learning code – whether you are an undergraduate hoping to get ahead for graduate school, a graduate student hoping to escape the inevitable (like me), or just someone who thinks getting a code to work properly is a fun game – my advice to you is this:
Google first. If that fails, take mental breaks. Revisit the problem later. Think through all possible sources of error. Ask around for help. Then, when you finally fix the bug or get the code to work the way you would like it to, throw a mini-party. After it’s all over, take a deep breath and go again. Remember, you are not alone!
Happy coding this winter GEMM Lab readers – and I wish you lots of celebratory dancing!