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

feat: Varscan2 - SnpEff Meta wrapper #3501

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

Conversation

tdayris
Copy link
Contributor

@tdayris tdayris commented Nov 26, 2024

I have been contacted about issue #275 . Varscan2 and SnpEff are compatible while calling somatic variants. No error is produced, and SNP are correctly annotated in the end.

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

    • Introduced a structured meta-wrapper configuration for a bioinformatics pipeline detailing variant calling and annotation steps.
    • Added a new Snakefile that outlines a comprehensive workflow for genomic variant analysis, integrating multiple tools.
    • Updated the used wrappers file to include new bioinformatics tools for enhanced functionality.
  • Tests

    • Added a new test function to verify the integration of VarScan2 with SnpEff for variant annotation.

tdayris and others added 30 commits September 21, 2020 09:16
* 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>
Copy link
Contributor

coderabbitai bot commented Nov 26, 2024

📝 Walkthrough

Walkthrough

The changes introduce a new meta-wrapper configuration for a bioinformatics pipeline in the meta.yaml file, detailing five steps for variant calling and annotation. A new Snakefile establishes rules for genome analysis workflows, integrating tools like Samtools and SnpEff. The used_wrappers.yaml file is updated to include a section listing relevant bioinformatics tools. Additionally, a new test function is added to test_wrappers.py to validate the integration of VarScan2 with SnpEff. These updates enhance the structure and testing of the bioinformatics pipeline.

Changes

File Change Summary
meta/bio/varscan2_snpeff/meta.yaml Added description and authors fields; outlined five key steps for variant calling/annotation.
meta/bio/varscan2_snpeff/test/Snakefile Introduced five rules: get_genome_fasta, samtools_mpileup, varscan2_somatic, snpeff_download, and snpeff_annotate.
meta/bio/varscan2_snpeff/used_wrappers.yaml Added a new wrappers section listing five bioinformatics tools.
test_wrappers.py Added a new test function test_varscan2_snpeff_meta(run) for testing the Snakemake command.

Suggested reviewers

  • fgvieira

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 5c41ca6 and 828d254.

📒 Files selected for processing (1)
  • meta/bio/varscan2_snpeff/meta.yaml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • meta/bio/varscan2_snpeff/meta.yaml

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

🧹 Outside diff range and nitpick comments (5)
meta/bio/varscan2_snpeff/meta.yaml (1)

1-17: Consider revising step categorization in the table

The table structure is clear and informative, but there's an inconsistency in the "Step" column:

  • Steps 1-3 are labeled as "Call variants" but step 1 (genome sequence acquisition) is actually a prerequisite
  • Steps 4-5 are correctly labeled as "Annotate calls"

Consider this revised categorization:

-    | Call variants  | Shell    | Acquire genome sequence                        |
+    | Preparation    | Shell    | Acquire genome sequence                        |
meta/bio/varscan2_snpeff/test/Snakefile (3)

13-25: Improve parameter naming and directory structure

The rule implementation is correct, but could be improved:

  1. The extra parameter name could be more descriptive
  2. Consider organizing outputs in a more structured way
     output:
-        "samtools/mpileup.gz",
+        "results/samtools/mpileup.gz",
     threads: 1
     log:
-        "logs/samtools_mpileup.log",
+        "logs/samtools/mpileup.log",
     params:
-        extra=" --count-orphans ",
+        mpileup_args=" --count-orphans ",

27-39: Update input path and add VCF version information

Consider the following improvements:

  1. Update input path to match the suggested samtools output path
  2. Add VCF version information in the filename
  3. Organize outputs in a results directory
     input:
-        mpileup="samtools/mpileup.gz",
+        mpileup="results/samtools/mpileup.gz",
     output:
-        snp="varscan2/snp.vcf",
-        indel="varscan2/indel.vcf",
+        snp="results/varscan2/snp.vcf4.2",
+        indel="results/varscan2/indel.vcf4.2",

