Skip to content

Fix: improve region query logic in RAMNTupleView#15

Merged
vgvassilev merged 2 commits intocompiler-research:developfrom
AdityaPandeyCN:ramcore_fix
Mar 6, 2026
Merged

Fix: improve region query logic in RAMNTupleView#15
vgvassilev merged 2 commits intocompiler-research:developfrom
AdityaPandeyCN:ramcore_fix

Conversation

@AdityaPandeyCN
Copy link
Copy Markdown

  • Add CIGAR span calculation for accurate read overlap detection
  • Filter secondary/supplementary/unmapped reads (flag 0x904)
  • Support reference name aliasing (chr1 <-> 1, chrM <-> MT)
  • Handle flexible query formats (rname, rname:pos, rname:start-end, *)
  • Use individual field views for better performance
  • Add early termination when past query region

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Feb 1, 2026

Codecov Report

❌ Patch coverage is 80.76923% with 35 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (develop@83334a1). Learn more about missing BASE report.

Files with missing lines Patch % Lines
test/ramcoretests.cxx 71.91% 0 Missing and 25 partials ⚠️
src/ramcore/RAMNTupleView.cxx 87.01% 2 Missing and 8 partials ⚠️

❌ Your patch status has failed because the patch coverage (80.76%) 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      #15   +/-   ##
==========================================
  Coverage           ?   55.78%           
==========================================
  Files              ?       16           
  Lines              ?     1425           
  Branches           ?      752           
==========================================
  Hits               ?      795           
  Misses             ?      521           
  Partials           ?      109           
Flag Coverage Δ
unittests 55.78% <80.76%> (?)

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

Files with missing lines Coverage Δ
benchmark/generate_sam.cxx 92.72% <100.00%> (ø)
src/ramcore/RAMNTupleView.cxx 88.63% <87.01%> (ø)
test/ramcoretests.cxx 73.95% <71.91%> (ø)
Files with missing lines Coverage Δ
benchmark/generate_sam.cxx 92.72% <100.00%> (ø)
src/ramcore/RAMNTupleView.cxx 88.63% <87.01%> (ø)
test/ramcoretests.cxx 73.95% <71.91%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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 src/ramcore/RAMNTupleView.cxx
Comment thread src/ramcore/RAMNTupleView.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 src/ramcore/RAMNTupleView.cxx
Comment thread src/ramcore/RAMNTupleView.cxx Outdated

} // namespace

