ElectroPhysiology Methods
using ElectroPhysiology
These methods become available after this command is run.
Stimulus Protocols
ElectroPhysiology.Stimulus
— TypeStimulus
An abstract type representing a stimulus in a physiological experiment.
Subtypes of Stimulus
should implement specific stimulus types and their corresponding parameters.
ElectroPhysiology.Flash
— TypeFlash <: Stimulus
A Flash
is a subtype of Stimulus
representing a flash stimulus in a physiological experiment.
Fields
intensity
: AReal
value indicating the intensity of the flash.
Constructors
Flash()
: Creates a defaultFlash
object with an intensity of 0.0.Flash(intensity::Real)
: Creates aFlash
object with the specifiedintensity
.
ElectroPhysiology.StimulusProtocol
— TypeStimulusProtocol{T, S} where {T <: Real, S <: Stimulus}
A mutable struct representing a stimulus protocol for physiological data.
Fields
type
: AStimulus
object describing the type of stimulus applied during the experiment.channelName
: AUnion{String, Int64}
representing the name or number of the channel where the stimulus is applied.timestamps
: AVector{Tuple{T, T}}
storing the start and end timestamps of the stimulus events.
Constructors
StimulusProtocol()
: Creates a defaultStimulusProtocol
object withFlash()
stimulus, "Nothing" channel, and a single (0.0, 0.0) timestamp.StimulusProtocol(stimulus_channel::String)
: Creates aStimulusProtocol
object withFlash()
stimulus, the providedstimulus_channel
, and a single (0.0, 0.0) timestamp.StimulusProtocol(swp::Int64)
: Creates aStimulusProtocol
object withFlash()
stimulus, "Nothing" channel, andswp
number of (0.0, 0.0) timestamps.StimulusProtocol(stimulus_channel::String, swp::Int64)
: Creates aStimulusProtocol
object withFlash()
stimulus, the providedstimulus_channel
, andswp
number of (0.0, 0.0) timestamps.
Examples
stim1 = StimululsProtocol()
stim_channel = StimulusProtocol("IN 3")
stim_sweep = StimulusProtocol(3)
stim_sweep_channel = StimululsProtocol(3, "IN 3")
stim_tstamp = StimululsProtocol((0.0, 0.01))
stim_type_time_channel = StimulusProtocol(Flash(), "IN 3", (0.00, 0.01))
ElectroPhysiology.extractStimulus
— FunctionextractStimulus(abfInfo::Dict{String, Any}; stimulus_name::String="IN 7", stimulus_threshold::Float64=2.5)
extractStimulus(abf_path::String; kwargs...)
Extract the stimulus information from the given abfInfo
dictionary and returns a StimulusProtocol
object containing stimulus timestamps.
Arguments
abfInfo
: A dictionary containing information about the physiological data.stimulus_name
: (Optional) The name of the stimulus channel. Default is "IN 7".stimulus_threshold
: (Optional) The threshold for detecting stimulus events in the waveform. Default is 2.5.
Returns
- A
StimulusProtocol
object containing the stimulus timestamps for each trial.
Examples
abfInfo = loadABF("path/to/abf/file")
stimuli = extractStimulus(abfInfo)
stimuli = extractStimulus("path/to/abf/file")
ElectroPhysiology.setIntensity
— FunctionsetIntensity(stimulus_protocols::StimulusProtocol{T, Flash}, photons::Vector{T}) where T<:Real
setIntensity(stimulus_protocols::StimulusProtocol{T, Flash}, photon::T) where T<:Real
This allows the intensity of the stimulus protocol (or multiple stimulus protocols be set).
Arguments
stimulus_protocol::StimulusProtocol{T, S} where S <: Flash
: A stimulus protocolphotons::Vector
: a vector of numbers representing the photon amount.
Examples
ElectroPhysiology.getIntensity
— FunctionsetIntensity(stimulus_protocols::StimulusProtocol{T, Flash}, photons::Vector)
This allows the intensity of the stimulus protocol (or multiple stimulus protocols be set).
Arguments
stimulus_protocol::StimulusProtocol{T, S} where S <: Flash
: A stimulus protocolphotons::Vector
: a vector of numbers representing the photon amount.
Structs
ElectroPhysiology.Experiment
— TypeExperiment{FORMAT, T}
A mutable struct representing a physiological experiment.
Fields
HeaderDict
: A dictionary containing header information for the experiment.dt
: AReal
value representing the time step between data points.t
: A vector containing the time points of the experiment.data_array
: A 3-dimensional array containing the experimental data.chNames
: A vector of strings representing the names of the channels.chUnits
: A vector of strings representing the units of the channels.chGains
: A vector ofReal
values representing the Gains values of the channels.stimulus_protocol
: AStimulusProtocol{T}
object containing the stimulus protocol information.
Constructors
Experiment(data_array::AbstractArray; data_idx = 2)
: Create anExperiment
object from an input data array with an optional data index.Experiment(time::Vector, data_array::Array{T, 3}) where T <: Real
: Create anExperiment
object from an input time vector and data array.
NOTE stimulus protocols are now going into the HeaderDict Object
Functions
Missing docstring for pad(trace::Experiment{T}, n_add::Int64; position::Symbol=:post, val::T=0.0) where {T <: Real}
. Check Documenter's build log for details.
Experiment readers
Missing docstring for readABF(::Type{T}, abf_data::Union{String,Vector{UInt8}}; trials::Union{Int64,Vector{Int64}}=-1, channels::Union{Int64, String, Vector{String}}=["Vm_prime", "Vm_prime4"], average_trials::Bool=false, stimulus_name::Union{String, Vector{String}, Nothing}="IN 7", #One of the best places to store digital stimuli stimulus_threshold::T=2.5, #This is the normal voltage rating on digital stimuli warn_bad_channel=false, #This will warn if a channel is improper flatten_episodic::Bool=false, #If the stimulation is episodic and you want it to be continuous time_unit=:s, #The time unit is s, change to ms ) where {T<:Real}
. Check Documenter's build log for details.