      Subroutine hlxres(summ, hlxch, altch, turnch, alturn, hlxsz,      HLXR001
     &                  seqlen)                                         HLXR002
c                                                                       HLXR003
c     to remove helix character runs of less than minimal helix size    HLXR004
c                                                                       HLXR005
      include 'sstruc.par'                                              HLXR006
      character*1 summ(maxres), hlxch, turnch, altch, alturn            HLXR007
      integer     hlxsz, seqlen                                         HLXR008
                                                                        HLXR009
      integer     nxres, stpos, nxsym                                   HLXR010
                                                                        HLXR011
      stpos = 0                                                         HLXR012
      do 1000, nxres = 1, seqlen                                        HLXR013
      if (summ(nxres) .eq. hlxch .or. summ(nxres) .eq. altch) then      HLXR014
         If (stpos .eq. 0) stpos = nxres                                HLXR015
      else                                                              HLXR016
         if (stpos .ne. 0) then                                         HLXR017
            if (nxres - stpos .lt. hlxsz) then                          HLXR018
               do 500, nxsym = stpos, nxres - 1                         HLXR019
               if (summ(nxsym) .eq. hlxch) then                         HLXR020
                  summ(nxsym) = turnch                                  HLXR021
               else                                                     HLXR022
                  summ(nxsym) = alturn                                  HLXR023
               end if                                                   HLXR024
  500          continue                                                 HLXR025
            end if                                                      HLXR026
            stpos = 0                                                   HLXR027
         end if                                                         HLXR028
      end if                                                            HLXR029
 1000 continue                                                          HLXR030
      if (stpos .ne. 0) then                                            HLXR031
         if (seqlen - stpos + 1 .lt. hlxsz) then                        HLXR032
            do 1500, nxsym = stpos, seqlen                              HLXR033
            if (summ(nxres) .eq. hlxch) then                            HLXR034
               summ(nxsym) = turnch                                     HLXR035
            else                                                        HLXR036
               summ(nxsym) = alturn                                     HLXR037
            end if                                                      HLXR038
 1500       continue                                                    HLXR039
         end if                                                         HLXR040
      end if                                                            HLXR041
      END                                                               HLXR042
