Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add rust_htslib::bcf::index::build #408

Merged
merged 2 commits into from
Mar 27, 2024

Conversation

PB-DB
Copy link
Contributor

@PB-DB PB-DB commented Sep 28, 2023

Builds a bcf/vcf index using the htslib bindings. It was useful to us, so I'm happy to share.

It's modeled after the equivalent in rust_htslib::bam::index. I've used it myself to verify behavior, but I haven't built any doc or unit tests.

Hope it's helpful!

Best,

Daniel

@PB-DB PB-DB changed the title Add rust_htslib::bcf::index::build feat: Add rust_htslib::bcf::index::build Sep 28, 2023
Copy link
Contributor

@johanneskoester johanneskoester left a comment

Choose a reason for hiding this comment

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

Thanks!

Copy link
Contributor

@johanneskoester johanneskoester left a comment

Choose a reason for hiding this comment

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

Can you please add a test case?

@PB-DB
Copy link
Contributor Author

PB-DB commented Dec 15, 2023

Sure!

I added some basic tests for successful construction from bcf + vcf.gz, as well as assert errors on building the wrong index format.

It would be convenient if it automatically chose 14 for a min shift for CSI files, or if we autodetected the index type to build, but I'm not sure it would make sense for the library. I'm happy to if you think it's worth it.

Thanks for building such a great resource!

@johanneskoester
Copy link
Contributor

Sure!

I added some basic tests for successful construction from bcf + vcf.gz, as well as assert errors on building the wrong index format.

It would be convenient if it automatically chose 14 for a min shift for CSI files, or if we autodetected the index type to build, but I'm not sure it would make sense for the library. I'm happy to if you think it's worth it.

Thanks for building such a great resource!

Sure, feel free to extend the functionality in that direction in a follow-up PR! And thanks for liking rust-htslib!

@coveralls
Copy link

coveralls commented Dec 18, 2023

Pull Request Test Coverage Report for Build 7822478621

Details

  • -10 of 33 (69.7%) changed or added relevant lines in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.1%) to 79.683%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/bcf/index.rs 23 33 69.7%
Files with Coverage Reduction New Missed Lines %
src/bam/record.rs 1 76.72%
Totals Coverage Status
Change from base Build 7814288779: -0.1%
Covered Lines: 2463
Relevant Lines: 3091

💛 - Coveralls

@johanneskoester
Copy link
Contributor

May I ask you to update to merge in the latest upstream master branch? It contains fixes for the failing tests.

@PB-DB
Copy link
Contributor Author

PB-DB commented Feb 23, 2024

Done - and thanks for figuring that out. Hope this fixes the tests! 🤞

@johanneskoester johanneskoester merged commit 79d70cd into rust-bio:master Mar 27, 2024
1 check passed
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