Skip to content

Conversation

@dlaehnemann
Copy link
Member

@dlaehnemann dlaehnemann commented Jul 16, 2025

This change allows for multiple gene set files to be specified.

There are two things to especially consider in reviewing this:

  1. Do we even want to enable this, or do we want to expect people to merge their .gmt files manually, to have just one comprehensive run of fgsea? This might be the favorable, as this would ensure multiple testing control across all specified gene sets at once. If we decide to do this, I would create a separate pull request to properly explain this in the config.yaml (and possiblye README.md) files.
  2. Do we want to make this another breaking change, or can we simply tack this onto yesterday's 3.0.0 release with a minor version bump?

Summary by CodeRabbit

  • Documentation
    • Improved comments in configuration files to clarify requirements and best practices for providing gene set files when using the enrichment tool, including instructions on merging gene sets and citing sources. No changes to actual configuration options.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 16, 2025

Walkthrough

Expanded comments were added above the fgsea configuration sections in three YAML files to clarify the requirements for providing a GMT file when using the tool. The comments explain the usage of GMT files, encourage merging gene sets, and remind users to document and cite their sources. No functional or structural changes were made.

Changes

File(s) Change Summary
.test/config/config.yaml Added detailed comment above fgsea section about GMT file requirements and citation reminders.
.test/three_prime/config/config.yaml Augmented fgsea section with multi-line comment on gene_sets_file usage and documentation.
config/config.yaml Expanded comment for fgsea to clarify GMT file usage and citation guidelines.

Poem

A rabbit with a YAML file in paw,
Hopped through configs with a thoughtful awe.
"Remember your gene sets, merge them with care,
Cite your sources, be always fair!
With comments expanded, our guidance is clear—
For enrichment adventures, success is near!"
🐇📄✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 71c4c9b and 41f8a3b.

📒 Files selected for processing (3)
  • .test/config/config.yaml (1 hunks)
  • .test/three_prime/config/config.yaml (1 hunks)
  • config/config.yaml (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • .test/config/config.yaml
🚧 Files skipped from review as they are similar to previous changes (2)
  • config/config.yaml
  • .test/three_prime/config/config.yaml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: formatting

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this 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

🧹 Nitpick comments (3)
workflow/schemas/config.schema.yaml (1)

150-151: Add constraints to the gene_set_files object schema.

The schema change from gene_sets_file (string) to gene_set_files (object) is correct, but the object type lacks validation constraints. Consider adding pattern properties or additional constraints to ensure the object values are valid file paths.

           gene_set_files:
             type: object
+            patternProperties:
+              "^.+$":
+                type: string
+            additionalProperties: false
workflow/rules/enrichment.smk (2)

34-85: Consider statistical implications of separate fgsea runs.

Running fgsea separately on multiple gene set files means each file gets independent multiple testing correction. This may not provide optimal false discovery rate control if you want to control FDR across all gene sets globally.

Consider documenting this behavior and potentially offering guidance on when users should merge GMT files versus using separate analyses.


38-40: Add wildcard constraints for robustness.

Consider adding wildcard constraints to ensure gene_set_file values are valid identifiers (e.g., alphanumeric with underscores/hyphens).

wildcard_constraints:
    gene_set_file=r"[A-Za-z0-9_-]+"

This prevents issues with special characters in file paths and improves error messages for invalid configurations.

Also applies to: 92-94

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 29dedff and 3bf4d34.

📒 Files selected for processing (6)
  • .test/config/config.yaml (1 hunks)
  • .test/three_prime/config/config.yaml (1 hunks)
  • config/config.yaml (1 hunks)
  • workflow/rules/common.smk (1 hunks)
  • workflow/rules/enrichment.smk (4 hunks)
  • workflow/schemas/config.schema.yaml (1 hunks)
🔇 Additional comments (7)
.test/config/config.yaml (1)

94-95: LGTM! Test configuration properly reflects the new structure.

The test configuration correctly implements the new gene_set_files dictionary structure, maintaining consistency with the main configuration format.

workflow/schemas/config.schema.yaml (1)

157-157: LGTM! Required fields updated correctly.

The required fields list has been properly updated to reflect the schema change from gene_sets_file to gene_set_files.

.test/three_prime/config/config.yaml (1)

94-95: LGTM! Consistent implementation with appropriate test naming.

The three_prime test configuration correctly implements the new structure using "test" as the key, demonstrating the flexibility of the named gene set files approach.

workflow/rules/enrichment.smk (4)

38-40: LGTM! Clean implementation of dynamic gene set file lookup.

The lookup function correctly retrieves gene set file paths from the new nested config structure. This enables flexible specification of multiple gene set files.


44-44: Consistent wildcard propagation across all fgsea outputs and logs.

All output files and logs now properly include the {gene_set_file} wildcard, ensuring results are organized by gene set file. The naming convention is consistent and logical.

Also applies to: 50-50, 56-56, 62-62, 68-68, 82-82


92-95: Proper dependency maintenance between fgsea rules.

The fgsea_plot_gene_sets rule correctly:

  • Uses the same lookup pattern for gene set files
  • References the parameterized output from the fgsea rule
  • Maintains the dependency chain with consistent wildcard usage

99-99: Consistent output directory and log file parameterization.

The output directory and log file correctly include the {gene_set_file} wildcard, maintaining consistency with the overall design.

Also applies to: 111-111

@dlaehnemann
Copy link
Member Author

Feedback from @johanneskoester was also, that users should rather combine their gene sets into a single GMT file for a joint gene set enrichment analysis. So I'll update this pull request to simply improve the docs.

@dlaehnemann dlaehnemann changed the title feat: switch to named list of gene_set_files (GMT) for fgsea docs: mention that you can merge multiple GMT files for fgsea Jul 18, 2025
@johanneskoester johanneskoester merged commit 1b1a00b into main Jul 21, 2025
8 checks passed
@johanneskoester johanneskoester deleted the feat/allow-for-multiple-gene-set-files-for-fgsea branch July 21, 2025 07:33
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