-
Notifications
You must be signed in to change notification settings - Fork 6
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
kymograph tutorial: add section on photon counts #717
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I frequently get questions about this workflow, so I added an example.
Nice! What questions do you typically get? I'm wondering whether people ask about this mostly for plotting or analyzing the counts further.
The reason I'm asking is because subtracting the offset changes the distribution. Especially when counts are low, it can make downstream analysis messier than if one were to keep the counts as is, but include a constant background count in the model used to analyze the data.
Hi Joep, I often get request such as 'I would like to plot the photon intensity of a specific region and subtract background'. A possible application could be
Often users would like to translate the signal intensity to the number of dyes bound to DNA, and therefore subtract the background. |
95fbff5
to
73c2788
Compare
For this what you have in this PR is fine.
Given that counts are high and the steps are very clear, this should also be fine.
It depends. When Poisson-noise dominates, the distributions are very tailed and you may find that subtracting offsets doesn't allow you to use a Poisson model for fitting anymore. Reason being that the count model depends on the total intensity (and that includes the background). In that case, it might be better to include the background (you could still pre-estimate it on a different section of data and make it a fixed parameter) in the model and fit the raw data as is.
👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found a few small errors that prevent the notebook from being rendered/run correctly.
time = np.arange(len(photon_counts)) * kymo.line_time_seconds | ||
|
||
plt.figure() | ||
plt.plot(time, summed_photon_counts - summed_background) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't feel super strongly about this, but another option would be to indicate the background level and leave the data as-is.
plt.plot(time, summed_photon_counts - summed_background) | |
plt.plot(time, summed_photon_counts) | |
plt.axhline(summed_background, color='k', linestyle='--') |
Then you could still call them counts. Anyways, your call on that one.
It would be nice if we had some data with clear bleaching steps and just make a fully worked example for stoichiometry analysis.
Co-authored-by: Joep Vanlier <[email protected]>
Co-authored-by: Joep Vanlier <[email protected]>
I frequently get questions about this workflow, so I added an example.
I decided to add the example in the 'Tutorial', but it would also fit under 'Examples'
On the one hand, there is no new syntax introduced, which makes it fit under 'Examples'.
On the other hand, the example is just very short and does not represent a full workflow, which makes it fit in the 'Tutorial'. Let me know what you think.