REAL*4 THET(3),ANGLE(250,2),PI,OMEGA INTEGER*2 IK(50),AA(250),LIMIT,NRES,N,I,RES character*4 atom(1000) COMMON COORD(1000,3) PI=4*ATAN(1.0) C BOND ANGLES: STRAIGHT WIRE HAS ANGLE 180, SO BEND FROM STRAIGHT BY 180-THETA degrees C The values used here might not be the most accurate available THET(1)=(180-123)*PI/180 c :'C-N-CA THET(2)=(180-110)*PI/180 c :'N-CA-C THET(3)=(180-114)*PI/180 c :'CA-C-N OMEGA=180*PI/180 c :'TORSION ANGLE OF PEPTIDE BOND c also check angle values of O atom below c bond lengths are coded into section below, should repl by variable set here 600 CONTINUE C READ MODEL ANGLES FROM STDIN I=1 620 READ(5,*,END=621,err=621)AA(I),PHI,PSI ANGLE(I,1)=PHI*PI/180 ANGLE(I,2)=PSI*PI/180 I=I+1 GOTO 620 621 NRES=I-1 write(6,*) 'CALCULATING NEW COORDINATES:' 2000 L=0 C 'NO ATOMS INITIALIZED YET. c First call to extrude simply initializes atom at o,o,o DO 2030 RES=1, NRES C IF L>LIMIT THEN L=LIMIT:print "Maximum of ";LIMIT;" atoms" c 'Nitrogen c DZ=1.32:THETA=THET(1):TAU=ANGLE(RES,1):'C-N BOND, N ANGLE, PHI ANGLE call extrude(1.32,THET(1),angle(res,1),L) atom(L)=' N ' C 'ALPHA CARBON: c DZ=1.53:THETA=THET(2):TAU=ANGLE(RES,2):'N-ALPHA BOND, ALPHA ANGLE, PSI A call extrude(1.53,THET(2),angle(res,2),L) atom(L)=' CA' C 'to make polyalanine, add CA now as we do O below (and change 4 to 5 atoms per res) C 'Carbonyl carbon c DZ=1.47:THETA=THET(3):TAU=OMEGA:'ALPHA-C BOND, C ANGLE, OMEGA ANGLE call extrude(1.47,THET(3),OMEGA,L) atom(L)=' C ' C 'CARBONYL OXYGEN: C atom is now at origin with next N on minus Z axis c and previous CA in yz plane, so put O in yz plane at angle 125* L=L+1 ATOM(L)=' O ' COORD(L,1)=0. COORD(L,2)=1.01575 C '1.01575 = 1.24 SIN 125 COORD(L,3)=0.71123 C '0.71123 =-1.24 COS 125 2030 CONTINUE C 'FILE ATOMIC COORDINATES c INPUT"FILENAME FOR SAVING COORDINATES";N OPEN (UNIT=3,FILE='construct.pdb',STATUS='unknown') DO 53 I=1, 4*NRES 53 write(3,51) I,atom(I),aa(1+int((I-1)/4)),(COORD(I,J),J=1,3),1.0,20.0 51 format ('ATOM ',I5,A4,' GLY A',i4,' ',3f8.3,2f6.2) CLOSE (UNIT=3) END SUBROUTINE EXTRUDE(DZ,THETA,TAU,L) C REAL*4 COORD(1000,3),DZ,THETA,TAU REAL*4 DZ,THETA,TAU REAL*8 COS1,SIN1,COS2,SIN2,X,Y,Z COMMON COORD(1000,3) C 'TRANSLATE BY BOND LENGTH DZ, BEND IN YZ PLANE BY BOND ANGLE THETA, C IN XY BY DIHEDRAL ANGLE C 'The current atom will be at origin, bondangle is at current atom, C ' dihedral is between current atom and next (because will translate and bend in yz plane) COS1=COS(THETA) SIN1=SIN(THETA) COS2=COS(TAU) SIN2=SIN(TAU) C :' FOR ALL ATOMS PREVIOUSLY INITIALIZED (1<=I<=L) DO 2105 I=1, L C 'Z-TRANSLATE BY DZ Z=COORD(I,3)+DZ C 'X-ROTATE (ROTATE ABOUT X AXIS BY THETA) Y=COORD(I,2)*COS1 + Z*SIN1 COORD(I,3)=Z*COS1 - COORD(I,2)*SIN1 C 'Z-ROTATE BY TAU COORD(I,2)= Y*COS2 + COORD(I,1)*SIN2 COORD(I,1)=-Y*SIN2 + COORD(I,1)*COS2 2105 CONTINUE C:'INITLZ NEXT ATOM TO ORIGIN L=L+1 DO 2107 I=1,3 2107 COORD(L,I)=0.0 RETURN end