-
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
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.
bfd0a81
to
aa53948
Compare
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.
LGTM!
plt.axhline(summed_background, color='k', linestyle='--', label = "background") | ||
plt.xlabel("time (s)") | ||
plt.ylabel("Photon counts") | ||
plt.title("Photon counts along binding event") |
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.
Extremely minor, but you have labels specified in the plt.plot()
calls, but don't actually show them by invoking plt.legend()
.
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.
good catch! I updated it.
aa53948
to
5f413cd
Compare
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.