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

Add recipe for consensify #50969

Merged
merged 9 commits into from
Sep 27, 2024
Merged

Add recipe for consensify #50969

merged 9 commits into from
Sep 27, 2024

Conversation

dramanica
Copy link
Contributor

@dramanica dramanica commented Sep 26, 2024

This PR adds a recipe for consensify, a method for generating a consensus pseudohaploid genome sequence


Please read the guidelines for Bioconda recipes before opening a pull request (PR).

General instructions

  • If this PR adds or updates a recipe, use "Add" or "Update" appropriately as the first word in its title.
  • New recipes not directly relevant to the biological sciences need to be submitted to the conda-forge channel instead of Bioconda.
  • PRs require reviews prior to being merged. Once your PR is passing tests and ready to be merged, please issue the @BiocondaBot please add label command.
  • Please post questions on Gitter or ping @bioconda/core in a comment.

Instructions for avoiding API, ABI, and CLI breakage issues

Conda is able to record and lock (a.k.a. pin) dependency versions used at build time of other recipes.
This way, one can avoid that expectations of a downstream recipe with regards to API, ABI, or CLI are violated by later changes in the recipe.
If not already present in the meta.yaml, make sure to specify run_exports (see here for the rationale and comprehensive explanation).
Add a run_exports section like this:

build:
  run_exports:
    - ...

with ... being one of:

Case run_exports statement
semantic versioning {{ pin_subpackage("myrecipe", max_pin="x") }}
semantic versioning (0.x.x) {{ pin_subpackage("myrecipe", max_pin="x.x") }}
known breakage in minor versions {{ pin_subpackage("myrecipe", max_pin="x.x") }} (in such a case, please add a note that shortly mentions your evidence for that)
known breakage in patch versions {{ pin_subpackage("myrecipe", max_pin="x.x.x") }} (in such a case, please add a note that shortly mentions your evidence for that)
calendar versioning {{ pin_subpackage("myrecipe", max_pin=None) }}

while replacing "myrecipe" with either name if a name|lower variable is defined in your recipe or with the lowercase name of the package in quotes.

Bot commands for PR management

Please use the following BiocondaBot commands:

Everyone has access to the following BiocondaBot commands, which can be given in a comment:

@BiocondaBot please update Merge the master branch into a PR.
@BiocondaBot please add label Add the please review & merge label.
@BiocondaBot please fetch artifacts Post links to CI-built packages/containers.
You can use this to test packages locally.

Note that the @BiocondaBot please merge command is now depreciated. Please just squash and merge instead.

Also, the bot watches for comments from non-members that include @bioconda/<team> and will automatically re-post them to notify the addressed <team>.

Summary by CodeRabbit

  • New Features

    • Introduced a new shell script for building the consensify project.
    • Added package configuration for consensify, version 2.4.0, including metadata and dependencies.
  • Documentation

    • Included detailed package information, such as source URL, checksum, and installation verification commands.

Copy link
Contributor

coderabbitai bot commented Sep 26, 2024

📝 Walkthrough
📝 Walkthrough
📝 Walkthrough
📝 Walkthrough

Walkthrough

The changes introduce a new shell script, build.sh, for the consensify project, facilitating the compilation and installation of the software. Additionally, a meta.yaml file is created to define the package configuration for consensify, version 2.4.0, detailing source information, dependencies, and metadata for the package.

Changes

Files Change Summary
recipes/consensify/build.sh Introduced a new shell script for compiling consensify_c.cpp, linking it with zlib, and copying the executable to a specified binary directory.
recipes/consensify/meta.yaml Created a new package configuration file defining the package name, version, source URL, SHA256 checksum, build requirements, host requirements, test commands, and metadata about the package's functionality.

Possibly related PRs

Suggested reviewers

  • gbayarri

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>, please review it.
    • 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 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 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: 2

🧹 Outside diff range and nitpick comments (7)
recipes/consensify/build.sh (2)

9-10: Linking step is correct, with a minor suggestion

The linking step is well-structured, correctly using environment variables and explicitly linking against zlib.

For consistency with the compilation step, consider using ${CXX} instead of ${CXX} for the linking command:

-${CXX} consensify_c.o -o consensify_c -lz ${LDFLAGS}
+${CXX} consensify_c.o -o consensify_c -lz ${LDFLAGS}

This change doesn't affect functionality but maintains consistent style throughout the script.


12-14: Installation step is correct, with a minor suggestion for robustness

The installation step correctly creates the bin directory and copies the executable to the appropriate location.

