Skip to contents

iRfcb (development version)

New features

  • Added support for the optional per-ROI cell_count data produced by the diatom chain counter (Groves et al. 2026, doi:10.1093/plankt/fbaf064) via the ifcb-pytorch-classify inference pipeline, and stored in .h5/.csv classification files. This enables reporting cell abundance (accounting for chains) in addition to ROI counts.
    • New ifcb_summarize_cell_counts() summarizes cell abundance and user-selectable chain-length statistics (mean, median, max, sd, n_chains) per sample and class, with optional per-liter abundance via an hdr_folder.
    • ifcb_summarize_biovolumes() and ifcb_extract_biovolumes() gain a use_cell_counts argument. When TRUE, ifcb_summarize_biovolumes() adds cell_counts (and cell_counts_per_liter when an hdr_folder is supplied) to the output.
    • A single_cell_values argument (default c(-1, 0)) lets the user define which cell_count values are treated as a single cell. By default, ROIs that were not chain-counted (-1) and ROIs where no cells were detected (0) each count as one cell; any other value is used verbatim.
    • The bundled SHARK column template (ifcb_get_shark_colnames()/ifcb_get_shark_example()) gains an IMAGE_COUNT column (number of ROIs/images), placed after COUNT. When COUNT/ABUND report cells, the mean chain length per taxon is COUNT / IMAGE_COUNT.
  • ifcb_extract_biovolumes() and ifcb_summarize_biovolumes() gain a diatom_equation argument selecting which Menden-Deuer and Lessard (2000) carbon-to-volume relationship to apply to diatoms. The default ("large") uses the large-diatom (> 3000 micron^3) equation, matching the ifcb-analysis convention and preserving previous behavior; "all" uses the all-sizes diatom equation, which assigns more carbon to small cells. A new exported helper vol2C_diatom() implements the all-sizes relationship (log a = -0.541, b = 0.811). Note that biovolume is measured per region of interest (image), not per cell, so chains of small cells register a large ROI biovolume.
  • Added ifcb_qc_sample(), which validates the integrity and self-consistency of raw IFCB samples (the .hdr/.adc/.roi triplet) and returns a tidy tibble of QC metrics and flags, one row per sample. Checks cover triplet completeness, ROI count consistency (imaged ROIs in the ADC versus the header roiCount), ROI data completeness (detecting truncated/aborted .roi files by comparing the file size to the last image’s end offset), header/ADC run time consistency, and flow/volume sanity via ifcb_volume_analyzed() (the volume ceiling is derived per sample from the header SyringeSampleVolume, reported as syringe_ml, rather than a fixed value; a constant ceiling can be forced with max_ml). Bead/calibration runs (is_bead_run), empty samples (is_empty), and, via the optional max_roi_mb argument, oversized .roi files (roi_oversized); and, via the optional max_humidity / max_temperature arguments, high recorded humidity or temperature (humidity_high / temperature_high) are flagged separately as advisory. The function accepts a directory, sample names with a data_folder, or explicit file paths, and builds entirely on existing native-R readers (no Python required).

Minor improvements and fixes

  • ifcb_is_diatom() gains a details argument. When TRUE, it returns a data frame with the resolved WoRMS class (worms_class) for each taxon instead of a logical vector, making it possible to audit genus homonyms, i.e. diatom genera such as Navicula or Actinocyclus whose names are shared with animals and therefore resolve to a non-diatom class in WoRMS. Inspect the worms_class column to identify such cases and add the affected taxa to diatom_include.
  • ifcb_extract_biovolumes() and ifcb_summarize_biovolumes() now report the diatom classification more usefully when verbose = TRUE: the (typically short) list of classes treated as diatoms is printed in full, classes that could not be found in WoRMS are listed separately, and the (typically long) list of non-diatom classes is summarized as a count with a pointer to ifcb_is_diatom(details = TRUE) for auditing homonyms. Previously the full non-diatom list was printed and truncated with an ellipsis, making it hard to tell whether a diatom class had been
  • Removed the Python dependency from all functions that create or edit MATLAB ifcb-analysis manual classification files. ifcb_create_class2use(), ifcb_create_manual_file() (and the deprecated ifcb_create_empty_manual_file()), ifcb_adjust_classes(), ifcb_correct_annotation(), ifcb_replace_mat_values(), and the format = "mat" output of ifcb_save_classification() now write .mat files with a native R implementation of the MATLAB Level 5 MAT-file format, producing output identical to the previous scipy.io.savemat-based approach (byte-for-byte identical when uncompressed, and identical in content when compressed). The wrapper functions ifcb_annotate_batch(), ifcb_annotate_samples(), ifcb_merge_manual(), and ifcb_prepare_whoi_plankton(), which delegate to the above, are therefore also Python-free. This removes the scipy/numpy requirement for creating and editing manual annotation files.
  • Removed the R.matlab package as a dependency. The default (non-Python) path for reading .mat files now also uses the native R MAT-file reader instead of R.matlab::readMat(), affecting ifcb_get_mat_names(), ifcb_get_mat_variable(), ifcb_read_summary(), ifcb_count_mat_annotations(), ifcb_extract_annotated_images(), and the reading of .mat classification files. The native reader decodes MATLAB-generated UTF-16 character data correctly, so non-ASCII strings (e.g. accented class or path names) that R.matlab::readMat() could mangle are now preserved. R.matlab has been moved from Imports to Suggests (used only as an independent cross-check in the test suite).
  • ifcb_extract_features() gains a feature_tag argument to control the feature file naming. The default ("features") writes <bin>_features_v4.csv as before; "fea" writes <bin>_fea_v4.csv, the name served by the IFCB Dashboard (pyifcb’s FeaturesDirectory).
  • Corrected the vol2C_lgdiatom() documentation, which incorrectly stated the relationship applied to diatoms > 2000 micron^3 (the Menden-Deuer and Lessard 2000 large-diatom equation is for cells > 3000 micron^3).