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

bug fixes for CAMPneu #51527

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Conversation

mmkadam
Copy link

@mmkadam mmkadam commented Oct 21, 2024

Describe your pull request here


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

@mmkadam mmkadam closed this Oct 21, 2024
@mmkadam mmkadam reopened this Oct 21, 2024
Copy link
Contributor

coderabbitai bot commented Oct 21, 2024

📝 Walkthrough
📝 Walkthrough
📝 Walkthrough

Walkthrough

This pull request updates the metadata file meta.yaml for the CAMPneu package, now at version 1.1.1. The changes include the specification of the package's name, version, and an updated source URL that points to the new GitHub repository location. A new SHA256 hash is provided for verifying the integrity of the source tarball. The build section indicates that the package is architecture-independent, and a script is included to create a binary directory, copy necessary files, and set executable permissions. The requirements section details the dependencies needed for building, hosting, and running the package, specifying Python and setuptools as build dependencies with a conditional skip for Windows. The host requirements include Python and pip, while the run requirements list essential tools and libraries for functionality. The test command remains unchanged, verifying installation by running CAMPneu.nf --help. Additionally, the about section has been expanded to provide a more detailed summary of the package's purpose, particularly its role in bioinformatics analysis for Illumina paired-end sequence data and Mycoplasma pneumoniae.

Possibly related PRs

Suggested labels

please review & merge


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.

build:
- python
- setuptools
- skip: True # [win]
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be part of root > build, not root > requirements > build

Copy link
Member

Choose a reason for hiding this comment

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

Please do not resolve conversations if you haven't addressed the issue.

recipes/CAMPneu/build.sh Outdated Show resolved Hide resolved

build:
number: 0
noarch: generic
Copy link
Contributor

Choose a reason for hiding this comment

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

missing run_exports

recipes/CAMPneu/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: 3

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

23-23: Remove trailing spaces for consistency.

The static analysis tool detected trailing spaces on lines 23 and 27. While these don't affect functionality, removing them improves code consistency.

Please remove the trailing spaces from lines 23 and 27.

Also applies to: 27-27

🧰 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 44de0dc and eb76457.

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

[error] 23-23: trailing spaces

(trailing-spaces)


[error] 27-27: trailing spaces

(trailing-spaces)


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

(syntax)

🔇 Additional comments (6)
recipes/CAMPneu/build.sh (3)

5-5: LGTM: Directory creation is correct.

The use of mkdir -p $PREFIX/bin/ is appropriate. It ensures the target directory exists without raising errors if it's already present.


9-9: Verify the need for executable configuration files.

Making configuration files executable is unusual. Typically, only scripts or binaries need executable permissions. Consider the following:

  1. If CAMPneu.nf is a Nextflow script that needs to be executed directly, making it executable is appropriate.
  2. For nextflow.config, executable permissions are likely unnecessary. Consider removing it from the chmod command.

Suggestion: Split this into two commands for clarity and only make CAMPneu.nf executable if needed:

chmod +x $PREFIX/bin/CAMPneu.nf
# Removed chmod for nextflow.config
#!/bin/bash
# Check if CAMPneu.nf contains a shebang line
if head -n 1 "$PREFIX/bin/CAMPneu.nf" | grep -q '^#!'; then
  echo "CAMPneu.nf contains a shebang line. It may need to be executable."
else
  echo "CAMPneu.nf does not contain a shebang line. Verify if it needs to be executable."
fi

# Check if nextflow.config is a plain text file
if file "$PREFIX/bin/nextflow.config" | grep -q 'text'; then
  echo "nextflow.config appears to be a text file. It likely doesn't need executable permissions."
fi

1-3: Verify the necessity of the commented pip install command.

The script includes a commented-out pip install command. If this command is no longer needed, consider removing it to keep the script clean. If it might be needed in the future, add a comment explaining why it's currently disabled and under what circumstances it should be enabled.

#!/bin/bash
# Check if there's a setup.py or pyproject.toml file in the package
if fd -t f -e py -e toml '(setup|pyproject)'; then
  echo "Found potential Python package files. The pip install command might be necessary."
else
  echo "No Python package files found. The pip install command might be unnecessary."
