Polar basecalling - #208
Open
jshleap wants to merge 28 commits into
Open
Conversation
Implements a parameter-free polar decoder separating amplitude (R, dark-base
detection) from direction (angle theta, base identity).
Two strategies, chosen from encoding matrix E (no chemistry-specific if/else
on channel count):
Orthogonal E (4-ch identity, 3-ch dark-base): argmax(d . E_bright.T)
Non-orthogonal E (2-col Illumina, A fires both channels):
atan2-based angular classification with xtalk-inferred thresholds
Angle thresholds derived parameter-free from the xtalk correction matrix
via _polar_thresholds_from_wcor (midpoints between E_soft centroids).
Results matching polar_basecalling.ipynb:
4-ch Exp C: mapping_rate ~79.4% cells ~74.7% (2,966 watershed cells)
3-ch NIS-seq: mapping_rate ~43.5% nuclei ~85% (1,001 CellPose nuclei)
2-col NIS-seq: mapping_rate ~29.4% nuclei ~84% (superior cell coverage vs SE)
Test data added to scallops/tests/data/:
experimentC/cells.npy watershed cell mask (1024x1024)
nis_seq/ pre-processed NIS-seq HeLa tile40
spots_3ch_corrected.npy (17520, 14, 3) xtalk-corrected 3-ch spots
spots_2col_corrected.npy (17520, 14, 2) synthesised 2-col channels
w_cor_3ch.npy (3, 3) xtalk correction matrix
peaks/labels/nuclei.npy spot metadata and segmentation
barcodes_whitelist.npy 154,646 RC Brunello barcodes
secondary_thr.npy per-chemistry secondary peak thresholds
…for SE (polar was already independent)
…ar-basecalling
…ar-basecalling
…ar-basecalling
…ar-basecalling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adding options for sign encoding and polar basecalling methods