Opticka 2.16.1
Opticka is an experiment manager for behavioral research.
Loading...
Searching...
No Matches
LFPAnalysis Class Reference
Inheritance diagram for LFPAnalysis:

Public Member Functions

function LFPAnalysis (in varargin)
 Constructor.
 
function getFiles (in me, in force)
 getFiles loads the requisite files before parsing
 
function parse (in me, in varargin)
 parse is the major first data parsing step. This performs all the steps from checking paths are still correct, parsing the Plexon events (our trial and behavioural data), parsing raw LFPs into the trial structures, and finally converting into a .ft fieldtrip structure.
 
function reparse (in me, in varargin)
 reparse data after an initial parse, takes less time.
 
function lazyParse (in me, in varargin)
 This only parses some data if there is no equivalent structure yet.
 
function toggleSaccadeRealign (in me, in varargin)
 toggle between stimulus=0 and post-stimulus sccade=0 so we can align spikes and LFPs to either event
 
function parseSpikes (in me, in varargin)
 This LFP object has a spikeAnalysis object as a property so we can use a different spike sort to the parent LFP plexon file. But we have to ensure that the spikeAnalysis is 'locked' or 'yoked' to the LFPAnalysis object settings and selection. This function makes surethis locking occurs...
 
function useSpikeSelect (in me, in val)
 As we can also select trials from the spikeanalysis object, this function allows us to let the LFPAnalysis use the spikeanalysis selection.
 
function getFieldTripLFPs (in me, in varargin)
 Parse the Plexon plxReader LFP data (itself parsed into trials) into a fieldtrip structure, stored in the .ft property and also returned to the commandline if needed.
 
function ftPreProcess (in me, in cfg, in removeLineNoise)
 Uses the Fieldtrip preprocessing functions if need be. This modifies the .ft property structure but not the raw .LFP property. To undo these changes you must use the getFieldTripLFPs() method to regenerate .ft.
 
function ftTimeLockAnalysis (in me, in cfg, in statcfg)
 Performs a FieldTrip timelock analysis on our parsed data.
 
function ftBandPass (in me, in order, in downsample, in rectify)
 ftBandPass performs Leopold et al., 2003 type BLP
 
function ftHilbert (in me)
 ftHilbert
 
function ftAlphaPhase (in me)
 ftBandPass performs Leopold et al., 2003 type BLP
 
function ftFrequencyAnalysis (in me, in cfg, in preset, in tw, in cycles, in smth, in width, in toi, in foi)
 
function ftFrequencyStats (in me, in name, in bline, in range)
 
function ftSpikeLFP (in me, in unit, in interpolate)
 
function plotTogether (in me, in varargin)
 
function plot (in me, in varargin)
 
function get nLFPs (in me)
 
function get nSelection (in me)
 
function save (in me, in varargin)
 saves this object as a MAT file, object renamed to 'lfp'
 
function select (in me, in varargin)
 selects trials/options based on many filters
 
function createSurrogate (in me, in varargin)
 replaces the LFP signals with a noisy surrogate to test, you can change the surrogate parameters in the code, including randomising phase and having a timelocked burst of a particular frequency to test time frequency algorithms etc.
 
function makeSurrogate ()
 
function plotSurrogates ()
 
function chSpectrum (in me, in tapers)
 
function set demeanLFP (in me, in in)
 
function set LFPWindow (in me, in in)
 
- Public Member Functions inherited from analysisCore
function analysisCore (in varargin)
 Class constructor.
 
function checkPaths (in me, in varargin)
 checkPaths: if we've saved an object then load it on a new machine paths to source files may be wrong. If so then allows us to find a new directory for the source files.
 
function showEyePlots (in me, in varargin)
 showEyePlots if we have a linked eyelink file show the raw data plots
 
function showInfo (in me, in varargin)
 showInfo shows the info box for the plexon parsed data
 
function setStats (in me, in varargin)
 setStats set up the stats structure used in many Fieldtrip analyses
 
function set baselineWindow (in me, in in)
 
function optimiseSize (in me)
 optimiseSize remove the raw matrices etc. to reduce memory
 
function GUI (in me, in varargin)
 show a GUI if available for analysis object
 
function initialise (in me, in varargin)
 
