Skip to content

[Feature]: Add BAM format support #20

Open
AdityaPandeyCN wants to merge 2 commits intocompiler-research:developfrom
AdityaPandeyCN:bam_support
Open

[Feature]: Add BAM format support #20
AdityaPandeyCN wants to merge 2 commits intocompiler-research:developfrom
AdityaPandeyCN:bam_support

Conversation

@AdityaPandeyCN
Copy link
Copy Markdown

This PR adds BAM support, through this we can convert BAM file directly to RNTuple format files without going through the SAM pipeline.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Feb 18, 2026

Codecov Report

❌ Patch coverage is 81.49171% with 67 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.04%. Comparing base (5cec39c) to head (f15bbe0).

Files with missing lines Patch % Lines
tools/bamtoramntuple.cxx 0.00% 28 Missing ⚠️
src/ramcore/BamtoNTuple.cxx 89.06% 9 Missing and 12 partials ⚠️
test/bam_conversion.cxx 87.32% 9 Missing and 9 partials ⚠️

❌ Your patch status has failed because the patch coverage (81.49%) is below the target coverage (85.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop      #20      +/-   ##
===========================================
+ Coverage    64.78%   68.04%   +3.25%     
===========================================
  Files           16       19       +3     
  Lines         1525     1887     +362     
  Branches       632      760     +128     
===========================================
+ Hits           988     1284     +296     
- Misses         462      508      +46     
- Partials        75       95      +20     
Flag Coverage Δ
unittests 68.04% <81.49%> (+3.25%) ⬆️

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

Files with missing lines Coverage Δ
test/bam_conversion.cxx 87.32% <87.32%> (ø)
src/ramcore/BamtoNTuple.cxx 89.06% <89.06%> (ø)
tools/bamtoramntuple.cxx 0.00% <0.00%> (ø)

... and 1 file with indirect coverage changes

Files with missing lines Coverage Δ
test/bam_conversion.cxx 87.32% <87.32%> (ø)
src/ramcore/BamtoNTuple.cxx 89.06% <89.06%> (ø)
tools/bamtoramntuple.cxx 0.00% <0.00%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@AdityaPandeyCN AdityaPandeyCN marked this pull request as ready for review March 4, 2026 13:58
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

There were too many comments to post at once. Showing the first 10 out of 65. Check the log or trigger a new build to see more.

Comment thread inc/ramcore/BamtoNTuple.h
Comment thread inc/ramcore/BamtoNTuple.h
Comment thread src/ramcore/BamtoNTuple.cxx
Comment thread src/ramcore/BamtoNTuple.cxx
Comment thread src/ramcore/BamtoNTuple.cxx
Comment thread src/ramcore/BamtoNTuple.cxx
Comment thread src/ramcore/BamtoNTuple.cxx
Comment thread src/ramcore/BamtoNTuple.cxx
Comment thread src/ramcore/BamtoNTuple.cxx
Comment thread src/ramcore/BamtoNTuple.cxx
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

There were too many comments to post at once. Showing the first 10 out of 48. Check the log or trigger a new build to see more.

Comment thread src/ramcore/BamtoNTuple.cxx
Comment thread src/ramcore/BamtoNTuple.cxx
Comment thread src/ramcore/BamtoNTuple.cxx
Comment thread src/ramcore/BamtoNTuple.cxx
Comment thread src/ramcore/BamtoNTuple.cxx
Comment thread src/ramcore/BamtoNTuple.cxx
Comment thread src/ramcore/BamtoNTuple.cxx
Comment thread src/ramcore/BamtoNTuple.cxx
Comment thread src/ramcore/BamtoNTuple.cxx
Comment thread src/ramcore/BamtoNTuple.cxx
@vgvassilev
Copy link
Copy Markdown

Can you rebase?

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

There were too many comments to post at once. Showing the first 10 out of 38. Check the log or trigger a new build to see more.

Comment thread src/ramcore/BamtoNTuple.cxx
Comment thread src/ramcore/BamtoNTuple.cxx
Comment thread src/ramcore/BamtoNTuple.cxx
Comment thread src/ramcore/BamtoNTuple.cxx
Comment thread src/ramcore/BamtoNTuple.cxx
Comment thread src/ramcore/BamtoNTuple.cxx
Comment thread test/bam_conversion.cxx
Comment thread test/bam_conversion.cxx
Comment thread test/bam_conversion.cxx
Comment thread test/bam_conversion.cxx Outdated
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

There were too many comments to post at once. Showing the first 10 out of 32. Check the log or trigger a new build to see more.

Comment thread inc/ramcore/BamtoNTuple.h
Comment thread src/ramcore/BamtoNTuple.cxx
Comment thread src/ramcore/BamtoNTuple.cxx
Comment thread test/bam_conversion.cxx
Comment thread test/bam_conversion.cxx Outdated
Comment thread test/bam_conversion.cxx
Comment thread test/bam_conversion.cxx Outdated
Comment thread test/bam_conversion.cxx
Comment thread test/bam_conversion.cxx Outdated
Comment thread test/bam_conversion.cxx
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

There were too many comments to post at once. Showing the first 10 out of 21. Check the log or trigger a new build to see more.

Comment thread src/ramcore/BamtoNTuple.cxx
Comment thread src/ramcore/BamtoNTuple.cxx Outdated
Comment thread test/bam_conversion.cxx
Comment thread test/bam_conversion.cxx
Comment thread test/bam_conversion.cxx
Comment thread test/bam_conversion.cxx
Comment thread test/bam_conversion.cxx
Comment thread test/bam_conversion.cxx
Comment thread test/bam_conversion.cxx
Comment thread test/bam_conversion.cxx
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

There were too many comments to post at once. Showing the first 10 out of 11. Check the log or trigger a new build to see more.

Comment thread test/bam_conversion.cxx
Comment thread test/bam_conversion.cxx
Comment thread test/bam_conversion.cxx
Comment thread test/bam_conversion.cxx
Comment thread tools/bamtoramntuple.cxx
Comment thread tools/bamtoramntuple.cxx
Comment thread tools/bamtoramntuple.cxx
Comment thread tools/bamtoramntuple.cxx
Comment thread tools/bamtoramntuple.cxx
Comment thread tools/bamtoramntuple.cxx
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

Comment thread tools/bamtoramntuple.cxx
@AdityaPandeyCN AdityaPandeyCN force-pushed the bam_support branch 2 times, most recently from 5d2d884 to fce1b16 Compare March 19, 2026 13:50
@AdityaPandeyCN AdityaPandeyCN force-pushed the bam_support branch 3 times, most recently from 08e1add to 885cc03 Compare March 21, 2026 10:44
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

Comment thread test/bam_conversion.cxx Outdated
bam_aux_append(rec, "XS", 'S', sizeof(val_S), static_cast<const uint8_t *>(static_cast<const void *>(&val_S)));

int32_t val_i = -100000;
bam_aux_append(rec, "Xi", 'i', sizeof(val_i), static_cast<const uint8_t *>(static_cast<const void *>(&val_i)));
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: do not cast 'int32_t *' (aka 'int *') to 'const uint8_t *' (aka 'const unsigned char *') through 'const void *' [bugprone-casting-through-void]

      bam_aux_append(rec, "Xi", 'i', sizeof(val_i), static_cast<const uint8_t *>(static_cast<const void *>(&val_i)));
                                                                                 ^

Comment thread test/bam_conversion.cxx Outdated
bam_aux_append(rec, "Xi", 'i', sizeof(val_i), static_cast<const uint8_t *>(static_cast<const void *>(&val_i)));

uint32_t val_I = 3000000;
bam_aux_append(rec, "XI", 'I', sizeof(val_I), static_cast<const uint8_t *>(static_cast<const void *>(&val_I)));
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: do not cast 'uint32_t *' (aka 'unsigned int *') to 'const uint8_t *' (aka 'const unsigned char *') through 'const void *' [bugprone-casting-through-void]

      bam_aux_append(rec, "XI", 'I', sizeof(val_I), static_cast<const uint8_t *>(static_cast<const void *>(&val_I)));
                                                                                 ^

Comment thread test/bam_conversion.cxx Outdated
bam_aux_append(rec, "XI", 'I', sizeof(val_I), static_cast<const uint8_t *>(static_cast<const void *>(&val_I)));

float val_f = 3.14F;
bam_aux_append(rec, "Xf", 'f', sizeof(val_f), static_cast<const uint8_t *>(static_cast<const void *>(&val_f)));
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: do not cast 'float *' to 'const uint8_t *' (aka 'const unsigned char *') through 'const void *' [bugprone-casting-through-void]

      bam_aux_append(rec, "Xf", 'f', sizeof(val_f), static_cast<const uint8_t *>(static_cast<const void *>(&val_f)));
                                                                                 ^

Comment thread test/bam_conversion.cxx Outdated

const char *val_Z = "hello";
bam_aux_append(rec, "XZ", 'Z', static_cast<int>(strlen(val_Z) + 1),
static_cast<const uint8_t *>(static_cast<const void *>(val_Z)));
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: do not cast 'const char *' to 'const uint8_t *' (aka 'const unsigned char *') through 'const void *' [bugprone-casting-through-void]

                     static_cast<const uint8_t *>(static_cast<const void *>(val_Z)));
                                                  ^