1-65: Consider architectural improvements for the workflow

While the workflow is well-structured, consider the following improvements:

  1. Add workflow documentation as comments, including:

    • Input requirements
    • Expected output files
    • Resource requirements
    • Tool versions
  2. Mark intermediate files as temporary:

     output:
-        "results/samtools/mpileup.gz",
+        temp("results/samtools/mpileup.gz"),
  1. Add resource specifications for cluster execution:
# Add to each rule
    resources:
        mem_mb=4000,
        runtime=60
test_wrappers.py (1)

817-829: Add docstring to document test purpose

The test implementation follows the established patterns in the codebase and correctly tests the varscan2-snpeff meta wrapper. Consider adding a docstring to document what this test validates.

 def test_varscan2_snpeff_meta(run):
+    """Test the varscan2-snpeff meta wrapper by validating generation of an annotated VCF file."""
     run(
         "meta/bio/varscan2_snpeff",
         [
             "snakemake", 
             "--cores",
             "1",
             "--use-conda",
             "-F",
             "snpeff/annotated.vcf",
         ],
     )
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 50980f1 and 117c632.

📒 Files selected for processing (4)
  • meta/bio/varscan2_snpeff/meta.yaml (1 hunks)
  • meta/bio/varscan2_snpeff/test/Snakefile (1 hunks)
  • meta/bio/varscan2_snpeff/used_wrappers.yaml (1 hunks)
  • test_wrappers.py (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • meta/bio/varscan2_snpeff/used_wrappers.yaml
🧰 Additional context used
📓 Path-based instructions (1)
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.

🔇 Additional comments (1)
meta/bio/varscan2_snpeff/meta.yaml (1)

18-20: LGTM!

The authors section follows the correct YAML format and properly attributes the contribution.

meta/bio/varscan2_snpeff/test/Snakefile Outdated Show resolved Hide resolved
meta/bio/varscan2_snpeff/test/Snakefile Outdated Show resolved Hide resolved
meta/bio/varscan2_snpeff/test/Snakefile Outdated 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: 1

🧹 Outside diff range and nitpick comments (1)
meta/bio/varscan2_snpeff/meta.yaml (1)

5-17: Consider improving the workflow description format and clarity.

While the table is visually clear, there are a few suggestions for improvement:

  1. The "Step" column could be more specific instead of repeating "Call variants" multiple times
  2. Consider using a more maintainable YAML list format instead of ASCII art table
  3. The "Shell" tool reference is vague and could be more specific about the actual tool or command being used

Consider this alternative format:

steps:
  variant_calling:
    - name: "Genome Sequence Acquisition"
      tool: "wget/curl"  # or specific tool name
      purpose: "Acquire genome sequence"
    - name: "Variant Detection"
      tool: "Samtools"
      purpose: "Acquire a list of potential variants"
    - name: "Variant Calling"
      tool: "Varscan2"
      purpose: "Call variants with Varscan2"
  
  annotation:
    - name: "Database Preparation"
      tool: "SnpEff"
      purpose: "Download variants database"
    - name: "Variant Annotation"
      tool: "SnpEff"
      purpose: "Annotate variants with downloaded database"
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 117c632 and 40f846a.

📒 Files selected for processing (2)
  • meta/bio/varscan2_snpeff/meta.yaml (1 hunks)
  • meta/bio/varscan2_snpeff/test/Snakefile (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • meta/bio/varscan2_snpeff/test/Snakefile
🔇 Additional comments (2)
meta/bio/varscan2_snpeff/meta.yaml (2)

1-4: LGTM! Clear and well-structured header.

The name and description structure follow YAML best practices and clearly indicate the purpose of the meta-wrapper.


19-20: LGTM! Author information is properly formatted.

The author section follows the correct YAML list structure and matches the PR submitter.

meta/bio/varscan2_snpeff/meta.yaml Outdated Show resolved Hide resolved
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.

5 participants