function setTimeFreqOptions (in me, in varargin)
 setTimeFreqOptions for Fieldtrip time freq analysis of LFP data
 
- Public Member Functions inherited from optickaCore
function optickaCore (in varargin)
 Class constructor.
 
function get fullName (in me)
 
function getALF (in me, in subject, in sessionPrefix, in lab, in create)
 
function findAttributes (in me, in attrName, in attrValue)
 
function findAttributesandType (in me, in attrName, in attrValue, in type)
 find properties of object with specific attributes, for example all properties whose GetAcccess attribute is public and type is logical.
 
function findPropertyDefault (in me, in propName)
 
function clone (in me)
 Use this syntax to make a deep copy of the object, i.e. OBJ_OUT has the same field values, but will not behave as a handle-copy of me anymore.
 
function checkSuperclasses (in List)
 
function editProperties (in me, in properties)
 method to modify a set of properties
 
function setProp (in me, in property, in value)
 method to fast change a particular value. This is useful for use in anonymous functions, like in the state machine.
 
function initialiseGlobals (in me, in doReset, in doOpen)
 
function initialiseSaveFile (in me)
 Initialise Save prefix.
 
function checkPaths (in me)
 checks the paths are valid
 

Public Attributes

Property lfpfile
 plexon file containing the LFP data
 
Property spikefile
 plexon file containing the spike data
 
Property dir
 data directory
 
Property demeanLFP
 remove the mean voltage offset from the individual trials?
 
Property selectedLFP
 default LFP channel
 
Property LFPWindow
 time window around the trigger we wish to load
 
Property selectedBehaviour
 default behavioural type
 
Property verbose
 plot verbosity
 
Property p
 LFP plxReader object.
 
Property sp
 spike analysis object
 
Property LFPs
 trial parsed LFPs
 
Property ft
 fieldtrip structure parsed from .LFPs
 
Property results
 fieldtrip parsed results
 
Property selectedTrials
 selectedTrials: each cell is a trial list grouping
 
Property cutTrials
 
Property map
 variable selection map for the analysis groups
 
Property plotDestination
 external plot destination handle (see LFPMeta for an example)
 
Property lastFrequencyMethod
 last freq method used
 
Property bpfreq
 bandpass frequencies
 
Property bpnames
 bandpass frequency names
 
- Public Attributes inherited from analysisCore
Property doPlots
 generate plots?
 
Property baselineWindow
 +- time window (s) for baseline estimation/removal [-0.2 0]
 
Property measureRange
 default range (s) to measure values from
 
Property plotRange
 default range to plot data
 
Property rootDirectory
 root directory to check for data if files can't be found
 
Property gd
 getDensity stats object, used for group comparisons
 
Property options
 various stats values in a structure for different analyses
 
Property openUI
 is the UI opened?
 
- Public Attributes inherited from optickaCore
Property name
 object name
 
Property comment
 comment
 
Property verbose
 verbose logging, subclasses must assign this. This is normally logical true/false
 
Property dateStamp
 clock() dateStamp set on construction
 
Property uuid
 universal ID
 
Property paths
 storage of various paths
 
Property fullName
 The fullName is the object name combined with its uuid and class name.
 

Protected Member Functions

function parseLFPs (in me)
 Parse the LFP signals into trial structures.
 
function selectTrials (in me)
 selectTrials selects trials based on several filters
 
function drawTrialLFPs (in me, in h, in sel)
 
function nextChannel (in src, in ignoredArg)
 
function previousChannel (in src, in ignoredArg)
 
function clickMe (in src, in ignoredArg)
 
function drawAverageLFPs (in me)
 
function drawTimelockLFPs (in me)
 
function drawContinuousLFPs (in me)
 
function forwardPlot (in src, in ignoredArg)
 
function backPlot (in src, in ignoredArg)
 
function drawSpikeLFP (in me)
 
function drawBandPass (in me)
 
function drawLFPFrequencies (in me, in varargin)
 
function drawLFPFrequencyStats (in me, in name)
 
function plotpowline (in f, in p, in e, in lc, in ec)
 
function runChronuxAnalysis (in me, in tapers)
 chSpectrum chronux spectrum equivalent
 
