C PROTEIN DATA BANK SOURCE CODE BENDER BENDER21 C AUTHOR. G.WILLIAMS BENDER22 C ENTRY DATE. 11/78 SUPPORTED BENDER23 C LAST REVISION. 4/82 BENDER31 C PURPOSE. PARAMETERS FOR BENT-WIRE MODELS BENDER25 C LANGUAGE. FORTRAN IV BENDER26 C BENDER27 C BENDER28 C BENDER29 C BENDER10 PROGRAM BENDER(INPUT,OUTPUT,TAPE1,TAPE2,TAPE5=INPUT,TAPE6=OUTPUT) BENDER 3 C BENDER 4 C PROGRAM *BENDER* BENDER 5 C BENDER 6 C PROTEIN DATA BANK PROGRAM TO CALCULATE THE QUANTITIES BENDER 7 C NECESSARY TO BUILD A BENT-WIRE MODEL WHICH DISPLAYS THE MAIN-CHAINBENDER 8 C CONFORMATION OF A PROTEIN OR NUCLEIC ACID MOLECULE. BENDER 9 C BENDER10 C REFER TO *THE SIMPLE CONSTRUCTION OF PROTEIN ALPHA-VARBON MODELS* BENDER11 C BY BYRON RUBIN AND JANE S. RICHARDSON, BIOPOLYMERS VOL. 11, P 2381BENDER12 C (1972). BENDER13 C BENDER14 C BENDER15 C WRITTEN BY GRAHEME J.B. WILLIAMS BENDER16 C PROTEIN DATA BANK BENDER17 C DEPARTMENT OF CHEMISTRY BENDER18 C BROOKHAVEN NATIONAL LABORATORY BENDER19 C UPTON, NEW YORK 11973 U.S.A. BENDER20 C BENDER21 C THE PROTEIN DATA BANK IS FUNDED BY THE NATIONAL SCIENCE FOUNDATIONBENDER22 C UNDER GRANT PCM 77-16811. BENDER23 C BENDER24 C THE USE OF A LIBRARY OF VECTOR MANIPULATION ROUTINES WRITTEN BY BENDER25 C LAWRENCE C. ANDREWS IS GRATEFULLY ACKNOWLEDGED. BENDER26 C BENDER27 C PLEASE NOTIFY THE PROTEIN DATA BANK OF ANY DIFFICULTIES BENDER28 C ENCOUNTERED IN USING THIS PROGRAM. BENDER29 C BENDER11 C CORRECTION. DELETE BAD CARD AND REPLACE IT WITH THE CORRECT BENDER12 C COMMENT CARD. 22-JAN-79. BENDER13 C BENDER11 C CORRECTION. INSERT COMMENT CARDS AT BEGINNING FOR USE BY BENDER12 C DIRECTORY PROGRAM. 20-SEP-79. BENDER13 C BENDER32 C CORRECTION. ENDFILE JOUT BETWEEN DATA ENTRIES. 26-APR-82. BENDER33 C BENDER34 C BENDER30 C BENDER31 C DEVICES/FILES USED BENDER32 C BENDER33 C A. CARD READER (LOGICAL UNIT NO. 5, SYMBOLIC NAME JCARD) BENDER34 C BENDER35 C ONE CARD IS READ FOR EACH PROTEIN DATA BANK ENTRY TO BE BENDER36 C PROCESSED. THIS CARD CONTAINS, BENDER37 C BENDER38 C 1. IN COLS 1-60 A TITLE WHICH WILL BE COPIED TO THE PRINTER BENDER39 C BENDER40 C 2. THE ATOM IDENTIFIER OF THE TEST ATOMS TO BE USED IN THE BENDER41 C CALCULATIONS IF IT IS DESIRED TO OVERRIDE THE DEFAULTS OF * CA * BENDER42 C AND * P * FOR PROTEINS AND NUCLEIC ACIDS RESPECTIVELY. THIS ATOMBENDER43 C IDENTIFIER IS READ FROM COLS 61-64. THE PROGRAM CAN DETECT BENDER44 C WHETHER IT IS PROCESSING A PROTEIN OR NUCLEIC ACID COORDINATE SET BENDER45 C AND SO THERE WILL USUALLY BE NO NEED FOR AN ENTRY IN THIS FIELD. BENDER46 C BENDER47 C 3. THE SCALE FACTOR (MM/ANGSTROM) AT WHICH IT IS PLANNED TO BENDER48 C BUILD THE MODEL (DEFAULT VALUES ARE 5 MM/A FOR PROTEINS AND BENDER49 C 3 MM/A FOR NUCLEIC ACIDS). THIS FLOATING POINT SCALE FACTOR BENDER50 C IS READ FROM COLUMNS 66-70. NOTE THAT ALTHOUGH THE DISTANCES ARE BENDER51 C CALCULATED IN ANGSTROMS AND THE SCALE FACTOR IS IN MM/A THE BENDER52 C COMMERCIALLY AVAILABLE WIRE-BENDING DEVICE IS CALIBRATED IN INCHESBENDER53 C AND SO THE PRINTED WIRE INCREMENTS ARE GIVEN IN INCHES. BENDER54 C BENDER55 C 4. IN ORDER TO DETECT DISCONTINUITIES IN THE MAIN-CHAIN EACH BENDER56 C DISTANCE CALCULATED BETWEEN PAIRS OF TEST ATOMS IS EXAMINED. IF BENDER57 C THE DISTANCE IS GREATER THAN ALLOWED, A *CHAIN-BREAK* IS SIGNALLEDBENDER58 C AND THE TABULAR OUTPUT IS MADE DISCONTINUOUS. FOR PROTEINS AND BENDER59 C NUCLEIC ACIDS THE ALLOWED MAXIMUM SEPARATIONS OF TEST ATOMS ARE BENDER60 C 4.6 AND 9.0 ANGSTROMS RESPECTIVELY UNLESS THE DEFAULT IS OVER- BENDER61 C RIDDEN, FOR THIS ENTRY, BY A NON-ZERO VALUE IN COLS 71-75. BENDER62 C BENDER63 C 5. IF IT IS DESIRED TO OVERRIDE EXPLICIT CHAIN BREAKS (I.E. BENDER64 C TER RECORDS) THEN COLS 76-80 SHOULD CONTAIN A POSITIVE INTEGER. BENDER65 C IMPLICIT CHAIN BREAKS MAY BE OVERRIDDEN BY USING A VERY LARGE BENDER66 C VALUE IN THE PRECEEDING FIELD. IF A CHAIN BREAK IS OVERRIDDEN THEBENDER67 C ENTIRE MOLECULE MAY (POSSIBLY) BE MADE FROM ONE PIECE OF WIRE BENDER68 C (ALBEIT WITH ONE OR MORE VERY LONG LINKAGES). BENDER69 C BENDER70 C B. PRINTER (LOGICAL UNIT NO. 6, SYMBOLIC NAME JOUT) BENDER71 C BENDER72 C FOR EACH PROTEIN DATA BANK ENTRY PROCESSED THE IDENTIFYING BENDER73 C INFORMATION IS PRINTED AND THIS IS FOLLOWED BY ONE TABLE OF BENDER74 C *BENDER* PARAMETERS FOR EACH DISTINCT CHAIN FOUND IN THE ENTRY. BENDER75 C BENDER76 C C. TAPE1 (LOGICAL UNIT NO. 1, SYMBOLIC NAME JIN) BENDER77 C BENDER78 C THIS IS THE FILE FROM WHICH THE ORIGINAL PROTEIN DATA BANK BENDER79 C ENTRIES ARE READ. IT IS EXPECTED THAT END-OF-FILE MARKS EXIST BENDER80 C BETWEEN ENTRIES AND THAT THE STANDARD PDB FORMATS ARE FOLLOWED. BENDER81 C ADAPTING THIS PROGRAM TO OTHER INPUT FILE FORMATS SHOULD INVOLVE BENDER82 C LITTLE MORE THAN CHANGING A FEW FORMAT SPECIFICATIONS AND BENDER83 C ARRANGING FOR THE COORDINATES TO BE CONVERTED TO ORTHOGONAL BENDER84 C ANGSTROMS IF NECESSARY. BENDER85 C BENDER86 C D. TAPE2 (LOGICAL UNIT NO. 2, SYMBOLIC NAME JTEMP) BENDER87 C BENDER88 C THIS FILE IS USED AS A RE-READ DEVICE FOR THE SEQRES RECORDS AND BENDER89 C FOR TEMPORARY STORAGE OF THE ATOMIC COORDINATE RECORDS OF THE TESTBENDER90 C ATOMS. THIS FILE IS REWRITTEN FOR EACH ENTRY PROCESSED. BENDER91 C BENDER92 C BENDER93 C THIS PROGRAM EXPECTS THAT EACH ALPHA-CARBON ATOM WILL OCCUR IN THEBENDER94 C INPUT DATA-BANK ENTRY ONLY ONCE. IF THE ALTERNATE ATOM LOCATION BENDER95 C FLAG IS SET (I.E. THE ATOM OCCURS IN MORE THAN ONE PLACE AND THESEBENDER96 C ARE REPRESENTED BY DISTINCT COORDINATE RECORDS) ONLY THE FIRST OF BENDER97 C EACH SET OF DISORDERED POSITIONS IS ACCEPTED. BENDER98 C BENDER99 C BENDE100 C MACHINE DEPENDENCIES BENDE101 C BENDE102 C THE DEPENDENCE OF THIS PROGRAM ON ANY SPECIAL SOFTWARE OR HARDWAREBENDE103 C FEATURE HAS BEEN MINIMIZED BY BENDE104 C 1. STORING A MAXIMUM OF FOUR LITERAL CHARACTERS IN EACH WORD BENDE105 C 2. USING REAL WORDS FOR THE STORAGE OF CHARACTERS, THUS BENDE106 C AVOIDING THE DIFFICULTIES ASSOCIATED WITH THE SMALLER BENDE107 C CAPACITIES OF INTEGERS ON SOME MINICOMPUTERS. BENDE108 C 3. NOT USING ANY ENCODE OR DECODE STATEMENTS. BENDE109 C BENDE110 C THE VARIABLES LISTED BELOW ARE USED TO STORE LITERAL (CHARACTER, BENDE111 C HOLLERITH) INFORMATION BENDE112 C BENDE113 C ALT, ATNAM, BLANK, CHAIN, PRONAM, RECORD, RES, RESNAM, RNANAM, BENDE114 C SAVNAM, SERT, TAG, TESATM, TITLE, WHATIS BENDE115 C BENDE116 C THE CDC-SPECIFIC END-OF-FILE TEST IS USED, HOWEVER, IN BENDE117 C COMBINATION WITH THE (AGAIN CDC SPECIFIC) TWO-BRANCH LOGICAL IF BENDE118 C TEST, E.G. IF(EOF(JCARD)) 99,100 BENDE119 C THIS TEST WOULD TRANSFER CONTROL TO THE STATEMENT LABELLED 99 IF BENDE120 C THE TEST HAD RETURNED A TRUE RESULT, I.E. AN END-OF-FILE HAD BEEN BENDE121 C ENCOUNTERED ON THE LAST READ FROM UNIT JCARD. IF NO END-OF-FILE BENDE122 C WAS MET THE FALSE BRANCH WOULD BE TAKEN AND CONTROL WOULD TRANSFERBENDE123 C TO THE STATEMENT WITH LABEL 100. BENDE124 C BENDE125 C THIS TEST HAS AN EQUIVALENT ON MOST COMPUTERS AND THE APPROPRIATE BENDE126 C CODE SHOULD BE PROVIDED FOR THE READS FROM THE FILES INPUT AND BENDE127 C TAPE1. BENDE128 C BENDE129 DIMENSION ALT(4), RES(4), JSEQ(4), SERT(4), XYZ(3,4), CHAIN(4) BENDE130 DIMENSION TAG(12), RECORD(67), D(3), ANG(2), V(3), TESATM(4,2) BENDE131 DIMENSION RESNAM(13), DTEST(2), BEND(2), WIRE(3), SCLE(2) BENDE132 DIMENSION PRONAM(25), RNANAM(15), TITLE(15), ATNAM(4), SAVNAM(4) BENDE133 COMMON /RECTAG/ NTAG,TAG BENDE134 C BENDE135 C THE LIST OF TAG-WORDS IS GIVEN IN APPROXIMATE OCCURRENCE-FREQUENCYBENDE136 C ORDER BENDE137 C BENDE138 DATA (TAG(I),I=1,12)/4HATOM,4HREMA,4HJRNL,4HAUTH,4HHETA,4HHEAD,4HCBENDE139 1OMP,4HSOUR,4HTER ,4HCONE,4HEND ,4HSEQR/ BENDE140 DATA BLANK/4H / BENDE141 DATA JIN/1/,JTEMP/2/,JOUT/6/,JCARD/5/,NTAG/12/,NENT/0/ BENDE142 DATA DTEST(1)/4.6/,DTEST(2)/9.0/,SCLE(1)/5.0/,SCLE(2)/3.0/ BENDE143 DATA (TESATM(I,1),I=1,4)/1H ,1HC,1HA,1H / BENDE144 DATA (TESATM(I,2),I=1,4)/1H ,1HP,1H ,1H / BENDE145 DATA (PRONAM(I),I=1,25)/3HALA,3HSER,3HGLY,3HLEU,3HLYS,3HVAL,3HTHR,BENDE146 13HPRO,3HASP,3HGLU,3HILE,3HASN,3HARG,3HGLN,3HPHE,3HTYR,3HCYS,3HHIS,BENDE147 23HMET,3HTRP,3HGLX,3HASX,3HACE,3HUNK,3HPCA/ BENDE148 DATA (RNANAM(I),I=1,15)/3H G,3H C,3H A,3H U,3H2MG,3HH2U,3HM2G,BENDE149 13HOMC,3HOMG,3H YG,3HPSU,3H5MC,3H7MG,3H5MU,3H1MA/ BENDE150 C BENDE151 C IN THIS PROGRAM COMPARISONS OF LITERAL INFORMATION ITEMS ARE DONE BENDE152 C WITH LOGICAL IF STATEMENTS INVOLVING REAL VARIABLES. THE CHOICE BENDE153 C OF REAL VARIABLES WAS MADE TO DEFEAT THE LIMITATION OF TWO LITERALBENDE154 C CHARACTERS PER WORD IN SOME COMPUTERS. BENDE155 C BENDE156 C THE FACTOR GIVEN BELOW IS USED TO CONVERT FROM INCHES TO FEET WITHBENDE157 C A 10 PERCENT ALLOWANCE FOR THE FACT THAT THE LENGTH OF WIRE NEEDEDBENDE158 C IS NOT SIMPLY THE SUM OF THE SCALED PSEUDO BOND DISTANCES. THE BENDE159 C DISTANCE BETWEEN THE BENDING JAW AND THE BACK CLAMP (ABOUT NINE BENDE160 C INCHES) IS ADDED TO THE ACCUMULATED LENGTH JUST BEFORE IT IS BENDE161 C WRITTEN OUT. BENDE162 C BENDE163 FACT=1./12.+1./120. BENDE164 10 WRITE (JOUT,500) BENDE165 REWIND JTEMP BENDE166 IEOF=0 BENDE167 NCA=0 BENDE168 NTER=0 BENDE169 NSOUR=0 BENDE170 NAUTH=0 BENDE171 NJRNL=0 BENDE172 NCPD=0 BENDE173 NPROT=0 BENDE174 NRNA=0 BENDE175 NUNID=0 BENDE176 NPASS=0 BENDE177 JALT=0 BENDE178 NENT=NENT+1 BENDE179 TWIRE=0.0 BENDE180 DO 20 I=1,4 BENDE181 20 SAVNAM(I)=BLANK BENDE182 DO 30 I=1,67 BENDE183 30 RECORD(I)=BLANK BENDE184 READ (JCARD,510) (TITLE(I),I=1,15),(ATNAM(J),J=1,4),SCALE,DST,ICONBENDE185 1N BENDE186 IF (EOF(JCARD)) 480,40 BENDE187 40 WRITE (JOUT,520) (TITLE(I),I=1,15) BENDE188 WRITE (JOUT,530) NENT BENDE189 DO 50 I=1,4 BENDE190 IF (ATNAM(I).NE.BLANK) GO TO 60 BENDE191 50 CONTINUE BENDE192 INNAM=0 BENDE193 GO TO 70 BENDE194 60 INNAM=1 BENDE195 WRITE (JOUT,540) (ATNAM(I),I=1,4) BENDE196 C BENDE197 C READ A RECORD, DETERMINE ITS TYPE AND BRANCH TO THE APPROPRIATE BENDE198 C STATEMENTS. BENDE199 C BENDE200 70 CONTINUE BENDE201 80 READ (JIN,550) RECORD BENDE202 IF (EOF(JIN)) 320,90 BENDE203 90 IEOF=0 BENDE204 CALL WATREC (RECORD,NREC) BENDE205 IF (NREC.LT.1) GO TO 80 BENDE206 GO TO (230,160,140,150,290,100,120,130,300,310,330,170), NREC BENDE207 C BENDE208 C HEADER RECORDS BENDE209 C BENDE210 100 WRITE (JOUT,560) (RECORD(I),I=60,63),(RECORD(J),J=48,57) BENDE211 DO 110 I=1,4 BENDE212 110 SAVNAM(I)=RECORD(I+59) BENDE213 GO TO 80 BENDE214 C BENDE215 C COMPND RECORDS BENDE216 C BENDE217 120 NCPD=NCPD+1 BENDE218 IF (NCPD.EQ.1) WRITE (JOUT,570) BENDE219 WRITE (JOUT,580) (RECORD(I),I=8,67) BENDE220 GO TO 80 BENDE221 C BENDE222 C SOURCE RECORDS BENDE223 C BENDE224 130 NSOUR=NSOUR+1 BENDE225 IF (NSOUR.EQ.1) WRITE (JOUT,590) BENDE226 WRITE (JOUT,580) (RECORD(I),I=8,67) BENDE227 GO TO 80 BENDE228 C BENDE229 C JRNL RECORDS BENDE230 C BENDE231 140 NJRNL=NJRNL+1 BENDE232 IF (NJRNL.EQ.1) WRITE (JOUT,600) BENDE233 WRITE (JOUT,580) (RECORD(I),I=8,67) BENDE234 GO TO 80 BENDE235 C BENDE236 C AUTHOR RECORDS BENDE237 C BENDE238 150 NAUTH=NAUTH+1 BENDE239 IF (NAUTH.EQ.1) WRITE (JOUT,610) BENDE240 WRITE (JOUT,580) (RECORD(I),I=8,67) BENDE241 GO TO 80 BENDE242 C BENDE243 C REMARK RECORDS - IGNORE THEM BENDE244 C BENDE245 160 GO TO 80 BENDE246 C BENDE247 C SEQRES RECORD - TRY TO DECIDE IF THIS IS A PROTEIN OR A NUCLEIC BENDE248 C ACID BY CHECKING THE SEQRES RECORDS AGAINST STANDARD TABLES BENDE249 C BENDE250 170 CONTINUE BENDE251 REWIND JTEMP BENDE252 WRITE (JTEMP,550) RECORD BENDE253 REWIND JTEMP BENDE254 READ (JTEMP,620) (RESNAM(I),I=1,13) BENDE255 DO 220 I=1,13 BENDE256 WHATIS=RESNAM(I) BENDE257 IF (WHATIS.EQ.3H ) GO TO 220 BENDE258 DO 180 J=1,25 BENDE259 L=J BENDE260 IF (WHATIS.EQ.PRONAM(J)) GO TO 200 BENDE261 180 CONTINUE BENDE262 DO 190 J=1,15 BENDE263 L=J BENDE264 IF (WHATIS.EQ.RNANAM(J)) GO TO 210 BENDE265 190 CONTINUE BENDE266 NUNID=NUNID+1 BENDE267 GO TO 220 BENDE268 200 NPROT=NPROT+1 BENDE269 GO TO 220 BENDE270 210 NRNA=NRNA+1 BENDE271 220 CONTINUE BENDE272 GO TO 80 BENDE273 C BENDE274 C ATOM RECORDS - ONLY KEEP THE TEST ATOMS BENDE275 C BENDE276 230 NPASS=NPASS+1 BENDE277 IF (NPASS.NE.1) GO TO 250 BENDE278 C BENDE279 C CAN TELL IF THIS IS A PROTEIN OR A NUCLEIC ACID BY THE LARGER OF BENDE280 C THE TWO COUNTERS OF MATCHES OF THE SEQRES RECORDS AGAINST THE TWO BENDE281 C TABLES OF STANDARD RESIDUES. BENDE282 C BENDE283 REWIND JTEMP BENDE284 KIND=1 BENDE285 IF (NPROT.LT.NRNA) KIND=2 BENDE286 DMAX=DTEST(KIND) BENDE287 IF (SCALE.EQ.0.0) SCALE=SCLE(KIND) BENDE288 SCALE=SCALE/25.4 BENDE289 IF (DST.GT.0.0) DMAX=DST BENDE290 IF (INNAM.EQ.1) GO TO 250 BENDE291 DO 240 I=1,4 BENDE292 240 ATNAM(I)=TESATM(I,KIND) BENDE293 C BENDE294 250 IFLAG=0 BENDE295 C BENDE296 DO 260 I=1,4 BENDE297 IF (RECORD(I+9).NE.ATNAM(I)) GO TO 80 BENDE298 260 CONTINUE BENDE299 C BENDE300 IF (RECORD(14).EQ.BLANK) GO TO 270 BENDE301 JALT=JALT+1 BENDE302 IF (JALT.EQ.1) GO TO 280 BENDE303 GO TO 80 BENDE304 270 JALT=0 BENDE305 280 WRITE (JTEMP,630) RECORD,IFLAG BENDE306 NCA=NCA+1 BENDE307 GO TO 80 BENDE308 C BENDE309 C HETATM RECORDS - TREAT THEM AS ATOM RECORDS BENDE310 C BENDE311 290 GO TO 230 BENDE312 C BENDE313 C TER RECORDS - COUNT THEM AND WRITE A MARKER ON THE TEMPORARY FILE BENDE314 C BENDE315 300 NTER=NTER+1 BENDE316 IFLAG=1 BENDE317 WRITE (JTEMP,640) NTER,IFLAG BENDE318 C BENDE319 C CONECT RECORDS - IGNORE THEM BENDE320 C BENDE321 310 GO TO 80 BENDE322 C BENDE323 C PREMATURE END-OF-FILE REACHED, TREAT IT AS AN END RECORD AFTER BENDE324 C WRITING A MESSAGE BENDE325 C BENDE326 320 CONTINUE BENDE327 IEOF=IEOF+1 BENDE328 IF (IEOF.GT.1) GO TO 490 BENDE329 IF (NCA.EQ.0) GO TO 80 BENDE330 WRITE (JOUT,650) BENDE331 C BENDE332 C END RECORD HAVE GOT ALL DATA NOW BENDE333 C BENDE334 330 IFLAG=2 BENDE335 WRITE (JTEMP,660) IFLAG BENDE336 REWIND JTEMP BENDE337 C BENDE338 C BENDE339 WRITE (JOUT,670) NCA,NTER BENDE340 C BENDE341 C NOW BEGIN THE WORK BENDE342 C BENDE343 340 NCA=0 BENDE344 TWIRE=0.0 BENDE345 C BENDE346 C FILL THE HOLDING ARRAYS BENDE347 C BENDE348 C FIRST FILL UP THE ATOM-HOLDING ARRAYS WITH THE FOUR ATOMS NEEDED BENDE349 C TO CALCULATE THE FIRST TORSION ANGLE. TEST FOR ACCEPTABLE BENDE350 C DISTANCES BETEEEN TEST ATOMS AS WE GO, KEEP THE GOOD DISTANCES ANDBENDE351 C SIGNAL A TERMINATOR OF NECESSARY. BENDE352 C BENDE353 350 NCA=NCA+1 BENDE354 READ (JTEMP,680) ALT(NCA),RES(NCA),CHAIN(NCA),JSEQ(NCA),SERT(NCA),BENDE355 1(XYZ(I,NCA),I=1,3),IFLAG BENDE356 IF (IFLAG.NE.0) GO TO 430 BENDE357 IF (NCA.EQ.1) GO TO 350 BENDE358 JDIST=NCA-1 BENDE359 CALL VECDIF (XYZ(1,JDIST),XYZ(1,NCA),V) BENDE360 D(JDIST)=AMAG(V) BENDE361 WIRE(JDIST)=D(JDIST)*SCALE BENDE362 TWIRE=TWIRE+WIRE(JDIST) BENDE363 IF (D(JDIST).LT.DMAX) GO TO 360 BENDE364 KBAD=JDIST BENDE365 IBAD=NCA BENDE366 GO TO 460 BENDE367 360 IF (NCA.LT.4) GO TO 350 BENDE368 C BENDE369 ID1=1 BENDE370 ID2=2 BENDE371 ID3=3 BENDE372 C BENDE373 C ANGLES BENDE374 C BENDE375 IA1=1 BENDE376 IA2=2 BENDE377 DO 370 I=1,2 BENDE378 J=I+1 BENDE379 K=I+2 BENDE380 ANG(I)=ANGLE(XYZ(1,I),XYZ(1,J),XYZ(1,K)) BENDE381 370 BEND(I)=180-ANG(I) BENDE382 C BENDE383 C CALCULATE THE FIRST TORSION ANGLE BENDE384 C BENDE385 N1=1 BENDE386 N2=2 BENDE387 N3=3 BENDE388 N4=4 BENDE389 TORS=TORSIN(XYZ(1,N1),XYZ(1,N2),XYZ(1,N3),XYZ(1,N4)) BENDE390 C BENDE391 C WE ARE ALL PRIMED NOW SO PUT OUT THE FIRST TWO LINES AND TURN THE BENDE392 C SPINNING WHEEL LOOSE TO RUN DOWN THE CHAIN. BENDE393 C BENDE394 WRITE (JOUT,690) BENDE395 WRITE (JOUT,700) (SAVNAM(I),I=1,4),RES(1),CHAIN(1),JSEQ(1),SERT(1)BENDE396 CUMUL=0.0 BENDE397 WRITE (JOUT,700) (SAVNAM(I),I=1,4),RES(2),CHAIN(2),JSEQ(2),SERT(2)BENDE398 1,WIRE(1),CUMUL,BEND(1) BENDE399 C BENDE400 C ENSURE THAT THE TORSION ANGLE TO BE SET ON THE BENDER IS IN THE BENDE401 C RANGE 0 - 360 BENDE402 C BENDE403 CUMUL=TORS+360. BENDE404 CUMUL=AMOD(CUMUL,360.) BENDE405 C BENDE406 C ROTATE THE POINTERS TO THE ATOMS IN THE HOLDING ARRARYS BENDE407 C BENDE408 380 JT=N1 BENDE409 N1=N2 BENDE410 N2=N3 BENDE411 N3=N4 BENDE412 N4=JT BENDE413 NCA=N4 BENDE414 C BENDER14 C GET THE NEXT ATOM FROM THE TEMPORARY FILE BENDE416 C BENDE417 READ (JTEMP,680) ALT(NCA),RES(NCA),CHAIN(NCA),JSEQ(NCA),SERT(NCA),BENDE418 1(XYZ(I,NCA),I=1,3),IFLAG BENDE419 IF (IFLAG.EQ.0) GO TO 390 BENDE420 IF (IFLAG.GT.1) GO TO 410 BENDE421 IF (ICONN.EQ.0) GO TO 410 BENDE422 390 JT=ID1 BENDE423 ID1=ID2 BENDE424 ID2=ID3 BENDE425 ID3=JT BENDE426 JDIST=ID3 BENDE427 CALL VECDIF (XYZ(1,N3),XYZ(1,N4),V) BENDE428 D(JDIST)=AMAG(V) BENDE429 C BENDE430 C IF THE DISTANCE IS ACCEPTABLE STORE IT AWAY, AND CONTINUE ON TO BENDE431 C CALCULATE THE BEND ANGLE AND THE TORSION ANGLE BENDE432 C BENDE433 IF (D(JDIST).LT.DMAX) GO TO 400 BENDE434 KBAD=N3 BENDE435 IBAD=N4 BENDE436 IFLAG=3 BENDE437 GO TO 410 BENDE438 400 WIRE(JDIST)=D(JDIST)*SCALE BENDE439 TWIRE=TWIRE+WIRE(JDIST) BENDE440 JT=IA1 BENDE441 IA1=IA2 BENDE442 IA2=JT BENDE443 JANG=IA2 BENDE444 ANG(JANG)=ANGLE(XYZ(1,N2),XYZ(1,N3),XYZ(1,N4)) BENDE445 BEND(JANG)=180.0-ANG(JANG) BENDE446 TORS=TORSIN(XYZ(1,N1),XYZ(1,N2),XYZ(1,N3),XYZ(1,N4)) BENDE447 C BENDE448 C PRINT THE RESULTS LINE BENDE449 C BENDE450 WRITE (JOUT,700) (SAVNAM(I),I=1,4),RES(N2),CHAIN(N2),JSEQ(N2),SERTBENDE451 1(N2),WIRE(ID1),CUMUL,BEND(IA1) BENDE452 CUMUL=CUMUL+TORS+360.0 BENDE453 CUMUL=AMOD(CUMUL,360.0) BENDE454 C BENDE455 C TURN THE HANDLE AGAIN BENDE456 C BENDE457 GO TO 380 BENDE458 C BENDE459 C HAVE HIT A CHAIN TERMINATOR OR A CHAIN BREAK - LIST THE TRAILER BENDE460 C DATA AND LOOK FOR MORE WORK BENDE461 C BENDE462 410 CONTINUE BENDE463 WRITE (JOUT,700) (SAVNAM(I),I=1,4),RES(N2),CHAIN(N2),JSEQ(N2),SERTBENDE464 1(N2),WIRE(ID2),CUMUL,BEND(IA2) BENDE465 WRITE (JOUT,700) (SAVNAM(I),I=1,4),RES(N3),CHAIN(N3),JSEQ(N3),SERTBENDE466 1(N3),WIRE(ID3) BENDE467 C BENDE468 C IFLAG = 0 IMPLIES NORMAL DATA RECORD READ BENDE469 C IFLAG = 1 IMPLIES A TER RECORD WAS READ BENDE470 C IFLAG = 2 IMPLIES AN END RECORD WAS READ BENDE471 C IFLAG = 3 IMPLIES A CHAIN-BREAK WAS DETECTED BENDE472 C BENDE473 420 IF (IFLAG.EQ.2) GO TO 450 BENDE474 IF (IFLAG.EQ.3) GO TO 460 BENDE475 WRITE (JOUT,710) BENDE476 TWIRE=TWIRE*FACT+0.75 BENDE477 IF (TWIRE.NE.0.75) WRITE (JOUT,720) TWIRE BENDE478 TWIRE=0.0 BENDE479 GO TO 340 BENDE480 430 IF (IFLAG.NE.1) GO TO 420 BENDE481 WRITE (JOUT,730) BENDE482 NCA=NCA-1 BENDE483 IF (NCA.LT.1) GO TO 340 BENDE484 DO 440 I=1,NCA BENDE485 440 WRITE (JOUT,740) ALT(I),RES(I),CHAIN(I),JSEQ(I),SERT(I),(XYZ(J,I),BENDE486 1J=1,3) BENDE487 GO TO 340 BENDE488 450 TWIRE=TWIRE*FACT+0.75 BENDE489 IF (TWIRE.NE.0.75) WRITE (JOUT,720) TWIRE BENDE490 TWIRE=0.0 BENDE491 WRITE (JOUT,750) BENDE492 ENDFILE JOUT BENDER35 GO TO 10 BENDE493 C BENDE494 C LIST THE RESIDUES ON EITHER SIDE OF THE CHAIN BREAK AND CONTINUE BENDE495 C BENDE496 460 WRITE (JOUT,760) ALT(KBAD),RES(KBAD),CHAIN(KBAD),JSEQ(KBAD),SERT(KBENDE497 1BAD),(XYZ(I,KBAD),I=1,3),ALT(IBAD),RES(IBAD),CHAIN(IBAD),JSEQ(IBADBENDE498 2),SERT(IBAD),(XYZ(J,IBAD),J=1,3) BENDE499 WRITE (JOUT,770) D(JDIST) BENDE500 TWIRE=TWIRE*FACT+0.75 BENDE501 IF (TWIRE.NE.0.75) WRITE (JOUT,720) TWIRE BENDE502 TWIRE=0.0 BENDE503 ALT(1)=ALT(IBAD) BENDE504 RES(1)=RES(IBAD) BENDE505 CHAIN(1)=CHAIN(IBAD) BENDE506 JSEQ(1)=JSEQ(IBAD) BENDE507 SERT(1)=SERT(IBAD) BENDE508 DO 470 I=1,3 BENDE509 470 XYZ(I,1)=XYZ(I,IBAD) BENDE510 NCA=1 BENDE511 GO TO 350 BENDE512 480 CONTINUE BENDE513 WRITE (JOUT,780) BENDE514 WRITE (JOUT,790) NENT BENDE515 STOP 777 BENDE516 490 WRITE (JOUT,800) BENDE517 WRITE (JOUT,790) NENT BENDE518 STOP 776 BENDE519 C BENDE520 500 FORMAT (49H1BEGIN OUTPUT OF PROTEIN DATA BANK PROGRAM BENDER) BENDE521 510 FORMAT (15A4,4A1,1X,F5.2,F5.2,I5) BENDE522 520 FORMAT (1H0,15A4) BENDE523 530 FORMAT (24H PROCESSING ENTRY NUMBER,I4) BENDE524 540 FORMAT (29H0TEST ATOMS HAVE IDENTIFIER- ,A4) BENDE525 550 FORMAT (A4,66A1) BENDE526 560 FORMAT (24H0PROTEIN DATA BANK ENTRY,1X,4A1,6H DATED,1X,10A1) BENDE527 570 FORMAT (5H0FOR-) BENDE528 580 FORMAT (1X,60A1) BENDE529 590 FORMAT (6H0FROM-) BENDE530 600 FORMAT (18H0ENTRY DEFINED IN-) BENDE531 610 FORMAT (14H0DEPOSITED BY-) BENDE532 620 FORMAT (18X,13(1X,A3)) BENDE533 630 FORMAT (A4,66A1,I4) BENDE534 640 FORMAT (4HTER ,I4,62X,I4) BENDE535 650 FORMAT (55H0 AN END-OF-FILE MARK SENSED BEFORE AN END RECORD FOUNDBENDE536 1) BENDE537 660 FORMAT (4HEND ,66X,I4) BENDE538 670 FORMAT (1H0,I4,22H TEST ATOMS EXTRACTED,,I3,24H CHAIN TERMINATORS BENDE539 1FOUND) BENDE540 680 FORMAT (16X,A1,A3,1X,A1,I4,A1,3X,3F8.3,16X,I4) BENDE541 690 FORMAT (1H0,2X,5HENTRY,5X,7HRESIDUE,9X,4HWIRE,4X,4HDRUM,4X,4HBEND)BENDE542 700 FORMAT (3X,4A1,4X,A3,1X,A1,I5,A1,4X,F6.2,F8.0,F8.0) BENDE543 710 FORMAT (26H0END-OF-CHAIN RECORD FOUND) BENDE544 720 FORMAT (50H0LENGTH OF WIRE REQUIRED FOR THIS CHAIN SEGMENT IS,F6.2BENDE545 1,14H FEET (APPROX)) BENDE546 730 FORMAT (56H0LESS THAN FOUR TEST ATOMS FOUND BEFORE A CHAIN TERMINUBENDE547 1S) BENDE548 740 FORMAT (3X,A1,1X,A3,1X,A1,I5,A1,3F8.3) BENDE549 750 FORMAT (26H0END-OF-ENTRY RECORD FOUND) BENDE550 760 FORMAT (54H0A CHAIN-BREAK DETECTED BETWEEN THE TWO RESIDUES BELOW,BENDE551 1/(16X,A1,A3,1X,A1,I4,A1,3X,3F8.3/)) BENDE552 770 FORMAT (31H0DISTANCE BETWEEN TEST ATOMS IS,F6.2,10H ANGSTROMS) BENDE553 780 FORMAT (56H0END-OF-FILE ENCOUNTERED ON CARD READER - PROGRAM HALTEBENDE554 1D) BENDE555 790 FORMAT (12H0A TOTAL OF ,I4,23H ENTRIES WERE PROCESSED) BENDE556 800 FORMAT (67H0END-OF-INFORMATION SENSED ON COORDINATE INPUT FILE - PBENDE557 1ROGRAM QUITS) BENDE558 END BENDE559 SUBROUTINE WATREC (RECORD,NREC) BENDE560 DIMENSION RECORD(20), TAG(12) BENDE561 COMMON /RECTAG/ NTAG,TAG BENDE562 TEST=RECORD(1) BENDE563 DO 10 I=1,NTAG BENDE564 K=I BENDE565 IF (TEST.EQ.TAG(I)) GO TO 20 BENDE566 10 CONTINUE BENDE567 NREC=0 BENDE568 RETURN BENDE569 20 NREC=K BENDE570 RETURN BENDE571 END BENDE572 FUNCTION AMAG (X) BENDE573 C GET AND RETURN THE MAGNITUDE OF A VECTOR X BENDE574 DIMENSION X(3) BENDE575 AMAG=DOT(X,X) BENDE576 AMAG=SQRT(AMAG) BENDE577 RETURN BENDE578 END BENDE579 FUNCTION DOT (X,Y) BENDE580 C COMPUTE AND RETURN THE DOT PRODUCT OF X AND Y BENDE581 DIMENSION X(3), Y(3) BENDE582 DOT=0.0 BENDE583 DO 10 I=1,3 BENDE584 DOT=DOT+X(I)*Y(I) BENDE585 10 CONTINUE BENDE586 RETURN BENDE587 END BENDE588 SUBROUTINE CROSS (X,Y,Z) BENDE589 C COMPUTE Z = X CROSS Y BENDE590 DIMENSION X(3), Y(3), Z(3) BENDE591 Z(1)=X(2)*Y(3)-Y(2)*X(3) BENDE592 Z(2)=-X(1)*Y(3)+Y(1)*X(3) BENDE593 Z(3)=X(1)*Y(2)-Y(1)*X(2) BENDE594 RETURN BENDE595 END BENDE596 SUBROUTINE VECDIF (X,Y,Z) BENDE597 C SUBTRACT TWO VECTORS AND RETURN THE RESULT IN Z BENDE598 DIMENSION X(3), Y(3), Z(3) BENDE599 DO 10 I=1,3 BENDE600 Z(I)=X(I)-Y(I) BENDE601 10 CONTINUE BENDE602 RETURN BENDE603 END BENDE604 FUNCTION ANGLE (A,B,C) BENDE605 C GET THE ANGLE BETWEEN TWO VECTORS DEFINED BY THE ENDS BENDE606 C OF THREE VECTORS BENDE607 COMMON /VECCOM/ X(12) BENDE608 DIMENSION Y(3) BENDE609 EQUIVALENCE (X(4),Y(1)) BENDE610 DIMENSION A(3), B(3), C(3) BENDE611 CALL VECDIF (A,B,X) BENDE612 CALL VECDIF (C,B,Y) BENDE613 Q=AMAG(X)*AMAG(Y) BENDE614 IF (Q.LT.1.0E-7) Q=1.0E-7 BENDE615 ANGLE=DOT(X,Y)/Q BENDE616 ANGLE=57.29577951*ACOS(ANGLE) BENDE617 RETURN BENDE618 END BENDE619 FUNCTION TORSIN (A,B,C,D) BENDE620 C CALCULATE THE TORSION ANGLE FOR FOUR ATOMS BENDE621 COMMON /VECCOM/ X(12) BENDE622 DIMENSION Y(3), P(3), Q(3) BENDE623 EQUIVALENCE (X(4),Y(1)), (X(7),P(1)), (X(10),Q(1)) BENDE624 DIMENSION A(3), B(3), C(3), D(3) BENDE625 DIMENSION ZERO(3) BENDE626 DATA ZERO/0.0,0.0,0.0/ BENDE627 CALL VECDIF (A,B,P) BENDE628 CALL VECDIF (C,B,Q) BENDE629 CALL CROSS (P,Q,X) BENDE630 CALL VECDIF (B,C,P) BENDE631 CALL VECDIF (D,C,Q) BENDE632 CALL CROSS (P,Q,Y) BENDE633 TORSIN=ANGLE(X,ZERO,Y) BENDE634 CALL CROSS (X,Y,Q) BENDE635 X(1)=DOT(P,Q) BENDE636 IF (X(1).GT.0.0) TORSIN=-TORSIN BENDE637 RETURN BENDE638 END BENDE639