Long64_t ramntupleview(const char *file, const char *query, bool /*cache*/, bool /*perfstats*/,
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: function 'ramntupleview' can be made static or moved into an anonymous namespace to enforce internal linkage [misc-use-internal-linkage]

Suggested change
Long64_t ramntupleview(const char *file, const char *query, bool /*cache*/, bool /*perfstats*/,
Long64_t ramntupleviewstatic (const char *file, const char *query, bool /*cache*/, bool /*perfstats*/,

@vgvassilev
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 46.57534% with 39 lines in your changes missing coverage. Please review. ⚠️ Please upload report for BASE (develop@ef5b3ae). Learn more about missing BASE report.
Files with missing lines Patch % Lines
src/ramcore/RAMNTupleView.cxx 46.57% 27 Missing and 12 partials ⚠️

❌ Your patch status has failed because the patch coverage (46.57%) is below the target coverage (85.00%). You can increase the patch coverage or adjust the target coverage.
Additional details and impacted files

🚀 New features to boost your workflow:

In a separate PR, we should make codecov block PRs if the testing coverage degrades.

@AdityaPandeyCN AdityaPandeyCN marked this pull request as draft February 2, 2026 11:57
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 src/ramcore/RAMNTupleView.cxx
Comment thread test/ramcoretests.cxx
Comment thread test/ramcoretests.cxx
Comment thread test/ramcoretests.cxx Outdated
@AdityaPandeyCN AdityaPandeyCN marked this pull request as ready for review February 4, 2026 08:24
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 src/ramcore/RAMNTupleView.cxx
@AdityaPandeyCN
Copy link
Copy Markdown
Author

Can you have a look @vgvassilev ?

@vgvassilev
Copy link
Copy Markdown

Can you address the clang-tidy and missing coverage first?

@AdityaPandeyCN AdityaPandeyCN marked this pull request as draft February 13, 2026 13:15
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 13. Check the log or trigger a new build to see more.

Comment thread benchmark/generate_sam.cxx Outdated
Comment thread benchmark/generate_sam.cxx Outdated
Comment thread benchmark/generate_sam.cxx
Comment thread src/ramcore/RAMNTupleView.cxx
Comment thread src/ramcore/RAMNTupleView.cxx
Comment thread src/ramcore/RAMNTupleView.cxx Outdated
Comment thread test/ramcoretests.cxx Outdated
Comment thread test/ramcoretests.cxx Outdated
Comment thread test/ramcoretests.cxx Outdated
Comment thread test/ramcoretests.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


if (i < 10) {
chrom = "chr1";
chrom_length = 249250621;
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: Value stored to 'chrom_length' is never read [clang-analyzer-deadcode.DeadStores]

         chrom_length = 249250621;
         ^
Additional context

benchmark/generate_sam.cxx:52: Value stored to 'chrom_length' is never read

         chrom_length = 249250621;
         ^

Comment thread test/ramcoretests.cxx Outdated
Comment thread test/ramcoretests.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

Comment thread test/ramcoretests.cxx
@@ -1,3 +1,4 @@
#include <cstdint>
#include <gtest/gtest.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: 'gtest/gtest.h' file not found [clang-diagnostic-error]

#include <gtest/gtest.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.

That's an issue which needs to be fixed in clang-tidy as we discussed.

Comment thread test/ramcoretests.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

Comment thread test/ramcoretests.cxx
Comment thread test/ramcoretests.cxx
@AdityaPandeyCN AdityaPandeyCN marked this pull request as ready for review February 16, 2026 11:41
@AdityaPandeyCN
Copy link
Copy Markdown
Author

AdityaPandeyCN commented Feb 16, 2026

Hi @vgvassilev , Can you have a look? Code cov of the test file should not be a issue and the ntupleview file is now above the required no.

Copy link
Copy Markdown

@vgvassilev vgvassilev left a comment

Choose a reason for hiding this comment

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

Comment thread src/ramcore/RAMNTupleView.cxx Outdated
std::string rest = region.substr(colonPos + 1);

size_t dashPos = rest.find('-');
try {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Is it a good idea to rely on exceptions for this code?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Removed try-catch exceptions

Comment thread test/ramcoretests.cxx
@@ -1,3 +1,4 @@
#include <cstdint>
#include <gtest/gtest.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.

That's an issue which needs to be fixed in clang-tidy as we discussed.

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 src/ramcore/RAMNTupleView.cxx
@AdityaPandeyCN
Copy link
Copy Markdown
Author

I guess codecov problem is it doesn't has a successful base commit to compare against, this PR would solve it(https://docs.codecov.com/docs/error-reference#section-missing-head-commit)

@AdityaPandeyCN
Copy link
Copy Markdown
Author

@vgvassilev Can we get this in?

Copy link
Copy Markdown

@vgvassilev vgvassilev left a comment

Choose a reason for hiding this comment

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

LGTM! Please squash everything into a single commit with the appropriate commit message.

- Add CIGAR span calculation for accurate read overlap detection
- Filter secondary/supplementary/unmapped reads (flag 0x904)
- Support reference name aliasing (chr1 <-> 1, chrM <-> MT)
- Handle flexible query formats (rname, rname:pos, rname:start-end, *)
- Use individual field views for better performance
- Add early termination when past query region

Signed-off-by: AdityaPandeyCN <adityapand3y666@gmail.com>
@AdityaPandeyCN AdityaPandeyCN force-pushed the ramcore_fix branch 2 times, most recently from 90f9f2c to cef6ab1 Compare March 4, 2026 11:01
@AdityaPandeyCN
Copy link
Copy Markdown
Author

@vgvassilev Squashed the commits!

@AdityaPandeyCN
Copy link
Copy Markdown
Author

@vgvassilev Gentle reminder for this

@vgvassilev vgvassilev merged commit 4504216 into compiler-research:develop Mar 6, 2026
8 checks passed
AdityaPandeyCN added a commit to AdityaPandeyCN/ramtools that referenced this pull request Mar 6, 2026
- Add CIGAR span calculation for accurate read overlap detection
- Filter secondary/supplementary/unmapped reads (flag 0x904)
- Support reference name aliasing (chr1 <-> 1, chrM <-> MT)
- Handle flexible query formats (rname, rname:pos, rname:start-end, *)
- Use individual field views for better performance
- Add early termination when past query region

Signed-off-by: AdityaPandeyCN <adityapand3y666@gmail.com>

use enums and add tests

Signed-off-by: AdityaPandeyCN <adityapand3y666@gmail.com>

clang formatting

Signed-off-by: AdityaPandeyCN <adityapand3y666@gmail.com>

add comments

Signed-off-by: AdityaPandeyCN <adityapand3y666@gmail.com>

clang formatting

Signed-off-by: AdityaPandeyCN <adityapand3y666@gmail.com>

clang formatting

Signed-off-by: AdityaPandeyCN <adityapand3y666@gmail.com>
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