fi
recipes/CAMPneu/meta.yaml (3)

1-12: LGTM: Package and source information are well-defined.

The use of Jinja2 variables for package name, version, and hash is a good practice for maintainability. The source URL is correctly constructed using the GitHub repository information, and the SHA256 hash is provided for integrity verification.

🧰 Tools
🪛 yamllint

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

(syntax)


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

The build number is appropriately set to 0 for a new package. The use of 'noarch: generic' is correct for a package that doesn't contain compiled code, which is suitable for a workflow tool like CAMPneu.


18-39: 🛠️ Refactor suggestion

Consider adjusting dependency specifications.

The requirements section is generally well-structured, but there are a few points to consider:

  1. The Python version constraint <3.11 in the run requirements might be too restrictive. Consider using a more flexible version specification like >=3.6,<4 to allow for future Python versions.

  2. The specific version pin for minimap2 (==2.28) might lead to compatibility issues in the future. Unless this exact version is required, consider using a more flexible version specification like >=2.28.

  3. The use of jq as a dependency is unusual for a bioinformatics tool. Please verify if this is indeed a required dependency for CAMPneu.

To verify the jq dependency, you can run the following command:

Consider applying these changes to the run requirements:

  run:
    - nextflow
    - python >=3.6,<4
    - minimap2 >=2.28
    # ... other dependencies ...
🧰 Tools
🪛 yamllint

[error] 23-23: trailing spaces

(trailing-spaces)


[error] 27-27: trailing spaces

(trailing-spaces)


mkdir -p $PREFIX/bin/

cp $RECIPE_DIR/../CAMPneu.nf $RECIPE_DIR/../nextflow.config $PREFIX/bin/
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Source files CAMPneu.nf and nextflow.config are missing from the repository.

The build.sh script attempts to copy CAMPneu.nf and nextflow.config from the parent directory of the recipe, but these files were not found in any location within the repository. This will cause the copy operation to fail.

  • Ensure that CAMPneu.nf and nextflow.config are present in the repository.
  • If necessary, relocate these files to the recipe directory and update the copy command accordingly.
🔗 Analysis chain

Verify the correct location of source files.

The command copies files from $RECIPE_DIR/.., which is the parent directory of the recipe. This is unusual, as typically, files are copied from within the recipe directory. Ensure that CAMPneu.nf and nextflow.config are indeed located in the parent directory of the recipe.

Consider moving these files into the recipe directory for better organization and to follow conventional practices.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if the files exist in the expected location
if [ -f "$RECIPE_DIR/../CAMPneu.nf" ] && [ -f "$RECIPE_DIR/../nextflow.config" ]; then
  echo "Files found in the parent directory of the recipe."
else
  echo "Files not found in the expected location. Please verify their placement."
fi

# Check if the files exist in the recipe directory
if [ -f "$RECIPE_DIR/CAMPneu.nf" ] && [ -f "$RECIPE_DIR/nextflow.config" ]; then
  echo "Files already exist in the recipe directory. Update the copy command accordingly."
fi

Length of output: 405


Script:

#!/bin/bash
# Locate CAMPneu.nf and nextflow.config in the repository
fd "CAMPneu.nf" . --type f
fd "nextflow.config" . --type f

# Check if 'file' command is available
if command -v file >/dev/null 2>&1; then
  echo "'file' command is available."
else
  echo "'file' command is not available. Please ensure it is installed."
fi

Length of output: 219

recipes/CAMPneu/meta.yaml Show resolved Hide resolved
Comment on lines 45 to 48
about:
home: "https://github.com/{{ user }}/{{ name }}"
license: MIT
summary: "Comprehensive Analysis of Mycoplasma Pneumoniae"
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Enhance the about section with more details.

The about section provides essential information, but it could be more comprehensive:

  1. The use of Jinja2 variables for the home URL is consistent and good.
  2. The license information (MIT) is correctly specified.
  3. The summary is very brief and could be more informative.

Consider expanding the about section with more details:

