Title: | 'Neurodata' Without Borders in R |
---|---|
Description: | Supports 'Neurodata' Without Borders ('NWB') format in R. |
Authors: | Zhengjia Wang [aut, cre] |
Maintainer: | Zhengjia Wang <[email protected]> |
License: | file LICENSE |
Version: | 0.0.0.9000 |
Built: | 2024-11-22 03:36:02 UTC |
Source: | https://github.com/dipterix/rnwb |
'NWB'
via 'pynwb'
Install 'NWB'
via 'pynwb'
install_nwb(python_ver = "auto", verbose = TRUE)
install_nwb(python_ver = "auto", verbose = TRUE)
python_ver |
'Python' version, see |
verbose |
whether to print the installation messages |
This function returns nothing.
'pynwb'
moduleGet 'pynwb'
module
nwb load_nwb(force = FALSE, error_if_missing = TRUE)
nwb load_nwb(force = FALSE, error_if_missing = TRUE)
force |
whether to force reloading |
error_if_missing |
whether to raise errors when the module is unable to load; default is true. |
A 'Python' module if successfully loaded. If error_if_missing
is set to false and module is unable to load, return NULL
NWBHDF5IO
file containerCreates a NWBHDF5IO
file container
Creates a NWBHDF5IO
file container
Nothing
Nothing
'NWBFile'
container
Whatever results generated by expr
opened
Whether the container is opened.
new()
Initialize the class
NWBHDF5IO$new(path = NULL, mode = c("r", "w", "r+", "a", "w-", "x"), ...)
path
Path to a '.nwb'
file
mode
Mode for opening the file
...
Other parameters passed to nwb$NWBHDF5IO
close()
Close the connections (low-level method, see 'with' method below)
NWBHDF5IO$close(close_links = TRUE)
close_links
Whether to close all files linked to from this file; default is true
close_linked_files()
Close all opened, linked-to files. 'MacOS'
and 'Linux'
automatically release the linked-to file after the linking file is
closed, but 'Windows'
does not, which prevents the linked-to
file from being deleted or truncated. Use this method to close all
opened, linked-to files.
NWBHDF5IO$close_linked_files()
read()
Read the 'NWB'
file from the 'IO' source. Please use along with
'$with'
method
NWBHDF5IO$read()
with()
Safe wrapper for reading and handling 'NWB'
file. See class examples.
NWBHDF5IO$with(expr, quoted = FALSE, envir = parent.frame())
expr
R expression to evaluate
quoted
Whether expr
is quoted; default is false
envir
environment for expr
to evaluate; default is the
parent frame (see parent.frame
)
## Not run: # Running this example requires a .nwb file library(rnwb) container <- NWBHDF5IO$new(path = file) container$with({ data <- container$read() electrode_table <- data$electrodes[convert = TRUE] }) print(electrode_table) ## End(Not run)
## Not run: # Running this example requires a .nwb file library(rnwb) container <- NWBHDF5IO$new(path = file) container$with({ data <- container$read() electrode_table <- data$electrodes[convert = TRUE] }) print(electrode_table) ## End(Not run)
Get 'Python' main process environment
py
py
An object of class NULL
of length 0.
The 'Python' main process as a module
Try to convert an object to an R object
to_r(x, on_fail = c("ignore", "error", "warning"))
to_r(x, on_fail = c("ignore", "error", "warning"))
x |
input data, can be either an 'R' or 'Python' object |
on_fail |
what to do when the object is still a 'Python' object;
default is to |
The converted R object