Skip to content

57 update binseq requirement#58

Merged
noamteyssier merged 2 commits into
mainfrom
57-update-binseq-requirement
Oct 30, 2025
Merged

57 update binseq requirement#58
noamteyssier merged 2 commits into
mainfrom
57-update-binseq-requirement

Conversation

@noamteyssier

Copy link
Copy Markdown
Collaborator

No description provided.

@noamteyssier noamteyssier linked an issue Oct 30, 2025 that may be closed by this pull request
@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello @noamteyssier, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request primarily focuses on upgrading the binseq dependency to version 0.7.5, along with a comprehensive update of many other project dependencies. The core logic for recoding data to BINSEQ and VBINSEQ formats has been refactored to align with the new binseq API, which now utilizes builder patterns for header creation and updated methods for writing records. Additionally, a new command-line option has been introduced to allow users to specify the bit size for BINSEQ output, enhancing flexibility.

Highlights

  • Dependency Updates: The pull request includes a comprehensive update of numerous project dependencies, most notably upgrading the binseq crate from version 0.6.2 to 0.7.5.
  • BINSEQ Bit Size Option: A new command-line option, --bitsize, has been introduced for the recode command, allowing users to specify the bit size (2 or 4) for BINSEQ output.
  • Binseq API Adaptation: The code has been refactored to adapt to changes in the binseq crate's API, specifically moving to builder patterns for BinseqHeader and VBinseqHeader creation, and updating record writing methods.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request updates several dependencies, including a significant update to the binseq crate which introduces breaking API changes. While most of the code has been adapted correctly, I've found a critical issue in a function call that will prevent compilation, as well as a potential problem with command-line argument validation. My review includes specific suggestions to address these points.

Comment thread src/recode/mod.rs
Comment on lines +218 to 226
t_writer.write_paired_record(
None,
None,
primary_seg.seq(),
Some(primary_seg.qual()),
None,
extended_seg.seq(),
primary_seg.qual(),
extended_seg.qual(),
Some(extended_seg.qual()),
)?;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

critical

This call to write_paired_record is incorrect. It provides 7 arguments, but the function from the updated binseq crate expects 8. This will cause a compilation error. Additionally, the arguments are mismatched, leading to type errors: extended_seg.seq() is passed as a name (n2), and Some(extended_seg.qual()) is passed as a sequence (s2).

You need to pass 8 arguments, with None for the second read's name (n2), and correctly pass the sequence and quality for the second read.

Suggested change
t_writer.write_paired_record(
None,
None,
primary_seg.seq(),
Some(primary_seg.qual()),
None,
extended_seg.seq(),
primary_seg.qual(),
extended_seg.qual(),
Some(extended_seg.qual()),
)?;
t_writer.write_paired_record(
None,
None,
primary_seg.seq(),
Some(primary_seg.qual()),
None,
None,
extended_seg.seq(),
Some(extended_seg.qual()),
)?;

Comment thread src/cli/recode.rs
Comment on lines +96 to +102
pub fn bitsize(&self) -> BitSize {
if self.bitsize == 4 {
BitSize::Four
} else {
BitSize::Two
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The current implementation of bitsize() silently treats any value other than 4 as 2. This could lead to unexpected behavior if a user provides an invalid value like 3. It's better to validate the input and fail fast by panicking for unsupported values.

An even better approach would be to use clap's validation capabilities to reject invalid values at the argument parsing stage, for example by using value_parser.

    pub fn bitsize(&self) -> BitSize {
        match self.bitsize {
            2 => BitSize::Two,
            4 => BitSize::Four,
            other => panic!(
                "Invalid bitsize: {}. Only 2 or 4 are supported.", other
            ),
        }
    }

@noamteyssier noamteyssier merged commit f7811ef into main Oct 30, 2025
9 checks passed
@noamteyssier noamteyssier deleted the 57-update-binseq-requirement branch October 30, 2025 01:03
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.

update binseq requirement

1 participant