Repository navigation
feat: read and write fgbio and fgumi metrics - #5
Merged
Merged
Conversation
make_fg.sh simulates a small set of duplex UMI reads with simulate_umis.py, aligns them with bwa, and runs fgbio 4.1.1 and fgumi 0.8.0 over them to write every metrics file each tool can, into tests/data/fgbio and tests/data/fgumi. No input is downloaded, and a rerun writes the same bytes.
Adds captainslog.fgbio and captainslog.fgumi, with a frozen dataclass for every metrics file each tool writes, an FgbioReader and FgumiReader, an FgbioWriter and FgumiWriter, and a metrics_class that names a file's dataclass by its header row, since both tools write under any path. The dataclasses are generated, as Picard's are: - fgbio's from its jar: FgbioSchema.java reads the columns Metric.write writes with Scala reflection, and the docstrings come from the Scaladoc. Four histograms fgbio writes line by line are written by hand. - fgumi's from its published column contract, metric_columns.json, and the structs its contract test pairs with each file. The generator follows serde's rename and skip, and refuses to run unless every struct's columns are the published ones. Both tools write NaN and the infinities as NaN, Infinity and -Infinity, which fgbio's Metric.read needs, and whole-number floats without a point; the writers do the same. fgbio and fgumi write eleven files with one header, and a test pins those pairs and their types, so either tool's dataclass reads the other's file.
PairOrientation was declared by Picard, fgbio, and Riker, and ReadType by fgbio and fgumi, so the same column read as a different class from each tool. Each now lives once, in captainslog/_htsjdk.py and captainslog/_fulcrum.py, and every tool's module re-exports it. The generators import a shared enumeration through SHARED_ENUMS rather than declaring it, and refuse to run unless it holds the values the tool writes.
clintval
marked this pull request as ready for review
October 27, 2026 20:22
This was referenced Oct 27, 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.
No description provided.