Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 0 additions & 50 deletions .editorconfig

This file was deleted.

4 changes: 1 addition & 3 deletions .github/workflows/fix_linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@ jobs:
github.repository == 'sanger-tol/readmapping'
runs-on: ubuntu-latest
steps:
# Use the @nf-core-bot token to check out so we can push later
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
# Use the @sanger-tolsoft token to check out so we can push later
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
token: ${{ secrets.sangertolsoft_access_token }}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ jobs:
run: uv tool install nf-core==${{ steps.read_yml.outputs['nf_core_version'] }}

- name: Run nf-core pipelines lint
if: ${{ github.base_ref != 'main' }}
if: ${{ github.base_ref != 'master' && github.base_ref != 'main' }}
env:
GITHUB_COMMENTS_URL: ${{ github.event.pull_request.comments_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_PR_COMMIT: ${{ github.event.pull_request.head.sha }}
run: nf-core -l lint_log.txt pipelines lint --dir ${GITHUB_WORKSPACE} --markdown lint_results.md

- name: Run nf-core pipelines lint --release
if: ${{ github.base_ref == 'main' }}
if: ${{ github.base_ref == 'master' || github.base_ref == 'main' }}
env:
GITHUB_COMMENTS_URL: ${{ github.event.pull_request.comments_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ testing*
*.pyc
null/
.nf-test*
.lineage/
12 changes: 4 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,16 @@ repos:
exclude: |
(?x)^(
.*ro-crate-metadata.json$|
modules/nf-core/.*|
subworkflows/nf-core/.*|
modules/sanger-tol/.*|
subworkflows/sanger-tol/.*|
modules/(?!local/).*|
subworkflows/(?!local/).*|
.*\.snap$
)$
- id: end-of-file-fixer
exclude: |
(?x)^(
.*ro-crate-metadata.json$|
modules/nf-core/.*|
subworkflows/nf-core/.*|
modules/sanger-tol/.*|
subworkflows/sanger-tol/.*|
modules/(?!local/).*|
subworkflows/(?!local/).*|
.*\.snap$
)$
- id: check-added-large-files
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ On merge to `dev` and `main` branch, automated continuous integration tests run

## Quick Start

> [!NOTE]
> If you are new to Nextflow and nf-core, please refer to [this page](https://nf-co.re/docs/get_started/environment_setup/overview) on how to set-up Nextflow. Make sure to [test your setup](https://nf-co.re/docs/get_started/run-your-first-pipeline) with `-profile test` before running the workflow on actual data.

1. Install [`Nextflow`](https://www.nextflow.io/docs/latest/getstarted.html#installation) (`>=25.10.4`)

2. Install any of [`Docker`](https://docs.docker.com/engine/installation/), [`Singularity`](https://www.sylabs.io/guides/3.0/user-guide/) (you can follow [this tutorial](https://singularity-tutorial.github.io/01-installation/)), [`Podman`](https://podman.io/), [`Shifter`](https://nersc.gitlab.io/development/shifter/how-to-use/) or [`Charliecloud`](https://hpc.github.io/charliecloud/) for full pipeline reproducibility _(you can use [`Conda`](https://conda.io/miniconda.html) both to install Nextflow itself and also to manage software within pipelines. Please only use it within pipelines as a last resort; see [docs](https://nf-co.re/usage/configuration#basic-configuration-profiles))_.
Expand Down
2 changes: 1 addition & 1 deletion conf/base.config
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

process {

errorStrategy = { task.exitStatus in ((130..145) + 104) ? 'retry' : 'finish' }
errorStrategy = { task.exitStatus in ((130..145) + 104 + (175..177)) ? 'retry' : 'finish' }
maxRetries = 5
maxErrors = '-1'

Expand Down
2 changes: 0 additions & 2 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,5 +156,3 @@ nf-core pipelines bump-version --nextflow . <min_nf_version>
#### Images and figures guidelines

If you update images or graphics, follow the nf-core [style guidelines](https://nf-co.re/docs/community/brand/workflow-schematics).

## Pipeline specific contribution guidelines
69 changes: 2 additions & 67 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,78 +199,13 @@ Specify the path to a specific config file (this is a core Nextflow command). Se

Whilst the default requirements set within the pipeline will hopefully work for most people and with most input data, you may find that you want to customise the compute resources that the pipeline requests. Each step in the pipeline has a default set of requirements for number of CPUs, memory and time. For most pipeline steps, if a job exits with one of the retryable error codes defined in this pipeline's [`conf/base.config`](../conf/base.config), it will automatically be resubmitted with increased resource requests. In most cases these increases scale with `task.attempt`, so the exact increase depends on the process definition rather than being limited to fixed 2x and 3x bumps. The pipeline is configured with `maxRetries = 5`, meaning that after the initial submission a task can be retried up to 5 times (6 total attempts) before pipeline execution is stopped.

For example, if the sanger-tol/readmapping pipeline is failing after multiple re-submissions of the BWA-MEM2 alignment process due to an exit code of `137` this often indicates that the task was killed, commonly due to an out of memory issue. Check the `.command.err` file and any scheduler logs to confirm the exact cause.
To change the resource requests, please see the [max resources](https://nf-co.re/docs/running/configuration/nextflow-for-your-system#set-max-resources) and [customise process resources](https://nf-co.re/docs/running/configuration/nextflow-for-your-system#customize-process-resources) section of the nf-core website.

#### For beginners

A first step to bypass this error, you could try to increase the amount of CPUs, memory, and time for the whole pipeline. You can do this by increasing the `resourceLimits` setting:

```nextflow
process {
resourceLimits = [
cpus: 32,
memory: 256.GB,
time: 24.h
]
}
```

To change the resource requests, please see the [max resources](https://nf-co.re/docs/running/configuration/nextflow-for-your-system#set-max-resources) and [customise process resources](https://nf-co.re/docs/running/configuration/nextflow-for-your-system#customize-process-resources) section of the nf-core website.

#### Advanced option on process level

To bypass this error you first need to check which resources are set for the Hi-C BWA-MEM2 alignment step in this pipeline. In `readmapping` this is handled by the local process `CRAMALIGN_BWAMEM2ALIGNHIC` in `modules/sanger-tol/cramalign/bwamem2alignhic/main.nf`, which is labelled [`process_high`](https://github.com/sanger-tol/readmapping/blob/main/modules/sanger-tol/cramalign/bwamem2alignhic/main.nf#L3). The actual resource settings are then overridden in [`conf/base.config`](https://github.com/sanger-tol/readmapping/blob/main/conf/base.config), where the full selector `.*:ALIGN_SHORT:.*:CRAMALIGN_BWAMEM2ALIGNHIC` sets `cpus = 16`, `time = 4.h * task.attempt`, and `memory = 50.GB` for references smaller than 2 Gb or approximately `20.GB` per Gb of reference for larger genomes, scaled by retry attempt. If that still is not sufficient for your data, you can provide a custom config file via the [`-c`](#-c) parameter to override the process-level memory setting, for example increasing it to 100 GB as shown below.

```nextflow
process {
withName: ".*:ALIGN_SHORT:.*:CRAMALIGN_BWAMEM2ALIGNHIC" {
memory = 100.GB
}
}
```

> **NB:** We specify the full process name i.e. `.*:ALIGN_SHORT:.*:CRAMALIGN_BWAMEM2ALIGNHIC` in the config file because this takes priority over the short process name (`CRAMALIGN_BWAMEM2ALIGNHIC`) and allows existing configuration using the full process name to be correctly overridden.
>
> If you get a warning suggesting that the process selector isn't recognised check that the process name has been specified correctly.

### Custom Containers (advanced users)

The [Nextflow DSL2](https://www.nextflow.io/docs/latest/dsl2.html) implementation of this pipeline uses one container per process which makes it much easier to maintain and update software dependencies. If for some reason you need to use a different version of a particular tool with the pipeline then you just need to identify the `process` name and override the Nextflow `container` definition for that process using the `withName` declaration. You can override the default container used by the pipeline by creating a custom config file and passing it as a command-line argument via `-c custom.config`.

1. Check the default version used by the pipeline in the module file for [Samtools](https://github.com/sanger-tol/readmapping/blob/main/modules/nf-core/samtools/view/main.nf#L5-L8)
2. Find the latest version of the Biocontainer available on [Quay.io](https://quay.io/repository/biocontainers/samtools?tag=latest&tab=tags)
3. Create the custom config accordingly:
- For Docker:

```nextflow
process {
withName: SAMTOOLS_VIEW {
container = 'quay.io/biocontainers/samtools:1.16.1--h6899075_1'
}
}
```

- For Singularity:

```nextflow
process {
withName: SAMTOOLS_VIEW {
container = 'https://depot.galaxyproject.org/singularity/samtools:1.16.1--h6899075_1'
}
}
```

- For Conda:

```nextflow
process {
withName: SAMTOOLS_VIEW {
conda = 'bioconda::samtools=1.16.1'
}
}
```

> **NB:** If you wish to periodically update individual tool-specific results (e.g. Samtools) generated by the pipeline then you must ensure to keep the `work/` directory otherwise the `-resume` ability of the pipeline will be compromised and it will restart from scratch.
To use a different container from the default container or conda environment specified in a pipeline, please see the [updating tool versions](https://nf-co.re/docs/running/configuration/nextflow-for-your-system#update-tool-versions) section of the nf-core website.

### Custom Tool Arguments

Expand Down
3 changes: 2 additions & 1 deletion main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ workflow SANGERTOL_READMAPPING {
READMAPPING (
samplesheet,
fasta,
header
header,
params.outdir,
)
}
/*
Expand Down
25 changes: 12 additions & 13 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,18 @@ params {


// Boilerplate options
outdir = 'results'
publish_dir_mode = 'copy'
email = null
email_on_fail = null
plaintext_email = false
monochrome_logs = false
hook_url = null
help = false
help_full = false
show_hidden = false
version = false
trace_report_suffix = new java.util.Date().format( 'yyyy-MM-dd_HH-mm-ss')// Config options

outdir = 'results'
publish_dir_mode = 'copy'
email = null
email_on_fail = null
plaintext_email = false
monochrome_logs = false
help = false
help_full = false
show_hidden = false
version = false
pipelines_testdata_base_path = 'https://raw.githubusercontent.com/nf-core/test-datasets/'
trace_report_suffix = new java.util.Date().format( 'yyyy-MM-dd_HH-mm-ss')

// Config options
config_profile_name = null
Expand Down
14 changes: 7 additions & 7 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -239,13 +239,6 @@
"fa_icon": "fas fa-palette",
"hidden": true
},
"hook_url": {
"type": "string",
"description": "Incoming hook URL for messaging service",
"fa_icon": "fas fa-people-group",
"help_text": "Incoming hook URL for messaging service. Currently, MS Teams and Slack are supported.",
"hidden": true
},
"multiqc_title": {
"type": "string",
"description": "MultiQC report title. Printed as page header, used for filename if not otherwise specified.",
Expand Down Expand Up @@ -276,6 +269,13 @@
"fa_icon": "fas fa-check-square",
"hidden": true
},
"pipelines_testdata_base_path": {
"type": "string",
"fa_icon": "far fa-check-circle",
"description": "Base URL or local path to location of pipeline test dataset files",
"default": "https://raw.githubusercontent.com/nf-core/test-datasets/",
"hidden": true
},
"trace_report_suffix": {
"type": "string",
"fa_icon": "far calendar",
Expand Down
7 changes: 6 additions & 1 deletion nf-test.config
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ config {
configFile = "tests/nextflow.config"

// ignore tests coming from the nf-core/modules repo
ignore 'modules/nf-core/**/tests/*', 'subworkflows/nf-core/**/tests/*', 'modules/sanger-tol/**/tests/*', 'subworkflows/sanger-tol/**/tests/*'
ignore = [
'modules/nf-core/**/tests/*',
'subworkflows/nf-core/**/tests/*',
'modules/sanger-tol/**/tests/*',
'subworkflows/sanger-tol/**/tests/*',
]

// run all test with defined profile(s) from the main nextflow.config
profile = "test"
Expand Down
10 changes: 0 additions & 10 deletions pyproject.toml

This file was deleted.

Loading
Loading