For added robustness, consider using the -p option with cp as well:

-cp consensify_c ${PREFIX}/bin/consensify_c
+cp -p consensify_c "${PREFIX}/bin/consensify_c"

This change preserves the executable permissions and uses quotes to handle potential spaces in the path. While unlikely in this context, it's a good practice for shell scripts.

recipes/consensify/meta.yaml (5)

7-9: LGTM: Source URL and checksum are correctly defined.

The source URL and SHA256 checksum are correctly specified. Using the version variable in the URL is a good practice for maintainability.

Consider adding a comment above the sha256 line to remind contributors to update the checksum when the version changes. For example:

source:
  url: https://github.com/jlapaijmans/Consensify/archive/refs/tags/{{ version }}.tar.gz
  # Remember to update the checksum when changing the version
  sha256: 2b88cda2c6ad44b6fd749d86485d3f16418b189b9c8ff4d20dd19640792dac1e

11-14: LGTM: Build section is well-defined.

The build number is correctly set to 0 for a new package. The use of run_exports with pin_subpackage is good for maintaining ABI compatibility.

Consider adding a script section to specify how the package should be built. For C++ projects, this typically involves using make or cmake. For example:

build:
  number: 0
  script:
    - mkdir build
    - cd build
    - cmake ..
    - make
    - make install
  run_exports:
    - {{ pin_subpackage('consensify', max_pin="x") }}

Please adjust the build commands according to the actual build process of the Consensify project.


22-24: LGTM with suggestions: Test section could be more comprehensive.

The current test command is a good basic smoke test, checking if the consensify_c executable can run with the -h option.

Consider adding more comprehensive tests:

  1. Check if the executable exists:

    - test -f $PREFIX/bin/consensify_c  # [unix]
    - if not exist %PREFIX%\\Scripts\\consensify_c.exe exit 1  # [win]
  2. Run a small example dataset if available:

    - consensify_c --input test_data.fastq --output test_output.fastq  # adjust parameters as needed
  3. Check the version:

    - consensify_c --version

These additional tests would provide more confidence in the correct installation and functionality of the package.


26-33: LGTM: About section is comprehensive.

The about section includes all required metadata fields and provides good information about the package.

Consider adding a license_family field to make it easier for automated tools to categorize the license. For GPL-3.0, you can add:

about:
  ...
  license: GPL-3.0
  license_family: GPL
  ...

Also, consider adding a description field with a more detailed explanation of the package, separate from the summary. This can help users understand the package better when viewing it in conda repositories.


21-21: Minor: Remove trailing spaces.

There are trailing spaces on this line. Please remove them to improve code cleanliness.

-    
+
🧰 Tools
🪛 yamllint

[error] 21-21: trailing spaces

(trailing-spaces)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between d6403ea and 293e042.

📒 Files selected for processing (2)
  • recipes/consensify/build.sh (1 hunks)
  • recipes/consensify/meta.yaml (1 hunks)
🧰 Additional context used
🪛 Shellcheck
recipes/consensify/build.sh

[warning] 4-4: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

(SC2164)

🪛 yamllint
recipes/consensify/meta.yaml

[error] 21-21: trailing spaces

(trailing-spaces)


[error] 1-1: syntax error: found character '%' that cannot start any token

(syntax)

🔇 Additional comments (3)
recipes/consensify/build.sh (2)

6-7: Compilation step looks good

The compilation step is well-structured, using environment variables for flexibility and including the current directory in the header search path.


1-14: Overall, the build script is well-structured and functional

This build script for consensify covers all necessary steps (compilation, linking, and installation) and follows good practices such as using environment variables for flexibility. The minor suggestions provided in the review will enhance its robustness and consistency, but the script is already in a good state to serve its purpose in the Bioconda recipe.

🧰 Tools
🪛 Shellcheck

[warning] 4-4: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

(SC2164)

recipes/consensify/meta.yaml (1)

1-5: LGTM: Package and version are correctly defined.

The use of a Jinja2 variable for the version is a good practice for maintainability. The package name and version are correctly defined.

🧰 Tools
🪛 yamllint

[error] 1-1: syntax error: found character '%' that cannot start any token

(syntax)

recipes/consensify/build.sh Outdated Show resolved Hide resolved
recipes/consensify/meta.yaml Show resolved Hide resolved
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

🧹 Outside diff range and nitpick comments (2)
recipes/consensify/meta.yaml (2)

24-26: LGTM: Basic test is present. Consider adding more comprehensive tests.

