44 * Proof of concept of a RNAseq pipeline implemented with Nextflow
55 */
66
7+ nextflow. preview. output = true
78
89/*
910 * Default pipeline parameters. They can be overriden on the command line eg.
10- * given `params.foo ` specify on the run command line `--foo some_value`.
11+ * given `params.reads ` specify on the run command line `--reads some_value`.
1112 */
1213
13- params. reads = " $b aseDir /data/ggal/ggal_gut_{1,2}.fq "
14- params. transcriptome = " $b aseDir /data/ggal/ggal_1_48850000_49020000.Ggal71.500bpflank.fa "
14+ params. reads = null
15+ params. transcriptome = null
1516params. outdir = " results"
16- params. multiqc = " $b aseDir /multiqc"
17+ params. multiqc = " $p rojectDir /multiqc"
1718
1819
1920// import modules
@@ -24,16 +25,48 @@ include { MULTIQC } from './modules/multiqc'
2425 * main script flow
2526 */
2627workflow {
28+ main :
29+ log. info """ \
30+ R N A S E Q - N F P I P E L I N E
31+ ===================================
32+ transcriptome: ${ params.transcriptome}
33+ reads : ${ params.reads}
34+ outdir : ${ params.outdir}
35+ """ . stripIndent()
2736
28- log. info """ \
29- R N A S E Q - N F P I P E L I N E
30- ===================================
31- transcriptome: ${ params.transcriptome}
32- reads : ${ params.reads}
33- outdir : ${ params.outdir}
34- """
35-
36- read_pairs_ch = channel. fromFilePairs( params. reads, checkIfExists : true )
37- RNASEQ ( params. transcriptome, read_pairs_ch )
38- MULTIQC ( RNASEQ . out, params. multiqc )
37+ inputs_ch = channel. fromPath(params. reads)
38+ .splitCsv()
39+ .map { id, fastq_1, fastq_2 ->
40+ tuple(id, file(fastq_1, checkIfExists : true ), file(fastq_2, checkIfExists : true ))
41+ }
42+
43+ samples_ch = RNASEQ ( params. transcriptome, inputs_ch )
44+ .map { id, fastqc, quant ->
45+ [id : id, fastqc : fastqc, quant : quant]
46+ }
47+
48+ multiqc_files_ch = samples_ch
49+ .flatMap { sample -> [sample. fastqc, sample. quant] }
50+ .collect()
51+ multiqc_report = MULTIQC ( multiqc_files_ch, params. multiqc )
52+
53+ publish :
54+ samples = samples_ch
55+ multiqc_report = multiqc_report
56+ }
57+
58+ output {
59+ samples {
60+ path { sample ->
61+ sample. fastqc >> " fastqc/${ sample.id} "
62+ sample. quant >> " quant/${ sample.id} "
63+ }
64+ index {
65+ path ' samples.csv'
66+ header true
67+ }
68+ }
69+
70+ multiqc_report {
71+ }
3972}
0 commit comments