Skip to content
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

chore: remove wrapper for unmaintained nanosim-h in favor of new nanosim wrapper (#3165) #3143

Merged
merged 7 commits into from
Sep 5, 2024

Conversation

dlaehnemann
Copy link
Contributor

@dlaehnemann dlaehnemann commented Aug 29, 2024

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

  • New Features

    • Enhanced the simulator's configuration with a new URL linking to the project's GitHub repository.
    • Expanded the parameters section with detailed descriptions for command line arguments, improving clarity for users.
    • Added a max_read_len parameter to the nanosimh rule, allowing for longer simulated reads.
  • Improvements

    • Reformatted the description in the configuration file for better readability.
    • Improved input handling in the simulation function for enhanced flexibility.
  • Bug Fixes

    • Updated parameter handling to ensure correct execution of commands with new inputs.
    • Removed outdated test function to streamline testing strategy.

Copy link
Contributor

coderabbitai bot commented Aug 29, 2024

Walkthrough

The changes involve enhancements to the meta.yaml, Snakefile, and wrapper.py files of the nanosim-h project. The meta.yaml file was updated for better readability and usability, including a new URL field and expanded parameter descriptions. The Snakefile modifications clarified input and output specifications and introduced a new parameter for maximum read length. The wrapper.py file adjustments improved input parameter handling and introduced new parameters for flexibility. Additionally, the test.py file saw the removal of the test_nanosimh function.

Changes

Files Change Summary
bio/nanosim-h/meta.yaml Reformatted description to block style, added url, and expanded params section with detailed descriptions for several parameters.
bio/nanosim-h/test/Snakefile Clarified input and output specifications, added max_read_len parameter, and reformatted sections for consistency.
bio/nanosim-h/wrapper.py Updated get_length_of_longest_sequence function to modify the prefix parameter and added new parameters for input handling.
test.py Removed the test_nanosimh function, indicating a change in the testing strategy.

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?

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>.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @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.

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 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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between c282ac1 and 4e9c63f.

Files selected for processing (3)
  • bio/nanosim-h/meta.yaml (1 hunks)
  • bio/nanosim-h/test/Snakefile (1 hunks)
  • bio/nanosim-h/wrapper.py (2 hunks)
Additional context used
Path-based instructions (1)
bio/nanosim-h/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.

Ruff
bio/nanosim-h/wrapper.py

32-32: Undefined name snakemake

(F821)


32-32: Undefined name snakemake

(F821)


33-33: Undefined name snakemake

(F821)


34-34: Undefined name snakemake

(F821)


35-35: Undefined name snakemake

(F821)


36-36: Undefined name snakemake

(F821)


37-37: Undefined name snakemake

(F821)


38-38: Undefined name snakemake

(F821)


39-39: Undefined name snakemake

(F821)

Additional comments not posted (11)
bio/nanosim-h/test/Snakefile (4)

3-3: LGTM!

The explicit definition of the fasta parameter improves clarity and usability.


6-8: LGTM!

The reformatting of the output section improves consistency.


10-14: LGTM!

The expanded params section enhances functionality and flexibility by allowing users to specify a broader range of parameters.


16-16: LGTM!

The update to the log section improves consistency with the new formatting style.

bio/nanosim-h/meta.yaml (3)

2-5: LGTM!

The reformatting of the description to block style improves readability.


8-8: LGTM!

The addition of the url field enhances accessibility by providing a reference point for users.


10-24: LGTM!

The expanded params section with detailed descriptions improves the documentation quality, making it easier for users to understand how to configure the simulator effectively.

bio/nanosim-h/wrapper.py (4)

32-39: LGTM!

The additional parameters enhance the function's capability to manage input data more effectively.

Tools
Ruff

32-32: Undefined name snakemake

(F821)


32-32: Undefined name snakemake

(F821)


33-33: Undefined name snakemake

(F821)


34-34: Undefined name snakemake

(F821)


35-35: Undefined name snakemake

(F821)


36-36: Undefined name snakemake

(F821)


37-37: Undefined name snakemake

(F821)


38-38: Undefined name snakemake

(F821)


39-39: Undefined name snakemake

(F821)


32-39: LGTM!

The updates to the prefix parameter and the introduction of input_fasta and input_profile_dir improve the flexibility and usability of the function.

Tools
Ruff

32-32: Undefined name snakemake

(F821)


32-32: Undefined name snakemake

(F821)


33-33: Undefined name snakemake

(F821)


34-34: Undefined name snakemake

(F821)


35-35: Undefined name snakemake

(F821)


36-36: Undefined name snakemake

(F821)


37-37: Undefined name snakemake

(F821)


38-38: Undefined name snakemake

(F821)


39-39: Undefined name snakemake

(F821)


60-60: LGTM!

The update to the command string ensures that the new input parameters are passed correctly in the command execution.


32-39: Skip the static analysis hints.

The use of snakemake is intentional and should not be flagged as an issue.

Tools
Ruff

32-32: Undefined name snakemake

(F821)


32-32: Undefined name snakemake

(F821)


33-33: Undefined name snakemake

(F821)


34-34: Undefined name snakemake

(F821)


35-35: Undefined name snakemake

(F821)


36-36: Undefined name snakemake

(F821)


37-37: Undefined name snakemake

(F821)


38-38: Undefined name snakemake

(F821)


39-39: Undefined name snakemake

(F821)

@fgvieira
Copy link
Collaborator

Just wondering what the advantage would be of having all parameters separately (instead of a single params.extra).

@dlaehnemann
Copy link
Contributor Author

Yeah, I also saw that. Also, it might make sense to run stuff in a temporary directory and then copy to truly arbitrary file path and names. But I think I think it is not worth investing too much in this wrapper, as nanosim-h does not seem to be maintained any further, with the last commit 3 years ago today:
karel-brinda/NanoSim-H@093831e

So for my own usage, I am now working on a wrapper for the original tool, nanosim, which is being maintained and has more functionality nowadays. For that one, I am opting for an only extra=-based command line argument handling (apart from file-extension based auto-inferences and the likes). But I'll fix the formatting here, later today, so that we can at least improve this wrapper a bit, while I am at it...

@dlaehnemann
Copy link
Contributor Author

Just fixed the formatting, so I hope all tests will run through, now. Feel free to review and merge, if you are satisfied, @fgvieira.

Also, the newer nanosim wrapper is finally in a PR as well, in case you feel like reviewing a wrapper that works around a veeeery quirky command-line interface and some interesting choices for configuration files...

@dlaehnemann
Copy link
Contributor Author

Hmm, I can't seem to get nanosim-h to run in the tests, neither in the CI, nor locally. I think I'll just cut my losses and retire this PR in favor of the new nanosim wrapper.

Should we maybe remove this old wrapper altogether? It will still exist in the older snakemake-wrapper releases, but people will not start using this unmaintained tool (and wrapper), simply because they find it on the docs...

@fgvieira
Copy link
Collaborator

fgvieira commented Sep 4, 2024

Yep, if we cannot get it to work and @johanneskoester has nothing against it, I agree that it is better to just remove it.

@dlaehnemann
Copy link
Contributor Author

Maybe I'll try to summon @mbhall88, who originally create the wrapper. Michael, would you have anything against retiring this wrapper and instead only listing the new nanosim wrapper from #3165 ?

@mbhall88
Copy link
Member

mbhall88 commented Sep 4, 2024

Maybe I'll try to summon @mbhall88, who originally create the wrapper. Michael, would you have anything against retiring this wrapper and instead only listing the new nanosim wrapper from #3165 ?

Fine by me

@dlaehnemann dlaehnemann changed the title feat: more specific nanosim-h input file handling chore: remove wrapper for unmaintained nanosim-h in favor of new nanosim wrapper (#3165) Sep 5, 2024
@fgvieira fgvieira merged commit b7947ff into master Sep 5, 2024
8 checks passed
@fgvieira fgvieira deleted the feat/more-specific-nanosim-h-input-file-handling branch September 5, 2024 09:10
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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 4e9c63f and df99184.

Files selected for processing (1)
  • test.py (1 hunks)
Files skipped from review due to trivial changes (1)
  • test.py

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.

3 participants