The current test command checks if the consensify_c executable runs without errors, which is a good basic test. However, if possible, consider adding more comprehensive tests to verify the functionality of the package.


23-23: Remove trailing spaces.

There are trailing spaces on this line. Please remove them to improve code cleanliness.

🧰 Tools
🪛 yamllint

[error] 23-23: trailing spaces

(trailing-spaces)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 293e042 and 97f00a1.

📒 Files selected for processing (2)
  • recipes/consensify/build.sh (1 hunks)
  • recipes/consensify/meta.yaml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • recipes/consensify/build.sh
🧰 Additional context used
🪛 yamllint
recipes/consensify/meta.yaml

[error] 23-23: trailing spaces

(trailing-spaces)


[error] 1-1: syntax error: found character '%' that cannot start any token

(syntax)

🔇 Additional comments (6)
recipes/consensify/meta.yaml (6)

1-5: LGTM: Package and version are correctly defined.

The package name and version are properly set. Using a Jinja2 variable for the version is a good practice for maintainability.

🧰 Tools
🪛 yamllint

[error] 1-1: syntax error: found character '%' that cannot start any token

(syntax)


7-9: LGTM: Source information is correctly specified.

The source URL and SHA256 checksum are properly defined. Using the version variable in the URL is a good practice for consistency.


11-14: LGTM: Build section is properly configured.

The build number is correctly set to 0 for a new package. The run_exports section is using the recommended syntax for pinning, which helps ensure compatibility with downstream packages.


28-35: LGTM: About section is comprehensive and well-documented.

The about section includes all necessary metadata, including home URL, license information, development URL, documentation URL, and a clear summary of the package's functionality. The detailed description provides valuable context about the method and its associated publication.


1-1: Note on YAML syntax warning (can be ignored).

The static analysis tool reported a syntax error for the '%' character on this line. This is a false positive, as the '%' is part of a valid Jinja2 template syntax used in Conda recipes. No action is required for this warning.

🧰 Tools
🪛 yamllint

[error] 1-1: syntax error: found character '%' that cannot start any token

(syntax)


16-22: Verify zlib dependency and consider removing if unused.

The C++ compiler requirement is correct for a C++ project. However, the necessity of the zlib dependency was questioned in previous reviews, and no evidence of its usage was found.

To verify the zlib usage, please run the following script:

If no zlib usage is found, consider removing the zlib dependency from both the host and run sections.

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

🧹 Outside diff range and nitpick comments (1)
recipes/consensify/meta.yaml (1)

31-38: LGTM with a minor suggestion: About section is well-defined.

The about section provides comprehensive metadata:

  1. All required fields (home URL, license, dev_url, doc_url, summary) are present.
  2. The license is correctly specified as GPL3 with a reference to the license file.
  3. The summary and about fields provide clear descriptions of the package's purpose and background.

Minor suggestion: Consider adding a license_family: GPL field for better categorization in the Conda ecosystem.

You can add the license family field like this:

about:
  ...
  license: GPL3
  license_family: GPL
  license_file: LICENCE.txt
  ...
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 97f00a1 and 5c8b84a.

📒 Files selected for processing (1)
  • recipes/consensify/meta.yaml (1 hunks)
🧰 Additional context used
🪛 yamllint
recipes/consensify/meta.yaml

[error] 1-1: syntax error: found character '%' that cannot start any token

(syntax)

🔇 Additional comments (5)
recipes/consensify/meta.yaml (5)

1-5: LGTM: Package and version are correctly defined.

The use of a Jinja2 variable for the version is a good practice for maintainability. The package name and version are correctly set.

Note: The static analysis hint about a syntax error for the '%' character is a false positive. This is a valid Jinja2 template syntax used in Conda recipes.

🧰 Tools
🪛 yamllint

[error] 1-1: syntax error: found character '%' that cannot start any token

(syntax)


7-9: LGTM: Source URL and checksum are correctly specified.

The source URL correctly uses the version variable, which is good for consistency. The SHA256 checksum is provided, ensuring the integrity of the downloaded source.


11-14: LGTM: Build section is correctly configured.

The build number is correctly set to 0 for a new package. The run_exports section with pin_subpackage is a good practice, ensuring that the package is correctly pinned in downstream dependencies. The max_pin="x" allows updates to minor and patch versions, which is generally appropriate for most packages.


24-29: LGTM: Test section is well-defined.

The test section is comprehensive:

  1. It includes source files from the test directory, which is good for thorough testing.
  2. The help command test (consensify_c -h) ensures the executable is properly installed and accessible.
  3. The specific command test checks the functionality with actual input files, providing a more robust verification of the package's operation.

