-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRNAseq2.nf
90 lines (69 loc) · 1.8 KB
/
RNAseq2.nf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/usr/bin/env nextflow
// input
params.reads = "$projectDir/inputData/*_{1,2}.fq"
params.transcripts = "$projectDir/inputData/transcriptome.fa"
params.outdir = "$projectDir/results"
// location of programs
params.kallisto="$projectDir/kallisto.yml"
params.fastqc="$projectDir/fastqc.yml"
params.multiqc="$projectDir/multiqc.yml"
// index creation
process INDEX {
conda "${params.kallisto}"
input:
path transcriptome
output:
path "${transcriptome.baseName}"
script:
"""
kallisto index -i kallisto_index $transcriptome
"""
}
// Read quantification
process QUANTIFICATION {
conda "${params.kallisto}"
input:
path kallisto_index
tuple val(sample_id), path(reads)
output:
path "$sample_id"
script:
"""
kallisto quant --threads $task.cpus -i $kallisto_index -o $sample_id ${reads[0]} ${reads[1]}
"""
}
// fastqc report
process FASTQC {
conda "${params.fastqc}"
input:
tuple val(sample_id), path(reads)
output:
path "fastqc_${sample_id}_logs"
script:
"""
mkdir fastqc_${sample_id}_logs
fastqc -o fastqc_${sample_id}_logs -f fastq -q ${reads}
"""
}
// mutiqc report - combine fastqc reports
process MULTIQC {
conda "${params.multiqc}"
publishDir "${params.outdir}/multiqc", mode:'copy'
input:
path '*'
output:
path 'multiqc_report.html'
script:
"""
multiqc .
"""
}
// creates channels and input channel to processes
workflow{
Channel.fromFilePairs(params.reads, checkIfExists: true).set{ readpairs_ch }
Channel.fromPath(params.transcripts, checkIfExists: true).set{ transcripts_ch }
index_ch=INDEX(transcripts_ch)
quant_ch=QUANTIFICATION(index_ch,readpairs_ch)
fastqc_ch = FASTQC(read_pairs_ch)
MULTIQC(quant_ch.mix(fastqc_ch).collect())
}