alecheckert / saspt Goto Github PK
View Code? Open in Web Editor NEWState arrays for single particle tracking
License: MIT License
State arrays for single particle tracking
License: MIT License
Hi Alec, here is another one, more of a clarification/question than an issue.
I noticed that the sum of posterior probabilities over all values of diffusion coefficients is 0.0278 and not 1. Interestingly, the sum is same for two different grids of D. Could you please explain why? Or am I missing something?
Given that this is correct, should the immobile fraction (e.g., Fig. 5C in your eLife paper about this code) be defined as
sum(P(D<threshold)) / sum(P(all))
instead of just the numerator?
Hi again @alecheckert,
I am wondering if one can access a diffusion coefficient value for every frame-to-frame transition during a trajectory. So a trajectory with length of N frames will have N-1 diffusion coefficient values.
Does saspt report that or carry out that kind of assignment at all?
The natural guess would be SA.trajectories.something
which would be a row or column vector of length N-1. But I could not find something like that. Am I thinking in the right direction?
Possibly another FAQ, more on the scientific side rather than the repo. I am asking to make sure because of fast response (thanks again)!
Since the number of jumps for each trajectory are accounted for in the calculation (alpha_j has a factor of n_i), my intuition is that the code can be safely used even for non-blinking fluorophores which would end up with loooooong trajectories.
Is that correct?
The default is 1e-2 to 100 um^2/s. Can we change it to start from 1e-3 or 1e-5?
This may be an FAQ: the code seems to be processing only 10000 trajectories even if the input dataset contains many more. Are these the first 10,000 trajectories in the input array or randomly chosen? Is there a variable to change this?
Kudos on the great paper and the public repo!
Hi @alecheckert, I ran across some quirks when trying to subsample within an SAD. Here's a code snippet:
import saspt
from saspt.dataset import StateArrayDataset
import os
import pandas as pd
module_path = os.path.dirname(os.path.dirname(saspt.__file__))
sample_csv = os.path.join(module_path, "examples",
"u2os_ht_nls_7.48ms", "region_8_7ms_trajs.csv")
settings = dict(pixel_size_um=0.16,
frame_interval=0.00748,
focal_depth=0.7,
sample_size=10,
progress_bar=True,
likelihood_type='rbme',
splitsize=10,
start_frame=0)
paths = dict(filepath=[sample_csv for _ in range(3)],
condition=['test' for _ in range(3)])
SAD = StateArrayDataset.from_kwargs(pd.DataFrame(paths),
path_col='filepath',
condition_col='condition',
**settings)
print(f"Sum of unnormalized posterior probabilities per file:",
f"{SAD.posterior_occs.sum(axis=(1,2))}",
sep="\n")
print(f"SAD.jumps_per_file attr:", SAD.jumps_per_file, sep="\n")
The problem is that subsampling is happening every time StateArrayDataset._load_tracks
is called. This can happen twice while using the object (unless the user clear()
s): once when calculating occupancies and another to get processed track statistics. jumps_per_file
depends on the processed track stats, so it doesn't agree with the posterior occs.
A solution could be to bundle StateArrayDataset._get_processed_track_statistics()
and StateArrayDataset.calc_marginal_posterior_occs()
into a bigger function. I guess the subsampled detections could also be cached on the SAD object, though that could take up a lot of memory.
Happy to try to fix this; let me know what you think is the best way forward.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.