Skip to content

Commit

Permalink
Merge pull request #1551 from robsyme/nonamer
Browse files Browse the repository at this point in the history
Make nf-core branding optional to help users create non-nf-core pipelines that can still leverage nf-core standards.
  • Loading branch information
ErikDanielsson authored Jul 11, 2022
2 parents 7d15c8e + a9a37e5 commit 0cc0a0a
Show file tree
Hide file tree
Showing 36 changed files with 647 additions and 219 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/create-lint-wf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:

# Build a pipeline from the template
- name: nf-core create
run: nf-core --log-file log.txt create -n testpipeline -d "This pipeline is for testing" -a "Testing McTestface"
run: nf-core --log-file log.txt create -n testpipeline -d "This pipeline is for testing" -a "Testing McTestface" --plain

# Try syncing it before we change anything
- name: nf-core sync
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create-test-wf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:

- name: Run nf-core/tools
run: |
nf-core --log-file log.txt create -n testpipeline -d "This pipeline is for testing" -a "Testing McTestface"
nf-core --log-file log.txt create -n testpipeline -d "This pipeline is for testing" -a "Testing McTestface" --plain
nextflow run nf-core-testpipeline -profile test,docker --outdir ./results
- name: Upload log file artifact
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
- Fix and improve broken test for Singularity container download ([#1622](https://github.com/nf-core/tools/pull/1622))
- Use [`$XDG_CACHE_HOME`](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html) or `~/.cache` instead of `$XDG_CONFIG_HOME` or `~/config/` as base directory for API cache
- Switch CI to use [setup-nextflow](https://github.com/nf-core/setup-nextflow) action to install Nextflow ([#1650](https://github.com/nf-core/tools/pull/1650))
- Allow customization of the `nf-core` pipeline template when using `nf-core create` ([#1548](https://github.com/nf-core/tools/issues/1548))

### Modules

Expand Down
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,29 @@ Please see the [nf-core documentation](https://nf-co.re/developers/adding_pipeli
Note that if the required arguments for `nf-core create` are not given, it will interactively prompt for them. If you prefer, you can supply them as command line arguments. See `nf-core create --help` for more information.

### Customizing the creation of a pipeline

The `nf-core create` command comes with a number of options that allow you to customize the creation of a pipeline if you intend to not publish it as an
nf-core pipeline. This can be done in two ways: by using interactive prompts, or by supplying a `template.yml` file using the `--template-yaml <file>` option.
Both options allow you to specify a custom pipeline prefix, as well as selecting parts of the template to be excluded during pipeline creation.
The interactive prompts will guide you through the pipeline creation process. An example of a `template.yml` file is shown below.

```yaml
name: cool-pipe
description: A cool pipeline
author: me
prefix: cool-pipes-company
skip:
- ci
- github_badges
- igenomes
- nf_core_configs
```
This will create a pipeline called `cool-pipe` in the directory `cool-pipes-company-cool-pipe` with `me` as the author. It will exclude the GitHub CI from the pipeline, remove GitHub badges from the `README.md` file, remove pipeline options related to iGenomes and exclude `nf_core/configs` options.

To run the pipeline creation silently (i.e. without any prompts) with the nf-core template, you can use the `--plain` option.

## Linting a workflow

The `lint` subcommand checks a given pipeline for all nf-core community guidelines.
Expand Down
18 changes: 10 additions & 8 deletions nf_core/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,25 +260,27 @@ def validate_wf_name_prompt(ctx, opts, value):
@click.option(
"-n",
"--name",
prompt="Workflow Name",
callback=validate_wf_name_prompt,
type=str,
help="The name of your new pipeline",
)
@click.option("-d", "--description", prompt=True, type=str, help="A short description of your pipeline")
@click.option("-a", "--author", prompt=True, type=str, help="Name of the main author(s)")
@click.option("-d", "--description", type=str, help="A short description of your pipeline")
@click.option("-a", "--author", type=str, help="Name of the main author(s)")
@click.option("--version", type=str, default="1.0dev", help="The initial version number to use")
@click.option("--no-git", is_flag=True, default=False, help="Do not initialise pipeline as new git repository")
@click.option("-f", "--force", is_flag=True, default=False, help="Overwrite output directory if it already exists")
@click.option("-o", "--outdir", type=str, help="Output directory for new pipeline (default: pipeline name)")
def create(name, description, author, version, no_git, force, outdir):
@click.option("-o", "--outdir", help="Output directory for new pipeline (default: pipeline name)")
@click.option("-t", "--template-yaml", help="Pass a YAML file to customize the template")
@click.option("--plain", is_flag=True, help="Use the standard nf-core template")
def create(name, description, author, version, no_git, force, outdir, template_yaml, plain):
"""
Create a new pipeline using the nf-core template.
Uses the nf-core template to make a skeleton Nextflow pipeline with all required
files, boilerplate code and bfest-practices.
files, boilerplate code and best-practices.
"""
create_obj = nf_core.create.PipelineCreate(name, description, author, version, no_git, force, outdir)
create_obj = nf_core.create.PipelineCreate(
name, description, author, version, no_git, force, outdir, template_yaml, plain
)
create_obj.init_pipeline()


Expand Down
Loading

0 comments on commit 0cc0a0a

Please sign in to comment.