Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/nf-core/tools into refgenie-…
Browse files Browse the repository at this point in the history
…config
  • Loading branch information
mirpedrol committed Jan 12, 2023
2 parents d496513 + 681ccf3 commit 73e277e
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

- Fix the syntax of github_output in GitHub actions ([#2114](https://github.com/nf-core/tools/pull/2114))
- Fix a bug introduced in 2.7 that made pipelines hang ([#2132](https://github.com/nf-core/tools/issues/2132))
- Explicitly disable `conda` when a container profile ([#2140](https://github.com/nf-core/tools/pull/2140))

### Linting

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,8 @@ You can run the pipeline by simply providing the directory path for the `workflo
nextflow run /path/to/download/nf-core-rnaseq-dev/workflow/ --input mydata.csv --outdir results # usual parameters here
```

> Note that if you downloaded singularity images, you will need to use `-profile singularity` or have it enabled in your config file.
### Downloaded nf-core configs

The pipeline files are automatically updated (`params.custom_config_base` is set to `../configs`), so that the local copy of institutional configs are available when running the pipeline.
Expand Down
3 changes: 1 addition & 2 deletions nf_core/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1446,8 +1446,7 @@ def docs(schema_path, output, format, force, columns):
# Assume we're in a pipeline dir root if schema path not set
schema_obj.get_schema_path(schema_path)
schema_obj.load_schema()
if not output:
stdout.print(schema_obj.print_documentation(output, format, force, columns.split(",")))
schema_obj.print_documentation(output, format, force, columns.split(","))


# nf-core bump-version
Expand Down
5 changes: 5 additions & 0 deletions nf_core/pipeline-template/nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ profiles {
docker {
docker.enabled = true
docker.userEmulation = true
conda.enabled = false
singularity.enabled = false
podman.enabled = false
shifter.enabled = false
Expand All @@ -113,27 +114,31 @@ profiles {
singularity {
singularity.enabled = true
singularity.autoMounts = true
conda.enabled = false
docker.enabled = false
podman.enabled = false
shifter.enabled = false
charliecloud.enabled = false
}
podman {
podman.enabled = true
conda.enabled = false
docker.enabled = false
singularity.enabled = false
shifter.enabled = false
charliecloud.enabled = false
}
shifter {
shifter.enabled = true
conda.enabled = false
docker.enabled = false
singularity.enabled = false
podman.enabled = false
charliecloud.enabled = false
}
charliecloud {
charliecloud.enabled = true
conda.enabled = false
docker.enabled = false
singularity.enabled = false
podman.enabled = false
Expand Down
27 changes: 20 additions & 7 deletions nf_core/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,20 @@
import json
import logging
import os
import tempfile
import webbrowser

import jinja2
import jsonschema
import markdown
import rich.console
import yaml
from rich.prompt import Confirm
from rich.syntax import Syntax

import nf_core.list
import nf_core.utils
from nf_core.lint_utils import dump_json_with_prettier
from nf_core.lint_utils import dump_json_with_prettier, run_prettier_on_file

log = logging.getLogger(__name__)

Expand Down Expand Up @@ -464,13 +467,21 @@ def print_documentation(
if format == "html":
output = self.markdown_to_html(output)

# Print to file
if output_fn:
with tempfile.NamedTemporaryFile(mode="w+") as fh:
fh.write(output)
run_prettier_on_file(fh.name)
fh.seek(0)
prettified_docs = fh.read()

if not output_fn:
console = rich.console.Console()
console.print("\n", Syntax(prettified_docs, format), "\n")
else:
if os.path.exists(output_fn) and not force:
log.error(f"File '{output_fn}' exists! Please delete first, or use '--force'")
return
with open(output_fn, "w") as file:
file.write(output)
with open(output_fn, "w") as fh:
fh.write(prettified_docs)
log.info(f"Documentation written to '{output_fn}'")

# Return as a string
Expand All @@ -495,9 +506,11 @@ def schema_to_markdown(self, columns):
if column == "parameter":
out += f"| `{p_key}` "
elif column == "description":
out += f"| {param.get('description', '')} "
desc = param.get("description", "").replace("\n", "<br>")
out += f"| {desc} "
if param.get("help_text", "") != "":
out += f"<details><summary>Help</summary><small>{param['help_text']}</small></details>"
help_txt = param["help_text"].replace("\n", "<br>")
out += f"<details><summary>Help</summary><small>{help_txt}</small></details>"
elif column == "type":
out += f"| `{param.get('type', '')}` "
else:
Expand Down

0 comments on commit 73e277e

Please sign in to comment.