Nextflow language preview
1. An nf-core style process
FASTQC with tag/label/publishDir/container directives and two emitted outputs
horizon-dark
process FASTQC {
tag "$meta.id"
label 'process_medium'
publishDir "${params.outdir}/fastqc", mode: 'copy'
container 'quay.io/biocontainers/fastqc:0.12.1--hdfd78af_0'
input:
tuple val(meta), path(reads)
output:
tuple val(meta), path("*.html"), emit: html
tuple val(meta), path("*.zip"), emit: zip
script:
"""
fastqc --quiet --threads $task.cpus $reads
"""
}
atom-one-dark
process FASTQC {
tag "$meta.id"
label 'process_medium'
publishDir "${params.outdir}/fastqc", mode: 'copy'
container 'quay.io/biocontainers/fastqc:0.12.1--hdfd78af_0'
input:
tuple val(meta), path(reads)
output:
tuple val(meta), path("*.html"), emit: html
tuple val(meta), path("*.zip"), emit: zip
script:
"""
fastqc --quiet --threads $task.cpus $reads
"""
}
github-dark
process FASTQC {
tag "$meta.id"
label 'process_medium'
publishDir "${params.outdir}/fastqc", mode: 'copy'
container 'quay.io/biocontainers/fastqc:0.12.1--hdfd78af_0'
input:
tuple val(meta), path(reads)
output:
tuple val(meta), path("*.html"), emit: html
tuple val(meta), path("*.zip"), emit: zip
script:
"""
fastqc --quiet --threads $task.cpus $reads
"""
}
dracula
process FASTQC {
tag "$meta.id"
label 'process_medium'
publishDir "${params.outdir}/fastqc", mode: 'copy'
container 'quay.io/biocontainers/fastqc:0.12.1--hdfd78af_0'
input:
tuple val(meta), path(reads)
output:
tuple val(meta), path("*.html"), emit: html
tuple val(meta), path("*.zip"), emit: zip
script:
"""
fastqc --quiet --threads $task.cpus $reads
"""
}
nord
process FASTQC {
tag "$meta.id"
label 'process_medium'
publishDir "${params.outdir}/fastqc", mode: 'copy'
container 'quay.io/biocontainers/fastqc:0.12.1--hdfd78af_0'
input:
tuple val(meta), path(reads)
output:
tuple val(meta), path("*.html"), emit: html
tuple val(meta), path("*.zip"), emit: zip
script:
"""
fastqc --quiet --threads $task.cpus $reads
"""
}
github
process FASTQC {
tag "$meta.id"
label 'process_medium'
publishDir "${params.outdir}/fastqc", mode: 'copy'
container 'quay.io/biocontainers/fastqc:0.12.1--hdfd78af_0'
input:
tuple val(meta), path(reads)
output:
tuple val(meta), path("*.html"), emit: html
tuple val(meta), path("*.zip"), emit: zip
script:
"""
fastqc --quiet --threads $task.cpus $reads
"""
}
2. A channel pipeline
reading a samplesheet and mapping rows into a tuple channel
horizon-dark
workflow {
ch_samplesheet = Channel
.fromPath(params.input)
.splitCsv(header: true)
.map { row -> tuple(row.sample_id, file(row.fastq)) }
ch_samplesheet.view { sample_id, fastq -> "queued ${sample_id}: ${fastq}" }
}
atom-one-dark
workflow {
ch_samplesheet = Channel
.fromPath(params.input)
.splitCsv(header: true)
.map { row -> tuple(row.sample_id, file(row.fastq)) }
ch_samplesheet.view { sample_id, fastq -> "queued ${sample_id}: ${fastq}" }
}
github-dark
workflow {
ch_samplesheet = Channel
.fromPath(params.input)
.splitCsv(header: true)
.map { row -> tuple(row.sample_id, file(row.fastq)) }
ch_samplesheet.view { sample_id, fastq -> "queued ${sample_id}: ${fastq}" }
}
dracula
workflow {
ch_samplesheet = Channel
.fromPath(params.input)
.splitCsv(header: true)
.map { row -> tuple(row.sample_id, file(row.fastq)) }
ch_samplesheet.view { sample_id, fastq -> "queued ${sample_id}: ${fastq}" }
}
nord
workflow {
ch_samplesheet = Channel
.fromPath(params.input)
.splitCsv(header: true)
.map { row -> tuple(row.sample_id, file(row.fastq)) }
ch_samplesheet.view { sample_id, fastq -> "queued ${sample_id}: ${fastq}" }
}
github
workflow {
ch_samplesheet = Channel
.fromPath(params.input)
.splitCsv(header: true)
.map { row -> tuple(row.sample_id, file(row.fastq)) }
ch_samplesheet.view { sample_id, fastq -> "queued ${sample_id}: ${fastq}" }
}
3. A DSL2 sub-workflow
include-ing modules and wiring their emitted channels together
horizon-dark
include { FASTQC } from './modules/fastqc'
include { MULTIQC } from './modules/multiqc'
workflow QC {
take:
reads
main:
FASTQC(reads)
MULTIQC(FASTQC.out.zip.collect())
emit:
html = FASTQC.out.html
}
atom-one-dark
include { FASTQC } from './modules/fastqc'
include { MULTIQC } from './modules/multiqc'
workflow QC {
take:
reads
main:
FASTQC(reads)
MULTIQC(FASTQC.out.zip.collect())
emit:
html = FASTQC.out.html
}
github-dark
include { FASTQC } from './modules/fastqc'
include { MULTIQC } from './modules/multiqc'
workflow QC {
take:
reads
main:
FASTQC(reads)
MULTIQC(FASTQC.out.zip.collect())
emit:
html = FASTQC.out.html
}
dracula
include { FASTQC } from './modules/fastqc'
include { MULTIQC } from './modules/multiqc'
workflow QC {
take:
reads
main:
FASTQC(reads)
MULTIQC(FASTQC.out.zip.collect())
emit:
html = FASTQC.out.html
}
nord
include { FASTQC } from './modules/fastqc'
include { MULTIQC } from './modules/multiqc'
workflow QC {
take:
reads
main:
FASTQC(reads)
MULTIQC(FASTQC.out.zip.collect())
emit:
html = FASTQC.out.html
}
github
include { FASTQC } from './modules/fastqc'
include { MULTIQC } from './modules/multiqc'
workflow QC {
take:
reads
main:
FASTQC(reads)
MULTIQC(FASTQC.out.zip.collect())
emit:
html = FASTQC.out.html
}