ElectroPhysiology Methods

using ElectroPhysiology

These methods become available after this command is run.

Stimulus Protocols

ElectroPhysiology.StimulusType
Stimulus

An abstract type representing a stimulus in a physiological experiment.

Subtypes of Stimulus should implement specific stimulus types and their corresponding parameters.

source
ElectroPhysiology.FlashType
Flash <: Stimulus

A Flash is a subtype of Stimulus representing a flash stimulus in a physiological experiment.

Fields

  • intensity: A Real value indicating the intensity of the flash.

Constructors

  • Flash(): Creates a default Flash object with an intensity of 0.0.
  • Flash(intensity::Real): Creates a Flash object with the specified intensity.
source
ElectroPhysiology.StimulusProtocolType
StimulusProtocol{T, S} where {T <: Real, S <: Stimulus}

A mutable struct representing a stimulus protocol for physiological data.

Fields

  • type: A Stimulus object describing the type of stimulus applied during the experiment.
  • channelName: A Union{String, Int64} representing the name or number of the channel where the stimulus is applied.
  • timestamps: A Vector{Tuple{T, T}} storing the start and end timestamps of the stimulus events.

Constructors

  • StimulusProtocol(): Creates a default StimulusProtocol object with Flash() stimulus, "Nothing" channel, and a single (0.0, 0.0) timestamp.
  • StimulusProtocol(stimulus_channel::String): Creates a StimulusProtocol object with Flash() stimulus, the provided stimulus_channel, and a single (0.0, 0.0) timestamp.
  • StimulusProtocol(swp::Int64): Creates a StimulusProtocol object with Flash() stimulus, "Nothing" channel, and swp number of (0.0, 0.0) timestamps.
  • StimulusProtocol(stimulus_channel::String, swp::Int64): Creates a StimulusProtocol object with Flash() stimulus, the provided stimulus_channel, and swp 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))
source
ElectroPhysiology.extractStimulusFunction
extractStimulus(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")
source
ElectroPhysiology.setIntensityFunction
setIntensity(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 protocol
  • photons::Vector: a vector of numbers representing the photon amount.

Examples

source
ElectroPhysiology.getIntensityFunction
setIntensity(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 protocol
  • photons::Vector: a vector of numbers representing the photon amount.
source

Structs

ElectroPhysiology.ExperimentType
Experiment{FORMAT, T}

A mutable struct representing a physiological experiment.

Fields

  • HeaderDict: A dictionary containing header information for the experiment.
  • dt: A Real 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 of Real values representing the Gains values of the channels.
  • stimulus_protocol: A StimulusProtocol{T} object containing the stimulus protocol information.

Constructors

  • Experiment(data_array::AbstractArray; data_idx = 2): Create an Experiment object from an input data array with an optional data index.
  • Experiment(time::Vector, data_array::Array{T, 3}) where T <: Real: Create an Experiment object from an input time vector and data array.

NOTE stimulus protocols are now going into the HeaderDict Object

source

Functions

Missing docstring.

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.

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.