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

examples: determine effective kon #713

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

aafkevandenberg
Copy link
Collaborator

@aafkevandenberg aafkevandenberg commented Dec 11, 2024

I added an example for a frequently requested workflow: kon.

Docs can be found here: https://lumicks-pylake.readthedocs.io/en/example_kon/examples/kon/kon.html

Copy link
Member

@JoepVanlier JoepVanlier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!

I mostly commented some minor things, but I have one potential issue that you should probably consider regarding the track order and/or overlaps.


Fit an exponential ditribution to the distribution of time intervals using Pylake::

single_exponential_fit = lk.DwelltimeModel(np.array(intervals_total), n_components=1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would make sense to give some thought on discretization and the minimally observable time.

Discretization is easy, that's just the line time. The latter I would expect to be related to the gap window size in some way since you can't really observe on times shorter than this (because they would be connected to the adjacent track).

For this data, it isn't really needed, given that the binding times you measure here are quite long (36 seconds). In that case, I don't expect it to change the answer much in this case (since your line time is much shorter), but I think it would make the notebook a bit more generally usable for people who have short on timescales.

What do you think?

docs/examples/kon/kon.rst Outdated Show resolved Hide resolved
Comment on lines +14 to +15
In this Notebook, we will determine the binding time of a fluorescently labeled protein binding to DNA.
The protein binds and unbinds to target sites on DNA and the result is recorded as a kymograph.
Copy link
Member

@JoepVanlier JoepVanlier Dec 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this one, and also the other binding notebook actually, we should probably mention that we neglect photobleaching here (which would lengthen t_on and shorten t_off). Users should make sure that their samples aren't expected to bleach on the timescales that they are considering.

One paper that might be interesting to look at in the future would be this one, though it needs a very large number of counts (I wouldn't suggest that for this analysis right now, as I doubt this amount of data would work reliably there). There are more pragmatic ways to correct for bleaching too, but given that we haven't tested those, I would not explicitly recommend a particular one here.

docs/examples/kon/kon.rst Outdated Show resolved Hide resolved
docs/examples/kon/kon.rst Outdated Show resolved Hide resolved

def time_intervals(tracks):
"""Compute the time intervals between all tracks in a given selection"""
intervals = [tracks[x+1].seconds[0]-tracks[x].seconds[-1] for x in range(len(tracks)-1)]
Copy link
Member

@JoepVanlier JoepVanlier Dec 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You rely on tracks being sorted with respect to time and non-overlapping here. Unfortunately, tracks in a group are not guaranteed to be sorted in time. While this is usually the case for track_greedy (but only when you use a single ROI), it is not for track_lines for instance

I would sort them and throw if you encounter overlaps.

The second thing you rely on is that this is a KymoTrackGroup for a single kymo. Unfortunately, there is no public API to validate that right now (internally we use _validate_single_source for that when a method requires that it is not a KymoTrackGroup with multiple sources).

docs/examples/kon/kon.rst Show resolved Hide resolved
docs/examples/kon/kon.rst Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants