PKd=ANIN5aaspykeutils-0.2.0/genindex.html Index — spykeutils 0.2.0 documentation

Index

A | B | C | D | E | F | G | I | L | M | N | O | P | R | S | U

A

aligned_spike_trains() (in module spykeutils.rate_estimation)
analog_signal_array_to_analog_signals() (in module spykeutils.conversions)
analog_signal_arrays() (DataProvider method)
analog_signal_arrays_by_channelgroup() (DataProvider method)
analog_signal_arrays_by_channelgroup_and_segment() (DataProvider method)
analog_signal_arrays_by_segment() (DataProvider method)
analog_signal_arrays_by_segment_and_channelgroup() (DataProvider method)
analog_signals() (DataProvider method)
analog_signals_by_channel() (DataProvider method)
analog_signals_by_channel_and_segment() (DataProvider method)
analog_signals_by_segment() (DataProvider method)
analog_signals_by_segment_and_channel() (DataProvider method)
AnalysisPlugin (class in spykeutils.plugin.analysis_plugin)

B

begin() (ProgressIndicator method)
binned_spike_trains() (in module spykeutils.rate_estimation)
blocks() (DataProvider method)

C

calculate_overlap_fp_fn() (in module spykeutils.sorting_quality_assesment)
calculate_refperiod_fp() (in module spykeutils.sorting_quality_assesment)
CancelException
collapsed_spike_trains() (in module spykeutils.rate_estimation)
configure() (AnalysisPlugin method)
correlogram() (in module spykeutils.correlations)

D

data_dict() (DataProvider method)
DataProvider (class in spykeutils.plugin.data_provider)
done() (ProgressIndicator method)

E

epoch_array_to_epochs() (in module spykeutils.conversions)
epoch_arrays() (DataProvider method)
epochs() (DataProvider method)
event_array_to_events() (in module spykeutils.conversions)
event_arrays() (DataProvider method)
events() (DataProvider method)

F

from_data() (spykeutils.plugin.data_provider.DataProvider class method)

G

get_name() (AnalysisPlugin method)
get_parameters() (AnalysisPlugin method)
get_refperiod_violations() (in module spykeutils.sorting_quality_assesment)

I

ignores_cancel() (in module spykeutils.progress_indicator)

L

labeled_epochs() (DataProvider method)
labeled_events() (DataProvider method)
load() (AnalysisPlugin method)

M

minimum_spike_train_interval() (in module spykeutils.rate_estimation)

N

num_analog_signal_arrays() (DataProvider method)
num_analog_signals() (DataProvider method)

O

optimal_gauss_kernel_size() (in module spykeutils.rate_estimation)

P

ProgressIndicator (class in spykeutils.progress_indicator)
psth() (in module spykeutils.rate_estimation)

R

recording_channel_groups() (DataProvider method)
recording_channels() (DataProvider method)

S

save() (AnalysisPlugin method)
segments() (DataProvider method)
selection_blocks() (DataProvider method)
set_parameters() (AnalysisPlugin method)
set_status() (ProgressIndicator method)
set_ticks() (ProgressIndicator method)
spike_amplitude_histogram() (in module spykeutils.stationarity)
spike_density_estimation() (in module spykeutils.rate_estimation)
spike_train_to_spikes() (in module spykeutils.conversions)
spike_trains() (DataProvider method)
spike_trains_by_segment() (DataProvider method)
spike_trains_by_segment_and_unit() (DataProvider method)
spike_trains_by_unit() (DataProvider method)
spike_trains_by_unit_and_segment() (DataProvider method)
spikes() (DataProvider method)
spikes_by_segment() (DataProvider method)
spikes_by_segment_and_unit() (DataProvider method)
spikes_by_unit() (DataProvider method)
spikes_by_unit_and_segment() (DataProvider method)
spikes_to_spike_train() (in module spykeutils.conversions)
SpykeException (class in spykeutils)
spykeutils (module)
spykeutils.conversions (module)
spykeutils.correlations (module)
spykeutils.plugin (module)
spykeutils.plugin.analysis_plugin (module)
spykeutils.plugin.data_provider (module)
spykeutils.plugin.gui_data (module)
spykeutils.progress_indicator (module)
spykeutils.rate_estimation (module)
spykeutils.sorting_quality_assesment (module)
spykeutils.stationarity (module)
start() (AnalysisPlugin method)
step() (ProgressIndicator method)

U

units() (DataProvider method)

Project Versions

