Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dwell time post analysis errors #422

Open
jc-brandeis opened this issue Apr 14, 2023 · 2 comments
Open

dwell time post analysis errors #422

jc-brandeis opened this issue Apr 14, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@jc-brandeis
Copy link

jc-brandeis commented Apr 14, 2023

The following errors appeared while trying to do the dwell time analysis using all default parameters with 2 exponential fitting. I am using version v1.1.17.post.dev4. I have not seen these errors with my other data previously. It could be data-specific.

Saved off-rate parameters in cosmos_dwelltime-koff-channel0.csv file
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
File ~/anaconda3/envs/tapqir-env/lib/python3.8/site-packages/tapqir/gui.py:1350, in dtCmd(b, layout, out)
   1348 with out:
   1349     logger.info("Dwell-time analysis ...")
-> 1350     dwelltime(
   1351         **layout.kwargs,
   1352         progress_bar=tqdm_notebook,
   1353     )
   1354     logger.info("Dwell-time analysis: Done")
   1355 out.clear_output(wait=True)

File ~/anaconda3/envs/tapqir-env/lib/python3.8/site-packages/tapqir/main.py:1280, in dwelltime(model, K, cuda, num_samples, num_iter, progress_bar)
   1276     torch.set_default_tensor_type(torch.FloatTensor)
   1278 fig, ax = plt.subplots()
   1279 ax.hist(
-> 1280     bound_dwell_times(
   1281         count_intervals(
   1282             model.params["z_map"][: model.data.N][
   1283                 None, model.data.mask[: model.data.N], :, c
   1284             ]
   1285         )
   1286     )[0],
   1287     bins=100,
   1288     density=True,
   1289 )
   1290 t = torch.arange(bound_dt.max())
   1291 y = 0

File ~/anaconda3/envs/tapqir-env/lib/python3.8/site-packages/tapqir/utils/imscroll.py:120, in bound_dwell_times(intervals)
    118 max_count = value_counts.max()
    119 n_values = len(value_counts)
--> 120 data = np.zeros((n_values, max_count), dtype=np.float32)
    121 for i in range(n_values):
    122     mask = result["posterior_sample"] == i

TypeError: 'float' object cannot be interpreted as an integer
@ordabayevy ordabayevy added the bug Something isn't working label Apr 14, 2023
@ordabayevy
Copy link
Collaborator

That looks like a strange error to me (max_count and n_values should always be integers). Does it happen with other dataset when you fit with 2 exponentials?

@jc-brandeis
Copy link
Author

jc-brandeis commented Apr 14, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants