57 update binseq requirement#58
Conversation
Summary of ChangesHello @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 Highlights
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
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.
| 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()), | ||
| )?; |
There was a problem hiding this comment.
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.
| 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()), | |
| )?; |
| pub fn bitsize(&self) -> BitSize { | ||
| if self.bitsize == 4 { | ||
| BitSize::Four | ||
| } else { | ||
| BitSize::Two | ||
| } | ||
| } |
There was a problem hiding this comment.
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
),
}
}
No description provided.