Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces an algorithmic change to Polaris that increases the number of pixels sent through the
SpotDecoding
application. Previously, we performed peak finding to determine which pixels were decoded. Now with this change, we will threshold the spot probability image and decode all pixels above a certain spot probability. Then, we create a mask for all of the pixels decoded to genes and apply this mask to the spot probability image. We then perform peak finding on this masked image to call the gene locations. This change is like a compromise between Polaris' original method and pixel-wise decoding methods that are common in MERFISH analysis pipelines. We found that this method increases the number of spots decoded to genes by Polaris, while yielding results with a better correlation to bulk sequencing data.This change redefines of the
threshold
parameter for thepredict
method. Instead of being used in peak finding, this parameter is used to create a mask for tissue area. Therefore, the default value has been changed.This PR also includes changes the output of Polaris that are unrelated to the algorithmic change. Polaris previously returned
df_spots
anddf_intensities
, but now these two outputs have been concatenated column-wise to yield a singleDataFrame
.