Newer
Older
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
/*
* Ribowave :
* Inputs : fastq files
* Inputs : fasta files
* Output : bam files
*/
/* Create annotation */
params.gtf = "/media/manu/ManuDisque/gencode/gencode.v28.annotation.gtf"
params.genome = "/media/manu/ManuDisque/gencode/GRCh38.p12.genome.fa"
log.info "gtf file : ${params.gtf}"
log.info "genome fasta file : ${params.genome}"
Channel
.fromPath( params.gtf )
.ifEmpty { error "Cannot find any fasta files matching: ${params.gtf}" }
.set { gtf_file }
Channel
.fromPath( params.genome )
.ifEmpty { error "Cannot find any fasta files matching: ${params.genome}" }
.set { genome_file }
process create_annot {
publishDir "results/ribowave/annotation", mode: 'copy'
input:
file gtf from gtf_file
file genome from genome_file
output:
file "*" into annot_file
script:
"""
/Ribowave/scripts/create_annotation.sh -G ${gtf} -f ${genome} -o ./ -s /Ribowave/scripts
"""
}
/*
* P-site determination
*/
params.bam = ""
params.start = ""
params.jobname = ""
log.info "bam file(s) : ${params.bam}"
log.info "start_codon file : ${params.start}"
log.info "job name : ${params.jobname}"
Channel
.fromPath( params.bam )
.ifEmpty { error "Cannot find any fastq files matching: ${params.bam}" }
.set { bam_files }
Channel
.fromPath( params.start )
.ifEmpty { error "Cannot find any index files matching: ${params.start}" }
.set { start_file }
process determination_P_site {
publishDir "results/ribowave/", mode: 'copy'
input:
file bam from bam_files
file start from start_file
output:
file "*" into p_site_channel
script:
"""
/Ribowave/scripts/P-site_determination.sh -i ${bam} -S ${start} -o ./ -n ${params.jobname} -s /Ribowave/scripts
"""
}
/*
* P-site track
*/
params.bam = ""
params.exon = ""
params.genome = ""
params.jobname = ""
params.p_site = ""
log.info "bam file(s) : ${params.bam}"
log.info "exon file : ${params.exon}"
log.info "genome file : ${params.genome}"
log.info "job name : ${params.jobname}"
log.info "job name : ${params.p_site}"
Channel
.fromPath( params.bam )
.ifEmpty { error "Cannot find any fastq files matching: ${params.bam}" }
.set { bam_files }
Channel
.fromPath( params.exon )
.ifEmpty { error "Cannot find any index files matching: ${params.exon}" }
.set { exon_file }
Channel
.fromPath( params.genome )
.ifEmpty { error "Cannot find any index files matching: ${params.genome}" }
.set { genome_file }
Channel
.fromPath( params.p_site )
.ifEmpty { error "Cannot find any index files matching: ${params.p_site}" }
.set { p_site_file }
process determination_P_site {
publishDir "results/ribowave/track_P_site", mode: 'copy'
input:
file bam from bam_files
file exon from exon_file
file genome from genome_file
file p_site from p_site_file
output:
file "*" into det_p_site_channel
script:
"""
/Ribowave/scripts/create_track_Ribo.sh -i ${bam} -G ${exon} -g ${genome} -P ${p_site} -o ./ -n ${params.jobname} -s /Ribowave/scripts
"""
}
/*
* for single-end data
*/
params.fastq = "$baseDir/data/fastq/*.fastq"
params.index = "$baseDir/data/index/*.index*"
params.mean = 200
params.sd = 100
log.info "fastq files : ${params.fastq}"
log.info "index files : ${params.index}"
log.info "mean read size: ${params.mean}"
log.info "sd read size: ${params.sd}"
Channel
.fromPath( params.fastq )
.ifEmpty { error "Cannot find any fastq files matching: ${params.fastq}" }
.set { fastq_files }
Channel
.fromPath( params.index )
.ifEmpty { error "Cannot find any index files matching: ${params.index}" }
.set { index_files }
process mapping_fastq {
tag "$reads.baseName"
cpus 4
publishDir "results/mapping/quantification/", mode: 'copy'
input:
file reads from fastq_files
file index from index_files.toList()
output:
file "*" into count_files
script:
"""
mkdir ${reads.baseName}
kallisto quant -i ${index} -t ${task.cpus} --single
--bias --bootstrap-samples 100 -o ${reads.baseName} \
-l ${params.mean} -s ${params.sd} -o ./ \
${reads} > ${reads.baseName}_kallisto_report.txt
"""
}