function plot_matrix (in X, in t, in f, in plt, in Xerr, in zlims)
 
function plot_vector (in X, in f, in plt, in Xerr, in c, in w)
 
function getAverageTuningCurve (in me, in idx, in sel, in err)
 
function makeUI (in me, in varargin)
 
function runAnal (in src, in ignoredArg)
 
function togglePlots (in src, in ignoredArg)
 
function closeUI (in me, in varargin)
 
function updateUI (in me, in varargin)
 
function notifyUI (in me, in varargin)
 
- Protected Member Functions inherited from analysisCore
virtual function makeUI (in me)
 make the UI for the analysis object
 
virtual function closeUI (in me)
 close the UI for the analysis object
 
virtual function updateUI (in me)
 update the UI for the analysis object
 
function initialiseOptions (in me)
 initialise settings for fieldtrip time frequency analysis
 
function inheritPlxReader (in me, in p)
 Allows two analysis objects to share a single plxReader object. This is important in cases where for e.g. an LFPAnalysis object uses the same plexon file as its spikeAnalysis child used for spike-LFP anaysis.
 
function setSelection (in me, in in)
 set trials / var parsing from outside, override dialog, used when yoked to another analysis object, for example when spikeAnalysis is a child of LFPAnalysis
 
function initialiseStats (in me)
 initialise the statistics options, see setStats()
 
function formatByClass (in me, in dp, in dn)
 format data for ROC
 
function roc (in me, in data)
 ROC see http://www.subcortex.net/research/code/area_under_roc_curve.
 
function auc (in me, in data, in alpha, in flag, in nboot, in varargin)
 Area under ROC.
 
function aucBootstrap (in me, in data, in nboot, in flag, in H0)
 AUC bootstrap.
 
- Protected Member Functions inherited from optickaCore
function parseArgs (in me, in args, in allowedProperties)
 Sets properties from a structure or normal arguments pairs, ignores invalid or non-allowed properties.
 
function addArgs (in me, in args)
 
function setPaths (in me)
 Sets properties from a structure or normal arguments pairs, ignores invalid or non-allowed properties.
 
function getFonts (in me)
 set paths for object
 
function toStructure (in me)
 Converts properties to a structure.
 
function getType (in me, in in)
 
function logOutput (in me, in in, in message, in override)
 Give a metaproperty return the likely property class.
 
function salutation (in me, in varargin)
 Prints messages dependent on verbosity.
 

Protected Attributes

Property nLFPs
 number of LFP channels
 
Property nSelection
 selected LFP channel
 
- Protected Attributes inherited from analysisCore
Property panels
 UI panels.
 
Property yokedSelection
 do we yoke the selection to the parent object (e.g. LFPAnalysis > spikeAnalysis)
 
Property handles
 handles for the GUI
 
- Protected Attributes inherited from optickaCore
Property cloning
 are we cloning this from another object
 
Property mversion
 Matlab version number, this is transient so it is not saved.
 
Property sansFont
 sans font
 
Property monoFont
 monoFont
 
Property className
 class name
 
Property savePrefix
 save prefix generated from clock time
 
Property fullName_
 cached full name
 

Additional Inherited Members

- Static Public Member Functions inherited from analysisCore
static function doFFT (in p, in fs, in ff, in normalise, in useHanning)
 phaseDifference basic phase diff measurement
 
static function phaseDifference (in x, in y)
 phaseDifference basic phase diff measurement
 
static function phase (in x)
 phase basic phase measurement
 
static function subselectFieldTripTrials (in ft, in idx)
 subselectFieldTripTrials sub-select trials where the ft function fails to use cfg.trials
 
static function findNearest (in in, in value)
 find nearest value in a vector, if more than 1 index return the first
 
static function linearFit (in x, in y)
 
static function var2SE (in var, in dof)
 convert variance to standard error
 
static function rad2ang (in alphain, in rect, in rot)
 
static function ang2rad (in alpha)
 
static function stderr (in data, in type, in onlyerror, in alpha, in dim, in avgfn)
 
static function areabar (in xv, in yv, in ev, in c1, in alpha, in varargin)
 
static function pupilConversion (in value, in cal, in calSize)
 
static function cellArray2Num (in data)
 
