1 subroutine read_ref_structure(iprot,*)
3 C Read the reference structure from the PDB file or from a PDB file or in the form of the dihedral
8 include 'DIMENSIONS.ZSCOPT'
11 integer IERROR,ERRCODE,kolor,key,comm
14 include 'COMMON.IOUNITS'
17 include 'COMMON.INTERACT'
18 include 'COMMON.LOCAL'
19 include 'COMMON.NAMES'
20 include 'COMMON.CHAIN'
21 include 'COMMON.FFIELD'
22 include 'COMMON.SBRIDGE'
23 include 'COMMON.HEADER'
24 include 'COMMON.CONTROL'
25 include 'COMMON.TIME1'
26 include 'COMMON.COMPAR'
27 include 'COMMON.VMCPAR'
29 character*4 sequence(maxres)
31 double precision x(maxvar)
32 integer itype_pdb(maxres)
34 integer i,j,k,ib,iref,iprot,nres_pdb
35 double precision ddsc,dist
36 double precision efree_temp
40 if (me.eq.Master) write (2,*) "PDBREF ",pdbref
42 DO IB=1,NBETA(1,iprot)
45 if (me.eq.Master) write (iout,'(2a,1h.)')
46 & 'PDB data will be read from file ',
47 & pdbfile(ib,iprot)(:ilen(pdbfile(ib,iprot)))
48 open(ipdbin,file=pdbfile(ib,iprot),status='old',err=33)
50 33 if (me.eq.Master)write (iout,'(a)') 'Error opening PDB file.'
55 if (me.eq.Master)write (2,*) "Reading reference structure",iref
56 call readpdb(print_refstr,iprot,efree_temp,*44)
57 c write (2,*) "After readpdb"
59 if (nres_pdb.eq.0) then
62 C Copy the coordinates to reference coordinates
63 efreeref(iref,ib,iprot)=efree_temp
66 cref(j,i,iref,ib,iprot)=c(j,i)
75 if (nsup(iprot).le.(nct-nnt+1)) then
76 do i=0,nct-nnt+1-nsup(iprot)
77 if (seq_comp(itype(nnt+i),itype_pdb(nstart_sup(iprot)),
79 do j=nnt+nsup(iprot)-1,nnt,-1
81 cref(k,j+i,iref,ib,iprot)=cref(k,j,iref,ib,iprot)
82 cref(k,nres+j+i,iref,ib,iprot)=
83 & cref(k,nres_pdb+j,iref,ib,iprot)
85 c phi_ref(j+i,iprot)=phi_ref(j,iprot)
86 c theta_ref(j+i,iprot)=theta_ref(j,iprot)
87 c alph_ref(j+i,iprot)=alph_ref(j,iprot)
88 c omeg_ref(j+i,iprot)=omeg_ref(j,iprot)
91 write (iout,*) "Free energy",efreeref(iref,ib,iprot)
93 write (iout,'(i5,3f10.5,5x,3f10.5)')
94 & j,(cref(k,j,iref,ib,iprot),k=1,3),
95 & (cref(k,j+nres,iref,ib,iprot),k=1,3)
99 nstart_sup(iprot)=nnt+i
103 if (me.eq.Master) write (iout,'(a)')
104 & 'Error - sequences to be superposed do not match.'
107 do i=0,nsup(iprot)-(nct-nnt+1)
108 if (seq_comp(itype(nnt),itype_pdb(nstart_sup(iprot)+i),
111 nstart_sup(iprot)=nstart_sup(iprot)+i
112 nsup(iprot)=nct-nnt+1
116 if (me.eq.Master) write (iout,'(a)')
117 & 'Error - sequences to be superposed do not match.'
120 if (me.eq.Master) write (iout,'(a,i5)')
121 & 'Experimental structure begins at residue',nstart_seq
124 nref(ib,iprot)=iref-1
125 if (me.eq.Master) write (iout,*) "NREF",ib,iprot,nref(ib,iprot)
126 if (me.eq.Master) call flush(iout)
129 call read_angles(inp,*38)
131 38 nref(ib,iprot)=iref-1
134 nstart_sup(iprot)=nnt
136 nsup(iprot)=nct-nnt+1
139 cref(j,i,iref,ib,iprot)=c(j,i)
143 nref(ib,iprot)=iref-1
145 nend_sup(iprot)=nstart_sup(iprot)+nsup(iprot)-1
148 c c(j,i)=cref(j,i,iprot)
153 c dc(j,nres+i)=cref(j,nres+i,iprot)-cref(j,i,iprot)
155 c if (itype(i).ne.10) then
156 c ddsc = dist(i,nres+i)
158 c dc_norm(j,nres+i)=dc(j,nres+i)/ddsc
162 c dc_norm(j,nres+i)=0.0d0
165 c write (iout,*) "i",i," dc_norm",(dc_norm(k,nres+i),k=1,3),
166 c " norm",dc_norm(1,nres+i)**2+dc_norm(2,nres+i)**2+
167 c dc_norm(3,nres+i)**2
169 dc(j,i)=c(j,i+1)-c(j,i)
173 dc_norm(j,i)=dc(j,i)/ddsc
176 c print *,"Calling contact"
177 c call contact(print_contact,ncont_ref(iprot),icont_ref(1,1,iprot),
178 c & nstart_sup(iprot),nend_sup(iprot))
179 c print *,"Calling elecont"
180 c call elecont(print_contact,ncont_pept_ref(iprot),
181 c & icont_pept_ref(1,1,iprot),
182 c & nstart_sup(iprot),nend_sup(iprot))
183 c write (iout,'(a,i3,a,i3,a,i3,a)')
184 c & 'Number of residues to be superposed:',nsup(iprot),
185 c & ' (from residue',nstart_sup(iprot),' to residue',
186 c & nend_sup(iprot),').'