Opticka 2.16.1
Opticka is an experiment manager for behavioral research.
Loading...
Searching...
No Matches
analysisCore Class Reference

analysisCore base class inherited by other analysis classes. analysisCore is itself derived from optickaCore. Provides a set of shared methods and some core properties and stats GUI for various analysis classes. More...

Detailed Description

analysisCore base class inherited by other analysis classes. analysisCore is itself derived from optickaCore. Provides a set of shared methods and some core properties and stats GUI for various analysis classes.

Copyright ©2014-2022 Ian Max Andolina — released: LGPL3, see LICENCE.md

Inheritance diagram for analysisCore:

Public Member Functions

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
 

Static Public Member Functions

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.
 

Public Attributes

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

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
 
virtual function notifyUI (in me, in varargin)
 modify text of 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 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
 

Constructor & Destructor Documentation

◆ analysisCore()

function analysisCore::analysisCore ( in  varargin)

Class constructor.

Parameters
vararginargs are passed as a set of properties which is parsed by optickaCore.parseArgs
Returns
instance of class.

Member Function Documentation

◆ ang2rad()

static function analysisCore::ang2rad ( in  alpha)
static

◆ areabar()

static function analysisCore::areabar ( in  xv,
in  yv,
in  ev,
in  c1,
in  alpha,
in  varargin 
)
static

Plots X and Y value data with error bar shown as a shaded area. Use: areabar(x,y,error,c1,alpha,plotoptions) where c1 is the colour of the shaded options and plotoptions are passed to the line plot

◆ auc()

function analysisCore::auc ( in  me,
in  data,
in  alpha,
in  flag,
in  nboot,
in  varargin 
)
protected

Area under ROC.

Parameters
me- object
data- [class , score] matrix
alpha- level for confidence intervals (eg., enter 0.05 if you want 95% CIs)
flag- 'hanley' yields Hanley-McNeil (1982) asymptotic CI; 'maxvar' yields maximum variance CI;'mann-whitney';'logit';'boot' yields bootstrapped CI (DEFAULT)
nboot- if 'boot' is set, specifies # of resamples, default=1000
varargin- additional arguments to pass to BOOTCI, only valid for 'boot' this assumes you have the STATs toolbox, otherwise it's ignored and a crude percentile bootstrap is estimated.
Returns
A - area under ROC
Aci - confidence intervals

◆ aucBootstrap()

function analysisCore::aucBootstrap ( in  me,
in  data,
in  nboot,
in  flag,
in  H0 
)
protected

AUC bootstrap.

◆ baselineWindow()

function set analysisCore::baselineWindow ( in  me,
in  in 
)
Parameters

return

◆ cellArray2Num()

static function analysisCore::cellArray2Num ( in  data)
static

cellArray2Num

out = cellArray2Num(data)

◆ checkPaths()

function analysisCore::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.

Parameters
varargin
Returns

◆ closeUI()

virtual function analysisCore::closeUI ( in  me)
protectedvirtual

close the UI for the analysis object

Reimplemented in LFPMeta.

◆ colorstr2rgb()

static function analysisCore::colorstr2rgb ( in  c)
static

◆ doFFT()

static function analysisCore::doFFT ( in  p,
in  fs,
in  ff,
in  normalise,
in  useHanning 
)
static

phaseDifference basic phase diff measurement

Parameters
x- first signal in the time domain
y- second signal in the time domain
Returns
phase - phase difference Y -> X, degrees
angX - phase X, degrees
angY - phase Y, degrees

◆ findNearest()

static function analysisCore::findNearest ( in  in,
in  value 
)
static

find nearest value in a vector, if more than 1 index return the first

Parameters
ininput vector
valuevalue to find
Returns
idx index position of nearest value
val value of nearest value
delta the difference between val and value

◆ formatByClass()

function analysisCore::formatByClass ( in  me,
in  dp,
in  dn 
)
protected

format data for ROC

Parameters
dpscores for "signal" distribution
dnscores for "noise" distribution
Returns
data - [class , score] matrix

◆ GUI()

function analysisCore::GUI ( in  me,
in  varargin 
)

show a GUI if available for analysis object

Parameters

return

◆ inheritPlxReader()

function analysisCore::inheritPlxReader ( in  me,
in  p 
)
protected

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.

Parameters

◆ initialise()

function analysisCore::initialise ( in  me,
in  varargin 
)
Parameters

return

◆ initialiseOptions()

function analysisCore::initialiseOptions ( in  me)
protected

initialise settings for fieldtrip time frequency analysis

Parameters

return

◆ initialiseStats()

function analysisCore::initialiseStats ( in  me)
protected

initialise the statistics options, see setStats()

Parameters

return

◆ linearFit()

static function analysisCore::linearFit ( in  x,
in  y 
)
static
Parameters

return

◆ makeUI()

virtual function analysisCore::makeUI ( in  me)
protectedvirtual

make the UI for the analysis object

Reimplemented in LFPMeta.

◆ notifyUI()

virtual function analysisCore::notifyUI ( in  me,
in  varargin 
)
protectedvirtual

