-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPKININIT.c
3233 lines (3092 loc) · 138 KB
/
PKININIT.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
/***PREKINinit.c*************************************************************/
/* PREKIN reads Brookhaven PDB file and produces a file in kinemage format
*(that can be read by MAGE) ready to be edited into the kinemage as desired
* by the author.
* MAGE shows KINEMAGEs:
*/
/* PREKIN determines the connectivity (covalent and H-bond) of the
* coordinates,
* sorts the vectors into hierarchical sets,
* associates identifying text with each vector,
* allows range and focus selection.
*
* Attribution Notice:
* PREKIN program: copyright c David C. Richardson,
* 1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005
* all rights reserved
* Little River Institute, 5820 Old Stony Way, Durham, NC 27705
*
* Use and distribution for non-profit educational and research purposes
* encouraged. Rewrites for this and other platforms encouraged for similar
* use and distribution.
* Contact David C. Richardson, Little River Institute, for details.
* Concept and MAGE Developed by David C. Richardson and Jane S. Richardson
* "Kinemage" name invented by Caroline P. Usher
* Grateful acknowledgement of many years of support from NIH, grant GM15000,
* which included visualization of protein structures and the development of
* CHAOS: display program written in E&S PS300 function-net language,
* CHAosIN Fortran program, etc.
* Grateful acknowlegement to Fred Brooks and the UNC GRIP team for
* many years of exposure to Computer Science and developing my sense of
* what can and should be done with computer graphics.
*
* Although this code obviously bears resemblance to many examples of .c
* and Mac code, one hopes this combination and construction departs from
* the examples far enough so that there is no danger of copyright
* infringement, nor blame for failings, going back to earlier work.
* On the other hand, there is a real intellectual debt owed.
* In particular:
* Think C development system, examples, and manual, Symantec Corp. 1989
* and several timely hints from Think C technical Support!
* Apple Inside Macintosh, Addison-Wesley, 1985
* (the essentual and eventually preferred ref.)
* Several suggestions and a look at real code by Warren Robinett.
* Using the Macintosh Toolbox with C,
* F.A.Huxham, D.Burnard,J.Takatsuka 2nd Ed. Sybex,1989
* Macintosh C Programming Primer, Vol. II, D. Mark, Addison-Wesley, 1990
* Robert Weiss who began making useful suggestions even before he signed
* on to help rewrite the Mac program for Windows 3.1..
* Brent Presley who did the port to Win32 and did much code reconciliation
* as well as helped clean up the program flow logic. 971029
* J. Michael Word who gave me a lot of tips, pieces of code, and a real
* appreciation of good programming practice.
* Ian W. Davis whose MolProbity, KiNG, and building prekin-like features
* in KiNG, has pushed further development of this old prekin.
****************************************************************************/
#include "PKIN.h"
#include "PKINDLOG.h"
#include "PKINRIBB.h" /*051025*/
FILE *fphelp;
void writeversiontooutput(void); /*041011*/
void writechangestooutput(void); /*040215*/
void writecmdhelptooutput(void); /*040425*/
static char* prekinchanges[] =
{"\r"
,"020514 Cbeta:Superpos,NB:Prekin,IOmage\r"
,"020529 Cbeta:Superpos,NB:Prekin,IOmage,orig-rot-hypertext\r"
,"020614 6.10 Cbeta,IOmage,altmutants\r"
,"021213 6.14 Bval-ribbons\r"
,"030111 6.20 MODEL work\r"
,"030125 6.20 vectorCO :perpendicular vector from Ca--Ca to Carbonyl Oxygen\r"
,"030127 6.20 angles for vectorCO\r"
,"030128 6.20 Calpha---Calpha angle,dihedral,azimuth to CO\r"
,"030129 6.20 pdb output for vectorCO \r"
,"030202 6.20 vectorCO IO pdb CaCO in, full mc pdb out\r"
,"030203 6.20 cis pro\r"
,"030223 clean up of 030221, 030224 6.24 bug in doaxisrot\r"
,"030228,308 6.25 ranges dialog unix rework,PC fail gracefully running quiet\r"
,"030401 6.28 atomradii, 030405 on mutation also\r"
,"030502 6.29 report to stdout \r"
,"030515,19,20,27 6.30 Phosphate perpendiculars to Base by commandline\r"
,"030605,07 6.30 clean up pro mutation & cbetadev; do gray H on hets \r"
,"030706 nterm beta ribbon fudge for rasmol 3D printer\r"
,"030920 6.31 cns H names, extra ring closure atoms called ghost\r"
,"030925 rotatorname incl sub==chainID \r"
,"031001 6.32 mutation full sc for alt conf sc\r"
,"031124 6.33 altb,altc cbetadev even for no alternative mainchain atoms\r"
,"031228 short colorset names: mage limit 14 characters\r"
,"040202 6.34 040211 pperpdump \r"
,"040215 clean up range-external-script, external-script should be obseleted\r"
,"040222 pperptobase removed residue numbering dependence (bug)\r"
,"040226-29 RNA & DNA ribbons, ranges for nucleic acid ribbon with arrowheads\r"
,"040303 6.35 output mutated residue in PDB format\r"
,"040304 matrix, center input --> transformed PDB\r"
,"040318 -cbetadevmax single #, USER MOD limit==100\r"
,"040319,23,24 ribbon perps,avoid duplicate beta strand ends, #chains 255\r"
,"040406 ribbon fakes CO for GFP, rearranged naba,aasc output\r"
,"040419 NOT CARRIED FORWARD: doubled nucleic acid spine guide points\r"
,"040420,23,24 curvature fudged nucleic acid spine guide points\r"
,"040425 html help initiated\r"
,"040504,09 color53 in bestribbon, more levels for huge, multichain molecs\r"
,"040609 6.36 clean up\r"
,"040620 correct axes on pperpplot\r"
,"040705 pperpoutliers only, delta added to dump\r"
,"040902 cmdline water balls, -listmaster \"name\", cmdline color by occ\r"
,"040918 6.40 black edge on explicit structure-type ribbon sections\r"
,"040924 black ribbon edge option\r"
,"041001 Unpickable foot for pperpoutliers muli-crit\r"
,"041011 (MSE selenomet mutation present) thumbnail: -nohetconnect, -version\r"
,"041017 ribbon blackedge clean up, foo atomradii 2.0 if not n,c,o,p,s\r"
,"041020 -ballradius atom marker choice, no balls for hydrogen\r"
,"041023 cis peptide calc reported in -vectorCO command\r"
,"041029 white pt color on hets for colornc \r"
,"041031 new colors for subunits, cbetadev output only bad ones\r"
," -ribnhet: -arrows -colornc -blackedge -nohetconnect -ballradius 0.32 -show \"ht,at\"\r"
,"041102 commandline -vectorCO with cispeptides emphasized\r"
,"041102 GUI ranges: option cispeptides emphasized, commandline: -cispep \r"
,"041103,04 GUI ranges: option bestribbon, bestribbon + cispeptides \r"
,"041105 ribnhet allows Ca-only spline...\r"
,"041106 bestribbon list colors discriminate multiple chains as default\r"
," -bestribbon == -arrows , convergent evolution complete!\r"
,"RCSB: -ribnhet: -bestribbon -colornc -blackedge -nohetconnect -ballradius 0.32 -show \"ht,at\"\r"
,"041106 distinguished -cispeponly vs -ribbon -cispep\r"
,"041107 bug fix: chain specific hetatm HOH residue numbers foul ribbon ranges\r"
," Lbestribbon uses variable width ribbon for chain without specifications\r"
," -passkeyword \"...\" : keyword to pass to mage, e.g. @whitebackground \r"
,"041115 -cispep: cis-peptide now recognized even if Cterm residue\r"
,"041205 -cbstubs : ribbon---CB stubs for sidechains\r"
,"050121 nmrmodel in bondrot rotatorname, and group and subgroup names.\r"
," balllist pointmaster alt a,b,c fixed\r"
," existing option now in -help: specify sets off e.g. -show 'mc(red)[off]'\r"
,"(050125 revived 050324: pperp to nucleotide c1'--n line did not work.\r"
,"050204 multistrand ribbon output in VRML 2.0 format (extrusion) \r"
,"050206,08,09 sidechain stubs for selected sc on ribbon\r"
,"050211 multistrand ribbon output in VRML 1.0 format (cylinder & ball-joint)\r"
,"050212 more ribbon work, including beta strand arrows for VRML output.\r"
,"( NOT IMPLEMENTED make pointID match pdb format atom & res name...)\r"
,"050309 MAXRanges from 101 to 301 for MolProbity Multicrit bad rotamers\r"
,"Maxranges was NOT the problem..., size of ranges char str was the problem.\r"
,"050310 protect total ranges by MAXR, strobe out full strlen(), one # ranges\r"
,"050324 translate added to matrix so can dump PDB biological related coords.\r"
," revived 050125 pperp to nucleotide c1'--n line to test Xueyi's results.\r"
,"050324 is held as distribution version until later stuff settles down... \r"
,"050327 NOfudge and ribbon-guide-points output for how to draw show-n-tell\r"
,"050327 default Lhylens==0 so NOT do lens for hydrogens now is lots default\r"
,"050329 more VRML tinkering: white ribbon, simpler attribute designations\r"
,"050403 CA---CB vector defined in terms of ribbon guide points.\r"
,"050409 code for use of CONECT records started, not yet implemented ...\r"
,"050409 try redefinition of imbedded HETATMs in P or N chains as ATOMS\r"
," THIS WORSE for GFPs! hetatm code much better than atom to get something!\r"
,"050630 resume work from 050409 code... \r"
,"IWD050617: All balls are marked alt B (even those for alt A)\r"
," -050704- cannot reproduce this, need example. Probably already fixed.\r"
,"IWD050617: Color by OCC/B still leaves SS as yellow (Prekin bug?)\r"
," -050704-fixed.\r"
,"050704 Bcol subroutined, applied to -SS- \r"
,"IWD050617: pointmasters not on the start of vectors (those flagged P)\r"
," -050705- Need pointmaster on a P type point,\r"
," even though vector is controlled by its L point.\r"
," KiNG will still pick that unshown P pt, so need to turn it off also.\r"
,"IWD050617:dangling altB C--N for 1SWU B 29(whenever i has all A and B alts)\r"
," -050705 case of oldconnect carbonyl atoms are alt a and b, to one nitrogen\r"
," this would need remembering alts of base for 2 c--n vectors,\r"
," and forcing a new P nitrogen to make a non-alt vector to next Calpha.\r"
," This would be a lot of work in old prekin to fix a minor annoyance.\r"
,"IWD050617: unwanted @listcolordominant for multi-subunit ribbons in multi-crit\r"
," -050705- pt color is rainbow on each, list color distinguishes subunits.\r"
," This was deliberate for RCSB -ribnhet option, now option specific.\r"
,"050705 pointmaster on P matches that on following L, for KiNG picking \r"
,"050705 Llistcolordom flagged only for ribnhet option (as of now).\r"
,"050705 restore use of list for hetatm residues that can be treated as atoms\r"
,"050731 ...accummulate changes for next issue... \r"
,"050916 make usuable version, many loose ends... \r"
,"050917 SITE residues by number,chainID,insertion_code... \r"
," prekinz -bestribbon -scope -siterec -cbstubs -scballs -show \"ht,at\" -ballradius 0.32 1RUVbeta.pdb >1RUVbeta.site.kin \r"
,"050920 max ranges to 900: ranges includes ribbon regions and site residues\r"
,"050922 multi-subunits in NMR models correctly associated with their models \r"
,"050923--25 rework Alpha,Beta ranges to work with all the MODELs \r"
,"050925 -ballradius applies to -scballs as well as -show \"at\" \r"
,"050928 rework ranges: separate general ranges, ribbon ranges, site ranges\r"
,"050929 cleaned up PC dialog boxes\r"
,"051005 minor housecleaning\r"
,"051007 alternate PKINRIBBon code... NOT IMPLEMENTED YET...\r"
,"051102 add codestr text to all pointIDs\r"
,"051108 CPK also for nucleic acid mc P\r"
,"051112 continue PKINRIBB coding...\r"
,"051114 -spline :meaning changed 051208, use -strand 1 for single mid strand\r"
," -spline :meaning changed back 140520: single mid strand vectorlist\r"
," -skeins 140520 shows all ribbon-defining strands\r"
," -strand # : # stranded ribbon, local curvature offsets.\r"
," -name: name sustitutes for MolNameStr in chain names\r"
,"051116 rainbow color across atom-hetatm-atom chain changes: colorbyNtoC \r"
,"051126 -newribbon tries out new ribbon code, PKINRIBB\r"
,"051128 fix old ribbon code. alpha,beta,coil masters optional -ribbonmasters\r"
,"051129 -listname \"name\" :13 char max: {name} for all lists\r"
," -nosubgroup for MolProbity micromanagement\r"
,"051130 fix -colornc\r"
,"051201 ordered masters for water,hets when -nogroup or -onegroup\r"
,"051204,6,8 more PKINRIBB...\r"
,"051209 -spline to show newribbon raw splines, see old ribbon -guide\r"
,"051212 much newribbon stuff, incl -hbonds for ribbons\r"
,"051213\r"
,"prekinz -ribbon -newribbon -strand 5 -scope -siterec -cbstubs -sc cys -scope -siterec -scballs -show \"at\" -ballradius 0.32 -scope -sc cys -show sc 1RUVbeta.pdb >1RUVbeta.site.kin\r"
,"prekinz -bestribbon -newribbon -scope -siterec -cbstubs -sc cys -scope -siterec -scballs -show \"at\" -ballradius 0.32 -scope -sc cys -show sc 1RUVbeta.pdb >1RUVbeta.site.kin\r"
,"prekinz -bestribbon -newribbon -scope -siterec -cbstubs -sc cys -scope -siterec -scballs -show \"ht,at\" -ballradius 0.32 -scope -sc cys -show sc 1RUVbeta.pdb >1RUVbeta.site.kin use for ribnhet, remember to restore quotes\r"
,"old RCSB: -ribnhet: -bestribbon -colornc -blackedge -nohetconnect -ballradius 0.32 -show \"ht,at\"\r"
,"051217\r"
,"prekinz -bestribbon -newribbon -hbonds -scope -siterec -cbstubs -sc cys -scope -siterec -scballs -show \"ht,at\" -ballradius 0.32 -scope -sc cys -show sc 3PCC.pdb > 3PCC.kin mulltiple subunits, some fragmented\r"
,"051222... kinvrmler takes over from prekin for newribbon kinemages\r"
,"060113 guide points, splines to TEST new ribbon\r"
,"060114 Nucleic ribbons A-form vs B-form by existence of O2prime\r"
,"060115 newribbon axial x spline (-axis), and its local density (-density)\r"
,"060120 -nobutton -residuegroups (<1024) (control with animate)\r"
,"060208 pperpoutlier redefined optimally for pperp-to-line. \r"
," rinhets: only s,p yellow; other non-cno as bigger gray metals\r"
," Virtual BB for nucleic pseudo-backbone\r"
,"060212 unneeded \"space\" removed from master button specification*/\r"
,"6.43.060216 -range cmdline ,-site records, need different range counting\r"
," logic obscurely differs for -ribnhet vs -range badrotamers \r"
,"060322 fix segfault: PKINFILE codestr: limit imposed\r"
,"060324 NOGUI option, esp for MolProbity generic Mac with no MOTIF libraries\r"
,"060227 Makefile: make nogui now doesNOT specify -lXm \r"
,"060531 seqfault fix: PKINCSUB avoids failure at textblock resize(PKINSCRT)\r"
,"6.45.060929 NUCLEIC fake BETA SHEET names--> colorsets, -newribbon default\r"
,"061001 allow p--p--p as well as p--c4'--p as nucleic version of ca--ca--ca\r"
," reworked connectcaca,connectheavy,oldcon\r"
," HETATM nucl: if sc before mc: c1'-n1 part of mc: sc gap to virtualBB\r"
,"061004 arrowhead where ribbon changes rib-identity as well as sec-str end\r"
,"061006 mc and virtual-BB continuity from nucleic to protein residue (tRNA)\r"
,"061011 RIBB fudges a Calpha atom at non-residue Nterm group, e.g. acyl\r"
,"061019 one line NOGUI prekin -version\r"
,"061020 fixed logic with invalid command or file name\r"
,"061021 BETAARROW head logic changed in PKINRIBB.c\r"
,"061029 colorNtoC counter changed for more even blue...red\r"
,"061202 residue connectivity report work ... Lconnectresiduesdump\r"
," workarounds needed: hetatm H given masters and gray color\r"
," loop to try treating hetatm in field of atom as if atom\r"
,"070323 VIZ talk Owen Actrachan : qsort is evil...\r"
,"070512 fix help for atom balls, lone previous nucl O3*,(lots for nucs ?)\r"
,"6.50.070520 first cut pdb new atom names\r"
,"070521 nucleic pprep calc, includes epsilon, both use P of next residue.\r"
,"070627 pprepdump incl insertion codes \r"
,"070726 second cut pdb new atom and residue names\r"
,"070727 fixed dumb mistake in setting element name as records are inputed \r"
," now use inputed or derived element name for all atoms\r"
,"070728 SITE atoms for newpdb (v3.0), chainID lowercase within prekin\r"
,"ribnhet with site... use \"ht,at,hy\" to show Hydrogens...\r"
,"prekinz -bestribbon -newribbon -scope -siterec -cbstubs -sc cys -scope -siterec -scballs -show \"ht,at\" -ballradius 0.32 -scope -sc cys -show sc 1RUV.pdb >1RUV.site.kin\r"
,"070730 prekin broken between 070726 and 070727 for old v2.3 pdb files...\r"
," whatelement() at input made more robust for v2.3 and v3.0\r"
," HET groups not include recognized hydrogens unless hydrogens requested\r"
," ...starting to annotate V3UNSAFE in prekin code...\r"
,"070731 #ifdef GFPchromophore : NOT quite works, NOT implemented\r"
,"070731 first 15 char of atom pointID == cols 13--27 inclusive PDB \r"
," NB not all kinemage points are atoms, eg ribbon ptID only incl residue\r"
," Nucleotide: pperp only done if find O2' atom, i.e. RNA NOT DNA \r"
," Pperp kin outliers indicate 2'<3A, 3'>=3 consistent with MolProbity chart\r"
,"070801 GFP chromophore special case of het within protein chain, ribnhet OK\r"
,"070803 clean up, more work toward ribnhetsite\r"
,"070829 decidemainside flagged for LGFPchromophore (avoid Nucl problem)\r"
,"070926 2 char chainID \r"
,"6.51.071001 Hybrid36 Atom number as string: was ncnt[n] now Anum[n]\r"
,"071002 PKINHY36.c == hybrid_36_c.c from http://cci.lbl.gov/hybrid_36/\r"
,"071215 v3.0 format mutation library\r"
,"071222 try to find bug in mutation-bondrot stuff...\r"
,"080318 try to figure out 071222, fixed crash on -ribbon: 2char chainID \r"
,"080325 cut -libXp out of Makefile.linux : denegrated, not used\r"
," 2char chainID cbetadevdump output\r"
,"080326 080318 broke recognizing hydrogen names: element can be either case\r"
,"080329 linux only ribbon crash: need initial NULL splines,chords,etc.\r"
,"080410 fix disulfide code: connectssbonds just guard against same resnumber\r"
,"080915 -range not being recognized: must order commands:\r"
,"FOR A -scope SET -range \"#-#,#-#,...\" -show \"mc,sc,...\" FOR EACH RANGE\r"
,"081112 fix mchb to always calculate its own H of NH (avoid H name issues)\r"
,"081120,081122 fix ribbon failure when using ribnhet -model \"1\"...\r"
,"090219 now try to fix ribnhet failure...\r"
,"090223 dirty trick: hetatm to atom for prot/nuc ribbons within P or N chain\r"
,"090622,\r"
,"090704 ribbon coil needs black outline...\r"
,"090924 vbc3 reconcile 090223, 090304, and 090704...\r"
,"091129 -operp pperp code for RNA uses O3' instead of next residue P\r"
,"100322 incorporate Calpha + Oazimuth angle from PKINRIBN.070731 to PKINRIBB\r"
,"101024 try to recover plain ribbon output -- nothing done for this\r"
,"101225 tinker output for magekinjas: 3 mc, 3 sc, places in PKINCSUB\r"
,"111106 line 876 PKINRIBB discon=0 always to do VTF fakeCa plots\r"
,"121031 compile for only i386\r"
,"130121 flag -ca3rib use perp to ca-1,ca,ca+1 instead of C=O for rib plane\r"
," Makefile for 10.8.2, recompile...\r"
," compiler logic warning: beware PKINCSBS:1133:cbstubsrib \r"
,"130317 6.54 integrate 090924 vbc3 with 130121 dcr code into svnwork/dcrwork\r"
,"130318 connecthydrogenbyname supersede connecthydrogen by distance\r"
,"130324 ... very tricky, empower -report for suspect connections \r"
,"130329 pperpoutlier limits slightly changed\r"
,"130406 PKINRIBB prune flawed segment end residue, better alloc and tests\r"
,"130415 isahydrogen() elem dominant to name, now elem recognizes D Deuterium\r"
,"130508 jjh added -segid option to use segid instead of chain id\r"
," added functionality to read segid field\r"
," cleaned up compiler warnings\r"
,"130725 investigate 3D printing setup for ribbons... \r"
,"140520 ribbon code to make minimally specified center spline... \r"
," -spline :meaning changed back 140520: single mid strand vectorlist\r"
," -skeins 140520 shows all ribbon-defining strands\r"
,"141223 sj changed the RNA delta angle range for RNA pucker analysis to match suitename and data from RNA11 \r"
,"240709 rt removed duplicate definition of Lribbonnew in header file to allow compiling on new compilers \r"
,"\r"
,"\r"
,"END\r"
}; /*prekinchanges[]*/
/****getversion()*************************************************************/
void getversion()
{
char *OS;
char guiness[64];
PREKINVERSION = (float)6.58;
sprintf(PREKINDATE,"240709 ");
OS = (char *)operatingsystem(); /*PUXMLNX.c,PUXMOSX.c,... or ____INIT*/
guiness[0] = '\0'; /*060324 initialize to take no space in output str*/
#ifdef NOGUI
sprintf(guiness," NOGUI");
#endif
if(OS != NULL)
{
sprintf(version,"version %.2f,%s dated: %s%s"
,PREKINVERSION,OS,PREKINDATE,guiness);
}
else
{
sprintf(version,"version %.2f dated: %s%s"
,PREKINVERSION,PREKINDATE,guiness);
}
}
/*___getversion()____________________________________________________________*/
static char* prekincmdhelp[] =
{"\r"
," This \"help\" is for running prekin from the command line.\r"
,"A partial command line mode (meant for a user to type in) allows specification\r"
,"of input and output files and/or some flags, but invokes the GUI dialog boxes\r"
,"for the rest of the missing information. \r"
,"A fully command-line, or \"quiet\", mode (with no GUI) allows all prekin\r"
,"controls to be specified on the command line; complex examples of such\r"
,"command lines are often generated by a program or may form part of a stored \r"
,"UNIX script, but simple ones such as \"prekin -lots in.pdb >out.kin\" can\r"
,"conveniently be typed by the user. Some of these prekin flags (like \"-lots\"\r"
,"invoke quite complicated combinations, the same ones available through\r"
,"prekin's GUI built-in scripts dialog box. Others are like the options in\r"
,"the range-control dialog box.\r"
,"\r"
,"\r"
,"COMMAND LINE options useful in partial as well as full command line mode:\r"
,"-in filename -out filename \r"
," first unflagged name -> input file, second unflagged name -> output file\r"
," first \"-\" flags stdin; second \"-\" flags stdout, making functional: > >> |\r"
,"-oldpdb :mutations, substitutions: old atom names, default is new v3.1 names\r"
,"-append :opens output in append mode, does NOT write @text,@kinemage,...\r"
,"-notext :does NOT write @text, but does issue @kinemage\r"
,"-nogroup :does NOT write @group... keyword line\r"
,"-nosubgroup :does NOT write @subgroup... keyword line\r"
,"-onlygroups :group for each chain, masters for subgroups\r"
,"-onegroup :one group each molecule or model, masters for chains, subgroups\r"
,"-allbuttons :show all group,subgroup,list buttons (overrides -xxxxgroup)\r"
,"-nosubgroupmasters :(default) NOT write a master={} on @subgroup... lines\r"
,"-subgroupmasters :DOES write a master={} on @subgroup... lines\r"
,"-listname \"name\" :13 char max: {name} for all lists\r"
,"-listmaster \"name\" :14 char max: master={name} for all list masters\r"
," use along with -nogroup and default of -nosubgroupmasters for special \r"
," calls to get a single list, e.g. for bad rot sc, or bad rama mc list\r"
,"-nohetconnect : does not connect het-group fragments, e.g. for thumbnail\r"
,"\r"
,"QUIET BUILT-IN SCRIPTS for full command line mode, NO control dialogs\r"
,"e.g. prekin -lots name.pdb >name.kin \r"
,"+selections: e.g. prekin -lots -show \"wa(gold)[off]\" name.pdb >name.kin \r"
,"-browse :Launch Mage: Calpha,-ss-(nucleic acid pseudo-backbone),non-H2O hets\r"
,"-cass :Calphas & -ss- (nucleic acid pseudo-backbone) non-H2O hets\r"
,"-mchb :mainchain and its h-bonds\r"
,"-aasc :individual amino acids in separate sets and Calphas\r"
,"-lots :mc, sc, ca, (hy), (hets), H2O balls\r"
,"-naba :individual nucleic acid bases in separate sets and lots else\r"
,"\r"
,"-ribnhet: -bestribbon -colornc -blackedge -nohetconnect -ballradius 0.32 -show \"ht,at\" \r"
,"-ribbonmasters: optional masters for alpha,beta,coil\r"
,"-ribbon :variable width as a function of local curvature\r"
,"-newribbon : using code in PKINRIBB default as of prekin.6.45.060929\r"
,"-oldribbon : using code in PKINRIBN until it finally dies...\r"
,"-hbonds : newribbon pseudo-hbonds approx where PKINHBND would place them\r"
,"-byresidue : newribbon skeined ribbons has vectorlist for each residue\r"
,"-arrowheads : newribbon skeined ribbons, arrowheads on beta (SHEET records)\r"
,"-arrows :arrows on beta, ribbons on alpha, by PDB SHEET,HELIX records\r"
,"-bestribbon :ribbon by PDB SHEET,HELIX if present, else single strand coil\r"
," -bestribbon == -arrows , convergent evolution complete!\r"
,"-rnaribbon : force nucleic acid ribbons to be Aform type\r"
,"-dnaribbon : force nucleic acid ribbons to be Bform type\r"
,"\r"
,"-strand # : # of strands for skeined ribbon, local curvature offsets.\r"
,"-fakecalphas : fake Calphas, no Ca--Ca distance filter\r"
,"\r"
," overrides and extras issued after -ribbon or -bestribbon (or -arrows): \r"
,"-also : also do selected sidechains\r"
,"-Aform :do nucleics as A-RNA (rather than B-DNA)\r"
,"-nucbeta :use SHEET records for nucleic ranges with arrow heads\r"
,"-double :do nucleics with doubled interval using c4' \r"
,"-curved :do nucleics with curvature offset \r"
,"-c4prime :do nucleics with curvature offset toward c4' \r"
,"-blackedge :faced ribbon has unpickable black edge strand (bestribbon default)\r"
,"-noblackedge :faced ribbon has same colored edge.\r"
,"-fencepost :(temporary) if ribbons: do fencepost (==BDNA) orientation\r"
,"-noface :(temporary) if ribbons: do not fill in faces\r"
,"-noedge :(temporary) if ribbons: do not do a separate edge strand\r"
,"-cbstubs : ribbon spline stubs to CB for sidechains\r"
,"-cacbvec : CA---CB vector angles to ribbon direction, use with cbstubs \r"
," e.g.: prekin -bestribbon -cbstubs -cacbvec 1bch.pdb > 1bch.cacbvec.kin \r"
,"-cispep : cispeptides emphasized as extra part of a ribbon kinemage\r"
,"-nofudge : ribbons without fudged width and without curvature fudge offset\r"
,"-guide : ribbon guide points displayed (also for newribbons)\r"
,"-skeins : (newribbons) all ribbon-defining splines displayed 140520\r"
," -spline :meaning changed back 140520: single mid strand vectorlist\r"
," -skeins 140520 shows all ribbon-defining strands\r"
,"-spline :meaning changed back 140520: to single mid strand vectorlist\r"
,"-axis: (newribbons) ribbon axial spline \r"
,"-density : (newribbons) local density of ribbon axial splines \r"
,"-ca3rib : Lca3ribbon perp to ca-1,ca,ca+1 instead of C=O for ribbon plane\r"
,"\r"
," set of specialized calculations that use the ribbon code:\r"
,"-cispeponly : cispeptides emphasized as independent part of a kinemage\r"
,"-cispepdump : cispeptides list (just @text, NOT a real kinemage!)\r"
,"-vectorCO :perpendicular vector from Calpha--Calpha to Carbonyl Oxygen\r"
," cispeptides highlighted \r"
,"-labels :label much angle info along with vectorCO vectors\r"
,"-azimuthCO :Calpha--Calpha angle, dihedral, azimuth to Carbonyl Oxygen\r"
,"-phipsiCO :Calpha--Calpha angle,dihedral,azimuthCarbonylOxygen & phi,psi\r"
,"-psiphiCO :Calpha--Calpha angle,dihedral,azimuthCarbonylOxygen & psi,phi\r"
,"-vectCOpdb :only Calpha,azimuth --> pdb format\r"
,"-pdbCACOpdb :pdb format Calpha,azimuth(66-71 f6.2) -->N,Ca,C,O,Cb pdb file\r"
,"\r"
," analysis of geometry around Calpha\r"
,"-calphataudev :deviation from ideal tau angle at Calpha\r"
,"-cbetadev :deviation and spread of ideal beta from actual beta\r"
,"-cbdevdump :deviation of ideal beta as : delineated list (NOT a kinemage!)\r"
,"-cbdevdumpmax :just maximum deviation from ideal beta (NOT a kinemage!)\r"
,"\r"
," analysis of nucleic acid distance between bases and phosphate\r"
,"-pperptobase :phosphate perpendiculars to base on molecule. (kin)\r"
,"-pperptoline :phosphate perpendiculars to c1'--n of base. (kin)\r"
," pperptobase and pperptoline are alternatives for vectors in a kinemage\r"
," pperpplot OR pperpdump change type of output to 3D plot or text-list\r"
,"-pperpplot :3D plot of phosphate perpendiculars to base vs delta. (kin)\r"
,"-pperpdump :colon delineated dump of phosphate perpendiculars to bases\r"
,"-pperpoutliers :outliers only, modifier of above pperp requests\r"
," SO use either pperptobase or pperptoline, then addition flags if desired.\r"
,"\r"
,"-connectdump :colon delineated dump of residue connections (NOT a kinemage)\r"
,"\r"
,"\r"
,"Otherwise to run in full command line mode with NO control dialog boxes\r"
,"must start with -quiet or -scope followed by options and selections\r"
,"\r"
,"GENERAL OPTIONS:\r"
,"-quiet :forces NO dialog boxes: e.g. prekin -quiet -show ... ...\r"
,"-stdoutreport : prekin -stdoutreport ...:only chains reported to stdout\r"
,"-report :writes report to stderr about an otherwise quiet command line run\r"
,"-mage :persistant GUI expects stdout|persistant pipe to mage\r"
,"-animate :adds \"animate\" to end of @group {} ...\r"
,"-nobutton :adds \"nobutton\" to end of @group {} ...\r"
,"-residuegroups: each residue in separate group, (multi-poses: ligand ATOMs)\r"
," less than 1024 hidden groups: -residuegroup -animate -nobutton \r"
,"-alt (-alt_) :selects atoms with NO alternate conformer flag\r"
,"-alta (-altx) :selects atoms with only alternate conformer flag 'a' ('x')\r"
,"-sclists :each sidechain in a separate, nobutton, list\r"
,"-scballs :individual balls on sidechain n,o,s atoms\r"
,"-scrings :triangle tesselation fills sidechain rings\r"
,"-bval :pointID B-values & occupancies\r"
,"-bcol :color by B-values: PDB col 61...66\r"
,"-ocol :color by occ-values: PDB col 55...60\r"
,"-ucol :color by values: PDB col 67...72\r"
,"-colorscale \"name,value,name,value,...,name\" : (<=10)color names & (<=9)dividing values\r"
," n+1 color names separated by n values \r"
,"-colornc :ribbons colored spectrally from N to C (also does Nucleics 5' to 3')\r"
,"-color53 :ribbons colored spectrally from 5' to 3' (also does Proteins N to C)\r"
,"-colorabc :ribbons colored by HEADER alpha, beta, coil\r"
,"-colorbval :ribbons colored by Bvalue of Ca or C1\r"
,"-colorcurvature : ribbons colored by fractional extendedness\r"
,"-halfbonds :intermediate point, ca--.--ca, divides Calpha vectors in half\r"
,"-noaspects :aspects present in PDB file NOT outputted to kinemage\r"
," (aspects produced by default if present in PDB file)\r"
,"-aspectnc :aspect added for spectral colors from N to C\r"
,"-aspectabc :aspect added for coloring by HEADER alpha, beta, coil\r"
,"-atomradii :individual radii on all c,n,o,s,h atoms\r"
,"-polarHradius #.# :radius for polar H atoms, default==1.0\r"
,"-ballradius #.# :radius for all atom marker balls, default==0.2\r" /*041020*/
,"-segid :uses segid to differentiate chains, rather than chainid\r" /*130508*/
,"\r"
,"SELECTIONS:\r"
,"-focusresidue number :focuses on this numbered residue\r"
,"-focuschainID number :focuses on residue in this chain ('_' for blank)\r"
,"-focusradius number :focus radius for sc (was 8: mc,wa,ht set this+2, ca set +7)\r"
,"-chainnum number : output from that number chain as prekin counts them\r"
,"-chainid \"_,A,...\" : output chain with that PDB chain identifier ('_' for blank)\r"
,"-model \"_,1,...,17,...\" : output chain(s) with that PDB model identifier ('_' for blank)\r"
,"-excludesc \"res,res,...\" :every sidechain except those named here\r"
,"-sc \"res,res,...\" :(implies include) only sidechains named here \r"
," (excludesc and sc are incompatible)\r"
,"-scope :starts a new scope of one or more ranges with -show stuff\r"
," forces a quiet run (NO control-dialog boxes)\r"
,"-range \"nstart-nend,nstart-nend,...,...\" :sets of res# start-stop ranges\r"
,"-site \"nstart-nend,nstart-nend,...,...\" :sets of res# start-stop ranges\r"
,"-siterec : SITE records provide sets of res# start-stop ranges\r"
,"\r"
,"-show \"mc,sc,hy,hb,ca,lb,ht,wa\" \r" /*070512*/
," :can specify global color e.g. \"mc(red),sc(blue)\" \r"
," :can specify off e.g. \"mc(red)[off],sc(blue)\" \r"
," mc, sc, hy, hb, ca, lb, ht, wa ,\r"
," mainchain,sidechain,hydrogens,mcHbonds,Calphas,labels, hetatoms,water,\r"
,"-show \"at,ct,mK,sK,hK,cb\" color by convention, come up ON \r" /*070512*/
," at ,ct ,mK ,sK ,hK ; cb \r"
," atom_markers(balls),balls_on_carbons,mcCPKs,scCPKs,htCPKs; Cb_only \r"
,"\r"
,"FOR A -scope SET -range \"#-#,#-#,...\" TO -show \"mc,sc,...\" FOR EACH RANGE\r"
,"E.G.: prekin -scope -range \"9-38,44-73,91-120,122-158,158-170\" -show \"mc,sc\" 2V2P.pdb >2V2P.kin\r"
,"\r"
,"-rotate number :sets up rotations for this numbered residue\r"
,"-mutate number aa : mutate nth res to aa ... (&sets up rotations)\r"
,"-pdbout output of mutated residue in pdb format, nothing else.\r"
,"-emphasis: rotatable vectors emphasized as fat lines\r"
,"-noemphasis: rotatable vectors NOT emphasized as fat lines\r"
,"-superpos aa :superpositions all these aa by their ideal Cbeta\r"
," use -pdbout with -matrix, -center, and -translate (e.g. for biol unit PDB)\r"
,"-matrix : #.# #.# #.# #.# #.# #.# #.# #.# #.# (==3x3 matrix) \r"
," : m11 m12 m13 m21 m22 m23 m31 m32 m33 (idn 1 0 0 0 1 0 0 0 1) \r"
,"-center : #.# #.# #.# (cx cy cz) defaults to 0,0,0\r"
,"-translate : #.# #.# #.# (tx ty tz) defaults to 0,0,0\r"
," when matrix and center given: \r"
," subtract center xo = x - cx, yo = y - cy, zo = z - cz\r"
," apply matrix xm = xo*m11 + yo*m21 + zo*m31 \r"
," xm = xo*m12 + yo*m22 + zo*m32 \r"
," xm = xo*m13 + yo*m23 + zo*m33 \r"
," add back center x = xm + cx, y = ym + cy, z = zm + cz \r"
," when translate given: x = x + tx, y = y + ty, z = z + tz \r"
," when only center given: just add center to coords.\r"
,"-passkeyword \"...\" : keyword to pass to mage, e.g. @whitebackground \r"
,"-code \"...\" : codestr in every pointID, \" \":prekin invents PDB code... \r"
,"-name \"...\" : molecstr substitutes for molecule name of groups... \r"
,"\r"
,"NOGUI option: as of prekin.6.44.060324 can be compiled with target nogui\r"
," commandline control only, e.g. for MolProbity with no MOTIF libraries\r"
,"\r"
,"-html: writes html formated helpful stuff, then quits.\r"
,"-help: writes this help listing then quits.\r"
,"-version: writes version then quits.\r"
,"-changes: writes chronological list of code changes then quits.\r"
," try: prekin -help | more OR: prekin -html > prekin.html THEN use browser\r"
,"\r"
,"END\r"
}; /*prekincmdhelp[]*/
/*this next section seems unmaintainable to me now on 040924 !!!! ???? */
static char* prekinribbonhelp[] =
{"\r"
,"040425 too many options, many superceeded\r"
," current nucleic ribbons use midpoint of successive P's as guide pts\r"
," need: -rnaribbon -c4prime\r"
," curvature from distance of nearest next P to midpoint of P---P interval\r"
," start offset at dist < 9A, scaled from dist 7 -- 9, \r"
," offset toward c4' atom as a fraction of distance between midpt and c4'\r"
," however allowing the guide point to go 1A beyond the c4' since the\r"
," B-splines on a curve never quite get out to their guide points anyway.\r"
,"\r"
,"\r"
,"-ribbon :variable width as a function of local curvature\r"
,"-arrows :arrows on beta, ribbons on alpha, by PDB SHEET,HELIX records\r"
,"-bestribbon :ribbon by PDB SHEET,HELIX if present, else variable width\r"
,"-rnaribbon :bestribbon with nucleic acids as Aform rather than Bform type\r"
,"-dnaribbon :bestribbon with nucleic acids as Bform rather than Aform type\r"
,"-Aform :if ribbons do nucleics as A-RNA rather than B-DNA\r"
,"-nucbeta :if ribbons use SHEET records for nucleic ranges with arrow heads\r"
,"-double :if ribbons do nucleics with doubled interval using c4'\r"
,"-curved :if ribbons do nucleics with curvature offset\r"
,"-c4prime :if ribbons do nucleics with curvature offset toward c4'\r"
,"-blackedge : faced ribbon has unpickable black edge strand \r"
," Ribbon Splines calculated for interval 2--3 of sequentual residues 1234 \r"
," Protein Ribbons are based on crossties in the peptide planes\r"
," A = CA[3] - CA[2], B = O[2] - CA[2], C = AxB, D = CxA \r"
," crosstie D parallel to peptide plane, perpendicular to A \r"
," guide points are displaced both ways from midline along D \r"
," fencepost uses C as guide point direction across ribbon\r"
,"\r"
," RNA Ribbons \r"
," A = P[3] - P[2], B = c1'[2] - c3'[2], C = AxB, D = CxA \r"
," crosstie D parallel to pseudo-plane p,c3',c1',p+1 perpendicular to A \r"
," guide points are displaced both ways from midline along D \r"
," BNA Ribbons use fencepost C direction for guide point direction \r"
,"\r"
,"-fencepost :(temporary) if ribbons: do fencepost (==BDNA) orientation\r"
,"-noface :(temporary) if ribbons: do not fill in faces\r"
,"-noedge :(temporary) if ribbons: do not do a separate edge strand\r"
,"\r"
,"END\r"
}; /*prekinribbonhelp[]*/
static char* prekinVRMLhelp[] =
{"\r"
,"annotations: 050212... VRML output for 3D printer\r"
,"run prekin.6.40.050212 (or later) from the GUI\r"
,"Probably should name output kinemage file with .wrl extant\r"
,"(Prekin always thinks that it is writing kinemage files and will\r"
," report things that do not actually appear in the VRML output)\r"
,"Example directions to make a ribbon with disulfide crosslinks,\r"
,"a few sidechains, and arrowheads on beta sheet strands as\r"
,"specified by SHEET records in the pdb file header records.\r"
,"NOTE that usually defaults are set for what you want to do, \r"
,"in doubt, just click \"OK\".\r"
,"PREKIN_DLOG: PREKIN NEW PASS, select \"first: Reset Options\" click \"OK\"\r"
,"PREKIN_DLOG: Various Kludges, select \"VRML output, e.g. for 3D Printer\" click \"OK\"\r"
,"PREKIN_DLOG: PREKIN NEW PASS, select \"New Ranges\" click \"OK\"\r"
,"PREKIN_DLOG: (Range Control) type \"cys\" in place of \"...\", select \"sc: sidechain\", select \"at: atom markers or balls (not C or H)\", select \"Ribbon: by curvature over entire range\", click \"OK\".\r"
,"Since option \"OK accepts and comes back for more\" is the default, then again get:\r"
,"PREKIN_DLOG: (Range Control) type \"his\" in place of \"...\", select \"sc: sidechain\", select \"at: atom markers or balls (not C or H)\", select \"Ribbon: by curvature over entire range\", select \"OK accepts and end ranges\", click \"OK\"\r"
,"(Of course, here one would probably want to do one-by-one just the particularly important histidine sidechains to illustrate the active site.)\r"
,"( in that case, set \"Number of start residue\" = \"Number of end residue\" = residue number of interest as well as that residue 3-letter code.)\r"
,"PREKIN_DLOG: Focus Point Options, select \"No focus at all\", click \"OK\"\r"
,"PREKIN_DLOG: Atom Marker choices:, \"Current radius of ball\" is probably set to something reasonable, and \"atom mark = ball, of radius given above\" should already be selected, click \"OK\".\r"
,"PREKIN_DLOG: Ribbon Control Values, defaults should be set for VRML, particularly \"number of strands\" 5 makes a good solid ribbon, and must use \"Ribbon of long skeins\", click \"OK\".\r"
,"PREKIN_DLOG: Subunit, or molecule, choice:, usually will do only one subunit, but in a file of a monomer that is all subunits of input file, click \"OK\".\r"
,"PREKIN: general report window... now for this example we want arrowheads so need another pass:\r"
," select from top menu bar File/New Pass\r"
,"PREKIN_DLOG: PREKIN NEW PASS, select \"Selection of built-in Scripts\", click \"OK\".\r"
,"PREKIN_DLOG: kinemage built-in scripts, select \"bestribbon: HELIX & SHEET from pdb header,...\", click \"OK\".\r"
,"PREKIN_DLOG: Ribbon Control Values, here we are subverting how prekin does its fancy ribbons and will only get the few vectors of the arrrowheads written out in VRML format,\r"
," the settings should be now set so (near the bottom) should see selected \"Edged, flat faced ribbon (instead of skeins)\", click \"OK\".\r"
,"PREKIN_DLOG: Subunit, or molecule, choice:, select whatever you did last time, then click \"OK\".\r"
,"PREKIN: general report window... now you have the complete VRML output, so \r"
,"select from top menu bar File/Quit\r"
,"Find your VRML file and read it into a VRML viewer, or directly into the 3D Printer...\r"
,"\r"
,"\r"
,"\r"
,"END\r"
}; /*prekinVRMLhelp[]*/
/****mainlooprouter()*********************************************************/
void mainlooprouter() /*PKININIT*/ /*common routing in mainloop*/
{
/*
fprintf(stderr,"Prekin enters mainlooprouter() with Lnewfile== %d, Lstartfile== %d, Lnewpass== %d, Lthispass== %d, mrange== %d\n",Lnewfile,Lstartfile,Lnewpass,Lthispass,mrange);
*/
if(Lhelpoutopen)
{/*must re-call writehelptohtmlfile() when opened with non-modal dialogs*/
writehelptohtmlfile(1); /*called with 0 from menu, 1 revisits 040425*/
}
if(Lnewfile)
{
selectfiles(); /*PKINFILE.C, if successful, sets Lnewpass=1*/
if(!Lnewpass)
{/*failed somewhere in the file name and open business*/
Lgot_infilename = 0; /*ready for new set of files*/
Lgot_outfilename = 0;
Lgot_infileopen = 0; /*ready for new set of files*/
Lgot_outfileopen = 0;
}
if(Lquiet)
{
if(Lerr) return;
Lnewpass=0;
Lgetranges=1;
if(Lin_stdin) Lthispass = 2;
}
}
if(Lnewpass)
{
/*
fprintf(stderr,"Prekin gets Lnewpass with Lcommanded: %d, Lbuiltin: %d, Lthispass: %d\n",Lcommanded,Lbuiltin,Lthispass);
*/
if(Lthispass==1)
{
Lnewpass = 0;
Lnewpassflow = 1;
}
else
{
Lnewpass = 0;
Lnewpassflow = 0;/*later used to continue with a newpass*/
Lrangestart = 1; /*to call rangestartinitialize() from getranges()*/
Lgetranges = 1; /*to call getranges()*/
}
}
if(Lgetranges && !Lwaiting)
{
/*
fprintf(stderr,"Prekin calls getranges with Lcommanded: %d, Lbuiltin: %d\n",Lcommanded,Lbuiltin);
*/
getranges(); /*PKINRNGE.c*/ /*971029*/
}
if(Lfinishranges)
{
Lfinishranges = 0;/*971029 reset this here*/
finishranges(); /*PKINRNGE.c*/ /*971029*/
}
if(Lnewpassflow && fpinput!=NULL) /*971029 new flag to unload Lnewpass */
{
/*Lnewpassflow = 0;*/ /*990506 reset this in flowControl() after HEADER */
#ifdef PCWINDOWS
makecursorwait(); /*990407b Future Feature for Mac, UNIX*/
#endif
if(Ltestprint) printf("mainlooprouter about to call flowControl()WWWWWWWWWWWWWWWWWWWWWWWWW\n");
/*
fprintf(stderr," Lribonucleic== %d\n", Lribonucleic);
fprintf(stderr," Lfudgedwidth== %d\n", Lfudgedwidth);
fprintf(stderr," Lonestrandcoil== %d\n", Lonestrandcoil);
fprintf(stderr," Lbetaarrows== %d\n", Lbetaarrows);
fprintf(stderr," Lsmoothtwist== %d\n", Lsmoothtwist);
fprintf(stderr," LcolorbyNtoC== %d\n", LcolorbyNtoC);
fprintf(stderr," LNtermBetaFudge== %d\n", LNtermBetaFudge);
fprintf(stderr," LNOfudge== %d\n", LNOfudge);
fprintf(stderr," Lribbonguidepts== %d\n", Lribbonguidepts);
fprintf(stderr," Lnucleicarrows== %d\n", Lnucleicarrows);
fprintf(stderr," Lcrosstie== %d\n", Lcrosstie);
fprintf(stderr," Ledgedribbon== %d\n", Ledgedribbon);
fprintf(stderr," Lskeinedribbon== %d\n", Lskeinedribbon);
*/
flowControl(); /*PKINCRTL.c*/
#ifdef PCWINDOWS
makecursoractive(); /*990407b Future Feature for Mac, UNIX*/
#endif
}
}
/*___mainlooprouter()________________________________________________________*/
/****initialvalues()*********************************************************/
void initialvalues(void)
{
int j;
IDEMO = 0;
/* IDEMO == 1 for big type, terse comments, set in kludges dialog*/
/* IDEMO == 0 for regular use prekin, keep this 0 here!*/
textHeight = 1;
widMax = 1;
maxValue=10000;
minValue = 0;
Lnewcoord=0;
Lnewfile=0;
Lgetfile=0;
Lcontrols=0;
Linein=0;
Loption=0;
Lallaminoacids = 0;
Lthispass = 1; /*initial pass, scan for subunit pattern */
UseSEGIDasChain = 0; /*initialization 130507 JJH*/
Nchainfirstpass = 0;
for(j=0; j<256;j++)
typechainfirstpass[j] = ' '; /*char str*/ /*991210 Protein, Nucleic,...*/
kindchainfirstpass[j] = ' '; /*char str*/ /*060114: space char, Dna, Rna*/
codechainfirstpass[j][0] = ' '; /*char str*/ /*010426, 2char 070926*/
codechainfirstpass[j][1] = ' '; /*char str*/ /*010426, 2char 070926*/
codechainfirstpass[j][2] = '\0'; /*char str*/ /*010426, 2char 070926*/
/*segidfirstpass[j][0] = ' ';
segidfirstpass[j][1] = ' ';
segidfirstpass[j][2] = ' ';
segidfirstpass[j][3] = ' ';
segidfirstpass[j][4] = '\0';*/
Lnewpass = 0; /*set this when get valid input/output files */
Lpassposs = 0;
npass = 1;
Linclusive = 1; /*usually include given ranges*/
newkinemage = 1;
Lallsubunits = 1; /*990403*/
Lfirstsubunit = 0; /*990403*/
Lneedsubunits = 0;
/* fovea, focus distances */
focus[1] = 0.0;
focus[2] = 0.0;
focus[3] = 0.0;
focusca = focuscadefault = 15.0;
focusmc = focusmcdefault = 10.0;
focussc = focusscdefault = 8.0;
focuswa = focuswadefault = 10.0;
focusht = focushtdefault = 10.0;
focuschaincharcode[0] = ' '; /*011109 2char 070926*/
focuschaincharcode[1] = ' '; /*011109 2char 070926*/
focuschaincharcode[2] = '\0'; /*011109*/
nLines = 0;
Lleftadjatomname = 0;
Lhetconnect = 1; /*990403*/
Lribnhet = 0; /*051214 distinguish this call to make ribbons, re RCSB PDB*/
Lexplanation = 0;
Lmagekinjas = 0; /*101225*/
/*ribbon and reduced-representation default parameters*/
Lribbon = 0;
Lribbonalso = 0; /*050206*/
Lbestribbon = 0; /*011030*/
Lribonucleic = 0; /*040226*/
LdoRNAribbon = 0; /*060114 force RNA A form ribbon*/
LdoDNAribbon = 0; /*060114 force DNA B form ribbon*/
Ldoublenucleics = 0; /*040419*/
Lcurvednucleics = 0; /*040420*/
Lc4primenucleics = 0; /*040422*/
Lnucleicarrows = 0; /*040228*/
Larrowhead = 0; /*051210*/ /*for newribbon, skeined with arrows*/
Lbyresidue = 0; /*051210*/ /*for newribbon, skeined with arrows*/
Lcbstubsrib = 0; /*041205 ribbon---CB stubs to attach sidechain to spline*/
Lcacbvector = 0; /*050403*/
for(j=0;j<5;j++){Lcbrib[j]=0;} /*041205*/
LNOfudge = 0; /*050327*/
Lribbonguidepts = 0; /*050327*/
Lribbonrawsplines = 0; /*051208*/
Lribbonaxisspline = 0; /*060115*/
Lsplinevector = 0; /*140520*/
Lribbondensity = 0; /*060115*/
LvectorCO = 0; /*030125*/
LvectorCOlabels = 0; /*041023*/
Lcispeptides = 0; /*041102*/
Ldumpcispeptides = 0; /*041023*/
LazimuthCO = 0; /*030128*/
LphipsiCO = 0; /*030128*/
LpsiphiCO = 0; /*030128*/
LvectCOpdb = 0; /*030129*/
LpdbCACOpdb = 0; /*030202*/
LfakeCaCaspline = 0; /*111106*/
fpoutput = 0;
/*more ribbon default parameters*/
nstrnd = 2;
onestrandcoilwidth = 4; /*integer flag for point width*/
ribwidcoil = 1.0;
ribwidalpha = 2.0;
ribwidbeta = 2.2;
ribwidnucleic = 3.0;
ribwidVRML = 2.0; /*050204*/
Lfudgedwidth = 1;
LNtermBetaFudge = 1; /*030706*/
Lcrosstie = 0;
Ledgedribbon = 1;
Lskeinedribbon = 0;
Lbetaarrows = 0;
Lonestrandcoil = 0;
Lsmoothtwist = 1;
Lcolorbycurvature = 0; /*010530x*/
LcolorbyNtoC = 0; /*010530x*/
LcolorbyABC = 0;
LcolorbyBval = 0; /*021213*/
ichord = 4; /* number of vec/res */
/*#define CORDER 4 */ /*order of the B-spline defined in PKINRIBN.C*/
Lpeptideperprib = 0; /*040319*/
Lnoface = 0; /*040319*/
Lnoedge = 0; /*040319*/
Lblackedge = 0; /*040924*/
/*atom marker controls*/
Lballs = 1;
ballradius = (float).2;
Ldotsonly = 0;
Lcrosses = 0;
Latomradii = 0; /*for cavity definition 030330*/
polarHradius = 1.0; /*for cavity definition 030331*/
Lexplanation = 0;
Llaunchkinemage = 0;
Llaunchcurrentkin = 0;
Llaunchdiffkin = 0;
Lskip = 0;
Lmadekin = 0;
Lbrowsedefault = 0;
Lindicator = 0;
Lquiet = 0;
Lstdoutreport = 0; /*030502*/
Lpperptobase = 0; /*030515*/
Lpperptoc1nline = 0; /*050125 pperp to c1'--nbase line instead of base plane*/
Lplotpperptobase = 0; /*030519*/
Ldumppperptobase = 0; /*040202*/
Lpperpoutliersonly = 0; /*040705*/
Lkinmasters = 0; /*030519*/
Lhylens = 0; /* lens on hydrogen lists*/
Listext = 0; /* extra output at end of pass, controled from kludges*/
MolNameStr[0] = '\0';
ShortNameStr[0] = '\0';
Lwaiting = 0; /* used in PKININIT/mainlooprouter()*/
Ltable = 0; /*signel for table group 991122 */
Lcanlaunchmage = 1; /*move out from PCWINDOWS for everybody 010530*/
/*MAC also still has its own place to set this*/
#ifdef PCWINDOWS /*Mac deals with these in its own way*/
/*folowing values moved from PCinitialvalues(obsolete) */
Lappleevents = 0;
Lstartfile = 0; /*presume prekin not launched by a file*/
Lin_stdin = 0;
Lout_stdout = 0;
Lgot_infilename = 0; /*ready for new set of files*/
Lgot_outfilename = 0;
Lgot_infileopen = 0; /*ready for new set of files*/
Lgot_outfileopen = 0;
#endif
Lcolorscale = 0; /*flag for DoColorScaleDialog, set in Kludges Dialog*/
Ncolorscale = 10; /*number of colors of the colorscale */
Ncolorscalebasis = 1;/*1:Bvalue 61...66, 2:occ 55...60, 3:Unusual 67...72*/
/*Scale by f-stop: 1,1.4,2,2.8,4,5.6,8,11,16,22,32,44,64 */
/*but we do B cut offs at 30 and 40, so:*/
colorscale[1].origvalue = 4.0;
colorscale[2].origvalue = 8.0;
colorscale[3].origvalue = 11.0;
colorscale[4].origvalue = 16.0;
colorscale[5].origvalue = 22.0;
colorscale[6].origvalue = 30.0;
colorscale[7].origvalue = 40.0;
colorscale[8].origvalue = 60.0;
colorscale[9].origvalue = 100.0;
colorscale[10].origvalue = 999.0;
for(j=1; j<=10; j++) colorscale[j].value = colorscale[j].origvalue;
strcpy(colorscale[1].origcolor,"blue");
strcpy(colorscale[2].origcolor,"purple");
strcpy(colorscale[3].origcolor,"magenta");
strcpy(colorscale[4].origcolor,"hotpink");
strcpy(colorscale[5].origcolor,"red");
strcpy(colorscale[6].origcolor,"orange");
strcpy(colorscale[7].origcolor,"gold");
strcpy(colorscale[8].origcolor,"yellow");
strcpy(colorscale[9].origcolor,"yellowtint");
strcpy(colorscale[10].origcolor,"white");
for(j=1; j<=10; j++) strcpy(colorscale[j].color,colorscale[j].origcolor);
Leachsclist = 0; /*each sidechain in its own list, set in Kludges Dialog*/
Lballonscpoints=0; /*individual balls on sidechain points, Kludges Dialog*/
Lfillscrings = 0; /*triangle tesselation fills sidechain rings*/
Lcbonly = 0; /*ca--cb only part of sidechain outputted*/
Lhalfbonds = 0; /*intermediate point divides vector into halves*/
Lnotext = 0; /*still issues @kinemage, but like Lappend does NOT do text*/
Lallbuttons = 0; /*overrides and cancels Lonlygroups,Lonegroup,Lnogroups */
Lonlygroups = 1; /*uses dominant groups with masters for subgroups, etc.*/
Lonegroup = 0; /*one dominant group with masters for chains, subgroups,...*/
Lnogroups = 0; /*NO groups, but masters for chains, subgroups, etc.*/
Lnosubgroups = 0; /*NO subgroups 051129*/
Ngroups = 0; /*counter for Number of groups per pass or MODEL */
Lhypertextstuff = 0; /*hypertext commands, e.g. mutant rotamer angles */
/*------output color overrides, one for each type of output */
colormcvec[0] = '\0';
colorscvec[0] = '\0';
colorcavec[0] = '\0';
colorhyvec[0] = '\0';
colorhtvec[0] = '\0';
colorhbvec[0] = '\0';
colorwavec[0] = '\0';
colorlbvec[0] = '\0';
colorextra[0] = '\0'; /*041106*/
/*------output ON/OFF overrides, one for each type of output */
offmc[0] = '\0';
offsc[0] = '\0';
offca[0] = '\0';
offhy[0] = '\0';
offht[0] = '\0';
offhb[0] = '\0';
offwa[0] = '\0';
offlb[0] = '\0';
Naspectcode = 0; /*counter for color coded aspects for individual atoms*/
Lallowaspectsin = 1; /*flag for using aspects if present in PDB file*/
Lnosubgroupmasters = 1; /*default 011028*/
Lspeciallistmaster = 0; /*special list master 040902*/
speciallistmaster[0] = '\0'; /*special list master 040902*/
Lspeciallistname = 0; /*special list name 051129*/
speciallistname[0] = '\0'; /*special list name 051129*/
ntypes =0;/*number recognized scratch-flags of individual output lists 011202*/
LIOmage = 0; /*020514*/
LIOpipe = 0; /*020514*/
LdumpVRML = 0; /*050204*/
LsplineVRML = 0; /*050204*/
LheaderVRML = 0; /*050204*/
LvectorVRML = 0; /*050208*/
LsphereVRML = 0; /*050209*/
LarrowVRML = 0; /*050212*/
/*max value of 32 bit float is about 10^38 with 7 significant digits*/
fxmin = (float)1E37; /* scaling limits initialized wimperwhump*/
fxmax = (float)-1E37;
fymin = (float)1E37;
fymax = (float)-1E37;
fzmin = (float)1E37;
fzmax = (float)-1E37;