This approach to testing helps ensure the package is correctly installed and functional.


16-22: Verify the necessity of zlib dependency.

The C++ compiler requirement is correct for a C++ project. However, as noted in a previous review, the necessity of the zlib dependency should be verified:

  1. Is zlib actually required for building and running Consensify?
  2. If zlib is not used, consider removing it from both host and run requirements.

To help verify the zlib dependency, you can run the following script:

If the script doesn't find any zlib usage or headers, consider removing the zlib dependency.

recipes/consensify/build.sh Outdated Show resolved Hide resolved
recipes/consensify/meta.yaml Outdated Show resolved Hide resolved
recipes/consensify/meta.yaml Show resolved Hide resolved
mulled-test ignores resources set in the meta.yaml, so the more advanced tests that work on conda fail on mulled.
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

🧹 Outside diff range and nitpick comments (1)
recipes/consensify/meta.yaml (1)

24-26: LGTM with suggestion: Test section is good, but could be expanded.

The test command verifies that the main executable is installed and can run. This is a good basic test.

Consider adding more comprehensive tests if possible, such as:

  • Checking for the presence of other executables or scripts if any.
  • Running a simple analysis on a small dataset to ensure functionality.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 5c8b84a and b996103.

📒 Files selected for processing (2)
  • recipes/consensify/build.sh (1 hunks)
  • recipes/consensify/meta.yaml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • recipes/consensify/build.sh
🧰 Additional context used
📓 Learnings (1)
recipes/consensify/meta.yaml (1)
Learnt from: dramanica
PR: bioconda/bioconda-recipes#50969
File: recipes/consensify/meta.yaml:16-20
Timestamp: 2024-09-26T11:44:14.445Z
Learning: In the Consensify package, `zlib` is a necessary dependency for building, and it must not be removed from the requirements, even if code analysis suggests otherwise.
🪛 yamllint
recipes/consensify/meta.yaml

[error] 1-1: syntax error: found character '%' that cannot start any token

(syntax)

🔇 Additional comments (6)
recipes/consensify/meta.yaml (6)

1-5: LGTM: Package and version are correctly defined.

The package name and version are properly set. Using a Jinja2 variable for the version is a good practice for maintainability.

🧰 Tools
🪛 yamllint

[error] 1-1: syntax error: found character '%' that cannot start any token

(syntax)


7-9: LGTM: Source URL and checksum are properly defined.

The source URL correctly uses the version variable, and the SHA256 checksum is provided to ensure the integrity of the downloaded source.


11-14: LGTM: Build section is correctly configured.

The build number is set to 0, which is correct for a new package. The run_exports section uses the recommended syntax for pinning the package version.


16-22: LGTM: Requirements are correctly specified.

The requirements section is properly configured:

  • The C++ compiler is correctly specified for building.
  • Zlib is included in both host and run requirements, which is necessary for building and running the package as confirmed by the maintainer.

1-1: Note on static analysis warning: False positive.

The yamllint tool reports a syntax error for the '%' character at the beginning of the file. This is a false positive because:

  1. The '%' is part of a Jinja2 template, which is commonly used and encouraged in Conda recipes.
  2. Bioconda explicitly allows and recommends the use of Jinja2 templates in meta.yaml files.

No action is required to address this warning.

🧰 Tools
🪛 yamllint

[error] 1-1: syntax error: found character '%' that cannot start any token

(syntax)


1-36: Summary: Recipe looks good overall with minor updates needed.

The consensify recipe is well-structured and follows Bioconda guidelines. Here's a summary of the review:

  1. Package, version, and source sections are correctly defined.
  2. Build and requirements sections are properly configured.
  3. Test section is good but could be expanded for more comprehensive testing.
  4. About section needs a minor update to the license information.

Next steps:

  1. Update the license information as suggested.
  2. Consider expanding the test section if possible.
  3. Once these changes are made, the recipe should be ready for submission.

Great job on creating this Bioconda recipe for consensify!

🧰 Tools
🪛 yamllint

[error] 1-1: syntax error: found character '%' that cannot start any token

(syntax)

recipes/consensify/meta.yaml Show resolved Hide resolved
@dramanica
Copy link
Contributor Author

@BiocondaBot please add label

@BiocondaBot BiocondaBot added the please review & merge set to ask for merge label Sep 26, 2024
@apeltzer apeltzer enabled auto-merge (squash) September 27, 2024 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
please review & merge set to ask for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants