Skip to content

Commit

Permalink
Define workflow inputs and outputs
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Sherman <[email protected]>
  • Loading branch information
bentsherman committed Jan 12, 2024
1 parent 8253a58 commit 328abba
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 36 deletions.
59 changes: 32 additions & 27 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,6 @@
*/
nextflow.enable.dsl = 2

/*
* Default pipeline parameters. They can be overriden on the command line eg.
* given `params.foo` specify on the run command line `--foo some_value`.
*/

params.reads = "$baseDir/data/ggal/ggal_gut_{1,2}.fq"
params.transcriptome = "$baseDir/data/ggal/ggal_1_48850000_49020000.Ggal71.500bpflank.fa"
params.outdir = "results"
params.multiqc = "$baseDir/multiqc"

log.info """\
R N A S E Q - N F P I P E L I N E
===================================
transcriptome: ${params.transcriptome}
reads : ${params.reads}
outdir : ${params.outdir}
"""

// import modules
include { RNASEQ } from './modules/rnaseq'
include { MULTIQC } from './modules/multiqc'
Expand All @@ -51,14 +33,37 @@ include { MULTIQC } from './modules/multiqc'
* main script flow
*/
workflow {
read_pairs_ch = channel.fromFilePairs( params.reads, checkIfExists: true )
RNASEQ( params.transcriptome, read_pairs_ch )
MULTIQC( RNASEQ.out, params.multiqc )
}
/*
* Default pipeline parameters. They can be overriden on the command line eg.
* given `foo` specify on the run command line `--foo some_value`.
*/
input:
Path reads = "$baseDir/data/ggal/ggal_gut_{1,2}.fq"
Path transcriptome = "$baseDir/data/ggal/ggal_1_48850000_49020000.Ggal71.500bpflank.fa"
Path multiqc = "$baseDir/multiqc"
String outdir = "results"

/*
* completion handler
*/
workflow.onComplete {
log.info ( workflow.success ? "\nDone! Open the following report in your browser --> $params.outdir/multiqc_report.html\n" : "Oops .. something went wrong" )
main:
log.info """\
R N A S E Q - N F P I P E L I N E
===================================
transcriptome: ${transcriptome}
reads : ${reads}
outdir : ${outdir}
"""

read_pairs_ch = channel.fromFilePairs( reads, checkIfExists: true )
RNASEQ( transcriptome, read_pairs_ch )
MULTIQC( RNASEQ.out, multiqc )

/*
* completion handler
*/
workflow.onComplete {
log.info ( workflow.success ? "\nDone! Open the following report in your browser --> $outdir/multiqc_report.html\n" : "Oops .. something went wrong" )
}

output:
List<Path> rnaseq_outputs = RNASEQ.out
Path multiqc_report = MULTIQC.out
}
2 changes: 0 additions & 2 deletions modules/fastqc/main.nf
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
params.outdir = 'results'

process FASTQC {
tag "FASTQC on $sample_id"
conda 'fastqc=0.12.1'
publishDir params.outdir, mode:'copy'

input:
tuple val(sample_id), path(reads)
Expand Down
2 changes: 0 additions & 2 deletions modules/multiqc/main.nf
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
params.outdir = 'results'

process MULTIQC {
conda 'multiqc=1.17'
publishDir params.outdir, mode:'copy'

input:
path('*')
Expand Down
9 changes: 4 additions & 5 deletions modules/rnaseq.nf
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
params.outdir = 'results'

include { INDEX } from './index'
include { QUANT } from './quant'
include { FASTQC } from './fastqc'

workflow RNASEQ {
take:
transcriptome
read_pairs_ch
Path transcriptome
Path read_pairs_ch

main:
INDEX(transcriptome)
FASTQC(read_pairs_ch)
QUANT(INDEX.out, read_pairs_ch)
outputs = QUANT.out | concat(FASTQC.out) | collect

emit:
QUANT.out | concat(FASTQC.out) | collect
List<Path> outputs
}

0 comments on commit 328abba

Please sign in to comment.