static function optimalLayout (in len)
 calculates preferred row col layout for multiple plots
 
static function optimalColours (in n_colors, in bg, in func)
 make optimally different colours for plots Copyright 2010-2011 by Timothy E. Holy
 
static function parsecolor (in s)
 
static function colorstr2rgb (in c)
 
- Static Public Member Functions inherited from optickaCore
static function makeArgs (in args)
 Converts cell args to structure array.
 
static function addDefaults (in args, in defs)
 add default options to arg input
 
static function hasKey (in in, in key)
 check if a struct / object has a propery / field
 
static function getKeys (in device)
 PTB Get key presses, stops key bouncing.
 

Constructor & Destructor Documentation

◆ LFPAnalysis()

function LFPAnalysis::LFPAnalysis ( in  varargin)

Constructor.

Parameters
vararginsee parseArgs for more details
Returns
constructors return the object

Member Function Documentation

◆ backPlot()

function LFPAnalysis::backPlot ( in  src,
in  ignoredArg 
)
protected

◆ chSpectrum()

function LFPAnalysis::chSpectrum ( in  me,
in  tapers 
)
Parameters

return

◆ clickMe()

function LFPAnalysis::clickMe ( in  src,
in  ignoredArg 
)
protected

◆ closeUI()

function LFPAnalysis::closeUI ( in  me,
in  varargin 
)
protected
Parameters

return

◆ createSurrogate()

function LFPAnalysis::createSurrogate ( in  me,
in  varargin 
)

replaces the LFP signals with a noisy surrogate to test, you can change the surrogate parameters in the code, including randomising phase and having a timelocked burst of a particular frequency to test time frequency algorithms etc.

Parameters

return

◆ demeanLFP()

function set LFPAnalysis::demeanLFP ( in  me,
in  in 
)
Parameters

return

◆ drawAverageLFPs()

function LFPAnalysis::drawAverageLFPs ( in  me)
protected
Parameters

return

◆ drawBandPass()

function LFPAnalysis::drawBandPass ( in  me)
protected
Parameters

return

◆ drawContinuousLFPs()

function LFPAnalysis::drawContinuousLFPs ( in  me)
protected
Parameters

return

◆ drawLFPFrequencies()

function LFPAnalysis::drawLFPFrequencies ( in  me,
in  varargin 
)
protected
Parameters

return

◆ drawLFPFrequencyStats()

function LFPAnalysis::drawLFPFrequencyStats ( in  me,
in  name 
)
protected
Parameters

return

◆ drawSpikeLFP()

function LFPAnalysis::drawSpikeLFP ( in  me)
protected
Parameters

return

◆ drawTimelockLFPs()

function LFPAnalysis::drawTimelockLFPs ( in  me)
protected
Parameters

return

◆ drawTrialLFPs()

function LFPAnalysis::drawTrialLFPs ( in  me,
in  h,
in  sel 
)
protected
Parameters

return

◆ forwardPlot()

function LFPAnalysis::forwardPlot ( in  src,
in  ignoredArg 
)
protected

◆ ftAlphaPhase()

function LFPAnalysis::ftAlphaPhase ( in  me)

ftBandPass performs Leopold et al., 2003 type BLP

Parameters
orderof BP filter to use
downsamplewhether to down/resample after filtering
rectifywhether to rectify the responses
Returns

◆ ftBandPass()

function LFPAnalysis::ftBandPass ( in  me,
in  order,
in  downsample,
in  rectify 
)

ftBandPass performs Leopold et al., 2003 type BLP

Parameters
orderof BP filter to use
downsamplewhether to down/resample after filtering
rectifywhether to rectify the responses
Returns

◆ ftFrequencyAnalysis()

function LFPAnalysis::ftFrequencyAnalysis ( in  me,
in  cfg,
in  preset,
in  tw,
in  cycles,
in  smth,
in  width,
in  toi,
in  foi 
)
Parameters

return

◆ ftFrequencyStats()

function LFPAnalysis::ftFrequencyStats ( in  me,
in  name,
in  bline,
in  range 
)
Parameters

return

◆ ftHilbert()

function LFPAnalysis::ftHilbert ( in  me)

ftHilbert

