diff --git a/.github/workflows/create-lint-wf.yml b/.github/workflows/create-lint-wf.yml index 56b2da87a6..4b4e7dfb35 100644 --- a/.github/workflows/create-lint-wf.yml +++ b/.github/workflows/create-lint-wf.yml @@ -39,6 +39,7 @@ jobs: nf-core --log-file log.txt modules install nf-core-testpipeline/ --tool fastqc - name: Upload log file artifact + if: ${{ always() }} uses: actions/upload-artifact@v2 with: name: nf-core-log-file diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a0b0c4c90..a756dcd98b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,8 @@ * The parameters `--max_memory` and `--max_time` are now validated against a regular expression [[#793](https://github.com/nf-core/tools/issues/793)] * Must be written in the format `123.GB` / `456.h` with any of the prefixes listed in the [Nextflow docs](https://www.nextflow.io/docs/latest/process.html#memory) * Bare numbers no longer allowed, avoiding people from trying to specify GB and actually specifying bytes. +* Finally dropped the wonderful [cookiecutter](https://github.com/cookiecutter/cookiecutter) library that was behind the first pipeline template that led to nf-core [[#880](https://github.com/nf-core/tools/pull/880)] + * Now rendering templates directly using [Jinja](https://jinja.palletsprojects.com/), which is what cookiecutter was doing anyway ### Modules diff --git a/docs/api/_src/lint_tests/cookiecutter_strings.rst b/docs/api/_src/lint_tests/cookiecutter_strings.rst deleted file mode 100644 index 9fe30cae48..0000000000 --- a/docs/api/_src/lint_tests/cookiecutter_strings.rst +++ /dev/null @@ -1,4 +0,0 @@ -cookiecutter_strings -==================== - -.. automethod:: nf_core.lint.PipelineLint.cookiecutter_strings diff --git a/docs/api/_src/lint_tests/template_strings.rst b/docs/api/_src/lint_tests/template_strings.rst new file mode 100644 index 0000000000..9599a1c26b --- /dev/null +++ b/docs/api/_src/lint_tests/template_strings.rst @@ -0,0 +1,4 @@ +template_strings +================ + +.. automethod:: nf_core.lint.PipelineLint.template_strings diff --git a/nf_core/__main__.py b/nf_core/__main__.py index 2c35ec863d..a2e3b43db0 100755 --- a/nf_core/__main__.py +++ b/nf_core/__main__.py @@ -277,18 +277,18 @@ def validate_wf_name_prompt(ctx, opts, value): ) @click.option("-d", "--description", prompt=True, required=True, type=str, help="A short description of your pipeline") @click.option("-a", "--author", prompt=True, required=True, type=str, help="Name of the main author(s)") -@click.option("--new-version", type=str, default="1.0dev", help="The initial version number to use") +@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, new_version, no_git, force, outdir): +def create(name, description, author, version, no_git, force, outdir): """ 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. """ - create_obj = nf_core.create.PipelineCreate(name, description, author, new_version, no_git, force, outdir) + create_obj = nf_core.create.PipelineCreate(name, description, author, version, no_git, force, outdir) create_obj.init_pipeline() diff --git a/nf_core/create.py b/nf_core/create.py index 717042b517..f1c063688d 100644 --- a/nf_core/create.py +++ b/nf_core/create.py @@ -2,16 +2,16 @@ """Creates a nf-core pipeline matching the current organization's specification based on a template. """ -import click -import cookiecutter.main, cookiecutter.exceptions +from genericpath import exists import git +import jinja2 import logging +import mimetypes import os +import pathlib import requests import shutil import sys -import tempfile -import textwrap import nf_core @@ -25,21 +25,21 @@ class PipelineCreate(object): name (str): Name for the pipeline. description (str): Description for the pipeline. author (str): Authors name of the pipeline. - new_version (str): Version flag. Semantic versioning only. Defaults to `1.0dev`. + version (str): Version flag. Semantic versioning only. Defaults to `1.0dev`. no_git (bool): Prevents the creation of a local Git repository for the pipeline. Defaults to False. force (bool): Overwrites a given workflow directory with the same name. Defaults to False. May the force be with you. outdir (str): Path to the local output directory. """ - def __init__(self, name, description, author, new_version="1.0dev", no_git=False, force=False, outdir=None): + def __init__(self, name, description, author, version="1.0dev", no_git=False, force=False, outdir=None): self.short_name = name.lower().replace(r"/\s+/", "-").replace("nf-core/", "").replace("/", "-") - self.name = "nf-core/{}".format(self.short_name) + self.name = f"nf-core/{self.short_name}" self.name_noslash = self.name.replace("/", "-") self.name_docker = self.name.replace("nf-core", "nfcore") self.description = description self.author = author - self.new_version = new_version + self.version = version self.no_git = no_git self.force = force self.outdir = outdir @@ -47,13 +47,10 @@ def __init__(self, name, description, author, new_version="1.0dev", no_git=False self.outdir = os.path.join(os.getcwd(), self.name_noslash) def init_pipeline(self): - """Creates the nf-core pipeline. - - Launches cookiecutter, that will ask for required pipeline information. - """ + """Creates the nf-core pipeline. """ # Make the new pipeline - self.run_cookiecutter() + self.render_template() # Init the git repository and make the first commit if not self.no_git: @@ -66,69 +63,87 @@ def init_pipeline(self): + "[default]Please read: [link=https://nf-co.re/developers/adding_pipelines#join-the-community]https://nf-co.re/developers/adding_pipelines#join-the-community[/link]" ) - def run_cookiecutter(self): - """Runs cookiecutter to create a new nf-core pipeline.""" - log.info("Creating new nf-core pipeline: {}".format(self.name)) + def render_template(self): + """Runs Jinja to create a new nf-core pipeline.""" + log.info(f"Creating new nf-core pipeline: '{self.name}'") # Check if the output directory exists if os.path.exists(self.outdir): if self.force: - log.warning("Output directory '{}' exists - continuing as --force specified".format(self.outdir)) + log.warning(f"Output directory '{self.outdir}' exists - continuing as --force specified") else: - log.error("Output directory '{}' exists!".format(self.outdir)) + log.error(f"Output directory '{self.outdir}' exists!") log.info("Use -f / --force to overwrite existing files") sys.exit(1) else: os.makedirs(self.outdir) - # Build the template in a temporary directory - self.tmpdir = tempfile.mkdtemp() - template = os.path.join(os.path.dirname(os.path.realpath(nf_core.__file__)), "pipeline-template/") - cookiecutter.main.cookiecutter( - template, - extra_context={ - "name": self.name, - "description": self.description, - "author": self.author, - "name_noslash": self.name_noslash, - "name_docker": self.name_docker, - "short_name": self.short_name, - "version": self.new_version, - "nf_core_version": nf_core.__version__, - }, - no_input=True, - overwrite_if_exists=self.force, - output_dir=self.tmpdir, + # Run jinja2 for each file in the template folder + env = jinja2.Environment( + loader=jinja2.PackageLoader("nf_core", "pipeline-template"), keep_trailing_newline=True ) + template_dir = os.path.join(os.path.dirname(__file__), "pipeline-template") + copy_ftypes = ["image", "application/java-archive"] + object_attrs = vars(self) + object_attrs["nf_core_version"] = nf_core.__version__ + + # Can't use glob.glob() as need recursive hidden dotfiles - https://stackoverflow.com/a/58126417/713980 + template_files = list(pathlib.Path(template_dir).glob("**/*")) + template_files += list(pathlib.Path(template_dir).glob("*")) + ignore_strs = [".pyc", "__pycache__", ".pyo", ".pyd", ".DS_Store", ".egg"] + + for template_fn_path_obj in template_files: + + template_fn_path = str(template_fn_path_obj) + if os.path.isdir(template_fn_path): + continue + if any([s in template_fn_path for s in ignore_strs]): + log.debug(f"Ignoring '{template_fn_path}' in jinja2 template creation") + continue + + # Set up vars and directories + template_fn = os.path.relpath(template_fn_path, template_dir) + output_path = os.path.join(self.outdir, template_fn) + os.makedirs(os.path.dirname(output_path), exist_ok=True) + + # Just copy binary files + (ftype, encoding) = mimetypes.guess_type(template_fn_path) + if encoding is not None or (ftype is not None and any([ftype.startswith(ft) for ft in copy_ftypes])): + log.debug(f"Copying binary file: '{output_path}'") + shutil.copy(template_fn_path, output_path) + continue + + # Render the template + log.debug(f"Rendering template file: '{template_fn}'") + j_template = env.get_template(template_fn) + rendered_output = j_template.render(object_attrs) + + # Write to the pipeline output file + with open(output_path, "w") as fh: + log.debug(f"Writing to output file: '{output_path}'") + fh.write(rendered_output) # Make a logo and save it self.make_pipeline_logo() - # Move the template to the output directory - for f in os.listdir(os.path.join(self.tmpdir, self.name_noslash)): - shutil.move(os.path.join(self.tmpdir, self.name_noslash, f), self.outdir) - - # Delete the temporary directory - shutil.rmtree(self.tmpdir) - def make_pipeline_logo(self): """Fetch a logo for the new pipeline from the nf-core website""" - logo_url = "https://nf-co.re/logo/{}".format(self.short_name) - log.debug("Fetching logo from {}".format(logo_url)) + logo_url = f"https://nf-co.re/logo/{self.short_name}" + log.debug(f"Fetching logo from {logo_url}") - email_logo_path = "{}/{}/assets/{}_logo.png".format(self.tmpdir, self.name_noslash, self.name_noslash) - log.debug("Writing logo to {}".format(email_logo_path)) - r = requests.get("{}?w=400".format(logo_url)) + email_logo_path = f"{self.outdir}/assets/{self.name_noslash}_logo.png" + os.makedirs(os.path.dirname(email_logo_path), exist_ok=True) + log.debug(f"Writing logo to '{email_logo_path}'") + r = requests.get(f"{logo_url}?w=400") with open(email_logo_path, "wb") as fh: fh.write(r.content) - readme_logo_path = "{}/{}/docs/images/{}_logo.png".format(self.tmpdir, self.name_noslash, self.name_noslash) + readme_logo_path = f"{self.outdir}/docs/images/{self.name_noslash}_logo.png" - log.debug("Writing logo to {}".format(readme_logo_path)) - if not os.path.exists(os.path.dirname(readme_logo_path)): - os.makedirs(os.path.dirname(readme_logo_path)) - r = requests.get("{}?w=600".format(logo_url)) + log.debug(f"Writing logo to '{readme_logo_path}'") + os.makedirs(os.path.dirname(readme_logo_path), exist_ok=True) + r = requests.get(f"{logo_url}?w=600") with open(readme_logo_path, "wb") as fh: fh.write(r.content) @@ -137,14 +152,14 @@ def git_init_pipeline(self): log.info("Initialising pipeline git repository") repo = git.Repo.init(self.outdir) repo.git.add(A=True) - repo.index.commit("initial template build from nf-core/tools, version {}".format(nf_core.__version__)) + repo.index.commit(f"initial template build from nf-core/tools, version {nf_core.__version__}") # Add TEMPLATE branch to git repository repo.git.branch("TEMPLATE") repo.git.branch("dev") log.info( "Done. Remember to add a remote and push to GitHub:\n" - + "[white on grey23] cd {} \n".format(self.outdir) - + " git remote add origin git@github.com:USERNAME/REPO_NAME.git \n" - + " git push --all origin " + f"[white on grey23] cd {self.outdir} \n" + " git remote add origin git@github.com:USERNAME/REPO_NAME.git \n" + " git push --all origin " ) log.info("This will also push your newly created dev branch and the TEMPLATE branch for syncing.") diff --git a/nf_core/lint/__init__.py b/nf_core/lint/__init__.py index f800bcea0e..efd9a165a3 100644 --- a/nf_core/lint/__init__.py +++ b/nf_core/lint/__init__.py @@ -108,7 +108,7 @@ class PipelineLint(nf_core.utils.Pipeline): from .conda_dockerfile import conda_dockerfile from .pipeline_todos import pipeline_todos from .pipeline_name_conventions import pipeline_name_conventions - from .cookiecutter_strings import cookiecutter_strings + from .template_strings import template_strings from .schema_lint import schema_lint from .schema_params import schema_params from .actions_schema_validation import actions_schema_validation @@ -140,7 +140,7 @@ def __init__(self, wf_path, release_mode=False, fix=()): "conda_dockerfile", "pipeline_todos", "pipeline_name_conventions", - "cookiecutter_strings", + "template_strings", "schema_lint", "schema_params", "actions_schema_validation", diff --git a/nf_core/lint/cookiecutter_strings.py b/nf_core/lint/template_strings.py similarity index 50% rename from nf_core/lint/cookiecutter_strings.py rename to nf_core/lint/template_strings.py index 2819963c41..722a6204a0 100644 --- a/nf_core/lint/cookiecutter_strings.py +++ b/nf_core/lint/template_strings.py @@ -5,17 +5,20 @@ import re -def cookiecutter_strings(self): - """Check for 'cookiecutter' placeholders. +def template_strings(self): + """Check for template placeholders. The ``nf-core create`` pipeline template uses - `cookiecutter `_ behind the scenes. + `Jinja `_ behind the scenes. - This lint test fails if any cookiecutter template variables such as - ``{{ cookiecutter.pipeline_name }}`` are found in your pipeline code. + This lint test fails if any Jinja template variables such as + ``{{ pipeline_name }}`` are found in your pipeline code. Finding a placeholder like this means that something was probably copied and pasted from the template without being properly rendered for your pipeline. + + This test ignores any double-brackets prefixed with a dollar sign, such as + ``${{ secrets.AWS_ACCESS_KEY_ID }}`` as these placeholders are used in GitHub Actions workflows. """ passed = [] failed = [] @@ -27,12 +30,12 @@ def cookiecutter_strings(self): lnum = 0 for l in fh: lnum += 1 - cc_matches = re.findall(r"{{\s*cookiecutter[^}]*}}", l) + cc_matches = re.findall(r"[^$]{{[^}]*}}", l) if len(cc_matches) > 0: for cc_match in cc_matches: - failed.append("Found a cookiecutter template string in `{}` L{}: {}".format(fn, lnum, cc_match)) + failed.append("Found a Jinja template string in `{}` L{}: {}".format(fn, lnum, cc_match)) num_matches += 1 if num_matches == 0: - passed.append("Did not find any cookiecutter template strings ({} files)".format(len(self.files))) + passed.append("Did not find any Jinja template strings ({} files)".format(len(self.files))) return {"passed": passed, "failed": failed} diff --git a/nf_core/modules/create.py b/nf_core/modules/create.py index ab7a36da07..40747fe323 100644 --- a/nf_core/modules/create.py +++ b/nf_core/modules/create.py @@ -162,7 +162,7 @@ def create(self): if self.process_label is None: log.info( "Provide an appropriate resource label for the process, taken from the " - "[link=https://github.com/nf-core/tools/blob/master/nf_core/pipeline-template/%7B%7Bcookiecutter.name_noslash%7D%7D/conf/base.config#L29]nf-core pipeline template[/link].\n" + "[link=https://github.com/nf-core/tools/blob/master/nf_core/pipeline-template/conf/base.config#L29]nf-core pipeline template[/link].\n" "For example: 'process_low', 'process_medium', 'process_high', 'process_long'" ) while self.process_label is None: @@ -208,12 +208,10 @@ def create(self): def render_template(self): """ - Create new module files with cookiecutter in a temporyary directory. - - Returns: Path to generated files. + Create new module files with Jinja2. """ # Run jinja2 for each file in the template folder - env = jinja2.Environment(loader=jinja2.PackageLoader("nf_core", "module-template")) + env = jinja2.Environment(loader=jinja2.PackageLoader("nf_core", "module-template"), keep_trailing_newline=True) for template_fn, dest_fn in self.file_paths.items(): log.debug(f"Rendering template file: '{template_fn}'") j_template = env.get_template(template_fn) @@ -247,7 +245,7 @@ def get_repo_type(self, directory): def get_module_dirs(self): """Given a directory and a tool/subtool, set the file paths and check if they already exist - Returns dict: keys are file paths in cookiecutter output, vals are target paths. + Returns dict: keys are relative paths to template files, vals are target paths. """ file_paths = {} @@ -272,7 +270,7 @@ def get_module_dirs(self): if os.path.exists(test_dir) and not self.force_overwrite: raise UserWarning(f"Module test directory exists: '{test_dir}'. Use '--force' to overwrite") - # Set file paths - can be tool/ or tool/subtool/ so can't do in cookiecutter template + # Set file paths - can be tool/ or tool/subtool/ so can't do in template directory structure file_paths[os.path.join("software", "functions.nf")] = os.path.join(software_dir, "functions.nf") file_paths[os.path.join("software", "main.nf")] = os.path.join(software_dir, "main.nf") file_paths[os.path.join("software", "meta.yml")] = os.path.join(software_dir, "meta.yml") diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/.gitattributes b/nf_core/pipeline-template/.gitattributes similarity index 100% rename from nf_core/pipeline-template/{{cookiecutter.name_noslash}}/.gitattributes rename to nf_core/pipeline-template/.gitattributes diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/.github/.dockstore.yml b/nf_core/pipeline-template/.github/.dockstore.yml similarity index 100% rename from nf_core/pipeline-template/{{cookiecutter.name_noslash}}/.github/.dockstore.yml rename to nf_core/pipeline-template/.github/.dockstore.yml diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/.github/CONTRIBUTING.md b/nf_core/pipeline-template/.github/CONTRIBUTING.md similarity index 78% rename from nf_core/pipeline-template/{{cookiecutter.name_noslash}}/.github/CONTRIBUTING.md rename to nf_core/pipeline-template/.github/CONTRIBUTING.md index 92ea2fd029..2efd6020bd 100644 --- a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/.github/CONTRIBUTING.md +++ b/nf_core/pipeline-template/.github/CONTRIBUTING.md @@ -1,23 +1,23 @@ -# {{ cookiecutter.name }}: Contributing Guidelines +# {{ name }}: Contributing Guidelines Hi there! -Many thanks for taking an interest in improving {{ cookiecutter.name }}. +Many thanks for taking an interest in improving {{ name }}. -We try to manage the required tasks for {{ cookiecutter.name }} using GitHub issues, you probably came to this page when creating one. +We try to manage the required tasks for {{ name }} using GitHub issues, you probably came to this page when creating one. Please use the pre-filled template to save time. However, don't be put off by this template - other more general issues and suggestions are welcome! Contributions to the code are even more welcome ;) -> If you need help using or modifying {{ cookiecutter.name }} then the best place to ask is on the nf-core Slack [#{{ cookiecutter.short_name }}](https://nfcore.slack.com/channels/{{ cookiecutter.short_name }}) channel ([join our Slack here](https://nf-co.re/join/slack)). +> If you need help using or modifying {{ name }} then the best place to ask is on the nf-core Slack [#{{ short_name }}](https://nfcore.slack.com/channels/{{ short_name }}) channel ([join our Slack here](https://nf-co.re/join/slack)). ## Contribution workflow -If you'd like to write some code for {{ cookiecutter.name }}, the standard workflow is as follows: +If you'd like to write some code for {{ name }}, the standard workflow is as follows: -1. Check that there isn't already an issue about your idea in the [{{ cookiecutter.name }} issues](https://github.com/{{ cookiecutter.name }}/issues) to avoid duplicating work +1. Check that there isn't already an issue about your idea in the [{{ name }} issues](https://github.com/{{ name }}/issues) to avoid duplicating work * If there isn't one already, please create one so that others know you're working on this -2. [Fork](https://help.github.com/en/github/getting-started-with-github/fork-a-repo) the [{{ cookiecutter.name }} repository](https://github.com/{{ cookiecutter.name }}) to your GitHub account +2. [Fork](https://help.github.com/en/github/getting-started-with-github/fork-a-repo) the [{{ name }} repository](https://github.com/{{ name }}) to your GitHub account 3. Make the necessary changes / additions within your forked repository following [Pipeline conventions](#pipeline-contribution-conventions) 4. Use `nf-core schema build .` and add any new parameters to the pipeline JSON schema (requires [nf-core tools](https://github.com/nf-core/tools) >= 1.10). 5. Submit a Pull Request against the `dev` branch and wait for the code to be reviewed and merged @@ -55,11 +55,11 @@ These tests are run both with the latest available version of `Nextflow` and als ## Getting help -For further information/help, please consult the [{{ cookiecutter.name }} documentation](https://nf-co.re/{{ cookiecutter.short_name }}/usage) and don't hesitate to get in touch on the nf-core Slack [#{{ cookiecutter.short_name }}](https://nfcore.slack.com/channels/{{ cookiecutter.short_name }}) channel ([join our Slack here](https://nf-co.re/join/slack)). +For further information/help, please consult the [{{ name }} documentation](https://nf-co.re/{{ short_name }}/usage) and don't hesitate to get in touch on the nf-core Slack [#{{ short_name }}](https://nfcore.slack.com/channels/{{ short_name }}) channel ([join our Slack here](https://nf-co.re/join/slack)). ## Pipeline contribution conventions -To make the {{ cookiecutter.name }} code and processing logic more understandable for new contributors and to ensure quality, we semi-standardise the way the code and other contributions are written. +To make the {{ name }} code and processing logic more understandable for new contributors and to ensure quality, we semi-standardise the way the code and other contributions are written. ### Adding a new step @@ -87,7 +87,7 @@ Once there, use `nf-core schema build .` to add to `nextflow_schema.json`. ### Default processes resource requirements -Sensible defaults for process resource requirements (CPUs / memory / time) for a process should be defined in `conf/base.config`. These should generally be specified generic with `withLabel:` selectors so they can be shared across multiple processes/steps of the pipeline. A nf-core standard set of labels that should be followed where possible can be seen in the [nf-core pipeline template](https://github.com/nf-core/tools/blob/master/nf_core/pipeline-template/%7B%7Bcookiecutter.name_noslash%7D%7D/conf/base.config), which has the default process as a single core-process, and then different levels of multi-core configurations for increasingly large memory requirements defined with standardised labels. +Sensible defaults for process resource requirements (CPUs / memory / time) for a process should be defined in `conf/base.config`. These should generally be specified generic with `withLabel:` selectors so they can be shared across multiple processes/steps of the pipeline. A nf-core standard set of labels that should be followed where possible can be seen in the [nf-core pipeline template](https://github.com/nf-core/tools/blob/master/nf_core/pipeline-template/conf/base.config), which has the default process as a single core-process, and then different levels of multi-core configurations for increasingly large memory requirements defined with standardised labels. The process resources can be passed on to the tool dynamically within the process with the `${task.cpu}` and `${task.memory}` variables in the `script:` block. diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/.github/ISSUE_TEMPLATE/bug_report.md b/nf_core/pipeline-template/.github/ISSUE_TEMPLATE/bug_report.md similarity index 87% rename from nf_core/pipeline-template/{{cookiecutter.name_noslash}}/.github/ISSUE_TEMPLATE/bug_report.md rename to nf_core/pipeline-template/.github/ISSUE_TEMPLATE/bug_report.md index 7f71baaa90..964f581679 100644 --- a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/.github/ISSUE_TEMPLATE/bug_report.md +++ b/nf_core/pipeline-template/.github/ISSUE_TEMPLATE/bug_report.md @@ -5,7 +5,7 @@ labels: bug --- - version: -- Image tag: +- Image tag: ## Additional context diff --git a/nf_core/pipeline-template/.github/ISSUE_TEMPLATE/config.yml b/nf_core/pipeline-template/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000000..a582ac2fb3 --- /dev/null +++ b/nf_core/pipeline-template/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,8 @@ +blank_issues_enabled: false +contact_links: + - name: Join nf-core + url: https://nf-co.re/join + about: Please join the nf-core community here + - name: "Slack #{{ short_name }} channel" + url: https://nfcore.slack.com/channels/{{ short_name }} + about: Discussion about the {{ name }} pipeline diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/.github/ISSUE_TEMPLATE/feature_request.md b/nf_core/pipeline-template/.github/ISSUE_TEMPLATE/feature_request.md similarity index 87% rename from nf_core/pipeline-template/{{cookiecutter.name_noslash}}/.github/ISSUE_TEMPLATE/feature_request.md rename to nf_core/pipeline-template/.github/ISSUE_TEMPLATE/feature_request.md index 411a24cc1a..1727d53f01 100644 --- a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/.github/ISSUE_TEMPLATE/feature_request.md +++ b/nf_core/pipeline-template/.github/ISSUE_TEMPLATE/feature_request.md @@ -1,11 +1,11 @@ --- name: Feature request -about: Suggest an idea for the {{ cookiecutter.name }} pipeline +about: Suggest an idea for the {{ name }} pipeline labels: enhancement --- ## PR checklist @@ -16,8 +16,8 @@ Learn more about contributing: [CONTRIBUTING.md](https://github.com/{{ cookiecut - [ ] This comment contains a description of changes (with reason). - [ ] If you've fixed a bug or added code that should be tested, add tests! - [ ] If you've added a new tool - add to the software_versions process and a regex to `scrape_software_versions.py` - - [ ] If you've added a new tool - have you followed the pipeline conventions in the [contribution docs](https://github.com/{{ cookiecutter.name }}/tree/master/.github/CONTRIBUTING.md) - - [ ] If necessary, also make a PR on the {{ cookiecutter.name }} _branch_ on the [nf-core/test-datasets](https://github.com/nf-core/test-datasets) repository. + - [ ] If you've added a new tool - have you followed the pipeline conventions in the [contribution docs](https://github.com/{{ name }}/tree/master/.github/CONTRIBUTING.md) + - [ ] If necessary, also make a PR on the {{ name }} _branch_ on the [nf-core/test-datasets](https://github.com/nf-core/test-datasets) repository. - [ ] Make sure your code lints (`nf-core lint .`). - [ ] Ensure the test suite passes (`nextflow run . -profile test,docker`). - [ ] Usage Documentation in `docs/usage.md` is updated. diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/.github/markdownlint.yml b/nf_core/pipeline-template/.github/markdownlint.yml similarity index 100% rename from nf_core/pipeline-template/{{cookiecutter.name_noslash}}/.github/markdownlint.yml rename to nf_core/pipeline-template/.github/markdownlint.yml diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/.github/workflows/awsfulltest.yml b/nf_core/pipeline-template/.github/workflows/awsfulltest.yml similarity index 75% rename from nf_core/pipeline-template/{{cookiecutter.name_noslash}}/.github/workflows/awsfulltest.yml rename to nf_core/pipeline-template/.github/workflows/awsfulltest.yml index 093b6fc399..0e4bfb7ea6 100644 --- a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/.github/workflows/awsfulltest.yml +++ b/nf_core/pipeline-template/.github/workflows/awsfulltest.yml @@ -22,7 +22,7 @@ env: jobs: run-awstest: name: Run AWS full tests - if: github.repository == '{{ cookiecutter.name }}' + if: github.repository == '{{ name }}' runs-on: ubuntu-latest steps: - name: Setup Miniconda @@ -40,7 +40,7 @@ jobs: run: | aws batch submit-job \ --region eu-west-1 \ - --job-name nf-core-{{ cookiecutter.short_name }} \ + --job-name nf-core-{{ short_name }} \ --job-queue $AWS_JOB_QUEUE \ --job-definition $AWS_JOB_DEFINITION \ - --container-overrides '{"command": ["{{ cookiecutter.name }}", "-r '"${GITHUB_SHA}"' -profile test --outdir s3://'"${AWS_S3_BUCKET}"'/{{ cookiecutter.short_name }}/results-'"${GITHUB_SHA}"' -w s3://'"${AWS_S3_BUCKET}"'/{{ cookiecutter.short_name }}/work-'"${GITHUB_SHA}"' -with-tower"], "environment": [{"name": "TOWER_ACCESS_TOKEN", "value": "'"$TOWER_ACCESS_TOKEN"'"}]}' + --container-overrides '{"command": ["{{ name }}", "-r '"${GITHUB_SHA}"' -profile test --outdir s3://'"${AWS_S3_BUCKET}"'/{{ short_name }}/results-'"${GITHUB_SHA}"' -w s3://'"${AWS_S3_BUCKET}"'/{{ short_name }}/work-'"${GITHUB_SHA}"' -with-tower"], "environment": [{"name": "TOWER_ACCESS_TOKEN", "value": "'"$TOWER_ACCESS_TOKEN"'"}]}' diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/.github/workflows/awstest.yml b/nf_core/pipeline-template/.github/workflows/awstest.yml similarity index 72% rename from nf_core/pipeline-template/{{cookiecutter.name_noslash}}/.github/workflows/awstest.yml rename to nf_core/pipeline-template/.github/workflows/awstest.yml index f8ce2a18bd..38cb57d086 100644 --- a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/.github/workflows/awstest.yml +++ b/nf_core/pipeline-template/.github/workflows/awstest.yml @@ -19,7 +19,7 @@ env: jobs: run-awstest: name: Run AWS tests - if: github.repository == '{{ cookiecutter.name }}' + if: github.repository == '{{ name }}' runs-on: ubuntu-latest steps: - name: Setup Miniconda @@ -36,7 +36,7 @@ jobs: run: | aws batch submit-job \ --region eu-west-1 \ - --job-name nf-core-{{ cookiecutter.short_name }} \ + --job-name nf-core-{{ short_name }} \ --job-queue $AWS_JOB_QUEUE \ --job-definition $AWS_JOB_DEFINITION \ - --container-overrides '{"command": ["{{ cookiecutter.name }}", "-r '"${GITHUB_SHA}"' -profile test --outdir s3://'"${AWS_S3_BUCKET}"'/{{ cookiecutter.short_name }}/results-'"${GITHUB_SHA}"' -w s3://'"${AWS_S3_BUCKET}"'/{{ cookiecutter.short_name }}/work-'"${GITHUB_SHA}"' -with-tower"], "environment": [{"name": "TOWER_ACCESS_TOKEN", "value": "'"$TOWER_ACCESS_TOKEN"'"}]}' + --container-overrides '{"command": ["{{ name }}", "-r '"${GITHUB_SHA}"' -profile test --outdir s3://'"${AWS_S3_BUCKET}"'/{{ short_name }}/results-'"${GITHUB_SHA}"' -w s3://'"${AWS_S3_BUCKET}"'/{{ short_name }}/work-'"${GITHUB_SHA}"' -with-tower"], "environment": [{"name": "TOWER_ACCESS_TOKEN", "value": "'"$TOWER_ACCESS_TOKEN"'"}]}' diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/.github/workflows/branch.yml b/nf_core/pipeline-template/.github/workflows/branch.yml similarity index 85% rename from nf_core/pipeline-template/{{cookiecutter.name_noslash}}/.github/workflows/branch.yml rename to nf_core/pipeline-template/.github/workflows/branch.yml index d3f3c1a1b5..5c880e7c5f 100644 --- a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/.github/workflows/branch.yml +++ b/nf_core/pipeline-template/.github/workflows/branch.yml @@ -11,9 +11,9 @@ jobs: steps: # PRs to the nf-core repo master branch are only ok if coming from the nf-core repo `dev` or any `patch` branches - name: Check PRs - if: github.repository == '{{cookiecutter.name}}' + if: github.repository == '{{ name }}' run: | - { [[ {% raw %}${{github.event.pull_request.head.repo.full_name}}{% endraw %} == {{cookiecutter.name}} ]] && [[ $GITHUB_HEAD_REF = "dev" ]]; } || [[ $GITHUB_HEAD_REF == "patch" ]] + { [[ {% raw %}${{github.event.pull_request.head.repo.full_name }}{% endraw %} == {{ name }} ]] && [[ $GITHUB_HEAD_REF = "dev" ]]; } || [[ $GITHUB_HEAD_REF == "patch" ]] {% raw %} # If the above check failed, post a comment on the PR explaining the failure @@ -25,9 +25,9 @@ jobs: message: | Hi @${{ github.event.pull_request.user.login }}, - It looks like this pull-request is has been made against the ${{github.event.pull_request.base.repo.full_name}} `master` branch. + It looks like this pull-request is has been made against the ${{github.event.pull_request.base.repo.full_name }} `master` branch. The `master` branch on nf-core repositories should always contain code from the latest release. - Because of this, PRs to `master` are only allowed if they come from the ${{github.event.pull_request.base.repo.full_name}} `dev` branch. + Because of this, PRs to `master` are only allowed if they come from the ${{github.event.pull_request.base.repo.full_name }} `dev` branch. You do not need to close this PR, you can change the target branch to `dev` by clicking the _"Edit"_ button at the top of this page. Note that even after this, the test will continue to show as failing until you push a new commit. diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/.github/workflows/ci.yml b/nf_core/pipeline-template/.github/workflows/ci.yml similarity index 83% rename from nf_core/pipeline-template/{{cookiecutter.name_noslash}}/.github/workflows/ci.yml rename to nf_core/pipeline-template/.github/workflows/ci.yml index 1e27cafe67..0228228801 100644 --- a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/.github/workflows/ci.yml +++ b/nf_core/pipeline-template/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: test: name: Run workflow tests # Only run on push if this is the nf-core dev branch (merged PRs) - if: {% raw %}${{{% endraw %} github.event_name != 'push' || (github.event_name == 'push' && github.repository == '{{ cookiecutter.name }}') {% raw %}}}{% endraw %} + if: {% raw %}${{{% endraw %} github.event_name != 'push' || (github.event_name == 'push' && github.repository == '{{ name }}') {% raw %}}}{% endraw %} runs-on: ubuntu-latest env: NXF_VER: {% raw %}${{ matrix.nxf_ver }}{% endraw %} @@ -34,13 +34,13 @@ jobs: - name: Build new docker image if: env.MATCHED_FILES - run: docker build --no-cache . -t {{ cookiecutter.name_docker }}:dev + run: docker build --no-cache . -t {{ name_docker }}:dev - name: Pull docker image if: {% raw %}${{ !env.MATCHED_FILES }}{% endraw %} run: | - docker pull {{ cookiecutter.name_docker }}:dev - docker tag {{ cookiecutter.name_docker }}:dev {{ cookiecutter.name_docker }}:dev + docker pull {{ name_docker }}:dev + docker tag {{ name_docker }}:dev {{ name_docker }}:dev - name: Install Nextflow env: diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/.github/workflows/linting.yml b/nf_core/pipeline-template/.github/workflows/linting.yml similarity index 100% rename from nf_core/pipeline-template/{{cookiecutter.name_noslash}}/.github/workflows/linting.yml rename to nf_core/pipeline-template/.github/workflows/linting.yml diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/.github/workflows/linting_comment.yml b/nf_core/pipeline-template/.github/workflows/linting_comment.yml similarity index 100% rename from nf_core/pipeline-template/{{cookiecutter.name_noslash}}/.github/workflows/linting_comment.yml rename to nf_core/pipeline-template/.github/workflows/linting_comment.yml diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/.github/workflows/push_dockerhub_dev.yml b/nf_core/pipeline-template/.github/workflows/push_dockerhub_dev.yml similarity index 77% rename from nf_core/pipeline-template/{{cookiecutter.name_noslash}}/.github/workflows/push_dockerhub_dev.yml rename to nf_core/pipeline-template/.github/workflows/push_dockerhub_dev.yml index 0303241f10..68cbf88a3d 100644 --- a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/.github/workflows/push_dockerhub_dev.yml +++ b/nf_core/pipeline-template/.github/workflows/push_dockerhub_dev.yml @@ -11,7 +11,7 @@ jobs: name: Push new Docker image to Docker Hub (dev) runs-on: ubuntu-latest # Only run for the nf-core repo, for releases and merged PRs - if: {% raw %}${{{% endraw %} github.repository == '{{ cookiecutter.name }}' {% raw %}}}{% endraw %} + if: {% raw %}${{{% endraw %} github.repository == '{{ name }}' {% raw %}}}{% endraw %} env: DOCKERHUB_USERNAME: {% raw %}${{ secrets.DOCKERHUB_USERNAME }}{% endraw %} DOCKERHUB_PASS: {% raw %}${{ secrets.DOCKERHUB_PASS }}{% endraw %} @@ -20,9 +20,9 @@ jobs: uses: actions/checkout@v2 - name: Build new docker image - run: docker build --no-cache . -t {{ cookiecutter.name_docker }}:dev + run: docker build --no-cache . -t {{ name_docker }}:dev - name: Push Docker image to DockerHub (dev) run: | echo "$DOCKERHUB_PASS" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin - docker push {{ cookiecutter.name_docker }}:dev + docker push {{ name_docker }}:dev diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/.github/workflows/push_dockerhub_release.yml b/nf_core/pipeline-template/.github/workflows/push_dockerhub_release.yml similarity index 62% rename from nf_core/pipeline-template/{{cookiecutter.name_noslash}}/.github/workflows/push_dockerhub_release.yml rename to nf_core/pipeline-template/.github/workflows/push_dockerhub_release.yml index d5e260af96..fe3c7987ee 100644 --- a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/.github/workflows/push_dockerhub_release.yml +++ b/nf_core/pipeline-template/.github/workflows/push_dockerhub_release.yml @@ -10,7 +10,7 @@ jobs: name: Push new Docker image to Docker Hub (release) runs-on: ubuntu-latest # Only run for the nf-core repo, for releases and merged PRs - if: {% raw %}${{{% endraw %} github.repository == '{{ cookiecutter.name }}' {% raw %}}}{% endraw %} + if: {% raw %}${{{% endraw %} github.repository == '{{ name }}' {% raw %}}}{% endraw %} env: DOCKERHUB_USERNAME: {% raw %}${{ secrets.DOCKERHUB_USERNAME }}{% endraw %} DOCKERHUB_PASS: {% raw %}${{ secrets.DOCKERHUB_PASS }}{% endraw %} @@ -19,11 +19,11 @@ jobs: uses: actions/checkout@v2 - name: Build new docker image - run: docker build --no-cache . -t {{ cookiecutter.name_docker }}:latest + run: docker build --no-cache . -t {{ name_docker }}:latest - name: Push Docker image to DockerHub (release) run: | echo "$DOCKERHUB_PASS" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin - docker push {{ cookiecutter.name_docker }}:latest - docker tag {{ cookiecutter.name_docker }}:latest {{ cookiecutter.name_docker }}:{% raw %}${{ github.event.release.tag_name }}{% endraw %} - docker push {{ cookiecutter.name_docker }}:{% raw %}${{ github.event.release.tag_name }}{% endraw %} + docker push {{ name_docker }}:latest + docker tag {{ name_docker }}:latest {{ name_docker }}:{% raw %}${{ github.event.release.tag_name }}{% endraw %} + docker push {{ name_docker }}:{% raw %}${{ github.event.release.tag_name }}{% endraw %} diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/.gitignore b/nf_core/pipeline-template/.gitignore similarity index 100% rename from nf_core/pipeline-template/{{cookiecutter.name_noslash}}/.gitignore rename to nf_core/pipeline-template/.gitignore diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/CHANGELOG.md b/nf_core/pipeline-template/CHANGELOG.md similarity index 57% rename from nf_core/pipeline-template/{{cookiecutter.name_noslash}}/CHANGELOG.md rename to nf_core/pipeline-template/CHANGELOG.md index b401036075..c9bd47f145 100644 --- a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/CHANGELOG.md +++ b/nf_core/pipeline-template/CHANGELOG.md @@ -1,11 +1,11 @@ -# {{ cookiecutter.name }}: Changelog +# {{ name }}: Changelog The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## v{{ cookiecutter.version }} - [date] +## v{{ version }} - [date] -Initial release of {{ cookiecutter.name }}, created with the [nf-core](https://nf-co.re/) template. +Initial release of {{ name }}, created with the [nf-core](https://nf-co.re/) template. ### `Added` diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/CODE_OF_CONDUCT.md b/nf_core/pipeline-template/CODE_OF_CONDUCT.md similarity index 100% rename from nf_core/pipeline-template/{{cookiecutter.name_noslash}}/CODE_OF_CONDUCT.md rename to nf_core/pipeline-template/CODE_OF_CONDUCT.md diff --git a/nf_core/pipeline-template/Dockerfile b/nf_core/pipeline-template/Dockerfile new file mode 100644 index 0000000000..1c1fa539c4 --- /dev/null +++ b/nf_core/pipeline-template/Dockerfile @@ -0,0 +1,13 @@ +FROM nfcore/base:{{ 'dev' if 'dev' in nf_core_version else nf_core_version }} +LABEL authors="{{ author }}" \ + description="Docker image containing all software requirements for the {{ name }} pipeline" + +# Install the conda environment +COPY environment.yml / +RUN conda env create --quiet -f /environment.yml && conda clean -a + +# Add conda installation dir to PATH (instead of doing 'conda activate') +ENV PATH /opt/conda/envs/{{ name_noslash }}-{{ version }}/bin:$PATH + +# Dump the details of the installed packages to a file for posterity +RUN conda env export --name {{ name_noslash }}-{{ version }} > {{ name_noslash }}-{{ version }}.yml diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/LICENSE b/nf_core/pipeline-template/LICENSE similarity index 96% rename from nf_core/pipeline-template/{{cookiecutter.name_noslash}}/LICENSE rename to nf_core/pipeline-template/LICENSE index 9b30bada3a..9fc4e61c3f 100644 --- a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/LICENSE +++ b/nf_core/pipeline-template/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) {{ cookiecutter.author }} +Copyright (c) {{ author }} Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/README.md b/nf_core/pipeline-template/README.md similarity index 64% rename from nf_core/pipeline-template/{{cookiecutter.name_noslash}}/README.md rename to nf_core/pipeline-template/README.md index 1d73cbce86..9adcfb0aac 100644 --- a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/README.md +++ b/nf_core/pipeline-template/README.md @@ -1,19 +1,19 @@ -# ![{{ cookiecutter.name }}](docs/images/{{ cookiecutter.name_noslash }}_logo.png) +# ![{{ name }}](docs/images/{{ name_noslash }}_logo.png) -**{{ cookiecutter.description }}**. +**{{ description }}**. -[![GitHub Actions CI Status](https://github.com/{{ cookiecutter.name }}/workflows/nf-core%20CI/badge.svg)](https://github.com/{{ cookiecutter.name }}/actions) -[![GitHub Actions Linting Status](https://github.com/{{ cookiecutter.name }}/workflows/nf-core%20linting/badge.svg)](https://github.com/{{ cookiecutter.name }}/actions) +[![GitHub Actions CI Status](https://github.com/{{ name }}/workflows/nf-core%20CI/badge.svg)](https://github.com/{{ name }}/actions) +[![GitHub Actions Linting Status](https://github.com/{{ name }}/workflows/nf-core%20linting/badge.svg)](https://github.com/{{ name }}/actions) [![Nextflow](https://img.shields.io/badge/nextflow-%E2%89%A520.04.0-brightgreen.svg)](https://www.nextflow.io/) [![install with bioconda](https://img.shields.io/badge/install%20with-bioconda-brightgreen.svg)](https://bioconda.github.io/) -[![Docker](https://img.shields.io/docker/automated/{{ cookiecutter.name_docker }}.svg)](https://hub.docker.com/r/{{ cookiecutter.name_docker }}) -[![Get help on Slack](http://img.shields.io/badge/slack-nf--core%20%23{{ cookiecutter.short_name }}-4A154B?logo=slack)](https://nfcore.slack.com/channels/{{ cookiecutter.short_name }}) +[![Docker](https://img.shields.io/docker/automated/{{ name_docker }}.svg)](https://hub.docker.com/r/{{ name_docker }}) +[![Get help on Slack](http://img.shields.io/badge/slack-nf--core%20%23{{ short_name }}-4A154B?logo=slack)](https://nfcore.slack.com/channels/{{ short_name }}) ## Introduction -**{{ cookiecutter.name }}** is a bioinformatics best-practise analysis pipeline for +**{{ name }}** is a bioinformatics best-practise analysis pipeline for The pipeline is built using [Nextflow](https://www.nextflow.io), a workflow tool to run tasks across multiple compute infrastructures in a very portable manner. It comes with docker containers making installation trivial and results highly reproducible. @@ -26,7 +26,7 @@ The pipeline is built using [Nextflow](https://www.nextflow.io), a workflow tool 3. Download the pipeline and test it on a minimal dataset with a single command: ```bash - nextflow run {{ cookiecutter.name }} -profile test, + nextflow run {{ name }} -profile test, ``` > Please check [nf-core/configs](https://github.com/nf-core/configs#documentation) to see if a custom config file to run nf-core pipelines already exists for your Institute. If so, you can simply use `-profile ` in your command. This will enable either `docker` or `singularity` and set the appropriate execution settings for your local compute environment. @@ -36,10 +36,10 @@ The pipeline is built using [Nextflow](https://www.nextflow.io), a workflow tool ```bash - nextflow run {{ cookiecutter.name }} -profile --input '*_R{1,2}.fastq.gz' --genome GRCh37 + nextflow run {{ name }} -profile --input '*_R{1,2}.fastq.gz' --genome GRCh37 ``` -See [usage docs](https://nf-co.re/{{ cookiecutter.short_name }}/usage) for all of the available options when running the pipeline. +See [usage docs](https://nf-co.re/{{ short_name }}/usage) for all of the available options when running the pipeline. ## Pipeline Summary @@ -52,13 +52,13 @@ By default, the pipeline currently performs the following: ## Documentation -The {{ cookiecutter.name }} pipeline comes with documentation about the pipeline: [usage](https://nf-co.re/{{ cookiecutter.short_name }}/usage) and [output](https://nf-co.re/{{ cookiecutter.short_name }}/output). +The {{ name }} pipeline comes with documentation about the pipeline: [usage](https://nf-co.re/{{ short_name }}/usage) and [output](https://nf-co.re/{{ short_name }}/output). ## Credits -{{ cookiecutter.name }} was originally written by {{ cookiecutter.author }}. +{{ name }} was originally written by {{ author }}. We thank the following people for their extensive assistance in the development of this pipeline: @@ -69,12 +69,12 @@ of this pipeline: If you would like to contribute to this pipeline, please see the [contributing guidelines](.github/CONTRIBUTING.md). -For further information or help, don't hesitate to get in touch on the [Slack `#{{ cookiecutter.short_name }}` channel](https://nfcore.slack.com/channels/{{ cookiecutter.short_name }}) (you can join with [this invite](https://nf-co.re/join/slack)). +For further information or help, don't hesitate to get in touch on the [Slack `#{{ short_name }}` channel](https://nfcore.slack.com/channels/{{ short_name }}) (you can join with [this invite](https://nf-co.re/join/slack)). ## Citations - + You can cite the `nf-core` publication as follows: diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/assets/email_template.html b/nf_core/pipeline-template/assets/email_template.html similarity index 79% rename from nf_core/pipeline-template/{{cookiecutter.name_noslash}}/assets/email_template.html rename to nf_core/pipeline-template/assets/email_template.html index f85800e2ac..ecff600d44 100644 --- a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/assets/email_template.html +++ b/nf_core/pipeline-template/assets/email_template.html @@ -4,21 +4,21 @@ - - {{ cookiecutter.name }} Pipeline Report + + {{ name }} Pipeline Report
-

{{ cookiecutter.name }} v${version}

+

{{ name }} v${version}

Run Name: $runName

<% if (!success){ out << """
-

{{ cookiecutter.name }} execution completed unsuccessfully!

+

{{ name }} execution completed unsuccessfully!

The exit status of the task that caused the workflow execution to fail was: $exitStatus.

The full error message was:

${errorReport}
@@ -27,7 +27,7 @@

{{ cookiecutter.name }} execution comp } else { out << """
- {{ cookiecutter.name }} execution completed successfully! + {{ name }} execution completed successfully!
""" } @@ -44,8 +44,8 @@

Pipeline Configuration:

-

{{ cookiecutter.name }}

-

https://github.com/{{ cookiecutter.name }}

+

{{ name }}

+

https://github.com/{{ name }}

diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/assets/email_template.txt b/nf_core/pipeline-template/assets/email_template.txt similarity index 78% rename from nf_core/pipeline-template/{{cookiecutter.name_noslash}}/assets/email_template.txt rename to nf_core/pipeline-template/assets/email_template.txt index a2190e361a..01f96f537a 100644 --- a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/assets/email_template.txt +++ b/nf_core/pipeline-template/assets/email_template.txt @@ -4,16 +4,16 @@ |\\ | |__ __ / ` / \\ |__) |__ } { | \\| | \\__, \\__/ | \\ |___ \\`-._,-`-, `._,._,' - {{ cookiecutter.name }} v${version} + {{ name }} v${version} ---------------------------------------------------- Run Name: $runName <% if (success){ - out << "## {{ cookiecutter.name }} execution completed successfully! ##" + out << "## {{ name }} execution completed successfully! ##" } else { out << """#################################################### -## {{ cookiecutter.name }} execution completed unsuccessfully! ## +## {{ name }} execution completed unsuccessfully! ## #################################################### The exit status of the task that caused the workflow execution to fail was: $exitStatus. The full error message was: @@ -36,5 +36,5 @@ Pipeline Configuration: <% out << summary.collect{ k,v -> " - $k: $v" }.join("\n") %> -- -{{ cookiecutter.name }} -https://github.com/{{ cookiecutter.name }} +{{ name }} +https://github.com/{{ name }} diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/assets/multiqc_config.yaml b/nf_core/pipeline-template/assets/multiqc_config.yaml similarity index 54% rename from nf_core/pipeline-template/{{cookiecutter.name_noslash}}/assets/multiqc_config.yaml rename to nf_core/pipeline-template/assets/multiqc_config.yaml index 39a510de08..e3f940c2e7 100644 --- a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/assets/multiqc_config.yaml +++ b/nf_core/pipeline-template/assets/multiqc_config.yaml @@ -1,11 +1,11 @@ report_comment: > - This report has been generated by the {{ cookiecutter.name }} + This report has been generated by the {{ name }} analysis pipeline. For information about how to interpret these results, please see the - documentation. + documentation. report_section_order: software_versions: order: -1000 - {{ cookiecutter.name.lower().replace('/', '-') }}-summary: + {{ name.lower().replace('/', '-') }}-summary: order: -1001 export_plots: true diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/assets/sendmail_template.txt b/nf_core/pipeline-template/assets/sendmail_template.txt similarity index 79% rename from nf_core/pipeline-template/{{cookiecutter.name_noslash}}/assets/sendmail_template.txt rename to nf_core/pipeline-template/assets/sendmail_template.txt index 4314c5c80a..a415ceedf8 100644 --- a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/assets/sendmail_template.txt +++ b/nf_core/pipeline-template/assets/sendmail_template.txt @@ -9,12 +9,12 @@ Content-Type: text/html; charset=utf-8 $email_html --nfcoremimeboundary -Content-Type: image/png;name="{{ cookiecutter.name_noslash }}_logo.png" +Content-Type: image/png;name="{{ name_noslash }}_logo.png" Content-Transfer-Encoding: base64 Content-ID: -Content-Disposition: inline; filename="{{ cookiecutter.name_noslash }}_logo.png" +Content-Disposition: inline; filename="{{ name_noslash }}_logo.png" -<% out << new File("$projectDir/assets/{{ cookiecutter.name_noslash }}_logo.png"). +<% out << new File("$projectDir/assets/{{ name_noslash }}_logo.png"). bytes. encodeBase64(). toString(). diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/bin/markdown_to_html.py b/nf_core/pipeline-template/bin/markdown_to_html.py similarity index 100% rename from nf_core/pipeline-template/{{cookiecutter.name_noslash}}/bin/markdown_to_html.py rename to nf_core/pipeline-template/bin/markdown_to_html.py diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/bin/scrape_software_versions.py b/nf_core/pipeline-template/bin/scrape_software_versions.py similarity index 84% rename from nf_core/pipeline-template/{{cookiecutter.name_noslash}}/bin/scrape_software_versions.py rename to nf_core/pipeline-template/bin/scrape_software_versions.py index a6d687ce1b..8a5d0c23f7 100755 --- a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/bin/scrape_software_versions.py +++ b/nf_core/pipeline-template/bin/scrape_software_versions.py @@ -5,13 +5,13 @@ # TODO nf-core: Add additional regexes for new tools in process get_software_versions regexes = { - "{{ cookiecutter.name }}": ["v_pipeline.txt", r"(\S+)"], + "{{ name }}": ["v_pipeline.txt", r"(\S+)"], "Nextflow": ["v_nextflow.txt", r"(\S+)"], "FastQC": ["v_fastqc.txt", r"FastQC v(\S+)"], "MultiQC": ["v_multiqc.txt", r"multiqc, version (\S+)"], } results = OrderedDict() -results["{{ cookiecutter.name }}"] = 'N/A' +results["{{ name }}"] = 'N/A' results["Nextflow"] = 'N/A' results["FastQC"] = 'N/A' results["MultiQC"] = 'N/A' @@ -36,8 +36,8 @@ print( """ id: 'software_versions' -section_name: '{{ cookiecutter.name }} Software Versions' -section_href: 'https://github.com/{{ cookiecutter.name }}' +section_name: '{{ name }} Software Versions' +section_href: 'https://github.com/{{ name }}' plot_type: 'html' description: 'are collected at run time from the software output.' data: | diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/conf/base.config b/nf_core/pipeline-template/conf/base.config similarity index 97% rename from nf_core/pipeline-template/{{cookiecutter.name_noslash}}/conf/base.config rename to nf_core/pipeline-template/conf/base.config index 2a2322c95d..a23e501684 100644 --- a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/conf/base.config +++ b/nf_core/pipeline-template/conf/base.config @@ -1,6 +1,6 @@ /* * ------------------------------------------------- - * {{ cookiecutter.name }} Nextflow base config file + * {{ name }} Nextflow base config file * ------------------------------------------------- * A 'blank slate' config file, appropriate for general * use on most high performace compute environments. @@ -47,5 +47,5 @@ process { withName:get_software_versions { cache = false } - + } diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/conf/igenomes.config b/nf_core/pipeline-template/conf/igenomes.config similarity index 100% rename from nf_core/pipeline-template/{{cookiecutter.name_noslash}}/conf/igenomes.config rename to nf_core/pipeline-template/conf/igenomes.config diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/conf/test.config b/nf_core/pipeline-template/conf/test.config similarity index 93% rename from nf_core/pipeline-template/{{cookiecutter.name_noslash}}/conf/test.config rename to nf_core/pipeline-template/conf/test.config index 7840d28846..6e0793f2aa 100644 --- a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/conf/test.config +++ b/nf_core/pipeline-template/conf/test.config @@ -4,7 +4,7 @@ * ------------------------------------------------- * Defines bundled input files and everything required * to run a fast and simple test. Use as follows: - * nextflow run {{ cookiecutter.name }} -profile test, + * nextflow run {{ name }} -profile test, */ params { diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/conf/test_full.config b/nf_core/pipeline-template/conf/test_full.config similarity index 93% rename from nf_core/pipeline-template/{{cookiecutter.name_noslash}}/conf/test_full.config rename to nf_core/pipeline-template/conf/test_full.config index d9abb981eb..404137663a 100644 --- a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/conf/test_full.config +++ b/nf_core/pipeline-template/conf/test_full.config @@ -4,7 +4,7 @@ * ------------------------------------------------- * Defines bundled input files and everything required * to run a full size pipeline test. Use as follows: - * nextflow run {{ cookiecutter.name }} -profile test_full, + * nextflow run {{ name }} -profile test_full, */ params { diff --git a/nf_core/pipeline-template/cookiecutter.json b/nf_core/pipeline-template/cookiecutter.json deleted file mode 100644 index 4d10d74047..0000000000 --- a/nf_core/pipeline-template/cookiecutter.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "nf-core/example", - "description": "This pipeline takes some data and does something with it.", - "author": "Rocky Balboa", - "name_noslash": "{{ cookiecutter.name.replace('/', '-') }}", - "name_docker": "{{ cookiecutter.name_docker }}", - "short_name": "{{ cookiecutter.short_name }}", - "version": "1.0dev", - "nf_core_version": "{{ cookiecutter.nf_core_version }}" -} diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/docs/README.md b/nf_core/pipeline-template/docs/README.md similarity index 77% rename from nf_core/pipeline-template/{{cookiecutter.name_noslash}}/docs/README.md rename to nf_core/pipeline-template/docs/README.md index 191f199dc5..4bb82007e8 100644 --- a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/docs/README.md +++ b/nf_core/pipeline-template/docs/README.md @@ -1,6 +1,6 @@ -# {{ cookiecutter.name }}: Documentation +# {{ name }}: Documentation -The {{ cookiecutter.name }} documentation is split into the following pages: +The {{ name }} documentation is split into the following pages: * [Usage](usage.md) * An overview of how the pipeline works, how to run it and a description of all of the different command-line flags. diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/docs/output.md b/nf_core/pipeline-template/docs/output.md similarity index 98% rename from nf_core/pipeline-template/{{cookiecutter.name_noslash}}/docs/output.md rename to nf_core/pipeline-template/docs/output.md index 406aaead94..5372dc70ce 100644 --- a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/docs/output.md +++ b/nf_core/pipeline-template/docs/output.md @@ -1,4 +1,4 @@ -# {{ cookiecutter.name }}: Output +# {{ name }}: Output ## Introduction diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/docs/usage.md b/nf_core/pipeline-template/docs/usage.md similarity index 86% rename from nf_core/pipeline-template/{{cookiecutter.name_noslash}}/docs/usage.md rename to nf_core/pipeline-template/docs/usage.md index 0c98d86b87..a5140a98f1 100644 --- a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/docs/usage.md +++ b/nf_core/pipeline-template/docs/usage.md @@ -1,6 +1,6 @@ -# {{ cookiecutter.name }}: Usage +# {{ name }}: Usage -## :warning: Please read this documentation on the nf-core website: [https://nf-co.re/{{ cookiecutter.short_name }}/usage](https://nf-co.re/{{ cookiecutter.short_name }}/usage) +## :warning: Please read this documentation on the nf-core website: [https://nf-co.re/{{ short_name }}/usage](https://nf-co.re/{{ short_name }}/usage) > _Documentation of pipeline parameters is generated automatically from the pipeline schema and can no longer be found in markdown files._ @@ -13,7 +13,7 @@ The typical command for running the pipeline is as follows: ```bash -nextflow run {{ cookiecutter.name }} --input '*_R{1,2}.fastq.gz' -profile docker +nextflow run {{ name }} --input '*_R{1,2}.fastq.gz' -profile docker ``` This will launch the pipeline with the `docker` configuration profile. See below for more information about profiles. @@ -32,14 +32,14 @@ results # Finished results (configurable, see below) When you run the above command, Nextflow automatically pulls the pipeline code from GitHub and stores it as a cached version. When running the pipeline after this, it will always use the cached version if available - even if the pipeline has been updated since. To make sure that you're running the latest version of the pipeline, make sure that you regularly update the cached version of the pipeline: ```bash -nextflow pull {{ cookiecutter.name }} +nextflow pull {{ name }} ``` ### Reproducibility It's a good idea to specify a pipeline version when running the pipeline on your data. This ensures that a specific version of the pipeline code and software are used when you run your pipeline. If you keep using the same tag, you'll be running the same version of the pipeline, even if there have been changes to the code since. -First, go to the [{{ cookiecutter.name }} releases page](https://github.com/{{ cookiecutter.name }}/releases) and find the latest version number - numeric only (eg. `1.3.1`). Then specify this when running the pipeline with `-r` (one hyphen) - eg. `-r 1.3.1`. +First, go to the [{{ name }} releases page](https://github.com/{{ name }}/releases) and find the latest version number - numeric only (eg. `1.3.1`). Then specify this when running the pipeline with `-r` (one hyphen) - eg. `-r 1.3.1`. This version number will be logged in reports when you run the pipeline, so that you'll know what you used when you look back in the future. @@ -64,19 +64,19 @@ If `-profile` is not specified, the pipeline will run locally and expect all sof * `docker` * A generic configuration profile to be used with [Docker](https://docker.com/) - * Pulls software from Docker Hub: [`{{ cookiecutter.name_docker }}`](https://hub.docker.com/r/{{ cookiecutter.name_docker }}/) + * Pulls software from Docker Hub: [`{{ name_docker }}`](https://hub.docker.com/r/{{ name_docker }}/) * `singularity` * A generic configuration profile to be used with [Singularity](https://sylabs.io/docs/) - * Pulls software from Docker Hub: [`{{ cookiecutter.name_docker }}`](https://hub.docker.com/r/{{ cookiecutter.name_docker }}/) + * Pulls software from Docker Hub: [`{{ name_docker }}`](https://hub.docker.com/r/{{ name_docker }}/) * `podman` * A generic configuration profile to be used with [Podman](https://podman.io/) - * Pulls software from Docker Hub: [`{{ cookiecutter.name_docker }}`](https://hub.docker.com/r/{{ cookiecutter.name_docker }}/) + * Pulls software from Docker Hub: [`{{ name_docker }}`](https://hub.docker.com/r/{{ name_docker }}/) * `shifter` * A generic configuration profile to be used with [Shifter](https://nersc.gitlab.io/development/shifter/how-to-use/) - * Pulls software from Docker Hub: [`{{ cookiecutter.name_docker }}`](https://hub.docker.com/r/{{ cookiecutter.name_docker }}/) + * Pulls software from Docker Hub: [`{{ name_docker }}`](https://hub.docker.com/r/{{ name_docker }}/) * `charliecloud` * A generic configuration profile to be used with [Charliecloud](https://hpc.github.io/charliecloud/) - * Pulls software from Docker Hub: [`{{ cookiecutter.name_docker }}`](https://hub.docker.com/r/{{ cookiecutter.name_docker }}/) + * Pulls software from Docker Hub: [`{{ name_docker }}`](https://hub.docker.com/r/{{ name_docker }}/) * `conda` * Please only use Conda as a last resort i.e. when it's not possible to run the pipeline with Docker, Singularity, Podman, Shifter or Charliecloud. * A generic configuration profile to be used with [Conda](https://conda.io/docs/) diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/environment.yml b/nf_core/pipeline-template/environment.yml similarity index 86% rename from nf_core/pipeline-template/{{cookiecutter.name_noslash}}/environment.yml rename to nf_core/pipeline-template/environment.yml index 8950af95de..dd84f7dffb 100644 --- a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/environment.yml +++ b/nf_core/pipeline-template/environment.yml @@ -1,6 +1,6 @@ # You can use this file to create a conda environment for this pipeline: # conda env create -f environment.yml -name: {{ cookiecutter.name_noslash }}-{{ cookiecutter.version }} +name: {{ name_noslash }}-{{ version }} channels: - conda-forge - bioconda diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/lib/Headers.groovy b/nf_core/pipeline-template/lib/Headers.groovy similarity index 100% rename from nf_core/pipeline-template/{{cookiecutter.name_noslash}}/lib/Headers.groovy rename to nf_core/pipeline-template/lib/Headers.groovy diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/lib/NfcoreSchema.groovy b/nf_core/pipeline-template/lib/NfcoreSchema.groovy similarity index 100% rename from nf_core/pipeline-template/{{cookiecutter.name_noslash}}/lib/NfcoreSchema.groovy rename to nf_core/pipeline-template/lib/NfcoreSchema.groovy diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/lib/nfcore_external_java_deps.jar b/nf_core/pipeline-template/lib/nfcore_external_java_deps.jar similarity index 100% rename from nf_core/pipeline-template/{{cookiecutter.name_noslash}}/lib/nfcore_external_java_deps.jar rename to nf_core/pipeline-template/lib/nfcore_external_java_deps.jar diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/main.nf b/nf_core/pipeline-template/main.nf similarity index 92% rename from nf_core/pipeline-template/{{cookiecutter.name_noslash}}/main.nf rename to nf_core/pipeline-template/main.nf index 3da3c896af..4ddf49f734 100644 --- a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/main.nf +++ b/nf_core/pipeline-template/main.nf @@ -1,11 +1,11 @@ #!/usr/bin/env nextflow /* ======================================================================================== - {{ cookiecutter.name }} + {{ name }} ======================================================================================== - {{ cookiecutter.name }} Analysis Pipeline. + {{ name }} Analysis Pipeline. #### Homepage / Documentation - https://github.com/{{ cookiecutter.name }} + https://github.com/{{ name }} ---------------------------------------------------------------------------------------- */ @@ -16,7 +16,7 @@ log.info Headers.nf_core(workflow, params.monochrome_logs) ////////////////////////////////////////////////////+ def json_schema = "$projectDir/nextflow_schema.json" if (params.help) { - def command = "nextflow run {{ cookiecutter.name }} --input '*_R{1,2}.fastq.gz' -profile docker" + def command = "nextflow run {{ name }} --input '*_R{1,2}.fastq.gz' -profile docker" log.info NfcoreSchema.params_help(workflow, params, json_schema, command) exit 0 } @@ -132,10 +132,10 @@ Channel.from(summary.collect{ [it.key, it.value] }) .map { k,v -> "
$k
${v ?: 'N/A'}
" } .reduce { a, b -> return [a, b].join("\n ") } .map { x -> """ - id: '{{ cookiecutter.name_noslash }}-summary' + id: '{{ name_noslash }}-summary' description: " - this information is collected when the pipeline is started." - section_name: '{{ cookiecutter.name }} Workflow Summary' - section_href: 'https://github.com/{{ cookiecutter.name }}' + section_name: '{{ name }} Workflow Summary' + section_href: 'https://github.com/{{ name }}' plot_type: 'html' data: |
@@ -250,9 +250,9 @@ process output_documentation { workflow.onComplete { // Set up the e-mail variables - def subject = "[{{ cookiecutter.name }}] Successful: $workflow.runName" + def subject = "[{{ name }}] Successful: $workflow.runName" if (!workflow.success) { - subject = "[{{ cookiecutter.name }}] FAILED: $workflow.runName" + subject = "[{{ name }}] FAILED: $workflow.runName" } def email_fields = [:] email_fields['version'] = workflow.manifest.version @@ -284,12 +284,12 @@ workflow.onComplete { if (workflow.success) { mqc_report = ch_multiqc_report.getVal() if (mqc_report.getClass() == ArrayList) { - log.warn "[{{ cookiecutter.name }}] Found multiple reports from process 'multiqc', will use only one" + log.warn "[{{ name }}] Found multiple reports from process 'multiqc', will use only one" mqc_report = mqc_report[0] } } } catch (all) { - log.warn "[{{ cookiecutter.name }}] Could not attach MultiQC report to summary email" + log.warn "[{{ name }}] Could not attach MultiQC report to summary email" } // Check if we are only sending emails on failure @@ -321,7 +321,7 @@ workflow.onComplete { if (params.plaintext_email) { throw GroovyException('Send plaintext e-mail, not HTML') } // Try to send HTML e-mail using sendmail [ 'sendmail', '-t' ].execute() << sendmail_html - log.info "[{{ cookiecutter.name }}] Sent summary e-mail to $email_address (sendmail)" + log.info "[{{ name }}] Sent summary e-mail to $email_address (sendmail)" } catch (all) { // Catch failures and try with plaintext def mail_cmd = [ 'mail', '-s', subject, '--content-type=text/html', email_address ] @@ -329,7 +329,7 @@ workflow.onComplete { mail_cmd += [ '-A', mqc_report ] } mail_cmd.execute() << email_html - log.info "[{{ cookiecutter.name }}] Sent summary e-mail to $email_address (mail)" + log.info "[{{ name }}] Sent summary e-mail to $email_address (mail)" } } @@ -355,10 +355,10 @@ workflow.onComplete { } if (workflow.success) { - log.info "-${c_purple}[{{ cookiecutter.name }}]${c_green} Pipeline completed successfully${c_reset}-" + log.info "-${c_purple}[{{ name }}]${c_green} Pipeline completed successfully${c_reset}-" } else { checkHostname() - log.info "-${c_purple}[{{ cookiecutter.name }}]${c_red} Pipeline completed with errors${c_reset}-" + log.info "-${c_purple}[{{ name }}]${c_red} Pipeline completed with errors${c_reset}-" } } diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/nextflow.config b/nf_core/pipeline-template/nextflow.config similarity index 94% rename from nf_core/pipeline-template/{{cookiecutter.name_noslash}}/nextflow.config rename to nf_core/pipeline-template/nextflow.config index 5e6b52f134..8f73409af0 100644 --- a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/nextflow.config +++ b/nf_core/pipeline-template/nextflow.config @@ -1,6 +1,6 @@ /* * ------------------------------------------------- - * {{ cookiecutter.name }} Nextflow config file + * {{ name }} Nextflow config file * ------------------------------------------------- * Default config options for all environments. */ @@ -47,7 +47,7 @@ params { // Container slug. Stable releases should specify release tag! // Developmental code should specify :dev -process.container = '{{ cookiecutter.name_docker }}:dev' +process.container = '{{ name_docker }}:dev' // Load base.config by default for all pipelines includeConfig 'conf/base.config' @@ -147,13 +147,13 @@ dag { } manifest { - name = '{{ cookiecutter.name }}' - author = '{{ cookiecutter.author }}' - homePage = 'https://github.com/{{ cookiecutter.name }}' - description = '{{ cookiecutter.description }}' + name = '{{ name }}' + author = '{{ author }}' + homePage = 'https://github.com/{{ name }}' + description = '{{ description }}' mainScript = 'main.nf' nextflowVersion = '>=20.04.0' - version = '{{ cookiecutter.version }}' + version = '{{ version }}' } // Function to ensure that resource requirements don't go beyond diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/nextflow_schema.json b/nf_core/pipeline-template/nextflow_schema.json similarity index 98% rename from nf_core/pipeline-template/{{cookiecutter.name_noslash}}/nextflow_schema.json rename to nf_core/pipeline-template/nextflow_schema.json index f2c3f042cf..da5ca21ce0 100644 --- a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/nextflow_schema.json +++ b/nf_core/pipeline-template/nextflow_schema.json @@ -1,8 +1,8 @@ { "$schema": "http://json-schema.org/draft-07/schema", - "$id": "https://raw.githubusercontent.com/{{ cookiecutter.name }}/master/nextflow_schema.json", - "title": "{{ cookiecutter.name }} pipeline parameters", - "description": "{{ cookiecutter.description }}", + "$id": "https://raw.githubusercontent.com/{{ name }}/master/nextflow_schema.json", + "title": "{{ name }} pipeline parameters", + "description": "{{ description }}", "type": "object", "definitions": { "input_output_options": { diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/.github/ISSUE_TEMPLATE/config.yml b/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index c812ac10f7..0000000000 --- a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1,8 +0,0 @@ -blank_issues_enabled: false -contact_links: - - name: Join nf-core - url: https://nf-co.re/join - about: Please join the nf-core community here - - name: "Slack #{{ cookiecutter.short_name }} channel" - url: https://nfcore.slack.com/channels/{{ cookiecutter.short_name }} - about: Discussion about the {{ cookiecutter.name }} pipeline diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/Dockerfile b/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/Dockerfile deleted file mode 100644 index 294a494879..0000000000 --- a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/Dockerfile +++ /dev/null @@ -1,13 +0,0 @@ -FROM nfcore/base:{{ 'dev' if 'dev' in cookiecutter.nf_core_version else cookiecutter.nf_core_version }} -LABEL authors="{{ cookiecutter.author }}" \ - description="Docker image containing all software requirements for the {{ cookiecutter.name }} pipeline" - -# Install the conda environment -COPY environment.yml / -RUN conda env create --quiet -f /environment.yml && conda clean -a - -# Add conda installation dir to PATH (instead of doing 'conda activate') -ENV PATH /opt/conda/envs/{{ cookiecutter.name_noslash }}-{{ cookiecutter.version }}/bin:$PATH - -# Dump the details of the installed packages to a file for posterity -RUN conda env export --name {{ cookiecutter.name_noslash }}-{{ cookiecutter.version }} > {{ cookiecutter.name_noslash }}-{{ cookiecutter.version }}.yml diff --git a/nf_core/schema.py b/nf_core/schema.py index e0506b2821..697e52b2b0 100644 --- a/nf_core/schema.py +++ b/nf_core/schema.py @@ -287,19 +287,15 @@ def make_skeleton_schema(self): """ Make a new pipeline schema from the template """ self.schema_from_scratch = True # Use Jinja to render the template schema file to a variable - # Bit confusing sorry, but cookiecutter only works with directories etc so this saves a bunch of code - templateLoader = jinja2.FileSystemLoader( - searchpath=os.path.join( - os.path.dirname(os.path.realpath(__file__)), "pipeline-template", "{{cookiecutter.name_noslash}}" - ) + env = jinja2.Environment( + loader=jinja2.PackageLoader("nf_core", "pipeline-template"), keep_trailing_newline=True ) - templateEnv = jinja2.Environment(loader=templateLoader) - schema_template = templateEnv.get_template("nextflow_schema.json") - cookiecutter_vars = { + schema_template = env.get_template("nextflow_schema.json") + template_vars = { "name": self.pipeline_manifest.get("name", os.path.dirname(self.schema_filename)).strip("'"), "description": self.pipeline_manifest.get("description", "").strip("'"), } - self.schema = json.loads(schema_template.render(cookiecutter=cookiecutter_vars)) + self.schema = json.loads(schema_template.render(template_vars)) self.get_schema_defaults() def build_schema(self, pipeline_dir, no_prompts, web_only, url): diff --git a/nf_core/sync.py b/nf_core/sync.py index d9db253d37..68e9a9c5a4 100644 --- a/nf_core/sync.py +++ b/nf_core/sync.py @@ -219,7 +219,7 @@ def make_template_pipeline(self): nf_core.create.PipelineCreate( name=self.wf_config["manifest.name"].strip('"').strip("'"), description=self.wf_config["manifest.description"].strip('"').strip("'"), - new_version=self.wf_config["manifest.version"].strip('"').strip("'"), + version=self.wf_config["manifest.version"].strip('"').strip("'"), no_git=True, force=True, outdir=self.pipeline_dir, diff --git a/setup.py b/setup.py index 289f15c555..84da5c5ed9 100644 --- a/setup.py +++ b/setup.py @@ -32,7 +32,6 @@ entry_points={"console_scripts": ["nf-core=nf_core.__main__:run_nf_core"]}, install_requires=[ "click", - "cookiecutter", "GitPython", "jinja2", "jsonschema", diff --git a/tests/test_create.py b/tests/test_create.py index 2b2e18fba7..5fb1e53a60 100644 --- a/tests/test_create.py +++ b/tests/test_create.py @@ -18,7 +18,7 @@ def setUp(self): name=self.pipeline_name, description=self.pipeline_description, author=self.pipeline_author, - new_version=self.pipeline_version, + version=self.pipeline_version, no_git=False, force=True, outdir=tempfile.mkdtemp(), @@ -28,7 +28,7 @@ def test_pipeline_creation(self): assert self.pipeline.name == self.pipeline_name assert self.pipeline.description == self.pipeline_description assert self.pipeline.author == self.pipeline_author - assert self.pipeline.new_version == self.pipeline_version + assert self.pipeline.version == self.pipeline_version def test_pipeline_creation_initiation(self): self.pipeline.init_pipeline() diff --git a/tests/test_launch.py b/tests/test_launch.py index a0acebee24..e592d56363 100644 --- a/tests/test_launch.py +++ b/tests/test_launch.py @@ -19,7 +19,7 @@ def setUp(self): """ Create a new PipelineSchema and Launch objects """ # Set up the schema root_repo_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) - self.template_dir = os.path.join(root_repo_dir, "nf_core", "pipeline-template", "{{cookiecutter.name_noslash}}") + self.template_dir = os.path.join(root_repo_dir, "nf_core", "pipeline-template") self.nf_params_fn = os.path.join(tempfile.mkdtemp(), "nf-params.json") self.launcher = nf_core.launch.Launch(self.template_dir, params_out=self.nf_params_fn) diff --git a/tests/test_modules.py b/tests/test_modules.py index 9ca618a333..5fb094ba81 100644 --- a/tests/test_modules.py +++ b/tests/test_modules.py @@ -19,7 +19,7 @@ def setUp(self): """ Create a new PipelineSchema and Launch objects """ # Set up the schema root_repo_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) - self.template_dir = os.path.join(root_repo_dir, "nf_core", "pipeline-template", "{{cookiecutter.name_noslash}}") + self.template_dir = os.path.join(root_repo_dir, "nf_core", "pipeline-template") self.pipeline_dir = os.path.join(tempfile.mkdtemp(), "mypipeline") shutil.copytree(self.template_dir, self.pipeline_dir) self.mods = nf_core.modules.PipelineModules() diff --git a/tests/test_schema.py b/tests/test_schema.py index a53d946c09..2f29a1f0bd 100644 --- a/tests/test_schema.py +++ b/tests/test_schema.py @@ -25,7 +25,7 @@ def setUp(self): self.root_repo_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) # Copy the template to a temp directory so that we can use that for tests self.template_dir = os.path.join(tempfile.mkdtemp(), "wf") - template_dir = os.path.join(self.root_repo_dir, "nf_core", "pipeline-template", "{{cookiecutter.name_noslash}}") + template_dir = os.path.join(self.root_repo_dir, "nf_core", "pipeline-template") shutil.copytree(template_dir, self.template_dir) self.template_schema = os.path.join(self.template_dir, "nextflow_schema.json")