Abstract definition of electrode class in RAVE
Source:R/class-electrode-abstract.R
RAVEAbstarctElectrode.Rd
This class is not intended for direct use. Please create new child classes and implement some key methods.
Value
If simplify
is enabled, and only one block is loaded,
then the result will be a vector (type="voltage"
) or a matrix
(others), otherwise the result will be a named list where the names
are the blocks.
Public fields
subject
subject instance (
RAVESubject
)number
integer stands for electrode number or reference ID
reference
reference electrode, either
NULL
for no reference or an electrode instance inheritsRAVEAbstarctElectrode
epoch
a
RAVEEpoch
instance
Active bindings
type
signal type of the electrode, such as 'LFP', 'Spike', and 'EKG'; default is 'Unknown'
power_enabled
whether the electrode can be used in power analyses such as frequency, or frequency-time analyses; this usually requires transforming the electrode raw voltage signals using signal processing methods such as 'Fourier', 'wavelet', 'Hilbert', 'multi-taper', etc. If an electrode has power data, then it's power data can be loaded via
prepare_subject_power
method.is_reference
whether this instance is a reference electrode
location
location type of the electrode, see
LOCATION_TYPES
for detailsexists
whether electrode exists in subject
preprocess_file
path to preprocess 'HDF5' file
power_file
path to power 'HDF5' file
phase_file
path to phase 'HDF5' file
voltage_file
path to voltage 'HDF5' file
reference_name
reference electrode name
epoch_name
current epoch name
cache_root
run-time cache path;
NA
if epoch or trial intervals are missingtrial_intervals
trial intervals relative to epoch onset
Methods
Method new()
constructor
Usage
RAVEAbstarctElectrode$new(subject, number, quiet = FALSE)
Arguments
subject
character or
RAVESubject
instancenumber
current electrode number or reference ID
quiet
reserved, whether to suppress warning messages
Method set_epoch()
set epoch instance for the electrode
Arguments
epoch
characters or
RAVEEpoch
instance. For characters, make sure"epoch_<name>.csv"
is in meta folder.
Examples
if (FALSE) { # \dontrun{
# To run this example, please download demo subject (~700 MB) from
# https://github.com/beauchamplab/rave/releases/tag/v0.1.9-beta
generator <- RAVEAbstarctElectrode
# load demo subject electrode 14
e <- generator$new("demo/DemoSubject", number = 14)
# set epoch
e$subject$epoch_names
e$set_epoch("auditory_onset")
head(e$epoch$table)
# set epoch range (-1 to 2 seconds relative to onset)
e$trial_intervals <- c(-1,2)
# or to set multiple ranges
e$trial_intervals <- list(c(-2,-1), c(0, 2))
# set reference
e$subject$reference_names
reference_table <- e$subject$meta_data(
meta_type = "reference",
meta_name = "default")
ref_name <- subset(reference_table, Electrode == 14)[["Reference"]]
# the reference is CAR type, mean of electrode 13-16,24
ref_name
# load & set reference
ref <- generator$new(e$subject, ref_name)
e$set_reference(ref)
} # }