Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Important! Template update for nf-core/tools v2.10 #1254

Merged
merged 6 commits into from
Sep 26, 2023
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
1 change: 1 addition & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "nfcore",
"image": "nfcore/gitpod:latest",
"remoteUser": "gitpod",
"runArgs": ["--privileged"],

// Configure tool-specific properties.
"customizations": {
Expand Down
4 changes: 3 additions & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ 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 nf-core/sarek then the best place to ask is on the nf-core Slack [#sarek](https://nfcore.slack.com/channels/sarek) channel ([join our Slack here](https://nf-co.re/join/slack)).
:::info
If you need help using or modifying nf-core/sarek then the best place to ask is on the nf-core Slack [#sarek](https://nfcore.slack.com/channels/sarek) channel ([join our Slack here](https://nf-co.re/join/slack)).
:::

## Contribution workflow

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:

- uses: actions/setup-python@v4
with:
python-version: "3.8"
python-version: "3.11"
architecture: "x64"

- name: Install dependencies
Expand Down
68 changes: 68 additions & 0 deletions .github/workflows/release-announcments.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: release-announcements
# Automatic release toot and tweet anouncements
on:
release:
types: [published]
workflow_dispatch:

jobs:
toot:
runs-on: ubuntu-latest
steps:
- uses: rzr/fediverse-action@master
with:
access-token: ${{ secrets.MASTODON_ACCESS_TOKEN }}
host: "mstdn.science" # custom host if not "mastodon.social" (default)
# GitHub event payload
# https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#release
message: |
Pipeline release! ${{ github.repository }} v${{ github.event.release.tag_name }} - ${{ github.event.release.name }}!

Please see the changelog: ${{ github.event.release.html_url }}

send-tweet:
runs-on: ubuntu-latest

steps:
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: pip install tweepy==4.14.0
- name: Send tweet
shell: python
run: |
import os
import tweepy

client = tweepy.Client(
access_token=os.getenv("TWITTER_ACCESS_TOKEN"),
access_token_secret=os.getenv("TWITTER_ACCESS_TOKEN_SECRET"),
consumer_key=os.getenv("TWITTER_CONSUMER_KEY"),
consumer_secret=os.getenv("TWITTER_CONSUMER_SECRET"),
)
tweet = os.getenv("TWEET")
client.create_tweet(text=tweet)
env:
TWEET: |
Pipeline release! ${{ github.repository }} v${{ github.event.release.tag_name }} - ${{ github.event.release.name }}!

Please see the changelog: ${{ github.event.release.html_url }}
TWITTER_CONSUMER_KEY: ${{ secrets.TWITTER_CONSUMER_KEY }}
TWITTER_CONSUMER_SECRET: ${{ secrets.TWITTER_CONSUMER_SECRET }}
TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }}
TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}

bsky-post:
runs-on: ubuntu-latest
steps:
- uses: zentered/[email protected]
with:
post: |
Pipeline release! ${{ github.repository }} v${{ github.event.release.tag_name }} - ${{ github.event.release.name }}!

Please see the changelog: ${{ github.event.release.html_url }}
env:
BSKY_IDENTIFIER: ${{ secrets.BSKY_IDENTIFIER }}
BSKY_PASSWORD: ${{ secrets.BSKY_PASSWORD }}
#
1 change: 0 additions & 1 deletion .nf-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@ lint:
- lib/NfcoreTemplate.groovy
- lib/NfcoreSchema.groovy
template_strings: False
multiqc_config: False
2 changes: 1 addition & 1 deletion CITATIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@

