Skip to content

Commit

Permalink
Update syntax
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Sherman <[email protected]>
  • Loading branch information
bentsherman committed May 28, 2024
1 parent e1b1d45 commit 36f6203
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 43 deletions.
10 changes: 1 addition & 9 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,7 @@ workflow {
}
}

publish {
output {
directory params.outdir
mode 'copy'

'fastqc' {
path '.'
}

'multiqc' {
path '.'
}
}
9 changes: 5 additions & 4 deletions modules/fastqc/main.nf
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@

process FASTQC {
tag "FASTQC on $sample.id"
tag "FASTQC on $id"
conda 'fastqc=0.12.1'

input:
Tuple2<String,List<Path>> sample
id : String
reads : List<Path>

output:
Path logs = path("fastqc_${sample.id}_logs")
logs : Path = path("fastqc_${id}_logs")

publish:
logs >> 'fastqc'

script:
"""
fastqc.sh "$sample.id" "$sample.reads"
fastqc.sh "$id" "$reads"
"""
}
4 changes: 2 additions & 2 deletions modules/index/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ process INDEX {
conda 'salmon=1.10.2'

input:
Path transcriptome
transcriptome : Path

output:
Path index = path('index')
index : Path = path('index')

script:
"""
Expand Down
6 changes: 3 additions & 3 deletions modules/multiqc/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ process MULTIQC {
conda 'multiqc=1.17'

input:
List<Path> inputs
Path config
inputs : List<Path>
config : Path

output:
Path report = path('multiqc_report.html')
report : Path = path('multiqc_report.html')

publish:
report >> 'multiqc'
Expand Down
15 changes: 8 additions & 7 deletions modules/quant/main.nf
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@

process QUANT {
tag "$pair.id"
tag "$id"
conda 'salmon=1.10.2'

input:
Path index
Tuple2<String,List<Path>> pair
index : Path
id : String
reads : List<Path>

output:
Path quant = path(pair.id)
quant : Path = path(id)

script:
"""
salmon quant \
--threads $task.cpus \
--libType=U \
-i $index \
-1 ${pair.reads[0]} \
-2 ${pair.reads[1]} \
-o $pair.id
-1 ${reads[0]} \
-2 ${reads[1]} \
-o $id
"""
}
36 changes: 18 additions & 18 deletions modules/rnaseq.nf
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
params.outdir = 'results'

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

workflow RNASEQ {
take:
reads // Channel<Tuple2<String,List<Path>>>
transcriptome // Path
reads : Channel<Tuple2<String,List<Path>>>
transcriptome : Path

main:
transcriptome // Path
|> INDEX // Path
|> set { index } // Path
transcriptome // Path
|> INDEX // Path
|> set { index } // Path

reads // Channel<Tuple2<String,List<Path>>>
|> map { pair ->
QUANT(index, pair)
} // Channel<Path>
|> set { quant } // Channel<Path>
reads // Channel<Tuple2<String,List<Path>>>
|> map { id, reads ->
QUANT(index, id, reads)
} // Channel<Path>
|> set { quant } // Channel<Path>

reads // Channel<Tuple2<String,List<Path>>>
|> map(FASTQC) // Channel<Path>
|> set { fastqc_logs } // Channel<Path>
reads // Channel<Tuple2<String,List<Path>>>
|> map { id, reads ->
FASTQC( id, reads )
} // Channel<Path>
|> set { fastqc_logs } // Channel<Path>

emit:
index
quant
fastqc_logs
index
quant
fastqc_logs
}

0 comments on commit 36f6203

Please sign in to comment.