-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.nf
86 lines (56 loc) · 1.29 KB
/
main.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
#!/usr/bin/env nextflow
// default parameter values
params.fastaFile = 's3://pipelines-microservice-data/kallisto/transcripts.fasta.gz'
params.fastqFile1 = 's3://pipelines-microservice-data/kallisto/reads_1.fastq.gz'
params.fastqFile2 = 's3://pipelines-microservice-data/kallisto/reads_2.fastq.gz'
params.out = "$PWD/out/"
// input files
fasta = file(params.fastaFile)
fastq1 = file(params.fastqFile1)
fastq2 = file(params.fastqFile2)
// output
result = file(params.out)
process indexation {
container 'insilicodb/kallisto'
input:
file fasta
output:
file 'index.idx' into INDEX
"""
kallisto index -i index.idx $fasta
"""
}
process quantification {
container 'insilicodb/kallisto'
input:
file idxFile from INDEX
file fastq1
file fastq2
output:
file "./out/abundance.h5" into QUANT
"""
kallisto quant --index=$idxFile --output=./out $fastq1 $fastq2
"""
}
process exportRObject {
container 'insilicodb/kallisto'
input:
file quantH5 from QUANT
output:
file "kallisto_sleuth.RData" into OUTPUT
script:
"""
#! /usr/bin/env Rscript
library("sleuth")
k <- read_kallisto("${quantH5}")
save(k, file = "./kallisto_sleuth.RData")
"""
}
process collectOutput {
input:
file filename from OUTPUT
"""
mkdir -p ${params.out}
cp ${filename} ${params.out}${filename}
"""
}