Skip to content

Nextflow#144

Merged
dimalvovs merged 25 commits intomasterfrom
nextflow
Jul 9, 2025
Merged

Nextflow#144
dimalvovs merged 25 commits intomasterfrom
nextflow

Conversation

@dimalvovs
Copy link
Contributor

  • add functionality to run a standalone nextflow pipeline
  • supports .h5ad and .rds files
  • exposes all params via CLI, multiple npatterns can specified as comma-separated string e.g. 5,6,7

@dimalvovs dimalvovs requested a review from Copilot July 9, 2025 17:04
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for running CoGAPS as a standalone Nextflow pipeline, handling both .h5ad and .rds inputs and exposing all parameters via the CLI (including multi-pattern support as comma-separated values).

  • Updated nextflow.config defaults (including new n_top_genes) and resource limits.
  • Enhanced main.nf to select top genes, refine distributed execution logic, and define a full example workflow for .h5ad/.rds.
  • Updated documentation (README.md), R package version, CI ignore rules, and added .cirro configs.

Reviewed Changes

Copilot reviewed 9 out of 11 changed files in this pull request and generated 1 comment.

File Description
nextflow.config Tweaked default params, added n_top_genes, increased resources
main.nf Gene selection, distributed params logic, workflow channels
README.md Added Nextflow usage example and CLI param table
.Rbuildignore Updated ignore rules for Nextflow, work/, main.nf, and .cirro
Comments suppressed due to low confidence (5)

README.md:38

  • The input and outdir parameters are missing from this list. Adding them will help users understand how to specify input folders and output directory.
Supported CLI params and their defaults are:

main.nf:3

  • The process label was changed to 'process_high' but there is no corresponding config block defining this label. Ensure 'process_high' is defined in nextflow.config or revert to a matching label.
  label 'process_high'

main.nf:62

  • The closing brace here no longer matches an opening if since the guard was removed, causing a syntax error. Either restore the if (!is.null(dist_param)) wrapper or remove this stray }.
      };

main.nf:64

  • Hardcoding outputFrequency = 100 ignores the user-specified niterations. Consider restoring floor($cparams.niterations/10) to align output frequency with iterations.
                             outputFrequency = 100);

main.nf:119

  • This label was updated from 'process_low' to 'process_medium', but no matching config block appears to exist. Verify the label mapping in nextflow.config.
  label 'process_medium'

ch_patterns = Channel.from(patterns)

//example channel with cparams
ch_fixed_params = Channel.of([niterations: params.niterations, sparse: params.sparse, distributed: params.distributed, nsets:params.nsets, nthreads:1])
Copy link

Copilot AI Jul 9, 2025

Choose a reason for hiding this comment

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

nthreads is statically set to 1, so any CLI override of --nthreads will be ignored. Use params.nthreads instead of a hardcoded value.

Suggested change
ch_fixed_params = Channel.of([niterations: params.niterations, sparse: params.sparse, distributed: params.distributed, nsets:params.nsets, nthreads:1])
ch_fixed_params = Channel.of([niterations: params.niterations, sparse: params.sparse, distributed: params.distributed, nsets:params.nsets, nthreads: params.nthreads])

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

nthreads is tricky (works with multithreaded only) and never used, would prefer leaving it hardcoded

Copy link

@drbergman drbergman left a comment

Choose a reason for hiding this comment

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

Can't say I can understand all the details of the changes here, but I think supporting easily running cogaps with multiple pattern numbers is worthy of incrementing the minor version.

Would it also be worth it to support range expression for npatterns? e.g. npatterns=5:5:20? A function to parse this string should be straightforward.

@@ -1,5 +1,5 @@
Package: CoGAPS
Version: 3.27.4
Version: 3.27.5

Choose a reason for hiding this comment

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

Certainly this PR is worthy of a minor increment!

@dimalvovs dimalvovs merged commit a1a03c2 into master Jul 9, 2025
3 checks passed
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