1 subroutine read_ref_structure(*)
3 C Read the reference structure from the PDB file or from a PDB file or in the form of the dihedral
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 character*4 sequence(maxres)
23 double precision x(maxvar)
24 integer itype_pdb(maxres)
26 integer i,j,k,nres_pdb,iaux
27 double precision ddsc,dist
32 write (iout,*) "pdbref",pdbref
34 read(inp,'(a)') pdbfile
35 write (iout,'(2a,1h.)') 'PDB data will be read from file ',
36 & pdbfile(:ilen(pdbfile))
37 open(ipdbin,file=pdbfile,status='old',err=33)
39 33 write (iout,'(a)') 'Error opening PDB file.'
55 if (nsup.le.(nct-nnt+1)) then
57 if (seq_comp(itype(nnt+i),itype_pdb(nstart_sup),
59 do j=nnt+nsup-1,nnt,-1
61 cref(k,nres+j+i)=cref(k,nres_pdb+j)
64 do j=nnt+nsup-1,nnt,-1
68 phi_ref(j+i)=phi_ref(j)
69 theta_ref(j+i)=theta_ref(j)
70 alph_ref(j+i)=alph_ref(j)
71 omeg_ref(j+i)=omeg_ref(j)
75 write (iout,'(i5,3f10.5,5x,3f10.5)')
76 & j,(cref(k,j),k=1,3),(cref(k,j+nres),k=1,3)
85 & 'Error - sequences to be superposed do not match.'
88 do i=0,nsup-(nct-nnt+1)
89 if (seq_comp(itype(nnt),itype_pdb(nstart_sup+i),
92 nstart_sup=nstart_sup+i
98 & 'Error - sequences to be superposed do not match.'
101 write (iout,'(a,i5)')
102 & 'Experimental structure begins at residue',nstart_seq
104 call read_angles(inp,*38)
106 38 write (iout,'(a)') 'Error reading reference structure.'
118 nend_sup=nstart_sup+nsup-1
126 dc(j,nres+i)=cref(j,nres+i)-cref(j,i)
128 if (itype(i).ne.10) then
129 ddsc = dist(i,nres+i)
131 dc_norm(j,nres+i)=dc(j,nres+i)/ddsc
135 dc_norm(j,nres+i)=0.0d0
138 c write (iout,*) "i",i," dc_norm",(dc_norm(k,nres+i),k=1,3),
139 c " norm",dc_norm(1,nres+i)**2+dc_norm(2,nres+i)**2+
140 c dc_norm(3,nres+i)**2
142 dc(j,i)=c(j,i+1)-c(j,i)
146 dc_norm(j,i)=dc(j,i)/ddsc
149 write (iout,'(a,i3,a,i3,a,i3,a)')
150 & 'Number of residues to be superposed:',nsup,
151 & ' (from residue',nstart_sup,' to residue',