Data Wrangling to Assess Data Availability: A Data Detective at Work

By Alexa Kownacki, Ph.D. Student, OSU Department of Fisheries and Wildlife, Geospatial Ecology of Marine Megafauna Lab

Data wrangling, in my own loose definition, is the necessary combination of both data selection and data collection. Wrangling your data requires accessing then assessing your data. Data collection is just what it sounds like: gathering all data points necessary for your project. Data selection is the process of cleaning and trimming data for final analyses; it is a whole new bag of worms that requires decision-making and critical thinking. During this process of data wrangling, I discovered there are two major avenues to obtain data: 1) you collect it, which frequently requires an exorbitant amount of time in the field, in the lab, and/or behind a computer, or 2) other people have already collected it, and through collaboration you put it to a good use (often a different use then its initial intent). The latter approach may result in the collection of so much data that you must decide which data should be included to answer your hypotheses. This process of data wrangling is the hurdle I am facing at this moment. I feel like I am a data detective.

Data wrangling illustrated by members of the R-programming community. (Image source: R-bloggers.com)

My project focuses on assessing the health conditions of the two ecotypes of bottlenose dolphins between the waters off of Ensenada, Baja California, Mexico to San Francisco, California, USA between 1981-2015. During the government shutdown, much of my data was inaccessible, seeing as it was in possession of my collaborators at federal agencies. However, now that the shutdown is over, my data is flowing in, and my questions are piling up. I can now begin to look at where these animals have been sighted over the past decades, which ecotypes have higher contaminant levels in their blubber, which animals have higher stress levels and if these are related to geospatial location, where animals are more susceptible to human disturbance, if sex plays a role in stress or contaminant load levels, which environmental variables influence stress levels and contaminant levels, and more!

Alexa, alongside collaborators, photographing transiting bottlenose dolphins along the coastline near Santa Barbara, CA in 2015 as part of the data collection process. (Image source: Nick Kellar).

Over the last two weeks, I was emailed three separate Excel spreadsheets representing three datasets, that contain partially overlapping data. If Microsoft Access is foreign to you, I would compare this dilemma to a very confusing exam question of “matching the word with the definition”, except with the words being in different languages from the definitions. If you have used Microsoft Access databases, you probably know the system of querying and matching data in different databases. Well, imagine trying to do this with Excel spreadsheets because the databases are not linked. Now you can see why I need to take a data management course and start using platforms other than Excel to manage my data.

A visual interpretation of trying to combine datasets being like matching the English definition to the Spanish translation. (Image source: Enchanted Learning)

In the first dataset, there are 6,136 sightings of Common bottlenose dolphins (Tursiops truncatus) documented in my study area. Some years have no sightings, some years have fewer than 100 sightings, and other years have over 500 sightings. In another dataset, there are 398 bottlenose dolphin biopsy samples collected between the years of 1992-2016 in a genetics database that can provide the sex of the animal. The final dataset contains records of 774 bottlenose dolphin biopsy samples collected between 1993-2018 that could be tested for hormone and/or contaminant levels. Some of these samples have identification numbers that can be matched to the other dataset. Within these cross-reference matches there are conflicting data in terms of amount of tissue remaining for analyses. Sorting these conflicts out will involve more digging from my end and additional communication with collaborators: data wrangling at its best. Circling back to what I mentioned in the beginning of this post, this data was collected by other people over decades and the collection methods were not standardized for my project. I benefit from years of data collection by other scientists and I am grateful for all of their hard work. However, now my hard work begins.

The cutest part of data wrangling: finding adorable images of bottlenose dolphins, photographed during a coastal survey. (Image source: Alexa Kownacki).

