1 implicit real*8 (a-h,o-z)
4 include 'COMMON.INTERACT'
5 include 'COMMON.SBRIDGE'
7 real*4 prec,potE,efree,rmsdev
9 character*80 arg,seqfile,pdbfile
10 character*3 sequenc(maxres)
12 character*8 onethree,cfreq
21 if (iargc().lt.4) then
23 & "Usage: xdrf2pdb one/three seqfile cxfile conf [pdbfile]"
26 call getarg(1,onethree)
27 onethree = ucase(onethree)
28 if (onethree.eq.'ONE') then
30 else if (onethree.eq.'THREE') then
33 print *,"ONE or THREE must be specified"
35 call getarg(2,seqfile)
36 open (1,file=seqfile,status='old')
38 read(1,'(80a1)',end=10,err=10) (sequenc(i)(1:1),i=1,maxres)
42 do while (.not.iblnk(sequenc(i+1)(1:1)))
47 itype(i)=rescode(i,sequenc(i),1)
50 read(1,'(20(a3,1x))',end=11,err=11) (sequenc(i),i=1,maxres)
55 print *,i," ",sequenc(i)
59 do while (.not.iblnk(sequenc(i+1)(1:1)))
60 print *,i+1," ",sequenc(i+1)," ",sequenc(i+1)(1:1)
66 itype(i)=rescode(i,sequenc(i),0)
68 print *,(itype(i),i=1,nres)
71 iext = index(arg,'.cx') - 1
73 print *,"Error - not a cx file"
80 if (iargc().gt.4) then
81 call getarg(5,pdbfile)
83 pdbfile=arg(:iext)//'.pdb'
87 if (itype(1).eq.21) nnt = 2
89 if (itype(nres).eq.21) nct = nres-1
90 c if (nct.eq.nres-1) nres=nres-1
91 c if (nnt.eq.2) nres=nres-1
93 print *,"nres",nres," nnt",nnt," nct",nct
95 call xdrfopen(ixdrf,arg, "r", iret)
101 call xdrf3dfcoord(ixdrf, coord, isize, prec, iret)
102 call xdrfint(ixdrf, nss, iret)
104 call xdrfint(ixdrf, ihpb(j), iret)
105 call xdrfint(ixdrf, jhpb(j), iret)
107 call xdrffloat(ixdrf, potE, iret)
110 call xdrffloat(ixdrf, efree, iret)
111 call xdrffloat(ixdrf, rmsdev, iret)
112 call xdrfint(ixdrf, iscor, iret)
113 if (kk.eq.iconf) then
114 print *,"pote",pote," efree",efree," rmsdev",rmsdev
116 print *,"isize",isize
118 if (isize .ne. nres+nct-nnt+1) then
119 print *,"Error: inconsistent sizes",isize,nres+nct-nnt+1
130 c(j,i+nres)=coord(j,ii+nres)
134 write (tytul,'(a,i6)') "Structure",kk
135 call pdbout(etot,tytul,9)