-
Notifications
You must be signed in to change notification settings - Fork 29
/
transcriptclean.wdl
200 lines (177 loc) · 8.18 KB
/
transcriptclean.wdl
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
version 1.0
# Copyright (c) 2019 Leiden University Medical Center
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
task GetSJsFromGtf {
input {
File gtfFile
File genomeFile
String outputPrefix
Int minIntronSize = 21
String memory = "8GiB"
Int timeMinutes = 30
String dockerImage = "biocontainers/transcriptclean:v2.0.2_cv1"
}
command {
set -e
mkdir -p "$(dirname ~{outputPrefix})"
get_SJs_from_gtf \
--f=~{gtfFile} \
--g=~{genomeFile} \
--minIntronSize=~{minIntronSize} \
~{"--o=" + outputPrefix + ".tsv"}
}
output {
File spliceJunctionFile = outputPrefix + ".tsv"
}
runtime {
memory: memory
time_minutes: timeMinutes
docker: dockerImage
}
parameter_meta {
# inputs
gtfFile: {description: "Input gtf file.", category: "required"}
genomeFile: {description: "Reference genome.", category: "required"}
outputPrefix: {description: "Output directory path + output file prefix.", category: "required"}
minIntronSize: {description: "Minimum size of intron to consider a junction.", category: "advanced"}
memory: {description: "The amount of memory available to the job.", category: "advanced"}
timeMinutes: {description: "The maximum amount of time the job will run in minutes.", category: "advanced"}
dockerImage: {description: "The docker image used for this task. Changing this may result in errors which the developers may choose not to address.", category: "advanced"}
# outputs
spliceJunctionFile: {description: "Extracted splice junctions."}
}
}
task GetTranscriptCleanStats {
input {
File inputSam
String outputPrefix
String memory = "4GiB"
Int timeMinutes = 30
String dockerImage = "biocontainers/transcriptclean:v2.0.2_cv1"
}
command {
set -e
mkdir -p "$(dirname ~{outputPrefix})"
get_TranscriptClean_stats \
~{inputSam} \
~{outputPrefix}
}
output {
File statsFile = stdout()
}
runtime {
memory: memory
time_minutes: timeMinutes
docker: dockerImage
}
parameter_meta {
# inputs
inputSam: {description: "Output sam file from transcriptclean.", category: "required"}
outputPrefix: {description: "Output directory path + output file prefix.", category: "required"}
memory: {description: "The amount of memory available to the job.", category: "advanced"}
timeMinutes: {description: "The maximum amount of time the job will run in minutes.", category: "advanced"}
dockerImage: {description: "The docker image used for this task. Changing this may result in errors which the developers may choose not to address.", category: "advanced"}
# outputs
statsFile: {description: "Summary stats from transcriptclean run."}
}
}
task TranscriptClean {
input {
File inputSam
File referenceGenome
Int maxLenIndel = 5
Int maxSJOffset = 5
String outputPrefix
Boolean correctMismatches = true
Boolean correctIndels = true
Boolean correctSJs = true
Boolean dryRun = false
Boolean primaryOnly = false
Boolean canonOnly = false
Int bufferSize = 100
Boolean deleteTmp = true
File? spliceJunctionAnnotation
File? variantFile
Int cores = 1
String memory = "25GiB"
Int timeMinutes = 2880
String dockerImage = "biocontainers/transcriptclean:v2.0.2_cv1"
}
command {
set -e
mkdir -p "$(dirname ~{outputPrefix})"
TranscriptClean \
-s ~{inputSam} \
-g ~{referenceGenome} \
-t ~{cores} \
--maxLenIndel=~{maxLenIndel} \
--maxSJOffset=~{maxSJOffset} \
-o ~{outputPrefix} \
~{true="-m true" false="-m false" correctMismatches} \
~{true="-i true" false="-i false" correctIndels} \
~{true="--correctSJs=true" false="--correctSJs=false" correctSJs} \
~{true="--dryRun" false="" dryRun} \
~{true="--primaryOnly" false="" primaryOnly} \
~{true="--canonOnly" false="" canonOnly} \
--bufferSize=~{bufferSize} \
~{true="--deleteTmp" false="" deleteTmp} \
~{"-j " + spliceJunctionAnnotation} \
~{"-v " + variantFile}
}
output {
File fastaFile = outputPrefix + "_clean.fa"
File logFile = outputPrefix + "_clean.log"
File outputSam = outputPrefix + "_clean.sam"
File logFileTE = outputPrefix + "_clean.TE.log"
}
runtime {
cpu: cores
memory: memory
time_minute: timeMinutes
docker: dockerImage
}
parameter_meta {
# inputs
inputSam: {description: "Input sam file containing transcripts to correct.", category: "required"}
referenceGenome: {description: "Reference genome fasta file.", category: "required"}
maxLenIndel: {description: "Maximum size indel to correct.", category: "advanced"}
maxSJOffset: {description: "Maximum distance from annotated splice junction to correct.", category: "advanced"}
outputPrefix: {description: "Output directory path + output file prefix.", category: "required"}
correctMismatches: {description: "Set this to make transcriptclean correct mismatches.", category: "common"}
correctIndels: {description: "Set this to make transcriptclean correct indels.", category: "common"}
correctSJs: {description: "Set this to make transcriptclean correct splice junctions.", category: "common"}
dryRun: {description: "Transcriptclean will read in the data but don't do any correction.", category: "advanced"}
primaryOnly: {description: "Only output primary mappings of transcripts.", category: "advanced"}
canonOnly: {description: "Only output canonical transcripts and transcript containing annotated noncanonical junctions.", category: "advanced"}
bufferSize: {description: "Number of lines to output to file at once by each thread during run.", category: "common"}
deleteTmp: {description: "The temporary directory generated by transcriptclean will be removed.", category: "common"}
spliceJunctionAnnotation: {description: "Splice junction file.", category: "common"}
variantFile: {description: "Vcf formatted file of variants.", category: "common"}
cores: {description: "The number of cores to be used.", category: "advanced"}
memory: {description: "The amount of memory available to the job.", category: "advanced"}
timeMinutes: {description: "The maximum amount of time the job will run in minutes.", category: "advanced"}
dockerImage: {description: "The docker image used for this task. Changing this may result in errors which the developers may choose not to address.", category: "advanced"}
# outputs
fastaFile: {description: "Fasta file containing corrected reads."}
logFile: {description: "Log file of transcriptclean run."}
outputSam: {description: "Sam file containing corrected aligned reads."}
logFileTE: {description: "TE log file of transcriptclean run."}
}
}