Skip to content

Commit 4ea7375

Browse files
committed
Revert pipes to dots for operators
Signed-off-by: Ben Sherman <[email protected]>
1 parent 6e5f0d8 commit 4ea7375

File tree

2 files changed

+20
-24
lines changed

2 files changed

+20
-24
lines changed

main.nf

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ params {
2424
defaultValue "${projectDir}/data/ggal/ggal_gut_{1,2}.fq"
2525
}
2626

27-
transcriptome: String {
27+
transcriptome: Path {
2828
description 'The input transcriptome file'
2929
faIcon 'fas fa-folder-open'
3030
defaultValue "${projectDir}/data/ggal/ggal_1_48850000_49020000.Ggal71.500bpflank.fa"
3131
}
3232

33-
multiqc: String {
33+
multiqc: Path {
3434
description 'Directory containing multiqc configuration'
3535
faIcon 'fas fa-folder-open'
3636
defaultValue "${projectDir}/multiqc"
@@ -50,17 +50,18 @@ workflow {
5050
outdir : ${workflow.outputDir}
5151
""".stripIndent()
5252

53-
def (index, samples) = params.reads
54-
|> Channel.fromFilePairs( checkIfExists: true ) // Channel<(String,List<Path>)>
55-
|> map { (id, reads) ->
56-
new FastqPair(id, reads[0], reads[1])
57-
} // Channel<FastqPair>
58-
|> RNASEQ( file(params.transcriptome) ) // NamedTuple(index: Path, samples: Channel<Sample>)
59-
60-
def summary = samples
61-
|> flatMap { s -> [ s.fastqc, s.quant ] } // Channel<Path>
62-
|> collect // Bag<Path> (future)
63-
|> MULTIQC( file(params.multiqc) ) // Path (future)
53+
def pairs = Channel.fromFilePairs(params.reads).map { (id, reads) ->
54+
new FastqPair(id, reads[0], reads[1])
55+
} // Channel<FastqPair>
56+
57+
def (index, samples) = RNASEQ(pairs, params.transcriptome)
58+
// NamedTuple(index: Path, samples: Channel<Sample>)
59+
60+
def multiqc_files = samples
61+
.scatter { s -> [ s.fastqc, s.quant ] } // Channel<Path>
62+
.collect() // Bag<Path> (future)
63+
64+
def summary = MULTIQC( multiqc_files, params.multiqc ) // Path (future)
6465

6566
workflow.onComplete {
6667
log.info ( workflow.success

modules/rnaseq.nf

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,13 @@ workflow RNASEQ {
88
transcriptome : Path
99

1010
main:
11-
transcriptome // Path
12-
|> INDEX // Path (future)
13-
|> set { index } // Path (future)
11+
def index = INDEX( transcriptome ) // Path (future)
1412

15-
pairs // Channel<FastqPair>
16-
|> map { pair ->
17-
def (id, fastq_1, fastq_2) = (pair.id, pair.fastq_1, pair.fastq_2)
18-
def fastqc = FASTQC(id, fastq_1, fastq_2)
19-
def quant = QUANT(index, id, fastq_1, fastq_2)
20-
new Sample(id, fastqc, quant)
21-
} // Channel<Sample>
22-
|> set { samples } // Channel<Sample>
13+
def samples = pairs.map { (id, fastq_1, fastq_2) ->
14+
def fastqc = FASTQC(id, fastq_1, fastq_2)
15+
def quant = QUANT(index, id, fastq_1, fastq_2)
16+
new Sample(id, fastqc, quant)
17+
} // Channel<Sample>
2318

2419
emit:
2520
index : Path

0 commit comments

Comments
 (0)