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

Add mixed barcode rescue to SpotDecoding #56

Merged
merged 7 commits into from
May 19, 2023
Merged

Conversation

elaubsch
Copy link
Member

@elaubsch elaubsch commented May 19, 2023

This PR adds a function _rescue_mixed_spots to the SpotDecoding application. This function addresses the case of mixed barcodes caused by spatial crowding of spots. An argument rescue_mixed has been added to the predict method of SpotDecoding to toggle this function. A test case has been added to cover this function. Print statements have been added to make the prediction more verbose to make the amount of error correction more obvious.

The function _rescue_spots has been refactored to _rescue_errors, because there are now two methods for rescuing spots. The exposed argument rescue_spots has also been changed to rescue_errors.

Regardless of error correction, two items have been added to the dictionary returned by SpotDetection.predict.

  1. spot_index indexes the spots, because rescue_mixed_spots introduces the case that two gene assignments can be made for the same spot. In that case, a new entry is added to the output with the same index as the original spot.

  2. source details the origin of a prediction. Its values can be:

    • 'prediction' from SpotDetection.predict
    • 'error rescue' from rescue_errors
    • 'mixed rescue' from _rescue_mixed_spots

@elaubsch elaubsch added the enhancement New feature or request label May 19, 2023
@elaubsch elaubsch merged commit 1605a4f into master May 19, 2023
@elaubsch elaubsch deleted the mly/mixed_barcodes branch May 19, 2023 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant