1 subroutine define_fragments(iprot)
4 include 'DIMENSIONS.ZSCOPT'
5 include 'DIMENSIONS.COMPAR'
6 include 'COMMON.IOUNITS'
9 include 'COMMON.SBRIDGE'
10 include 'COMMON.CONTROL'
11 include 'COMMON.COMPAR'
12 include 'COMMON.CHAIN'
13 include 'COMMON.HEADER'
15 include 'COMMON.CONTACTS1'
16 include 'COMMON.PEPTCONT'
17 include 'COMMON.INTERACT'
18 include 'COMMON.NAMES'
19 include 'COMMON.CLASSES'
21 integer i,j,ii,i1,i2,i3,i4,it1,it2,it3,it4
22 integer nstrand,istrand(2,maxres/2)
23 integer nhairp,ihairp(2,maxres/5)
24 character*16 strstr(4) /'helix','hairpin','strand','strand pair'/
26 write (iout,*) "Entered DEFINE_FRAGMENTS iprot",iprot
28 do ibatch=1,nclass(iprot)-1
30 write (iout,*) 'NC_FRAC_HEL',ncfrac_hel(ibatch),
31 & ' NC_REQ_HEL',ncreq_hel(ibatch),
32 & ' NC_FRAC_BET',ncfrac_bet(ibatch),
33 & ' NC_REQ_BET',ncreq_bet(ibatch),
34 & ' NC_FRAC_PAIR',ncfrac_pair(ibatch),
35 & ' NC_REQ_PAIR',ncreq_pair(ibatch),
36 & ' RMS_PAIR',irms_pair(ibatch),' SPLIT_BET',isplit_bet
37 write (iout,*) 'NSHIFT_HEL',nshift_hel(ibatch),
38 & ' NSHIFT_BET',nshift_bet(ibatch),
39 & ' NSHIFT_STRAND',nshift_strand(ibatch),
40 & ' NSHIFT_PAIR',nshift_pair(ibatch)
41 write (iout,*) 'ANGCUT_HEL',angcut_hel(ibatch)*rad2deg,
42 & ' MAXANG_HEL',angcut1_hel(ibatch)*rad2deg
43 write (iout,*) 'ANGCUT_BET',angcut_bet(ibatch)*rad2deg,
44 & ' MAXANG_BET',angcut1_bet(ibatch)*rad2deg
45 write (iout,*) 'ANGCUT_STRAND',angcut_strand(ibatch)*rad2deg,
46 & ' MAXANG_STRAND',angcut1_strand(ibatch)*rad2deg
47 write (iout,*) 'FRAC_MIN',frac_min_set(ibatch)
49 c Find secondary structure elements (helices and beta-sheets)
51 write (iout,*) "Calling SECONDARY2 iprot",iprot
54 call secondary2(.true.,print_secondary,ncont_pept_ref(iprot),
55 & icont_pept_ref(1,1,iprot),isec_ref(1,iprot),iprot)
56 c Define primary fragments. First include the helices.
60 c AL 12/23/03 - to avoid splitting helices into very small fragments
61 if (merge_helices) then
62 if (print_secondary) then
63 write (iout,*) "Before merging helices: nhfrag",nhfrag
65 write (2,*) hfrag(1,i),hfrag(2,i)
69 do while (i.lt.nhfrag)
70 if (hfrag(1,i+1)-hfrag(2,i).le.1) then
72 hfrag(2,i)=hfrag(2,i+1)
74 hfrag(1,j)=hfrag(1,j+1)
75 hfrag(2,j)=hfrag(2,j+1)
80 if (print_secondary) then
81 write (iout,*) "After merging helices: nhfrag",nhfrag
83 write (2,*) hfrag(1,i),hfrag(2,i)
88 do ibatch=1,nclass(iprot)-1
90 npiece(i,1,ibatch,iprot)=1
91 ifrag(1,1,i,ibatch,iprot)=hfrag(1,i)
92 ifrag(2,1,i,ibatch,iprot)=hfrag(2,i)
93 n_shift(1,i,1,ibatch,iprot)=0
94 n_shift(2,i,1,ibatch,iprot)=nshift_hel(ibatch)
95 ang_cut(i,ibatch,iprot)=angcut_hel(ibatch)
96 ang_cut1(i,ibatch,iprot)=angcut1_hel(ibatch)
97 frac_min(i,ibatch,iprot)=frac_min_set(ibatch)
98 nc_fragm(i,1,ibatch,iprot)=ncfrac_hel(ibatch)
99 nc_req_setf(i,1,ibatch,iprot)=ncreq_hel(ibatch)
100 istruct(i,ibatch,iprot)=1
104 write (iout,*) "isplit_bet",isplit_bet
106 if (isplit_bet.gt.1) then
107 c Split beta-sheets into strands and store strands as primary fragments.
108 call split_beta(nbfrag,bfrag,nstrand,istrand,nhairp,ihairp)
109 do ibatch=1,nclass(iprot)-1
112 npiece(ii,1,ibatch,iprot)=1
113 ifrag(1,1,ii,ibatch,iprot)=istrand(1,i)
114 ifrag(2,1,ii,ibatch,iprot)=istrand(2,i)
115 n_shift(1,ii,1,ibatch,iprot)=nshift_strand(ibatch)
116 n_shift(2,ii,1,ibatch,iprot)=nshift_strand(ibatch)
117 ang_cut(ii,ibatch,iprot)=angcut_strand(ibatch)
118 ang_cut1(ii,ibatch,iprot)=angcut1_strand(ibatch)
119 frac_min(ii,ibatch,iprot)=frac_min_set(ibatch)
120 nc_fragm(ii,1,ibatch,iprot)=0
121 nc_req_setf(ii,1,ibatch,iprot)=0
122 istruct(ii,ibatch,iprot)=3
125 nfrag(1,iprot)=nfrag(1,iprot)+nstrand
126 else if (isplit_bet.eq.1) then
127 c Split only far beta-sheets; does not split hairpins.
128 call find_and_remove_hairpins(nbfrag,bfrag,nhairp,ihairp)
129 call split_beta(nbfrag,bfrag,nstrand,istrand,nhairp,ihairp)
130 do ibatch=1,nclass(iprot)-1
133 npiece(ii,1,ibatch,iprot)=1
134 ifrag(1,1,ii,ibatch,iprot)=ihairp(1,i)
135 ifrag(2,1,ii,ibatch,iprot)=ihairp(2,i)
136 n_shift(1,ii,1,ibatch,iprot)=nshift_bet(ibatch)
137 n_shift(2,ii,1,ibatch,iprot)=nshift_bet(ibatch)
138 ang_cut(ii,ibatch,iprot)=angcut_bet(ibatch)
139 ang_cut1(ii,ibatch,iprot)=angcut1_bet(ibatch)
140 frac_min(ii,ibatch,iprot)=frac_min_set(ibatch)
141 nc_fragm(ii,1,ibatch,iprot)=ncfrac_bet(ibatch)
142 nc_req_setf(ii,1,ibatch,iprot)=ncreq_bet(ibatch)
143 istruct(ii,ibatch,iprot)=2
146 nfrag(1,iprot)=nfrag(1,iprot)+nhairp
147 do ibatch=1,nclass(iprot)-1
150 npiece(ii,1,ibatch,iprot)=1
151 ifrag(1,1,ii,ibatch,iprot)=istrand(1,i)
152 ifrag(2,1,ii,ibatch,iprot)=istrand(2,i)
153 n_shift(1,ii,1,ibatch,iprot)=nshift_strand(ibatch)
154 n_shift(2,ii,1,ibatch,iprot)=nshift_strand(ibatch)
155 ang_cut(ii,ibatch,iprot)=angcut_strand(ibatch)
156 ang_cut1(ii,ibatch,iprot)=angcut1_strand(ibatch)
157 frac_min(ii,ibatch,iprot)=frac_min_set(ibatch)
158 nc_fragm(ii,1,ibatch,iprot)=0
159 nc_req_setf(ii,1,ibatch,iprot)=0
160 istruct(ii,ibatch,iprot)=3
163 nfrag(1,iprot)=nfrag(1,iprot)+nstrand
165 c Do not split beta-sheets; each pair of strands is a primary element.
166 call find_and_remove_hairpins(nbfrag,bfrag,nhairp,ihairp)
167 do ibatch=1,nclass(iprot)-1
170 npiece(ii,1,ibatch,iprot)=1
171 ifrag(1,1,ii,ibatch,iprot)=ihairp(1,i)
172 ifrag(2,1,ii,ibatch,iprot)=ihairp(2,i)
173 n_shift(1,ii,1,ibatch,iprot)=nshift_bet(ibatch)
174 n_shift(2,ii,1,ibatch,iprot)=nshift_bet(ibatch)
175 ang_cut(ii,ibatch,iprot)=angcut_bet(ibatch)
176 ang_cut1(ii,ibatch,iprot)=angcut1_bet(ibatch)
177 frac_min(ii,ibatch,iprot)=frac_min_set(ibatch)
178 nc_fragm(ii,1,ibatch,iprot)=ncfrac_bet(ibatch)
179 nc_req_setf(ii,1,ibatch,iprot)=ncreq_bet(ibatch)
180 istruct(ii,ibatch,iprot)=2
183 nfrag(1,iprot)=nfrag(1,iprot)+nhairp
184 do ibatch=1,nclass(iprot)-1
187 npiece(ii,1,ibatch,iprot)=2
188 ifrag(1,1,ii,ibatch,iprot)=bfrag(1,i)
189 ifrag(2,1,ii,ibatch,iprot)=bfrag(2,i)
190 if (bfrag(3,i).lt.bfrag(4,i)) then
191 ifrag(1,2,ii,ibatch,iprot)=bfrag(3,i)
192 ifrag(2,2,ii,ibatch,iprot)=bfrag(4,i)
194 ifrag(1,2,ii,ibatch,iprot)=bfrag(4,i)
195 ifrag(2,2,ii,ibatch,iprot)=bfrag(3,i)
197 n_shift(1,ii,1,ibatch,iprot)=nshift_bet(ibatch)
198 n_shift(2,ii,1,ibatch,iprot)=nshift_bet(ibatch)
199 ang_cut(ii,ibatch,iprot)=angcut_bet(ibatch)
200 ang_cut1(ii,ibatch,iprot)=angcut1_bet(ibatch)
201 frac_min(ii,ibatch,iprot)=frac_min_set(ibatch)
202 nc_fragm(ii,1,ibatch,iprot)=ncfrac_bet(ibatch)
203 nc_req_setf(ii,1,ibatch,iprot)=ncreq_bet(ibatch)
204 istruct(ii,ibatch,iprot)=4
207 nfrag(1,iprot)=nfrag(1,iprot)+nbfrag
209 write (iout,*) "The following primary fragments were found:"
211 write (iout,*) "Helices:",nhfrag
214 i1=ifrag(1,1,i,1,iprot)
215 i2=ifrag(2,1,i,1,iprot)
219 write (iout,'(i3,2x,a,i4,2x,a,i4)')
220 & i,restyp(it1),i1,restyp(it2),i2
224 write (iout,*) "Hairpins:",nhairp
226 do i=nhfrag+1,nhfrag+nhairp
227 i1=ifrag(1,1,i,1,iprot)
228 i2=ifrag(2,1,i,1,iprot)
232 write (iout,'(i3,2x,a,i4,2x,a,i4,2x)')
233 & i,restyp(it1),i1,restyp(it2),i2
237 write (iout,*) "Far strand pairs:",nbfrag
239 do i=nhfrag+nhairp+1,nhfrag+nhairp+nbfrag
240 i1=ifrag(1,1,i,1,iprot)
241 i2=ifrag(2,1,i,1,iprot)
244 i3=ifrag(1,2,i,1,iprot)
245 i4=ifrag(2,2,i,1,iprot)
249 write (iout,'(i3,2x,a,i4,2x,a,i4," and ",a,i4,2x,a,i4)')
250 & i,restyp(it1),i1,restyp(it2),i2,
251 & restyp(it3),i3,restyp(it4),i4
255 write (iout,*) "Strands:",nstrand
257 do i=nhfrag+nhairp+nbfrag+1,nfrag(1,iprot)
258 i1=ifrag(1,1,i,1,iprot)
259 i2=ifrag(2,1,i,1,iprot)
263 write (iout,'(i3,2x,a,i4,2x,a,i4)')
264 & i,restyp(it1),i1,restyp(it2),i2
268 do ibatch=1,nclass(iprot)-1
269 write (iout,*) "Structural level",ibatch+1
270 write (iout,*) "Fragments before sorting:"
272 write (iout,'(20i4)') i,istruct(i,1,iprot),
273 & npiece(i,1,ibatch,iprot),
274 & (ifrag(1,j,i,1,iprot),ifrag(2,j,i,1,iprot),
275 & j=1,npiece(i,1,ibatch,iprot))
279 do ibatch=1,nclass(iprot)-1
280 call lmysort(nfrag(1,iprot),2,maxpiece,ifrag(1,1,1,ibatch,iprot),
281 & npiece(1,1,ibatch,iprot),istruct(1,ibatch,iprot),
282 & n_shift(1,1,1,ibatch,iprot),ang_cut(1,ibatch,iprot),
283 & ang_cut1(1,ibatch,iprot),frac_min(1,ibatch,iprot),
284 & nc_fragm(1,1,ibatch,iprot),nc_req_setf(1,1,ibatch,iprot))
286 write (iout,*) "Fragments after sorting:"
288 write (iout,'(20i4)') i,istruct(i,1,iprot),
289 & npiece(i,1,ibatch,iprot),
290 & (ifrag(1,j,i,1,iprot),ifrag(2,j,i,1,iprot),
291 & j=1,npiece(i,1,ibatch,iprot))
296 do i=1,nfrag(1,iprot)
297 i1=ifrag(1,1,i,1,iprot)
298 i2=ifrag(2,1,i,1,iprot)
302 write (iout,*) i,ifrag(1,1,i,1,iprot),ifrag(2,1,i,1,iprot),
303 & it1,it2,ifrag(1,2,i,1,iprot),ifrag(2,2,i,1,iprot)
305 write (iout,'(i3,2x,a,i4,2x,a,i4,$)')
306 & i,restyp(it1),i1,restyp(it2),i2
308 if (npiece(i,1,1,iprot).eq.1) then
309 write (iout,'(2x,a)') strstr(istruct(i,1,iprot))
311 i1=ifrag(1,2,i,1,iprot)
312 i2=ifrag(2,2,i,1,iprot)
316 write (iout,*) i,ifrag(1,2,i,1,iprot),ifrag(2,2,i,1,iprot),
320 write (iout,'(2x,a,i4,2x,a,i4,2x,a)')
321 & restyp(it1),i1,restyp(it2),i2,strstr(istruct(i,1,iprot))
326 c------------------------------------------------------------------------------
327 subroutine find_and_remove_hairpins(nbfrag,bfrag,nhairp,ihairp)
330 include 'DIMENSIONS.ZSCOPT'
331 include 'DIMENSIONS.COMPAR'
332 include 'COMMON.IOUNITS'
333 include 'COMMON.COMPAR'
335 integer nbfrag,bfrag(4,maxres/3)
336 integer nhairp,ihairp(2,maxres/5)
338 write (iout,*) "Entered find_and_remove_hairpins"
340 if (print_secondary) then
341 write (iout,*) "Before checking for hairpins: nbfrag",nbfrag
343 write (iout,*) i,(bfrag(k,i),k=1,4)
348 do while (i.le.nbfrag)
350 & write (iout,*) "check hairpin:",i,(bfrag(j,i),j=1,4)
351 if (bfrag(3,i).gt.bfrag(4,i) .and. bfrag(4,i)-bfrag(2,i).lt.5)
354 & write (iout,*) "Found hairpin:",i,bfrag(1,i),bfrag(3,i)
356 ihairp(1,nhairp)=bfrag(1,i)
357 ihairp(2,nhairp)=bfrag(3,i)
361 bfrag(k,j)=bfrag(k,j+1)
368 if (print_secondary) then
369 write (iout,*) "After finding hairpins:"
370 write (iout,*) "nhairp",nhairp
372 write (iout,*) i,ihairp(1,i),ihairp(2,i)
374 write (iout,*) "nbfrag",nbfrag
376 write (iout,*) i,(bfrag(k,i),k=1,4)
381 c------------------------------------------------------------------------------
382 subroutine split_beta(nbfrag,bfrag,nstrand,istrand,nhairp,ihairp)
385 include 'DIMENSIONS.ZSCOPT'
386 include 'DIMENSIONS.COMPAR'
387 include 'COMMON.COMPAR'
388 include 'COMMON.IOUNITS'
390 integer nbfrag,bfrag(4,maxres/3)
391 integer nstrand,istrand(2,maxres/2)
392 integer nhairp,ihairp(2,maxres/5)
395 write (iout,*) "Entered split_beta"
397 if (print_secondary) then
398 write (iout,*) "Before splitting hairpins: nbfrag",nbfrag
400 write (iout,*) i,(bfrag(k,i),k=1,4)
406 & write (iout,*) "calling add_strand:",i,bfrag(1,i),bfrag(2,i)
407 call add_strand(nstrand,istrand,nhairp,ihairp,
408 & bfrag(1,i),bfrag(2,i),found)
409 if (bfrag(3,i).lt.bfrag(4,i)) then
411 & write (iout,*) "calling add_strand:",i,bfrag(3,i),bfrag(4,i)
412 call add_strand(nstrand,istrand,nhairp,ihairp,
413 & bfrag(3,i),bfrag(4,i),found)
416 & write (iout,*) "calling add_strand:",i,bfrag(4,i),bfrag(3,i)
417 call add_strand(nstrand,istrand,nhairp,ihairp,
418 & bfrag(4,i),bfrag(3,i),found)
422 if (print_secondary) then
423 write (iout,*) "Strands found:",nstrand
425 write (iout,*) i,istrand(1,i),istrand(2,i)
430 c------------------------------------------------------------------------------
431 subroutine add_strand(nstrand,istrand,nhairp,ihairp,is1,is2,found)
434 include 'DIMENSIONS.ZSCOPT'
435 include 'DIMENSIONS.COMPAR'
436 include 'COMMON.IOUNITS'
437 include 'COMMON.COMPAR'
438 integer nstrand,istrand(2,maxres/2)
439 integer nhairp,ihairp(2,maxres/5)
440 integer is1,is2,j,idelt
444 idelt=(ihairp(2,j)-ihairp(1,j))/6
445 if (is1.lt.ihairp(2,j)-idelt.and.is2.gt.ihairp(1,j)+idelt) then
447 & write (iout,*) "strand",is1,is2," is part of hairpin",
448 & ihairp(1,j),ihairp(2,j)
453 idelt=(istrand(2,j)-istrand(1,j))/3
454 if (is1.lt.istrand(2,j)-idelt.and.is2.gt.istrand(1,j)+idelt)
456 c The strand already exists in the array; update its ends if necessary.
458 & write (iout,*) "strand",is1,is2," found at position",j,
459 & ":",istrand(1,j),istrand(2,j)
460 istrand(1,j)=min0(istrand(1,j),is1)
461 istrand(2,j)=max0(istrand(2,j),is2)
465 c The strand has not been found; add it to the array.
467 &write (iout,*) "strand",is1,is2," added to the array."
470 istrand(1,nstrand)=is1
471 istrand(2,nstrand)=is2
474 c------------------------------------------------------------------------------
475 subroutine secondary2(lprint,lprint_sec,ncont,icont,isecstr,iprot)
478 include 'DIMENSIONS.ZSCOPT'
479 include 'COMMON.IOUNITS'
480 include 'COMMON.FRAG'
483 include 'COMMON.CHAIN'
484 include 'COMMON.NAMES'
485 include 'COMMON.INTERACT'
486 integer i,j,ij,k,i1,j1,ii1,jj1,iii1,jjj1,ist,ien,nhelix,nbeta,
487 & nstrand,iprot,n310helix
488 integer ncont,icont(2,maxcont),isec(maxres,4),nsec(maxres),
490 logical lprint,lprint_sec,not_done,freeres
491 double precision p1,p2
493 character*1 csec(0:3) /'-','E','H','3'/
495 write (iout,*) "entered SECONDARY2 iprot",iprot," ncont",ncont
496 write (iout,*) "nstart_sup",nstart_sup(iprot),
497 & " nend_sup",nend_sup(iprot)
498 write (iout,*) "The ICONT array"
500 write (iout,*) icont(1,i),icont(2,i)
515 c finding parallel beta
516 cd write (iout,*) '------- looking for parallel beta -----------'
522 if (i1.ge.nstart_sup(iprot) .and. i1.le.nend_sup(iprot)
523 & .and. j1.gt.nstart_sup(iprot) .and. j1.le.nend_sup(iprot))
525 cd write (iout,*) "parallel",i1,j1
526 if(j1-i1.gt.5 .and. freeres(i1,j1,nsec,isec)) then
529 cd write (iout,*) i1,j1
535 if (i1.eq.icont(1,j) .and. j1.eq.icont(2,j) .and.
536 & freeres(i1,j1,nsec,isec)) goto 5
540 cd write (iout,*) i1,j1,not_done
544 if (i1-ii1.gt.1) then
548 if(lprint)write(iout,'(a,i3,4i4)')'parallel beta',
549 & nbeta,ii1,i1,jj1,j1
552 bfrag(1,nbfrag)=ii1+1
554 bfrag(3,nbfrag)=jj1+1
555 bfrag(4,nbfrag)=min0(j1+1,nres)
559 isec(ij,nsec(ij))=nbeta
563 isec(ij,nsec(ij))=nbeta
569 write(12,'(a18,i1,a9,i3,a2,i3,a1)')
570 & "DefPropRes 'strand",nstrand,
571 & "' 'num = ",ii1-1,"..",i1-1,"'"
573 write(12,'(a18,i2,a9,i3,a2,i3,a1)')
574 & "DefPropRes 'strand",nstrand,
575 & "' 'num = ",ii1-1,"..",i1-1,"'"
579 write(12,'(a18,i1,a9,i3,a2,i3,a1)')
580 & "DefPropRes 'strand",nstrand,
581 & "' 'num = ",jj1-1,"..",j1-1,"'"
583 write(12,'(a18,i2,a9,i3,a2,i3,a1)')
584 & "DefPropRes 'strand",nstrand,
585 & "' 'num = ",jj1-1,"..",j1-1,"'"
588 & "SetNeigh",ii1-1,i1-1,jj1-1,j1-1
592 endif ! i1.ge.nstart_sup .and. i1.le.nend_sup .and. i2.gt.nstart_sup .and. i2.le.nend_sup
595 c finding antiparallel beta
596 cd write (iout,*) '--------- looking for antiparallel beta ---------'
601 if (freeres(i1,j1,nsec,isec)) then
604 cd write (iout,*) i1,j1
611 if (i1.eq.icont(1,j).and.j1.eq.icont(2,j) .and.
612 & freeres(i1,j1,nsec,isec)) goto 6
616 cd write (iout,*) i1,j1,not_done
620 if (i1-ii1.gt.1) then
624 bfrag(2,nbfrag)=min0(i1+1,nres)
625 bfrag(3,nbfrag)=min0(jj1+1,nres)
632 if (nsec(ij).le.2) then
633 isec(ij,nsec(ij))=nbeta
639 if (nsec(ij).le.2) then
640 isec(ij,nsec(ij))=nbeta
646 write (iout,'(a,i3,4i4)')'antiparallel beta',
647 & nbeta,ii1-1,i1,jj1,j1-1
649 if (nstrand.le.9) then
650 write(12,'(a18,i1,a9,i3,a2,i3,a1)')
651 & "DefPropRes 'strand",nstrand,
652 & "' 'num = ",ii1-2,"..",i1-1,"'"
654 write(12,'(a18,i2,a9,i3,a2,i3,a1)')
655 & "DefPropRes 'strand",nstrand,
656 & "' 'num = ",ii1-2,"..",i1-1,"'"
659 if (nstrand.le.9) then
660 write(12,'(a18,i1,a9,i3,a2,i3,a1)')
661 & "DefPropRes 'strand",nstrand,
662 & "' 'num = ",j1-2,"..",jj1-1,"'"
664 write(12,'(a18,i2,a9,i3,a2,i3,a1)')
665 & "DefPropRes 'strand",nstrand,
666 & "' 'num = ",j1-2,"..",jj1-1,"'"
669 & "SetNeigh",ii1-2,i1-1,jj1-1,j1-2
675 cd write (iout,*) "After beta:",nbfrag
677 cd write (iout,*) (bfrag(j,i),j=1,4)
680 if (nstrand.gt.0.and.lprint_sec) then
681 write(12,'(a27,$)') "DefPropRes 'sheet' 'strand1"
684 write(12,'(a9,i1,$)') " | strand",i
686 write(12,'(a9,i2,$)') " | strand",i
693 c finding alpha or 310 helix
701 if (j1+2.le.nres) p2=phi(j1+2)*rad2deg
705 & ((p1.ge.10.and.p1.le.80).or.i1.le.2).and.
706 & ((p2.ge.10.and.p2.le.80).or.j1.le.2.or.j1.ge.nres-3) )then
707 cd if (j1.eq.i1+3) write (iout,*) "found 1-4 ",i1,j1,p1,p2
708 co if (j1.eq.i1+4) write (iout,*) "found 1-5 ",i1,j1,p1,p2
711 if (nsec(ii1).eq.0) then
720 if (i1.eq.icont(1,j) .and. j1.eq.icont(2,j)) goto 10
726 if (p1.lt.10.or.p1.gt.80.or.p2.lt.10.or.p2.gt.80)
729 cd write (iout,*) i1,j1,not_done,p1,p2
732 if (j1-ii1.gt.4) then
734 cd write (iout,*)'helix',nhelix,ii1,j1
744 write (iout,'(a,i3,2i4)') "Helix",nhelix,ii1-1,j1-1
745 if (nhelix.le.9) then
746 write(12,'(a17,i1,a9,i3,a2,i3,a1)')
747 & "DefPropRes 'helix",nhelix,
748 & "' 'num = ",ii1-1,"..",j1-2,"'"
750 write(12,'(a17,i2,a9,i3,a2,i3,a1)')
751 & "DefPropRes 'helix",nhelix,
752 & "' 'num = ",ii1-1,"..",j1-2,"'"
759 if (nhelix.gt.0.and.lprint_sec) then
760 write(12,'(a26,$)') "DefPropRes 'helix' 'helix1"
762 if (nhelix.le.9) then
763 write(12,'(a8,i1,$)') " | helix",i
765 write(12,'(a8,i2,$)') " | helix",i
772 write(12,'(a37)') "DefPropRes 'coil' '! (helix | sheet)'"
773 write(12,'(a20)') "XMacStand ribbon.mac"
778 write(iout,*) 'UNRES seq:'
780 write(iout,*) 'beta ',(bfrag(i,j),i=1,4)
784 write(iout,*) 'helix ',(hfrag(i,j),i=1,2)
790 do k=min0(bfrag(1,j),bfrag(2,j)),max0(bfrag(1,j),bfrag(2,j))
793 do k=min0(bfrag(3,j),bfrag(4,j)),max0(bfrag(3,j),bfrag(4,j))
798 do k=hfrag(1,j),hfrag(2,j)
804 c write (iout,*) "Finding 3-10 helices"
810 c write (iout,*) "i",i," i1",i1,isecstr(i1)," j1",j1,isecstr(j1)
811 if (isecstr(i1).eq.0 .and. isecstr(i1).eq.0 .and.
815 if (nsec(ii1).eq.0) then
824 if (i1.eq.icont(1,j) .and. j1.eq.icont(2,j)) goto 12
828 c write (iout,*) "d i1",isecstr(i1),i1," j1",j1,isecstr(i1)
829 if (isecstr(i1).ne.0 .or. isecstr(j1).ne.0) then
834 c write (iout,*) "not_done",not_done
837 c write (iout,*) "ii1",ii1," j1",j1
838 if (j1-ii1.gt.4) then
839 n310helix=n310helix+1
840 nh310frag=nh310frag+1
841 h310frag(1,nh310frag)=ii1
842 h310frag(2,nh310frag)=j1
847 c write (iout,*) "n310helix",n310helix," nh310frag",nh310frag
849 write (iout,'(a,i3,2i4)')
850 & "3-10 helix",n310helix,ii1-1,j1-1
851 if (n310helix.le.9) then
852 write(12,'(a17,i1,a9,i3,a2,i3,a1)')
853 & "DefPropRes 'helix",n310helix,
854 & "' 'num = ",ii1-1,"..",j1-2,"'"
856 write(12,'(a17,i2,a9,i3,a2,i3,a1)')
857 & "DefPropRes 'helix",n310helix,
858 & "' 'num = ",ii1-1,"..",j1-2,"'"
863 c write (iout,*) "n310helix",n310helix," nh310frag",nh310frag
866 c write (iout,*) "nh310frag",nh310frag
868 c write (iout,*) "h310frag",h310frag(1,j),h310frag(2,j)
869 do k=h310frag(1,j),h310frag(2,j)
875 write (iout,*) "Secondary structure"
880 write (iout,'(8(7x,i3))') (k,k=ist+9,ien,10)
881 write (iout,'(80a1)') (onelet(itype(k)),k=ist,ien)
882 write (iout,'(80a1)') (csec(isecstr(k)),k=ist,ien)
888 c-------------------------------------------------
889 logical function freeres(i,j,nsec,isec)
893 integer isec(maxres,4),nsec(maxres)
896 if (nsec(i).gt.1.or.nsec(j).gt.1) return
899 if (isec(i,k).eq.isec(j,l)) return