Overview
The iRfcb
R package offers a suite of tools for managing and performing quality control on plankton data generated by the Imaging FlowCytobot (IFCB). It streamlines the processing and analysis of IFCB data, facilitating the preparation of IFCB data and images for publication (e.g. in GBIF, OBIS, EMODNet, SHARK or EcoTaxa). It is especially useful for researchers using, or partly using, the MATLAB ifcb-analysis package.
Functional Highlights
- Data Management: Functions for reading raw and processed IFCB files, counting and summarizing annotated or classified image data, and accessing, correcting, and merging manually annotated datasets.
- Quality Control: Tools for geospatial quality control of IFCB data and analysis of Particle Size Distribution.
- Image Extraction: Tools to extract and prepare images for publication.
- Taxonomical Data: Tools for handling and analyzing taxonomic data and calculating biomass concentration from image data.
Installation
You can install iRfcb
from CRAN using:
install.packages("iRfcb")
Development version
To access a feature from the development version of iRfcb
, install the latest development version from GitHub using the remotes
package:
# install.packages("remotes")
remotes::install_github("EuropeanIFCBGroup/iRfcb")
Documentation and Tutorials
Reference
For a detailed overview of all available iRfcb
functions, please visit the reference section:
Python Dependency
Some functions in iRfcb
require Python, and you will be notified when you call one of these functions. You can download Python from the official website: python.org/downloads. For details on what function that require Python, please visit the project’s Function Reference.
A Python virtual environment (venv) can be created using the ifcb_py_install()
function before calling the function that require Python.
The iRfcb
package can also be configured to automatically activate an installed Python venv upon loading by setting an environment variable. This feature is especially useful for users who regularly interact with Python dependencies within the iRfcb
package.
USE_IRFCB_PYTHON
-
Description: The
USE_IRFCB_PYTHON
environment variable controls whether the package automatically activates a pre-installed Python venv namediRfcb
when the package is loaded. -
Default: By default, this environment variable is not set. This means that the Python environment will not be loaded automatically, and the user must call the
ifcb_py_install()
functions manually before using a Python feature. -
Usage: To enable automatic setup of the Python environment when
iRfcb
is loaded, setUSE_IRFCB_PYTHON
to"TRUE"
. Ensure that a venv namediRfcb
is installed (e.g. throughifcb_py_install()
) inreticulate::virtualenv_root()
and available viareticulate::virtualenv_list()
.
How to Set the USE_IRFCB_PYTHON
Variable
You can set the USE_IRFCB_PYTHON
variable in your R session or make it persistent across sessions:
-
Temporary for the session: You can set the variable in your R session before loading
iRfcb
using the following command:Sys.setenv(USE_IRFCB_PYTHON = "TRUE")
-
Permanent across sessions: To ensure this setting persists across R sessions, add it to your
.Renviron
file in your R home directory. You can easily edit the file using the following command:usethis::edit_r_environ("user")
Then, add the following line to the file:
USE_IRFCB_PYTHON=TRUE
This will automatically set the environment variable each time you start an R session.
Getting help
If you encounter a bug or need an IFCB feature that’s missing, please report it on GitHub with a minimal reproducible example.
Repository
For more details and the latest updates, visit the GitHub repository.