PKd=Ah ``spykeutils-0.2.0/objects.inv# Sphinx inventory version 2 # Project: spykeutils # Version: 0.2 # The remainder of this file is compressed using zlib. xYK WX^v{[{CH' h_vIJ90oT ]"d6}vZu/f+Woo]w5FXX G]CO=aRo1k pN?l>漄 |Hwu1sm-HVHT?nIԾ>eS*jÈNn8"`ʍ'id] 5+Xj_G"#;mdv%GSr Љ9FrYWuEY m^clo[À["{acyAp;P!6֙H BЈ50ghaY񴡤(% 0jWDذ]2%= [lBm*XJ'DW| ;INEns,>v\vfD(*VS%>s0;\"B\`(T%Tӓ5m"İ=PMNema`s:qL/iG&Z}d6KLh@xl,-8i r `DsvU]w@$2V+b GHH^E7GQ (n4`.F#EH#c~Ilé<G $ 14 ^ZZ]M)q2edHE}QR Python Module Index — spykeutils 0.2.0 documentation

Project Versions

PKd=AvN**spykeutils-0.2.0/index.html Welcome to the documentation of spykeutils! — spykeutils 0.2.0 documentation

Welcome to the documentation of spykeutils!

Based on the Neo framework, spykeutils is a Python library for analyzing and plotting neurophysiological data. It can be used by itself or in conjunction with Spyke Viewer, a multi-platform GUI application for navigating electrophysiological datasets.

Contents:

Indices and tables

Project Versions

Table Of Contents

Next topic

Requirements

This Page

