-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathftdmp-all
executable file
·1285 lines (1135 loc) · 42.8 KB
/
ftdmp-all
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
#!/bin/bash
function print_help_and_exit
{
cat >&2 << 'EOF'
'ftdmp-all' docks, scores and ranks complex structures of proteins or nucleic acids
Options:
--job-name string * job name
--pre-docked-input-dir string path to directory that contains pre-docked multimeric structures in PDB format
--static-file string hetero docking static input file path
--static-sel string hetero docking query to restrict static atoms, default is '[]'
--static-chain string hetero docking chain name or chain renaming rule to apply for static atoms, default is ''
--static-rotation-seed number random seed to initially rotate static part, default is 1
--mobile-file string hetero or homo docking mobile input file path
--mobile-sel string hetero or homo docking query to restrict mobile atoms, default is '[]'
--mobile-chain string hetero or homo docking chain name or chain renaming rule to apply for mobile atoms, default is ''
--mobile-rotation-seed number random seed to initially rotate mobile part, default is 2
--symmetry-docking string homo docking symmetry to apply for the mobile input file, default is ''
--subselect-contacts string query to subselect inter-chain contacts for scoring, default is '[]'
--constraints-required string query to check required inter-chain contacts, default is ''
--constraints-banned string query to check banned inter-chain contacts, default is ''
--constraint-clashes number max allowed clash score, default is ''
--reference string input structure file to compute CAD-score with, default is ''
--openmm-forcefield string forcefield name for OpenMM-based operations, default is ''
--ftdmp-root string ftdmp root path, default is '' (autodetected from the calling command)
--conda-path string conda installation path, default is ''
--conda-early string flag to activate conda as early as possible
--conda-env string conda main environment name, default is ''
--conda-env-for-gnn string conda GNN environment name, equals the main environment name if not set
--sam-parameters string additional SAM parameters, default is '-top=8000 -show=2000 -clusters=2000'
--use-ftdock string flag to use ftdock, default is 'true'
--use-hex string flag to use HEX, default is 'false'
--ftdock-keep number ftdock keep parameter, default is 1
--ftdock-angle-step number ftdock angle step parameter, default is 9
--ftdock-min-grid-sep number minimum grid separation between same-rotation translations, default is 20
--hex-macro-mode string flag to enable HEX macro mode, default is 'true'
--hex-max-solutions number max number of docking solutions for HEX, default is 10000
--hex-script string semicolon-sparated additional commands for HEX, default is ''
--hex-swap-and-repeat string flag to run HEX twice with monomers swapped, default is 'false'
--reuse-ftdock-results string path to directly input ftdock docking results file and avoid running ftdock, default is ''
--reuse-hex-results string path to directly input hex docking results file and avoid running hex, default is ''
--parallel-docking number number of processes to run when docking, default is 8
--parallel-scoring number number of processes to run when scoring, default is 8
--cache-dir string cache directory path to store results of past slower calculations
--sbatch-for-ftdock string sbatch parameters to run docking with ftdock in parallel, default is ''
--sbatch-for-hex-or-sam string sbatch parameters to run docking with HEX or SAM on cluster, default is ''
--sbatch-scoring string sbatch parameters to run scoring in parallel, default is ''
--score-symmetry string flag to score symmetry, default is 'false'
--local-columns string flag to add per-residue scores to the global output table, default is 'false'
--remap-cadscore string flag to use optimal chains remapping for CAD-score, default is 'false'
--geom-hash-to-simplify number number of instances per rotation to keep after first scoring, default is 0 to not do it
--scoring-full-top number number of top complexes to keep after full scoring stage, default is 1000
--scoring-full-top-slow number number of top complexes to keep before slow full scoring stage, default is 9999999
--scoring-rank-names string * rank names to use, or name of a standard set of rank names
--scoring-rank-names-x string extra rank names to use, default is 'all_plugin' to use plugin output columns (if any)
--only-extra-in-jury string flag to only use extra rank names in jury stage
--scoring-ranks-top number number of top complexes to consider for each ranking, default is 100
--scoring-jury-slices string slice sizes sequence definition for ranks jury scoring, default is '5 20'
--scoring-jury-cluster number clustering threshold for ranks jury scoring, default is 0.9
--scoring-jury-maxs number number of max values to use for ranks jury scoring, default is 1
--redundancy-threshold number minimal ordered redundancy value to accept, default is 0.9
--plugin-scoring-script string path to executable script that outputs a table of scores for a PDB structure
--build-complexes number number of top complexes to build, default is 0
--multiply-chains string options to multiply chains, default is ''
--relax-complexes string options to relax complexes, default is ''
--all-ranks-for-relaxed string flag to use both scoring ranks of both raw and relaxed structures, default is 'true'
--only-dock-and-score string flag to only dock, score and quit after scoring, default is 'false'
--diversify number step of CAD-score to diversify scoring results and exit, default is ''
--plot-jury-scores string flag to output plot of jury scores, default is 'false'
--casp15-qa string flag to output CASP15 QA answer, default is 'false'
--casp15-qa-target string target name for outputting CASP15 QA answer, default is '_THETARGET_'
--casp15-qa-author-id string author ID for outputting CASP15 QA answer, default is '_THEAUTHOR_'
--output-dir string * output directory path
--help | -h flag to display help message and exit
Output:
All the docking and scoring results are placed into directory "${output_dir}/${jobname}"
Main results for raw (unrelaxed) complex models:
final ordered table with VoroIF-jury scores = "${output_dir}/${jobname}/raw_top_scoring_results_RJS_only.txt"
directory with built top complex models in PDB format = "${output_dir}/${jobname}/raw_top_complexes"
Main results for relaxed complex models:
directory with built and relaxed top complex models in PDB format = "${output_dir}/${jobname}/relaxed_top_complexes"
final ordered table with VoroIF-jury scores = "${output_dir}/${jobname}/relaxed_top_scoring_results_RJS_only.txt"
Examples:
ftdmp-all --job-name 'j1' --static-file './chainA.pdb' --mobile-file './chainB.pdb' \
--scoring-rank-names 'protein_protein_voromqa_and_global_and_gnn_no_sr' --output-dir './results'
ftdmp-all --job-name 'j2' --pre-docked-input-dir './predocked' \
--scoring-rank-names 'protein_protein_voromqa_and_gnn_no_sr' --output-dir './results'
Named collections of rank names, to be provided as a single string to '--scoring-rank-names':
protein_protein_voromqa_and_global_and_gnn_no_sr
protein_protein_voromqa_and_global_and_gnn_with_sr
protein_protein_voromqa_and_gnn_no_sr
protein_protein_voromqa_and_gnn_with_sr
protein_protein_voromqa_no_sr
protein_protein_voromqa_with_sr
protein_protein_simplest_voromqa
generalized_voromqa
EOF
exit 1
}
################################################################################
if [ -z "$1" ]
then
print_help_and_exit
fi
echo >&2 "ftdpm-all: reading and checking options"
JOB_NAME=""
PRE_DOCKED_INPUT_DIR=""
STATIC_STRUCTURE_FILE=""
STATIC_STRUCTURE_SELECTION="[]"
STATIC_STRUCTURE_CHAIN=""
STATIC_STRUCTURE_ROTATION_SEED="1"
MOBILE_STRUCTURE_FILE=""
MOBILE_STRUCTURE_SELECTION="[]"
MOBILE_STRUCTURE_CHAIN=""
MOBILE_STRUCTURE_ROTATION_SEED="2"
SYMMETRY_DOCKING=""
INTERFACE_SUBSELECTION="[]"
CONSTRAINTS_REQUIRED=""
CONSTRAINTS_BANNED=""
CONSTRAINT_CLASHES=""
REFERENCE_STRUCTURE_FILE_FOR_COMPARISON=""
OPENMM_FORCEFIELD=""
FTDMP_ROOT=""
CONDA_PATH=""
CONDA_EARLY="false"
CONDA_ENV=""
CONDA_ENV_FOR_GNN=""
SAM_PARAMETERS="-top=8000 -show=2000 -clusters=2000"
USE_FTDOCK="true"
USE_HEX="false"
FTDOCK_KEEP="1"
FTDOCK_ANGLE_STEP="9"
FTDOCK_MIN_GRID_SEP="20"
HEX_MACRO_MODE="true"
HEX_MAX_SOLUTIONS="10000"
HEX_SCRIPT=""
HEX_SWAP_AND_REPEAT="false"
REUSE_FTDOCK_DOCKING_RESULTS=""
REUSE_HEX_DOCKING_RESULTS=""
DOCKING_PROCESSORS="8"
SCORING_PROCESSORS="8"
CACHE_DIR=""
DOCKING_SBATCH_FOR_FTDOCK=""
DOCKING_SBATCH_FOR_HEX_OR_SAM=""
SCORING_SBATCH=""
SCORE_SYMMETRY="false"
LOCAL_COLUMNS="false"
REMAP_CADSCORE="false"
GEOM_HASH_MAX_PRESENCE="0"
SCORING_TOP_STAGE1="1000"
SCORING_TOP_STAGE1_FOR_SLOW="9999999"
SCORING_RANKS=""
EXTRA_SCORING_RANKS="all_plugin"
ONLY_EXTRA_SCORING_IN_JURY="false"
SCORING_TOP_STAGE2="100"
SCORING_RANKS_JURY_SLICES="5 20"
SCORING_RANKS_JURY_CLUSTER="0.9"
SCORING_RANKS_JURY_MAX_VALUES="1"
PLUGIN_SCORING_SCRIPT=""
NUMBER_OF_COMPLEXES_TO_BUILD="0"
REDUNDANCY_THRESHOLD="0.9"
MULTIPLY_CHAINS=""
RELAX_COMPLEXES=""
ALL_RANKS_FOR_RELAXED="true"
ONLY_DOCK_AND_SCORE="false"
DIVERSIFY=""
PLOT_JURY_SCORES="false"
CASP15QA="false"
CASP15QA_TARGET="_THETARGET_"
CASP15QA_AUTHOR="_THEAUTHOR_"
OUTPUT_PATH=""
HELP_MODE="false"
while [[ $# > 0 ]]
do
OPTION="$1"
OPTARG="$2"
shift
case $OPTION in
--job-name)
JOB_NAME="$OPTARG"
shift
;;
--pre-docked-input-dir)
PRE_DOCKED_INPUT_DIR="$OPTARG"
shift
;;
--static-file)
STATIC_STRUCTURE_FILE="$OPTARG"
shift
;;
--static-sel)
STATIC_STRUCTURE_SELECTION="$OPTARG"
shift
;;
--static-chain)
STATIC_STRUCTURE_CHAIN="$OPTARG"
shift
;;
--static-rotation-seed)
STATIC_STRUCTURE_ROTATION_SEED="$OPTARG"
shift
;;
--mobile-file)
MOBILE_STRUCTURE_FILE="$OPTARG"
shift
;;
--mobile-sel)
MOBILE_STRUCTURE_SELECTION="$OPTARG"
shift
;;
--mobile-chain)
MOBILE_STRUCTURE_CHAIN="$OPTARG"
shift
;;
--mobile-rotation-seed)
MOBILE_STRUCTURE_ROTATION_SEED="$OPTARG"
shift
;;
--symmetry-docking)
SYMMETRY_DOCKING="$OPTARG"
shift
;;
--subselect-contacts)
INTERFACE_SUBSELECTION="$OPTARG"
shift
;;
--constraints-required)
CONSTRAINTS_REQUIRED="$OPTARG"
shift
;;
--constraints-banned)
CONSTRAINTS_BANNED="$OPTARG"
shift
;;
--constraint-clashes)
CONSTRAINT_CLASHES="$OPTARG"
shift
;;
--reference)
REFERENCE_STRUCTURE_FILE_FOR_COMPARISON="$OPTARG"
shift
;;
--openmm-forcefield)
OPENMM_FORCEFIELD="$OPTARG"
shift
;;
--ftdmp-root)
FTDMP_ROOT="$OPTARG"
shift
;;
--conda-path)
CONDA_PATH="$OPTARG"
shift
;;
--conda-early)
CONDA_EARLY="$OPTARG"
shift
;;
--conda-env)
CONDA_ENV="$OPTARG"
CONDA_ENV_FOR_GNN="$OPTARG"
shift
;;
--conda-env-for-gnn)
CONDA_ENV_FOR_GNN="$OPTARG"
shift
;;
--sam-parameters)
SAM_PARAMETERS="$OPTARG"
shift
;;
--use-ftdock)
USE_FTDOCK="$OPTARG"
shift
;;
--use-hex)
USE_HEX="$OPTARG"
shift
;;
--ftdock-keep)
FTDOCK_KEEP="$OPTARG"
shift
;;
--ftdock-angle-step)
FTDOCK_ANGLE_STEP="$OPTARG"
shift
;;
--ftdock-min-grid-sep)
FTDOCK_MIN_GRID_SEP="$OPTARG"
shift
;;
--hex-macro-mode)
HEX_MACRO_MODE="$OPTARG"
shift
;;
--hex-max-solutions)
HEX_MAX_SOLUTIONS="$OPTARG"
shift
;;
--hex-script)
HEX_SCRIPT="$OPTARG"
shift
;;
--hex-swap-and-repeat)
HEX_SWAP_AND_REPEAT="$OPTARG"
shift
;;
--reuse-ftdock-results)
REUSE_FTDOCK_DOCKING_RESULTS="$OPTARG"
shift
;;
--reuse-hex-results)
REUSE_HEX_DOCKING_RESULTS="$OPTARG"
shift
;;
--parallel-docking)
DOCKING_PROCESSORS="$OPTARG"
shift
;;
--parallel-scoring)
SCORING_PROCESSORS="$OPTARG"
shift
;;
--cache-dir)
CACHE_DIR="$OPTARG"
shift
;;
--sbatch-for-ftdock)
DOCKING_SBATCH_FOR_FTDOCK="$OPTARG"
shift
;;
--sbatch-for-hex-or-sam)
DOCKING_SBATCH_FOR_HEX_OR_SAM="$OPTARG"
shift
;;
--sbatch-scoring)
SCORING_SBATCH="$OPTARG"
shift
;;
--score-symmetry)
SCORE_SYMMETRY="$OPTARG"
shift
;;
--local-columns)
LOCAL_COLUMNS="$OPTARG"
shift
;;
--remap-cadscore)
REMAP_CADSCORE="$OPTARG"
shift
;;
--geom-hash-to-simplify)
GEOM_HASH_MAX_PRESENCE="$OPTARG"
shift
;;
--scoring-full-top)
SCORING_TOP_STAGE1="$OPTARG"
shift
;;
--scoring-full-top-slow)
SCORING_TOP_STAGE1_FOR_SLOW="$OPTARG"
shift
;;
--scoring-rank-names)
SCORING_RANKS="$OPTARG"
shift
;;
--scoring-rank-names-x)
EXTRA_SCORING_RANKS="$OPTARG"
shift
;;
--only-extra-in-jury)
ONLY_EXTRA_SCORING_IN_JURY="$OPTARG"
shift
;;
--scoring-ranks-top)
SCORING_TOP_STAGE2="$OPTARG"
shift
;;
--scoring-jury-slices)
SCORING_RANKS_JURY_SLICES="$OPTARG"
shift
;;
--scoring-jury-cluster)
SCORING_RANKS_JURY_CLUSTER="$OPTARG"
shift
;;
--scoring-jury-maxs)
SCORING_RANKS_JURY_MAX_VALUES="$OPTARG"
shift
;;
--plugin-scoring-script)
PLUGIN_SCORING_SCRIPT="$OPTARG"
shift
;;
--build-complexes)
NUMBER_OF_COMPLEXES_TO_BUILD="$OPTARG"
shift
;;
--redundancy-threshold)
REDUNDANCY_THRESHOLD="$OPTARG"
shift
;;
--multiply-chains)
MULTIPLY_CHAINS="$OPTARG"
shift
;;
--relax-complexes)
RELAX_COMPLEXES="$OPTARG"
shift
;;
--all-ranks-for-relaxed)
ALL_RANKS_FOR_RELAXED="$OPTARG"
shift
;;
--only-dock-and-score)
ONLY_DOCK_AND_SCORE="$OPTARG"
shift
;;
--diversify)
DIVERSIFY="$OPTARG"
shift
;;
--plot-jury-scores )
PLOT_JURY_SCORES="$OPTARG"
shift
;;
--casp15-qa)
CASP15QA="$OPTARG"
shift
;;
--casp15-qa-target)
CASP15QA_TARGET="$OPTARG"
shift
;;
--casp15-qa-author-id)
CASP15QA_AUTHOR="$OPTARG"
shift
;;
--output-dir)
OUTPUT_PATH="$OPTARG"
shift
;;
-h|--help)
HELP_MODE="true"
;;
*)
echo >&2 "Error: invalid command line option '$OPTION'"
exit 1
;;
esac
done
if [ "$HELP_MODE" == "true" ]
then
print_help_and_exit
fi
[ -n "$JOB_NAME" ] || { echo >&2 "Error: job name not provided"; exit 1;}
DOCKING_REGIME=""
if [ -n "$PRE_DOCKED_INPUT_DIR" ]
then
[ -d "$PRE_DOCKED_INPUT_DIR" ] || { echo >&2 "Error: invalid pre-docked files input directory '$PRE_DOCKED_INPUT_DIR'"; exit 1;}
[ "$(find $PRE_DOCKED_INPUT_DIR -type f -not -empty | wc -l)" -gt "1" ] || { echo >&2 "Error: pre-docked files input directory '$PRE_DOCKED_INPUT_DIR' does not contain more than 1 file"; exit 1;}
[ -z "$SYMMETRY_DOCKING" ] || { echo >&2 "Error: docking symmetry provided in pre-docked mode"; exit 1;}
[ -z "$STATIC_STRUCTURE_FILE" ] || { echo >&2 "Error: static structure file provided in pre-docked mode"; exit 1;}
[ -z "$MOBILE_STRUCTURE_FILE" ] || { echo >&2 "Error: mobile structure file not provided in pre-docked mode"; exit 1;}
DOCKING_REGIME="pre-docked"
else
if [ -n "$SYMMETRY_DOCKING" ]
then
[ -z "$STATIC_STRUCTURE_FILE" ] || { echo >&2 "Error: static structure file provided in homo docking mode"; exit 1;}
[ -n "$MOBILE_STRUCTURE_FILE" ] || { echo >&2 "Error: mobile structure file not provided in homo docking mode"; exit 1;}
[ -s "$MOBILE_STRUCTURE_FILE" ] || { echo >&2 "Error: mobile structure file non-existing or empty in homo docking mode"; exit 1;}
[ -n "$MOBILE_STRUCTURE_SELECTION" ] || { echo >&2 "Error: mobile structure selection not defined in homo docking mode"; exit 1;}
DOCKING_REGIME="homo"
else
[ -n "$STATIC_STRUCTURE_FILE" ] || { echo >&2 "Error: static structure file not provided in hetero docking mode"; exit 1;}
[ -s "$STATIC_STRUCTURE_FILE" ] || { echo >&2 "Error: static structure file non-existing or empty in hetero docking mode"; exit 1;}
[ -n "$STATIC_STRUCTURE_SELECTION" ] || { echo >&2 "Error: static structure selection not defined in hetero docking mode"; exit 1;}
[ -n "$MOBILE_STRUCTURE_FILE" ] || { echo >&2 "Error: mobile structure file not provided in hetero docking mode"; exit 1;}
[ -s "$MOBILE_STRUCTURE_FILE" ] || { echo >&2 "Error: mobile structure file non-existing or empty in hetero docking mode"; exit 1;}
[ -n "$MOBILE_STRUCTURE_SELECTION" ] || { echo >&2 "Error: mobile structure selection not defined in hetero docking mode"; exit 1;}
DOCKING_REGIME="hetero"
fi
fi
[ -n "$INTERFACE_SUBSELECTION" ] || { echo >&2 "Error: contacts subselection not defined"; exit 1; }
[ -n "$SCORING_RANKS" ] || { echo >&2 "Error: scoring rank names not provided"; exit 1;}
[ -n "$SCORING_RANKS_JURY_SLICES" ] || { echo >&2 "Error: scoring ranks jury slices not defined"; exit 1;}
[ -n "$OUTPUT_PATH" ] || { echo >&2 "Error: output path not provided"; exit 1;}
################################################################################
if [ "$SCORING_RANKS" == "generalized_voromqa" ]
then
SCORING_RANKS="
raw_FIVb_iface_energy_rank
raw_FIVb_energy_clash_tour_rank
"
fi
if [ "$SCORING_RANKS" == "protein_protein_simplest_voromqa" ]
then
SCORING_RANKS="
raw_FIV_iface_energy_rank
raw_FIV_energy_clash_tour_rank
"
fi
if [ "$SCORING_RANKS" == "protein_protein_voromqa_no_sr" ]
then
SCORING_RANKS="
raw_FIV_iface_energy_rank
raw_FIV_energy_clash_tour_rank
raw_FIVb_iface_energy_rank
raw_FIVb_energy_clash_tour_rank
"
fi
if [ "$SCORING_RANKS" == "protein_protein_voromqa_with_sr" ]
then
SCORING_RANKS="
raw_FIV_iface_energy_rank
raw_FIV_energy_clash_tour_rank
raw_FIVb_iface_energy_rank
raw_FIVb_energy_clash_tour_rank
raw_FIV_sr_iface_energy_rank
raw_FIV_sr_energy_clash_tour_rank
raw_FIVb_sr_iface_energy_rank
raw_FIVb_sr_energy_clash_tour_rank
"
fi
if [ "$SCORING_RANKS" == "protein_protein_voromqa_and_gnn_no_sr" ]
then
SCORING_RANKS="
raw_FIV_iface_energy_rank
raw_FIV_energy_clash_tour_rank
raw_FIVb_iface_energy_rank
raw_FIVb_energy_clash_tour_rank
raw_FIGNN_sum_of_gnn_scores_rank
raw_FIGNN_average_gnn_score_rank
raw_FIGNN_gnn_scores_tour_rank
raw_FIGNN_average_pcadscore_rank
raw_FIGNN_weighted_average_pcadscore_rank
raw_FIGNN_sum_of_gnn_scores_clash_tour_rank
raw_FIGNN_sum_of_gnn_scores_FIV_energy_tour_rank
raw_FIGNN_avg_gnn_score_FIV_energy_tour_rank
raw_FIGNN_wavg_pcadscore_FIV_energy_tour_rank
raw_FIGNN_sum_of_gnn_scores_FIVb_energy_tour_rank
raw_FIGNN_avg_gnn_score_FIVb_energy_tour_rank
raw_FIGNN_wavg_pcadscore_FIVb_energy_tour_rank
"
fi
if [ "$SCORING_RANKS" == "protein_protein_voromqa_and_gnn_with_sr" ]
then
SCORING_RANKS="
raw_FIV_iface_energy_rank
raw_FIV_energy_clash_tour_rank
raw_FIVb_iface_energy_rank
raw_FIVb_energy_clash_tour_rank
raw_FIGNN_sum_of_gnn_scores_rank
raw_FIGNN_average_gnn_score_rank
raw_FIGNN_gnn_scores_tour_rank
raw_FIGNN_average_pcadscore_rank
raw_FIGNN_weighted_average_pcadscore_rank
raw_FIGNN_sum_of_gnn_scores_clash_tour_rank
raw_FIGNN_sum_of_gnn_scores_FIV_energy_tour_rank
raw_FIGNN_avg_gnn_score_FIV_energy_tour_rank
raw_FIGNN_wavg_pcadscore_FIV_energy_tour_rank
raw_FIGNN_sum_of_gnn_scores_FIVb_energy_tour_rank
raw_FIGNN_avg_gnn_score_FIVb_energy_tour_rank
raw_FIGNN_wavg_pcadscore_FIVb_energy_tour_rank
raw_FIV_sr_iface_energy_rank
raw_FIV_sr_energy_clash_tour_rank
raw_FIVb_sr_iface_energy_rank
raw_FIVb_sr_energy_clash_tour_rank
raw_FIGNN_sr_sum_of_gnn_scores_rank
raw_FIGNN_sr_average_gnn_score_rank
raw_FIGNN_sr_gnn_scores_tour_rank
raw_FIGNN_sr_average_pcadscore_rank
raw_FIGNN_sr_weighted_average_pcadscore_rank
raw_FIGNN_sr_sum_of_gnn_scores_clash_tour_rank
raw_FIGNN_sr_sum_of_gnn_scores_FIV_sr_energy_tour_rank
raw_FIGNN_sr_avg_gnn_score_FIV_sr_energy_tour_rank
raw_FIGNN_sr_wavg_pcadscore_FIV_sr_energy_tour_rank
raw_FIGNN_sr_sum_of_gnn_scores_FIVb_sr_energy_tour_rank
raw_FIGNN_sr_avg_gnn_score_FIVb_sr_energy_tour_rank
raw_FIGNN_sr_wavg_pcadscore_FIVb_sr_energy_tour_rank
"
fi
if [ "$SCORING_RANKS" == "protein_protein_voromqa_and_global_and_gnn_no_sr" ]
then
SCORING_RANKS="
raw_FIV_iface_energy_rank
raw_FIV_energy_clash_tour_rank
raw_FIVb_iface_energy_rank
raw_FIVb_energy_clash_tour_rank
raw_FIGNN_sum_of_gnn_scores_rank
raw_FIGNN_average_gnn_score_rank
raw_FIGNN_gnn_scores_tour_rank
raw_FIGNN_average_pcadscore_rank
raw_FIGNN_weighted_average_pcadscore_rank
raw_FIGNN_sum_of_gnn_scores_clash_tour_rank
raw_FIGNN_sum_of_gnn_scores_FIV_energy_tour_rank
raw_FIGNN_avg_gnn_score_FIV_energy_tour_rank
raw_FIGNN_wavg_pcadscore_FIV_energy_tour_rank
raw_FIGNN_sum_of_gnn_scores_FIVb_energy_tour_rank
raw_FIGNN_avg_gnn_score_FIVb_energy_tour_rank
raw_FIGNN_wavg_pcadscore_FIVb_energy_tour_rank
raw_FIV_and_FGV_light_tour_rank
raw_FIV_and_FGV_dark_tour_rank
raw_FIGNN_and_FGV_light_tour_rank
raw_FIGNN_and_FGV_dark_tour_rank
"
fi
if [ "$SCORING_RANKS" == "protein_protein_voromqa_and_global_and_gnn_with_sr" ]
then
SCORING_RANKS="
raw_FIV_iface_energy_rank
raw_FIV_energy_clash_tour_rank
raw_FIVb_iface_energy_rank
raw_FIVb_energy_clash_tour_rank
raw_FIGNN_sum_of_gnn_scores_rank
raw_FIGNN_average_gnn_score_rank
raw_FIGNN_gnn_scores_tour_rank
raw_FIGNN_average_pcadscore_rank
raw_FIGNN_weighted_average_pcadscore_rank
raw_FIGNN_sum_of_gnn_scores_clash_tour_rank
raw_FIGNN_sum_of_gnn_scores_FIV_energy_tour_rank
raw_FIGNN_avg_gnn_score_FIV_energy_tour_rank
raw_FIGNN_wavg_pcadscore_FIV_energy_tour_rank
raw_FIGNN_sum_of_gnn_scores_FIVb_energy_tour_rank
raw_FIGNN_avg_gnn_score_FIVb_energy_tour_rank
raw_FIGNN_wavg_pcadscore_FIVb_energy_tour_rank
raw_FIV_and_FGV_light_tour_rank
raw_FIV_and_FGV_dark_tour_rank
raw_FIGNN_and_FGV_light_tour_rank
raw_FIGNN_and_FGV_dark_tour_rank
raw_FIV_sr_iface_energy_rank
raw_FIV_sr_energy_clash_tour_rank
raw_FIVb_sr_iface_energy_rank
raw_FIVb_sr_energy_clash_tour_rank
raw_FIGNN_sr_sum_of_gnn_scores_rank
raw_FIGNN_sr_average_gnn_score_rank
raw_FIGNN_sr_gnn_scores_tour_rank
raw_FIGNN_sr_average_pcadscore_rank
raw_FIGNN_sr_weighted_average_pcadscore_rank
raw_FIGNN_sr_sum_of_gnn_scores_clash_tour_rank
raw_FIGNN_sr_sum_of_gnn_scores_FIV_sr_energy_tour_rank
raw_FIGNN_sr_avg_gnn_score_FIV_sr_energy_tour_rank
raw_FIGNN_sr_wavg_pcadscore_FIV_sr_energy_tour_rank
raw_FIGNN_sr_sum_of_gnn_scores_FIVb_sr_energy_tour_rank
raw_FIGNN_sr_avg_gnn_score_FIVb_sr_energy_tour_rank
raw_FIGNN_sr_wavg_pcadscore_FIVb_sr_energy_tour_rank
"
fi
if [[ $SCORING_RANKS == "file:"* ]]
then
SCORING_RANKS="$(cat "$(echo ${SCORING_RANKS} | sed 's|^file:||')" | tr '\n' ' ')"
fi
SCORING_RANKS="$(echo ${SCORING_RANKS} | tr '\n' ' ' | sed 's/\s\+/ /g' | sed 's/^\s\+//' | sed 's/\s\+$//')"
if [[ $EXTRA_SCORING_RANKS == "file:"* ]]
then
EXTRA_SCORING_RANKS="$(cat "$(echo ${EXTRA_SCORING_RANKS} | sed 's|^file:||')" | tr '\n' ' ')"
fi
EXTRA_SCORING_RANKS="$(echo ${EXTRA_SCORING_RANKS} | tr '\n' ' ' | sed 's/\s\+/ /g' | sed 's/^\s\+//' | sed 's/\s\+$//')"
if [ -n "$EXTRA_SCORING_RANKS" ] && [ "$EXTRA_SCORING_RANKS" != "all_plugin" ]
then
SCORING_RANKS="${SCORING_RANKS} ${EXTRA_SCORING_RANKS}"
fi
SCORING_MODE_PROTEIN="false"
SCORING_MODE_PROTEIN_SIDECHAIN_REBUILT="false"
SCORING_MODE_GENERIC="false"
SCORING_MODE_GENERIC_SIDECHAIN_REBUILT="false"
SCORING_MODE_PROTEIN_GNN="false"
SCORING_MODE_PROTEIN_GNN_SIDECHAIN_REBUILT="false"
SCORING_MODE_PROTEIN_GLOBAL="false"
if [[ "$SCORING_RANKS" == *"_FIV_"* ]]
then
SCORING_MODE_PROTEIN="true"
fi
if [[ "$SCORING_RANKS" == *"_FIV_sr_"* ]]
then
SCORING_MODE_PROTEIN_SIDECHAIN_REBUILT="true"
fi
if [[ "$SCORING_RANKS" == *"_FIVb_"* ]]
then
SCORING_MODE_GENERIC="true"
fi
if [[ "$SCORING_RANKS" == *"_FIVb_sr_"* ]]
then
SCORING_MODE_GENERIC_SIDECHAIN_REBUILT="true"
fi
if [[ "$SCORING_RANKS" == *"_FIGNN_"* ]]
then
SCORING_MODE_PROTEIN_GNN="true"
fi
if [[ "$SCORING_RANKS" == *"_FIGNN_sr_"* ]]
then
SCORING_MODE_PROTEIN_GNN_SIDECHAIN_REBUILT="true"
fi
if [[ "$SCORING_RANKS" == *"_FGV_"* ]]
then
SCORING_MODE_PROTEIN_GLOBAL="true"
fi
if [ -z "$REFERENCE_STRUCTURE_FILE_FOR_COMPARISON" ] && [ "$SCORING_MODE_PROTEIN" != "true" ] && [ "$SCORING_MODE_PROTEIN_SIDECHAIN_REBUILT" != "true" ] && [ "$SCORING_MODE_GENERIC" != "true" ] && [ "$SCORING_MODE_GENERIC_SIDECHAIN_REBUILT" != "true" ] && [ "$SCORING_MODE_PROTEIN_GNN" != "true" ] && [ "$SCORING_MODE_PROTEIN_GNN_SIDECHAIN_REBUILT" != "true" ] && [ "$SCORING_MODE_PROTEIN_GLOBAL" != "true" ]
then
echo >&2 "Error: no scoring action enabled"
exit 1
fi
################################################################################
if [ "$CONDA_EARLY" == "true" ] && [ "$CONDA_ENV_FOR_GNN" == "$CONDA_ENV" ]
then
if [ -z "$CONDA_DEFAULT_ENV" ]
then
if [ -z "$CONDA_PATH" ]
then
echo >&2 "Error: not in conda environment, and the conda path is not provided"
exit 1
fi
if [ ! -s "${CONDA_PATH}/bin/activate" ]
then
echo >&2 "Error: no conda activation script '${CONDA_PATH}/bin/activate'"
exit 1
fi
source "${CONDA_PATH}/bin/activate"
fi
if [ -n "$CONDA_ENV" ]
then
if [ "$CONDA_DEFAULT_ENV" != "$CONDA_ENV" ]
then
conda activate "$CONDA_ENV"
fi
if [ "$CONDA_DEFAULT_ENV" != "$CONDA_ENV" ]
then
echo >&2 "Error: no '$CONDA_ENV' environment"
exit 1
fi
fi
CONDA_PATH=""
fi
################################################################################
if [ -z "$FTDMPDIR" ] || [ -n "$FTDMP_ROOT" ]
then
if [ -z "$FTDMP_ROOT" ]
then
export FTDMPDIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
else
export FTDMPDIR="$FTDMP_ROOT"
fi
export PATH="${FTDMPDIR}/core/voronota/expansion_js:${FTDMPDIR}/core/3D_Dock/progs:${FTDMPDIR}:${PATH}"
fi
################################################################################
PREPARED_STATIC_STRUCTURE_FILE=""
PREPARED_MOBILE_STRUCTURE_FILE=""
INPUT_COMPLEX_PREFIX=""
INPUT_COMPLEX_SUFFIX=""
if [ "$DOCKING_REGIME" == "hetero" ]
then
echo >&2 "ftdpm-all: doing hetero docking"
ftdmp-all-dock \
--job-name "$JOB_NAME" \
--static-file "$STATIC_STRUCTURE_FILE" \
--static-sel "$STATIC_STRUCTURE_SELECTION" \
--static-chain "$STATIC_STRUCTURE_CHAIN" \
--static-rotation-seed "$STATIC_STRUCTURE_ROTATION_SEED" \
--mobile-file "$MOBILE_STRUCTURE_FILE" \
--mobile-sel "$MOBILE_STRUCTURE_SELECTION" \
--mobile-chain "$MOBILE_STRUCTURE_CHAIN" \
--mobile-rotation-seed "$MOBILE_STRUCTURE_ROTATION_SEED" \
--openmm-forcefield "$OPENMM_FORCEFIELD" \
--conda-path "$CONDA_PATH" \
--conda-env "$CONDA_ENV" \
--use-ftdock "$USE_FTDOCK" \
--use-hex "$USE_HEX" \
--ftdock-keep "$FTDOCK_KEEP" \
--ftdock-angle-step "$FTDOCK_ANGLE_STEP" \
--ftdock-min-grid-sep "$FTDOCK_MIN_GRID_SEP" \
--hex-macro-mode "$HEX_MACRO_MODE" \
--hex-max-solutions "$HEX_MAX_SOLUTIONS" \
--hex-script "$HEX_SCRIPT" \
--hex-swap-and-repeat "$HEX_SWAP_AND_REPEAT" \
--reuse-ftdock-results "$REUSE_FTDOCK_DOCKING_RESULTS" \
--reuse-hex-results "$REUSE_HEX_DOCKING_RESULTS" \
--parallel "$DOCKING_PROCESSORS" \
--sbatch-for-ftdock "$DOCKING_SBATCH_FOR_FTDOCK" \
--sbatch-for-hex-or-sam "$DOCKING_SBATCH_FOR_HEX_OR_SAM" \
--output-dir "$OUTPUT_PATH"
PREPARED_STATIC_STRUCTURE_FILE="${OUTPUT_PATH}/${JOB_NAME}/monomer_static.pdb"
PREPARED_MOBILE_STRUCTURE_FILE="${OUTPUT_PATH}/${JOB_NAME}/monomer_mobile.pdb"
fi
if [ "$DOCKING_REGIME" == "homo" ]
then
echo >&2 "ftdpm-all: doing homo docking"
ftdmp-all-dock \
--job-name "$JOB_NAME" \
--mobile-file "$MOBILE_STRUCTURE_FILE" \
--mobile-sel "$MOBILE_STRUCTURE_SELECTION" \
--mobile-chain "$MOBILE_STRUCTURE_CHAIN" \
--symmetry-docking "$SYMMETRY_DOCKING" \
--openmm-forcefield "$OPENMM_FORCEFIELD" \
--conda-path "$CONDA_PATH" \
--conda-env "$CONDA_ENV" \
--sam-parameters "$SAM_PARAMETERS" \
--sbatch-for-hex-or-sam "$DOCKING_SBATCH_FOR_HEX_OR_SAM" \
--output-dir "$OUTPUT_PATH"
INPUT_COMPLEX_PREFIX="${OUTPUT_PATH}/${JOB_NAME}/homo_complexes/"
INPUT_COMPLEX_SUFFIX=".pdb"
fi
if [ "$DOCKING_REGIME" == "pre-docked" ]
then
echo >&2 "ftdpm-all: running in pre-docked mode"
mkdir -p "${OUTPUT_PATH}/${JOB_NAME}"
{
echo "ID"
find "$PRE_DOCKED_INPUT_DIR" -type f -name '*.pdb' -not -empty \
| sed "s|^${PRE_DOCKED_INPUT_DIR}||" \
| sed 's|\.pdb$||'
} \
> "${OUTPUT_PATH}/${JOB_NAME}/docking_results.txt"
INPUT_COMPLEX_PREFIX="${PRE_DOCKED_INPUT_DIR}"
INPUT_COMPLEX_SUFFIX=".pdb"
fi
OUTPUT_PATH="${OUTPUT_PATH}/${JOB_NAME}"
PREV_SCORING_RESULTS_FILE="${OUTPUT_PATH}/docking_results.txt"
if [ ! -s "$PREV_SCORING_RESULTS_FILE" ]
then
echo >&2 "Error: no docking results"
exit 1
fi
################################################################################
echo >&2 "ftdpm-all: scoring with ftdmp-all-score"
ftdmp-all-score \
--input-from-table "$PREV_SCORING_RESULTS_FILE" \
--structure-monomer1 "$PREPARED_STATIC_STRUCTURE_FILE" \
--structure-monomer2 "$PREPARED_MOBILE_STRUCTURE_FILE" \
--structure-prefix "$INPUT_COMPLEX_PREFIX" \
--structure-suffix "$INPUT_COMPLEX_SUFFIX" \
--subselect-contacts "$INTERFACE_SUBSELECTION" \
--constraints-required "$CONSTRAINTS_REQUIRED" \
--constraints-banned "$CONSTRAINTS_BANNED" \
--constraint-clashes "$CONSTRAINT_CLASHES" \
--reference "$REFERENCE_STRUCTURE_FILE_FOR_COMPARISON" \
--remap-cadscore "$REMAP_CADSCORE" \
--mode-protein "$SCORING_MODE_PROTEIN" \
--mode-protein-sr "$SCORING_MODE_PROTEIN_SIDECHAIN_REBUILT" \
--mode-generic "$SCORING_MODE_GENERIC" \
--mode-generic-sr "$SCORING_MODE_GENERIC_SIDECHAIN_REBUILT" \
--mode-protein-gnn "$SCORING_MODE_PROTEIN_GNN" \
--mode-protein-gnn-sr "$SCORING_MODE_PROTEIN_GNN_SIDECHAIN_REBUILT" \
--mode-protein-global "$SCORING_MODE_PROTEIN_GLOBAL" \
--plugin-scoring-script "$PLUGIN_SCORING_SCRIPT" \
--conda-path "$CONDA_PATH" \
--conda-env "$CONDA_ENV_FOR_GNN" \
--score-symmetry "$SCORE_SYMMETRY" \
--local-columns "$LOCAL_COLUMNS" \
--geom-hash-to-simplify "$GEOM_HASH_MAX_PRESENCE" \
--keep-top "$SCORING_TOP_STAGE1" \
--keep-top-for-slow "$SCORING_TOP_STAGE1_FOR_SLOW" \
--clash-tour-tolerance "0.05" \
--parallel "$SCORING_PROCESSORS" \
--cache-dir "$CACHE_DIR" \
--sbatch "$SCORING_SBATCH" \
--output-names-prefix "raw_" \
--output-dir "$OUTPUT_PATH"
PREV_SCORING_RESULTS_FILE="${OUTPUT_PATH}/raw_scoring_results_with_ranks.txt"
if [ ! -s "$PREV_SCORING_RESULTS_FILE" ]
then
echo >&2 "Error: no raw scoring results"
exit 1
fi
################################################################################
if [ "$ONLY_DOCK_AND_SCORE" == "true" ]
then
exit 0
fi
################################################################################
if [ -n "$DIVERSIFY" ]
then
echo >&2 "ftdpm-all: diversifying with ftdmp-all-diversify"
ftdmp-all-diversify \
--input-scoring-table "$PREV_SCORING_RESULTS_FILE" \
--names-prefix "raw_" \
--cadscore-step "$DIVERSIFY" \
--site-cadscore-step "$DIVERSIFY" \
--zero-count "5" \
--build-complexes "$NUMBER_OF_COMPLEXES_TO_BUILD"
exit 0
fi
################################################################################
if [ "$EXTRA_SCORING_RANKS" == "all_plugin" ] && [ -n "$PLUGIN_SCORING_SCRIPT" ] && [ -s "${OUTPUT_PATH}/raw_scoring_results_PLUGIN.txt" ]
then
EXTRA_SCORING_RANKS="$(cat ${OUTPUT_PATH}/raw_scoring_results_PLUGIN.txt | head -1 | sed 's/^\S\+\s\+//' | sed 's/\s\+/_rank /g' | sed 's/$/_rank/g')"
SCORING_RANKS="${SCORING_RANKS} ${EXTRA_SCORING_RANKS}"
fi
if [ "$ONLY_EXTRA_SCORING_IN_JURY" == "true" ]
then
if [ -n "$EXTRA_SCORING_RANKS" ]
then
SCORING_RANKS="${EXTRA_SCORING_RANKS}"
else
echo >&2 "Error: only extra scoring rank names requested to be used in jury, but no extra scoring rank names available"
exit 1
fi
fi
################################################################################
echo >&2 "ftdpm-all: running ftdmp-all-jury"
echo "$SCORING_RANKS" | tr ' ' '\n' > "${OUTPUT_PATH}/raw_used_scoring_ranks_names.txt"
ftdmp-all-jury \
--input-scoring-table "$PREV_SCORING_RESULTS_FILE" \
--structure-monomer1 "$PREPARED_STATIC_STRUCTURE_FILE" \
--structure-monomer2 "$PREPARED_MOBILE_STRUCTURE_FILE" \