-
Notifications
You must be signed in to change notification settings - Fork 0
5. Curation
Kelsy Cain edited this page Oct 7, 2024
·
1 revision
Now that the gating parameters are set and all the samples have been analyzed using gating.R, you can now begin curating the cytometry data by generating the particle size distribution (PSD). To do this, open PSD.R.
- Load the required packages.
library(tidyverse)
library(FCSplankton)
-
Set working directory
setwd("PATH/TO/PROJECT/")
. -
Load PSD data.
project <- basename(getwd())
PSD_all <- read_csv(paste0("Influx_", project,"_PSD.csv"))
PSD_all[1:3,]
Note for conversion from carbon per cell to equivalent spherical diameter:
Based on Menden-Deuer, S. & Lessard, E. J. Carbon to volume relationships for dinoflagellates, diatoms, and other protist plankton. Limnol. Oceanogr. 45, 569–579 (2000).
d <- 0.261; e <- 0.860 # < 3000 µm3
- Calculate the per population cell abundance, biomass, carbon quota, and cell diameter from PSD data for every sample replicate.
influx_replicates <- PSD_all %>%
group_by(time,station,cast,lat,lon,depth,pop,replicate) %>%
dplyr::summarise(
lat = unique(lat, na.rm = TRUE),
lon = unique(lon, na.rm = TRUE),
cell_abundance = sum(abundance_per_bin, na.rm = TRUE), # calculate cell abundance per population
carbon_biomass = sum(biomass_per_bin, na.rm = TRUE)) %>% # calculate carbon biomass per population
mutate(carbon_quota = carbon_biomass / cell_abundance, # calculate carbon per cell
diameter = round(2*(3/(4*base::pi)*(carbon_quota/d)^(1/e))^(1/3),5)) %>% # convert carbon per cell to equivalent spherical diameter
arrange(time)
- Average per population cell abundance, biomass, carbon quota, and cell diameter data among sample replicates.
influx <- influx_replicates %>%
group_by(time,station,cast,lat,lon,depth,pop) %>%
dplyr::summarise(
lat = mean(lat, na.rm = TRUE),
lon = mean(lon, na.rm = TRUE),
cell_abundance = mean(cell_abundance, na.rm = TRUE), # calculate cell abundance per population
carbon_biomass = mean(carbon_biomass, na.rm = TRUE), # calculate carbon biomass per population
carbon_quota = mean(carbon_quota), # calculate carbon per cell
diameter = mean(diameter, na.rm = TRUE)) %>% # convert carbon per cell to equivalent spherical diameter
arrange(time)
- Ensure the time format has not been changed and is the correct format for CMAP data submission (yyyy-mm-ddThh:mm:ss).
influx$time[1:3]
influx$time <- str_replace_all(as.character(influx$time), " ","T")
- Assign function arguments for
cmap_convert()
.
project <- basename(getwd())
cruise <- "" # Cruise ID (ex. KM1906); leave blank if samples were not collected during a cruise
cruise_keywords <- "" # Cruise keywords, alternate cruise names commonly referred to (ex. "Gradients 2, Gradients 2017, NPSG, Thomas G. Thompson"), any relevant geographical, personal, dataset specific keywords for querying data
- Save data.
cmap_convert(data = influx , cruise, cruise_keywords, project, version = "v1.0")
Authors: Kelsy Cain, François Ribalet
Maintainer: Francois Ribalet ribalet@uw.edu