[FieldTrip] error with Computing cross-correlations between spike trains tutorial

Valentina Mione valentina.mione at uniroma1.it
Mon Feb 22 12:43:55 CET 2016


Hi everyone,

I posted a comment on the error 3058
http://bugzilla.fieldtriptoolbox.org/show_bug.cgi?id=3058 about the cross
correlation tutorial on spike data

But I copy and paste what I did also here, maybe someone could be intrested
as well

(In reply to Danial Arabali from comment #0)
Hi Danial,

I'm stuck exactly at your point with the same error.

Today I tried to do some detective work because I think the first error is
at the line 138:

*chansel    = unique(cmbindx(:)); % get the unique channels*


because it takes also the value 0 as index for channels.

So i corrected like:

*chansel    = unique(cmbindx(:)); % get the unique channels*
*chansel    = chansel(chansel~=0); % remove zeros*

and the script works fine to the end, but the output is different: infact I
don't get the instruction at line 133

*for k=1:size(cfg.channelcmb,1)*
*  cmbindx(k,1) = strmatch(cfg.channelcmb(k,1), spike.label, 'exact');*
*  cmbindx(k,2) = strmatch(cfg.channelcmb(k,2), spike.label, 'exact');*
*end*

Why does it is set to search for only two channels if we specified 4
channels? (*cfg.spikechannel = {'sig001U_wf', 'sig002U_wf', 'sig003U_wf',
'sig004U_wf'}; % select only the MUA*)

Maybe the instruction at this point should be something like this

*for k=1:size(cfg.channelcmb,1)*
*        for c=1:length(spike.label)*
*         cmbindx(k,c) = strmatch(cfg.channelcmb(k,c), spike.label,
'exact');*
*        end*
*end*


Anyway, I tried this solution and the output is of the right size now
(xcorr: [4x4x400 double] instead of xcorr: [2x2x400 double]), but I don't
think the content is right.

The last test I did was to select only the channels 3 and 4

*cfg.spikechannel = { 'sig003U_wf', 'sig004U_wf'}; % select only the MUA*

and run the original script with only the first modified instruction

*chansel    = unique(cmbindx(:)); % get the unique channels*
*chansel    = chansel(chansel~=0); % remove zeros*

Then I followed the second part of the tutorial

*% compute the shuffled correlogram*
*cfg.method      = 'shiftpredictor'; % compute the shift predictor*
*Xshuff = ft_spike_xcorr(cfg,spikeTrials);*

*iCmb = 3;*
*jCmb = 4;*
*figure*
*xcSmoothed = conv(squeeze(Xc.xcorr(iCmb,jCmb,:)),ones(1,5)./5,'same'); %
do some smoothing*
*hd = plot(Xc.time(3:end-2),xcSmoothed(3:end-2),'k'); % leave out borders
(because of smoothing)*
*hold on*
*xcSmoothed =
conv(squeeze(Xshuff.shiftpredictor(iCmb,jCmb,:)),ones(1,5)./5,'same');    *
*plot(Xc.time(3:end-2),xcSmoothed(3:end-2),'r')*
*hold on*
*xlabel('delay')*
*ylabel('proportion of coincidences')        *
*title([Xc.label{iCmb} Xc.label{jCmb}])*
*axis tight*



And I just changed
*iCmb = 3;*
*jCmb = 4;*
in
*iCmb = 1;*
*jCmb = 2;*

And I got exactly the same figure output of the tutorial.

I hope this can be a little help for the work


Valentina


2016-02-20 12:49 GMT+01:00 Schoffelen, J.M. (Jan Mathijs) <
jan.schoffelen at donders.ru.nl>:

> Hi Valentina,
>
> Danial Arabali (in BCC) has also encountered this, and filed a bug on
> bugzilla.fieldtriptoolbox.org, as bug 3058. Perhaps you could create
> yourself an account, add yourself on the CC-list of this bug, and team up
> with Danial to do some extra detective work. You seem to be on the right
> track, with respect to your debugging attempt. I suspect it’s probably
> relatively easy to solve. Note that the error relating to the issue in
> ft_checkconfig has been fixed in the current version of the code, that can
> be easily obtained from github.com/fieldtrip
>
> The ft_checkconfig bug is referenced here:
>
> http://bugzilla.fieldtriptoolbox.org/show_bug.cgi?id=3062
>
> The current issue is referenced here:
>
> http://bugzilla.fieldtriptoolbox.org/show_bug.cgi?id=3058
>
> Best,
> Jan-Mathijs
>
>
>
>
> On Feb 19, 2016, at 6:17 PM, Valentina Mione <valentina.mione at uniroma1.it>
> wrote:
>
> Hi everyone,
>
> I am Valentina and I am a fresh new FieldTrip user.
>
> I was following the tutorial
> http://www.fieldtriptoolbox.org/tutorial/spike, in particular the cross
> correlation part with the example data
> ftp://ftp.fieldtriptoolbox.org/pub/fieldtrip/tutorial/spike/p029_sort_final_01.nex,
> but I'm stuck with a MatLab error.
>
> I loaded the data exactly how it's explained and I defined the channels
> and the trials (just copying the matlab instructions) and all worked fine.
>
> Then I followed this part of the tutorial:
>
>  *and then compute the cross-correlogram (and the shift-predictor
> cross-correlogram) by*
>
> cfg             = [];
> cfg.maxlag      = 0.2; % maximum 200 ms
> cfg.binsize     = 0.001; % bins of 1 ms
> cfg.outputunit  = 'proportion'; % make unit area
> cfg.latency     = [-2.5 0];
> cfg.vartriallen = 'no'; % do not allow variable trial lengths
> cfg.method      = 'xcorr'; % compute the normal cross-correlogram
> Xc = ft_spike_xcorr(cfg,spikeTrials);
>
> But after processing all the 600 trials the ft_spike_xcorr function
> interrupts working with the error:
>
> "*??? Subscript indices must either be real positive integers
> or logicals.*
>
>
> *Error in ==> ft_spike_xcorr at 350 *
>
> *stat.label       = spike.label(chansel);*"
>
> Trying to understand the error I set I breakpoint on the 350 line of the
> script and I got  another error in ft_checkconfig.m
>
> "*??? Error using ==> ft_checkconfig at 208*
>
> *The field cfg.progress is not allowed*
>
> *Error in ==> ft_spike_xcorr at 126*
>
> *cfg = ft_checkconfig(cfg, 'allowed', {'latency', 'trials',*
>
> *'keeptrials', 'method', 'channelcmb', 'vartriallen', 'debias',*
>
> *'maxlag', 'binsize', 'outputunit'});*"
>
>
> I hope someone can help me because I really can't understand what's wrong
> (I feel there is a problem with the selection of the channels maybe) and I
> just followed the instructions.
>
>
> Best,
>
>
> Valentina
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
>
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20160222/487f6df0/attachment.html>


More information about the fieldtrip mailing list