c
c
c     ###################################################
c     ##  COPYRIGHT (C)  1989  by  Jay William Ponder  ##
c     ###################################################
c
c     ############################################################
c     ##                                                        ##
c     ##  subroutine second  --  DDM-based secondary structure  ##
c     ##                                                        ##
c     ############################################################
c
c
c     "second" computes the secondary structural motifs of a
c     protein from alpha carbon positions using the difference
c     distance matrix method of Fred Richards and Craig Kundrot
c
c     literature reference :
c
c     F. M. Richards and C. E. Kundrot, "Identification of Structural
c     Motifs From Protein Coordinate Data: Secondary Structure and
c     First-Level Supersecondary Structure", PROTEINS: Structure,
c     Function, and Genetics, 3, 71-84 (1988)
c
c
      subroutine second (nres,cai,fold)
      implicit none
      include 'sizes.i'
      include 'atoms.i'
      integer maxdist
      parameter (maxdist=1200)
      integer i,k,ifirst(maxdist),ilast(maxdist)
      integer nres,cai(maxres)
      real*8 ha3(50,50),a310(3,50)
      real*8 hlxwt(30),strwt(30)
      real*8 alpha(50),beta(20),turn(3,5)
      real*8 chkha,chkh3,chktrn,chkstr
      real*8 axrpt,hlxrad,dhblen
      real*8 rr,rrr,theta,arclen,chrdlen
      real*8 dist(maxdist,maxdist)
      character*1 cis,break,helix,h310
      character*1 trn,strand,coil,foldtype
      character*1 symbol(maxdist)
      character*1 dist2(maxdist,maxdist)
      character*3 fold(maxres)
c
c     linear mask for a 50 residue ideal alpha helix
c
      data alpha /   0.00,  3.75,  5.36,  5.02,  6.11,
     &               8.53,  9.75, 10.43, 12.18, 14.09,
     &              15.15, 16.32, 18.19, 19.77, 20.85,
     &              22.33, 24.13, 25.49, 26.70, 28.36,
     &              30.01, 31.27, 32.65, 34.35, 35.84,
     &              37.11, 38.64, 40.30, 41.67, 43.06,
     &              44.64, 46.20, 47.52, 48.97, 50.61,
     &              52.07, 53.41, 54.95, 56.55, 57.93,
     &              59.33, 60.93, 62.45, 63.81, 65.29,
     &              66.89, 68.33, 69.72, 71.27, 72.82/
c
c     linear mask for a 20 residue ideal parallel beta strand
c
      data beta /    0.00,  3.75,  6.47,  9.89 ,12.94,
     &              16.28, 19.40, 22.72, 25.87, 29.17,
     &              32.34, 35.62, 38.81, 42.09, 45.28,
     &              48.55, 51.74, 55.01, 58.21, 61.48/
c
c     triangular mask (3x5) for a sharp beta turn
c
      data turn /    0.00,  0.00,  0.00,
     &               3.70,  0.00,  0.00,
     &               5.60,  3.70,  0.00,
     &               5.00,  5.10,  3.70,
     &               5.40,  6.90,  6.10/
c
c     Cartesian coordinates for 30 residues of alpha helix
c     followed by a further 20 residues of 3/10 helix
c
      data a310 /
     &  -0.042,-1.388, 1.834, 1.472,-1.616,-1.673, 3.013, 1.872,-1.334,
     &   4.464, 1.004, 2.097, 5.939,-2.228, 0.679, 7.427,-0.325,-2.287,
     &   8.917, 2.295, 0.069,10.402,-0.459, 2.268,11.884,-2.174,-0.812,
     &  13.360, 1.146,-2.011,14.844, 1.792, 1.456,16.334,-1.730, 1.525,
     &  17.815,-1.221,-1.965,19.289, 2.143,-0.899,20.777, 0.548, 2.244,
     &  22.266,-2.289, 0.155,23.743, 0.238,-2.309,25.222, 2.260, 0.581,
     &  26.712,-0.916, 2.104,28.197,-1.898,-1.281,29.673, 1.605,-1.704,
     &  31.158, 1.456, 1.818,32.647,-1.992, 1.096,34.126,-0.717,-2.193,
     &  35.607, 2.325,-0.409,37.096, 0.079, 2.304,38.572,-2.247,-0.349,
     &  40.053, 0.737,-2.226,41.558, 2.124, 1.009,43.051,-1.299, 1.839,
     &  44.986,-0.755,-1.696,46.921, 1.843, 0.220,48.857,-1.132, 1.471,
     &  50.792,-0.684,-1.726,52.728, 1.833, 0.295,54.663,-1.192, 1.424,
     &  56.598,-0.613,-1.752,58.534, 1.819, 0.370,60.469,-1.249, 1.373,
     &  62.404,-0.541,-1.776,64.340, 1.803, 0.444,66.275,-1.304, 1.321,
     &  68.210,-0.467,-1.797,70.146, 1.783, 0.518,72.081,-1.357, 1.266,
     &  74.017,-0.393,-1.814,75.952, 1.760, 0.591,77.887,-1.408, 1.210,
     &  79.823,-0.318,-1.829,81.758, 1.734, 0.662/
