-
Notifications
You must be signed in to change notification settings - Fork 2
/
rnaseq-toy-dsl2.nf
73 lines (59 loc) · 1.38 KB
/
rnaseq-toy-dsl2.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
#!/usr/bin/env nextflow
/*
* Defines pipeline parameters in order to specify the refence genomes
* and read pairs by using the command line options
*/
params.reads = "$baseDir/data/ggal/*_{1,2}.fq"
params.genome = "$baseDir/data/ggal/ggal_1_48850000_49020000.Ggal71.500bpflank.fa"
/*
* Step 1. Builds the genome index required by the mapping process
*/
process buildIndex {
input:
path genome
output:
path 'genome.index*'
"""
bowtie2-build ${genome} genome.index
"""
}
/*
* Step 2. Maps each read-pair by using Tophat2 mapper tool
*/
process mapping {
input:
path genome
path index
tuple val(pair_id), path(reads)
output:
tuple val(pair_id), path("tophat_out/accepted_hits.bam")
"""
tophat2 genome.index ${reads}
"""
}
/*
* Step 3. Assembles the transcript by using the "cufflinks"
* and publish the transcript output files into the `results` folder
*/
process makeTranscript {
publishDir "results"
input:
tuple val(pair_id), path(bam_file)
output:
tuple val(pair_id), path('transcripts.gtf')
"""
cufflinks ${bam_file}
"""
}
/*
* main flow
*/
read_pairs = Channel.fromFilePairs( params.reads, checkIfExists: true )
/*
* main flow
*/
workflow {
buildIndex(params.genome)
mapping(params.genome, buildIndex.out, read_pairs)
makeTranscript(mapping.out)
}