PKd=Aĺ(,,spykeutils-0.2.0/searchindex.jsSearch.setIndex({objects:{"":{spykeutils:[2,0,1,""]},"spykeutils.plugin.data_provider":{DataProvider:[1,3,1,""]},"spykeutils.conversions":{analog_signal_array_to_analog_signals:[2,2,1,""],spikes_to_spike_train:[2,2,1,""],epoch_array_to_epochs:[2,2,1,""],spike_train_to_spikes:[2,2,1,""],event_array_to_events:[2,2,1,""]},"spykeutils.plugin.analysis_plugin":{AnalysisPlugin:[1,3,1,""]},"spykeutils.progress_indicator":{ProgressIndicator:[2,3,1,""],ignores_cancel:[2,2,1,""],CancelException:[2,4,1,""]},"spykeutils.progress_indicator.ProgressIndicator":{begin:[2,1,1,""],done:[2,1,1,""],step:[2,1,1,""],set_ticks:[2,1,1,""],set_status:[2,1,1,""]},"spykeutils.stationarity":{spike_amplitude_histogram:[2,2,1,""]},spykeutils:{conversions:[2,0,1,""],rate_estimation:[2,0,1,""],stationarity:[2,0,1,""],sorting_quality_assesment:[2,0,1,""],correlations:[2,0,1,""],progress_indicator:[2,0,1,""],SpykeException:[2,3,1,""],plugin:[1,0,1,""]},"spykeutils.rate_estimation":{collapsed_spike_trains:[2,2,1,""],spike_density_estimation:[2,2,1,""],aligned_spike_trains:[2,2,1,""],binned_spike_trains:[2,2,1,""],psth:[2,2,1,""],minimum_spike_train_interval:[2,2,1,""],optimal_gauss_kernel_size:[2,2,1,""]},"spykeutils.plugin.analysis_plugin.AnalysisPlugin":{load:[1,1,1,""],get_parameters:[1,1,1,""],configure:[1,1,1,""],get_name:[1,1,1,""],start:[1,1,1,""],set_parameters:[1,1,1,""],save:[1,1,1,""]},"spykeutils.correlations":{correlogram:[2,2,1,""]},"spykeutils.plugin":{data_provider:[1,0,1,""],analysis_plugin:[1,0,1,""],gui_data:[1,0,1,""]},"spykeutils.plugin.data_provider.DataProvider":{analog_signals:[1,1,1,""],analog_signals_by_segment_and_channel:[1,1,1,""],data_dict:[1,1,1,""],spike_trains_by_segment_and_unit:[1,1,1,""],epochs:[1,1,1,""],analog_signal_arrays_by_channelgroup_and_segment:[1,1,1,""],num_analog_signal_arrays:[1,1,1,""],segments:[1,1,1,""],analog_signals_by_channel_and_segment:[1,1,1,""],spike_trains_by_unit:[1,1,1,""],spikes_by_unit:[1,1,1,""],recording_channel_groups:[1,1,1,""],num_analog_signals:[1,1,1,""],analog_signal_arrays:[1,1,1,""],analog_signal_arrays_by_segment_and_channelgroup:[1,1,1,""],spikes_by_segment_and_unit:[1,1,1,""],analog_signals_by_channel:[1,1,1,""],units:[1,1,1,""],spike_trains:[1,1,1,""],events:[1,1,1,""],recording_channels:[1,1,1,""],blocks:[1,1,1,""],from_data:[1,5,1,""],epoch_arrays:[1,1,1,""],analog_signal_arrays_by_segment:[1,1,1,""],spike_trains_by_unit_and_segment:[1,1,1,""],spike_trains_by_segment:[1,1,1,""],labeled_epochs:[1,1,1,""],spikes_by_unit_and_segment:[1,1,1,""],spikes:[1,1,1,""],spikes_by_segment:[1,1,1,""],analog_signal_arrays_by_channelgroup:[1,1,1,""],event_arrays:[1,1,1,""],analog_signals_by_segment:[1,1,1,""],selection_blocks:[1,1,1,""],labeled_events:[1,1,1,""]},"spykeutils.sorting_quality_assesment":{get_refperiod_violations:[2,2,1,""],calculate_overlap_fp_fn:[2,2,1,""],calculate_refperiod_fp:[2,2,1,""]}},terms:{all:[2,5,1],code:1,edg:5,illustr:5,skip:5,four:5,known:4,scalar:2,correl:2,follow:[2,4,5,1],sould:2,millisecond:1,depend:[4,1],estim:[0,5,2],calculate_refperiod_fp:2,recording_channel_group:1,under:2,suitabl:1,deserialize_paramet:1,everi:[2,1],string:[2,1],fals:[2,1],serialize_paramet:1,wave:5,consider_guiparam:1,ident:2,veri:[2,5],affect:1,brows:4,relev:1,analog_signal_arrays_by_channelgroup:1,epoch_arrai:[2,1],gui:[0,2,1],list:[2,5,1],iter:2,correct:2,"try":2,small:5,analogsignalarrai:[2,1],refperiod:2,dimens:2,prevent:4,direct:2,rate:[2,5],pass:2,download:[0,4],further:1,append:5,num_bin:2,neo:[0,4,5,2,1],compar:2,neg:2,calcul:2,spikes_by_unit:1,uniform:2,current:[2,4,1],version:4,spykeview:1,analog_signal_arrays_by_segment_and_channelgroup:1,"new":[2,1],shimazaki:2,order:2,method:[2,1],acesss:1,situat:4,gener:[2,5],error:2,boolitem:1,len:2,sine:5,sinc:5,interpret:2,convert:[2,1],convers:2,hdf5:1,correlogram:2,larger:5,dataproviderneo:1,trial:5,doctest:5,implement:[2,1],some_tim:1,sourc:[2,1],appli:2,modul:[0,5,2,1],prefer:5,bin_siz:[2,5],visibl:[2,5],instal:[0,4,5,1],total:2,unit:[2,5,1],plot:[0,3,4,5,2],from:[2,4,5,1],describ:2,would:5,peri:[2,5],shinomoto:2,dure:2,websit:4,superposit:2,call:[5,1],spike:[0,5,2,1],no_channelgroup:1,type:[2,1],more:[2,1],sort:2,flat:5,desir:2,get_nam:1,no_unit:1,visual:1,train:[2,5,1],templat:2,neurosci:2,easiest:4,must:2,none:[2,1],data_provid:[2,1],restor:1,setup:4,work:[2,4,5,1],annot:2,minimum:2,can:[0,4,5,2,1],purpos:[5,1],def:1,instantan:[2,5],overrid:1,cancelexcept:2,encapsul:1,give:[2,5,1],process:[2,1],share:2,indic:[0,2,1],high:2,calculate_overlap_fp_fn:2,want:[4,5],serial:1,occur:2,alwai:[2,4],spike_density_estim:[2,5],multipl:[2,5,1],anoth:2,data_dir:1,write:1,how:4,sig:5,pure:4,instead:[2,5,1],simpl:2,sin:5,overridden:1,clone:4,after:2,rate_estim:[2,5],befor:[2,4],mai:2,end:2,data:[0,4,5,2,1],demonstr:5,github:4,third:2,spyke:[0,2,1],classmethod:1,correspond:2,assign:2,maximum_kernel:5,inform:1,environ:1,analysis_plugin:[2,1],spike_trains_by_seg:1,origin:2,over:2,becaus:[5,1],outer:2,hierarchi:[5,1],paramet:[2,4,1],perfect:2,conjunct:0,group:2,chosen:2,ignores_cancel:2,epoch:[2,1],better:1,platform:0,window:5,persist:1,cross:2,main:1,easier:2,non:1,no_channel:1,"return":[2,5,1],thei:[2,4,1],python:[0,4,1],framework:0,spike_amplitude_histogram:2,half:1,now:5,assess:2,max_lag:2,name:[2,1],sampling_r:5,spike_train_to_spik:2,staionar:2,linspac:5,separ:[2,5],easili:1,each:[2,5],debug:2,found:2,complet:[2,5],mean:2,just:[2,1],analog_signals_by_segment_and_channel:1,selection_block:1,gaussian:[2,5],realli:5,set_statu:2,our:5,happen:5,event:[2,1],shown:[2,5],referenc:2,space:2,crosscorrelogram:2,content:[0,4],hill:2,print:1,prewhiten:2,earlier:2,navig:0,advanc:2,pleas:4,get_refperiod_viol:2,given:[2,1],standard:2,base:[0,5,2,1],dictionari:[2,5,1],latest:4,index2:2,index1:2,afterward:1,thrown:2,save_guiparam:1,could:2,area:[2,5],round:5,length:2,propos:2,gauss_kernel:2,first:[2,5,1],oper:[2,1],rand:5,rang:[2,5],directli:[2,4,1],onc:[2,4],arrai:[2,5,1],bar_plot:5,qualiti:2,number:[2,1],instruct:4,alreadi:1,done:2,hould:1,stabl:4,open:[5,1],spiketrain:[2,5,1],size:[2,5],differ:[2,1],returnd:1,start:[2,5,1],caught:2,smoother:5,construct:2,stimulu:[2,5],attach:[2,1],toi:5,master:4,too:[2,5],accept:2,"final":5,store:1,low:5,consol:[2,1],option:[2,4,1],relationship:[2,5],especi:2,copi:[2,1],setuptool:4,specifi:[2,1],part:4,mostli:1,exactli:2,than:2,include_array_epoch:1,serv:1,provid:1,second:[2,1],structur:5,str:1,were:[2,5],posit:2,"function":[2,4,5,1],comput:[2,4],no_seg:1,viewer:[0,2,1],ani:2,packag:[0,1,2,3,4,5],have:[2,4,1],tabl:[0,4,1],need:[2,4,1],element:[2,1],border:2,analog_signals_by_seg:1,self:1,violat:2,rproepp:4,note:[2,4,5],also:[4,5,1],exampl:[0,4,5,1],take:[2,4,5],which:[2,5,1],noth:2,singl:2,begin:2,sure:4,unless:4,distribut:2,num_spik:2,normal:2,object:[2,4,5,1],most:[2,4,5,1],spike_train:[2,5,1],regular:[5,1],segment:[2,5,1],"class":[2,1],later:2,cover:2,spikes_by_unit_and_seg:1,doe:2,dummi:[2,1],determin:[2,1],left:2,show:[2,5],random:5,event_array_to_ev:2,distanc:2,find:[2,5],access:1,onli:[2,5,1],neurophysiolog:0,randn:5,nois:[2,5],configur:1,analog_signal_arrays_by_seg:1,data_provider_neo:1,should:[2,1],optimal_gauss_kernel_s:2,analog_signals_by_channel_and_seg:1,dict:[2,1],analyz:[0,5],spikes_by_segment_and_unit:1,analog_signals_by_channel:1,include_array_ev:1,folder:[4,1],psth:[0,5,2],data_dict:1,count:2,get:4,familiar:4,stop:2,obtain:1,cannot:1,num_step:2,progress:[2,1],report:[2,1],recalcul:2,requir:[0,4,2],bar:5,contain:[2,4,5,1],where:[2,5,1],kernel:[2,5],set:[2,1],maximum:2,datatyp:1,eviron:1,see:[2,4],exampleanalysi:1,result:[2,4,5,1],close:1,timelag:2,analog:[2,5,1],sorting_quality_asses:2,statu:2,label:1,between:5,"import":[5,1],rate_correct:2,attribut:1,altern:4,kei:1,weak:5,analysisplugin:1,labeled_ev:1,here:5,otherwis:2,recording_channel:1,addit:[2,4,5,1],both:[2,5,1],last:2,get_paramet:1,plugin:[2,1],equal:2,equat:2,mani:[2,4,5],com:4,load:[5,1],binned_spike_train:2,point:[2,5,1],instanti:1,overview:4,period:2,cancel:2,respect:[4,1],assum:2,esim:5,recordingchannelgroup:1,becom:5,evalu:2,event_arrai:[2,1],numpi:2,three:2,been:[2,1],gui_data:[2,1],valu:[2,5,1],optimize_step:[2,5],valueerror:2,spike_trains_by_unit_and_seg:1,fire:5,logspac:5,search:0,clearli:5,spikes_by_seg:1,func:2,spykeutil:[0,1,2,3,4,5],present:[4,1],"case":[2,5],refractori:2,multi:0,therefor:[2,4,5],look:[4,5],guidata:1,align:2,properti:2,defin:1,"while":[2,5],pairwis:2,abov:2,analog_sign:1,pytabl:[4,1],margin:5,num_analog_sign:1,readi:[5,1],guiqwt:[4,5],neuron:5,them:4,epoch_array_to_epoch:2,cluster:2,floatitem:1,scipi:[4,5],new_statu:2,st_dict:5,decor:2,develop:4,welcom:0,perform:1,make:4,belong:1,eventarrai:[2,1],same:[2,5,1],progressind:[2,1],member:1,uniform_y_scal:2,spykeexcept:2,descend:2,document:0,higher:2,http:4,optim:[2,5],effect:2,covari:2,rais:2,user:2,include_waveform:2,recent:1,subpackag:[0,2],lower:1,appropri:1,off:2,kernel_s:[2,5],whole:2,well:5,inherit:1,without:1,thi:[2,5,1],choos:5,dimension:2,usual:5,collapsed_spike_train:2,aligned_spike_train:2,identifi:1,entri:[2,1],execut:1,less:2,total_tim:2,spike_trains_by_segment_and_unit:1,detail:2,shape:[2,5],yet:4,cut:2,easi:4,except:2,param:1,other:[2,1],densiti:[0,5,2],input:2,save:1,bin:[2,5],applic:0,read:1,print_mor:1,sweep:2,tick:2,apart:1,like:[2,5],arbitrari:1,signal:[0,5,2,1],dataprovid:1,integ:1,server:1,collect:4,api:[0,4,2],index:[0,4,2,1],channel:2,page:[0,4],two:[2,5,1],encount:2,spikes_to_spike_train:2,titl:2,manual:5,interv:5,creation:5,some:[4,5,1],intern:1,sampl:[0,5],analog_signal_arrays_by_channelgroup_and_seg:1,librari:0,lead:1,definit:1,minimum_spike_train_interv:2,best:2,waveform:2,analog_signal_arrai:1,progress_ind:[2,1],larg:[2,5],select:[4,1],necessari:1,border_correct:2,refer:[0,4,2,1],core:[2,5],dataitem:1,journal:2,usag:[0,4,5],step:2,analog_signal_array_to_analog_sign:2,repositori:4,subtract:2,num_analog_signal_arrai:1,electrophysiolog:[0,5],manag:4,includ:[2,5,1],recordingchannel:1,produc:[2,5],block:1,consid:[2,1],convolut:5,"float":1,easy_instal:4,automat:[2,5],dataset:[0,1],down:1,ellipsi:5,empti:1,chang:1,your:4,git:4,fill:2,wai:[2,4],pictur:5,support:[5,1],"long":2,width:2,inner:2,fraction:2,suit:1,analysi:[4,1],head:4,properli:4,offer:1,tupl:2,recommend:[4,1],histogram:[2,5],sde:5,line:5,"true":[2,5,1],bug:4,info:1,made:1,"default":[2,4,1],displai:5,record:2,plugin_framework:1,problem:2,similar:5,khz:5,featur:4,creat:[0,5,2,1],"int":2,certain:1,"abstract":1,censor:2,repres:5,exist:[4,1],evaluation_point:2,file:[5,1],pip:4,quantiti:[2,4,5],set_tick:2,probabl:2,again:5,analogsign:[2,5,1],when:[2,1],spike_trains_by_unit:1,dicionari:[5,1],signal_arrai:2,valid:1,bool:[2,1],branch:4,you:[4,5],epocharrai:[2,1],sequenc:[2,1],drift:2,ndarrai:2,from_data:1,amplitud:2,matrix:2,axi:2,longer:2,algorithm:2,directori:1,descript:2,set_paramet:1,itself:0,ignor:2,time:[2,5,1],labeled_epoch:1,parameterss:1},objtypes:{"0":"py:module","1":"py:method","2":"py:function","3":"py:class","4":"py:exception","5":"py:classmethod"},titles:["Welcome to the documentation of spykeutils!","plugin Package","API reference","spykeutils.plot package","Requirements","Examples"],objnames:{"0":["py","module","Python module"],"1":["py","method","Python method"],"2":["py","function","Python function"],"3":["py","class","Python class"],"4":["py","exception","Python exception"],"5":["py","classmethod","Python class method"]},filenames:["index","apidoc/spykeutils.plugin","apidoc/spykeutils","apidoc/spykeutils.plot","intro","examples"]})PKd=A2Ruuspykeutils-0.2.0/examples.html Examples — spykeutils 0.2.0 documentation

Examples

These examples demonstrate the usage of some functions in spykeutils. This includes the creation of a small Neo object hierarchy with toy data.

Creating the sample data

The functions in spykeutils work on electrophysiological data that is represented in Neo object hierarchies. Usually, you would load these objects from a file, but for the purpose of this demonstration we will manually create an object hierarchy to illustrate their structure. Note that most functions in spykeutils will also work with separate Neo data objects that are not contained in a complete hierarchy. First, we import the modules we will use:

>>> import quantities as pq
>>> import neo
>>> import scipy as sp

We start with some container objects - two segments that represent trials and two units (representing neurons) that produced the spike trains:

>>> segments = []
>>> segments.append(neo.Segment('Trial 1'))
>>> segments.append(neo.Segment('Trial 2'))
>>> units = []
>>> units.append(neo.Unit('Unit 1'))
>>> units.append(neo.Unit('Unit 2'))

We create some analog signals from a sine wave with additive Gaussian noise, four signals in each segment:

>>> wave = sp.sin(sp.linspace(0, 20*sp.pi, 10000)) * 10
>>> for i in range(8):
...     sig = wave + sp.randn(10000) * 3
...     signal = neo.AnalogSignal(sig*pq.uV, sampling_rate=1*pq.kHz)
...     signal.segment = segments[i%2]
...     segments[i%2].analogsignals.append(signal)

And some spike trains from regular intervals or random time points:

>>> trains = []
>>> trains.append(neo.SpikeTrain(sp.linspace(0, 10, 40)*pq.s, 10*pq.s))
>>> trains.append(neo.SpikeTrain(sp.linspace(0, 10, 60)*pq.s, 10*pq.s))
>>> trains.append(neo.SpikeTrain(sp.rand(50)*10*pq.s, 10*pq.s))
>>> trains.append(neo.SpikeTrain(sp.rand(70)*10*pq.s, 10*pq.s))

Now we create the relationships between the spike trains and container objects. Each unit has two spike trains, one in each segment:

>>> segments[0].spiketrains = [trains[0], trains[2]]
>>> segments[1].spiketrains = [trains[1], trains[3]]
>>> units[0].spiketrains = trains[:2]
>>> units[1].spiketrains = trains[2:4]
>>> for s in segments:
...     for st in s.spiketrains:
...         st.segment = s
>>> for u in units:
...     for st in u.spiketrains:
...         st.unit = u

Now that our sample data is ready, we will use some of the function from spykeutils to analyze it.

PSTH

To create a peri stimulus time histogram from our spike trains, we call spykeutils.rate_estimation.psth(). This function can create multiple PSTHs and takes a dicionary of lists of spike trains. Since our spike trains were generated by two units, we will create two histograms, one for each unit:

>>> import spykeutils.rate_estimation
>>> st_dict = {}
>>> st_dict[units[0]] = units[0].spiketrains
>>> st_dict[units[1]] = units[1].spiketrains
>>> spykeutils.rate_estimation.psth(st_dict, 400*pq.ms)[0] 
{<neo.core.unit.Unit object at 0x...>: array([ 6.25,  5.  ,  5.  ,  5.  ,  3.75, ...

spykeutils.rate_estimation.psth() returns two values: A dictionary with the resulting histograms and a Quantity 1D with the bin edges.

If guiqwt is installed, we can also use the spykeutils.plot package to create a PSTH plot from our data (in this case we want a bar histogram and therefore only use spike trains from one unit):

>>> import spykeutils.plot
>>> spykeutils.plot.psth({units[1]: units[1].spiketrains}, bin_size=400*pq.ms, bar_plot=True) 

This will open a plot window like the following:

_images/psth.png

Spike Density Estimation

Similar to a PSTH, a spike density estimation gives an esimate of the instantaneous firing rate. Instead of binning, it is based on a kernel convolution which results in a smoother estimate. Creating and SDE with spykeutils works very similar to creating a PSTH. Instead of manually choosing the size of the Gaussian kernel, spykeutils.rate_estimation.spike_density_estimation() also supports finding the optimal kernel size automatically for each unit:

>>> kernel_sizes = sp.logspace(2,3.3,100) * pq.ms
>>> spykeutils.rate_estimation.spike_density_estimation(st_dict, optimize_steps=kernel_sizes)[0] 
{<neo.core.unit.Unit object at 0x...>: array([ 3.61293378,  3.62744654,  3.64195481,  3.65645819, ...

As with the PSTH, there is also a plot function for creating a spike density estimation. Here, we use both units because the function produces a line plot where both units can be shown at the same time:

>>> spykeutils.plot.sde(st_dict, maximum_kernel=1500*pq.ms, optimize_steps=100) 

The resulting plot will look like the following:

_images/sde.png

While spike density estimations are preferable to PSTHs in many cases, the picture also shows an important weakness: The estimation will generally be too low on margins. The areas where this happens become larger with kernel size, which is clearly visible from the rounded shape of Unit 1 (which really has a flat rate) with its very large kernel size.

Signal Plot

As a final example, we will again use the spykeutils.plot package to create a plot of the signals we created. This plot will also display the timings of our spike trains.

>>> spykeutils.plot.signals(segments[0].analogsignals, spike_trains=segments[0].spiketrains) 
_images/signal.png

The plot shows all four signals from the first segments as well as the spike times of both spike trains in the same segment.

Project Versions

Table Of Contents

Previous topic

Requirements

Next topic

API reference

This Page

PKd=Ar&spykeutils-0.2.0/.buildinfo# Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. config: b3a1bb423002ed268f403d917ca15336 tags: fbb0d17656682115ca4d033fb2f83ba1 PKd=AMspykeutils-0.2.0/search.html Search — spykeutils 0.2.0 documentation

Search

Please activate JavaScript to enable the search functionality.

From here you can search these documents. Enter your search words into the box below and click "search". Note that the search function will automatically search for all of the words. Pages containing fewer words won't appear in the result list.

Project Versions

PKd=AL!3!3spykeutils-0.2.0/intro.html Requirements — spykeutils 0.2.0 documentation

Requirements

Spykeutils is a pure Python package and therefore easy to install. It depends on the following additional packages:

  • Python >= 2.7
  • neo >= 0.2.2
  • scipy
  • guiqwt (Optional, for plotting)
  • tables (Optional, for analysis results data management. Also known as PyTables.)

Please see the respective websites for instructions on how to install them if they are not present on your computer.

Note

The current version of Neo in the Python Package Index contains some bugs that prevent it from working properly with spykeutils in some situations. Please install the latest version directly from GitHub: https://github.com/rproepp/python-neo

You can download the repository from the GitHub page or clone it using git and then install from the resulting folder:

$ python setup.py install

Download and Installation

The easiest way to get spykeutils is from the Python Package Index. If you have pip installed:

$ pip install spykeutils

Alternatively, if you have setuptools:

$ easy_install spykeutils

Alternatively, you can get the latest version directly from GitHub at https://github.com/rproepp/spykeutils.

The master branch (selected by default) always contains the current stable version. If you want the latest development version (not recommended unless you need some features that do not exist in the stable version yet), select the develop branch. You can download the repository from the GitHub page or clone it using git and then install from the resulting folder:

$ python setup.py install

Usage

For the most part, spykeutils is a collection of functions that work on Neo objects. Many functions also take quantities as parameters. Therefore, make sure to get an overview of neo and quantities before using spykeutils. Once you are familiar with these packages, have a look at the Examples or head to the API reference to browse the contents of spykeutils.

Project Versions

Table Of Contents

Previous topic

Welcome to the documentation of spykeutils!

Next topic

Examples

This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.4V iZ##T;m!4bP~7r>ιbwc;m;oӍAΆ ζZ^/|s{;yR=9(rtVoG1w#_ө{*E&!(LVuoᲵ‘D PG4 :&~*ݳreu: S-,U^E&JY[P!RB ŖޞʖR@_ȐdBfNvHf"2T]R j'B1ddAak/DIJD D2H&L`&L $Ex,6|~_\P $MH`I=@Z||ttvgcЕWTZ'3rje"ܵx9W> mb|byfFRx{w%DZC$wdցHmWnta(M<~;9]C/_;Տ#}o`zSڷ_>:;x컓?yݩ|}~wam-/7=0S5RP"*֯ IENDB`PK@=A[{gtt'spykeutils-0.2.0/_static/up-pressed.pngPNG  IHDRasRGBbKGDC pHYs B(xtIME ,ZeIDAT8͓jA*WKk-,By@- و/`cXYh!6jf GrOlXvvfk2!p!GOOԲ &zf 6|M~%`]* ΛM]K ZĆ1Er%ȶcm1`(spykeutils-0.2.0/_static/ajax-loader.gifGIF89aU|NU|l!Created with ajaxload.info! ! NETSCAPE2.0,30Ikc:Nf E1º.`q-[9ݦ9 JkH! ,4N!  DqBQT`1 `LE[|ua C%$*! ,62#+AȐ̔V/cNIBap ̳ƨ+Y2d! ,3b%+2V_ ! 1DaFbR]=08,Ȥr9L! ,2r'+JdL &v`\bThYB)@<&,ȤR! ,3 9tڞ0!.BW1  sa50 m)J! ,2 ٜU]qp`a4AF0` @1Α! ,20IeBԜ) q10ʰPaVڥ ub[;PKd=A:>>>'spykeutils-0.2.0/_static/searchtools.js/* * searchtools.js_t * ~~~~~~~~~~~~~~~~ * * Sphinx JavaScript utilties for the full-text search. * * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ /** * helper function to return a node containing the * search summary for a given text. keywords is a list * of stemmed words, hlwords is the list of normal, unstemmed * words. the first one is used to find the occurance, the * latter for highlighting it. */ jQuery.makeSearchSummary = function(text, keywords, hlwords) { var textLower = text.toLowerCase(); var start = 0; $.each(keywords, function() { var i = textLower.indexOf(this.toLowerCase()); if (i > -1) start = i; }); start = Math.max(start - 120, 0); var excerpt = ((start > 0) ? '...' : '') + $.trim(text.substr(start, 240)) + ((start + 240 - text.length) ? '...' : ''); var rv = $('
').text(excerpt); $.each(hlwords, function() { rv = rv.highlightText(this, 'highlighted'); }); return rv; } /** * Porter Stemmer */ var Stemmer = function() { var step2list = { ational: 'ate', tional: 'tion', enci: 'ence', anci: 'ance', izer: 'ize', bli: 'ble', alli: 'al', entli: 'ent', eli: 'e', ousli: 'ous', ization: 'ize', ation: 'ate', ator: 'ate', alism: 'al', iveness: 'ive', fulness: 'ful', ousness: 'ous', aliti: 'al', iviti: 'ive', biliti: 'ble', logi: 'log' }; var step3list = { icate: 'ic', ative: '', alize: 'al', iciti: 'ic', ical: 'ic', ful: '', ness: '' }; var c = "[^aeiou]"; // consonant var v = "[aeiouy]"; // vowel var C = c + "[^aeiouy]*"; // consonant sequence var V = v + "[aeiou]*"; // vowel sequence var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0 var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1 var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1 var s_v = "^(" + C + ")?" + v; // vowel in stem this.stemWord = function (w) { var stem; var suffix; var firstch; var origword = w; if (w.length < 3) return w; var re; var re2; var re3; var re4; firstch = w.substr(0,1); if (firstch == "y") w = firstch.toUpperCase() + w.substr(1); // Step 1a re = /^(.+?)(ss|i)es$/; re2 = /^(.+?)([^s])s$/; if (re.test(w)) w = w.replace(re,"$1$2"); else if (re2.test(w)) w = w.replace(re2,"$1$2"); // Step 1b re = /^(.+?)eed$/; re2 = /^(.+?)(ed|ing)$/; if (re.test(w)) { var fp = re.exec(w); re = new RegExp(mgr0); if (re.test(fp[1])) { re = /.$/; w = w.replace(re,""); } } else if (re2.test(w)) { var fp = re2.exec(w); stem = fp[1]; re2 = new RegExp(s_v); if (re2.test(stem)) { w = stem; re2 = /(at|bl|iz)$/; re3 = new RegExp("([^aeiouylsz])\\1$"); re4 = new RegExp("^" + C + v + "[^aeiouwxy]$"); if (re2.test(w)) w = w + "e"; else if (re3.test(w)) { re = /.$/; w = w.replace(re,""); } else if (re4.test(w)) w = w + "e"; } } // Step 1c re = /^(.+?)y$/; if (re.test(w)) { var fp = re.exec(w); stem = fp[1]; re = new RegExp(s_v); if (re.test(stem)) w = stem + "i"; } // Step 2 re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; if (re.test(w)) { var fp = re.exec(w); stem = fp[1]; suffix = fp[2]; re = new RegExp(mgr0); if (re.test(stem)) w = stem + step2list[suffix]; } // Step 3 re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; if (re.test(w)) { var fp = re.exec(w); stem = fp[1]; suffix = fp[2]; re = new RegExp(mgr0); if (re.test(stem)) w = stem + step3list[suffix]; } // Step 4 re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; re2 = /^(.+?)(s|t)(ion)$/; if (re.test(w)) { var fp = re.exec(w); stem = fp[1]; re = new RegExp(mgr1); if (re.test(stem)) w = stem; } else if (re2.test(w)) { var fp = re2.exec(w); stem = fp[1] + fp[2]; re2 = new RegExp(mgr1); if (re2.test(stem)) w = stem; } // Step 5 re = /^(.+?)e$/; if (re.test(w)) { var fp = re.exec(w); stem = fp[1]; re = new RegExp(mgr1); re2 = new RegExp(meq1); re3 = new RegExp("^" + C + v + "[^aeiouwxy]$"); if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) w = stem; } re = /ll$/; re2 = new RegExp(mgr1); if (re.test(w) && re2.test(w)) { re = /.$/; w = w.replace(re,""); } // and turn initial Y back to y if (firstch == "y") w = firstch.toLowerCase() + w.substr(1); return w; } } /** * Search Module */ var Search = { _index : null, _queued_query : null, _pulse_status : -1, init : function() { var params = $.getQueryParameters(); if (params.q) { var query = params.q[0]; $('input[name="q"]')[0].value = query; this.performSearch(query); } }, loadIndex : function(url) { $.ajax({type: "GET", url: url, data: null, success: null, dataType: "script", cache: true}); }, setIndex : function(index) { var q; this._index = index; if ((q = this._queued_query) !== null) { this._queued_query = null; Search.query(q); } }, hasIndex : function() { return this._index !== null; }, deferQuery : function(query) { this._queued_query = query; }, stopPulse : function() { this._pulse_status = 0; }, startPulse : function() { if (this._pulse_status >= 0) return; function pulse() { Search._pulse_status = (Search._pulse_status + 1) % 4; var dotString = ''; for (var i = 0; i < Search._pulse_status; i++) dotString += '.'; Search.dots.text(dotString); if (Search._pulse_status > -1) window.setTimeout(pulse, 500); }; pulse(); }, /** * perform a search for something */ performSearch : function(query) { // create the required interface elements this.out = $('#search-results'); this.title = $('

' + _('Searching') + '

').appendTo(this.out); this.dots = $('').appendTo(this.title); this.status = $('

').appendTo(this.out); this.output = $('