RAVERepository: Definition for data repository class

Description Public fields Active bindings Methods See Also

Description

Do not create instance directly, use loaded_rave_repository instead.

Public fields

subject

RAVESubject instance

electrodes

electrodes loaded

ignored_electrodes

electrodes ignored

reference_table

reference table

time_range

seconds before and after trial onset

reference_name

name of reference table

epoch

RAVEEpoch instance

Active bindings

signature

unique signature for repository; if subject ID, reference table, epoch table, and time range are the same, signatures will be the same

preload_electrodes

get or set default electrodes to be loaded, mainly used internally by link{rave_load}.

project

RAVEProject instance

Methods

Public methods


Method new()

constructor

Usage
RAVERepository$new(subject, reference, epoch, before_onset, after_onset)
Arguments
subject

character or RAVESubject instance

reference

reference name

epoch

epoch name

before_onset

seconds to be loaded before trial onset

after_onset

seconds to be loaded after trial onset


Method load_brain()

load 3D brain instance

Usage
RAVERepository$load_brain(
  surfaces = "pial",
  use_141 = TRUE,
  recache = FALSE,
  clean_before_cache = FALSE,
  compute_template = FALSE,
  usetemplateifmissing = FALSE
)
Arguments
surfaces

surface types such as 'pial', 'white', 'smoothwm', 'sphere', etc.

use_141

whether to use 'SUMA' 141 standard brain if possible

recache

whether to force re-calculate cache data

clean_before_cache

whether to clear data before caching

compute_template

whether to compute template vertices

usetemplateifmissing

whether to use template brain if surfaces are missing, default is false

Returns

threeBrain brain instance


Method .validate_cache()

validate whether cached data is valid and consistent, i.e. the cached data is reliable, otherwise the cached data is no longer useful.

Usage
RAVERepository$.validate_cache(dtype = c("power", "phase", "voltage"))
Arguments
dtype

data type to check, choices are 'power', 'phase', 'voltage'

Returns

If there is no valid electrode, then returns NULL; otherwise returns a list with the following items:

path

path where the cached data should be stored

exist

whether path exists as a directory

consistent

whether cached data is consistent

dim

dimension of the array

dimnames

dimension names of the array


Method .signature_yaml()

internally used to save signature to cached arrays

Usage
RAVERepository$.signature_yaml(path)
Arguments
path

path to the cached array


Method epoch_continuous_signals()

epoch power, phase, or voltage data

Usage
RAVERepository$epoch_continuous_signals(
  electrodes = NULL,
  dtype = c("power", "phase", "voltage")
)
Arguments
electrodes

electrodes to epoch

dtype

data type, choices are 'power', 'phase', and 'voltage'


Method clear_cache()

call clear_cache for each electrodes loaded

Usage
RAVERepository$clear_cache(dtypes = c("power", "phase", "voltage"))
Arguments
dtypes

data types to clear


Method clear_memory()

call clear_memory for each electrodes loaded

Usage
RAVERepository$clear_memory()

Method get_meta()

get meta data

Usage
RAVERepository$get_meta(
  name = c("electrodes", "frequencies", "time_points", "trials")
)
Arguments
name

meta type name, choices are 'electrode', 'frequencies', 'time_points', 'trials'

Returns

Data frames of corresponding meta data


Method get_valid_electrodes()

get all valid electrode numbers for current subject

Usage
RAVERepository$get_valid_electrodes(electrodes)
Arguments
electrodes

integers to filter, if missing then default to all possible electrodes

Returns

Valid electrode numbers


Method get_loaded_electrodes()

get electrode numbers to be loaded

Usage
RAVERepository$get_loaded_electrodes()

Method get_power()

epoch power data of pre-specified electrodes

Usage
RAVERepository$get_power(.old = FALSE, ...)
Arguments
.old

whether use 'RAVE' 1.0 format

...

ignored

Returns

if .old is true, return ECoGTensor instance, otherwise return lazyarray


Method get_phase()

epoch phase data of pre-specified electrodes

Usage
RAVERepository$get_phase(.old = FALSE, ...)
Arguments
.old

whether use 'RAVE' 1.0 format

...

ignored

Returns

if .old is true, return ECoGTensor instance, otherwise return lazyarray


Method get_voltage()

epoch voltage data of pre-specified electrodes

Usage
RAVERepository$get_voltage(.old = FALSE, ...)
Arguments
.old

whether use 'RAVE' 1.0 format

...

ignored

Returns

if .old is true, return Tensor instance, otherwise return lazyarray


Method get_sample_rate()

get sampling frequency

Usage
RAVERepository$get_sample_rate(
  type = c("ECoG", "LFP", "Spike", "EEG"),
  time_freq = FALSE
)
Arguments
type

electrode signal type, choices are 'ECoG', 'LFP', 'Spike', 'EEG'

time_freq

whether should return sample rates after time-frequency decomposition (e.g. down-sampled rate after wavelet)

Returns

if time_freq is true, return power or phase sample rate, otherwise return voltage signal sample rate. If there is no such electrode signal type, for example, type='Spike' but no spike signals, then return NA


Method get_preload_info()

get information when creating the repository

Usage
RAVERepository$get_preload_info()
Returns

A list containing electrode to analyze, epoch and reference table names, time range of the analysis, time index for power and phase, wavelet frequencies and trial condition types.

See Also

rave_brain2, freesurfer_brain2


dipterix/ravebase documentation built on Sept. 1, 2020, 6:34 p.m.