-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPKINDLOG.c
1974 lines (1718 loc) · 59 KB
/
PKINDLOG.c
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
/*3456789_123456789_123456789_123456789_123456789_123456789_123456789_12345678*/
#include "PKIN.h"
#define EXTERNDLOG
#include "PKINDLOG.h"
/*PKINDLOG.c*/
/* generic Dialog sequence:
DoSpecialDialog
cleargenericflags PKIN
SpecialDialog PKIN
DogenericDialog P___
genericDialog P___
--processing of dialog- P___
---clean up dialog --- P___
genericdlogrouter PKIN
EndSpecialDialog PKIN
*/
/****cleargenericflags()*****************************************************/
void cleargenericflags()
{
Ldlog_subject = 0;
Ldlog_paramA = 0;
Ldlog_textA = 0;
Ldlog_paramB = 0;
Ldlog_textB = 0;
Ldlog_paramC = 0;
Ldlog_textC = 0;
Ldlog_paramD = 0;
Ldlog_textD = 0;
Ldlog_paramE = 0;
Ldlog_textE = 0;
Ldlog_paramF = 0;
Ldlog_textF = 0;
Ldlog_paramG = 0;
Ldlog_textG = 0;
Ldlog_paramH = 0;
Ldlog_textH = 0;
Ldlog_paramI = 0;
Ldlog_textI = 0;
Ldlog_info = 0;
Ldlog_check_caption = 0;
Ldlog_checkA = 0;
Ldlog_checkB = 0;
Ldlog_checkC = 0;
Ldlog_checkD = 0;
Ldlog_checkE = 0;
Ldlog_checkF = 0;
Ldlog_checkG = 0;
Ldlog_checkH = 0;
Ldlog_checkI = 0;
Ldlog_checkJ = 0;
Ldlog_checkK = 0;
Ldlog_checkL = 0;
Ldlog_checkM = 0;
Ldlog_checkN = 0;
Ldlog_checkO = 0;
Ldlog_checkP = 0;
Ldlog_checkQ = 0;
Ldlog_checkLast_caption = 0;
Ldlog_checkR = 0; /*990130*/
Ldlog_checkS = 0; /*990130*/
Ldlog_checkT = 0; /*990130*/
Ldlog_checkU = 0;
Ldlog_checkV = 0; /*041102 not used*/
Ldlog_checkW = 0; /*041102 not used*/
Ldlog_checkX = 0; /*041102 not used*/
Ldlog_radio_caption = 0;
Ldlog_radioA = 0;
Ldlog_radioB = 0;
Ldlog_radioC = 0;
Ldlog_radioD = 0;
Ldlog_radioE = 0;
Ldlog_radioF = 0;
Ldlog_radioG = 0;
Ldlog_radioH = 0;
Ldlog_radioI = 0;
Ldlog_radioJ = 0;
Ldlog_radioK = 0;
Ldlog_radioL = 0;
Ldlog_radioM = 0;
Ldlog_radioN = 0;
Ldlog_radioO = 0;
Ldlog_radioP = 0;
Ldlog_OK = 0;
Ldlog_option = 0;
Ldlog_cancel = 0;
sprintf(dlog_OKstr," OK ");
sprintf(dlog_cancelstr,"CANCEL");
sprintf(dlog_optionstr," ");
sprintf(dlog_textAstr," ");
sprintf(dlog_textBstr," ");
sprintf(dlog_textCstr," ");
sprintf(dlog_textDstr," ");
sprintf(dlog_textEstr," ");
sprintf(dlog_textFstr," ");
sprintf(dlog_textGstr," ");
sprintf(dlog_textHstr," ");
sprintf(dlog_subjectstr," ");
sprintf(dlog_infostr," ");
sprintf(dlog_checkcaptionstr," ");
sprintf(dlog_radiocaptionstr," ");
sprintf(dlog_checkLastcaptionstr," ");
ACTIVE_DLOG = 0;
Ldlog_OKHIT = 0;
Ldlog_cancelHIT = 0;
Ldlog_optionHIT = 0;
}
/*___cleargenericflags()____________________________________________________*/
/****genericdlogrouter()******************************************************/
void genericdlogrouter()
{
/*now the generic parameters have been adjusted by the generic dialog*/
/*need to get back to the specific dialog and set specific parameters */
switch(ACTIVE_DLOG)
{
case INIT_DLOG: EndInitDialog(); break;
case REPORT_DLOG: EndReportDialog(); break;
case RANGESTART_DLOG: EndRangeStartDialog(); break;
case BUILTINSCRIPTS_DLOG: EndBuiltinScriptsDialog(); break;
case EXTERNALSCRIPT_DLOG: EndExternalScriptDialog(); break;
case KLUDGES_DLOG: EndKludgesDialog(); break;
case RANGECONTROL_DLOG: EndRangeControlDialog(); break;
case RUNCONDITIONS_DLOG: EndRunConditionsDialog(); break;
case ATOMMARKER_DLOG: EndAtomMarkerDialog(); break;
case FOCUSOPTIONS_DLOG: EndFocusOptionsDialog(); break;
case FOCUSPARAM_DLOG: EndFocusParamDialog(); break;
case FOCUSBYRESNUM_DLOG: EndFocusParamDialog(); break;
case RIBBON_DLOG: EndRibbonDialog(); break;
case COLORSCALE_DLOG: EndColorScaleDialog(); break;
}
}
/*___genericdlogrouter()_____________________________________________________*/
/****DoInitDialog()***********************************************************/
void DoInitDialog(void)
{
if(!ACTIVE_DLOG)
{
cleargenericflags(); /*PKINDLOG.c*/
InitDialog(); /*PKINDLOG.c*/
DogenericDialog(); /*____DLOG.c*/
}
}
/*___DoInitDialog()__________________________________________________________*/
/****InitDialog()*************************************************************/
void InitDialog() /*INIT_DLOG*/
{
sprintf(dlog_subjectstr,"%s",alertstr);
Ldlog_subject = 1;
sprintf(dlog_OKstr,"PROCEED");
Ldlog_OK = 1;
sprintf(dlog_optionstr,"EXPLANATION");
Ldlog_option = 1;
sprintf(dlog_cancelstr,"QUIT");
Ldlog_cancel = 1;
ACTIVE_DLOG = INIT_DLOG;
Lwaiting = 1; /*wheel spinner while Dialog is active*/
}
/*___InitDialog()____________________________________________________________*/
/****EndInitDialog()**********************************************************/
void EndInitDialog()
{
int j;
if(Ldlog_OKHIT)
{
Lnewfile=1;
}
else if(Ldlog_cancelHIT)
{
/* Quit */
if(fpinput!=0) fclose(fpinput);
if(fpoutput!=0) fclose(fpoutput);
exit(0);
}
else if(Ldlog_optionHIT)
{
Lexplanation = 1;
}
for(j=0; j<256; j++) alertstr[j] = '\0'; /* clear alert report */
ACTIVE_DLOG = 0;
Lwaiting = 0; /*wheel spinner while Dialog active*/
}
/*___EndInitDialog()_________________________________________________________*/
/****DoReportDialog()*********************************************************/
void DoReportDialog(void)
{
if(!Lquiet)
{
if(!ACTIVE_DLOG)
{
cleargenericflags(); /*PKINDLOG.c*/
ReportDialog(); /*PKINDLOG.c*/
DogenericDialog(); /*____DLOG.c*/
#ifdef UNIX_X11
while(Lwaiting) HandleEvent();
#endif
}
}
else
{/*presume if have commandline so can run with Lquiet, has stderr*/
fprintf(stderr,"%s\n",alertstr);
}
}
/*___DoReportDialog()________________________________________________________*/
/****ReportDialog()***********************************************************/
void ReportDialog() /*REPORT_DLOG*/
{
sprintf(dlog_subjectstr,"%s",alertstr);
Ldlog_subject = 1;
sprintf(dlog_OKstr,"PROCEED");
Ldlog_OK = 1;
sprintf(dlog_optionstr,"QUIT");
Ldlog_option = 1;
ACTIVE_DLOG = REPORT_DLOG;
Lwaiting = 1; /*wheel spinner while Dialog is active*/
}
/*___ReportDialog()__________________________________________________________*/
/****EndReportDialog()********************************************************/
void EndReportDialog()
{
int j;
if(Ldlog_OKHIT)
{
; /*NOP*/
}
else if(Ldlog_optionHIT)
{
/* Quit */
if(fpinput!=0) fclose(fpinput);
if(fpoutput!=0) fclose(fpoutput);
exit(0);
}
for(j=0; j<256; j++) alertstr[j] = '\0'; /* clear alert report */
ACTIVE_DLOG = 0;
Lwaiting = 0; /*wheel spinner while Dialog active*/
}
/*___EndReportDialog()_______________________________________________________*/
/*****DoRangeStartDialog()****************************************************/
void DoRangeStartDialog(void)
{
if(!ACTIVE_DLOG)
{
cleargenericflags(); /*PKINDLOG.c*/
RangeStartDialog(); /*PKINDLOG.c*/
DogenericDialog(); /*____DLOG.c*/
}
}
/*____DoRangeStartDialog_____________________________________________________*/
/****RangeStartDialog()*******************************************************/
void RangeStartDialog(void) /*RANGESTART_DLOG*/
{
#ifdef PCWINDOWS
sprintf(dlog_subjectstr,"PREKIN NEW PASS:"CRLF"coordinates from file: %s"
CRLF"%s"
,dirstrip(NameStr),chainreport); /*041031*/
#endif
#ifndef PCWINDOWS
sprintf(dlog_subjectstr,"PREKIN NEW PASS:"CRLF"coordinates from file: %s"
CRLF"%s"
,NameStr,chainreport); /*041031*/
#endif
Ldlog_subject = 1;
sprintf(dlog_infostr,
"for C-alphas of whole molecule, choose Backbone Browsing Script"
CRLF"built-in scripts for other, standard combinations"
CRLF"New Ranges lets you build your own selection"
);
Ldlog_info = 1;
dlog_radioAint = 1; /*990407 forced defaults for New Pass dialog */
sprintf(dlog_radioAstr,"Backbone Browsing Script");
Ldlog_radioA = 1;
dlog_radioBint = 0;
sprintf(dlog_radioBstr,"Selection of built-in scripts");
Ldlog_radioB = 1;
dlog_radioCint = 0;
sprintf(dlog_radioCstr,"New Ranges");
Ldlog_radioC = 1;
dlog_radioDint = 0;
sprintf(dlog_radioDstr,"Focus only");
Ldlog_radioD = 1;
/* obselete: scripted ranges not kept up, not used!?, 050929
dlog_radioEint = 0;
sprintf(dlog_radioEstr,"Range List from external file");
Ldlog_radioE = 1;
*/
dlog_radioFint = 0;
sprintf(dlog_radioFstr,"first: Reset Options");
Ldlog_radioF = 1;
sprintf(dlog_OKstr," OK ");
Ldlog_OK = 1;
sprintf(dlog_optionstr," Quit ");
Ldlog_option = 1;
sprintf(dlog_cancelstr,"restart this Pass");
Ldlog_cancel = 1;
ACTIVE_DLOG = RANGESTART_DLOG;
Lwaiting = 1; /*wheel spinner while Dialog is active*/
}
/*___RangeStartDialog()______________________________________________________*/
/*3456789_123456789_123456789_123456789_123456789_123456789_123456789_12345678*/
/****EndRangeStartDialog()****************************************************/
void EndRangeStartDialog(void)
{
/*clear control logicals*/
Lbuiltin = 0;
Lexternal = 0;
Lrangecontrols = 0;
Lbrowsedefault = 0;
if(Ldlog_OKHIT)
{
/* interpret various radio integers */
if (dlog_radioAint == 1)
{
Lbrowsedefault = 1; /*go right to default script*/
Lbuiltin = 1;
}
else if(dlog_radioBint == 1)
{
Lbuiltin = 1;
Lbuiltindialog = 1; /*Do dialog to get script choice*/
}
else if(dlog_radioCint == 1) /* do range controls */
{
nrange = 1; /*==0 ends range control, similar to Lrangecontrols scope*/
n = 0; /*global used for range counter, */
/* but global mrange carries this info for later use */
Lrangecontrols = 1;
Lstartarange = 1;
}
else if(dlog_radioDint == 1) /*focus only*/
{
Lfirstsubunit=0;
Lallsubunits=1;
Ldetails = 1;
Lfocusoption = 1;
Lresnumfovea = 1; /*control global*/
}
/*obseleted 050929
else if(dlog_radioEint == 1) Lexternal = 1;
*/
else if(dlog_radioFint == 1) Lkluges = 1;
else Lrangestart = 1; /*since ALL radio buttons can be off!!!!*/
}
else if(Ldlog_optionHIT)
{
/* Quit */
if(fpinput!=0) fclose(fpinput);
if(fpoutput!=0) fclose(fpoutput);
exit(0);
}
else if(Ldlog_cancelHIT)
{
Lrangestart = 1;
}
ACTIVE_DLOG = 0;
Lwaiting = 0; /*wheel spinner while Dialog active*/
}
/*___EndRangeStartDialog()___________________________________________________*/
/*****DoBuiltinScriptsDialog**************************************************/
void DoBuiltinScriptsDialog(void)
{
if(!ACTIVE_DLOG)
{
cleargenericflags(); /*PKINDLOG.c*/
BuiltinScriptsDialog(); /*PKINDLOG.c*/
DogenericDialog(); /*PUXMDLOG.c*/
}
}
/*____DoBuiltinScriptsDialog_________________________________________________*/
/****BuiltinScriptsDialog()***************************************************/
void BuiltinScriptsDialog(void) /*BUILTINSCRIPTS_DLOG*/
{
sprintf(dlog_subjectstr,"kinemage built-in scripts");
Ldlog_subject = 1;
sprintf(dlog_infostr,
"for C-alphas of whole molecule, choose caSS"
CRLF"built-in scripts for other, standard combinations"
CRLF"range controls lets you build your own selection"
);
Ldlog_info = 1;
dlog_radioAint = 1;
sprintf(dlog_radioAstr /*1*/
,"caSS - Calphas & -ss- (or nucleic acid pseudo-backbone) non-H2O hets");
Ldlog_radioA = 1;
dlog_radioBint = 0;
sprintf(dlog_radioBstr /*2*/
,"mcHb - mainchain and its h-bonds");
Ldlog_radioB = 1;
dlog_radioCint = 0;
sprintf(dlog_radioCstr /*3*/
,"aasc - individual amino acids in separate sets and Calphas");
Ldlog_radioC = 1;
dlog_radioDint = 0;
sprintf(dlog_radioDstr /*9*/
,"aasc+R - individual amino acids in separate sets and Calphas and ranges");
Ldlog_radioD = 1;
dlog_radioEint = 0;
sprintf(dlog_radioEstr /*6*/
,"naba - individual nucleic acid bases in separate sets and lots else");
Ldlog_radioE = 1;
dlog_radioFint = 0;
sprintf(dlog_radioFstr /*7*/
,"separate bases, pseudo-backbone, non-carbon atom markers");
Ldlog_radioF = 1;
dlog_radioGint = 0;
sprintf(dlog_radioGstr /*4*/
,"lots - mc, sc, ca, (hy), (hets), H2O balls");
Ldlog_radioG = 1;
dlog_radioHint = 0;
sprintf(dlog_radioHstr /*8*/
,"ribbon: varible width dependent on local curvature ");
Ldlog_radioH = 1;
dlog_radioIint = 0;
sprintf(dlog_radioIstr /*5*/
,"bestribbon: HELIX & SHEET from pdb header, one-strand coil, flat nucleic acid ");
Ldlog_radioI = 1;
dlog_radioJint = 0;
sprintf(dlog_radioJstr /*5*/
,"ribnhet: bestribbon and hets with nonCatom balls ");
Ldlog_radioJ = 1;
dlog_radioKint = 0;
sprintf(dlog_radioKstr /*10*/
,"Table group (based on protein Calphas)");
Ldlog_radioK = 1;
sprintf(dlog_OKstr,"OK");
Ldlog_OK = 1;
sprintf(dlog_optionstr,"do range controls instead");
Ldlog_option = 1;
sprintf(dlog_cancelstr,"restart this Pass");
Ldlog_cancel = 1;
ACTIVE_DLOG = BUILTINSCRIPTS_DLOG;
Lwaiting = 1; /*wheel spinner while Dialog is active*/
}
/*___BuiltinScriptsDialog()__________________________________________________*/
/*3456789_123456789_123456789_123456789_123456789_123456789_123456789_12345678*/
/****EndBuiltinScriptsDialog()************************************************/
void EndBuiltinScriptsDialog(void)
{
if(Ldlog_OKHIT)
{
/*set control logical*/
Lbuiltin = 1; /*still true*/
Lbuiltinchoice = 1; /*now set*/
/* interpret various radio integers */
if (dlog_radioAint == 1) {ithscript = 1;}
else if(dlog_radioBint == 1) {ithscript = 2;}
else if(dlog_radioCint == 1) {ithscript = 3;}
else if(dlog_radioDint == 1) {ithscript = 9;}
else if(dlog_radioEint == 1) {ithscript = 6;}
else if(dlog_radioFint == 1) {ithscript = 7;}
else if(dlog_radioGint == 1) {ithscript = 4;}
else if(dlog_radioHint == 1) {ithscript = 8;}
else if(dlog_radioIint == 1) {ithscript = 5; Lribonucleic=1;} /*RNA type*/
else if(dlog_radioJint == 1) {ithscript = 5;
Lribonucleic = 1;
LcolorbyNtoC = 1;
Lblackedge = 1;
Lhetconnect = 0;
ballradius = (float)0.32;
htxl[1] = 1;
atxl[1] = 1;
htal[1] = 1; /*set this here to simulate rangeend logic*/
}
else if(dlog_radioKint == 1) {ithscript = 10;}
else {Lbuiltin = 0;Lrangestart = 1;}
}
else if(Ldlog_optionHIT)
{
Lbuiltin = 0;
Lrangecontrols = 1; /*will then do new ranges*/
nrange = 1; /*==0 ends range control, similar to Lrangecontrols scope*/
n = 0; /*global used for range counter, */
/* but global mrange carries this info for later use */
Lrangecontrols = 1;
Lstartarange = 1;
}
else if(Ldlog_cancelHIT)
{
Lbuiltin = 0;
Lrangestart = 1;
}
Lbuiltindialog = 0; /*clear flag, not under this control anymore*/
ACTIVE_DLOG = 0;
Lwaiting = 0; /*wheel spinner while Dialog active*/
}
/*___EndBuiltinScriptsDialog()_______________________________________________*/
/*3456789_123456789_123456789_123456789_123456789_123456789_123456789_12345678*/
/*****DoExternalScriptDialog**************************************************/
void DoExternalScriptDialog(void)
{
if(!ACTIVE_DLOG)
{
cleargenericflags(); /*PKINDLOG.c*/
ExternalScriptDialog(); /*PKINDLOG.c*/
DogenericDialog(); /*PUXMDLOG.c*/
}
}
/*____DoExternalScriptDialog_________________________________________________*/
/****ExternalScriptDialog()***************************************************/
void ExternalScriptDialog(void) /*EXTERNALSCRIPT_DLOG*/
/*050929 obseleted: should never be callled*/
{
sprintf(dlog_subjectstr,"External Range List to feed Range Controls");
Ldlog_subject = 1;
dlog_radioAint = 1;
sprintf(dlog_radioAstr ,"accept list exactly");
Ldlog_radioA = 1;
dlog_radioBint = 0;
sprintf(dlog_radioBstr ,"modify list as it is read in");
Ldlog_radioB = 1;
dlog_radioCint = 0;
sprintf(dlog_radioCstr ,"find residues by labellist coordinates");
Ldlog_radioC = 1;
sprintf(dlog_optionstr,"do Range Controls instead");
Ldlog_option = 1;
sprintf(dlog_OKstr,"OK");
Ldlog_OK = 1;
sprintf(dlog_cancelstr,"restart this Pass");
Ldlog_cancel = 1;
ACTIVE_DLOG = EXTERNALSCRIPT_DLOG;
Lwaiting = 1; /*wheel spinner while Dialog is active*/
}
/*___ExternalScriptDialog()__________________________________________________*/
/****EndExternalScriptDialog()************************************************/
void EndExternalScriptDialog(void)
{
if(Ldlog_OKHIT)
{
/* interpret various radio integers */
if (dlog_radioAint == 1)
{/*accept script exactly*/
Laccept = 1;
Lmodify = 0;
Lopenscriptin = 1; /*for flow control in PKINRNGE.c */
Llabellist = 0;
}
else if(dlog_radioBint == 1)
{/*modify script as it is read in*/
Laccept = 0;
Lmodify = 1;
Lopenscriptin = 1; /*for flow control in PKINRNGE.c */
Llabellist = 0;
}
else if(dlog_radioCint == 1)
{/*find residues by labellist coordinates*/
Laccept = 0;
Lmodify = 1;
Llabellist = 1;
Lopenscriptin = 1; /*for flow control in PKINRNGE.c */
}
else /*NO radios ON */
{/*restart this Pass*/
Laccept = 0;
Lmodify = 0;
Llabellist = 0;
Lrangestart = 1;
}
}
else if(Ldlog_optionHIT)
{/*do new range controls instead*/
Laccept = 0;
Lmodify = 0;
Llabellist = 0;
Lrangecontrols = 1; /*will then do range controls */
Lstartarange = 1;
}
else if(Ldlog_cancelHIT)
{/*restart this Pass*/
Laccept = 0;
Lmodify = 0;
Llabellist = 0;
Lrangestart = 1;
}
Lexternal = 0; /*no matter what, not under this control anymore*/
ACTIVE_DLOG = 0;
Lwaiting = 0; /*wheel spinner while Dialog active*/
}
/*___EndExternalScriptDialog()_______________________________________________*/
/*3456789_123456789_123456789_123456789_123456789_123456789_123456789_12345678*/
/*****DoKludgesDialog()********************************************************/
void DoKludgesDialog(void)
{
if(!ACTIVE_DLOG)
{
cleargenericflags(); /*PKINDLOG.c*/
KludgesDialog(); /*PKINDLOG.c*/
DogenericDialog(); /*____DLOG.c*/
}
}
/*___DoKludgesDialog()________________________________________________________*/
/****KludgesDialog()***********************************************************/
void KludgesDialog(void) /*KLUDGES_DLOG*/
{
sprintf(dlog_subjectstr,"Various Kludges");
Ldlog_subject = 1;
sprintf(dlog_checkcaptionstr,"independant Kludges:");
Ldlog_check_caption = 1;
dlog_checkAint = Ltestprint;
sprintf(dlog_checkAstr ,"debug test print statements");
Ldlog_checkA = 1;
dlog_checkBint = Lleftadjatomname;
sprintf(dlog_checkBstr ,"Left adjusted, non-standard, PDB atom names");
Ldlog_checkB = 1;
dlog_checkCint = Lhetconnect;
sprintf(dlog_checkCstr ,"connect hetatom 'residues' within a subunit");
Ldlog_checkC = 1;
dlog_checkDint = IDEMO;
sprintf(dlog_checkDstr
,"DEMO mode: just BIG print in text window to demo PREKIN");
Ldlog_checkD = 1;
dlog_checkEint = Listext;
sprintf(dlog_checkEstr
,"extra output at end of this pass");
Ldlog_checkE = 1;
dlog_checkFint = Lcolorscale;
sprintf(dlog_checkFstr
,"Change color scale values, e.g. for B-value colors");
Ldlog_checkF = 1;
dlog_checkGint = Leachsclist;
sprintf(dlog_checkGstr
,"each sidechain in a separate, nobutton, list");
Ldlog_checkG = 1;
dlog_checkHint = Lballonscpoints;
sprintf(dlog_checkHstr
,"individual balls on sidechain n,o,s atoms");
Ldlog_checkH = 1;
dlog_checkIint = Lfillscrings;
sprintf(dlog_checkIstr
,"triangle tesselation fills sidechain rings");
Ldlog_checkI = 1;
dlog_checkJint = Lonlygroups;
sprintf(dlog_checkJstr
,"groups dominant for each chain, subgroups by masters");
Ldlog_checkJ = 1;
dlog_checkKint = Lonegroup;
sprintf(dlog_checkKstr
,"Just one group dominant; chains and subgroups by masters");
Ldlog_checkK = 1;
dlog_checkLint = Lnogroups;
sprintf(dlog_checkLstr
,"NO groups; all chains and subgroups by masters");
Ldlog_checkL = 1;
/*050211 this is now the place that initiates VRML output*/
dlog_checkMint = LdumpVRML;
sprintf(dlog_checkMstr ,"VRML output, e.g. for 3D Printer");
Ldlog_checkM = 1;
sprintf(dlog_radiocaptionstr,"Range Controls apply:");
Ldlog_radio_caption = 1;
dlog_radioAint = (Linclusive && !Loverlap);
sprintf(dlog_radioAstr ,"Inclusive (default)");
Ldlog_radioA = 1;
dlog_radioBint = (!Linclusive && !Loverlap);
sprintf(dlog_radioBstr ,"Exclusive");
Ldlog_radioB = 1;
dlog_radioCint = (Linclusive && Loverlap);
sprintf(dlog_radioCstr ,"Inclusive lapped out by one");
Ldlog_radioC = 1;
sprintf(dlog_OKstr,"OK");
Ldlog_OK = 1;
sprintf(dlog_cancelstr,"CANCEL");
Ldlog_cancel = 1;
ACTIVE_DLOG = KLUDGES_DLOG;
Lwaiting = 1; /*wheel spinner while Dialog is active*/
}
/*___KludgesDialog()__________________________________________________________*/
/****EndKludgesDialog()********************************************************/
void EndKludgesDialog(void)
{
if(Ldlog_OKHIT)
{
/* interpret various radio integers */
if (dlog_radioAint == 1) {Linclusive = 1; Loverlap = 0;}
else if(dlog_radioBint == 1) {Linclusive = 0; Loverlap = 0;}
else if(dlog_radioCint == 1) {Linclusive = 1; Loverlap = 1;}
/* interpret various check boxes */
Ltestprint = dlog_checkAint;
Lleftadjatomname = dlog_checkBint;
Lhetconnect = dlog_checkCint;
IDEMO = dlog_checkDint;
Listext = dlog_checkEint;
Lcolorscale = dlog_checkFint;
Leachsclist = dlog_checkGint;
Lballonscpoints = dlog_checkHint;
Lfillscrings = dlog_checkIint;
Lonlygroups = dlog_checkJint;
Lonegroup = dlog_checkKint;
Lnogroups = dlog_checkLint;
LdumpVRML = dlog_checkMint;
if(LdumpVRML)
{
nstrnd = 5;
ballradius = 2*ribwidVRML/5; /*expecting nstrnd==5 050211*/
}
}
else if(Ldlog_optionHIT)
{
;
}
else if(Ldlog_cancelHIT)
{
/*Why did this bother to reset to arbitrary defaults here????
rather than just bailing out????
Linclusive = 1;
Loverlap = 0;
Ltestprint = 0;
Lleftadjatomname = 0;
Lhetconnect = 1; 990403 changed default
IDEMO = 0;
*/
; /*NOP*/
}
Lrangestart = 1; /*always return to rangestart*/
Lkluges = 0; /*clear flag*/
ACTIVE_DLOG = 0;
Lwaiting = 0; /*wheel spinner while Dialog active*/
}
/*___EndKludgesDialog()_______________________________________________________*/
/*****DoRangeControlDialog()**************************************************/
void DoRangeControlDialog(void)
{
if(!ACTIVE_DLOG)
{
cleargenericflags(); /*PKINDLOG.c*/
RangeControlDialog(); /*PKINDLOG.c*/
DogenericDialog(); /*____DLOG.c*/
}
}
/*___DoRangeControlDialog()__________________________________________________*/
/****RangeControlDialog()*****************************************************/
void RangeControlDialog(void) /*RANGECONTROL_DLOG*/
{
int j;
LRCDialogInput = 0;
if(Lscriptin&&!Llabellist) j = n;
else j = n-1;
if(Lscriptin) sprintf(word,"from script");
else sprintf(word," ");
sprintf(dlog_subjectstr,"Previous range information"
CRLF" %s"CRLF" %s"CRLF"%s"CRLF"This range %d %s"
,olderstr,oldstr,newstr,n,word);
Ldlog_subject = 1;
resnu1[n] = resnu1[j];
resnu2[n] = resnu2[j];
sprintf(dlog_paramAstr,"%d",resnu1[n]);
sprintf(dlog_textAstr,"Number of start residue");
Ldlog_paramA = 1;
Ldlog_textA = 1;
sprintf(dlog_paramBstr,"%d",resnu2[n]);
sprintf(dlog_textBstr,"Number of end residue");
Ldlog_paramB = 1;
Ldlog_textB = 1;
sprintf(dlog_paramCstr,"...");
sprintf(dlog_textCstr,"3-letter residue code");
Ldlog_paramC = 1;
Ldlog_textC = 1;
dlog_checkAint = mcxl[n]=mcxl[j];
sprintf(dlog_checkAstr ,"mc: mainchain");
Ldlog_checkA = 1;
dlog_checkBint = scxl[n]=scxl[j];
sprintf(dlog_checkBstr ,"sc: sidechain");
Ldlog_checkB = 1;
dlog_checkCint = hbxl[n]=hbxl[j];
sprintf(dlog_checkCstr ,"hb: h-bonds (mainchain)");
Ldlog_checkC = 1;
dlog_checkDint = hyxl[n]=hyxl[j];
sprintf(dlog_checkDstr ,"hy: hydrogens");
Ldlog_checkD = 1;
dlog_checkEint = caxl[n]=caxl[j];
sprintf(dlog_checkEstr,"ca: protein Calphas; nucl.acid pseudo-backbone");
Ldlog_checkE = 1;
dlog_checkFint = lbxl[n]=lbxl[j];
sprintf(dlog_checkFstr ,"lb: residue labels");
Ldlog_checkF = 1;
dlog_checkGint = htxl[n]=htxl[j];
sprintf(dlog_checkGstr ,"ht: hetatoms (non-water)");
Ldlog_checkG = 1;
dlog_checkHint = waxl[n]=waxl[j];
sprintf(dlog_checkHstr ,"wa: water");
Ldlog_checkH = 1;
dlog_checkIint = atxl[n]=atxl[j];
sprintf(dlog_checkIstr ,"at: atom markers or balls (not C or H)");
Ldlog_checkI = 1;
dlog_checkJint = ctxl[n]=ctxl[j];
sprintf(dlog_checkJstr ," atom markers on carbons as well as n,o,s");
Ldlog_checkJ = 1;
dlog_checkKint = mcCPKl[n]=mcCPKl[j];
sprintf(dlog_checkKstr ,"mc CPKs instead of vectors");
Ldlog_checkK = 1;
dlog_checkLint = scCPKl[n]=scCPKl[j];
sprintf(dlog_checkLstr ,"sc CPKs instead of vectors");
Ldlog_checkL = 1;
dlog_checkMint = htCPKl[n]=htCPKl[j];
sprintf(dlog_checkMstr ,"ht CPKs instead of vectors");
Ldlog_checkM = 1;
dlog_checkNint = Bcol[n]=Bcol[j];
sprintf(dlog_checkNstr ,"color by B-values");
Ldlog_checkN = 1;
dlog_checkOint = Bval[n]=Bval[j];
sprintf(dlog_checkOstr ,"pointID B-values & occupancies");
Ldlog_checkO = 1;
dlog_checkPint = mutl[n]=0;
sprintf(dlog_checkPstr ,"ro: mutation to idealized geom. of one residue");
Ldlog_checkP = 1;
dlog_checkQint = Laspectnc;
sprintf(dlog_checkQstr ,"N-->C colored aspect");
Ldlog_checkQ = 1;
dlog_checkRint = Laspectabc;
sprintf(dlog_checkRstr ,"ABC colored aspect");
Ldlog_checkR = 1;
dlog_checkSint = Lcbetadev;
sprintf(dlog_checkSstr ,"C-beta deviations from ideal");
Ldlog_checkS = 1;
dlog_checkTint = supl[n]=supl[j];
sprintf(dlog_checkTstr ,"superpos each instance of this aa on an ideal aa");
Ldlog_checkT = 1;
dlog_radioAint = Coil[n]=Coil[j];
sprintf(dlog_radioAstr ,"Ribbon: COIL range: adds to header info");
Ldlog_radioA = 1;
dlog_radioBint = Alpha[n]=Alpha[j];
sprintf(dlog_radioBstr ,"Ribbon: ALPHA range: adds to HELIX");
Ldlog_radioB = 1;
dlog_radioCint = Beta[n]=Beta[j];
sprintf(dlog_radioCstr ,"Ribbon: BETA/nucleic range: adds to SHEET");
Ldlog_radioC = 1;
dlog_radioDint = Best[n]=Best[j];
sprintf(dlog_radioDstr ,"bestribbon over this range");
Ldlog_radioD = 1;
dlog_radioEint = cisl[n]=cisl[j];
sprintf(dlog_radioEstr ,"bestribbon with cis peptides emphasized"); /*cispep*/
Ldlog_radioE = 1;
dlog_radioFint = cisl[n]=cisl[j];
sprintf(dlog_radioFstr ,"only cis peptides Ca--Ca emphasized");
Ldlog_radioF = 1;
dlog_radioGint = ribl[n]=ribl[j];
sprintf(dlog_radioGstr ,"Ribbon: by curvature over entire range");
Ldlog_radioG = 1;
/*the NO Ribbon choice lets one get out of the radio buttons once one is hit!*/
dlog_radioHint = (!ribl[j]&&!Coil[j]&&!Alpha[j]&&!Beta[j]&&!Best[j]&&!cisl[j]);
sprintf(dlog_radioHstr ,"NO Ribbon selection this range");
Ldlog_radioH = 1;
sprintf(dlog_checkLastcaptionstr,"--------------------------------- ");
Ldlog_checkLast_caption = 1;
/*050929 jumper this script stuff -- it is not up to date, nor ever used!?
dlog_checkUint = 0;
sprintf(dlog_checkUstr ,"write script when end ranges");
Ldlog_checkU = 1;
*/
dlog_radioMint = 1;
sprintf(dlog_radioMstr ,"OK accepts and comes back for more");
Ldlog_radioM = 1;
dlog_radioNint = 0;
sprintf(dlog_radioNstr ,"OK accepts and end ranges");
Ldlog_radioN = 1;
dlog_radioOint = 0;
sprintf(dlog_radioOstr ,"OK ends ranges at previous selection");
Ldlog_radioO = 1;
sprintf(dlog_OKstr," OK ");
Ldlog_OK = 1;
sprintf(dlog_optionstr,"Abandon range controls");
Ldlog_option = 1;
sprintf(dlog_cancelstr,"CANCEL this range");
Ldlog_cancel = 1;
ACTIVE_DLOG = RANGECONTROL_DLOG;
Lwaiting = 1; /*wheel spinner while Dialog is active*/
}
/*___RangeControlDialog()____________________________________________________*/
/****EndRangeControlDialog()**************************************************/
void EndRangeControlDialog(void)
{
int j;
if(Ldlog_OKHIT)
{
/*get residue range (and identity)*/
resnu1[n] = intfromstr(dlog_paramAstr); /*PKINUTIL.c*/
resnu2[n] = intfromstr(dlog_paramBstr); /*PKINUTIL.c*/
for(j=0;j<3;j++) resid[n][j] = dlog_paramCstr[j];