There is also a large amount of data that I downloaded from federally-maintained websites. For example, dolphin sighting data from research cruises are available for public access from the OBIS (Ocean Biogeographic Information System) Sea Map website. It boasts 5,927,551 records from 1,096 data sets containing information on 711 species with the help of 410 collaborators. This website is incredible as it allows you to search through different data criteria and then download the data in a variety of formats and contains an interactive map of the data. You can explore this at your leisure, but I want to point out the sheer amount of data. In my case, the OBIS Sea Map website is only one major platform that contains many sources of data that has already been collected, not specifically for me or my project, but will be utilized. As a follow-up to using data collected by other scientists, it is critical to give credit where credit is due. One of the benefits of using this website, is there is information about how to properly credit the collaborators when downloading data. See below for an example:

Example citation for a dataset (Dataset ID: 1201):

Lockhart, G.G., DiGiovanni Jr., R.A., DePerte, A.M. 2014. Virginia and Maryland Sea Turtle Research and Conservation Initiative Aerial Survey Sightings, May 2011 through July 2013. Downloaded from OBIS-SEAMAP (http://seamap.env.duke.edu/dataset/1201) on xxxx-xx-xx.

Citation for OBIS-SEAMAP:

Halpin, P.N., A.J. Read, E. Fujioka, B.D. Best, B. Donnelly, L.J. Hazen, C. Kot, K. Urian, E. LaBrecque, A. Dimatteo, J. Cleary, C. Good, L.B. Crowder, and K.D. Hyrenbach. 2009. OBIS-SEAMAP: The world data center for marine mammal, sea bird, and sea turtle distributions. Oceanography 22(2):104-115

Another federally-maintained data source that boasts more data than I can quantify is the well-known ERDDAP website. After a few Google searches, I finally discovered that the acronym stands for Environmental Research Division’s Data Access Program. Essentially, this the holy grail of environmental data for marine scientists. I have downloaded so much data from this website that Excel cannot open the csv files. Here is yet another reason why young scientists, like myself, need to transition out of using Excel and into data management systems that are developed to handle large-scale datasets. Everything from daily sea surface temperatures collected on every, one-degree of latitude and longitude line from 1981-2015 over my entire study site to Ekman transport levels taken every six hours on every longitudinal degree line over my study area. I will add some environmental variables in species distribution models to see which account for the largest amount of variability in my data. The next step in data selection begins with statistics. It is important to find if there are highly correlated environmental factors prior to modeling data. Learn more about fitting cetacean data to models here.

The ERDAPP website combined all of the average Sea Surface Temperatures collected daily from 1981-2018 over my study site into a graphical display of monthly composites. (Image Source: ERDDAP)

As you can imagine, this amount of data from many sources and collaborators is equal parts daunting and exhilarating. Before I even begin the process of determining the spatial and temporal spread of dolphin sightings data, I have to identify which data points have sex identified from either hormone levels or genetics, which data points have contaminants levels already quantified, which samples still have tissue available for additional testing, and so on. Once I have cleaned up the datasets, I will import the data into the R programming package. Then I can visualize my data in plots, charts, and graphs; this will help me identify outliers and potential challenges with my data, and, hopefully, start to see answers to my focal questions. Only then, can I dive into the deep and exciting waters of species distribution modeling and more advanced statistical analyses. This is data wrangling and I am the data detective.

What people may think a ‘data detective’ looks like, when, in reality, it is a person sitting at a computer. (Image source: Elder Research)

Like the well-known phrase, “With great power comes great responsibility”, I believe that with great data, comes great responsibility, because data is power. It is up to me as the scientist to decide which data is most powerful at answering my questions.

Data is information. Information is knowledge. Knowledge is power. (Image source: thedatachick.com)

 

Over the Ocean and Under the Bridges: STEM Cruise on the R/V Oceanus

By Alexa Kownacki, Ph.D. Student, OSU Department of Fisheries and Wildlife, Geospatial Ecology of Marine Megafauna Lab

From September 22nd through 30th, the GEMM Lab participated in a STEM research cruise aboard the R/V Oceanus, Oregon State University’s (OSU) largest research vessel, which served as a fully-functioning, floating, research laboratory and field station. The STEM cruise focused on integrating science, technology, engineering and mathematics (STEM) into hands-on teaching experiences alongside professionals in the marine sciences. The official science crew consisted of high school teachers and students, community college students, and Oregon State University graduate students and professors. As with a usual research cruise, there was ample set-up, data collection, data entry, experimentation, successes, and failures. And because everyone in the science party actively participated in the research process, everyone also experienced these successes, failures, and moments of inspiration.

The science party enjoying the sunset from the aft deck with the Astoria-Megler bridge in the background. (Image source: Alexa Kownacki)

Dr. Leigh Torres, Dr. Rachael Orben, and I were all primarily stationed on flybridge—one deck above the bridge—fully exposed to the elements, at the highest possible location on the ship for best viewing. We scanned the seas in hopes of spotting a blow, a splash, or any sign of a marine mammal or seabird. Beside us, students and teachers donned binoculars and positioned themselves around the mast, with Leigh and I taking a 90-degree swath from the mast—either to starboard or to port. For those who had not been part of marine mammal observations previously, it was a crash course into the peaks and troughs—of both the waves and of the sightings. We emphasized the importance of absence data: knowledge of what is not “there” is equally as important as what is. Fortunately, Leigh chose a course that proved to have surprisingly excellent environmental conditions and amazing sightings. Therefore, we collected a large amount of presence data: data collected when marine mammals or seabirds are present.

High school student, Chris Quashnick Holloway, records a seabird sighting for observer, Dr. Rachael Orben. (Image source: Alexa Kownacki).

When someone sighted a whale that surfaced regularly, we assessed the conditions: the sea state, the animal’s behavior, the wind conditions, etc. If we deemed them as “good to fly”, our licensed drone pilot and Orange Coast Community College student, Jason, prepared his Phantom 4 drone. While he and Leigh set up drone operations, I and the other science team members maintained a visual on the whale and stayed in constant communication with the bridge via radio. When the drone was ready, and the bridge gave the “all clear”, Jason launched his drone from the aft deck. Then, someone tossed an unassuming, meter-long, wood plank overboard—keeping it attached to the ship with a line. This wood board serves as a calibration tool; the drone flies over it at varying heights as determined by its built-in altimeter. Later, we analyze how many pixels one meter occupied at different heights and can thereby determine the body length of the whale from still images by converting pixel length to a metric unit.

High school student, Alishia Keller, uses binoculars to observe a whale, while PhD student, Alexa Kownacki, radios updates on the whale’s location to the bridge and the aft deck. (Image source: Tracy Crews)

Finally, when the drone is calibrated, I radio the most recent location of our animal. For example, “Blow at 9 o’clock, 250 meters away”. Then, the bridge and I constantly adjust the ship’s speed and location. If the whale “flukes” (dives and exposes the ventral side of its tail), and later resurfaced 500 meters away at our 10 o’clock, I might radio to the bridge to, “turn 60 degrees to port and increase speed to 5 knots”. (See the Hidden Math Lesson below). Jason then positions the drone over the whale, adjusting the camera angle as necessary, and recording high-quality video footage for later analysis. The aerial viewpoint provides major advantages. Whales usually expose about 10 percent of their body above the water’s surface. However, with an aerial vantage point, we can see more of the whale and its surroundings. From here, we can observe behaviors that are otherwise obscured (Torres et al. 2018), and record footage that to help quantify body condition (i.e. lengths and girths). Prior to the batteries running low, Jason returns the drone back to the aft deck, the vessel comes to an idle, and Leigh catches the drone. Throughout these operations, those of us on the flybridge photograph flukes for identification and document any behaviors we observe. Later, we match the whale we sighted to the whale that the drone flew over, and then to prior sightings of this same individual—adding information like body condition or the presence of a calf. I like to think of it as whale detective work. Moreover, it is a team effort; everyone has a critical role in the mission. When it’s all said and done, this noninvasive approach provides life history context to the health and behaviors of the animal.

Drone pilot, Jason Miranda, flying his drone using his handheld ground station on the aft deck. (Photo source: Tracy Crews)

Hidden Math Lesson: The location of 10 o’clock and 60 degrees to port refer to the exact same direction. The bow of the ship is our 12 o’clock with the stern at our 6 o’clock; you always orient yourself in this manner when giving directions. The same goes for a compass measurement in degrees when relating the direction to the boat: the bow is 360/0. An angle measure between two consecutive numbers on a clock is: 360 degrees divided by 12-“hour” markers = 30 degrees. Therefore, 10 o’clock was 0 degrees – (2 “hours”)= 0 degrees- (2*30 degrees)= -60 degrees. A negative degree less than 180 refers to the port side (left).

Killer whale traveling northbound.

Our trip was chalked full of science and graced with cooperative weather conditions. There were more highlights than I could list in a single sitting. We towed zooplankton nets under the night sky while eating ice cream bars; we sang together at sunset and watched the atmospheric phenomena: the green flash; we witnessed a humpback lunge-feeding beside the ship’s bow; and we saw a sperm whale traveling across calm seas.

Sperm whale surfacing before a long dive.

On this cruise, our lab focused on the marine mammal observations—which proved excellent during the cruise. In only four days of surveying, we had 43 marine mammal sightings containing 362 individuals representing 9 species (See figure 1). As you can see from figure 2, we traveled over shallow, coastal and deep waters, in both Washington and Oregon before inland to Portland, OR. Because we ventured to areas with different bathymetric and oceanographic conditions, we increased our likelihood of seeing a higher diversity of species than we would if we stayed in a single depth or area.

Humpback whale lunge feeding off the bow.
Number of sightings Total number of individuals
Humpback whale 22 40
Pacific white-sided dolphin 3 249
Northern right whale dolphin 1 9
Killer whale 1 3
Dall’s porpoise 5 49
Sperm whale 1 1
Gray whale 1 1
Harbor seal 1 1
California sea lion 8 9
Total 43 362

Figure 1. Summary table of all species sightings during cruise while the science team observed from the flybridge.

Pacific white-sided dolphins swimming towards the vessel.

Figure 2. Map with inset displaying study area and sightings observed by species during the cruise, made in ArcMap. (Image source: Alexa Kownacki).

Even after two days of STEM outreach events in Portland, we were excited to incorporate more science. For the transit from Portland, OR to Newport, OR, the entire science team consisted two people: me and Jason. But even with poor weather conditions, we still used science to answer questions and help us along our journey—only with different goals than on our main leg. With the help of the marine technician, we set up a camera on the bow of the ship, facing aft to watch the vessel maneuver through the famous Portland bridges.

Video 1. Time-lapse footage of the R/V Oceanus maneuvering the Portland Bridges from a GoPro. Compiled by Alexa Kownacki, assisted by Jason Miranda and Kristin Beem.

Prior to the crossing the Columbia River bar and re-entering the Pacific Ocean, the R/V Oceanus maneuvered up the picturesque Columbia River. We used our geospatial skills to locate our fellow science team member and high school student, Chris, who was located on land. We tracked each other using GPS technology in our cell phones, until the ship got close enough to use natural landmarks as reference points, and finally we could use our binoculars to see Chris shining a light from shore. As the ship powered forward and passed under the famous Astoria-Megler bridge that connects Oregon to Washington, Chris drove over it; he directed us “100 degrees to port”. And, thanks to clear directions, bright visual aids, and spatiotemporal analysis, we managed to find our team member waving from shore. This is only one of many examples that show how in a few days at sea, students utilized new skills, such as marine mammal observational techniques, and honed them for additional applications.

On the bow, Alexa and Jason use binoculars to find Chris–over 4 miles–on the Washington side of the Columbia River. (Image source: Kristin Beem)

Great science is the result of teamwork, passion, and ingenuity. Working alongside students, teachers, and other, more-experienced scientists, provided everyone with opportunities to learn from each other. We created great science because we asked questions, we passed on our knowledge to the next person, and we did so with enthusiasm.

High school students, Jason and Chris, alongside Dr. Leigh Torres, all try to get a glimpse at the zooplankton under Dr. Kim Bernard’s microscope. (Image source: Tracy Crews).

Check out other blog posts written by the science team about the trip here.