Skip to contents

R6 class definition

Value

list of electrode type, number, etc.

NULL when no channel is composed. When flat is TRUE, a data frame of weights with the columns composing electrode channel numbers, composed channel number, and corresponding weights; if flat is FALSE, then a weight matrix;

Super class

ravepipeline::RAVESerializable -> RAVEPreprocessSettings

Public fields

current_version

current configuration setting version

path

settings file path

backup_path

alternative back up path for redundancy checks

data

list of raw configurations, internally used only

subject

RAVESubject instance

read_only

whether the configuration should be read-only, not yet implemented

Active bindings

version

configure version of currently stored files

old_version

whether settings file is old format

blocks

experiment blocks

electrodes

electrode numbers

sample_rates

voltage data sample rate

notch_filtered

whether electrodes are notch filtered

has_wavelet

whether each electrode has wavelet transforms

data_imported

whether electrodes are imported

data_locked

whether electrode, blocks and sample rate are locked? usually when an electrode is imported into 'rave', that electrode is locked

electrode_locked

whether electrode is imported and locked

electrode_composed

composed electrode channels, not actual physically contacts, but is generated from those physically ones

wavelet_params

wavelet parameters

notch_params

Notch filter parameters

electrode_types

electrode signal types

@freeze_blocks

whether to free block, internally used

@freeze_lfp_ecog

whether to freeze electrodes that record 'LFP' signals, internally used

@lfp_ecog_sample_rate

'LFP' sample rates, internally used

all_blocks

characters, all possible blocks even not included in some projects

raw_path2

raw data path, based on the format standard; for native, this is equivalent to raw_path; for 'BIDS', this is subject raw directory in 'BIDS' project

raw_path2_type

raw data path type, 'native' or 'bids'

raw_path

legacy raw data path for 'RAVE', regardless of raw_path2_type. This field exists for compatibility support the legacy scripts. Please use raw_path2 combined with raw_path2_type for supporting 'BIDS' format

raw_path_type

legacy type for raw_path, always returns 'native'

Methods

Inherited methods


Method @marshal()

Internal method

Usage

RAVEPreprocessSettings$@marshal(...)

Arguments

...

internal arguments


Method @unmarshal()

Internal method

Usage

RAVEPreprocessSettings$@unmarshal(object, ...)

Arguments

object, ...

internal arguments


Method new()

constructor

Usage

RAVEPreprocessSettings$new(subject, read_only = TRUE)

Arguments

subject

character or RAVESubject instance

read_only

whether subject should be read-only (not yet implemented)


Method valid()

whether configuration is valid or not

Usage

RAVEPreprocessSettings$valid()


Method has_raw()

whether raw data folder exists

Usage

RAVEPreprocessSettings$has_raw()


Method set_blocks()

set blocks

Usage

RAVEPreprocessSettings$set_blocks(blocks, force = FALSE)

Arguments

blocks

character, combination of session task and run

force

whether to ignore checking. Only used when data structure is not native, for example, 'BIDS' format


Method get_block_paths()

get block-related files

Usage

RAVEPreprocessSettings$get_block_paths(
  block,
  force_native = FALSE,
  check = TRUE
)

Arguments

block

block names (for all available blocks, see all_blocks)

force_native

whether to ignore the format standard, such as 'BIDS' and force return the native paths; default is false

check

whether to check the file paths to make sure the returned paths are valid; default is true


Method set_electrodes()

set electrodes

Usage

RAVEPreprocessSettings$set_electrodes(
  electrodes,
  type = SIGNAL_TYPES,
  add = FALSE
)

Arguments

electrodes

integer vectors

type

signal type of electrodes, see SIGNAL_TYPES

add

whether to add to current settings


Method set_sample_rates()

set sample frequency

Usage

RAVEPreprocessSettings$set_sample_rates(srate, type = SIGNAL_TYPES)

Arguments

srate

sample rate, must be positive number

type

electrode type to set sample rate. In 'rave', all electrodes with the same signal type must have the same sample rate.


Method migrate()

convert old format to new formats

Usage

RAVEPreprocessSettings$migrate(force = FALSE)

Arguments

force

whether to force migrate and save settings


Method electrode_info()

get electrode information

Usage

RAVEPreprocessSettings$electrode_info(electrode)

Arguments

electrode

integer


Method save()

save settings to hard disk

Usage

RAVEPreprocessSettings$save()


Method get_compose_weights()

get weights of each composed channels

Usage

RAVEPreprocessSettings$get_compose_weights(flat = TRUE)

Arguments

flat

whether to flatten the data frame; default is true


Method clone()

The objects of this class are cloneable with this method.

Usage

RAVEPreprocessSettings$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples


# The following example require downloading demo subject (~700 MB) from
# https://github.com/beauchamplab/rave/releases/tag/v0.1.9-beta

if( has_rave_subject("demo/DemoSubject") ) {

conf <- RAVEPreprocessSettings$new(subject = 'demo/DemoSubject')
conf$blocks  # "008" "010" "011" "012"

conf$electrodes   # 5 electrodes

# Electrode 14 information
conf$electrode_info(electrode = 14)

conf$data_imported # All 5 electrodes are imported

conf$data_locked   # Whether block, sample rates should be locked

}