Add return_all_patterns parameter to isotopes.detect to preserve overlapping isotope series - #49
Merged
Conversation
…lapping isotope series Co-authored-by: kheal <10502759+kheal@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix overlapping isotope series detection in deimos.isotopes.detect
Add Mar 12, 2026
return_all_patterns parameter to isotopes.detect to preserve overlapping isotope series
kheal
approved these changes
Mar 12, 2026
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.
The child-filter in
isotopes.detect(lines 235–236) unconditionally removes any feature that appears as an isotope child, which silently drops valid isotope chains when a spurious low-intensity noise peak incorrectly matches as a parent — a common failure mode for large peptides where intensity doesn't monotonically decay.Changes
deimos/isotopes.py— Addsreturn_all_patterns=Falsetodetect(). WhenTrue, skips the step that removes features appearing as isotope children, preserving overlapping chains for downstream filtering.tests/test_isotopes.py— Addstest_detect_return_all_patternscovering the noise-shadows-monoisotopic scenario from the issue report.Usage
Default behaviour (
return_all_patterns=False) is unchanged.Original prompt
deimos.isotopes.detectremoves overlapping isotope series #48🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.