Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: various2 #150

Merged
merged 5 commits into from
Sep 25, 2024
Merged

fix: various2 #150

merged 5 commits into from
Sep 25, 2024

Conversation

cmeesters
Copy link
Member

@cmeesters cmeesters commented Sep 25, 2024

some minor fixes after teaching

Summary by CodeRabbit

  • New Features
    • Introduced a new configuration structure for managing sample data and mapping parameters for genomic analysis.
  • Improvements
    • Streamlined the release process by consolidating multiple PDF uploads into a single zipped asset.
    • Enhanced clarity and consistency in command line examples and configuration sections of the Snakemake workflow.
  • Style
    • Adjusted visual presentation in LaTeX documents for improved layout and readability.

Copy link
Contributor

coderabbitai bot commented Sep 25, 2024

Walkthrough

The changes involve updates to the GitHub Actions workflow for release management, introducing a new method for uploading release assets by zipping generated PDF files. Additionally, a new configuration file for managing sample data for the BWA tool is introduced, along with modifications to LaTeX documents and Snakemake workflow examples to enhance formatting and consistency.

Changes

File Path Change Summary
.github/workflows/release-please.yml Updated upload process to zip PDF files into slides.zip and use actions/upload-release-asset@v1.
setup_creators/solutions/config/config.yaml Introduced a new configuration structure for managing sample data and mapping parameters for BWA.
slides/common/mod_cs_mainz.tex Added vertical space before a citation, adjusting the layout of the document.
slides/creators/Decorating_the_Workflow.tex Standardized variable naming and improved formatting of command line examples in Snakemake workflow.

Possibly related PRs

  • fix: attempt to upload artifacts #130: Modifies the .github/workflows/release-please.yml file to enhance the upload process of release artifacts, incorporating the actions/upload-release-asset@v1 action.
  • fix: attempt to shift upload to build #140: Introduces a new job step in the .github/workflows/release-please.yml file for uploading release artifacts, relevant to the upload process.
  • fix: various little details #148: Updates the path specification in the .github/workflows/release-please.yml file to include specific PDF files for upload, directly related to the main PR's changes.

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

🧹 Outside diff range and nitpick comments (10)
setup_creators/solutions/config/config.yaml (2)

1-3: LGTM! Consider adding comments for clarity.

The samples section is well-structured and correctly defines two samples with their corresponding FASTQ files. This setup is clear and easy to understand.

Consider adding a brief comment above this section to explain its purpose, e.g.:

# Define samples and their corresponding FASTQ files
samples:
  A: A.fastq
  B: B.fastq

1-6: Overall, the configuration file is well-structured and suitable for its purpose.

The YAML file correctly defines the samples and BWA mapping parameters, making it a good example for teaching purposes. The structure is clear and easy to understand, which is crucial for educational material.

For future enhancements or more complex scenarios, consider:

  1. Adding more samples to demonstrate scalability.
  2. Including additional BWA parameters to show how to configure more complex tool options.
  3. Implementing a schema validation for the YAML file to ensure all required fields are present and correctly formatted.

These suggestions aim to make the configuration more robust and educational, but they're not necessary for the current scope of the teaching material.

.github/workflows/release-please.yml (2)

36-37: LGTM! Consider using a more specific zip filename.

The addition of the Snakemake_HPC_Admins.tex render command and the zipping of PDF files are good improvements. They align with the PR objective of enhancing teaching materials and prepare for a more efficient upload process.

Consider using a more specific filename for the zip file, such as snakemake_hpc_slides.zip, to make it easier to identify the content:

