View source: R/ifcb_read_summary.R
ifcb_read_summary | R Documentation |
This function reads a MATLAB .mat
file containing aggregated and classified IFCB (Imaging FlowCytobot)
data generated by the countcells_allTBnew_user_training
function from the ifcb-analysis
repository (Sosik and Olson 2007),
or a list of classified data generated by ifcb_summarize_class_counts
.
It returns a data frame with species counts and optionally biovolume information based on specified thresholds.
ifcb_read_summary(
summary,
hdr_directory = NULL,
biovolume = FALSE,
threshold = "opt",
use_python = FALSE
)
summary |
A character string specifying the path to the |
hdr_directory |
A character string specifying the path to the directory containing header (.hdr) files. Default is NULL. |
biovolume |
A logical indicating whether the file contains biovolume data. Default is FALSE. |
threshold |
A character string specifying the threshold type for counts and biovolume. Options are "opt" (default), "adhoc", and "none". |
use_python |
Logical. If |
If use_python = TRUE
, the function tries to read the .mat
file using ifcb_read_mat()
, which relies on SciPy
.
This approach may be faster than the default approach using R.matlab::readMat()
, especially for large .mat
files.
To enable this functionality, ensure Python is properly configured with the required dependencies.
You can initialize the Python environment and install necessary packages using ifcb_py_install()
.
If use_python = FALSE
or if SciPy
is not available, the function falls back to using R.matlab::readMat()
.
A data frame containing the summary information including file list, volume analyzed, species counts, optionally biovolume, and other metadata.
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.
https://github.com/hsosik/ifcb-analysis
mat_file <- system.file("exdata/example_summary.mat", package = "iRfcb")
summary_data <- ifcb_read_summary(mat_file, biovolume = FALSE, threshold = "opt")
print(summary_data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.