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'
9 include 'COMMON.IOUNITS'
12 include 'COMMON.INTERACT'
13 include 'COMMON.LOCAL'
14 include 'COMMON.NAMES'
15 include 'COMMON.CHAIN'
16 include 'COMMON.FFIELD'
17 include 'COMMON.SBRIDGE'
18 include 'COMMON.HEADER'
19 include 'COMMON.CONTROL'
20 include 'COMMON.TIME1'
21 include 'COMMON.COMPAR'
22 include 'COMMON.VMCPAR'
23 character*4 sequence(maxres)
25 double precision x(maxvar)
26 integer itype_pdb(maxres)
28 integer i,j,k,ib,iref,iprot,nres_pdb
29 double precision ddsc,dist
33 write (2,*) "PDBREF ",pdbref
35 DO IB=1,NBETA(1,iprot)
38 write (iout,'(2a,1h.)') 'PDB data will be read from file ',
39 & pdbfile(ib,iprot)(:ilen(pdbfile(ib,iprot)))
40 open(ipdbin,file=pdbfile(ib,iprot),status='old',err=33)
42 33 write (iout,'(a)') 'Error opening PDB file.'
47 write (2,*) "Reading reference structure",iref
48 call readpdb(print_refstr,iprot)
49 write (2,*) "After readpdb"
51 if (nres_pdb.eq.0) then
54 C Copy the coordinates to reference coordinates
57 cref(j,i,iref,ib,iprot)=c(j,i)
66 if (nsup(iprot).le.(nct-nnt+1)) then
67 do i=0,nct-nnt+1-nsup(iprot)
68 if (seq_comp(itype(nnt+i),itype_pdb(nstart_sup(iprot)),
70 do j=nnt+nsup(iprot)-1,nnt,-1
72 cref(k,j+i,iref,ib,iprot)=cref(k,j,iref,ib,iprot)
73 cref(k,nres+j+i,iref,ib,iprot)=
74 & cref(k,nres_pdb+j,iref,ib,iprot)
76 c phi_ref(j+i,iprot)=phi_ref(j,iprot)
77 c theta_ref(j+i,iprot)=theta_ref(j,iprot)
78 c alph_ref(j+i,iprot)=alph_ref(j,iprot)
79 c omeg_ref(j+i,iprot)=omeg_ref(j,iprot)
84 write (iout,'(i5,3f10.5,5x,3f10.5)')
85 & j,(cref(k,j,iref,ib,iprot),k=1,3),
86 & (cref(k,j+nres,iref,ib,iprot),k=1,3)
91 nstart_sup(iprot)=nnt+i
96 & 'Error - sequences to be superposed do not match.'
99 do i=0,nsup(iprot)-(nct-nnt+1)
100 if (seq_comp(itype(nnt),itype_pdb(nstart_sup(iprot)+i),
103 nstart_sup(iprot)=nstart_sup(iprot)+i
104 nsup(iprot)=nct-nnt+1
109 & 'Error - sequences to be superposed do not match.'
112 write (iout,'(a,i5)')
113 & 'Experimental structure begins at residue',nstart_seq
115 nref(ib,iprot)=iref-1
116 write (iout,*) "NREF",ib,iprot,nref(ib,iprot)
120 call read_angles(inp,*38)
122 38 nref(ib,iprot)=iref-1
125 nstart_sup(iprot)=nnt
127 nsup(iprot)=nct-nnt+1
130 cref(j,i,iref,ib,iprot)=c(j,i)
134 nref(ib,iprot)=iref-1
136 nend_sup(iprot)=nstart_sup(iprot)+nsup(iprot)-1
139 c c(j,i)=cref(j,i,iprot)
144 c dc(j,nres+i)=cref(j,nres+i,iprot)-cref(j,i,iprot)
146 c if (itype(i).ne.10) then
147 c ddsc = dist(i,nres+i)
149 c dc_norm(j,nres+i)=dc(j,nres+i)/ddsc
153 c dc_norm(j,nres+i)=0.0d0
156 c write (iout,*) "i",i," dc_norm",(dc_norm(k,nres+i),k=1,3),
157 c " norm",dc_norm(1,nres+i)**2+dc_norm(2,nres+i)**2+
158 c dc_norm(3,nres+i)**2
160 dc(j,i)=c(j,i+1)-c(j,i)
164 dc_norm(j,i)=dc(j,i)/ddsc
167 c print *,"Calling contact"
168 c call contact(print_contact,ncont_ref(iprot),icont_ref(1,1,iprot),
169 c & nstart_sup(iprot),nend_sup(iprot))
170 c print *,"Calling elecont"
171 c call elecont(print_contact,ncont_pept_ref(iprot),
172 c & icont_pept_ref(1,1,iprot),
173 c & nstart_sup(iprot),nend_sup(iprot))
174 c write (iout,'(a,i3,a,i3,a,i3,a)')
175 c & 'Number of residues to be superposed:',nsup(iprot),
176 c & ' (from residue',nstart_sup(iprot),' to residue',
177 c & nend_sup(iprot),').'