- zip slides slides/*pdf 
+ zip snakemake_hpc_slides slides/*pdf 

48-57: Remove commented-out code.

The commented-out lines represent the old upload process using actions/upload-artifact@v4. While it's sometimes useful to keep old code for reference during development, it's generally better to remove it before merging to keep the codebase clean.

Consider removing these commented-out lines entirely. If you need to reference this code in the future, you can always find it in the git history.

-      #      - name: Upload Release Artifacts
-      #if: ${{ steps.release.outputs.release_created }}        
-      #uses: actions/upload-artifact@v4
-      #with:
-      #name: Slides
-      #path: |
-      #  slides/Snakemake_HPC_Creators.pdf;
-      #  slides/Snakemake_HPC_Users.pdf;
-      #  slides/Snakemake_HPC_User_Creator_Combi.pdf;
-      #  slides/Snakemake_HPC_Admins.pdf;
slides/common/mod_cs_mainz.tex (1)

15-16: Approved: Layout adjustment improves slide presentation.

The addition of 18mm vertical space before the citation enhances the visual layout of the slide. This change aligns with the PR objective of implementing minor fixes to improve teaching materials.

For consistency and easier maintenance, consider using a LaTeX length variable for such spacing. For example:

\newlength{\citationvspace}
\setlength{\citationvspace}{18mm}

% Then use it in your document
\vspace{\citationvspace}

This approach allows for easier global adjustments to spacing throughout the document.

slides/creators/Decorating_the_Workflow.tex (5)

439-443: LGTM! Clear improvement in command line example

The changes enhance the clarity of the SLURM execution example by using placeholders for cluster-specific information. The added comment about quotation marks and argument formatting is helpful for users.

Consider wrapping the entire command in triple backticks (```) for better readability in markdown-rendered documentation.


459-463: LGTM! Helpful addition of -j unlimited explanation

The explanation of the -j unlimited option and its inclusion in the command line example is valuable. It helps users understand how to allow Snakemake to submit an unlimited number of jobs to the cluster.

Consider adding a brief note about the potential implications of using -j unlimited, such as the risk of overwhelming the cluster or hitting job submission limits.


491-492: LGTM! Improved command line example with -F option

The addition of the -F option is helpful for enforcing execution. The conditional inclusion of the cluster account placeholder improves the flexibility of the example for different cluster setups.

Consider adding a brief explanation of what the -F option does, either in the slide text or as a comment in the LaTeX source.


577-581: LGTM! Helpful addition of profile setup instructions

The addition of instructions for copying a template profile and the inclusion of the --workflow-profile option in the command line example are helpful for users setting up their Snakemake workflow with a profile.

Consider adding a brief explanation of what a Snakemake profile is and its benefits, either in the slide text or as a comment in the LaTeX source.


Line range hint 1-581: Overall, great improvements to the Snakemake workflow slides

The changes in this file significantly enhance the clarity and educational value of the Snakemake workflow slides, particularly in the areas of SLURM execution and profile usage. The updated command line examples and added explanations provide users with more comprehensive guidance on running Snakemake workflows on HPC clusters.

Consider adding a section or slide that discusses best practices for organizing Snakemake workflows, including the use of profiles, config files, and modular rule definitions. This could help users create more maintainable and portable workflows.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 3796b8f and b462e50.

📒 Files selected for processing (4)
  • .github/workflows/release-please.yml (1 hunks)
  • setup_creators/solutions/config/config.yaml (1 hunks)
  • slides/common/mod_cs_mainz.tex (1 hunks)
  • slides/creators/Decorating_the_Workflow.tex (5 hunks)
🧰 Additional context used
actionlint
.github/workflows/release-please.yml

44-44: property "create_release" is not defined in object type {}

(expression)

🔇 Additional comments not posted (2)
.github/workflows/release-please.yml (1)

38-47: ⚠️ Potential issue

Good improvement, but there are some issues to address.

The new upload process using actions/upload-release-asset@v1 is a good improvement, as it's more efficient to upload a single zip file rather than multiple PDFs. However, there are a couple of issues that need to be addressed:

  1. The upload_url parameter references a step (create_release) that doesn't exist in this workflow. This will cause the upload to fail.
  2. The asset_content_type is incorrect for a zip file.

To fix these issues, please make the following changes:

  1. Replace the upload_url with the correct reference. If you're using release-please-action to create the release, you should use its output. Otherwise, you may need to add a step to create the release first.

  2. Correct the asset_content_type for a zip file.

- upload_url: ${{ steps.create_release.outputs.upload_url }}
+ upload_url: ${{ steps.release.outputs.upload_url }}
- asset_path: ./slides.zip
+ asset_path: ./snakemake_hpc_slides.zip
- asset_name: slides.zip
+ asset_name: snakemake_hpc_slides.zip
- asset_content_type: slide/zip   
+ asset_content_type: application/zip

Also, ensure that the release-please-action step (in the release-please job) is configured to create a release and provide the upload_url output.

To verify the correct setup of the release-please action, run:

🧰 Tools
actionlint

44-44: property "create_release" is not defined in object type {}

(expression)

slides/creators/Decorating_the_Workflow.tex (1)

153-155: Clarify the source of the samples variable

The change from config["samples"] to samples simplifies the code, but it's unclear where samples is defined or how it relates to the previous config["samples"]. Please provide context on how samples is initialized and whether this change maintains the same functionality.

Comment on lines +5 to +6
bwa_map:
rg=r"@RG\tID:{sample}\tSM:{sample}"
Copy link
Contributor

@coderabbitai coderabbitai bot Sep 25, 2024

Choose a reason for hiding this comment

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

💡 Codebase verification

Missing FASTQ Files

The validation script indicates that A.fastq and B.fastq are not found in the expected directory. Please ensure these files are present or update the samples section with the correct file paths.

🔗 Analysis chain

LGTM! Consider adding comments and validating file paths.

The bwa_map section correctly defines the read group (RG) format string for BWA. The use of a raw string literal (r"...") is appropriate for handling escape characters, and the placeholders for {sample} will allow for dynamic replacement.

  1. Consider adding a comment to explain the purpose of this section and the format string:
# BWA mapping parameters
bwa_map:
  # Read group format string: includes sample ID and sample name
  rg: r"@RG\tID:{sample}\tSM:{sample}"
  1. It might be beneficial to add a note or implement a validation step to ensure that the FASTQ files specified in the samples section actually exist in the expected directory.

To verify the existence of the FASTQ files, you can run the following script:

This script will help ensure that the specified FASTQ files are present in the expected location.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the existence of FASTQ files specified in the config.yaml

# Test: Check if the FASTQ files exist
for file in A.fastq B.fastq; do
  if [ ! -f "$file" ]; then
    echo "Warning: $file not found in the current directory"
  else
    echo "$file exists"
  fi
done

Length of output: 335

Copy link
Member Author

Choose a reason for hiding this comment

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

these are tutorial data - they are provided seperately.

Copy link
Contributor

Choose a reason for hiding this comment

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

@cmeesters, thanks for the clarification! Since the FASTQ files are tutorial data provided separately, it's acceptable that they are not present in the repository.

🐰❓


✏️ Learnings added
Learnt from: cmeesters
PR: snakemake/snakemake-hpc-teaching-material#150
File: setup_creators/solutions/config/config.yaml:5-6
Timestamp: 2024-09-25T20:32:40.282Z
Learning: The FASTQ files `A.fastq` and `B.fastq` are tutorial data provided separately and may not be present in the repository.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

Copy link
Contributor

Artifacts

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant