kjamartens / TARDIS-public

Public releases of TARDIS
11 stars 2 forks source link

Error using mlecustom #3

Closed XiangruiJi closed 8 months ago

XiangruiJi commented 8 months ago

Hi Koen,

I run into problems when analyzing my own data: e11-1_A_all.csv

For the following parameters, image I got the error message:

Error using mlecustom Error in the custom pdf function '@(xdata,varargin)pdfBGwithPops(xdata,BGcurve_interp,output_BG_alldt,pdfSettings,callfromUI,varargin)'

Error in mle (line 309) [phat, pci] = mlecustom(data,varargin{:},'frequency',freq,'censoring',cens);

Error in URDA_HO_FF_function (line 744) [parameters_autoPickPops{nrpopsTesting}, parametersCI_autoPickPops{nrpopsTesting}] = mle(inputarr, 'pdf',pdf_FF_pops,'start',startparam,'LowerBound',lowerbound,'UpperBound',upperbound,'Options',mleoptions);

Error in TARDIS_app/RunTARDISButtonPushed (line 1285) URDA_HO_FF_function(poslist,app.Data.settingsURDA);

Error in appdesigner.internal.service.AppManagementService/executeCallback (line 172) callback(appOrUserComponent, event);

Error in matlab.apps.AppBase>@(source,event)executeCallback(ams,app,callback,requiresEventData,event) (line 62) newCallback = @(source, event)executeCallback(ams, ...

Caused by: Index exceeds the number of array elements. Index must not exceed 6.

Error using appdesservices.internal.interfaces.model.AbstractModel/executeUserCallback Error while evaluating Button PrivateButtonPushedFcn.

For the following parameters, image I got a slightly different error message:

Error using mlecustom 'Start' value must satisfy the 'UpperBound' and 'LowerBound' values.

Error in mle (line 309) [phat, pci] = mlecustom(data,varargin{:},'frequency',freq,'censoring',cens);

Error in URDA_HO_FF_function (line 744) [parameters_autoPickPops{nrpopsTesting}, parametersCI_autoPickPops{nrpopsTesting}] = mle(inputarr, 'pdf',pdf_FF_pops,'start',startparam,'LowerBound',lowerbound,'UpperBound',upperbound,'Options',mleoptions);

Error in TARDIS_app/RunTARDISButtonPushed (line 1285) URDA_HO_FF_function(poslist,app.Data.settingsURDA);

Error in appdesigner.internal.service.AppManagementService/executeCallback (line 172) callback(appOrUserComponent, event);

Error in matlab.apps.AppBase>@(source,event)executeCallback(ams,app,callback,requiresEventData,event) (line 62) newCallback = @(source, event)executeCallback(ams, ...

Error using appdesservices.internal.interfaces.model.AbstractModel/executeUserCallback Error while evaluating Button PrivateButtonPushedFcn.

I managed to run TARDIS with the parameters as follows, but the results varied when I run TARDIS repeatedly. This may be due to the randomly-chosen starting points, but I didn't expect to have such a large difference. In addition, I noticed that one of the diffusion coefficients can be 0±NaN. image image image

My expert settings for all the analyses above are: image

Thank you for your help!

kjamartens commented 8 months ago

Hi.

I was able to reproduce the first issue (Index exceeds the number of array elements. Index must not exceed 6.). I will look into this later.

The second issue should never happen - 'Start' value must satisfy the 'UpperBound' and 'LowerBound' values means that a start value was set outside the upper/lower bounds. Double-check your expert settings, but I wasn't able to reproduce this.

Your last figure is fully explainable - you are using a too high localization precision. The residual plot is very wavy-like, which isn't wanted (also stated in the manuscript: "Importantly, our investigations revealed that TARDIS cannot ‘fail silently’, that is, provide data that at glance look accurate, but contain errors: TARDIS failures due to wrong localization shows clear errors in the residuals of the fit (Supplementary Note 9)")

I'm pretty sure that your localization precision is roughly 50 nm (best to check this via NeNA or some other method). If I use 50 nm loc precision, I get sensible results: image

Although I want to note that your data appears to be slightly more complex than just 2 populations, but obviously I cannot judge that properly without knowing your biology/sample.

Second side-note: it might also be worthwhile to display your data logarithmically (storage/visualisation options), it can more clearly show the misfit at low JDs), where again 50 nm loc unc seems to be OKish: image

XiangruiJi commented 8 months ago

Hi Koen, Thank you very much for your detailed and helpful reply. I cannot figure out why I meet the second issue though you don't. For the third issue, I get results similar to yours after changing the localization uncertainty. (The first issue still exists with the modified localization uncertainty, and it would be perfect if you could fix it at your convenience.)

kjamartens commented 8 months ago

Hi, I believe the first issue should be fixed with the lasest commit (8d4e6d529b76de06e45a10d930ab34311668ddb8)

Please let me know if this is not the case.

XiangruiJi commented 8 months ago

Hi Koen, Yes, it has been fixed. Thank you very much.

kjamartens commented 8 months ago

You're welcome!