feat: add adapter trimming option to remove soft-clipped regions from signal - #173
Open
jayhesselberth wants to merge 1 commit into
Open
feat: add adapter trimming option to remove soft-clipped regions from signal#173jayhesselberth wants to merge 1 commit into
jayhesselberth wants to merge 1 commit into
Conversation
… signal Add a new "Trim Adapters" checkbox in the Plot Options panel that removes soft-clipped (adapter) regions from signal data before plotting. This is useful for focusing on the aligned portion of reads without adapter noise. Implementation: - Add `trim_adapters` parameter to plot_read(), plot_reads(), plot_aggregate() - Add `_apply_adapter_trimming_to_reads()` helper function that: - Trims signal based on soft-clip base positions from move table - Trims sequence and quality scores - Adjusts reference_start/reference_end coordinates - Adjusts query_to_ref mapping for new indices - Ensures move table base count matches sequence length - Add trimAdapters to PlotOptionsState and wire through UI - Add comprehensive tests for adapter trimming functionality Note: Adapter trimming removes the actual adapter sequences that are soft-clipped in the BAM alignment. The poly-A tail that may be visible in plots is part of the reference sequence, not adapter.
jayhesselberth
force-pushed
the
feature/adapter-trimming
branch
from
March 3, 2026 22:05
acbd0d9 to
6609fd3
Compare
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.
Summary
Add a new "Trim Adapters" checkbox in the Plot Options panel that removes soft-clipped (adapter) regions from signal data before plotting. This is useful for focusing on the aligned portion of reads without adapter noise.
Changes
Python Backend:
trim_adaptersparameter toplot_read(),plot_reads(),plot_aggregate()_apply_adapter_trimming_to_reads()helper function insquiggy/plotting.pythat:reference_start/reference_endcoordinatesquery_to_refmapping for new indicesquery_start_offset,query_end_offset) toAlignedReaddataclassTypeScript Frontend:
trimAdapterstoPlotOptionsStateinterfaceSquiggyRuntimeAPI.generateAggregatePlot()Tests:
tests/test_adapter_trimming.pywith 13 comprehensive tests covering:Important Note
Adapter trimming removes the actual adapter sequences that are soft-clipped in the BAM alignment. The poly-A tail that may be visible in tRNA plots is part of the reference sequence, not adapter - it will remain visible after trimming because it's part of the aligned region.
Test plan
🤖 Generated with Claude Code