c
c
c     symbols for different types of secondary structure
c
      cis = 'P'
      break = 'X'
      helix = 'H'
      h310 = '3'
      trn = 'T'
      strand = 'S'
      coil = 'C'
c
c     set the distance match limits for each structural type
c     in the original Richards and Kundrot program all four
c     of these values are set to 1.0
c
      chkha = 0.75d0
      chkh3 = 0.75d0
      chktrn = 1.0d0
      chkstr = 0.75d0
c
c     set parameters used in fitting helix/strand curvature
c
      axrpt = 5.4d0
      hlxrad = 2.3d0
      dhblen = 0.1d0
c
c     load array HA3 (distance mask) from CA data in A3/10
c     CA atoms 1-30 are alpha carbon atoms, atoms 31-50
c     are in the 3/10 conformation
c
      do i = 1, 50
         do k = i, 50
            ha3(i,k) = sqrt((a310(1,k)-a310(1,i))**2 +
     &                      (a310(2,k)-a310(2,i))**2 +
     &                      (a310(3,k)-a310(3,i))**2)
         end do
      end do
c
c     load HLXWT and STRWT; weighting factors
c     for rms check in AHELIX and STRAND
c
      rr = hlxrad * axrpt / dhblen
      theta = axrpt / rr
      do i = 1, 30
         arclen = i * axrpt
         chrdlen = 2.0d0 * rr * sin(theta*i/2.0d0)
         hlxwt(i) = arclen - chrdlen
      end do
      rrr = hlxrad * axrpt / (2.0d0*dhblen)
      theta = axrpt / rrr
      do i = 1, 30
         arclen = i * axrpt
         chrdlen = 2.0d0 * rrr * sin(theta*i/2.0d0)
         strwt(i) = arclen - chrdlen
      end do
c
c     load upper half of distance matrix
c
      do i = 1, nres
         do k = i, nres
            dist(i,k) = sqrt((x(cai(i))-x(cai(k)))**2 +
     &                       (y(cai(i))-y(cai(k)))**2 +
     &                       (z(cai(i))-z(cai(k)))**2)
         end do
      end do
c
c     initialize 'dist2' array with blanks,
c     except for '-' symbol on diagonal
c
      do i = 1, nres
         do k = 1, nres
            dist2(i,k) = ' '
            if (k .eq. i)  dist2(i,k) = '-'
         end do
      end do
c
c     look for cis peptide bonds and check that all trans
c     bonds are within reasonable distance limits
c
      call cispep (dist,dist2,nres,cis,break)
c
c     check helix mask (ALPHA) against each line; enter symbol,
c     HELIX, in each consecutive position where the difference
c     between DIST and the mask ALPHA is less than CHKHLX
c
      call ahelix (dist,dist2,nres,alpha,ha3,helix,
     &             h310,chkha,chkh3,hlxwt)
c
c     check in non-helical segments for tight beta turns using the
c     mask array TURN; the rms match must be less than or equal to
c     CHKTRN
c
      call sharptrn (dist,dist2,nres,turn,trn,helix,h310,chktrn)
c
c     check for extended chains with the mask BETA; this mask has
c     distances that are equivalent to those found in parallel sheets,
c     ie, somewhat shorter than a fully extended chain; the symbol,
c     STRAND, is entered in each consecutive position where the
c     difference between DIST and the mask BETA is less than CHKSTR
c
c
      call bstrand (dist,dist2,nres,beta,helix,h310,
     &              trn,strand,chkstr,strwt)
c
c     set the beginning and ending alpha carbon numbers and length
c     for each type of secondary structure; helix, turn, and strand
c
      call assign (dist,dist2,nres,ifirst,ilast,symbol,
     &              helix,h310,trn,strand,coil)
c
c     set the 'fold' list based on secondary structure segments
c
      do i = 1, nres
         fold(i) = '   '
      end do
      i = 1
      dowhile (ifirst(i) .ne. 0)
         foldtype = symbol(i)
         do k = ifirst(i), ilast(i)
            if (fold(k) .eq. '   ') then
               fold(k)(2:2) = foldtype
            else
               if (k .eq. ifirst(i)) then
                  fold(k)(1:1) = fold(k)(2:2)
                  fold(k)(2:2) = '/'
                  fold(k)(3:3) = foldtype
               else
                  fold(k)(3:3) = fold(k)(2:2)
                  fold(k)(2:2) = '/'
                  fold(k)(1:1) = foldtype
               end if
            end if
         end do
         i = i + 1
      end do
c
c     add cis peptides and chain breaks to secondary structure
c
      do i = 1, nres
         if (dist2(i,i) .eq. cis) then
            if (fold(i)(2:2) .eq. '/') then
               fold(i)(2:2) = cis
            else
               fold(i)(1:1) = fold(i)(2:2)
               fold(i)(2:2) = '/'
               fold(i)(3:3) = cis
            end if
         end if
         if (dist2(i,i) .eq. break) then
            if (fold(i)(2:2) .eq. '/') then
               fold(i)(2:2) = break
            else if (i.gt.1 .and. fold(i-1)(3:3).eq.break) then
               fold(i)(3:3) = fold(i)(2:2)
               fold(i)(2:2) = '/'
               fold(i)(1:1) = break
            else
               fold(i)(1:1) = fold(i)(2:2)
               fold(i)(2:2) = '/'
               fold(i)(3:3) = break
            end if
         end if
      end do
      return
      end
c
c
c     ###################################################
c     ##  COPYRIGHT (C)  1989  by  Jay William Ponder  ##
c     ###################################################
c
c     ##########################################################
c     ##                                                      ##
c     ##  subroutine cispep  --  check for cis-peptide units  ##
c     ##                                                      ##
c     ##########################################################
c
c
c     "cispep" locates cis-peptide units by comparing
c     actual alpha carbon distances to idealized values,
c     also identifies unusual distances and chain breaks
c
c
      subroutine cispep (dist,dist2,nres,cis,break)
      implicit none
      include 'sizes.i'
      include 'iounit.i'
      integer maxdist
      parameter (maxdist=1200)
      integer i,nres
      real*8 dist(maxdist,maxdist)
      character*1 cis,break
      character*1 dist2(maxdist,maxdist)
c
c
c     check for cis peptide bonds based on alpha carbon distance
c
      do i = 1, nres-1
         if (dist(i,i+1).ge.2.7d0 .and. dist(i,i+1).le.3.1d0) then
            if (dist2(i,i) .eq. ' ')  dist2(i,i) = cis
c
c     potential chain break if distance is really extreme
c
         else if (dist(i,i+1).lt.2.2d0 .or. dist(i,i+1).gt.4.5d0) then
            dist2(i,i) = break
            dist2(i+1,i+1) = break
            write (iout,10)  i,i+1,dist(i,i+1)
   10       format (/,' Chain Break between CA atoms',i5,
     &                 ' and',i5,', Distance is',f8.2,' Angs')
c
c     unusual distances between adjacent alpha carbons
c
         else if (dist(i,i+1).lt.3.6d0 .or. dist(i,i+1).gt.4.0d0) then
            write (iout,20)  i,i+1,dist(i,i+1)
   20       format (/,' Distance between CA atoms',i5,
     &                 ' and',i5,' is',f8.2,' Angs')
         end if
      end do
      return
      end
c
c
c     ###################################################
c     ##  COPYRIGHT (C)  1989  by  Jay William Ponder  ##
c     ###################################################
c
c     ###########################################################
c     ##                                                       ##
c     ##  subroutine ahelix  --  locate alpha helix structure  ##
c     ##                                                       ##
c     ###########################################################
c
c
c     "ahelix" finds pieces of alpha helical secondary structure
c     by comparison to idealized helical alpha carbon distances
c
c
      subroutine ahelix (dist,dist2,nres,alpha,ha3,
     &                   helix,h310,chkha,chkh3,hlxwt)
      implicit none
      include 'sizes.i'
      integer maxdist
      parameter (maxdist=1200)
      integer i,j,k,nres,je,jn,jje,jjs,ks,lh,nddk
      real*8 alpha(50),ha3(50,50),hlxwt(50)
      real*8 chkha,chkh3,chksqa,chksq3,dk,ddk
      real*8 dist(maxdist,maxdist)
      character*1 helix,h310
      character*1 dist2(maxdist,maxdist)
c
c
c     check over the full sequence for alpha helix regions
c
      chksqa = chkha**2
      chksq3 = chkh3**2
      i = 1
   10 continue
      if (i .ge. nres)  return
      je = i + 49
      if (je .gt. nres)  je = nres
      lh = 0
      do j = i+1, je
         lh = lh + 1
         ddk = 0
         nddk = 0
         do k = i, j-1
            jn = j - k + 1
c
c     omit diagonal and first off-diagonal positions from sum
c
            if (jn.gt.2 .and. k.lt.j-1) then
               dk = (dist(k,j)-alpha(jn))**2
c
c     weight matrix elements for curvature according
c     to the length of the helix
c
               dk = dk * ((1/(1+hlxwt(j-k)))**2)
               ddk = ddk + dk
               nddk = nddk + 1
            end if
            dist2(k,j) = helix
         end do
         if (nddk .eq. 0)  goto 20
c
c     check for rms match in each successive J line
c
         if (ddk/nddk .gt. chksqa) then
            do k = i, j-1
               dist2(k,j) = ' '
            end do
            lh = lh - 1
            goto 30
         end if
   20    continue
      end do
c
c     alpha helix terminated; check to see if there
c     is a 3/10 helix at the C-terminus
c
   30 continue
      jjs = j
      jje = jjs + 19
c
c     maximum length of alpha helix = JJS-I
c
      do j = jjs, jje
         ddk = 0
         nddk = 0
         do k = i, j-2
            ddk = ddk + (dist(k,j)-ha3(31+k-jjs,31+j-jjs))**2
            nddk = nddk + 1
            dist2(k,j) = h310
         end do
         if (ddk/nddk .gt. chksq3) then
            do k = i, j-2
               dist2(k,j) = ' '
            end do
            goto 40
         end if
      end do
   40 continue
      jje = j - 1
      if (jje .lt. jjs)  goto 50
c
c     fill in bottom of triangle with H-3/10 if any 3/10 helix
c     was added to the end of the alpha helix
c
      ks = i + lh
      do j = jjs, jje
         lh = lh + 1
         do k = ks, j-1
            dist2(k,j) = h310
         end do
      end do
   50 continue
c
c     save all helices longer than 4 residues
c
      if (lh .gt. 4) then
         i = i + lh
         goto 10
c
c     erase helical bits that are too short
c
      else
         do j = i+1, i+lh
            do k = i, j-1
               dist2(k,j) = ' '
            end do
         end do
         i = i + 1
         goto 10
      end if
      end
c
c
c     ###################################################
c     ##  COPYRIGHT (C)  1989  by  Jay William Ponder  ##
c     ###################################################
c
c     ###########################################################
c     ##                                                       ##
c     ##  subroutine sharptrn  --  locate beta turn structure  ##
c     ##                                                       ##
c     ###########################################################
c
c
c     "sharptrn" finds pieces of beta turn secondary structure
c     by comparison to idealized alpha carbon distance submatrix
c
c
      subroutine sharptrn (dist,dist2,nres,turn,trn,
     &                     helix,h310,chktrn)
      implicit none
      include 'sizes.i'
      integer maxdist
      parameter (maxdist=1200)
      integer i,k,m,n,nres,ichk
      real*8 chktrn,score,dx2,turn(3,5)
      real*8 dist(maxdist,maxdist)
      character*1 trn,helix,h310
      character*1 dist2(maxdist,maxdist)
c
c
c     check over the full sequence for sharp (beta) turns
c
      ichk = 1
   10 continue
      if (ichk .gt. nres-4)  return
c
c     determine fit of turn mask to lines ICHK,+1,+2
c
      score = 0.0d0
      do k = ichk, ichk+2
         do m = k+1, ichk+4
            dx2 = (dist(k,m) - turn(k-ichk+1,m-ichk+1))**2
            score = score + dx2
         end do
      end do
      score = sqrt(score/9.0d0)
      if (score .gt. chktrn) then
         ichk = ichk + 1
         goto 10
      end if
c
c     if match is better than CHKTRN, see if turn should be put in;
c     check whether or not current line has a HELIX symbol
c
      if (dist2(ichk,ichk+1).eq.helix .or.
     &    dist2(ichk,ichk+1).eq.h310) then
         n = 1
c
c    check ahead for length of helix beyond ICHK
c
         do i = ichk+1, nres
            if (dist2(i,i+1).eq.helix .or.
     &          dist2(i,i+1).eq.h310) then
               n = n + 1
            else
               goto 20
            end if
         end do
c
c     start next check beyond helix
c
   20    continue
         ichk = ichk + n
         goto 10
      else if (dist2(ichk,ichk+1).ne.helix .and.
     &         dist2(ichk,ichk+1).ne.h310) then
c
c     check ahead to see if space is clear to insert turn
c     or whether a new potential helix is starting
c
         n = 0
         do i = ichk+1, ichk+3
            if (dist2(i,i+1).eq.helix .or.
     &          dist2(i,i+1).eq.h310)  n = n + 1
         end do
c
c     if N is zero,then it is fine to insert turn
c
         if (n .le. 0) then
            goto 30
         else
c
c     if N greater than zero, then next helix starts just ahead
c
            ichk = ichk + 1
            goto 10
         end if
      end if
   30 continue
      do k = ichk, ichk+2
         do m = k+1, ichk+3
            dist2(k,m) = trn
         end do
      end do
      ichk = ichk + 3
      goto 10
      end
c
c
c     ###################################################
c     ##  COPYRIGHT (C)  1989  by  Jay William Ponder  ##
c     ###################################################
c
c     ############################################################
c     ##                                                        ##
c     ##  subroutine bstrand  --  locate beta strand structure  ##
c     ##                                                        ##
c     ############################################################
c
c
c     "bstrand" finds pieces of beta strand secondary structure
c     by comparison to idealized strand alpha carbon distances
c
c
      subroutine bstrand (dist,dist2,nres,beta,helix,
     &                    h310,trn,strand,chkstr,strwt)
      implicit none
      include 'sizes.i'
      integer maxdist
      parameter (maxdist=1200)
      integer i,j,k,m,nres,je,jn,lh,nddk
      real*8 chkstr,chksq,dk,ddk
      real*8 beta(20),strwt(30)
      real*8 dist(maxdist,maxdist)
      character*1 helix,h310,trn,strand
      character*1 dist2(maxdist,maxdist)
c
c
c     check over the full sequence for beta strands
c
      chksq = chkstr**2
      i = 1
   10 continue
      if (i .ge. nres)  return
c
c     don't check positions already identified as 'HELIX' or 'TRN'
c
      if (dist2(i,i+1).eq.helix .or.
     &    dist2(i,i+1).eq.h310 .or.
     &    dist2(i,i+1).eq.trn) then
         i = i + 1
         goto 10
      end if
      je = i + 49
      if (je .gt. nres)  je = nres
      lh = 0
      do j = i+1, je
         lh = lh + 1
         ddk = 0
         nddk = 0
         do k = i, j-1
c
c     if the strand runs into a helix or turn, these get preference
c
            if (dist2(k,j).eq.helix .or.
     &          dist2(k,j).eq.h310 .or.
     &          dist2(k,j).eq.trn)  goto 30
            jn = j - k + 1
c
c     omit diagonal and first off-diagonal positions from sum
c
            if (jn.gt.2 .and. k.lt.j-1) then
               dk = (dist(k,j)-beta(jn))**2
               dk = dk * ((1/(1+strwt(j-k)))**2)
               ddk = ddk + dk
               nddk = nddk + 1
            end if
            dist2(k,j) = strand
         end do
         if (nddk .eq. 0)  goto 20
c
c     check for rms match in each successive J line
c
         if(ddk/nddk .gt. chksq) then
            do k = i, j-1
               dist2(k,j) = ' '
            end do
            lh = lh - 1
            goto 40
         end if
   20    continue
      end do
      goto 40
   30 continue
      do m = i, k-1
         dist2(m,j) = ' '
      end do
      lh = lh - 1
   40 continue
      if (lh .gt. 2) then
         i = i + lh
         goto 10
      else
         if (j .ge. nres) then
            i = i + 1
            goto 10
         end if
         do j = i+1, i+lh
            do k = i, j-1
               dist2(k,j) = ' '
            end do
         end do
         i = i + 1
         goto 10
      end if
      end
