cluster unres
[unres.git] / source / cluster / unres / src / wrtclust.f
index ca43876..3f057b2 100644 (file)
@@ -25,20 +25,20 @@ c      ICANT(I,J)=((NCON+NCON-J)*(J-1))/2+I-J
 C
 C  PRINT OUT THE RESULTS OF CLUSTER ANALYSIS
 C
-      ii1= index(intinname,'/')
+      ii1= index(intname,'/')
       ii2=ii1
       ii1=ii1+1
       do while (ii2.gt.0) 
         ii1=ii1+ii2
-        ii2=index(intinname(ii1:),'/')
+        ii2=index(intname(ii1:),'/')
       enddo 
-      ii = ii1+index(intinname(ii1:),'.')-1
+      ii = ii1+index(intname(ii1:),'.')-1
       if (ii.eq.0) then
-        ii=ilen(intinname)
+        ii=ilen(intname)
       else
         ii=ii-1
       endif
-      prefixp=intinname(ii1:ii)
+      prefixp=intname(ii1:ii)
 cd    print *,icut,printang(icut),printpdb(icut),printmol2(icut)
 cd    print *,'ecut=',ecut
       WRITE (iout,100) NGR
@@ -94,9 +94,17 @@ cd          print '(3i4,f12.4)',ind,ii,jj,curr_dist
       write (iout,'(/A,F8.1,A,F8.1)')
      & 'Max. distance in the family:',amax_dim,
      & '; average distance in the family:',ave_dim 
-      if (refstr .or. pdbref) write (iout,'(a,i5,f8.3)') 
+      if (refstr .or. pdbref) then 
+        write (iout,'(a,i5,2f8.3)')
      & "RMSD of the lowest-energy conformation #",nconf(igr,1),
-     &  rmsnat(nconf(igr,1))
+     &  rmsnat(nconf(igr,1)),rmstab(nconf(igr,1))
+        rmsave=0.0d0
+        do i=1,licz(igr)
+          rmsave=rmsave+rmsnat(nconf(igr,i))
+        enddo
+        rmsave=rmsave/licz(igr)
+        write (iout,'(a,f8.3)') "Average RMSD in the family",rmsave
+      endif
    19 CONTINUE
       WRITE (iout,400)
       WRITE (iout,500) (I,IASS(I),I=1,NCON)
@@ -237,6 +245,16 @@ c Write conformations of the family i to PDB files
           else
 c Produce only a single PDB file for the leading member of the family
             write (iout,*) 'Writing pdb file: icon=',icon
+            if (from_cart .or. from_cx) then
+            
+            do ii=1,2*nres
+              do j=1,3
+              c(j,ii)=allcart(j,ii,icon)
+              enddo
+            enddo
+
+            else
+
             do ii=1,nres
               phi(ii)=phiall(ii,icon)
               theta(ii)=thetall(ii,icon)
@@ -244,6 +262,9 @@ c Produce only a single PDB file for the leading member of the family
               omeg(ii)=omall(ii,icon)
             enddo
             call chainbuild
+
+            endif
+
             cfname=prefixp(:ilen(prefixp))//numm(:ilen(numm))//exten
             OPEN(ipdb,FILE=CFNAME,STATUS='UNKNOWN',FORM='FORMATTED')
 c           print *,'Calling pdbout'