Skip to content

fix: fix 4118 #4119

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

Merged
merged 6 commits into from
May 19, 2025
Merged

fix: fix 4118 #4119

merged 6 commits into from
May 19, 2025

Conversation

fgvieira
Copy link
Collaborator

@fgvieira fgvieira commented May 16, 2025

Fixes #4118

QC

While the contributions guidelines are more extensive, please particularly ensure that:

  • test.py was updated to call any added or updated example rules in a Snakefile
  • input: and output: file paths in the rules can be chosen arbitrarily
  • wherever possible, command line arguments are inferred and set automatically (e.g. based on file extensions in input: or output:)
  • temporary files are either written to a unique hidden folder in the working directory, or (better) stored where the Python function tempfile.gettempdir() points to
  • the meta.yaml contains a link to the documentation of the respective tool or command under url:
  • conda environments use a minimal amount of channels and packages, in recommended ordering

Summary by CodeRabbit

  • Bug Fixes
    • Corrected formatting of input file paths when providing separate normal and tumor pileup files, ensuring proper handling by the VarScan somatic command.
  • Refactor
    • Simplified input handling by automatically detecting single mpileup files.
    • Streamlined command execution and improved logging for VarScan somatic analysis.

Copy link
Contributor

coderabbitai bot commented May 16, 2025

Warning

Rate limit exceeded

@fgvieira has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 6 minutes and 41 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

📥 Commits

Reviewing files that changed from the base of the PR and between 7ddcdb6 and 19dc0d1.

⛔ Files ignored due to path filters (1)
  • bio/varscan/somatic/test/mpileup/a.tumor.mpileup.gz is excluded by !**/*.gz
📒 Files selected for processing (3)
  • bio/varscan/somatic/test/Snakefile (1 hunks)
  • bio/varscan/somatic/wrapper.py (1 hunks)
  • test_wrappers.py (5 hunks)
📝 Walkthrough

Walkthrough

The update simplifies the VarScan somatic wrapper input handling by removing explicit separate normal and tumor pileup inputs, instead inferring a single mpileup input when exactly one input file is provided. It removes output directory creation and adjusts the shell command to use the unified input and append logging. The Snakefile input specification was also changed accordingly.

Changes

File(s) Change Summary
bio/varscan/somatic/wrapper.py Removed explicit checks for separate normal and tumor pileup inputs; inferred single mpileup input if only one file is present; removed output directory creation; updated shell command to use unified input and append logging; minor formatting adjustments.
bio/varscan/somatic/test/Snakefile Removed commented-out normal/tumor pileup inputs; replaced named mpileup input with positional "mpileup/{sample}.mpileup.gz" input; removed JVM memory and resource comments.

Assessment against linked issues

Objective Addressed Explanation
Fix VarScan somatic wrapper error caused by incorrect input string construction (#4118)
Correctly pass normal and tumor pileup inputs to VarScan somatic command (#4118)
Remove errors related to missing or misformatted input variables in the wrapper (#4118)

Suggested reviewers

  • johanneskoester
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 985cdf9 and afa92cb.

📒 Files selected for processing (1)
  • bio/varscan/somatic/wrapper.py (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
`**/*.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 `s...

**/*.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.

  • bio/varscan/somatic/wrapper.py
`**/wrapper.py`: Do not complain about use of undefined variable called `snakemake`.

**/wrapper.py: Do not complain about use of undefined variable called snakemake.

  • bio/varscan/somatic/wrapper.py
🪛 Ruff (0.8.2)
bio/varscan/somatic/wrapper.py

38-38: Undefined name snakemake

(F821)


38-38: Undefined name snakemakeinput

(F821)

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: testing
  • GitHub Check: docs

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between afa92cb and 7ddcdb6.

📒 Files selected for processing (2)
  • bio/varscan/somatic/test/Snakefile (1 hunks)
  • bio/varscan/somatic/wrapper.py (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • bio/varscan/somatic/test/Snakefile
🧰 Additional context used
📓 Path-based instructions (2)
`**/*.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 `s...

**/*.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.

  • bio/varscan/somatic/wrapper.py
`**/wrapper.py`: Do not complain about use of undefined variable called `snakemake`.

**/wrapper.py: Do not complain about use of undefined variable called snakemake.

  • bio/varscan/somatic/wrapper.py
🪛 Ruff (0.8.2)
bio/varscan/somatic/wrapper.py

9-9: os imported but unused

Remove unused import: os

(F401)


15-15: Undefined name snakemake

(F821)


16-16: Undefined name snakemake

(F821)


17-17: Undefined name snakemake

(F821)


20-20: Undefined name op

(F821)


20-20: Undefined name snakemake

(F821)


23-23: Undefined name snakemake

(F821)

🪛 GitHub Actions: Code quality
bio/varscan/somatic/wrapper.py

[error] 1-1: Black formatting check failed. File would be reformatted. Run 'black' to fix code style issues.

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: testing
  • GitHub Check: docs
🔇 Additional comments (5)
bio/varscan/somatic/wrapper.py (5)

22-23: Good simplification of mpileup detection.

This elegantly simplifies input handling by automatically detecting a single mpileup input file and setting the appropriate flag. This is a clean approach that aligns with the PR objective to simplify the wrapper.

🧰 Tools
🪛 Ruff (0.8.2)

23-23: Undefined name snakemake

(F821)


27-27: Clean input handling simplification.

This change simplifies the input handling by directly using the Snakemake input collection instead of explicitly referencing separate pileup files. This works well with the mpileup detection logic added above.


29-30: Improved parameter organization.

Separating Java options and extra parameters onto different lines improves readability and maintainability of the code.


34-34: Proper logging implementation.

Adding the log formatter ensures that both stdout and stderr are properly captured, which is a good practice for debugging and monitoring.


1-36:

❓ Verification inconclusive

Fix Black formatting issues.

The pipeline failure indicates that the file would be reformatted by Black. Please run Black on this file to fix the formatting issues.


🏁 Script executed:

#!/bin/bash
# Run Black to check formatting issues
black --check bio/varscan/somatic/wrapper.py

Length of output: 142


Install and run Black to fix formatting issues in wrapper.py

The sandbox couldn’t verify formatting (black not found). Please install Black (e.g., pip install black) and then run:

  • black --check bio/varscan/somatic/wrapper.py
  • black bio/varscan/somatic/wrapper.py

to address any formatting differences and commit the reformatted file.

🧰 Tools
🪛 Ruff (0.8.2)

9-9: os imported but unused

Remove unused import: os

(F401)


15-15: Undefined name snakemake

(F821)


16-16: Undefined name snakemake

(F821)


17-17: Undefined name snakemake

(F821)


20-20: Undefined name op

(F821)


20-20: Undefined name snakemake

(F821)


23-23: Undefined name snakemake

(F821)

🪛 GitHub Actions: Code quality

[error] 1-1: Black formatting check failed. File would be reformatted. Run 'black' to fix code style issues.

@fgvieira fgvieira merged commit 00f7aaf into snakemake:master May 19, 2025
7 checks passed
@fgvieira fgvieira deleted the varscan_fix_4118 branch May 19, 2025 10:39
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.

Varscan somatic error
2 participants