I/O Functions for PhysioExperiment Objects
PhysioIO provides comprehensive file I/O capabilities for the PhysioExperiment ecosystem. With 50 exported functions, it supports reading and writing physiological signal data across all major formats used in neuroscience, rehabilitation, and clinical research -- including EDF/EDF+, HDF5, BIDS, CSV, MATLAB .mat, and RDS. It also integrates with DuckDB for efficient querying and management of large-scale physiological datasets.
You can install PhysioIO from r-universe:
# the containers build on Bioconductor, so its repositories are needed too
install.packages("BiocManager", repos = "https://cloud.r-project.org")
install.packages("PhysioIO",
repos = c("https://x-biosignal.r-universe.dev", BiocManager::repositories()))
Or install the development version from GitHub:
# install.packages("remotes", repos = "https://cloud.r-project.org")
remotes::install_github("x-biosignal/PhysioIO")
library(PhysioIO)
# PhysioIO ships a small WFDB record; read it into a PhysioExperiment object.
# Your own files read the same way: readEDF(), readBrainVision(), readMAT(), ...
record <- file.path(system.file("extdata", package = "PhysioIO"), "100")
pe <- readWFDB(record)
pe
#> PhysioExperiment with 5000 timepoints x 2 channels
#> Sampling rate: 360 Hz
# Write to HDF5 for out-of-memory analysis of large datasets
h5 <- tempfile(fileext = ".h5")
writePhysioHDF5(pe, h5)
pe_h5 <- readPhysioHDF5(h5)
isHDF5Backed(pe_h5) # TRUE
# Native RDS serialization for fast save/load workflows
rds <- tempfile(fileext = ".rds")
writePhysio(pe, rds)
pe_rds <- readPhysio(rds)
Full support for the European Data Format, the most widely used standard for polysomnography, EEG, and clinical recordings:
readEDF() -- read EDF and EDF+ files with automatic header parsingwriteEDF() -- write PhysioExperiment objects to EDF formatHigh-performance hierarchical data format with out-of-memory support for large datasets:
readPhysioHDF5() -- read HDF5 files into PhysioExperiment objectswritePhysioHDF5() -- write with optional chunking and compressionisHDF5Backed() -- check if an object uses on-disk HDF5 storagerealizeHDF5() -- load HDF5-backed data into memoryBrain Imaging Data Structure support for standardized neuroimaging datasets:
readBIDS() -- read BIDS-formatted datasets with automatic metadata extractionwriteBIDS() -- export to BIDS-compliant directory structurevalidateBIDS() -- check BIDS compliance of a datasetlistBIDSSubjects() / listBIDSSessions() -- enumerate dataset contentsFlexible CSV import and export for tabular physiological data and clinical metadata:
readCSV() -- read CSV files with automatic channel detectionwriteCSV() -- export signal data and metadata to CSVInteroperability with MATLAB-based analysis pipelines:
readMAT() -- import .mat files (v5 and v7.3/HDF5-based)writeMAT() -- export PhysioExperiment objects to .mat formatNative R serialization for fast save/load workflows:
readPhysio() -- read PhysioExperiment objects from RDS fileswritePhysio() -- save PhysioExperiment objects as RDSEfficient database-backed storage and querying for large-scale studies
(requires the optional duckdb package):
connectDatabase() -- connect to a DuckDB databaseregisterExperiment() -- register a PhysioExperiment in the databasequeryExperiments() -- query experiments by metadata criterialoadExperiment() -- load experiments from the databasedisconnectDatabase() -- close the database connectionPhysioIO is the I/O layer of the PhysioExperiment ecosystem, a suite of R packages for multi-modal physiological signal analysis:
| Package | Description |
|---|---|
| PhysioCore | Core data structures and accessors |
| PhysioIO | File I/O (EDF, HDF5, BIDS, CSV, MAT) |
| PhysioPreprocess | Preprocessing (filters, ICA, resampling) |
| PhysioAnalysis | Analysis and visualization |
Visit the r-universe page to browse all available packages.
MIT License. See LICENSE for details.
Yusuke Matsui
Part of the Physio ecosystem. Community and policy documents live in the umbrella repository: