gelles-brandeis / tapqir

Bayesian analysis of co-localization single-molecule microscopy image data.
Apache License 2.0
4 stars 0 forks source link

post analysis not completing #412

Closed nidaf123 closed 1 year ago

nidaf123 commented 1 year ago

Hi! I have seen that the time to first binding analysis and dwell time analysis often gets struck for hours and does not proceed to completion. When it works, it takes about 10-15 minutes and would continously show the output lines. I am not sure if other uses have also experieneced this and I was wondering if there is any bug in the post analysis? Let me know if I can provide any other information to help resolve this.

ordabayevy commented 1 year ago

Hi @nidaf123 ! My suspicion is that there might be a lot of transition between bound and unbound states which slows the analysis. Can you check your p(specific) traces to see if you indeed have too many such transitions (this might be due to noisy data or under-fitting). Also can you try setting the number of posterior samples to 1 (instead of default 2000) and see if that makes the analysis faster?

nidaf123 commented 1 year ago

Hi! Thanks for the quick reply. I have attached the probabilistic rastergrams for channel 0 and 1. A lot of binding events look stable, signal to noise is around 2.5, but let me know if you think that the data might be causing this.

cosmos_rastergram-channel0 cosmos_rastergram-channel1

I tried posterior sample = 1. It finished the iterations quickly, but gave an error about tensor dimensions (attached) Screenshot 2023-01-25 133611

I also tried running posterior sample = 500, time to first binding finished, but dwell time got struck or gave an error (attached Screenshot 2023-01-25 134813 )

ordabayevy commented 1 year ago

@nidaf123 can you try out the new 1.1.17 version of Tapqir? You can upgrade by running pip install -U tapqir It fixed several things that were slow, in particular, made the default num_samples=500 for dwelltime analysis because of the large memory consumption of this command. It should be faster now, but still not super fast. If you see CUDA out of memory error messages try setting smaller num_samples.

This new version has also fixed the error about tensor dimensions.

nidaf123 commented 1 year ago

Hi. I updated tapqir and ran 500 posterior samples for time to first binding and 250 samples for dwell time. For these number of samples, the analysis did not get struck and finished quickly. I will let you know if I encounter very slow/incomplete analysis in future. Thanks!