/
single-cell-preprocess.cwl
394 lines (343 loc) · 11 KB
/
single-cell-preprocess.cwl
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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
cwlVersion: v1.0
class: Workflow
requirements:
- class: SubworkflowFeatureRequirement
- class: StepInputExpressionRequirement
- class: InlineJavascriptRequirement
- class: MultipleInputFeatureRequirement
'sd:upstream':
genome_indices:
- "genome-indices.cwl"
inputs:
alias:
type: string
label: "Experiment short name/Alias"
sd:preview:
position: 1
fastq_file_1:
type: File
format: "http://edamontology.org/format_1930"
label: "FASTQ file 1 (optionally compressed)"
doc: "FASTQ file 1 (optionally compressed)"
fastq_file_2:
type: File
format: "http://edamontology.org/format_1930"
label: "FASTQ file 2 (optionally compressed)"
doc: "FASTQ file 2 (optionally compressed)"
sc_technology:
type:
- type: enum
name: "sc_technology"
symbols:
- 10XV2 # 2 input files
- 10XV3 # 2 input files
- CELSEQ # 2 input files
- CELSEQ2 # 2 input files
- DROPSEQ # 2 input files
- INDROPSV1 # 2 input files
- INDROPSV2 # 2 input files
- SCRUBSEQ # 2 input files
- SURECELL # 2 input files
label: "Single-cell technology used"
doc: "Single-cell technology used"
workflow_type:
type:
- "null"
- type: enum
name: "workflow_type"
symbols:
- standard
- lamanno
- nucleus
- kite
default: "standard"
label: "Workflow type"
doc: |
Type of workflow. Use lamanno to calculate RNA velocity based
on La Manno et al. 2018 logic. Use nucleus to calculate RNA
velocity on single-nucleus RNA-seq reads.
Default: standard
genome_fasta_file:
type: File
format: "http://edamontology.org/format_1929"
label: "Reference genome FASTA file"
doc: "Reference genome FASTA file that includes all chromosomes"
'sd:upstreamSource': "genome_indices/fasta_output"
annotation_gtf_file:
type: File
format: "http://edamontology.org/format_2306"
label: "GTF annotation file"
doc: "GTF annotation file that includes refGene and mitochondrial DNA annotations"
'sd:upstreamSource': "genome_indices/annotation_gtf"
threads:
type: int?
default: 4
label: "Number of threads"
doc: "Number of threads for those steps that support multithreading"
'sd:layout':
advanced: true
memory_limit:
type: string?
default: "4G"
label: "Maximum memory used"
doc: "Maximum memory used"
'sd:layout':
advanced: true
outputs:
fastqc_report_fastq_1:
type: File
outputSource: run_fastqc_for_fastq_1/html_file
label: "FastqQC report for FASTQ file 1"
doc: "FastqQC report for FASTQ file 1"
fastqc_report_fastq_2:
type: File
outputSource: run_fastqc_for_fastq_2/html_file
label: "FastqQC report for FASTQ file 2"
doc: "FastqQC report for FASTQ file 2"
counts_unfiltered_folder:
type: File
outputSource: compress_counts_folder/compressed_folder
label: "Compressed folder with count matrix files"
doc: |
Compressed folder with count matrix files generated by bustools count
whitelist_file:
type: File
outputSource: generate_counts_matrix/whitelist_file
label: "Whitelisted barcodes"
doc: |
Whitelisted barcodes that correspond to the used single-cell technology
bustools_inspect_report:
type: File
outputSource: generate_counts_matrix/bustools_inspect_report
label: "Report summarizing BUS file content"
doc: |
Report summarizing BUS file content generated by bustools inspect
collected_statistics:
type: File
outputSource: collect_statistics/collected_statistics
label: "Collected statistics in Markdown format"
doc: "Collected statistics in Markdown format"
'sd:visualPlugins':
- markdownView:
tab: 'Overview'
kallisto_bus_report:
type: File
outputSource: generate_counts_matrix/kallisto_bus_report
label: "Pseudoalignment report"
doc: |
Pseudoalignment report generated by kallisto bus
ec_mapping_file:
type: File
outputSource: generate_counts_matrix/ec_mapping_file
label: "Mapping equivalence classes to transcripts"
doc: |
Mapping equivalence classes to transcripts generated by kallisto bus
transcripts_file:
type: File
outputSource: generate_counts_matrix/transcripts_file
label: "Transcript names"
doc: |
Transcript names file generated by kallisto bus
not_sorted_bus_file:
type: File
outputSource: generate_counts_matrix/not_sorted_bus_file
label: "Not sorted BUS file"
doc: |
Not sorted BUS file generated by kallisto bus
corrected_sorted_bus_file:
type: File
outputSource: generate_counts_matrix/corrected_sorted_bus_file
label: "Sorted BUS file with corrected barcodes"
doc: |
Sorted BUS file with corrected barcodes generated by bustools correct
prepare_indices_stdout_log:
type: File
outputSource: prepare_indices/stdout_log
label: stdout log generated by kb ref
doc: |
stdout log generated by kb ref
prepare_indices_stderr_log:
type: File
outputSource: prepare_indices/stderr_log
label: stderr log generated by kb ref
doc: |
stderr log generated by kb ref
generate_counts_matrix_stdout_log:
type: File
outputSource: generate_counts_matrix/stdout_log
label: stdout log generated by kb count
doc: |
stdout log generated by kb count
generate_counts_matrix_stderr_log:
type: File
outputSource: generate_counts_matrix/stderr_log
label: stderr log generated by kb count
doc: |
stderr log generated by kb count
steps:
prepare_indices:
run: ../tools/kb-ref.cwl
in:
genome_fasta_file: genome_fasta_file
annotation_gtf_file: annotation_gtf_file
workflow_type: workflow_type
out:
- kallisto_index_file
- tx_to_gene_mapping_file
- tx_fasta_file
- intron_fasta_file
- tx_to_capture_mapping_file
- intron_tx_to_capture_mapping_file
- stdout_log
- stderr_log
extract_fastq_1:
run: ../tools/extract-fastq.cwl
in:
compressed_file: fastq_file_1
out:
- fastq_file
extract_fastq_2:
run: ../tools/extract-fastq.cwl
in:
compressed_file: fastq_file_2
out:
- fastq_file
run_fastqc_for_fastq_1:
run: ../tools/fastqc.cwl
in:
reads_file: extract_fastq_1/fastq_file
out:
- html_file
run_fastqc_for_fastq_2:
run: ../tools/fastqc.cwl
in:
reads_file: extract_fastq_2/fastq_file
out:
- html_file
generate_counts_matrix:
run: ../tools/kb-count.cwl
in:
fastq_file_1: extract_fastq_1/fastq_file
fastq_file_2: extract_fastq_2/fastq_file
kallisto_index_file: prepare_indices/kallisto_index_file
tx_to_gene_mapping_file: prepare_indices/tx_to_gene_mapping_file
sc_technology: sc_technology
workflow_type: workflow_type
h5ad:
default: true
tx_to_capture_mapping_file: prepare_indices/tx_to_capture_mapping_file
intron_tx_to_capture_mapping_file: prepare_indices/intron_tx_to_capture_mapping_file
threads: threads
memory_limit: memory_limit
out:
- counts_unfiltered_folder
- whitelist_file
- bustools_inspect_report
- kallisto_bus_report
- ec_mapping_file
- transcripts_file
- not_sorted_bus_file
- corrected_sorted_bus_file
- stdout_log
- stderr_log
compress_counts_folder:
run: ../tools/tar-compress.cwl
in:
folder_to_compress: generate_counts_matrix/counts_unfiltered_folder
out:
- compressed_folder
collect_statistics:
run:
cwlVersion: v1.0
class: CommandLineTool
hints:
- class: DockerRequirement
dockerPull: rackspacedot/python37
inputs:
script:
type: string?
default: |
#!/usr/bin/env python3
import sys, json, os, yaml
kallisto_name = os.path.splitext(os.path.basename(sys.argv[1]))[0]
bustools_name = os.path.splitext(os.path.basename(sys.argv[2]))[0]
with open(sys.argv[1], "r") as kallisto_stream:
with open(sys.argv[2], "r") as bustools_stream:
with open("collected_statistics.md", "w") as report_stream:
combined_data = {
"Pseudoalignment statistics": json.load(kallisto_stream),
"BUS statistics": json.load(bustools_stream)
}
for line in yaml.dump(combined_data, width=1000, sort_keys=False).split("\n"):
if not line.strip():
continue
if line.startswith(" - "):
report_stream.write(line+"\n")
elif line.startswith(" "):
report_stream.write("<br>"+line+"\n")
elif line.startswith(" "):
report_stream.write("- "+line+"\n")
else:
report_stream.write("### "+line+"\n")
inputBinding:
position: 5
kallisto_report:
type: File
inputBinding:
position: 6
bustools_report:
type: File
inputBinding:
position: 7
outputs:
collected_statistics:
type: File
outputBinding:
glob: "*"
baseCommand: ["python3", "-c"]
in:
kallisto_report: generate_counts_matrix/kallisto_bus_report
bustools_report: generate_counts_matrix/bustools_inspect_report
out:
- collected_statistics
$namespaces:
s: http://schema.org/
$schemas:
- https://github.com/schemaorg/schemaorg/raw/main/data/releases/11.01/schemaorg-current-http.rdf
s:name: "Single-Cell Preprocessing Pipeline"
label: "Single-Cell Preprocessing Pipeline"
s:alternateName: "Single-Cell Preprocessing Pipeline"
s:downloadUrl: https://raw.githubusercontent.com/datirium/workflows/master/workflows/single-cell-preprocess.cwl
s:codeRepository: https://github.com/datirium/workflows
s:license: http://www.apache.org/licenses/LICENSE-2.0
s:isPartOf:
class: s:CreativeWork
s:name: Common Workflow Language
s:url: http://commonwl.org/
s:creator:
- class: s:Organization
s:legalName: "Cincinnati Children's Hospital Medical Center"
s:location:
- class: s:PostalAddress
s:addressCountry: "USA"
s:addressLocality: "Cincinnati"
s:addressRegion: "OH"
s:postalCode: "45229"
s:streetAddress: "3333 Burnet Ave"
s:telephone: "+1(513)636-4200"
s:logo: "https://www.cincinnatichildrens.org/-/media/cincinnati%20childrens/global%20shared/childrens-logo-new.png"
s:department:
- class: s:Organization
s:legalName: "Allergy and Immunology"
s:department:
- class: s:Organization
s:legalName: "Barski Research Lab"
s:member:
- class: s:Person
s:name: Michael Kotliar
s:email: mailto:misha.kotliar@gmail.com
s:sameAs:
- id: http://orcid.org/0000-0002-6486-3898
doc: |
Devel version of Single-Cell Preprocessing Pipeline
===================================================