c
c
c     ###################################################
c     ##  COPYRIGHT (C)  1989  by  Jay William Ponder  ##
c     ###################################################
c
c     ################################################################
c     ##                                                            ##
c     ##  subroutine assign  --  find secondary structure segments  ##
c     ##                                                            ##
c     ################################################################
c
c
c     "assign" organizes the secondary structure by sequence segments
c
c
      subroutine assign (dist,dist2,nres,ifirst,ilast,
     &                   symbol,helix,h310,trn,strand,coil)
      implicit none
      include 'sizes.i'
      include 'iounit.i'
      integer maxdist
      parameter (maxdist=1200)
      integer i,j,n,nres,ii,iend,iend1,j1cnt,j2cnt
      integer ifirst(maxdist),ilast(maxdist),length(maxdist)
      real*8 dist(maxdist,maxdist)
      character*1 helix,h310,trn,strand,coil
      character*1 symbol(maxdist),alast,test
      character*1 dist2(maxdist,maxdist)
c
c
c     clear out the list of secondary structure assignments
c
      i = 1
      n = 1
      j1cnt = 0
      j2cnt = 0
      do j = 1, maxdist
         ifirst(j) = 0
         ilast(j) = 0
         symbol(j) = ' '
      end do
   10 continue
      if (i.eq.1 .and. j1cnt.eq.0 .and. j2cnt.eq.0)  goto 20
c
c     terminate segment at IEND
c
      ilast(n) = iend
      symbol(n) = test
      if (symbol(n) .eq. h310)  ifirst(n) = ifirst(n) + 1
      length(n) = ilast(n) - ifirst(n) + 1
      n = n + 1
      i = iend
      if (i .gt. nres-1)  goto 70
c
c     start search for next segment
c
   20 continue
      if (dist2(i,i+1).eq.' ' .and. i.ne.1)  i = i + 1
      ifirst(n) = i
      test = dist2(i,i+1)
      j1cnt = 0
      j2cnt = 0
      if (test .eq. ' ')  goto 60
      do j = i+1, nres
         if (dist2(i,j) .eq. test)  j1cnt = j1cnt + 1
         if (dist2(i,j) .eq. ' ')  goto 30
      end do
   30 continue
      iend = i + j1cnt
      iend1 = iend - 1
   40 continue
      do j = iend, nres
         if (dist2(iend1,j) .eq. test)  j2cnt = j2cnt + 1
         if (dist2(iend1,j) .eq. ' ')  goto 50
      end do
   50 continue
      if (j2cnt .le. 1)  goto 10
      if (j2cnt .gt. 1) then
         iend = iend1 + j2cnt
         iend1 = iend - 1
         j2cnt = 0
         goto 40
      end if
c
c     special case of TEST = ' '
c
   60 continue
      do ii = i, nres
         if (dist2(ii,ii+1) .eq. ' ') then
            j1cnt = j1cnt + 1
         else
            ilast(n) = ifirst(n) + j1cnt - 1
            symbol(n) = coil
            length(n) = j1cnt
            n = n + 1
            i = i + j1cnt
            if (i .gt. nres-1)  goto 70
            goto 20
         end if
      end do
      ilast(n) = nres
      length(n) = ilast(n) - ifirst(n) + 1
      symbol(n) = test
      if (symbol(n) .eq. ' ')  symbol(n) = coil
c
c     debug output in Fred Richards' original format
c
   70 continue
c     write (iout,80)
c  80 format (/'   Sequence  Sequence Segment Secondary'/
c    &         '      Start       End  Length Structure'/)
c     do j = 1, maxdist
c        if (ifirst(j) .eq. 0)  goto 130
c        if(symbol(j).eq.helix .or. symbol(j).eq.h310) then
c           write (iout,90)  ifirst(j),ilast(j),length(j),symbol(j)
c  90       format (1x,2i10,i8,2x,a1)
c        else if (symbol(j) .eq. strand) then
c           write (iout,100)  ifirst(j),ilast(j),length(j),symbol(j)
c 100       format (1x,2i10,i8,4x,a1)
c        else if (symbol(j) .eq. trn) then
c           write (iout,110)  ifirst(j),ilast(j),length(j),symbol(j)
c 110       format (1x,2i10,i8,6x,a1)
c        else
c           write (iout,120)  ifirst(j),ilast(j),length(j),symbol(j)
c 120       format (1x,2i10,i8,8x,a1)
c        end if
c     end do
   80 continue
      return
      end