Parameters
orderof BP filter to use
downsamplewhether to down/resample after filtering
rectifywhether to rectify the responses
Returns

◆ ftPreProcess()

function LFPAnalysis::ftPreProcess ( in  me,
in  cfg,
in  removeLineNoise 
)

Uses the Fieldtrip preprocessing functions if need be. This modifies the .ft property structure but not the raw .LFP property. To undo these changes you must use the getFieldTripLFPs() method to regenerate .ft.

Parameters
cfga fieldtrip cfg structure
removeLineNoisea boolean to remove line noise
Returns

◆ ftSpikeLFP()

function LFPAnalysis::ftSpikeLFP ( in  me,
in  unit,
in  interpolate 
)
Parameters

return

◆ ftTimeLockAnalysis()

function LFPAnalysis::ftTimeLockAnalysis ( in  me,
in  cfg,
in  statcfg 
)

Performs a FieldTrip timelock analysis on our parsed data.

Parameters

return

◆ getAverageTuningCurve()

function LFPAnalysis::getAverageTuningCurve ( in  me,
in  idx,
in  sel,
in  err 
)
protected
Parameters

return

◆ getFieldTripLFPs()

function LFPAnalysis::getFieldTripLFPs ( in  me,
in  varargin 
)

Parse the Plexon plxReader LFP data (itself parsed into trials) into a fieldtrip structure, stored in the .ft property and also returned to the commandline if needed.

Parameters

return ft fieldtrip structure

◆ getFiles()

function LFPAnalysis::getFiles ( in  me,
in  force 
)

getFiles loads the requisite files before parsing

Parameters
forceforce us to ask for new filenames
Returns

◆ lazyParse()

function LFPAnalysis::lazyParse ( in  me,
in  varargin 
)

This only parses some data if there is no equivalent structure yet.

Parameters

return

◆ LFPWindow()

function set LFPAnalysis::LFPWindow ( in  me,
in  in 
)
Parameters

return

◆ makeSurrogate()

function LFPAnalysis::makeSurrogate ( )

◆ makeUI()

function LFPAnalysis::makeUI ( in  me,
in  varargin 
)
protected
Parameters

return

◆ nextChannel()

function LFPAnalysis::nextChannel ( in  src,
in  ignoredArg 
)
protected

◆ nLFPs()

function get LFPAnalysis::nLFPs ( in  me)
Parameters

return

◆ notifyUI()

function LFPAnalysis::notifyUI ( in  me,
in  varargin 
)
protectedvirtual
Parameters

return

Reimplemented from analysisCore.

◆ nSelection()

function get LFPAnalysis::nSelection ( in  me)
Parameters

return

◆ parse()

function LFPAnalysis::parse ( in  me,
in  varargin 
)

parse is the major first data parsing step. This performs all the steps from checking paths are still correct, parsing the Plexon events (our trial and behavioural data), parsing raw LFPs into the trial structures, and finally converting into a .ft fieldtrip structure.

Parameters

return

◆ parseLFPs()

function LFPAnalysis::parseLFPs ( in  me)
protected

Parse the LFP signals into trial structures.

Parameters

return

◆ parseSpikes()

function LFPAnalysis::parseSpikes ( in  me,
in  varargin 
)

This LFP object has a spikeAnalysis object as a property so we can use a different spike sort to the parent LFP plexon file. But we have to ensure that the spikeAnalysis is 'locked' or 'yoked' to the LFPAnalysis object settings and selection. This function makes surethis locking occurs...

Parameters

return

◆ plot()

function LFPAnalysis::plot ( in  me,
in  varargin 
)
Parameters

return

◆ plot_matrix()

function LFPAnalysis::plot_matrix ( in  X,
in  t,
in  f,
in  plt,
in  Xerr,
in  zlims 
)
protected

◆ plot_vector()

function LFPAnalysis::plot_vector ( in  X,
in  f,
in  plt,
in  Xerr,
in  c,
in  w 
)
protected

◆ plotpowline()

function LFPAnalysis::plotpowline ( in  f,
in  p,
in  e,
in  lc,
in  ec 
)
protected

◆ plotSurrogates()

function LFPAnalysis::plotSurrogates ( )

◆ plotTogether()

