Skip to content

Commit 642dbad

Browse files
committed
Update to second preview
Signed-off-by: Ben Sherman <[email protected]>
1 parent 267981b commit 642dbad

File tree

5 files changed

+43
-33
lines changed

5 files changed

+43
-33
lines changed

main.nf

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,6 @@ params.transcriptome = "$baseDir/data/ggal/ggal_1_48850000_49020000.Ggal71.500bp
3737
params.outdir = "results"
3838
params.multiqc = "$baseDir/multiqc"
3939

40-
log.info """\
41-
R N A S E Q - N F P I P E L I N E
42-
===================================
43-
transcriptome: ${params.transcriptome}
44-
reads : ${params.reads}
45-
outdir : ${params.outdir}
46-
"""
47-
4840
// import modules
4941
include { RNASEQ } from './modules/rnaseq'
5042
include { MULTIQC } from './modules/multiqc'
@@ -53,17 +45,40 @@ include { MULTIQC } from './modules/multiqc'
5345
* main script flow
5446
*/
5547
workflow {
56-
read_pairs_ch = channel.fromFilePairs( params.reads, checkIfExists: true )
48+
main:
49+
log.info """\
50+
R N A S E Q - N F P I P E L I N E
51+
===================================
52+
transcriptome: ${params.transcriptome}
53+
reads : ${params.reads}
54+
outdir : ${params.outdir}
55+
"""
56+
57+
read_pairs_ch = channel.fromFilePairs( params.reads, checkIfExists: true, flat: true )
5758
RNASEQ( params.transcriptome, read_pairs_ch )
58-
MULTIQC( RNASEQ.out, params.multiqc )
59+
60+
samples_ch = RNASEQ.out.quant
61+
| join(RNASEQ.out.fastqc)
62+
63+
multiqc_ch = RNASEQ.out.quant
64+
| concat(RNASEQ.out.fastqc)
65+
| map { _id, file -> file }
66+
| collect
67+
MULTIQC( multiqc_ch, params.multiqc )
68+
69+
publish:
70+
samples_ch >> 'samples'
71+
MULTIQC.out >> 'multiqc'
5972
}
6073

6174
output {
62-
directory params.outdir
63-
mode 'copy'
64-
fastqc {
75+
samples {
76+
path '.'
6577
index {
66-
path 'index.csv'
78+
path 'index.json'
79+
mapper { id, quant, fastqc ->
80+
[id: id, quant: quant, fastqc: fastqc]
81+
}
6782
}
6883
}
6984
}

modules/fastqc/main.nf

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11

22
process FASTQC {
3-
tag "FASTQC on $sample_id"
3+
tag "$sample_id"
44
conda 'fastqc=0.12.1'
55

66
input:
7-
tuple val(sample_id), path(reads)
7+
tuple val(sample_id), path(fastq_1), path(fastq_2)
88

99
output:
10-
path "fastqc_${sample_id}_logs", emit: logs
11-
12-
publish:
13-
logs >> 'fastqc'
10+
tuple val(sample_id), path("fastqc_${sample_id}_logs"), emit: logs
1411

1512
script:
1613
"""
17-
fastqc.sh "$sample_id" "$reads"
14+
fastqc.sh "$sample_id" "$fastq_1 $fastq_2"
1815
"""
1916
}

modules/multiqc/main.nf

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ process MULTIQC {
99
output:
1010
path('multiqc_report.html'), emit: report
1111

12-
publish:
13-
report >> 'multiqc'
14-
1512
script:
1613
"""
1714
cp $config/* .

modules/quant/main.nf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11

22
process QUANT {
3-
tag "$pair_id"
3+
tag "$sample_id"
44
conda 'salmon=1.10.2'
55

66
input:
7-
path index
8-
tuple val(pair_id), path(reads)
7+
path index
8+
tuple val(sample_id), path(fastq_1), path(fastq_2)
99

1010
output:
11-
path pair_id
11+
tuple val(sample_id), path(sample_id)
1212

1313
script:
1414
"""
15-
salmon quant --threads $task.cpus --libType=U -i $index -1 ${reads[0]} -2 ${reads[1]} -o $pair_id
15+
salmon quant --threads $task.cpus --libType=U -i $index -1 ${fastq_1} -2 ${fastq_2} -o $sample_id
1616
"""
1717
}

modules/rnaseq.nf

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@ workflow RNASEQ {
88
take:
99
transcriptome
1010
read_pairs_ch
11-
12-
main:
11+
12+
main:
1313
INDEX(transcriptome)
1414
FASTQC(read_pairs_ch)
1515
QUANT(INDEX.out, read_pairs_ch)
1616

17-
emit:
18-
QUANT.out | concat(FASTQC.out) | collect
17+
emit:
18+
quant = QUANT.out
19+
fastqc = FASTQC.out
1920
}

0 commit comments

Comments
 (0)