1 subroutine secstrp2dihc
2 implicit real*8 (a-h,o-z)
5 include 'COMMON.BOUNDS'
7 include 'COMMON.TORCNSTR'
8 include 'COMMON.IOUNITS'
9 character*1 secstruc(maxres)
10 COMMON/SECONDARYS/secstruc
15 cdr call getenv_loc('SECPREDFIL',secpred)
17 secpred=prefix(:lenpre)//'.spred'
19 #if defined(WINIFL) || defined(WINPGI)
20 open(isecpred,file=secpred,status='old',readonly,shared)
21 #elif (defined CRAY) || (defined AIX)
22 open(isecpred,file=secpred,status='old',action='read')
24 open(isecpred,file=secpred,status='old')
26 open(isecpred,file=secpred,status='old',readonly)
28 C read secondary structure prediction from JPRED here!
29 ! read(isecpred,'(A80)',err=100,end=100) line
30 ! read(line,'(f10.3)',err=110) ftors
31 read(isecpred,'(f10.3)',err=110) ftors
33 write (iout,*) 'FTORS factor =',ftors
34 ! initialize secstruc to any
41 call read_secstr_pred(isecpred,iout,errflag)
43 write(iout,*)'There is a problem with the list of secondary-',
44 & 'structure prediction'
47 C 8/13/98 Set limits to generating the dihedral angles
55 if ( secstruc(i) .eq. 'H') then
56 C Helix restraints for this residue
59 phi0(ii) = 45.0D0*deg2rad
60 drange(ii)= 5.0D0*deg2rad
61 phibound(1,i) = phi0(ii)-drange(ii)
62 phibound(2,i) = phi0(ii)+drange(ii)
63 else if (secstruc(i) .eq. 'E') then
64 C strand restraints for this residue
67 phi0(ii) = 180.0D0*deg2rad
68 drange(ii)= 5.0D0*deg2rad
69 phibound(1,i) = phi0(ii)-drange(ii)
70 phibound(2,i) = phi0(ii)+drange(ii)
72 C no restraints for this residue
73 ndih_nconstr=ndih_nconstr+1
74 idih_nconstr(ndih_nconstr)=i
80 write(iout,'(A30,A80)')'Error reading file SECPRED',secpred
83 write(iout,'(A20)')'Error reading FTORS'
87 subroutine read_secstr_pred(jin,jout,errors)
89 implicit real*8 (a-h,o-z)
91 include 'COMMON.IOUNITS'
92 include 'COMMON.CHAIN'
93 character*1 secstruc(maxres)
94 COMMON/SECONDARYS/secstruc
96 character*80 line,line1,ucase
97 logical errflag,errors,blankline
100 read (jin,'(a)') line
101 write (jout,'(2a)') '> ',line(1:78)
103 C Remember that we number full residues starting from 2, then, iseq=1 and iseq=nres
104 C correspond to the end-groups. ADD to the secondary structure prediction "-" for the
105 C end-groups in the input file "*.spred"
108 do while (index(line1,'$END').eq.0)
109 * Override commented lines.
112 do while (.not.blankline)
114 call mykey(line,line1,ipos,blankline,errflag)
115 if (errflag) write (jout,'(2a)')
116 & 'Error when reading sequence in line: ',line
117 errors=errors .or. errflag
118 if (.not. blankline .and. .not. errflag) then
121 if (iseq.le.maxres) then
122 if (line1(1:1).eq.'-' ) then
123 secstruc(iseq)=line1(1:1)
124 else if ( ( ucase(line1(1:1)).eq.'E' ) .or.
125 & ( ucase(line1(1:1)).eq.'H' ) ) then
126 secstruc(iseq)=ucase(line1(1:1))
129 write (jout,1010) line1(1:1), iseq
134 write (jout,1000) iseq,maxres
137 do while (ipos1.le.iend)
142 if (iseq.le.maxres) then
143 if (line1(ipos1-1:ipos1-1).eq.'-' ) then
144 secstruc(iseq)=line1(ipos1-1:ipos1-1)
145 else if((ucase(line1(ipos1-1:ipos1-1)).eq.'E').or.
146 & (ucase(line1(ipos1-1:ipos1-1)).eq.'H') ) then
147 secstruc(iseq)=ucase(line1(ipos1-1:ipos1-1))
150 write (jout,1010) line1(ipos1-1:ipos1-1), iseq
155 write (jout,1000) iseq,maxres
162 read (jin,'(a)') line
163 write (jout,'(2a)') '> ',line(1:78)
167 cd write (jout,'(10a8)') (sequence(i),i=1,iseq-1)
169 cd check whether the found length of the chain is correct.
170 length_of_chain=iseq-1
171 if (length_of_chain .ne. nres) then
173 write (jout,'(a,i4,a,i4,a)')
174 & 'Error: the number of labels specified in $SEC_STRUC_PRED ('
175 & ,length_of_chain,') does not match with the number of residues ('
180 1000 format('Error - the number of residues (',i4,
181 & ') has exceeded maximum (',i4,').')
182 1010 format ('Error - unrecognized secondary structure label',a4,