function LFPAnalysis::plotTogether ( in  me,
in  varargin 
)
Parameters

return

◆ previousChannel()

function LFPAnalysis::previousChannel ( in  src,
in  ignoredArg 
)
protected

◆ reparse()

function LFPAnalysis::reparse ( in  me,
in  varargin 
)

reparse data after an initial parse, takes less time.

Parameters

return

◆ runAnal()

function LFPAnalysis::runAnal ( in  src,
in  ignoredArg 
)
protected

◆ runChronuxAnalysis()

function LFPAnalysis::runChronuxAnalysis ( in  me,
in  tapers 
)
protected

chSpectrum chronux spectrum equivalent

◆ save()

function LFPAnalysis::save ( in  me,
in  varargin 
)

saves this object as a MAT file, object renamed to 'lfp'

Parameters

return

◆ select()

function LFPAnalysis::select ( in  me,
in  varargin 
)

selects trials/options based on many filters

Parameters

return

◆ selectTrials()

function LFPAnalysis::selectTrials ( in  me)
protected

selectTrials selects trials based on several filters

Parameters

return

◆ togglePlots()

function LFPAnalysis::togglePlots ( in  src,
in  ignoredArg 
)
protected

◆ toggleSaccadeRealign()

function LFPAnalysis::toggleSaccadeRealign ( in  me,
in  varargin 
)

toggle between stimulus=0 and post-stimulus sccade=0 so we can align spikes and LFPs to either event

Parameters

return

◆ updateUI()

function LFPAnalysis::updateUI ( in  me,
in  varargin 
)
protected
Parameters

return

◆ useSpikeSelect()

function LFPAnalysis::useSpikeSelect ( in  me,
in  val 
)

As we can also select trials from the spikeanalysis object, this function allows us to let the LFPAnalysis use the spikeanalysis selection.

Parameters

return

Member Data Documentation

◆ bpfreq

Property LFPAnalysis::bpfreq

bandpass frequencies

◆ bpnames

Property LFPAnalysis::bpnames

bandpass frequency names

◆ cutTrials

Property LFPAnalysis::cutTrials

trials to remove in reparsing. Our raw data plot allows us to visually remove trials, we can also call fieldtrip preprocessing code too.

◆ demeanLFP

Property LFPAnalysis::demeanLFP

remove the mean voltage offset from the individual trials?

◆ dir

Property LFPAnalysis::dir

data directory

◆ ft

Property LFPAnalysis::ft

fieldtrip structure parsed from .LFPs

◆ lastFrequencyMethod

Property LFPAnalysis::lastFrequencyMethod

last freq method used

◆ lfpfile

Property LFPAnalysis::lfpfile

plexon file containing the LFP data

LFPAnalysis Wraps native and fieldtrip analysis around our PLX/PL2 reading, taking our trial selection and behavioural selection into account. As we can do spike-LFP anaysis this asks for a spike data file, it can be the same as the LFP file or different if we resorted the data.

◆ LFPs

Property LFPAnalysis::LFPs

trial parsed LFPs

◆ LFPWindow

Property LFPAnalysis::LFPWindow

time window around the trigger we wish to load

◆ map

Property LFPAnalysis::map

variable selection map for the analysis groups

◆ nLFPs

Property LFPAnalysis::nLFPs
protected

number of LFP channels

◆ nSelection

Property LFPAnalysis::nSelection
protected

selected LFP channel

◆ p

Property LFPAnalysis::p

LFP plxReader object.

◆ plotDestination

Property LFPAnalysis::plotDestination

external plot destination handle (see LFPMeta for an example)

◆ results

Property LFPAnalysis::results

fieldtrip parsed results

◆ selectedBehaviour

Property LFPAnalysis::selectedBehaviour

default behavioural type

◆ selectedLFP

Property LFPAnalysis::selectedLFP

default LFP channel

◆ selectedTrials

Property LFPAnalysis::selectedTrials

selectedTrials: each cell is a trial list grouping

◆ sp

Property LFPAnalysis::sp

spike analysis object

◆ spikefile

Property LFPAnalysis::spikefile

plexon file containing the spike data

◆ verbose

Property LFPAnalysis::verbose

plot verbosity


The documentation for this class was generated from the following file: