-
Notifications
You must be signed in to change notification settings - Fork 1
/
processes_data.nf
86 lines (66 loc) · 1.88 KB
/
processes_data.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
/*
* pipeline input parameters
*/
nextflow.enable.dsl=2
// params.reads = "$baseDir/data/gut_{1,2}.fq"
params.reads = "$baseDir/data/*_{1,2}.fq"
params.transcript = "$baseDir/data/transcriptome.fa"
params.outdir = "results/"
log.info """\
R N A S E Q - N F P I P E L I N E
===================================
transcriptome: ${params.transcript}
reads : ${params.reads}
outdir : ${params.outdir}
"""
.stripIndent()
/*
* define the `index` process that create a binary index
* given the transcriptome file
*/
process index {
input:
path transcriptome
output:
path 'index' , emit: index
script:
"""
salmon index --threads $task.cpus -t $transcriptome -i index
"""
}
/*
* Run Salmon to perform the quantification of expression using
* the index and the matched read files
*/
process quantification {
input:
path index
tuple val(pair_id), path(reads)
output:
path(pair_id)
script:
"""
salmon quant --threads $task.cpus --libType=U -i $index -1 ${reads[0]} -2 ${reads[1]} -o $pair_id
"""
}
workflow {
publishDir = "/Users/ebuehler/Documents/GitHub/nextflow-training/results/"
// Index file
index(params.transcript)
// add local Data to Channel
all_pairs = params.reads
Channel.fromFilePairs( all_pairs, checkIfExists:true ).set { all_pairs }
// add online hosted data to Channel
lung_pairs = [
['lung',
[params.test_data_msk['lung_reads']['reads']['lung_1'], params.test_data_msk['lung_reads']['reads']['lung_2']]
]
]
Channel.fromList( lung_pairs).set { lung_pairs }
// combine
all_pairs = all_pairs.concat(lung_pairs)
// Quantification
quantification(index.out.index, all_pairs)
emit:
quantification = quantification.out
}