- [FastQC](https://www.bioinformatics.babraham.ac.uk/projects/fastqc/)

> Andrews, S. (2010). FastQC: A Quality Control Tool for High Throughput Sequence Data [Online]. Available online https://www.bioinformatics.babraham.ac.uk/projects/fastqc/.
> Andrews, S. (2010). FastQC: A Quality Control Tool for High Throughput Sequence Data [Online].

- [FGBio](https://github.com/fulcrumgenomics/fgbio)

Expand Down
133 changes: 102 additions & 31 deletions CODE_OF_CONDUCT.md

Large diffs are not rendered by default.

24 changes: 10 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# ![nf-core/sarek](docs/images/nf-core-sarek_logo_light.png#gh-light-mode-only) ![nf-core/sarek](docs/images/nf-core-sarek_logo_dark.png#gh-dark-mode-only)

> **An open-source analysis pipeline to detect germline or somatic variants from whole genome or targeted sequencing**

[![GitHub Actions CI Status](https://github.com/nf-core/sarek/workflows/nf-core%20CI/badge.svg)](https://github.com/nf-core/sarek/actions?query=workflow%3A%22nf-core+CI%22)
[![GitHub Actions Linting Status](https://github.com/nf-core/sarek/workflows/nf-core%20linting/badge.svg)](https://github.com/nf-core/sarek/actions?query=workflow%3A%22nf-core+linting%22)
[![AWS CI](https://img.shields.io/badge/CI%20tests-full%20size-FF9900?labelColor=000000&logo=Amazon%20AWS)](https://nf-co.re/sarek/results)
Expand Down Expand Up @@ -61,10 +59,11 @@ Depending on the options and samples provided, the pipeline can currently perfor

## Usage

> **Note**
> If you are new to Nextflow and nf-core, please refer to [this page](https://nf-co.re/docs/usage/installation) on how
> to set-up Nextflow. Make sure to [test your setup](https://nf-co.re/docs/usage/introduction#how-to-run-a-pipeline)
> with `-profile test` before running the workflow on actual data.
:::note
If you are new to Nextflow and nf-core, please refer to [this page](https://nf-co.re/docs/usage/installation) on how
to set-up Nextflow. Make sure to [test your setup](https://nf-co.re/docs/usage/introduction#how-to-run-a-pipeline)
with `-profile test` before running the workflow on actual data.
:::

First, prepare a samplesheet with your input data that looks as follows:

Expand All @@ -86,14 +85,11 @@ nextflow run nf-core/sarek \
--outdir <OUTDIR>
```

See [usage docs](https://nf-co.re/sarek/usage) for all of the available options when running the pipeline.

## Documentation

> **Warning:**
> Please provide pipeline parameters via the CLI or Nextflow `-params-file` option. Custom config files including those
> provided by the `-c` Nextflow option can be used to provide any configuration _**except for parameters**_;
> see [docs](https://nf-co.re/usage/configuration#custom-configuration-files).
:::warning
Please provide pipeline parameters via the CLI or Nextflow `-params-file` option. Custom config files including those
provided by the `-c` Nextflow option can be used to provide any configuration _**except for parameters**_;
see [docs](https://nf-co.re/usage/configuration#custom-configuration-files).
:::

For more details and further functionality, please refer to the [usage documentation](https://nf-co.re/sarek/usage) and the [parameter documentation](https://nf-co.re/sarek/parameters).

Expand Down
4 changes: 2 additions & 2 deletions assets/multiqc_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ custom_logo_url: https://github.com/nf-core/sarek/
custom_logo_title: "nf-core/sarek"

report_comment: >
This report has been generated by the <a href="https://github.com/nf-core/sarek/releases/tag/3.3.0" target="_blank">nf-core/sarek</a>
This report has been generated by the <a href="https://github.com/nf-core/sarek/releases/tag/dev" target="_blank">nf-core/sarek</a>
maxulysse marked this conversation as resolved.
Show resolved Hide resolved
analysis pipeline. For information about how to interpret these results, please see the
<a href="https://nf-co.re/sarek/3.3.0/docs/output/" target="_blank">documentation</a>.
<a href="https://nf-co.re/sarek/dev/docs/output" target="_blank">documentation</a>.
maxulysse marked this conversation as resolved.
Show resolved Hide resolved
report_section_order:
"nf-core-sarek-methods-description":
order: -1000
Expand Down
33 changes: 21 additions & 12 deletions docs/output.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,35 @@ The directories listed below will be created in the results directory after the

The pipeline is built using [Nextflow](https://www.nextflow.io/) and processes data using the following steps:

- [Directory Structure](#directory-structure)
- [Preprocessing](#preprocessing)
- [Prepare input files](#preparation-of-input-files-fastq-or-ubam)
- [Preparation of input files (FastQ or (u)BAM)](#preparation-of-input-files-fastq-or-ubam)
- [Trim adapters](#trim-adapters)
- [Split FastQ files](#split-fastq-files)
- [UMI consensus](#umi-consensus)
- [Map to Reference](#map-to-reference)
- [BWA](#bwa)
- [BWA-mem2](#bwa-mem2)
- [DragMap](#dragmap)
- [Sentieon bwa mem](#sentieon-bwa-mem)
- [Duplicate Marking](#mark-duplicates)
- [Sentieon BWA mem](#sentieon-bwa-mem)
- [Mark Duplicates](#mark-duplicates)
- [GATK MarkDuplicates (Spark)](#gatk-markduplicates-spark)
- [Sentieon LocusCollector and Dedup](#sentieon-locuscollector-dedup)
- [Sentieon LocusCollector and Dedup](#sentieon-locuscollector-and-dedup)
- [Base Quality Score Recalibration](#base-quality-score-recalibration)
- [GATK BaseRecalibrator (Spark)](#gatk-baserecalibrator-spark)
- [GATK ApplyBQSR (Spark)](#gatk-applybqsr-spark)
- [CSV files](#csv-files)
- [Variant Calling](#variant-calling)
- [SNVs and small indels](#snvs-and-small-indels)
- [bcftools](#bcftools)
- [DeepVariant](#deepvariant)
- [FreeBayes](#freebayes)
- [GATK HaplotypeCaller](#gatk-haplotypecaller)
- [Sentieon Haplotyper](#sentieon-haplotyper)
- [GATK Germline Single Sample Variant Calling](#gatk-germline-single-sample-variant-calling)
- [GATK Joint Germline Variant Calling](#gatk-joint-germline-variant-calling)
- [GATK Mutect2](#gatk-mutect2)
- [bcftools](#bcftools)
- [Sentieon Haplotyper](#sentieon-haplotyper)
- [Sentieon Joint Germline Variant Calling](#sentieon-joint-germline-variant-calling)
- [Strelka2](#strelka2)
- [Structural Variants](#structural-variants)
- [Manta](#manta)
Expand All @@ -42,22 +47,22 @@ The pipeline is built using [Nextflow](https://www.nextflow.io/) and processes d
- [ASCAT](#ascat)
- [CNVKit](#cnvkit)
- [Control-FREEC](#control-freec)
- [MSI status](#msi-status)
- [Microsatellite instability (MSI)](#microsatellite-instability-msi)
- [MSIsensorPro](#msisensorpro)
- [Concatenation](#concatentation)
- [Concatenation](#concatenation)
- [Variant annotation](#variant-annotation)
- [snpEff](#snpeff)
- [VEP](#vep)
- [Quality control and reporting](#qc-and-reporting)
- [Quality control and reporting](#quality-control-and-reporting)
- [Quality control](#quality-control)
- [FastQC](#fastqc)
- [FastP](#fastp)
- [Mosdepth](#mosdepth)
- [GATK MarkDuplicates reports](#gatk-markduplicates-reports)
- [Sentieon Dedup reports](#sentieon-dedup-reports)
- [mosdepth](#mosdepth)
- [samtools stats](#samtools-stats)
- [bcftools stats](#bcftools-stats)
- [vcftools](#vcftools)
- [VCFtools](#vcftools)
- [snpEff reports](#snpeff-reports)
- [VEP reports](#vep-reports)
- [Reporting](#reporting)
Expand Down Expand Up @@ -762,7 +767,7 @@ It requires a normal sample for each tumour to differentiate the somatic and ger
- Germline sites detected.
</details>

### Concatentation
### Concatenation

Germline VCFs from `DeepVariant`, `FreeBayes`, `HaplotypeCaller`, `Haplotyper`, `Manta`, `bcftools mpileup`, `Strelka2`, or `Tiddit` are concatenated with `bcftools concat`. The field `SOURCE` is added to the VCF header to report the variant caller.

Expand Down Expand Up @@ -853,6 +858,9 @@ The plots display:
<details markdown="1">
<summary>Output files for all samples</summary>

:::note
The FastQC plots displayed in the MultiQC report shows _untrimmed_ reads. They may contain adapter sequence and potentially regions with low quality.
:::
**Output directory: `{outdir}/reports/fastqc/<sample-lane>`**

- `<sample-lane_1>_fastqc.html` and `<sample-lane_2>_fastqc.html`
Expand Down Expand Up @@ -1072,6 +1080,7 @@ Results generated by MultiQC collect pipeline QC from supported tools e.g. FastQ
- Reports generated by Nextflow: `execution_report.html`, `execution_timeline.html`, `execution_trace.txt` and `pipeline_dag.dot`/`pipeline_dag.svg`.
- Reports generated by the pipeline: `pipeline_report.html`, `pipeline_report.txt` and `software_versions.yml`. The `pipeline_report*` files will only be present if the `--email` / `--email_on_fail` parameter's are used when running the pipeline.
- Reformatted samplesheet files used as input to the pipeline: `samplesheet.valid.csv`.
- Parameters used by the pipeline run: `params.json`.

</details>

Expand Down
16 changes: 12 additions & 4 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ If you wish to repeatedly use the same parameters for multiple runs, rather than

Pipeline settings can be provided in a `yaml` or `json` file via `-params-file <file>`.

> ⚠️ Do not use `-c <file>` to specify parameters as this will result in errors. Custom config files specified with `-c` must only be used for [tuning process resource specifications](https://nf-co.re/docs/usage/configuration#tuning-workflow-resources), other infrastructural tweaks (such as output directories), or module arguments (args).
:::warning
Do not use `-c <file>` to specify parameters as this will result in errors. Custom config files specified with `-c` must only be used for [tuning process resource specifications](https://nf-co.re/docs/usage/configuration#tuning-workflow-resources), other infrastructural tweaks (such as output directories), or module arguments (args).
:::

The above pipeline run specified with a params file in yaml format:

Expand Down Expand Up @@ -327,11 +329,15 @@ This version number will be logged in reports when you run the pipeline, so that

To further assist in reproducbility, you can use share and re-use [parameter files](#running-the-pipeline) to repeat pipeline runs with the same settings without having to write out a command with every single parameter.

> 💡 If you wish to share such profile (such as upload as supplementary material for academic publications), make sure to NOT include cluster specific paths to files, nor institutional specific profiles.
:::tip
If you wish to share such profile (such as upload as supplementary material for academic publications), make sure to NOT include cluster specific paths to files, nor institutional specific profiles.
:::

# Core Nextflow arguments

> **NB:** These options are part of Nextflow and use a _single_ hyphen (pipeline parameters use a double-hyphen).
:::note
These options are part of Nextflow and use a _single_ hyphen (pipeline parameters use a double-hyphen).
:::

## `-profile`

Expand All @@ -340,7 +346,9 @@ Profiles can give configuration presets for different compute environments.

Several generic profiles are bundled with the pipeline which instruct the pipeline to use software packaged using different methods (Docker, Singularity, Podman, Shifter, Charliecloud, Apptainer, Conda) - see below.

> We highly recommend the use of `Docker` or `Singularity` containers for full pipeline reproducibility, however when this is not possible, `Conda` is also supported.
:::info
We highly recommend the use of Docker or Singularity containers for full pipeline reproducibility, however when this is not possible, Conda is also supported.
:::

The pipeline also dynamically loads configurations from [github.com/nf-core/configs](https://github.com/nf-core/configs) when it runs, making multiple config profiles for various institutional clusters available at run time.
For more information and to see if your system is available in these configs please see the [nf-core/configs documentation](https://github.com/nf-core/configs#documentation).
Expand Down
16 changes: 16 additions & 0 deletions lib/NfcoreTemplate.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//

import org.yaml.snakeyaml.Yaml
import groovy.json.JsonOutput

class NfcoreTemplate {

Expand Down Expand Up @@ -222,6 +223,21 @@ class NfcoreTemplate {
}
}

//
// Dump pipeline parameters in a json file
//
public static void dump_parameters(workflow, params) {
def output_d = new File("${params.outdir}/pipeline_info/")
if (!output_d.exists()) {
output_d.mkdirs()
}

def timestamp = new java.util.Date().format( 'yyyy-MM-dd_HH-mm-ss')
def output_pf = new File(output_d, "params_${timestamp}.json")
def jsonStr = JsonOutput.toJson(params)
output_pf.text = JsonOutput.prettyPrint(jsonStr)
}

//
// Print pipeline summary on completion
//
Expand Down
2 changes: 1 addition & 1 deletion lib/WorkflowSarek.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class WorkflowSarek {

public static String toolCitationText(params) {

// TODO Optionally add in-text citation tools to this list.
// TODO nf-core: Optionally add in-text citation tools to this list.
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we actually do this?

// Can use ternary operators to dynamically construct based conditions, e.g. params["run_xyz"] ? "Tool (Foo et al. 2023)" : "",
// Uncomment function in methodsDescriptionText to render in MultiQC report
def citation_text = [
Expand Down
7 changes: 4 additions & 3 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ params {
// Schema validation default options
validationFailUnrecognisedParams = false
validationLenientMode = true
validationSchemaIgnoreParams = 'genomes,cf_ploidy'
validationSchemaIgnoreParams = 'cf_ploidy,genomes,igenomes_base'
validationShowHiddenParams = false
validate_params = true
}
Expand Down Expand Up @@ -229,6 +229,7 @@ profiles {
}
apptainer {
apptainer.enabled = true
apptainer.autoMounts = true
charliecloud.enabled = false
conda.enabled = false
docker.enabled = false
Expand All @@ -237,8 +238,8 @@ profiles {
singularity.enabled = false
}
gitpod {
executor.cpus = 16
executor.memory = 60.GB
executor.cpus = 4
executor.memory = 8.GB
executor.name = 'local'
}
// Basic test profile for CI
Expand Down
5 changes: 4 additions & 1 deletion workflows/sarek.nf
Original file line number Diff line number Diff line change
Expand Up @@ -1292,7 +1292,10 @@ workflow SAREK {
*/

workflow.onComplete {
if (params.email || params.email_on_fail) NfcoreTemplate.email(workflow, params, summary_params, projectDir, log, multiqc_report)
if (params.email || params.email_on_fail) {
NfcoreTemplate.email(workflow, params, summary_params, projectDir, log, multiqc_report)
}
NfcoreTemplate.dump_parameters(workflow, params)
NfcoreTemplate.summary(workflow, params, log)
if (params.hook_url) NfcoreTemplate.IM_notification(workflow, params, summary_params, projectDir, log)
}
Expand Down