-
Notifications
You must be signed in to change notification settings - Fork 11
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
fix: filter for hemizygous frequencies does not work (#2100) #2101
fix: filter for hemizygous frequencies does not work (#2100) #2101
Conversation
Warning Rate limit exceeded@stolpeo has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 3 minutes and 25 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughThe pull request introduces modifications to the Changes
Possibly related PRs
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
deps-report 🔍Commit scanned: bfd68bf Vulnerable dependencies4 dependencies have vulnerabilities 😱
Outdated dependencies60 outdated dependencies found (including 22 outdated major versions)😢
|
3c4dfc0
to
f36aea7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (2)
backend/variants/query_schemas.py (2)
Line range hint
450-453
: Fix incorrect sample comparison in error handling.There's a bug in the sample comparison logic. The condition is comparing
case_samples
withquality_samples
again instead ofgenotype_samples
, which could lead to incorrect error reporting.Apply this fix:
- if case_samples != quality_samples: + if case_samples != genotype_samples: raise ValueError( f"Case and genotype samples are not equal: {case_samples} vs {genotype_samples}" )
Line range hint
444-453
: Consider refactoring sample validation logic.The sample validation logic is duplicated and could be extracted into a helper method to improve maintainability and reduce the chance of errors like the one found above.
Consider refactoring like this:
+ def _validate_samples(self, case_samples: set, target_samples: set, sample_type: str) -> None: + if case_samples != target_samples: + raise ValueError( + f"Case and {sample_type} samples are not equal: {case_samples} vs {target_samples}" + ) + # In the convert method: - if case_samples != quality_samples: - raise ValueError( - f"Case and quality samples are not equal: {case_samples} vs {quality_samples}" - ) - if case_samples != genotype_samples: - raise ValueError( - f"Case and genotype samples are not equal: {case_samples} vs {genotype_samples}" - ) + self._validate_samples(case_samples, quality_samples, "quality") + self._validate_samples(case_samples, genotype_samples, "genotype")
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
backend/variants/query_schemas.py
(1 hunks)backend/variants/tests/data/query_settings.py
(1 hunks)
🧰 Additional context used
🪛 Ruff
backend/variants/tests/data/query_settings.py
2-2: SyntaxError: Simple statements must be separated by newlines or semicolons
3-3: SyntaxError: Simple statements must be separated by newlines or semicolons
🔇 Additional comments (1)
backend/variants/query_schemas.py (1)
317-317
: LGTM: Hemizygous frequency fields added consistently.
The new hemizygous frequency fields have been added following the same pattern as the existing heterozygous and homozygous fields, maintaining consistency across all database types (ExAC, Thousand Genomes, gnomAD exomes, and gnomAD genomes).
Also applies to: 322-322, 327-327, 332-332
f36aea7
to
bfd68bf
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2101 +/- ##
=====================================
Coverage 91% 91%
=====================================
Files 678 678
Lines 38537 38537
=====================================
Hits 35140 35140
Misses 3397 3397
|
Summary by CodeRabbit
New Features
Bug Fixes
Chores