-
Notifications
You must be signed in to change notification settings - Fork 0
/
proteomics_msgfplus.wdl
1082 lines (928 loc) · 30.2 KB
/
proteomics_msgfplus.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
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
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
version 1.0
workflow proteomics_msgfplus {
meta {
author: "David Jimenez-Morales"
version: "v1.1.0"
task_labels: {
msgf_sequences: {
task_name: 'MSGF+ Process Sequence DB',
description: 'Preprocess the sequence database for MSGF+'
},
masic: {
task_name: 'MASIC',
description: 'Extract reporter ion peaks from MS2 spectra and create Selected Ion'
},
msconvert: {
task_name: 'MSConvert',
description: 'Convert Thermo .raw files to .mzML files (standard XML file format for MS data)'
},
msgf_tryptic: {
task_name: 'MSGF+ Full Tryptic Search',
description: 'Full tryptic search (for speed). Used in mzrefiner filter in MSConvert and PPMErrorCharter'
},
msconvert_mzrefiner: {
task_name: 'MSConvert (MZRefiner filter)',
description: 'Use mass error histograms to re-calibrate the m/z values in the .mzML file'
},
ppm_errorcharter: {
task_name: 'PPMErrorCharter',
description: 'Plot the mass error histograms before and after in silico recalibration'
},
msgf_identification: {
task_name: 'MS-GF+ Partial Tryptic Search',
description: 'Identify peptides using a partially tryptic search'
},
mzidtotsvconverter: {
task_name: 'mzID to TSV Converter',
description: 'Create a tab-separated value file listing peptide IDs required for PeptideHitResultsProcessor'
},
phrp: {
task_name: 'PeptideHitResultsProcessor',
description: 'Create tab-delimited files required for Ascore; files contain peptide IDs, unique sequence info, and residue modification details'
},
ascore: {
task_name: 'AScore',
description: 'Localize the position of Phosphorylation on S, T, and Y residues in phosphopeptides'
},
wrapper_pp: {
task_name: 'PlexedPiper',
description: 'Process isobaric labeling (e.g. TMT) proteomics data'
}
}
}
input { # Quantification method
String quant_method
# RAW INPUT FILES
Array[File] raw_file = []
String results_prefix
String species
# MASIC
Int masic_ncpu
Int masic_ramGB
String masic_docker
Int? masic_disk
Int masic_preemptible = 2
File masic_parameter
# MSCONVERT
Int msconvert_ncpu
Int msconvert_ramGB
String msconvert_docker
Int? msconvert_disk
Int msconvert_preemptible = 2
# MS-GF+ SHARED OPTIONS
Int msgf_ncpu
Int msgf_ramGB
String msgf_docker
Int? msgf_disk
Int msgf_preemptible = 2
File fasta_sequence_db
String sequence_db_name
# MS-GF+ TRYPTIC
File msgf_tryptic_mzrefinery_parameter
# MS-GF+ IDENTIFICATION
File msgf_identification_parameter
# PPMErrorCharter
String ppm_errorcharter_docker
# MzidToTSVConverter
String mzidtotsvconverter_docker
# PHRP
Int phrp_ncpu
Int phrp_ramGB
String phrp_docker
Int? phrp_disk
Int phrp_preemptible = 2
File phrp_parameter_m
File phrp_parameter_t
File phrp_parameter_n
Float phrp_synpvalue
Float phrp_synprob
# ASCORE (ONLY PTMs)
String? proteomics_experiment
Int? ascore_ncpu
Int? ascore_ramGB
String? ascore_docker
Int? ascore_disk
Int? ascore_preemptible = 2
File? ascore_parameter_p
# WRAPPER (PlexedPiper)
Int? wrapper_ncpu
Int? wrapper_ramGB
String? wrapper_docker
Int? wrapper_disk
Int? wrapper_preemptible = 2
File? sd_fractions
File? sd_references
File? sd_samples
File? pr_ratio #prioritized inference
Boolean? unique_only # Unique peptides only (default FALSE)
Boolean? refine_prior # Refine prior probabilities (default TRUE)
}
Boolean isPTM = proteomics_experiment != 'pr'
call msgf_sequences {
input:
ncpu = msgf_ncpu,
ramGB = msgf_ramGB,
docker = msgf_docker,
disks = msgf_disk,
fasta_sequence_db = fasta_sequence_db,
preemptible = msgf_preemptible
}
scatter (i in range(length(raw_file))) {
call masic {
input:
ncpu = masic_ncpu,
ramGB = masic_ramGB,
docker = masic_docker,
disks = masic_disk,
preemptible = masic_preemptible,
raw_file = raw_file[i],
masic_parameter = masic_parameter,
quant_method = quant_method
}
call msconvert {
input:
ncpu = msconvert_ncpu,
ramGB = msconvert_ramGB,
docker = msconvert_docker,
disks = msconvert_disk,
preemptible = msconvert_preemptible,
raw_file = raw_file[i]
}
call msgf_tryptic {
input:
ncpu = msgf_ncpu,
ramGB = msgf_ramGB,
docker = msgf_docker,
disks = msgf_disk,
preemptible = msgf_preemptible,
input_mzml = msconvert.mzml,
fasta_sequence_db = fasta_sequence_db,
sequencedb_files = msgf_sequences.sequencedb_files,
msgf_tryptic_mzrefinery_parameter = msgf_tryptic_mzrefinery_parameter
}
call msconvert_mzrefiner {
input:
ncpu = msconvert_ncpu,
ramGB = msconvert_ramGB,
docker = msconvert_docker,
disks = msconvert_disk,
preemptible = msconvert_preemptible,
input_mzml = msconvert.mzml,
input_mzid = msgf_tryptic.mzid
}
call ppm_errorcharter {
input:
ncpu = msconvert_ncpu,
ramGB = msconvert_ramGB,
docker = ppm_errorcharter_docker,
disks = msconvert_disk,
preemptible = msconvert_preemptible,
input_fixed_mzml = msconvert_mzrefiner.mzml_fixed,
input_mzid = msgf_tryptic.mzid
}
call msgf_identification {
input:
ncpu = msgf_ncpu,
ramGB = msgf_ramGB,
docker = msgf_docker,
disks = msgf_disk,
preemptible = msgf_preemptible,
input_fixed_mzml = msconvert_mzrefiner.mzml_fixed,
fasta_sequence_db = fasta_sequence_db,
sequencedb_files = msgf_sequences.sequencedb_files,
msgf_identification_parameter = msgf_identification_parameter
}
call mzidtotsvconverter {
input:
ncpu = msconvert_ncpu,
ramGB = msconvert_ramGB,
docker = mzidtotsvconverter_docker,
disks = msconvert_disk,
preemptible = msconvert_preemptible,
input_mzid_final = msgf_identification.mzid_final
}
call phrp {
input:
ncpu = phrp_ncpu,
ramGB = phrp_ramGB,
docker = phrp_docker,
disks = phrp_disk,
preemptible = phrp_preemptible,
input_tsv = mzidtotsvconverter.tsv,
phrp_parameter_m = phrp_parameter_m,
phrp_parameter_t = phrp_parameter_t,
phrp_parameter_n = phrp_parameter_n,
phrp_synpvalue = phrp_synpvalue,
phrp_synprob = phrp_synprob,
input_revcat_fasta = msgf_sequences.revcat_fasta
}
if (isPTM) {
call ascore {
input:
ncpu = select_first([ascore_ncpu]),
ramGB = select_first([ascore_ramGB]),
docker = select_first([ascore_docker]),
disks = ascore_disk,
preemptible = select_first([ascore_preemptible]),
input_syn = phrp.syn,
input_fixed_mzml = msgf_identification.rename_mzmlfixed,
ascore_parameter_p = select_first([ascore_parameter_p]),
fasta_sequence_db = fasta_sequence_db,
syn_ModSummary = phrp.syn_ModSummary
}
}
}
if (quant_method == "tmt") {
call wrapper_pp {
input:
ncpu = select_first([wrapper_ncpu]),
ramGB = select_first([wrapper_ramGB]),
docker = select_first([wrapper_docker]),
disks = wrapper_disk,
preemptible = select_first([wrapper_preemptible]),
fractions = select_first([sd_fractions]),
references = select_first([sd_references]),
samples = select_first([sd_samples]),
fasta_sequence_db = fasta_sequence_db,
sequence_db_name = sequence_db_name,
proteomics_experiment = select_first([proteomics_experiment]),
ReporterIons_output_file = masic.ReporterIons_output_file,
SICstats_output_file = masic.SICstats_output_file,
syn = phrp.syn,
syn_ascore = ascore.syn_ascore,
results_prefix = results_prefix,
pr_ratio = pr_ratio,
species = species,
unique_only = select_first([unique_only]),
refine_prior = select_first([refine_prior]),
isPTM = isPTM
}
}
output {
File? results_rii = wrapper_pp.results_rii
File? results_ratio = wrapper_pp.results_ratio
}
}
task msgf_sequences {
input {
Int ncpu
Int ramGB
String docker
Int? disks
Int preemptible
File fasta_sequence_db
String seq_file_id = basename(fasta_sequence_db, ".fasta")
}
# String output_full = output_msgf_tryptic + "/" + output_name
command <<<
echo "PRE-STEP: MSGF+ READY TO PROCES SEQUENCE DB"
# Generate sequence indexes
java -Xmx4000M -cp /app/MSGFPlus.jar edu.ucsd.msjava.msdbsearch.BuildSA \
-d ~{fasta_sequence_db} \
-tda 2 \
-o sequencedb_folder
# Compress results
tar -C sequencedb_folder -zcvf sequencedb_files.tar.gz .
>>>
output {
File sequencedb_files = "sequencedb_files.tar.gz"
File revcat_fasta = "sequencedb_folder/${seq_file_id}.revCat.fasta"
}
runtime {
docker: docker
memory: "${ramGB} GB"
cpu: ncpu
disks: "local-disk ${select_first([disks, 100])} HDD"
preemptible: preemptible
}
parameter_meta {
seq_file_id: {
type: "id"
}
fasta_sequence_db: {
type: "sequence_db"
}
}
}
task masic {
input {
Int ncpu
Int ramGB
Int? disks
String docker
Int preemptible
File masic_parameter
File raw_file
File? null
String quant_method
String sample_id = basename(raw_file, ".raw")
}
command <<<
echo "STEP 0: Ready to run MASIC"
mono /app/masic/MASIC_Console.exe \
/I:~{raw_file} \
/P:~{masic_parameter} \
/O:output_masic
>>>
output {
File? ReporterIons_output_file = if (quant_method == "tmt") then "output_masic/${sample_id}_ReporterIons.txt" else null
File? RepIonObsRate_output_png_file = if (quant_method == "tmt") then "output_masic/${sample_id}_RepIonObsRate.png" else null
File? RepIonObsRate_output_txt_file = if (quant_method == "tmt") then "output_masic/${sample_id}_RepIonObsRate.txt" else null
File? RepIonObsRateHighAbundance_output_file = if (quant_method == "tmt") then "output_masic/${sample_id}_RepIonObsRateHighAbundance.png" else null
File? RepIonStats_output_file = if (quant_method == "tmt") then "output_masic/${sample_id}_RepIonStats.txt" else null
File? RepIonStatsHighAbundance_output_file = if (quant_method == "tmt") then "output_masic/${sample_id}_RepIonStatsHighAbundance.png" else null
File PeakAreaHistogram_output_file = "output_masic/${sample_id}_PeakAreaHistogram.png"
File PeakWidthHistogram_output_file = "output_masic/${sample_id}_PeakWidthHistogram.png"
File DatasetInfo_output_file = "output_masic/${sample_id}_DatasetInfo.xml"
File ScanStats_output_file = "output_masic/${sample_id}_ScanStats.txt"
File MS_scans_output_file = "output_masic/${sample_id}_MS_scans.csv"
File MSMS_scans_output_file = "output_masic/${sample_id}_MSMS_scans.csv"
File ScanStatsEx_output_file = "output_masic/${sample_id}_ScanStatsEx.txt"
File SICstats_output_file = "output_masic/${sample_id}_SICstats.txt"
File ScanStatsConstant_output_file = "output_masic/${sample_id}_ScanStatsConstant.txt"
File SICs_output_file = "output_masic/${sample_id}_SICs.xml"
}
runtime {
docker: docker
memory: "${ramGB} GB"
cpu: ncpu
disks: "local-disk ${select_first([disks, 100])} HDD"
preemptible: preemptible
}
parameter_meta {
sample_id: {
type: "id"
}
masic_parameter : {
type: "parameter",
label: "MASIC Parameter File"
}
raw_file: {
label: ".RAW File"
}
}
}
task msconvert {
input {
Int ncpu
Int ramGB
Int? disks
String docker
Int preemptible
File raw_file
String sample_id = basename(raw_file, ".raw")
}
command <<<
echo "STEP 1: MSCONVERT - - - - - - - -"
wine msconvert ~{raw_file} \
--zlib \
--filter "peakPicking true 2-" \
-o output_msconvert
>>>
output {
File mzml = "output_msconvert/${sample_id}.mzML"
}
runtime {
docker: docker
memory: "${ramGB} GB"
cpu: ncpu
disks: "local-disk ${select_first([disks, 100])} HDD"
preemptible: preemptible
}
parameter_meta {
sample_id: {
type: "id"
}
raw_file: {
label: ".RAW File"
}
}
}
task msgf_tryptic {
input {
Int ncpu
Int ramGB
String docker
Int? disks
Int preemptible
File input_mzml
File fasta_sequence_db
File sequencedb_files
File msgf_tryptic_mzrefinery_parameter
String sample_id = basename(input_mzml, ".mzML")
}
String seq_file_id = basename(fasta_sequence_db, ".fasta")
command <<<
echo "STEP 2: MS-GF+ TRYPTIC SEARCH"
ls
echo "COPY FILES - - - - - - - - - -"
cp ~{sequencedb_files} .
ls
tar xvzf ~{sequencedb_files}
echo "MSGF+ BEGINs - - - - - - - - - -"
java -Xmx4000M \
-jar /app/MSGFPlus.jar \
-s ~{input_mzml} \
-o output_msgf_tryptic/~{sample_id}.mzid \
-d ~{seq_file_id}.fasta \
-conf ~{msgf_tryptic_mzrefinery_parameter}
echo "LIST RESULTS - - - - - - - - - -"
ls
echo "ADIOS - - - - - - - - - -"
>>>
output {
File mzid = "output_msgf_tryptic/${sample_id}.mzid"
}
runtime {
docker: docker
memory: "${ramGB} GB"
cpu: ncpu
disks: "local-disk ${select_first([disks, 100])} HDD"
preemptible: preemptible
}
parameter_meta {
sample_id: {
type: "id"
}
input_mzml: {
label: "mzML File"
}
fasta_sequence_db: {
type: "sequence_db"
}
sequencedb_files: {
label: "Processed Sequence Database Files"
}
msgf_tryptic_mzrefinery_parameter: {
type: "parameter",
label: "MzRefinery Parameter File"
}
}
}
task msconvert_mzrefiner {
input {
Int ncpu
Int ramGB
String docker
Int? disks
Int preemptible
File input_mzml
File input_mzid
String sample_id = basename(input_mzml, ".mzML")
}
# Create new output destination
String output_name = basename(input_mzml, ".mzML") + "_FIXED.mzML"
command <<<
echo "STEP 3A: MSCONVERT-MZREFINE"
wine msconvert ~{input_mzml} \
-o output_msconvert_mzrefiner \
--outfile output_msconvert_mzrefiner/~{output_name} \
--filter "mzRefiner ~{input_mzid} thresholdValue=-1e-10 thresholdStep=10 maxSteps=2" \
--zlib
# Check if the output_name exists. If it doesn't, create a copy of the input file with the output_name.
if [ ! -f output_msconvert_mzrefiner/~{output_name} ]; then
cp ~{input_mzml} output_msconvert_mzrefiner/~{output_name}
fi
>>>
output {
File mzml_fixed = "output_msconvert_mzrefiner/${output_name}"
}
runtime {
docker: docker
memory: "${ramGB} GB"
cpu: ncpu
disks: "local-disk ${select_first([disks, 100])} HDD"
preemptible: preemptible
}
parameter_meta {
sample_id: {
type: "id"
}
input_mzml: {
label: "mzML file"
}
input_mzid: {
label: "mzID file"
}
}
}
task ppm_errorcharter {
input {
Int ncpu
Int ramGB
String docker
Int? disks
Int preemptible
File input_fixed_mzml
File input_mzid
String sample_id = basename(input_mzid, ".mzid")
}
command <<<
echo "STEP 3B: PPMErrorCharter"
mono /app/PPMErrorCharterPython.exe \
-I:~{input_mzid} \
-F:~{input_fixed_mzml} \
-EValue:1E-10 \
-HistogramPlot:output_ppm_errorcharter/~{sample_id}-histograms.png \
-MassErrorPlot:output_ppm_errorcharter/~{sample_id}-masserrors.png \
-Python
>>>
output {
File ppm_histogram_png = "output_ppm_errorcharter/${sample_id}-histograms.png"
File ppm_masserror_png = "output_ppm_errorcharter/${sample_id}-masserrors.png"
}
runtime {
docker: docker
memory: "${ramGB} GB"
cpu: ncpu
disks: "local-disk ${select_first([disks, 100])} HDD"
preemptible: preemptible
}
parameter_meta {
sample_id: {
type: "id"
}
input_fixed_mzml: {
label: "Fixed mzML file"
}
input_mzid: {
label: "mzID file"
}
}
}
task msgf_identification {
input {
Int ncpu
Int ramGB
String docker
Int? disks
Int preemptible
File input_fixed_mzml
File fasta_sequence_db
File sequencedb_files
File msgf_identification_parameter
}
# Create new output destination
String sample_id = basename(input_fixed_mzml, "_FIXED.mzML")
String seq_file_id = basename(fasta_sequence_db, ".fasta")
command <<<
echo "STEP 4: MS-GF+ IDENTIFICATION SEARCH - - - - - - - - - -"
ls
echo "COPY FILES - - - - - - - - - -"
cp ~{sequencedb_files} .
ls
tar xvzf ~{sequencedb_files}
echo "Rename *_FIXED.mzML to *.mzML"
cp ~{input_fixed_mzml} ~{sample_id}.mzML
echo "MSGF+ IDENTIFICATION BEGINs - - - - - - - - - -"
java -Xmx4000M \
-jar /app/MSGFPlus.jar \
-s ~{sample_id}.mzML \
-o output_msgf_identification/~{sample_id}_final.mzid \
-d ~{seq_file_id}.fasta \
-conf ~{msgf_identification_parameter}
cp ~{sample_id}.mzML output_msgf_identification/~{sample_id}.mzML
echo "LIST RESULTS - - - - - - - - - -"
ls -lR
echo "ADIOS - - - - - - - - - -"
>>>
output {
File mzid_final = "output_msgf_identification/${sample_id}_final.mzid"
File rename_mzmlfixed = "output_msgf_identification/${sample_id}.mzML"
}
runtime {
docker: docker
memory: "${ramGB} GB"
cpu: ncpu
disks: "local-disk ${select_first([disks, 100])} HDD"
preemptible: preemptible
}
parameter_meta {
input_fixed_mzml: {
label: "Fixed mzML file"
}
fasta_sequence_db: {
type: "sequence_db"
}
sequencedb_files: {
label: "Processed Sequence Database Files"
}
msgf_identification_parameter: {
type: "parameter",
label: "MSGF+ Identification Parameter File"
}
}
}
task mzidtotsvconverter {
input {
Int ncpu
Int ramGB
String docker
Int? disks
Int preemptible
File input_mzid_final
String sample_id = basename(input_mzid_final, "_final.mzid")
}
# Create new output destination
String output_name = basename(input_mzid_final, "_final.mzid") + ".tsv"
command <<<
echo "STEP 5:: MzidToTSVConverter"
mono /app/mzid2tsv/net462/MzidToTsvConverter.exe \
-mzid:~{input_mzid_final} \
-tsv:output_mzidtotsvconverter/~{output_name} \
-unroll -showDecoy
>>>
output {
File tsv = "output_mzidtotsvconverter/${sample_id}.tsv"
}
runtime {
docker: docker
memory: "${ramGB} GB"
cpu: ncpu
disks: "local-disk ${select_first([disks, 100])} HDD"
preemptible: preemptible
}
parameter_meta {
sample_id: {
type: "id"
}
input_mzid_final: {
label: "mzID file"
}
}
}
task phrp {
input {
Int ncpu
Int ramGB
String docker
Int? disks
Int preemptible
File input_tsv
File phrp_parameter_m
File phrp_parameter_t
File phrp_parameter_n
Float phrp_synpvalue
Float phrp_synprob
File input_revcat_fasta
String sample_id = basename(input_tsv, ".tsv")
}
# Create new output destination
String phrp_logfile = basename(input_tsv, ".tsv") + "_PHRP_LogFile.txt"
command <<<
echo "STEP 6: PeptideHitResultsProcRunner"
mono /app/phrp/PeptideHitResultsProcRunner.exe \
-I:~{input_tsv} \
-O:output_phrp \
-M:~{phrp_parameter_m} \
-T:~{phrp_parameter_t} \
-N:~{phrp_parameter_n} \
-SynPvalue:~{phrp_synpvalue} \
-SynProb:~{phrp_synprob} \
-L:output_phrp/~{phrp_logfile} \
-ProteinMods \
-F:~{input_revcat_fasta}
>>>
output {
File PepToProtMapMTS = "output_phrp/${sample_id}_PepToProtMapMTS.txt"
File fht = "output_phrp/${sample_id}_fht.txt"
File syn = "output_phrp/${sample_id}_syn.txt"
File syn_ModDetails = "output_phrp/${sample_id}_syn_ModDetails.txt"
File syn_ModSummary = "output_phrp/${sample_id}_syn_ModSummary.txt"
File syn_ProteinMods = "output_phrp/${sample_id}_syn_ProteinMods.txt"
File syn_ResultToSeqMap = "output_phrp/${sample_id}_syn_ResultToSeqMap.txt"
File syn_SeqInfo = "output_phrp/${sample_id}_syn_SeqInfo.txt"
File syn_SeqToProteinMap = "output_phrp/${sample_id}_syn_SeqToProteinMap.txt"
File phrp_log_file = "output_phrp/${phrp_logfile}"
}
runtime {
docker: docker
memory: "${ramGB} GB"
cpu: ncpu
disks: "local-disk ${select_first([disks, 100])} HDD"
preemptible: "${preemptible}"
}
parameter_meta {
sample_id: {
type: "id"
}
input_tsv: {
label: "Processed TSV File"
}
input_revcat_fasta: {
label: "RevCat FASTA File"
}
phrp_parameter_m: {
type: "parameter",
label: "PHRP Parameter File"
}
phrp_parameter_t: {
type: "parameter",
label: "PHRP Parameter File"
}
phrp_parameter_n: {
type: "parameter",
label: "PHRP Parameter File"
}
}
}
task ascore {
input {
Int ncpu
Int ramGB
String docker
Int? disks
Int preemptible
File input_syn
File input_fixed_mzml
File ascore_parameter_p
File fasta_sequence_db
File syn_ModSummary
}
# Create new output destination
String seq_file_id = basename(input_syn, "_syn.txt")
String ascore_logfile = "${seq_file_id}_ascore_LogFile.txt"
command <<<
echo "STEP 7 (PTM): Ascore"
mono /app/ascore/AScore_Console.exe \
-T:msgfplus \
-F:~{input_syn} \
-D:~{input_fixed_mzml} \
-MS:~{syn_ModSummary} \
-P:~{ascore_parameter_p} \
-U:~{seq_file_id}_syn_plus_ascore.txt \
-O:output_ascore \
-Fasta:~{fasta_sequence_db} \
-L:output_ascore/~{ascore_logfile}
>>>
output {
File syn_ascore = "output_ascore/${seq_file_id}_syn_ascore.txt"
File syn_plus_ascore = "output_ascore/${seq_file_id}_syn_plus_ascore.txt"
File syn_ascore_proteinmap = "output_ascore/${seq_file_id}_syn_ascore_ProteinMap.txt"
File output_ascore_logfile = "output_ascore/${ascore_logfile}"
}
runtime {
docker: docker
memory: "${ramGB} GB"
cpu: ncpu
disks: "local-disk ${select_first([disks, 100])} HDD"
preemptible: "${preemptible}"
}
parameter_meta {
input_syn: {
label: "PHRP Syn File"
}
input_fixed_mzml: {
label: "Fixed MZML File"
}
ascore_parameter_p: {
type: "parameter",
label: "AScore Parameter File"
}
fasta_sequence_db: {
type: "sequnce_db"
}
syn_ModSummary: {
type: "parameter",
label: "AScore Parameter File"
}
}
}
task wrapper_pp {
input {
File? null
Int ncpu
Int ramGB
String docker
Int? disks
Int preemptible
Boolean isPTM
File samples
File fractions
File references
File fasta_sequence_db
String sequence_db_name
String proteomics_experiment
String results_prefix
File? pr_ratio
String species
Boolean unique_only
Boolean refine_prior
# MASIC
Array[File?] ReporterIons_output_file = []
Array[File] SICstats_output_file = []
# #PHRP
Array[File] syn = []
# #ASCORE
Array[File?] syn_ascore = []
}
Array[File] ReporterIons_output_file_nonnull = select_all(ReporterIons_output_file)
Array[File] syn_ascore_nonnull = select_all(syn_ascore)
command <<<
echo "FINAL-STEP: COPY ALL THE FILES TO THE SAME PLACE"
echo "MASIC"
mkdir final_output_masic
cp ~{sep=" " ReporterIons_output_file_nonnull} final_output_masic
cp ~{sep=" " SICstats_output_file} final_output_masic
tar -C final_output_masic -zcvf final_output_masic.tar.gz .
echo "PHRP"
mkdir final_output_phrp
cp ~{sep=" " syn} final_output_phrp
tar -C final_output_phrp -zcvf final_output_phrp.tar.gz .
if ~{isPTM}
then
echo "ASCORE"
mkdir final_output_ascore
cp ~{sep=" " syn_ascore_nonnull} final_output_ascore
tar -C final_output_ascore -zcvf final_output_ascore.tar.gz .
fi
echo "STUDY DESIGN FOLDER"
mkdir study_design
cp ~{samples} study_design
cp ~{fractions} study_design
cp ~{references} study_design
if ~{isPTM}; then
Rscript /app/pp.R \
-p ~{proteomics_experiment} \
-i final_output_phrp \
-a final_output_ascore \
-j final_output_masic \
-f ~{fasta_sequence_db} \