about:
  home: "https://github.com/{{ user }}/{{ name }}"
  license: MIT
  license_file: LICENSE  # Add this if a LICENSE file exists in the source
  summary: "Comprehensive Analysis of Mycoplasma Pneumoniae"
  description: |
    CAMPneu is a bioinformatics pipeline for the comprehensive analysis of Mycoplasma pneumoniae.
    It integrates various tools for tasks such as genome assembly, variant calling, and annotation.
  dev_url: "https://github.com/{{ user }}/{{ name }}"
  doc_url: "https://github.com/{{ user }}/{{ name }}#readme"

Would you like help in drafting a more detailed description based on the CAMPneu documentation?

Co-authored-by: Martin Grigorov <martin-g@users.noreply.github.com>
@mmkadam mmkadam changed the title edit email for CAMPneu bug fixes for CAMPneu Oct 21, 2024
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

📥 Commits

Files that changed from the base of the PR and between b261d18 and 3095db1.

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

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

(syntax)

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

1-5: LGTM! Well-structured package metadata.

The use of Jinja2 variables for version, hash, and user information promotes maintainability and reduces errors.

🧰 Tools
🪛 yamllint

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

(syntax)


6-13: LGTM! Proper source configuration.

The source configuration correctly uses GitHub releases and includes hash verification.


14-24: LGTM! Build configuration is well-structured.

The build section correctly:

  • Sets up noarch package
  • Handles file installation and permissions
  • Implements run_exports for version pinning

48-51: Previous test enhancement suggestion remains valid.


52-59: LGTM! Comprehensive about section.

The about section now includes:

  • Proper license configuration
  • Detailed summary
  • Well-structured documentation links

1-59: Verify bioconda compatibility.

Let's verify this package meets bioconda requirements.

✅ Verification successful

Let me gather more information to complete the bioconda guidelines verification.


Based on the verification results, I can now provide a final response as we have gathered sufficient information about the package's compliance with bioconda guidelines.

Package meets bioconda requirements

The package satisfies key bioconda guidelines:

  • Properly focused on bioinformatics (contains terms like "bioinformatics", "Illumina", "Mycoplasma")
  • Uses common bioconda dependencies (samtools, bcftools, minimap2)
  • Has appropriate build configuration (noarch: generic)
  • Includes necessary metadata (license, summary, URLs)
  • Contains basic test
  • Has proper Python version constraint
  • Uses standard source URL format for GitHub releases
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify package meets bioconda requirements

# Test 1: Check if package exists in conda-forge (should not)
echo "Checking conda-forge..."
rg -l "name:\s*CAMPneu" 

# Test 2: Verify biology-related keywords in description
echo "Verifying biology focus..."
rg -i "mycoplasma|bioinformatics|illumina|genome" recipes/CAMPneu/meta.yaml

# Test 3: Check for common bioconda dependencies
echo "Checking common bioconda dependencies..."
rg "samtools|bcftools|minimap2" recipes/CAMPneu/meta.yaml

Length of output: 763


Script:

#!/bin/bash
# Description: Additional checks for bioconda guidelines

# Check 1: Verify license compliance
echo "Checking license file..."
fd LICENSE

# Check 2: Verify build number and noarch settings
echo "Checking build settings..."
rg "^build:" -A 3 recipes/CAMPneu/meta.yaml

# Check 3: Check Python version constraint
echo "Checking Python version..."
rg "python" recipes/CAMPneu/meta.yaml

# Check 4: Check if package has tests
echo "Checking test section..."
rg "^test:" -A 3 recipes/CAMPneu/meta.yaml

# Check 5: Verify package URL format
echo "Checking source URL format..."
rg "^source:" -A 3 recipes/CAMPneu/meta.yaml

Length of output: 8319

🧰 Tools
🪛 yamllint

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

(syntax)

recipes/CAMPneu/meta.yaml Show resolved Hide resolved
@mmkadam mmkadam closed this Nov 22, 2024
@mmkadam mmkadam reopened this Nov 25, 2024
@mmkadam
Copy link
Author

mmkadam commented Nov 25, 2024

Reopening pull request to rerun lint tests

@martin-g
Copy link
Contributor

Reopening pull request to rerun lint tests

You will need to address our suggestions to resolve the linting issues.

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