-
Notifications
You must be signed in to change notification settings - Fork 187
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: MtNucRatioCalculator #3496
Conversation
* perf: update bio/bcftools/index/environment.yaml. * perf: update bio/bcftools/index/environment.yaml. * perf: update bio/bcftools/index/environment.yaml.
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: snakedeploy-bot[bot] <115615832+snakedeploy-bot[bot]@users.noreply.github.com>
Co-authored-by: snakedeploy-bot[bot] <115615832+snakedeploy-bot[bot]@users.noreply.github.com>
Co-authored-by: snakedeploy-bot[bot] <115615832+snakedeploy-bot[bot]@users.noreply.github.com>
Co-authored-by: snakedeploy-bot[bot] <115615832+snakedeploy-bot[bot]@users.noreply.github.com>
* Add autobump action * fix paths * dbg * dbg branch * add checkout * dbg * trigger rerun * entity regex and add label * dbg * Update autobump.yml * Update autobump.yml
Co-authored-by: snakedeploy-bot[bot] <115615832+snakedeploy-bot[bot]@users.noreply.github.com>
Co-authored-by: snakedeploy-bot[bot] <115615832+snakedeploy-bot[bot]@users.noreply.github.com>
Co-authored-by: snakedeploy-bot[bot] <115615832+snakedeploy-bot[bot]@users.noreply.github.com>
Co-authored-by: snakedeploy-bot[bot] <115615832+snakedeploy-bot[bot]@users.noreply.github.com>
Co-authored-by: snakedeploy-bot[bot] <115615832+snakedeploy-bot[bot]@users.noreply.github.com>
Co-authored-by: snakedeploy-bot[bot] <115615832+snakedeploy-bot[bot]@users.noreply.github.com>
Co-authored-by: snakedeploy-bot[bot] <115615832+snakedeploy-bot[bot]@users.noreply.github.com>
Co-authored-by: snakedeploy-bot[bot] <115615832+snakedeploy-bot[bot]@users.noreply.github.com>
Co-authored-by: snakedeploy-bot[bot] <115615832+snakedeploy-bot[bot]@users.noreply.github.com>
Co-authored-by: snakedeploy-bot[bot] <115615832+snakedeploy-bot[bot]@users.noreply.github.com>
Co-authored-by: snakedeploy-bot[bot] <115615832+snakedeploy-bot[bot]@users.noreply.github.com>
📝 WalkthroughWalkthroughThis pull request introduces several new files and modifications related to the Changes
Possibly related PRs
Suggested reviewers
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 (
|
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: 4
🧹 Outside diff range and nitpick comments (5)
bio/mtnucratio/test/Snakefile (1)
10-13
: Consider improvements for parameters and wrapper versioningA few suggestions to enhance maintainability and reliability:
- Move the chromosome parameter to a config file for better configurability
- Use a specific version tag instead of "master" for the wrapper to ensure stability
Consider these improvements:
params: - chrom="ref2", + chrom=lambda wildcards, config: config["mtnucratio"].get("chromosome", "ref2"), wrapper: - "master/bio/mtnucratio" + "v3.3.3/bio/mtnucratio"Add to your config.yaml:
mtnucratio: chromosome: "ref2" # default value, can be overriddenbio/mtnucratio/wrapper.py (3)
10-11
: Document the significance of the 'MT' default value.Consider adding a comment explaining why 'MT' is chosen as the default chromosome name (e.g., if it's a standard convention for mitochondrial DNA).
-# Default mito chromosome name is set to 'MT' +# Default mitochondrial chromosome name is set to 'MT' as per human genome convention🧰 Tools
🪛 Ruff (0.7.0)
11-11: Undefined name
snakemake
(F821)
17-17
: Validate input BAM file existence.The input BAM file path is used without validation. Consider adding a check to ensure the file exists and is accessible.
bam = str(snakemake.input) +if not os.path.isfile(bam): + raise FileNotFoundError(f"Input BAM file not found: {bam}")🧰 Tools
🪛 Ruff (0.7.0)
17-17: Undefined name
snakemake
(F821)
1-37
: Consider enhancing logging for better debugging.The wrapper could benefit from additional logging to help users track the process flow and debug issues.
Consider adding log messages for key steps:
- Input file validation
- Temporary directory creation
- Symlink creation
- Command execution
- Output file movement
This can be achieved by using Snakemake's logging functionality or Python's logging module.
🧰 Tools
🪛 Ruff (0.7.0)
11-11: Undefined name
snakemake
(F821)
12-12: Undefined name
snakemake
(F821)
17-17: Undefined name
snakemake
(F821)
31-31: Undefined name
snakemake
(F821)
35-35: Undefined name
snakemake
(F821)
test_wrappers.py (1)
3420-3425
: Consider adding more test casesThe current test only verifies basic functionality with a single output file. Consider adding test cases for:
- Different input file formats/types
- Multiple output files if supported
- Various parameter combinations
- Edge cases and error conditions
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (6)
bio/mtnucratio/environment.linux-64.pin.txt
(1 hunks)bio/mtnucratio/environment.yaml
(1 hunks)bio/mtnucratio/meta.yaml
(1 hunks)bio/mtnucratio/test/Snakefile
(1 hunks)bio/mtnucratio/wrapper.py
(1 hunks)test_wrappers.py
(1 hunks)
✅ Files skipped from review due to trivial changes (3)
- bio/mtnucratio/environment.linux-64.pin.txt
- bio/mtnucratio/environment.yaml
- bio/mtnucratio/meta.yaml
🧰 Additional context used
📓 Path-based instructions (2)
bio/mtnucratio/wrapper.py (2)
Pattern **/*.py
: Do not try to improve formatting.
Do not suggest type annotations for functions that are defined inside of functions or methods.
Do not suggest type annotation of the self
argument of methods.
Do not suggest type annotation of the cls
argument of classmethods.
Do not suggest return type annotation if a function or method does not contain a return
statement.
Pattern **/wrapper.py
: Do not complain about use of undefined variable called snakemake
.
test_wrappers.py (1)
Pattern **/*.py
: Do not try to improve formatting.
Do not suggest type annotations for functions that are defined inside of functions or methods.
Do not suggest type annotation of the self
argument of methods.
Do not suggest type annotation of the cls
argument of classmethods.
Do not suggest return type annotation if a function or method does not contain a return
statement.
🪛 Ruff (0.7.0)
bio/mtnucratio/wrapper.py
11-11: Undefined name snakemake
(F821)
12-12: Undefined name snakemake
(F821)
17-17: Undefined name snakemake
(F821)
31-31: Undefined name snakemake
(F821)
35-35: Undefined name snakemake
(F821)
🔇 Additional comments (2)
bio/mtnucratio/wrapper.py (1)
1-9
: LGTM! Imports and docstring are appropriate.
The imports cover all necessary functionality for file operations and Snakemake integration.
test_wrappers.py (1)
3420-3425
: LGTM: Test function follows established patterns
The test function follows the standard pattern used throughout the test suite, with proper use of the run fixture and standard snakemake parameters.
🤖 I have created a release \*beep\* \*boop\* --- ## [5.3.0](https://www.github.com/snakemake/snakemake-wrappers/compare/v5.2.1...v5.3.0) (2024-11-27) ### Features * Add vg giraffe ([#3302](https://www.github.com/snakemake/snakemake-wrappers/issues/3302)) ([fbf806d](https://www.github.com/snakemake/snakemake-wrappers/commit/fbf806d97336b23caa443b9063b0042e97712d28)) * MtNucRatioCalculator ([#3496](https://www.github.com/snakemake/snakemake-wrappers/issues/3496)) ([b221057](https://www.github.com/snakemake/snakemake-wrappers/commit/b2210576f75be6a90569b676688b476c4aaba7a8)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Add a wrapper for MtNucRatioCalculator.
QC
snakemake-wrappers
.While the contributions guidelines are more extensive, please particularly ensure that:
test.py
was updated to call any added or updated example rules in aSnakefile
input:
andoutput:
file paths in the rules can be chosen arbitrarilyinput:
oroutput:
)tempfile.gettempdir()
points tometa.yaml
contains a link to the documentation of the respective tool or command underurl:
Summary by CodeRabbit
Release Notes
New Features
environment.linux-64.pin.txt
for easy environment setup on Linux 64-bit.MTNucRatioCalculator
with clear input/output specifications and parameters.Tests
MTNucRatioCalculator
wrapper.