| 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.
subjectsubject instance (RAVESubject)
numberinteger stands for electrode number or reference ID
referencereference electrode, either NULL for no reference
or an electrode instance inherits RAVEAbstarctElectrode
epocha RAVEEpoch instance
typesignal type of the electrode, such as 'LFP', 'Spike', and 'EKG'; default is 'Unknown'
power_enabledwhether 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_referencewhether this instance is a reference electrode
locationlocation type of the electrode, see
LOCATION_TYPES for details
existswhether electrode exists in subject
preprocess_filepath to preprocess 'HDF5' file
power_filepath to power 'HDF5' file
phase_filepath to phase 'HDF5' file
voltage_filepath to voltage 'HDF5' file
reference_namereference electrode name
epoch_namecurrent epoch name
cache_rootrun-time cache path; NA if epoch or trial
intervals are missing
trial_intervalstrial intervals relative to epoch onset
new()constructor
RAVEAbstarctElectrode$new(subject, number, quiet = FALSE)
subjectcharacter or RAVESubject instance
numbercurrent electrode number or reference ID
quietreserved, whether to suppress warning messages
set_reference()set reference for instance
RAVEAbstarctElectrode$set_reference(reference)
referenceNULL or RAVEAbstarctElectrode instance
instance
set_epoch()set epoch instance for the electrode
RAVEAbstarctElectrode$set_epoch(epoch)
epochcharacters 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)
typedata 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)
blockssession blocks
typedata type such as "power", "phase",
"voltage", "wavelet-coefficient".
simplifywhether to simplify the result
clone()The objects of this class are cloneable with this method.
RAVEAbstarctElectrode$clone(deep = FALSE)
deepWhether 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.