Skip to content

Store MD, MC, SA and XA in columns of their own - #112

Merged
mvassilev merged 1 commit into
developfrom
feature/string-tags
Oct 17, 2026
Merged

mvassilev merged 1 commit into
developfrom
feature/string-tags

Conversation

@mvassilev

Copy link
Copy Markdown
Collaborator

After #111 the tags left as text were mostly MD, MC, SA and XA, and on
chr20 of NA12878 at 30x they still took 118 MB of the 577 MB file in
one vector of strings per record. They are now string members of the
record, with their place among the other tags kept in tag_order like
the other typed tags. Second copies, and these names with another type
such as MD:i or XA:A, stay text. The format version becomes 5.

With the new columns ramdump -h took 15% more CPU on chr20, because
writing a typed tag back took four appends: the tab, the name, the
type and the value. RAMTagReader now builds the prefix, "\tMD:Z:" and
the rest, once per file, and appends it in one go.

On that chr20 the file goes from 576.8 to 563.1 MB; the tags take
133.1 MB, 0.8 MB of it text. ramdump -h gives the input SAM byte for
byte and takes 24.9 to 25.7 s against 27.4 to 27.6 s before, in
alternating runs. Region dumps, conversion from SAM on 4 threads and
conversion from BAM take the same time within the noise of a loaded
machine, and flagstat and idxstats are unchanged.

Closes #110.

After #111 the tags left as text were mostly MD, MC, SA and XA, and on
chr20 of NA12878 at 30x they still took 118 MB of the 577 MB file in
one vector of strings per record. They are now string members of the
record, with their place among the other tags kept in tag_order like
the other typed tags. Second copies, and these names with another type
such as MD:i or XA:A, stay text. The format version becomes 5.

With the new columns `ramdump -h` took 15% more CPU on chr20, because
writing a typed tag back took four appends: the tab, the name, the
type and the value. RAMTagReader now builds the prefix, "\tMD:Z:" and
the rest, once per file, and appends it in one go.

On that chr20 the file goes from 576.8 to 563.1 MB; the tags take
133.1 MB, 0.8 MB of it text. `ramdump -h` gives the input SAM byte for
byte and takes 24.9 to 25.7 s against 27.4 to 27.6 s before, in
alternating runs. Region dumps, conversion from SAM on 4 threads and
conversion from BAM take the same time within the noise of a loaded
machine, and flagstat and idxstats are unchanged.

Closes #110.
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.47%. Comparing base (8414cb3) to head (a53a816).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #112      +/-   ##
===========================================
+ Coverage    88.39%   88.47%   +0.08%     
===========================================
  Files           25       25              
  Lines         2946     2968      +22     
  Branches       981      991      +10     
===========================================
+ Hits          2604     2626      +22     
  Misses         185      185              
  Partials       157      157              
Flag Coverage Δ
unittests 88.47% <100.00%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
inc/rntuple/RAMNTupleRecord.h 100.00% <ø> (ø)
inc/rntuple/RAMTags.h 100.00% <ø> (ø)
src/rntuple/RAMTags.cxx 100.00% <100.00%> (ø)
test/ramcoretests.cxx 100.00% <100.00%> (ø)
test/ramdump_test.cxx 98.97% <100.00%> (ø)
tools/ramdump.cxx 85.63% <100.00%> (+0.66%) ⬆️
Files with missing lines Coverage Δ
inc/rntuple/RAMNTupleRecord.h 100.00% <ø> (ø)
inc/rntuple/RAMTags.h 100.00% <ø> (ø)
src/rntuple/RAMTags.cxx 100.00% <100.00%> (ø)
test/ramcoretests.cxx 100.00% <100.00%> (ø)
test/ramdump_test.cxx 98.97% <100.00%> (ø)
tools/ramdump.cxx 85.63% <100.00%> (+0.66%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

Copy link
Copy Markdown

clang-tidy review says "All clean, LGTM! 👍"

@mvassilev
mvassilev merged commit 5a963cd into develop Oct 17, 2026
4 checks passed
@mvassilev
mvassilev deleted the feature/string-tags branch October 17, 2026 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Store standard SAM tags in typed columns

2 participants