-
Notifications
You must be signed in to change notification settings - Fork 0
/
cas-21.f
14687 lines (13637 loc) · 490 KB
/
cas-21.f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
*****************************************************************************
* This program is to generate protein structural decoys by Monte Carlo *
* simulations under an on-and-off-lattice CAS model. It is illigal to *
* distribute any part of this code without writing permission from the *
* author. Please address comments/bug-reports to: [email protected] *
*****************************************************************************
*
* This program should be compiled by
* 'gfortran -static -O3 -ffast-math -lm -o cas cas.f'
*
* Last update by yzhang on March 18 2013
*
c 1 2 3 4 5 6 7 !
c 3456789012345678901234567890123456789012345678901234567890123456789012345678
program TASSER
!use openacc !this allows for the use of openacc
implicit integer(i-z)
parameter(ndim=1500) !maximum length of chain-length
parameter(nrep=100) !maximum number of replicas
parameter(nvec=416) !number of vectors on lattice
common/logica/goodc
logical look, goodc(nvec,nvec)
common/three/angle(nvec,nvec)
common/lengths/Lch,Lch1,Lch2
common/seqe/seq(ndim),sec(ndim)
common/vectors/vx(nvec),vy(nvec),vz(nvec),vector(-5:5,-5:5,-5:5)
common/bisec/cax(nvec,nvec),cay(nvec,nvec),caz(nvec,nvec)
common/hb/hbx(nvec,nvec),hby(nvec,nvec),hbz(nvec,nvec)
common/cutoff/cut1a,cut2a,cut3a,cut4a,cut1b,cut2b,cut3b,cut4b
common/hopp/eonehw(0:19)
common/looks/exc,exc1,exc2
common/hba/eh5a,Cr2a,acut_bb,acut_cc,acut_vv,acut_hh
common/hbb/eh5b,Cr2b,bcut_bb,bcut_cc,bcut_vv,bcut_hh
common/concutt/concut(0:19,0:19),concut2(0:19,0:19),concut_sc
common/arandom/ aarand,abrand,acrand,adrand
COMMON/ENERGY/EH5,ES3,ES3a,ES3b,EH1,EH1a,EH4,EHBIJ(ndim,ndim)
COMMON/pair/ apa(ndim,ndim),app(ndim,ndim),apm(ndim,ndim)
COMMON/size/ arla(0:19,0:19),arlm(0:19,0:19),arlp(0:19,0:19)
COMMON/short/ IBIN(-300:300),asr(ndim,-12:12) !safe when vr^2<30
COMMON/short1/ JBIN(0:500),bsr(ndim,16),acops(ndim,16)
COMMON/sizea/ ala(0:19,0:19),alm(0:19,0:19),alp(0:19,0:19)
common/one/acrit,contt,eonekd(0:19),eoinp(0:19,0:100),es2,es1
common/shape/amx,amy,amz,afs(ndim),afsn(ndim)
common/fr/frga(ndim),frgb(ndim)
COMMON/RES/ER3,er5,er6,er7,Mcom(ndim),Kcom(ndim,100)
COMMON/RCN/Mdis(ndim),kdis(ndim,100),dist(ndim,100),dev(ndim,100)
COMMON/RCN1/ER1,arca1(ndim,ndim,50),n_resa1(ndim,ndim)
COMMON/short2/ codevsum, didevsum, csr(ndim,2)
common/shortcom/eh3,es4,es5,es6,es7,es7a,es7b,es7c
common/sg/gx(nvec,nvec,0:19),gy(nvec,nvec,0:19),gz(nvec,nvec,0:19)
common/maxi/maxin,vect1,vect2
common/ehbc/envir(0:15,0:15,0:15,0:19,4),en1
common/forpreparemove4/ asrr(0:19,0:19,-12:12)
common/lim/colim,dilim,coold,conew,diold,dinew,didev,codev
common/distres/er4,es3c
common/rmsdrange/nca1,nca2
common/CA/dx(ndim),dy(ndim),dz(ndim)
common/msichores/msicho
common/ehbenergy/EHB1,EHB1a,EHB1b,EHB1c,EHB2,EHB3,EHB4,EHB5,EHB6
common/ehbenergy1/EHB5a,EHB5b
common/eshortenergy1/ESHORT1,ESHORT2,ESHORT3,ESHORT4,ESHORT11
common/eshortenergy2/ESHORT4a,ESHORT5,ESHORT5a,ESHORT5b,ESHORT5c
common/eshortenergy3/ESHORT6,ESHORT7,ESHORT8,ESHORT9,ESHORT10
common/eshortenergy4/ESHORT12
common/otherenergy/E_cord,E_cnum
common/resnumber/Ncom,Ndis,accur
common/initialinput/switch,k_cycle,k_phot,N_ann
common/thrtem/aT_ann(100)
common/outputxyz/fxyz(3,ndim)
common/temperature/itemp,atemp
common/beta1/axalf(0:19),ayalf(0:19),azalf(0:19)
common/beta2/axbet(0:19),aybet(0:19),azbet(0:19)
common/pair1/eh2,eh1b,eh1c
dimension E_s(nrep),E_ss(nrep)
common/paircut/ash
common/countres/t_comb,t_dist,t_combCA,s_comb,s_dist,s_combCA
common/countres1/t_combCA8,t_distL,s_combCA8,s_distL,N_resc
common/nswap/bNSa(100),bNSt(100)
common/naccept/bNa(100),bNt(100),bNNa(100),bNNt(100)
common/naccept1/bN5a(100),bN5t(100)
double precision bNa,bNt,bNNa,bNNt,bN5a,bN5t
common/mov2/v21(nvec,nvec,80),v22(nvec,nvec,80),Np2(nvec,nvec)
common/order/acorder,en2,sumct,sumcto,icnt,icnto,dord,en3
common/envir1/nop(ndim),nom(ndim),noa(ndim),nhbn(ndim)
common/backup1/NOPP(ndim),NOMM(ndim),NOAA(ndim),NHBNN(ndim)
common/backup2/eprofo,eprofn,energ
common/moverange/Mran1,Mran2,Mend,Mend_N,Mend_C
common/pairmap2/apabla(0:19,0:19),apablp(0:19,0:19)
common/pairmap3/apablm(0:19,0:19),amap(ndim,ndim),nmap
common/moveretio1/h2,h3s,h3d,h4s,h4d,h5s,h5d,h6,h7,hend
common/moveretio2/bh2,bh3s,bh3d,bh4s,bh4d,bh5s,bh5d,bh6
common/moveretio3/bh7a,bh7b,bhendn,bhendc
common/icgg/ icg(ndim), EH6
common/rs/i_thr0
common/frozen/L_cut,d_xyz0,d_xyz00(ndim),angle0,angle00(ndim)
common/nrepfile/n_repf
common/commonuse1/random,ncycle
common/commonuse2/atemp1,atemp2,N_rep,phot
common/commonuse4/al2,al4,al5,al6,al7,al8,anvec
common/gapmove2/ras2(ndim),nfl2
common/gapmove3/ras3(ndim),nfl3
common/gapmove4/ras4(ndim),nfl4
common/gapmove5/ras5(ndim),nfl5
common/gapmove6/ras6(ndim),nfl6
common/mng/m_g(100)
common/acct/accept0
character*6 mname
character fn
common/movename/mname(100)
common/readinitial/m_initial
common/eall/N_sum(100),energ_sum(100),energ_sum2(100),E_min
common/chain0/ras(ndim),nfl
common/chain1/ica(0:ndim),x(ndim),y(ndim),z(ndim)
common/echain0/nfr,nfr_i(ndim),nfr_f(ndim),ifr,n_fra
common/echain1/ex(ndim),ey(ndim),ez(ndim) !CA
common/echain2/egx(ndim),egy(ndim),egz(ndim) !SG
common/echain4/ecx(ndim),ecy(ndim),ecz(ndim) !cc
common/echain5/ebx(ndim),eby(ndim),ebz(ndim) !Hb
common/chainm/mv(ndim)
common/sw1/aT_rep(nrep),E_rep(nrep)
common/sw2/xrep(ndim,nrep),yrep(ndim,nrep),zrep(ndim,nrep)
common/sw3/icarep(ndim,nrep)
common/sw4/exrep(ndim,nrep),eyrep(ndim,nrep),ezrep(ndim,nrep) !Ca
common/sw5/egxrep(ndim,nrep),egyrep(ndim,nrep),egzrep(ndim,nrep) !SG
common/sw7/ecxrep(ndim,nrep),ecyrep(ndim,nrep),eczrep(ndim,nrep) !cc
common/sw8/ebxrep(ndim,nrep),ebyrep(ndim,nrep),ebzrep(ndim,nrep) !hb
common/weight/chuan
common/bigbond/i_bigbond,teco
common/ssp/ssp
common/defoangle/defo_angle
common/fractpair/fract_pair1,fract_pair3
common/zscore/izscore
common/aTs/aTs1,aTs2,aTs_rep(nrep),aTs
common/aTTs/aTTs1,aTTs2,aTTs_rep(nrep),aTTs
common/ichos/ichos
common/nana1/nana
common/ranzy/nozy
common/hours/hour_max
common/stick1/nstick,astick,nrmsd,ermsd
common/stick2/iq(ndim,nrep)
common/stick3/ax00(ndim,nrep),ay00(ndim,nrep),az00(ndim,nrep)
common/stick6/bx00(ndim),by00(ndim),bz00(ndim),armsd_min0
common/trackn/n_tem(100)
dimension eshort12_a(nrep)
common/lattice/m_latt,latt1,latt2
common/nwmax1/nvecr
common/iter/n_run
common/aminoacid/sequ(ndim)
character*3 sequ
common/stick7/itemp0,icycle,icycle0
common/mloopf/mloop
common/res2/er14,er15,er16,er17
common/svm1/Mcon(15,ndim),Kcon(15,ndim,100),awei(15,ndim,ndim)
common/svm2/acc_cut,dist_svm2(15),nk_svm(3),ik_svm(3,15)
common/svm3/er21,er22,er23
common/svm4/acc_cutB,acc_cutG
cccc RMSD:
double precision r_1(3,ndim),r_2(3,ndim),r_3(3,ndim),w(ndim)
double precision u(3,3),t(3),rms,drms !armsd is real
data w /ndim*1.0/
ccc
ccccccccccccccccccccccccc common input files cccccccccccccccccccccccccccccc
open(unit=1,file='contact.comm', status='old') !cutoff of contact predi.
open(unit=2,file='profile3.comm',status='old') !envir
open(unit=3,file='quasi3.comm', status='old') !SG-potential, format
open(unit=4,file='sidechain.comm',status='old') !for Sc position.
open(unit=5,file='r13.comm', status='old') !E_short of (i,i+2)
open(unit=12,file='r14.comm', status='old') !E_short of (i,i+3)
open(unit=7,file='r14h.comm', status='old') !stress helical-stru.
open(unit=8,file='r14e.comm', status='old') !stress extended-stru.
open(unit=9,file='r15.comm', status='old') !E_short(i,i+4)
open(unit=10,file='r15h.comm', status='old')
open(unit=11,file='r15e.comm', status='old')
ccccccccccccccc sequence specified input files cccccccccccccccc///////////
open(unit=14,file='seq.dat', status='old') !note format
open(unit=15,file='par.dat', status='old') !SG-pair potential
open(unit=16,file='comb.dat', status='old') !SG-contact restraints
open(unit=17,file='dist.dat', status='old') !CA-distant restraints
open(unit=18,file='combCA.dat',status='old') !CA-contact restraints
open(unit=28,file='comb8CA.dat',status='old') !CA-contact at 8A
open(unit=21,file='rmsinp',status='old') !chain length for Lch
open(unit=22,file='distL.dat',status='old') !long range CA dist restraint
open(unit=25,file='pair3.dat',status='unknown') !orientation specific
open(unit=26,file='pair1.dat',status='unknown') !no orientation
open(unit=27,file='exp.dat',status='unknown')
open(unit=24,file='init.dat',status='old')
open(unit=19, file='in.dd', status='old')
open(unit=20, file='out.d', status='unknown')
ccccccccccccccccfor E-t cccccccccccccccccccccccccccccccccccccccccccccccccc
c open(unit=91, file='swepa.d', status='unknown') !$$
c open(unit=92, file='swepb.d', status='unknown') !$$
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c 30-40 -->rep
cccccccccccccccc sequence-based contact predictions --------------->
open(unit=50,file='conf3.comm',status='unknown')
open(unit=51,file='svmseqca6.dat',status='unknown') !1
open(unit=52,file='svmseqca7.dat',status='unknown') !2
open(unit=53,file='svmseqca8.dat',status='unknown') !3
open(unit=54,file='svmseqcb6.dat',status='unknown') !4
open(unit=55,file='svmseqcb7.dat',status='unknown') !5
open(unit=56,file='svmseqcb8.dat',status='unknown') !6
open(unit=57,file='svmseqsg6.dat',status='unknown') !7
open(unit=58,file='svmseqsg7.dat',status='unknown') !8
open(unit=59,file='svmseqsg8.dat',status='unknown') !9
open(unit=60,file='svmcon.dat',status='unknown') !10, beta
open(unit=61,file='betacon.dat',status='unknown') !11, CA
open(unit=62,file='psicov.dat',status='unknown') !12, beta
open(unit=63,file='spcon.dat',status='unknown') !13, beta
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
read(19,*) hour_max
read(19,*) random,ncycle,phot,N_rep,n_run
read(19,*) h2,h3s,h3d,h4s,h4d,h5s,h5d,h6,hend
read(19,*) atemp2,atemp1,exc,exc1,exc2,Mend,defo_angle
read(19,*) d_xyz0,angle0,L_cut,teco
read(19,*) switch,i_thr0,ssp !i_thr0: 0->consensus; 1->top-1; 2->2th
read(19,*) eh5a,Cr2a,acut_bb,acut_cc,acut_vv,acut_hh !alpha-type HB
read(19,*) eh5b,Cr2b,bcut_bb,bcut_cc,bcut_vv,bcut_hh !alpha-type HB
read(19,*) eh1,eh2,eh3,eh4 !for EHBs (6)
read(19,*) eh1a,eh1b
read(19,*) es2,es3,es4,es5,es6 !for ESHORTs (6)
read(19,*) es3a,es3b,es3c
read(19,*) en1,en2,en3 !for ensemble (3)
read(19,*) chuan
read(19,*) aTs2,aTs1 !SQ2
read(19,*) aTTs2,aTTs1 !ARCSH
read(19,*) nana !number of columns in exp.dat
read(19,*) nstick,astick,nrmsd,ermsd !whether stick to templates
read(19,*) m_latt !how many vectors
***
write(20,*)'starting time: ',fdate() !pgf77 has problem on fdate()
write(*,*)'starting time: ',fdate()
***
call set_common !set common parameters
call read_seq !read seq(i),sec(i) from 'seq.dat'
call read_centro !read eoinp(i,dis) from 'centro.comm'
call read_profile !read envir(ia,im,ip,i,j) from 'profile3.comm'
call read_E13 !read 1-3 short-range E from 'r13.comm'
call read_E14 !read 1-4 potential from 'r14*.dat'
call read_E15 !read 1-5 potential from 'r15*.dat'
call read_quarsi3 !read 'quarsi3.comm'
call read_par !read 'par.dat', pair-wise potential
call read_concut !read cut-off for contact prediction
call read_contactrestrain !read contact restrains from 'comb.dat'
call read_distantrestrain !read distant restrains from 'dist.dat'
call read_longdistantrestrain !read long distant restrain from 'distL.dat'
call read_exp !read slovent expose prediction
call read_CAcontact !read CAcontact restrains from 'combCA.dat'
call read_CAcontact8 !read CAcontact restrains from 'comb8CA.dat'
call read_seqcontact !read seq_based_contact 'svmseqca6.dat'
call reset_temperature !reset temperature according N_rest
call set_temperature !set temperature for different replic
call set_EHB !set structure-specitic H-bond, EHBIJ(i,j)
call prepare_vectors !prepare all possible bond-vectors
call prepare_neighbors !define goodc(i,j), angle(i,j), prod(i,j)
call prepare_beta !define C_beta, C_group, and hydrogen-bond
call prepare_frg !compute the secondary fragment biases
call get_acorder !calculate contact order
call write_parameter !print out initial parameters
call set_move_retio !set movement percentage
call prepare_move2 !2-bond move, num2=26784
n_repf=5 !number of output replicas
if(izscore.eq.1)then !easy target
n_repf=8 !number of output replicas
endif
if(switch.gt.1)then
n_repf=3 !number of output replicas
call template_initial !initial model from templates
endif
ccccccccccccccc trajectory files cccccccccccccccccccccccccccccccccccccc
if(n_repf.gt.N_rep)n_repf=N_rep
do i=1,n_repf
if(i.lt.10)then
fn=char(48+i)
open(unit=30+i,file='rep'//fn//'.tra',status='unknown')
else
fn=char(48+(i-10))
open(unit=30+i,file='rep1'//fn//'.tra',status='unknown')
endif
enddo
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
if(switch.gt.1)then
call template_simulation !simulate the templates
stop
endif
do i=1,100
bNSa(i)=0 !aceptance for swep
bNSt(i)=0
bNa(i)=0 !acceptance for move2,3,4,5,6,7
bNt(i)=0
bNNa(i)=0 !acceptance for different temperature.
bNNt(i)=0
N_sum(i)=0
energ_sum(i)=0 !<E_tot>
energ_sum2(i)=0 !<E_tot^2>
eshort12_a(i)=0
enddo
i_tr=0 !order number of output trajectory
E_min=10000
mcycle=0
i_run=0
15 i_run=i_run+1
c call random_initial !produce initial structure randomly.
call read_initial !read initial (x,y,z) from 'init.dat'
do i=1,n_rep
n_tem(i)=i !i'th replica from n_tem(i)'th template
enddo
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
ccc The main cycle start from here ! ccc
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
do 1111 icycle=1,ncycle
do 2222 itemp=1,N_rep !iterate for all the replicas
atemp=aT_rep(itemp) !current temperature
aTs=aTs_rep(itemp)
aTTs=aTTs_rep(itemp)
call set_current !get current (x,y,z,ica)
call initial_move !update center, axis, energy
ccc
do 3333 iphot=1,phot !N_swap, iterate at fixed temperature
do 4444 i_lch=1,Lch
fff=aranzy(nozy)
if(fff.le.bh2)then
call move2
elseif(fff.le.bh3s)then
call move3s
elseif(fff.le.bh3d)then
call move3d
elseif(fff.le.bh4s)then
call move4s
elseif(fff.le.bh4d)then
call move4d
elseif(fff.le.bh5s)then
call move5s
elseif(fff.le.bh5d)then
call move5d
elseif(fff.le.bh6)then
call move6
c call move7a
c call move7b
c call move9
elseif(fff.le.bhendn)then
call move_n_end
else
call move_c_end
endif
atime=second()/3600.0 !pgf77:etime(tarray),real tarray(2)
if(atime.gt.hour_max)goto 901
4444 continue
3333 continue
ccc
ccccccccccrecord energy and (x,y,z) cccccccccccccccccccc
E_rep(itemp)=energy_tot() !whole energy
c energy_total=
c $ eh1*EHB1 !general soft-core energy for Ca-SC
c $ +eh1a*EHB1a !general soft-core energy for CA-CA
c $ +eh1b*EHB1b !general soft-core energy for SC-SC
c $ +eh1c*EHB1c !pair-wise potential for SC-SC
c $ +eh2*EHB2 !soft-core energy for SC-SC (quarsi3)
c $ +eh3*EHB3 !coupling of secondary structure and pairwise
c $ +eh4*EHB4 !enhanced quarsi3
c $ +eh5a*EHB5a !H-bond (alpha)
c $ +eh5b*EHB5b !H-bond (beta)
c $ +es2*ESHORT2 !bury potential for SC
c $ +er1*ESHORT3 !distmap
c $ +er3*ESHORT4 !contact restrain
c $ +er4*ESHORT4a !deviation of contact restrain
c $ +er5*ESHORT9 !CAcontact restrain
c $ +er6*ESHORT10 !longrange CA-dist restrain
c $ +er7*ESHORT11 !derivation to template
c $ +astick*ESHORT12 !derivation to ax00
c $ +es3*ESHORT5 !general bias to protein-like structure
c $ +es3a*ESHORT5a !panality on crumpling
c $ +es3b*ESHORT5b !bias to predicted alpha/beta structures
c $ +es3c*ESHORT5c !bias to possible alpha/beta structures
c $ +es4*ESHORT6 !R13
c $ +es5*ESHORT7 !R14
c $ +es6*ESHORT8 !R15
c $ +en1*eprofo !E_environment
c $ +en2*E_cord !Contact order
c $ +en3*E_cnum !Contact number
c parameters with input: eh1,eh1a,eh1b,eh2,eh3,eh4,eh5a,eh5b,
c es2,es3,es3a,es3b,es3c,es4,es5,
c en1,en2,en3
c parameters mandtoried: eh1c,er1,er2,er3,er4,er5,er6,er7
c write(*,*)E_rep(itemp),energy_total
c write(*,*)icycle,itemp,E_rep(itemp),eshort12,'=='
if(E_rep(itemp).lt.E_min) E_min=E_rep(itemp)
do i=1,Lch
xrep(i,itemp)=x(i)
yrep(i,itemp)=y(i)
zrep(i,itemp)=z(i)
enddo
eshort12_a(itemp)=eshort12_a(itemp)+eshort12
2222 continue
cccccccccccccccccc print out 'swep.d' cccccccccccccccccccccccccccc
c write(91,91)icycle,(E_rep(i),i=1,20) !$$
c write(92,91)icycle,(E_rep(i),i=21,N_rep) !$$
c 91 format(i10,21f9.1)
ccccccccccccccccc<RMSD>, <E> cccccccccccccccccccccccccc
do i=1,N_rep
energ_sum(i)=energ_sum(i)+E_rep(i)
energ_sum2(i)=energ_sum2(i)+E_rep(i)*E_rep(i)
N_sum(i)=N_sum(i)+1
enddo
ccccccccccccccccccccc snapshots of E(1), E(N_rep) ccccccccccccc
if(icycle.eq.icycle/1*1)then
i_tr=i_tr+1
do k=1,n_repf
write(30+k,401)Lch,E_rep(k),i_tr,icycle
do i=1,Lch
abx=xrep(i,k)*0.87
aby=yrep(i,k)*0.87
abz=zrep(i,k)*0.87
write(30+k,402)abx,aby,abz
enddo
enddo
endif
401 format(i8,1x,f10.1,2i8)
402 format(f10.3,1x,f10.3,1x,f10.3)
call count_restrains !count number of satisfied restraints
ccccccccccccccccc swap replicas cccccccccccccccccccccccccccccccc
ccccccccccccccccc We parallelize this portion of code for GPU ccccccc
!$acc kernels
if(icycle.eq.icycle/2*2)then
do i=1,N_rep-1,2 !swap odd replicas
call swap(i,i+1)
enddo
else
do i=2,N_rep-1,2
call swap(i,i+1) !swap even replicas
enddo
endif
mcycle=mcycle+1
1111 continue
if(i_run.lt.n_run)goto 15
901 continue
c--------------------------Main cycle ended here!!---------------
call test_neighbor !check all the neighboring residues
call test_overlap !test the overlap of C_a and C_b
energy_tot_tmp=energy_tot()
write(20,*)'E_final=',energy_tot_tmp
write(20,*)
write(20,*)'<s_comb>=',s_comb/float(N_resc)
write(20,*)'<t_comb>=',t_comb/float(N_resc)
write(20,*)'s_comb/t_comb=',float(s_comb)/(t_comb+0.001)
write(20,*)
write(20,*)'<s_dist>=',s_dist/float(N_resc)
write(20,*)'<t_dist>=',t_dist/float(N_resc)
write(20,*)'s_dist/t_dist=',float(s_dist)/(t_dist+0.001)
write(20,*)
write(20,*)'<s_distL>=',s_distL/float(N_resc)
write(20,*)'<t_distL>=',t_distL/float(N_resc)
write(20,*)'s_distL/t_distL=',float(s_distL)/(t_distL+0.001)
write(20,*)
write(20,*)'<s_combCA>=',s_combCA/float(N_resc)
write(20,*)'<t_combCA>=',t_combCA/float(N_resc)
write(20,*)'s_combCA/t_combCA=',float(s_combCA)/(t_combCA+0.001)
write(20,*)
write(20,*)'<s_combCA8>=',s_combCA8/float(N_resc)
write(20,*)'<t_combCA8>=',t_combCA8/float(N_resc)
write(20,*)'s_combCA8/t_combCA8=',
& float(s_combCA8)/(t_combCA8+0.001)
write(20,*)
cccccc output 'stick.pdb' ccccccccccccccccccccccccccccccc
c sticki.pdb is the conformation closest to i'th structure in init.pdb
if(nrmsd.eq.1)then
write(20,*)' ------- RMSD to templates ------------'
write(20,*)'rmsd_min0=',armsd_min0*0.87
write(20,*)'icycle0=',icycle0
write(20,*)'itemp0=',itemp0
open(unit=70,file='stick.pdb',status='unknown')
do i=1,Lch
write(70,1037)i,sequ(i),i,bx00(i)*0.87,by00(i)*0.87,
& bz00(i)*0.87
enddo
write(70,*)'TER'
close(70)
endif
1037 format('ATOM ',i5,' CA ',A3,I6,4X,3F8.3)
cccccccccccccccccccccccc Na/Nt cccccccccccccccccccccccccc
WRITE(20,*)
WRITE(20,*) 'i_move move Na(i) Nt(i) Na(i)/Nt(i)'
do i=2,15
if(bNt(i).gt.1)then
write(20,5004) i,mname(i),bNa(i),bNt(i),bNa(i)/bNt(i)
else
write(20,5004) i,mname(i),bNa(i),bNt(i)
endif
enddo
5004 format(I4,A9,2f15.1,f11.6)
ccccccccccccccccccccccccccE_final, NSa/NSt ccccccccccccccccccccccc
WRITE(20,*)
WRITE(20,*)'-------------- E_final, Na_swap/Nt_swap ---------'
WRITE(20,*) 'i T(i) final_E(i) Nsa(i) Nst(i) Nsa(i)/Nst(i)'
do i=1, n_rep
if(bNSt(i).gt.1)then
write(20,5005) i,aT_rep(i),E_rep(i),
$ bNSa(i),bNSt(i),bNSa(i)/bNSt(i)
else
write(20,5005) i,aT_rep(i),E_rep(i),bNSa(i),bNSt(i)
endif
enddo
5005 format(I4,f7.2,f8.1,2f15.1,f11.6)
ccccccccccccccccccccccc <E>, NNa/NNt ccccccccccccccccccccccccccc
WRITE(20,*)
WRITE(20,*)'------------ <energy>, Na(i)/Nt(i) ----------------'
write(20,*)'i_rep T <E> NNa(i_temp) NNt(i_temp) Na/Nt
& <ESHORT12>'
do i=1,N_rep
energ_sum(i)=energ_sum(i)/N_sum(i)
energ_sum2(i)=energ_sum2(i)/N_sum(i)
if(bNNt(i).gt.1)then
cheat=(energ_sum2(i)-energ_sum(i)**2)/(aT_rep(i)**2)
write(20,5006)i,aT_rep(i),energ_sum(i),cheat,bNNa(i)
$ ,bNNt(i),bNNa(i)/bNNt(i),eshort12_a(i)/N_sum(i)
else
write(20,5006)i,aT_rep(i),energ_sum(i),cheat,bNNa(i)
$ ,bNNt(i)
endif
enddo
5006 format(I4,f7.2,f8.1,f15.3,2f12.1,f11.6,6f8.1)
write(20,*)'E_min=',E_min
write(20,*)
write(20,*)'ncycle_max=',ncycle*n_run
write(20,*)'ncycle_real=',mcycle
write(20,*)
write(20,*)'hour_max=',hour_max
write(20,*)'hour_real=',atime
write(20,*)
write(20,*)'ending time: ',fdate()
write(*,*)
write(*,*)'ncycle_max=',ncycle*n_run
write(*,*)'ncycle_real=',mcycle
write(*,*)
write(*,*)'hour_max=',hour_max
write(*,*)'hour_real=',atime,TimeEnd,TimeEnd1
write(*,*)
write(*,*)'ending time: ',fdate()
STOP
END
ccccccc=======================================================cccccccccc
cc The main program ended!
ccccccc=======================================================cccccccccc
cccccccccccccccccc set common used parammeters cccccccccccc
subroutine set_common
implicit integer(i-z)
parameter(ndim=1500)
parameter(nrep=100) !number of replicas
parameter(nvec=416)
character protein*10
common/lengths/Lch,Lch1,Lch2
common/one/acrit,contt,eonekd(0:19),eoinp(0:19,0:100),es2,es1
common/maxdis2/maxdis2(ndim)
common/arandom/ aarand,abrand,acrand,adrand
common/nswap/bNSa(100),bNSt(100)
common/naccept/bNa(100),bNt(100),bNNa(100),bNNt(100)
common/naccept1/bN5a(100),bN5t(100)
double precision bNa,bNt,bNNa,bNNt,bN5a,bN5t
common/commonuse1/random,ncycle
common/commonuse2/atemp1,atemp2,N_rep,phot
common/commonuse4/al2,al4,al5,al6,al7,al8,anvec
common/sw1/aT_rep(nrep),E_rep(nrep)
character*6 mname
character*80 line
common/movename/mname(100)
common/frozen/L_cut,d_xyz0,d_xyz00(ndim),angle0,angle00(ndim)
COMMON/RCN1/ER1,arca1(ndim,ndim,50),n_resa1(ndim,ndim)
common/distres/er4,es3c
COMMON/RES/ER3,er5,er6,er7,Mcom(ndim),Kcom(ndim,100)
common/zscore/izscore
common/excluded/vvv(ndim,ndim)
common/countres/t_comb,t_dist,t_combCA,s_comb,s_dist,s_combCA
common/countres1/t_combCA8,t_distL,s_combCA8,s_distL,N_resc
common/pair1/eh2,eh1b,eh1c
common/weight/chuan
character type*10
common/bigbond/i_bigbond,teco
common/ssp/ssp
common/fractpair/fract_pair1,fract_pair3
common/pair33/i_pair3,mk_pair3
common/ichos/ichos
common/ranzy/nozy
common/lattice/m_latt,latt1,latt2
common/nwmax1/nvecr
common/stick1/nstick,astick,nrmsd,ermsd
common/stick2/iq(ndim,nrep)
common/stick3/ax00(ndim,nrep),ay00(ndim,nrep),az00(ndim,nrep)
common/stick6/bx00(ndim),by00(ndim),bz00(ndim),armsd_min0
common/res2/er14,er15,er16,er17
common/svm2/acc_cut,dist_svm2(15),nk_svm(3),ik_svm(3,15)
common/svm3/er21,er22,er23
common/svm4/acc_cutB,acc_cutG
cccccccccccccc set the random generator cccccccccccccccccccccccc
nozy=random
if(nozy.gt.0)nozy=-nozy
firstrandom=aranzy(nozy)
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
read(21,*)
read(21,*)Lch !length of chain
read(21,*)protein
Lch1=Lch-1
Lch2=Lch-2
anvec=nvec-0.00001
contt=1.5*float(Lch) !TARGET NUMBER OF CONTACTS 1.5*N
do i=1,Lch
maxdis2(i)=20*i*i !maximum distance of walk in i steps
enddo
write(20,*)'Target:',protein
write(20,*)'Length:',Lch
ichos=1
if(m_latt.eq.1)then
latt1=14
latt2=25
nvecr=312
else
latt1=12
latt2=26
nvecr=416
endif
anvec=nvecr-0.00001
do i=1,Lch
do j=1,Lch
vvv(i,j)=1 !every pair should be checked
enddo
enddo
armsd_min0=1000
c if(Lch.ge.300)ncycle=int(ncycle*0.8)
c if(Lch.ge.400)ncycle=int(ncycle*0.8)
c if(Lch.ge.500)ncycle=int(ncycle*0.8)
c if(Lch.ge.600)ncycle=int(ncycle*0.8)
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
N_resc=0
t_comb=0
t_dist=0
t_distL=0
t_combCA=0
t_combCA8=0
s_comb=0
s_dist=0
s_distL=0
s_combCA=0
s_combCA8=0
ccccccccccccccccccccccc Temperature ccccccccccccccccccccccccccc
c [80,130] is the standard:
if(Lch.lt.80)then
atemp1=atemp1*0.97
atemp2=atemp2*0.91
if(Lch.lt.55)then
atemp1=atemp1*0.97
atemp2=atemp2*0.91
endif
endif
if(Lch.gt.130)then
atemp1=atemp1*1.05
atemp2=atemp2*1.1
if(Lch.gt.165)then
atemp1=atemp1*1.05
atemp2=atemp2*1.1
if(Lch.gt.200)then
atemp1=atemp1*1.05
atemp2=atemp2*1.1
endif
endif
endif
ccccccccccccc Number of replicas #################
if(Lch.gt.165)then !50
N_rep=N_rep+10
endif
if(Lch.gt.240)then !60
N_rep=N_rep+10
endif
if(Lch.gt.300)then !70
N_rep=N_rep+10
endif
if(Lch.gt.400)then !80
N_rep=N_rep+10
endif
if(N_rep.gt.80)N_rep=80
ccccccccccccccc movement name cccccccccccccccccccccccc
mname(2)='move2a'
mname(3)='move3s'
mname(4)='move3d'
mname(5)='move4s'
mname(6)='move4d'
mname(7)='move8'
mname(8)='move5s'
mname(9)='move5d'
mname(10)='move6'
mname(11)='move_n'
mname(12)='move_c'
mname(13)='move7a'
mname(14)='move7b'
mname(15)='move9'
mname(16)='tran_N'
mname(17)='tran_M'
mname(18)='tran_C'
mname(19)='rot_N' !no
mname(20)='rot_M'
mname(21)='rot_C' !no
mname(22)='trot_N'
mname(23)='trot_M'
mname(24)='trot_C'
mname(25)='defo_N'
mname(26)='defo_M'
mname(27)='defo_C'
ccccccccccreset restraints weights according to zscore cccccccccccc
rewind(24)
read(24,*)n_thr,type
if(type.eq.'easy')then !--------------->easy
izscore=1
er1=chuan*3.6 !for dist.dat
er3=chuan*0.765 !for comb.dat
er4=chuan*0.45 !for comb.dat of deviation
er5=chuan*2.7 !for combCA.dat
eh1c=chuan*1.8 !for par.dat
er6=chuan*0.45 !for distL.dat
er7=chuan*500 !for RMSD
if(ssp.eq.1)er7=chuan*100 !for RMSD
i_bigbond=3 !decide fragment base on distance
fract_pair1=0.4
fract_pair3=0.3
acc_cut=0.4
acc_cutB=1.1
acc_cutG=1.1
er21=2.5
er22=2.5
er23=2.5
elseif(type.eq.'medm')then !--------------->medium
izscore=2
er1=chuan*4.05 !for dist.dat
er3=chuan*0.81 !for comb.dat
er4=chuan*0.405 !for comb.dat of deviation
er5=chuan*1.08 !for combCA.dat
eh1c=chuan*1.0 !for par.dat
er6=chuan*1.0 !for distL.dat
er7=chuan*100 !for RMSD
if(ssp.eq.1)er7=chuan*10 !for RMSD
i_bigbond=1 !decide fragment base on +-2
fract_pair1=0.7
fract_pair3=0.3
acc_cut=0.4
acc_cutB=1.1
acc_cutG=1.1
er21=2.5
er22=2.5
er23=2.5
else !--------------->hard
izscore=3
er1=chuan*2.7 !for dist.dat
er3=chuan*0.4 !for comb.dat
er4=chuan*0.27 !for comb.dat of deviation
er5=chuan*0.4 !for combCA.dat
eh1c=chuan*1.5 !for par.dat
er6=chuan*0.5 !for distL.dat
er7=chuan*5 !for RMSD
i_bigbond=3 !decide fragment base on distance
fract_pair1=0.3
fract_pair3=0.7
acc_cut=0.375
acc_cutB=1.1
acc_cutG=1.1
er21=2.0
er22=2.0
er23=2.0
endif
if(teco.eq.1) i_bigbond=1 !teco=1, template from teco
if(chuan.le.0.0001)then !without using restraints
eh1c=1 !for par.dat
fract_pair1=1 !do not use par.dat
endif
c er14=er5
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c^^^^^^^^^^^^^^^^ common parameters finished ^^^^^^^^^^^^^^^^^^^^^^^
return
end
ccccccccccccccccccc read sequence ccccccccccccccccccccccc
c Only seq(i) is useful
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
subroutine read_seq
implicit integer(i-z)
parameter(ndim=1500)
parameter(nvec=416)
character*3 aa(-1:20), NAME,sequ
common/seqe/seq(ndim),sec(ndim)
common/lengths/Lch,Lch1,Lch2
common/icgg/ icg(ndim), EH6
common/aminoacid/sequ(ndim)
data aa/ 'BCK','GLY','ALA','SER','CYS','VAL','THR','ILE',
c -1 0 1 2 3 4 5 6
& 'PRO','MET','ASP','ASN','LEU',
c 7 8 9 10 11
& 'LYS','GLU','GLN','ARG',
c 12 13 14 15
& 'HIS','PHE','TYR','TRP','CYX'/
c 16 17 18 19 20
do 121 i=1,Lch
read(14,707) k,NAME,SEC(I),tmp
do j=0,19
if(NAME.eq.aa(j)) then
SEQ(i)=j
icg(i)=0
sequ(i)=name
if(NAME.eq.'ASP'.or.NAME.eq.'GLU') icg(i)=-1
if(NAME.eq.'LYS'.or.NAME.eq.'ARG') icg(i)= 1
go to 121
endif
enddo
SEQ(i)=0
icg(i)=0
sequ(i)='GLY'
121 continue
707 format(i5,3x,a3,2i5)
close(14)
c^^^^^^^^^^^^^^^^^^^^^ read sequence finished ^^^^^^^^^^^^^^^^^^
return
end
cccccccccccccccccccccc read centrosymmetric potential cccccccccccccccccccc
c eonekd(A) controls centrosymmetric potential of C_g.
c
subroutine read_centro
implicit integer(i-z)
parameter(nvec=416)
character*3 NAME
common/one/acrit,contt,eonekd(0:19),eoinp(0:19,0:100),es2,es1
common/lengths/Lch,Lch1,Lch2
common/hopp/eonehw(0:19)
c read hydrophobic potential for Sg, positive for hydrophobic residue--->
data eonekd /-0.4, 1.8, -0.8, 2.5, 4.2, -0.7, 4.5,
& -1.6, 1.9, -3.5, -3.5, 3.8,
& -3.9, -3.5, -3.5, -4.5,
& -3.2, 2.8, -1.3, -0.9/
c ^ ^ ^ !contradict with 'centro.comm'
c read hydrophilic potential for Sg, positive for hydrophilic residue--->
data eonehw /0.0, -0.5, 0.3, -1.0, -1.5, -0.4, -1.8,
& 0.0, -1.3, 3.0, 0.2, -1.8,
& 3.0, 3.0, 0.2, 3.0,
& -0.5, -2.5, -2.3, -3.4/
c expected gyration radius:
acrit=2.2*exp(0.38*alog(float(Lch)))/0.87 !gyrat-radius~2.2*l^0.38
* Defination of gyration-radius: acrit=sqrt(<(r-r0)^2>)
c^^^^^^^^^^^^^^^^^ read centersymmetric potential finished ^^^^^^^^^^^
return
end
cccccccccccccccccccccc read environment cccccccccccccccccccccccccccc
c G A V L I S T C M P D N E Q K R H F Y W
c (0,0,0) * * * * * * * * * * * * * * * * * * * *
c (0,0,1) * * * * * * * * * * * * * * * * * * * *
c (0,0,2) * * * * * * * * * * * * * * * * * * * *
c ... ...
c (4,4,3) * * * * * * * * * * * * * * * * * * * *
c (4,4,4) * * * * * * * * * * * * * * * * * * * *
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
subroutine read_profile
implicit integer(i-z)
common/ehbc/envir(0:15,0:15,0:15,0:19,4),en1
common/one/acrit,contt,eonekd(0:19),eoinp(0:19,0:100),es2,es1
do kkk=1,4
do i=0,19
do im=0,15
do ip=0,15
do ia=0,15
envir(im,ip,ia,i,kkk)=2.0
end do
end do
end do
end do
enddo
c PROFILE3 potential =envir(#of antiparalel contacts,
c #of orthogonal, # of parallel, aminoacid's type)
c ia,im, ip - taken modulo 2, i.e. 0-1 contact, 2-3,...
c profile3.comm is a score table, i.e. envir(envir_class,A)
c here environment class is number of contacts on residue A.
do i=0,19 !from column
read(2,*)
do im=0,8
do ia=0,8
read(2,*)(envir(ia,im,ip,i,3),ip=0,8) !this is used
end do
read(2,*)
end do
read(2,*)
enddo
c do i=0,19 !from column
c read(2,*)