This function reads biovolume data from feature files generated by the `ifcb-analysis` repository (Sosik and Olson 2007) and matches them with corresponding classification results. It calculates biovolume in cubic micrometer and determines if each class is a diatom based World Register of Marine Species (WoRMS). Carbon content is computed for each roi using specific conversion functions depending on whether the class is identified as a diatom or not, according to Menden-Deuer and Lessard 2000.

ifcb_extract_biovolumes(
  feature_folder,
  class_folder,
  micron_factor = 1/3.4,
  diatom_class = "Bacillariophyceae",
  threshold = "opt",
  multiblob = FALSE
)

Arguments

feature_folder

Path to the folder containing feature files.

class_folder

Path to the folder containing class files.

micron_factor

Conversion factor for biovolume to cubic microns. Default is 1 / 3.4.

diatom_class

A string vector of diatom class names in the World Register of Marine Species (WoRMS). Default is "Bacillariophyceae".

threshold

Threshold for selecting class information ("opt" or other, default is "opt").

multiblob

A logical indicating whether to include multiblob features. Default is FALSE.

Value

A data frame containing sample, roi_number, class, biovolume_um3, and computed carbon_pg.

Details

The function combines biovolume data extracted from feature files with class information read from corresponding class files. It determines if each class is a diatom based on user-defined criteria and computes carbon content using conversion functions specific to diatoms and non-diatom protists.

References

Menden-Deuer Susanne, Lessard Evelyn J., (2000), Carbon to volume relationships for dinoflagellates, diatoms, and other protist plankton, Limnology and Oceanography, 3, doi: 10.4319/lo.2000.45.3.0569.

Sosik, H. M. and Olson, R. J. (2007), Automated taxonomic classification of phytoplankton sampled with imaging-in-flow cytometry. Limnol. Oceanogr: Methods 5, 204–216.

Examples

if (FALSE) {
# Example usage:
feature_folder <- "data/features"
class_folder <- "data/classified"
biovolume_df <- ifcb_extract_biovolumes(feature_folder, class_folder)
print(biovolume_df)
}