C PROTEIN DATA BANK SOURCE CODE DSTNCE DSTNCE11 C AUTHOR. F. BERNSTEIN DSTNCE12 C ENTRY DATE. 3/79 SUPPORTED DSTNCE13 C LAST REVISION. 8/82 DSTNCE21 C PURPOSE. CALCULATE DISTANCES FROM CONECT DSTNCE15 C PURPOSE. RECORDS DSTNCE16 C LANGUAGE. FORTRAN IV DSTNCE17 C DSTNCE18 C DSTNCE19 C DSTNCE10 PROGRAM DSTNCE(INPUT,OUTPUT,TAPE1,TAPE2,TAPE3,TAPE4,TAPE5=INPUT,TADSTNCE 3 1PE6=OUTPUT) DSTNCE 4 C DSTNCE 5 C THIS PROGRAM WAS WRITTEN BY DSTNCE 6 C DSTNCE 7 C FRANCES C. BERNSTEIN DSTNCE 8 C PROTEIN DATA BANK DSTNCE 9 C CHEMISTRY DEPARTMENT DSTNCE10 C BROOKHAVEN NATIONAL LABORATORY DSTNCE11 C UPTON, NEW YORK 11973 USA DSTNCE12 C DSTNCE13 C THE PROTEIN DATA BANK IS FUNDED BY THE NATIONAL SCIENCE DSTNCE14 C FOUNDATION UNDER GRANT PCM 77-16811. DSTNCE15 C DSTNCE16 C PLEASE NOTIFY THE PROTEIN DATA BANK OF ANY PROBLEMS IN USING THIS DSTNCE17 C PROGRAM. DSTNCE18 C DSTNCE19 C DSTNCE11 C CORRECTION. INSERT COMMENT CARDS AT BEGINNING FOR USE BY DSTNCE12 C DIRECTORY PROGRAM. 20-SEP-79. DSTNCE13 C DSTNCE22 C CORRECTION. INCREASE NUMBER OF ATOMS THAT CAN BE HANDLED. PRINT DSTNCE23 C WARNING MESSAGE IF LIMIT IS EXCEEDED. 23-AUG-82. DSTNCE24 C DSTNCE25 C DSTNCE20 C A. PURPOSE DSTNCE21 C DSTNCE22 C TO CALCULATE DISTANCES BETWEEN BONDED ATOMS. PROGRAM DSTNCE DSTNCE23 C READS PROTEIN DATA BANK ENTRIES AND THE FULL CONNECTIVITY FILES DSTNCE24 C GENERATED BY PROGRAM CONECT TO DETERMINE WHICH DISTANCES TO DSTNCE25 C CALCULATE. DSTNCE26 C DSTNCE27 C DSTNCE28 C B. INPUT/OUTPUT FILES DSTNCE29 C DSTNCE30 C SYMBOLIC LOGICAL DESCRIPTION DSTNCE31 C DESIGNATION UNIT DSTNCE32 C DSTNCE33 C INP TAPE5 SYSTEM INPUT FILE DSTNCE34 C IOUT TAPE6 SYSTEM OUTPUT FILE TO BE PRINTED DSTNCE35 C IDATA TAPE1 PROTEIN DATA BANK ENTRIES TO BE PROCESSED DSTNCE36 C ICONS TAPE2 CONECT RECORDS GENERATED BY CONECT PROGRAM DSTNCE37 C IDIST TAPE3 CONECT AND BONDIS RECORDS DSTNCE38 C ITEMP TAPE4 SCRATCH FILE IF ENCODE/DECODE NOT AVAILABLEDSTNCE39 C DSTNCE40 C DSTNCE41 C C. INPUT PARAMETERS DSTNCE42 C DSTNCE43 C DSTNCE READS ONE INPUT PARAMETER RECORD FROM THE INPUT FILE (INP).DSTNCE44 C THIS IS FOLLOWED BY ONE TITLE RECORD FOR EACH PROTEIN DATA BANK DSTNCE45 C ENTRY TO BE PROCESSED. DSTNCE46 C DSTNCE47 C INPUT PARAMETER RECORD FORMAT(2F5.3) DSTNCE48 C DSTNCE49 C COLS. 1-5. DLIMLO. LOWER BOUND ON DISTANCE, IN ANGSTROMS. DSTNCE50 C SMALLER DISTANCES WILL BE FLAGGED. IF THISDSTNCE51 C FIELD IS LEFT BLANK A VALUE OF 1.0 IS DSTNCE52 C ASSUMED. DSTNCE53 C DSTNCE54 C COLS. 6-10.DLIMUP. UPPER BOUND ON DISTANCE, IN ANGSTROMS. DSTNCE55 C LARGER DISTANCES WILL BE FLAGGED. IF THIS DSTNCE56 C FIELD IS LEFT BLANK A VALUE OF 1.8 IS DSTNCE57 C ASSUMED. DSTNCE58 C DSTNCE59 C TITLE RECORDS ARE REPRODUCED ON THE SYSTEM OUTPUT FILE. THESE DSTNCE60 C RECORDS MAY BE BLANK. DSTNCE61 C DSTNCE62 C THE PROGRAM WILL STOP WHEN THERE ARE NO MORE TITLE CARDS ON DSTNCE63 C FILE INP, WHEN THERE ARE NO MORE PROTEIN DATA BANK ENTRIES ON DSTNCE64 C FILE IDATA, OR WHEN THERE ARE NO MORE CONECT RECORD SETS ON FILE DSTNCE65 C ICONS. DSTNCE66 C DSTNCE67 C DSTNCE68 C D. OUTPUT DSTNCE69 C DSTNCE70 C FOR EACH PROTEIN DATA BANK ENTRY A MACHINE READABLE FILE OF DSTNCE71 C INTERSPERSED CONECT AND BONDIS RECORDS IS PRODUCED ON FILE IDIST. DSTNCE72 C SOME HEADER INFORMATION AND ALL DIAGNOSTIC MESSAGES ARE PRODUCED DSTNCE73 C ON FILE IOUT (SYSTEM PRINT FILE). DSTNCE74 C DSTNCE75 C THE FIRST RECORD ON FILE IDIST HAS THE DECK NAME STARTING IN DSTNCE76 C COLUMN 1. THIS IS FOLLOWED BY PAIRS OF CONECT AND BONDIS RECORDS.DSTNCE77 C THE CONECT RECORDS ARE AS READ FROM FILE ICONS WITH CONECT IN DSTNCE78 C COLUMNS 1-6 AND ATOM NUMBERS FOLLOWING (6HCONECT,11I5). DSTNCE79 C THE BONDIS RECORD DIRECTLY FOLLOWING EACH CONECT RECORD REPEATS DSTNCE80 C THE ATOM NUMBER AND THEN HAS THE DISTANCE IN ANGSTROMS FROM THAT DSTNCE81 C ATOM TO EACH OF THE BONDED ATOMS LISTED ON THE CONECT RECORD, IN DSTNCE82 C THE CORRESPONDING COLUMNS (6HBONDIS,I5,10F5.2). DSTNCE83 C THE LAST BONDIS RECORD IS FOLLOWED BY A RECORD WITH END IN COLUMNSDSTNCE84 C 1-3 (3HEND) AND THIS IS FOLLOWED BY AN END-OF-FILE INDICATOR. DSTNCE85 C DSTNCE86 C ON FILE IOUT ARE PRINTED ALL DIAGNOSTIC MESSAGES. ANY DISTANCES DSTNCE87 C THAT ARE TOO SMALL OR TOO LARGE BASED ON THE INPUT PARAMETERS DSTNCE88 C DLIMLO AND DLIMUP ARE PRINTED OUT TOGETHER WITH THE ATOM NUMBERS. DSTNCE89 C HYDROGEN BONDS AND SALT BRIDGES ARE IDENTIFIED ON THE FILE IOUT DSTNCE90 C AS AN AID TO EVALUATING *BAD* DISTANCES. DSTNCE91 C DSTNCE92 C DSTNCE93 C E. MACHINE DEPENDENCIES DSTNCE94 C DSTNCE95 C DATE AND TIME ARE CDC ROUTINES TO RETURN 10 CHARACTERS IN ONE WORDDSTNCE96 C WHICH CAN THEN BE PRINTED. DSTNCE97 C DSTNCE98 C THIS PROGRAM MUST HANDLE CHARACTERS STORED IN WORDS. AN DSTNCE99 C ATTEMPT WAS MADE TO HAVE A LIMIT OF FOUR CHARACTERS PER WORD. DSTNC100 C TYPICALLY A RECORD IS READ IN 20A4 FORMAT AND IDENTIFIED. IT IS DSTNC101 C SUBSEQUENTLY ENCODED INTO A LINE OF 8A10 FORMAT THAT CAN IN TURN DSTNC102 C BE DECODED USING THE APPROPRIATE FORMAT. THE ARRAY *LINE* IS DSTNC103 C ALWAYS USED FOR THIS PURPOSE. FOR COMPUTERS WITH ENCODE/DECODE DSTNC104 C CAPABILITIES ONLY THE DIMENSION OF *LINE* AND A FORMAT STATEMENT DSTNC105 C NEED BE CHANGED. FOR A COMPUTER WITHOUT ENCODE/DECODE IT IS DSTNC106 C NECESSARY TO REMOVE THE USE OF THIS FEATURE. IN THAT CASE DSTNC107 C THE RECORD CAN BE WRITTEN ON A SCRATCH FILE (ITEMP) AND REREAD. DSTNC108 C THE CODE TO DO THIS HAS BEEN TESTED AND IS ALWAYS PRESENT AS DSTNC109 C COMMENT CARDS ALONG WITH THE ENCODE/DECODE STATEMENTS. DSTNC110 C DSTNC111 C ALL COMPARISONS OF WORDS CONTAINING CHARACTERS ARE DONE USING DSTNC112 C THE ARITHMETIC STATEMENT FUNCTION ICOMP (SEE BELOW). DSTNC113 C DSTNC114 C TO RUN PROGRAM DSTNCE ON A MACHINE WITH LIMITED MEMORY IT MAY BE DSTNC115 C NECESSARY TO CHANGE THE DIMENSION OF COORDS TO A SMALLER NUMBER DSTNC116 C AND REDEFINE LIMAT TO TAKE ON THAT SAME VALUE. LIMAT DEFINES THE DSTNC117 C MAXIMUM NUMBER OF ATOMS THAT CAN BE HANDLED BY THE PROGRAM. DSTNC118 C ALL FETCHES AND STORES INTO THE ARRAY COORDS ARE LOCALIZED IN DSTNC119 C SPECIAL SUBROUTINES (FETCH AND STORE) THAT CAN BE MODIFIED FOR USEDSTNC120 C ON OTHER COMPUTERS. FOR EXAMPLE, THE LARGE ARRAY COULD BE STORED DSTNC121 C ON A RANDOM ACCESS DISK FILE IN WHICH CASE ONLY THESE TWO DSTNC122 C SUBROUTINES NEED BE REWRITTEN. DSTNC123 C DSTNC124 C THE FOLLOWING VARIABLES IN THIS PROGRAM ARE USED TO STORE DSTNC125 C CHARACTERS AT 4 PER WORD DSTNC126 C DSTNC127 C IALT, IBLANK, ICDIST, ICONE, ID, IEND, IFMT, INTRY, IRSCHN, DSTNC128 C IRSINS, IRSNAM, ITITLE DSTNC129 C DSTNC130 C THE FOLLOWING VARIABLES IN THIS PROGRAM ARE USED TO STORE DSTNC131 C CHARACTERS AT 10 PER WORD DSTNC132 C DSTNC133 C IDAT, ITIM, LINE DSTNC134 C DSTNC135 C DSTNC136 COMMON /FILES/ INP,IOUT,IDATA,ICONS,IDIST,ITEMP DSTNC137 COMMON /INTRY/ INTRY DSTNC138 DIMENSION ICONRC(20) DSTNC139 DIMENSION ITITLE(20) DSTNC140 DIMENSION IFMT(20) DSTNC141 DIMENSION ICONN(10), DIST(10) DSTNC142 DIMENSION ICDIST(20) DSTNC143 DIMENSION LINE(10) DSTNC144 DATA LIMAT/10000/ DSTNCE26 DATA INP/5/,IOUT/6/,IDATA/1/,ICONS/2/,IDIST/3/,ITEMP/4/ DSTNC146 DATA IEND/4HEND /,ICONE/4HCONE/ DSTNC147 DATA IBLANK/1H / DSTNC148 C DSTNC149 C JCODE = 0 FOR GOOD ATOM DSTNC150 C = 1 FOR TER CODE DSTNC151 C = 2 FOR END CODE DSTNC152 C = 3 FOR END-OF-FILE SENSED DSTNC153 C DSTNC154 DATA JCODE/0/ DSTNC155 C DSTNC156 C THIS DATA STATEMENT DEFINES THE FORMAT USED TO READ THE ATOM AND DSTNC157 C HETATM RECORDS FROM A PROTEIN DATA BANK ENTRY. FOR NON-STANDARD DSTNC158 C FORMATS IT WOULD HAVE TO BE CHANGED. DSTNC159 C DSTNC160 DATA IFMT/4H(7X,,4HI4, ,4H1X, ,4HA4, ,4HA1, ,4HA3, ,4H1X, ,4HA1, ,DSTNC161 14HI4 ,4H,A1,,4H3X, ,4H3F8.,4H3) ,7*0/ DSTNC162 C DSTNC163 C ICOMP IS AN ARITHMETIC STATEMENT FUNCTION USED TO COMPARE TWO DSTNC164 C WORDS. THE RESULT IS ZERO FOR EQUALITY AND NON-ZERO OTHERWISE. DSTNC165 C ALL COMPARISONS INVOLVING CHARACTERS ARE DONE VIA ICOMP. THIS DSTNC166 C FUNCTION MAY HAVE TO BE CHANGED FOR OTHER THAN CDC COMPUTERS. DSTNC167 C DSTNC168 ICOMP(I,J)=I-J DSTNC169 CDIST(X1,Y1,Z1,X2,Y2,Z2)=SQRT((X1-X2)**2+(Y1-Y2)**2+(Z1-Z2)**2) DSTNC170 C DSTNC171 C READ USER SUPPLIED VALUES FOR DLIMLO AND DLIMUP. IF BLANK USE DSTNC172 C DEFAULTS OF 1.0 AND 1.8 ANGSTROMS, RESPECTIVELY. DSTNC173 C DSTNC174 READ (INP,210) DLIMLO,DLIMUP DSTNC175 IF (DLIMLO.LE.0.0) DLIMLO=1.0 DSTNC176 IF (DLIMUP.LE.0.0) DLIMUP=1.8 DSTNC177 10 CONTINUE DSTNC178 C DSTNC179 C READ NEXT TITLE RECORD. IF NO MORE, STOP. DSTNC180 C DSTNC181 READ (INP,220) ITITLE DSTNC182 C DSTNC183 C THE STATEMENT BELOW WILL TRANSFER CONTROL TO STATEMENT 20 IF AN DSTNC184 C END-OF-FILE WAS ENCOUNTERED ON THE INPUT DEVICE. IF NO END-OF- DSTNC185 C FILE IS SENSED CONTROL IS ASSUMED BY STATEMENT 30. DSTNC186 C DSTNC187 IF (EOF(INP)) 20,30 DSTNC188 20 WRITE (IOUT,380) DSTNC189 GO TO 200 DSTNC190 30 CONTINUE DSTNC191 WRITE (IOUT,230) DSTNC192 C DSTNC193 C DATE AND TIME ARE CDC ROUTINES TO RETURN 10 CHARACTERS IN ONE DSTNC194 C WORD WHICH CAN THEN BE PRINTED. THIS WILL PROBABLY HAVE TO BE DSTNC195 C CHANGED (OR SIMPLY DELETED) ON OTHER EQUIPMENT. DSTNC196 C DSTNC197 CALL DATE (IDAT) DSTNC198 CALL TIME (ITIM) DSTNC199 WRITE (IOUT,240) ITIM,IDAT DSTNC200 WRITE (IOUT,250) ITITLE DSTNC201 WRITE (IOUT,370) DLIMLO,DLIMUP DSTNC202 I=0 DSTNC203 40 I=I+1 DSTNC204 50 CONTINUE DSTNC205 C DSTNC206 C CONTINUE READING ATOMS. DSTNC207 C DSTNC208 JCODSV=JCODE DSTNC209 CALL NXTLIN (NATOM,ID,IALT,IRSNAM,IRSCHN,IRSNUM,IRSINS,XT,YT,ZT,IFDSTNC210 1MT,JCODE) DSTNC211 IF (NATOM.LE.LIMAT) GO TO 70 DSTNC212 C DSTNC213 C LIMAT IS THE MAXIMUM ATOM NUMBER ALLOWED. DSTNC214 C DSTNC215 C HAVE STORED MAXIMUM NUMBER OF ATOMS POSSIBLE. THROW AWAY ANY DSTNC216 C EXTRAS AND MAKE SURE THAT FILE IDATA IS PROPERLY POSITIONED TO BE DSTNC217 C ABLE TO PROCESS MORE THAN ONE PROTEIN DATA BANK ENTRY. DSTNC218 C DSTNC219 60 CALL NXTLIN (NATOM,ID,IALT,IRSNAM,IRSCHN,IRSNUM,IRSINS,XT,YT,ZT,IFDSTNC220 1MT,JCODE) DSTNC221 IF (JCODE.EQ.0) GO TO 60 DSTNC222 IF (JCODE.EQ.1) GO TO 60 DSTNC223 WRITE (IOUT,410) LIMAT DSTNCE27 GO TO 90 DSTNC224 C DSTNC225 C IF DOUBLE END-OF-FILE SENSED ON FILE IDATA IT IS TIME TO STOP. DSTNC226 C DSTNC227 70 IF ((JCODE.EQ.3).AND.(JCODSV.EQ.3)) GO TO 190 DSTNC228 IF (JCODE.NE.0) GO TO 80 DSTNC229 C DSTNC230 C ATOMS ARE STORED BASED ON THEIR ATOM NUMBER. SAVE COORDINATES. DSTNC231 C DSTNC232 CALL STORE (NATOM,XT,YT,ZT) DSTNC233 GO TO 40 DSTNC234 80 IF (JCODE.EQ.1) GO TO 50 DSTNC235 IF (JCODSV.EQ.0) GO TO 90 DSTNC236 IF (JCODSV.EQ.1) GO TO 90 DSTNC237 GO TO 50 DSTNC238 90 NAT=I-1 DSTNC239 C DSTNC240 C HAVE READ COORDINATES FOR ALL ATOMS IN THIS ENTRY. DSTNC241 C DSTNC242 WRITE (IOUT,260) NAT DSTNC243 C DSTNC244 C START READING CONECT RECORDS FILE. READ HEADER RECORD. DSTNC245 C DSTNC246 READ (ICONS,220) ICONRC DSTNC247 C DSTNC248 C THE STATEMENT BELOW WILL TRANSFER CONTROL TO STATEMENT 100 IF AN DSTNC249 C END-OF-FILE WAS ENCOUNTERED ON FILE ICONS. IF NO END-OF-FILE DSTNC250 C IS SENSED CONTROL IS ASSUMED BY STATEMENT 110. DSTNC251 C DSTNC252 IF (EOF(ICONS)) 100,110 DSTNC253 100 WRITE (IOUT,400) DSTNC254 GO TO 200 DSTNC255 110 CONTINUE DSTNC256 WRITE (IOUT,250) ICONRC DSTNC257 C DSTNC258 C READ DECK NAME DSTNC259 C DSTNC260 READ (ICONS,220) ICONRC DSTNC261 WRITE (IOUT,250) ICONRC DSTNC262 C DSTNC263 C MAKE SURE COORDINATES AND CONECT RECORDS ARE FOR THE SAME DATA DSTNC264 C ENTRY. DSTNC265 C DSTNC266 IF (ICONRC(1).EQ.INTRY) GO TO 120 DSTNC267 WRITE (IOUT,360) ICONRC(1),INTRY DSTNC268 GO TO 200 DSTNC269 120 WRITE (IDIST,220) INTRY DSTNC270 130 CONTINUE DSTNC271 READ (ICONS,220) ICONRC DSTNC272 IF (ICOMP(ICONRC(1),ICONE).EQ.0) GO TO 140 DSTNC273 IF (ICOMP(ICONRC(1),IEND).NE.0) GO TO 130 DSTNC274 C DSTNC275 C HAVE READ END RECORD. DSTNC276 C DSTNC277 WRITE (IDIST,220) IEND DSTNC278 END FILE IDIST DSTNC279 READ (ICONS,250) ICONRC(1) DSTNC280 C DSTNC281 C THE STATEMENT BELOW TESTS FOR AN END-OF-FILE INDICATOR ON FILE DSTNC282 C ICONS. IN ALL CASES CONTROL IS TRANSFERRED TO STATEMENT 10. DSTNC283 C TESTING FOR AN END-OF-FILE CLEARS THE END-OF-FILE INDICATOR AND DSTNC284 C FURTHER READING IS THEN POSSIBLE ON THE DEVICE. DSTNC285 C DSTNC286 IF (EOF(ICONS)) 10,10 DSTNC287 140 CONTINUE DSTNC288 C WRITE(ITEMP,220) ICONRC DSTNC289 C REWIND ITEMP DSTNC290 C REWIND ITEMP DSTNC291 C READ(ITEMP,280) IAT,(ICONN(I),I=1,10) DSTNC292 ENCODE (80,220,LINE(1) )ICONRC DSTNC293 DECODE (80,280,LINE(1) )IAT,(ICONN(I),I=1,10) DSTNC294 IF (IAT.GT.LIMAT) GO TO 130 DSTNC295 C DSTNC296 C ACTUALLY COMPUTE DISTANCES. DSTNC297 C DSTNC298 CALL FETCH (IAT,X1,Y1,Z1) DSTNC299 DO 160 I=1,10 DSTNC300 DIST(I)=0.0 DSTNC301 IND=ICONN(I) DSTNC302 IF (IND.LE.0) GO TO 160 DSTNC303 IF (IND.GT.LIMAT) GO TO 160 DSTNC304 CALL FETCH (IND,X2,Y2,Z2) DSTNC305 DIST(I)=CDIST(X1,Y1,Z1,X2,Y2,Z2) DSTNC306 IF (DIST(I).LE.DLIMUP) GO TO 150 DSTNC307 C DSTNC308 C COME HERE IF DISTANCE IS OVER LIMIT. DSTNC309 C WRITE ERROR MESSAGES AND CHECK ATOM NUMBER POSITION FROM CONECT DSTNC310 C RECORD TO IDENTIFY SALT BRIDGES AND HYDROGEN BONDS. DSTNC311 C DSTNC312 WRITE (IOUT,320) IAT,IND,DIST(I) DSTNC313 IF ((I.EQ.7).OR.(I.EQ.10)) WRITE (IOUT,330) DSTNC314 IF ((I.EQ.5).OR.(I.EQ.6).OR.(I.EQ.8).OR.(I.EQ.9)) WRITE (IOUT,340)DSTNC315 1 DSTNC316 GO TO 160 DSTNC317 150 IF (DIST(I).LT.DLIMLO) WRITE (IOUT,350) IAT,IND,DIST(I) DSTNC318 160 CONTINUE DSTNC319 C DSTNC320 C ENCODE COMPUTED DISTANCES. THIS IS NECESSARY TO AVOID PRINTING DSTNC321 C ZERO IN FIELDS THAT SHOULD BE BLANK. DSTNC322 C DSTNC323 DO 180 I=1,10 DSTNC324 J=2*I DSTNC325 JM1=J-1 DSTNC326 IF (DIST(I).NE.0.0) GO TO 170 DSTNC327 ICDIST(JM1)=IBLANK DSTNC328 ICDIST(J)=IBLANK DSTNC329 GO TO 180 DSTNC330 170 CONTINUE DSTNC331 C REWIND ITEMP DSTNC332 C WRITE(ITEMP,290) DIST(I) DSTNC333 C REWIND ITEMP DSTNC334 C READ(ITEMP,300) ICDIST(JM1),ICDIST(J) DSTNC335 ENCODE (80,290,LINE(1) )DIST(I) DSTNC336 DECODE (80,300,LINE(1) )ICDIST(JM1),ICDIST(J) DSTNC337 180 CONTINUE DSTNC338 C DSTNC339 C WRITE CONECT AND BONDIS RECORDS ON FILE IDIST. DSTNC340 C DSTNC341 WRITE (IDIST,220) ICONRC DSTNC342 WRITE (IDIST,310) IAT,(ICDIST(I),I=1,20) DSTNC343 C DSTNC344 GO TO 130 DSTNC345 190 WRITE (IOUT,390) DSTNC346 200 CONTINUE DSTNC347 WRITE (IOUT,270) DSTNC348 STOP DSTNC349 C DSTNC350 C DSTNC351 C DSTNC352 210 FORMAT (2F5.3) DSTNC353 220 FORMAT (20A4) DSTNC354 230 FORMAT (1H1,42HOUTPUT OF PROTEIN DATA BANK PROGRAM DSTNCE) DSTNC355 240 FORMAT (8H0RUN AT ,A10,4H ON ,A10) DSTNC356 250 FORMAT (1H0,20A4) DSTNC357 260 FORMAT (1H0,I5,6H ATOMS) DSTNC358 270 FORMAT (1H0,42HEND OF PROTEIN DATA PROGRAM PROGRAM DSTNCE) DSTNC359 280 FORMAT (6X,11I5) DSTNC360 290 FORMAT (F5.2) DSTNC361 300 FORMAT (A4,A1) DSTNC362 310 FORMAT (6HBONDIS,I5,10(A4,A1)) DSTNC363 320 FORMAT (1H0,39X,33HDISTANCE GREATER THAN UPPER LIMIT/40X,2I5,F7.2)DSTNC364 330 FORMAT (40X,11HSALT BRIDGE) DSTNC365 340 FORMAT (40X,13HHYDROGEN BOND) DSTNC366 350 FORMAT (35H0DISTANCE SMALLLER THAN LOWER LIMIT/1X,2I5,F7.2) DSTNC367 360 FORMAT (33H0ERROR - HAVE CONECT RECORDS FOR ,A4,14H AND DATA FOR ,DSTNC368 1A4) DSTNC369 370 FORMAT (42H0LOWER AND UPPER LIMITS FOR DISTANCES ARE ,F5.2,5H AND DSTNC370 1,F5.2) DSTNC371 380 FORMAT (22H1NO MORE TITLE RECORDS) DSTNC372 390 FORMAT (21H1NO MORE DATA ENTRIES) DSTNC373 400 FORMAT (27H0NO MORE CONECT RECORD SETS) DSTNC374 410 FORMAT(52H0TOO MANY ATOMS FOR CURRENT DIMENSIONS - USED FIRST ,I8)DSTNCE28 END DSTNC375 SUBROUTINE STORE (INDEX,XT,YT,ZT) DSTNC376 C DSTNC377 C STORE COORDINATES OF SPECIFIED ATOM. DSTNC378 C DSTNC379 COMMON COORDS(3,10000) DSTNCE29 COORDS(1,INDEX)=XT DSTNC381 COORDS(2,INDEX)=YT DSTNC382 COORDS(3,INDEX)=ZT DSTNC383 RETURN DSTNC384 END DSTNC385 SUBROUTINE FETCH (INDEX,XT,YT,ZT) DSTNC386 C DSTNC387 C FETCH COORDINATES OF SPECIFIED ATOM. DSTNC388 C DSTNC389 COMMON COORDS(3,10000) DSTNCE10 XT=COORDS(1,INDEX) DSTNC391 YT=COORDS(2,INDEX) DSTNC392 ZT=COORDS(3,INDEX) DSTNC393 RETURN DSTNC394 END DSTNC395 SUBROUTINE NXTLIN (NATOML,NAML,NALTL,NAMRSL,NCHANL,NUML,INSL,XL,YLDSTNC396 1,ZL,IFMT,JCODE) DSTNC397 C DSTNC398 C THIS ROUTINE WILL PRINT CERTAIN RECORDS ON THE OUTPUT FILE. DSTNC399 C FOR ATOM AND HETATM RECORDS THE NEEDED PARAMETERS ARE RETURNED VIADSTNC400 C THE ARGUMENT LIST. DSTNC401 C DSTNC402 C NATOML IS THE ATOM SERIAL NUMBER DSTNC403 C NAML IS THE ATOM NAME DSTNC404 C NALTL IS THE ALTERNATE POSITION INDICATOR DSTNC405 C NAMRSL IS THE RESIDUE NAME DSTNC406 C NCHANL IS THE CHAIN INDICATOR DSTNC407 C NUML IS THE RESIDUE NUMBER DSTNC408 C INSL IS THE INSERTION CODE DSTNC409 C XL, YL, ZL ARE THE COORDINATES OF THE ATOM DSTNC410 C DSTNC411 C IFMT IS AN ARRAY STORING THE FORMAT USED TO READ ATOM AND HETATM DSTNC412 C RECORDS FROM A PROTEIN DATA BANK ENTRY. IT IS DEFINED IN THE DSTNC413 C MAIN PROGRAM AND USED BELOW. DSTNC414 C DSTNC415 C JCODE = 0 FOR GOOD ATOM DSTNC416 C = 1 FOR TER CODE DSTNC417 C = 2 FOR END CODE DSTNC418 C = 3 FOR END-OF-FILE SENSED DSTNC419 C DSTNC420 C THE FOLLOWING VARIABLES IN THIS ROUTINE ARE USED TO STORE DSTNC421 C CHARACTERS AT 4 PER WORD DSTNC422 C DSTNC423 C IATOM, IAUTH, ICMP, IDATE, IEND, IFMT, IHEAD, IHETA, INSL, DSTNC424 C INTRY, IREC, IREMA, ITER, JRNL, NALTL, NAML, NAMRSL, NCHANL DSTNC425 C DSTNC426 C THE FOLLOWING VARIABLES IN THIS ROUTINE ARE USED TO STORE DSTNC427 C CHARACTERS AT 10 PER WORD DSTNC428 C DSTNC429 C LINE DSTNC430 C DSTNC431 DIMENSION IFMT(20) DSTNC432 DIMENSION IDATE(3) DSTNC433 DIMENSION IREC(20) DSTNC434 DIMENSION LINE(8) DSTNC435 COMMON /FILES/ INP,IOUT,IDATA,ICONS,IDIST,ITEMP DSTNC436 COMMON /INTRY/ INTRY DSTNC437 DATA IATOM/4HATOM/,IHEAD/4HHEAD/,ICMP/4HCOMP/,ITER/4HTER / DSTNC438 DATA IEND/4HEND /,IAUTH/4HAUTH/,JRNL/4HJRNL/,IHETA/4HHETA/ DSTNC439 DATA IREMA/4HREMA/ DSTNC440 ICOMP(I,J)=I-J DSTNC441 JCODE=0 DSTNC442 10 READ (IDATA,90) IREC DSTNC443 C DSTNC444 C THE STATEMENT BELOW WILL TRANSFER CONTROL TO STATEMENT 80 IF AN DSTNC445 C END-OF-FILE WAS ENCOUNTERED ON THE INPUT DEVICE. IF NO END-OF- DSTNC446 C FILE IS SENSED CONTROL IS ASSUMED BY STATEMENT 20. DSTNC447 C DSTNC448 IF (EOF(IDATA)) 80,20 DSTNC449 C DSTNC450 C IDENTIFY TYPE OF RECORD DSTNC451 C DSTNC452 20 IF (ICOMP(IREC(1),IATOM).EQ.0) GO TO 30 DSTNC453 IF (ICOMP(IREC(1),IHETA).EQ.0) GO TO 30 DSTNC454 IF (ICOMP(IREC(1),IREMA).EQ.0) GO TO 10 DSTNC455 IF (ICOMP(IREC(1),IHEAD).EQ.0) GO TO 50 DSTNC456 IF (ICOMP(IREC(1),ICMP).EQ.0) GO TO 60 DSTNC457 IF (ICOMP(IREC(1),ITER).EQ.0) GO TO 70 DSTNC458 IF (ICOMP(IREC(1),IAUTH).EQ.0) GO TO 60 DSTNC459 IF (ICOMP(IREC(1),IEND).EQ.0) GO TO 40 DSTNC460 IF (ICOMP(IREC(1),JRNL).EQ.0) GO TO 60 DSTNC461 GO TO 10 DSTNC462 C DSTNC463 C ATOM OR HETATM RECORD DSTNC464 C DSTNC465 30 CONTINUE DSTNC466 C REWIND ITEMP DSTNC467 C WRITE (ITEMP,90) IREC DSTNC468 C REWIND ITEMP DSTNC469 C READ(ITEMP,IFMT) NATOML,NAML,NALTL,NAMRSL,NCHANL,NUML,INSL,XL,YL, DSTNC470 C 1ZL DSTNC471 ENCODE (80,90,LINE(1) )(IREC(I),I=1,20) DSTNC472 DECODE (80,IFMT,LINE(1) )NATOML,NAML,NALTL,NAMRSL,NCHANL,NUML,INSLDSTNC473 1,XL,YL,ZL DSTNC474 RETURN DSTNC475 40 JCODE=2 DSTNC476 RETURN DSTNC477 C DSTNC478 C HEADER RECORD DSTNC479 C DSTNC480 50 CONTINUE DSTNC481 C REWIND ITEMP DSTNC482 C WRITE (ITEMP,90) IREC DSTNC483 C REWIND ITEMP DSTNC484 C READ (ITEMP,100) IDATE,INTRY DSTNC485 ENCODE (80,90,LINE(1) )(IREC(I),I=1,20) DSTNC486 DECODE (80,100,LINE(1) )IDATE,INTRY DSTNC487 WRITE (IOUT,110) INTRY,IDATE DSTNC488 GO TO 10 DSTNC489 C DSTNC490 C SHIFT THE *COMPND*, *AUTH* OR *JRNL* INFORMATION IN IREC LEFT BY DSTNC491 C 10 CHARACTERS AND PRINT THE STRING DSTNC492 C DSTNC493 60 CONTINUE DSTNC494 C REWIND ITEMP DSTNC495 C WRITE (ITEMP,90) IREC DSTNC496 C REWIND ITEMP DSTNC497 C READ (ITEMP,120) (IREC(I),I=1,15) DSTNC498 ENCODE (80,90,LINE(1) )(IREC(I),I=1,20) DSTNC499 DECODE (80,120,LINE(1) )(IREC(I),I=1,15) DSTNC500 WRITE (IOUT,130) (IREC(I),I=1,15) DSTNC501 GO TO 10 DSTNC502 C DSTNC503 C TER RECORD DSTNC504 C DSTNC505 70 JCODE=1 DSTNC506 RETURN DSTNC507 80 JCODE=3 DSTNC508 RETURN DSTNC509 C DSTNC510 C DSTNC511 C DSTNC512 90 FORMAT (20A4) DSTNC513 100 FORMAT (50X,2A4,A2,2X,A4) DSTNC514 110 FORMAT (25H0PROTEIN DATA BANK ENTRY ,A4,9H DATED ,2A4,A2,4H FOR)DSTNC515 120 FORMAT (10X,15A4) DSTNC516 130 FORMAT (1X,15A4) DSTNC517 END DSTNC518