Repository navigation
Add Sanger AB1 support, rename to Raw Data Reader - #5
Merged
Merged
Conversation
AB1 datasets from Samples & Data (TaggedAb1) are now selectable. A sample's traces are listed from the pre-run's file index (told apart by their tag values); the selected trace's bytes are fetched from the pre-run's exported file and parsed in the UI, so no Run is needed. The viewer shows the four dye traces with base calls and quality bars, or the base calls as text, with run metadata and .ab1 / FASTQ downloads of the trace. Args refuse AB1 datasets (snapshot of the dataset kind taken on pick) and the main workflow asserts the same. Raw-file downloads drop the synthetic "R1" from file names of datasets without a read-index axis. Bump block-tools to 2.16.13 and tengo-builder to 4.1.11 for the require-latest CI preflight.
- Check each tag's element count and element size against its payload before allocating or reading, so a malformed count can neither request a huge array nor read other tags' bytes; reject negative data sizes and too-short dates/times/longs. A malformed metadata tag is now skipped instead of failing the whole trace. - Save a trace without per-base qualities as FASTA instead of FASTQ with made-up Q40 scores; the button label and sequence view say which. - Add vitest to the ui package with 20 tests over synthetic ABIF files: channel order, edited/original tag fallback, raw-trace fallback, inline payloads, offset views, missing or mismatched qualities, metadata, and malformed files (bad signature, truncated directory, oversized and overlapping counts, wrong element size, out-of-file offsets).
Collaborator
Author
|
@greptile review |
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.
What
Samples & Data now imports Sanger AB1 datasets (
TaggedAb1, platforma-open/samples-and-data#136). This PR lets the block open them and renames it to Raw Data Reader.pl7.app/sequencing/datacolumns withfileExtension = ab1, alongside fastq/fasta.fileIndexand told apart by their tag values. The picker appears in the viewer when a sample has more than one trace..ab1or as FASTQ (base calls + qualities). The existing sample and whole-dataset archive buttons download every original file, as before.How
file.exportFile. The model resolves only the selected trace withgetFileHandle(), and the UI fetches its bytes withReactiveFileContent.getContentBytes. This is the same route mixcr-amplicon-alignment uses for its prerun FASTA.ui/src/ab1.tsis a small ABIF parser for the tags a viewer needs:PBAS2/1,PCON2/1,PLOC2/1,DATA9–12(rawDATA1–4as fallback),FWO_1, and the metadata tags. It was checked against Biopython on 177 real 3730 traces: sequence, qualities, peak positions, and all four trace channels match exactly.data, so the dataset kind is snapshotted intodata.inputIsAb1when the user picks a dataset (ab1Inputsoutput).main.tpl.tengoalso asserts against AB1. The prerun runs regardless of args validity.Other changes
milaboratories.fastq-reader.*, so this stays the same block in the registry.R1for datasets without a read-index axis:S1_Fwd.ab1, andS1.fastawhere it used to beS1_R1.fasta.ReadViewer.vueintoRawDownloads.vueanddownload.ts, so both viewers share them.Testing
pnpm check: type-check, lint and format pass in all packages.build:dev-binary-existing.The PR appears safe to merge, with all three previous findings addressed and no new actionable issues found.
What we checked:
elementsrejects counts that exceed the tag’s checked payload beforereadShortsallocates the array.Summary
Adds Sanger AB1 viewing and renames the block to Raw Data Reader while keeping its package IDs.
Important touched types:
BlockData: Saved user choices. Adds AB1 dataset detection, the selected trace, and view and zoom settings.Ab1Trace: Parsed base calls, qualities, peak positions, four dye traces, and run details. New in this PR.TraceOption: A trace’s picker value and label. New in this PR.RawFileIndexEntry: A reference to an original file from the pre-run. Its existingextravalues now also distinguish AB1 traces.DirEntry: An ABIF tag’s location, count, and size. Addstagso parser errors identify the bad entry.Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD Dataset[Pick dataset] --> PreRun[Pre-run exposes original files] PreRun --> Archive[Download sample or dataset] PreRun --> Kind{Dataset format} Kind -->|AB1| Pick[Pick sample and trace] Pick --> Bytes[Load selected file] Bytes --> Parse[Parse ABIF] Parse --> View[Show chromatogram and sequence] Parse --> Quality{Qualities available?} Quality -->|Yes| FASTQ[Download FASTQ] Quality -->|No| FASTA[Download FASTA] Kind -->|FASTQ or FASTA| Run[Run read extraction] Run --> Reads[Show selected reads]Reviews (2) · Last reviewed commit: "Address review: bound AB1 counts, no inv..." · Reviewed by Greptile