quantixed / TrackMateR

Analysis of TrackMate XML outputs in R
https://quantixed.github.io/TrackMateR/
Other
12 stars 1 forks source link

Can't reproduce the output of the example dataset #1

Closed fadelvalle closed 2 years ago

fadelvalle commented 2 years ago

Hi. First of all, I'd like to thank you for the development of this package ! I'm sure many of us will take advantage of it.

My problem is that when I try the example code , I get the following output and error:

Error in unserialize(socklist[[n]]) : error reading from connection

I'm using windows 11 and the latest R base version, running this script on the latest Rstudio GUI and with all packages updated.

R version 4.1.2 (2021-11-01) -- "Bird Hippie" Copyright (C) 2021 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 (64-bit)

quantixed commented 2 years ago

I can reproduce this on Windows 10:

R version 4.2.1 (2022-06-23 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 22000)

Matrix products: default

locale:
[1] LC_COLLATE=English_United Kingdom.utf8 
[2] LC_CTYPE=English_United Kingdom.utf8   
[3] LC_MONETARY=English_United Kingdom.utf8
[4] LC_NUMERIC=C                           
[5] LC_TIME=English_United Kingdom.utf8    

attached base packages:
[1] parallel  stats     graphics  grDevices utils    
[6] datasets  methods   base     

other attached packages:
[1] ggplot2_3.3.6     TrackMateR_0.3.0  doParallel_1.0.17
[4] iterators_1.0.14  foreach_1.5.2     XML_3.99-0.10    
[7] xml2_1.3.3  

The example works fine on macOS/Linux. I have narrowed down the problem to how parallelisation works on Windows. TrackMate XML files are big and take a while to load so TrackMateR uses parallelisation to speed this up. I will try to fix/find a workaround.

quantixed commented 2 years ago

Hi @fadelvalle, thanks for raising this issue. I have come up with a fix https://github.com/quantixed/TrackMateR/commit/ebcd7c70e2f7866e284c636e60d49efbda891556 The fix is to switch off parallelisation for Windows. So it will be slower to load a file, but it should work! I have tested on W10 and I could load the example.

Please give it a try by first reinstalling, using devtools::install_github("quantixed/TrackMateR")

If you find any other issues, let me know!

fadelvalle commented 2 years ago

Thanks ! Now it works for the example dataset, but when trying this datased (attached file, xml from trackmate) I get this error when using the report command:

Error in nls(hdata$countsCum ~ (1 - D2 exp(-hdata$mid^2/(4 D1 * timeRes)) - : singular gradient

xml.zip