modify text of the UI for the analysis object

Reimplemented in eyelinkAnalysis, iRecAnalysis, LFPAnalysis, LFPMeta, spikeAnalysis, and tobiiAnalysis.

◆ optimalColours()

static function analysisCore::optimalColours ( in  n_colors,
in  bg,
in  func 
)
static

make optimally different colours for plots Copyright 2010-2011 by Timothy E. Holy

Parameters
n_colors

◆ optimalLayout()

static function analysisCore::optimalLayout ( in  len)
static

calculates preferred row col layout for multiple plots

Parameters
lenlength of data points to plot
Returns
row number of rows
col number of columns

◆ optimiseSize()

function analysisCore::optimiseSize ( in  me)

optimiseSize remove the raw matrices etc. to reduce memory

◆ parsecolor()

static function analysisCore::parsecolor ( in  s)
static

◆ phase()

static function analysisCore::phase ( in  x)
static

phase basic phase measurement

Parameters
x- signal in the time domain
Returns
phase - phase, degrees

◆ phaseDifference()

static function analysisCore::phaseDifference ( in  x,
in  y 
)
static

phaseDifference basic phase diff measurement

Parameters
x- first signal in the time domain
y- second signal in the time domain
Returns
phase - phase difference Y -> X, degrees
angX - phase X, degrees
angY - phase Y, degrees

◆ pupilConversion()

static function analysisCore::pupilConversion ( in  value,
in  cal,
in  calSize 
)
static

[mm, cf] = pupilConversion(value, calibration, calSize) eyelink uses arbitrary area units, convert to mm using this function e.g. [mm, rs] = pupilConversion(2000, 8890, 8)

◆ rad2ang()

static function analysisCore::rad2ang ( in  alphain,
in  rect,
in  rot 
)
static

◆ roc()

function analysisCore::roc ( in  me,
in  data 
)
protected

ROC see http://www.subcortex.net/research/code/area_under_roc_curve.

Parameters
data- [class , score] matrix
Returns
tp - true positive rate
fp - false positive rate

◆ setSelection()

function analysisCore::setSelection ( in  me,
in  in 
)
protected

set trials / var parsing from outside, override dialog, used when yoked to another analysis object, for example when spikeAnalysis is a child of LFPAnalysis

Parameters
instructure
Returns

◆ setStats()

function analysisCore::setStats ( in  me,
in  varargin 
)

setStats set up the stats structure used in many Fieldtrip analyses

Parameters

return

◆ setTimeFreqOptions()

function analysisCore::setTimeFreqOptions ( in  me,
in  varargin 
)

setTimeFreqOptions for Fieldtrip time freq analysis of LFP data

Parameters

return

◆ showEyePlots()

function analysisCore::showEyePlots ( in  me,
in  varargin 
)

showEyePlots if we have a linked eyelink file show the raw data plots

Parameters

return

◆ showInfo()

function analysisCore::showInfo ( in  me,
in  varargin 
)

showInfo shows the info box for the plexon parsed data

Parameters

return

◆ stderr()

static function analysisCore::stderr ( in  data,
in  type,
in  onlyerror,
in  alpha,
in  dim,
in  avgfn 
)
static

Plots mean and error choosable by switches

[mean,error] = stderr(data,type,onlyerror,alpha)

Switches: SE 2SE SD 2SD 3SD V FF CV AF

◆ subselectFieldTripTrials()

static function analysisCore::subselectFieldTripTrials ( in  ft,
in  idx 
)
static

subselectFieldTripTrials sub-select trials where the ft function fails to use cfg.trials

Parameters
ftfieldtrip structure
idxindex to use for selection
Returns
ftout modified ft structure

◆ updateUI()

virtual function analysisCore::updateUI ( in  me)
protectedvirtual

update the UI for the analysis object

Reimplemented in LFPMeta.

◆ var2SE()

static function analysisCore::var2SE ( in  var,
in  dof 
)
static

convert variance to standard error

Parameters
varvariance
dofdegrees of freedom
Returns
err standard error

Member Data Documentation

◆ baselineWindow

Property analysisCore::baselineWindow

+- time window (s) for baseline estimation/removal [-0.2 0]

◆ doPlots

Property analysisCore::doPlots

generate plots?

◆ gd

Property analysisCore::gd

getDensity stats object, used for group comparisons

◆ handles

Property analysisCore::handles
protected

handles for the GUI

◆ measureRange

Property analysisCore::measureRange

default range (s) to measure values from

◆ openUI

Property analysisCore::openUI

is the UI opened?

◆ options

Property analysisCore::options

various stats values in a structure for different analyses

◆ panels

Property analysisCore::panels
protected

UI panels.

◆ plotRange

Property analysisCore::plotRange

default range to plot data

◆ rootDirectory

Property analysisCore::rootDirectory

root directory to check for data if files can't be found

◆ yokedSelection

Property analysisCore::yokedSelection
protected

do we yoke the selection to the parent object (e.g. LFPAnalysis > spikeAnalysis)


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