Comment thread test/bam_conversion.cxx Outdated

const char *val_H = "1AE301";
bam_aux_append(rec, "XH", 'H', static_cast<int>(strlen(val_H) + 1),
static_cast<const uint8_t *>(static_cast<const void *>(val_H)));
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: do not cast 'const char *' to 'const uint8_t *' (aka 'const unsigned char *') through 'const void *' [bugprone-casting-through-void]

                     static_cast<const uint8_t *>(static_cast<const void *>(val_H)));
                                                  ^

Comment thread tools/bamtoramntuple.cxx Outdated
if (arg == "-noindex")
do_index = false;
else if (arg == "-illumina")
quality_mode = RAMNTupleRecord::kIlluminaBinning;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: repeated branch body in conditional chain [bugprone-branch-clone]

         quality_mode = RAMNTupleRecord::kIlluminaBinning;
         ^
Additional context

tools/bamtoramntuple.cxx:30: end of the original

         quality_mode = RAMNTupleRecord::kIlluminaBinning;
                     ^

tools/bamtoramntuple.cxx:32: clone 1 starts here

         quality_mode = RAMNTupleRecord::kDrop;
         ^

Signed-off-by: AdityaPandeyCN <adityapand3y666@gmail.com>
@AdityaPandeyCN AdityaPandeyCN marked this pull request as ready for review April 21, 2026 01:36
@AdityaPandeyCN
Copy link
Copy Markdown
Author

@vgvassilev Please take a look

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.

3 participants