-
Notifications
You must be signed in to change notification settings - Fork 70
RFC: Base calling filter for in situ sequencing #1281
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1281 +/- ##
==========================================
+ Coverage 88.84% 89.18% +0.33%
==========================================
Files 146 147 +1
Lines 5246 5409 +163
==========================================
+ Hits 4661 4824 +163
Misses 585 585
Continue to review full report at Codecov.
|
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.
Kevin, this is amazing. I have some comments that I hope are really simple. Sorry for the delay on reviewing this.
@ambrosejcarr , thanks for the comments! I've addressed them. Would you mind re-reviewing? |
Overview
As discussed in #1263, this filter component performs base calling for in situ sequencing. The filter determines which base (if any) is represented in each X, Y location in a (round, z plane) slice (i.e., in a (channel, x, y) image). Each pixel value in the resulting image is the base quality score for a given base call.
Currently, the base quality score is calculated as the intensity of the called base divided by the L2 norm of the intensities in all 4 channels (this is how it is done in the original BaristaSeq paper). However, I think it could be useful to add the capability for the user to provide their own custom functions. However, this will likely present challenges for provenance logging. Thoughts, @ambrosejcarr and @dganguli?
Usage
In the example above, the test image has intensities as shown below. The field over view is 2 pixels x 2 pixels. Base for channel 0 is "on" in the upper left corner (intensity=0.75), the base for channel 1 is "on" in the upper right hand corner (intensity=1), the base for channel 2 is "on" in lower left-hand corner (intensity=1), and the base for channel 3 is "on" in the lower right hand corner (intensity=1). The background intensity is uniformly 0.5 for all channels.
After filtering, we obtain the following. Note that the base 0 intensity in the upper left hand corner was 0.75, so no base was called due to the intensity threshold we set for the filter (
intensity_threshold=0.8
). The base quality for all other bases is1 / (1^2 + 0.5^2 + 0.5^2 + 0.5^2)^0.5 = 0.755929
.Testing
I added tests for the base calling and filtering in
starfish/core/image/_filter/test/test_call_bases.py