segment.modify_conductance {scbursts}R Documentation

Transform the conductance states according to a user-defined function of conductance level.

Description

Transform the conductance states according to a user-defined function of conductance level.

Usage

segment.modify_conductance(segment, fun)

Arguments

segment

the segment containing dwells and states.

fun

a function on conductance levels (states)

Value

A modified copy of the original segment

Examples


# It's more likely that you created states or dwells with some function
states  <-  c(0,    0.2,    0,    1,    0,  0.5,    0,  0.7,    0,    1)
dwells  <-  c(0.1,  1.1,  0.5,  0.2,  1.0,  1.1,  0.6,  1.1,  0.8,  1.1)
my_burst <- segment.create(states, dwells, seg=1, start_time=3.14159, name="example_segment")

### Collapse into three subconductance states
fun <- function(amp) {
    if (amp < 0.3)
        return(0)
    else if (amp >= 0.3 && amp < 0.6)
        return(0.5)
    else
        return(1)
}

my_burst_d <- segment.modify_conductance(my_burst, fun)


[Package scbursts version 1.6 Index]