RAVEAbstarctElectrode | R Documentation |
This class is not intended for direct use. Please create new child classes and implement some key methods.
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.
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 inherits RAVEAbstarctElectrode
epoch
a RAVEEpoch
instance
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 details
exists
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 missing
trial_intervals
trial intervals relative to epoch onset
new()
constructor
RAVEAbstarctElectrode$new(subject, number, quiet = FALSE)
subject
character or RAVESubject
instance
number
current electrode number or reference ID
quiet
reserved, whether to suppress warning messages
set_reference()
set reference for instance
RAVEAbstarctElectrode$set_reference(reference)
reference
NULL
or RAVEAbstarctElectrode
instance
instance
set_epoch()
set epoch instance for the electrode
RAVEAbstarctElectrode$set_epoch(epoch)
epoch
characters or RAVEEpoch
instance. For
characters, make sure "epoch_<name>.csv"
is in meta folder.
clear_cache()
method to clear cache on hard drive
RAVEAbstarctElectrode$clear_cache(...)
...
implemented by child instances
clear_memory()
method to clear memory
RAVEAbstarctElectrode$clear_memory(...)
...
implemented by child instances
load_data()
method to load electrode data
RAVEAbstarctElectrode$load_data(type)
type
data type such as "power"
, "phase"
,
"voltage"
, "wavelet-coefficient"
, or others
depending on child class implementations
load_blocks()
load electrode block-wise data (with reference), useful when epoch is absent
RAVEAbstarctElectrode$load_blocks(blocks, type, simplify = TRUE)
blocks
session blocks
type
data type such as "power"
, "phase"
,
"voltage"
, "wavelet-coefficient"
.
simplify
whether to simplify the result
clone()
The objects of this class are cloneable with this method.
RAVEAbstarctElectrode$clone(deep = FALSE)
deep
Whether to make a deep clone.
## Not run:
# 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)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.