-
Notifications
You must be signed in to change notification settings - Fork 0
/
1.9.1-3__biu-2.3.7-1.patch
22254 lines (21083 loc) · 773 KB
/
1.9.1-3__biu-2.3.7-1.patch
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
From 073da516289890646a38642def958ad6b2a74e14 Mon Sep 17 00:00:00 2001
From: Victor Zhao <[email protected]>
Date: Fri, 2 Sep 2016 15:20:44 -0400
Subject: [PATCH 01/11] generate RNG seed from seqstr using sbdm hash
---
src/latFold.cc | 9 +++++----
src/latFoldVec.cc | 9 +++++----
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/src/latFold.cc b/src/latFold.cc
index 91982d5..bf3f1c0 100755
--- a/src/latFold.cc
+++ b/src/latFold.cc
@@ -594,12 +594,13 @@ int main(int argc, char** argv) {
// This design is not robust.
// See Sindhikara et al. JCTC 2009, 5
// "Bad Seeds Sprout Perilous Dynamics: Stochastic Thermostat Induced Trajectory Synchronization in Biomolecules"
- unsigned int modified_seed = (unsigned int)(kT * 100) * seed;
+ unsigned int modified_seed = 0;
for (std::string::iterator it=seqStr.begin(); it!=seqStr.end(); ++it) {
- modified_seed *= *it;
- modified_seed += *it;
+ // (sbdm hash)
+ modified_seed = it + (modified_seed << 6) + (modified_seed << 16) - modified_seed;
}
- biu::RNF::getRNG().setSeed(modified_seed);
+ modified_seed *= (unsigned int)(kT * 100)
+ biu::RNF::getRNG().setSeed(modified_seed + seed);
/*
* Building Protein related objects.
diff --git a/src/latFoldVec.cc b/src/latFoldVec.cc
index db81497..51e4ee6 100755
--- a/src/latFoldVec.cc
+++ b/src/latFoldVec.cc
@@ -597,12 +597,13 @@ int main(int argc, char** argv) {
// This design is not robust.
// See Sindhikara et al. JCTC 2009, 5
// "Bad Seeds Sprout Perilous Dynamics: Stochastic Thermostat Induced Trajectory Synchronization in Biomolecules"
- unsigned int modified_seed = (unsigned int)(kT * 100) * seed;
+ unsigned int modified_seed = 0;
for (std::string::iterator it=seqStr.begin(); it!=seqStr.end(); ++it) {
- modified_seed *= *it;
- modified_seed += *it;
+ // (sbdm hash)
+ modified_seed = it + (modified_seed << 6) + (modified_seed << 16) - modified_seed;
}
- biu::RNF::getRNG().setSeed(modified_seed);
+ modified_seed *= (unsigned int)(kT * 100)
+ biu::RNF::getRNG().setSeed(modified_seed + seed);
// output parameter setting
if (verbosity > 0) {
--
2.1.0
From af18ea3ceb3fb1696086ba8350496a962bf14384 Mon Sep 17 00:00:00 2001
From: Victor Zhao <[email protected]>
Date: Fri, 2 Sep 2016 15:33:21 -0400
Subject: [PATCH 02/11] oops forgot a semicolon
---
src/latFold.cc | 2 +-
src/latFoldVec.cc | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/latFold.cc b/src/latFold.cc
index bf3f1c0..6dfefb7 100755
--- a/src/latFold.cc
+++ b/src/latFold.cc
@@ -599,7 +599,7 @@ int main(int argc, char** argv) {
// (sbdm hash)
modified_seed = it + (modified_seed << 6) + (modified_seed << 16) - modified_seed;
}
- modified_seed *= (unsigned int)(kT * 100)
+ modified_seed *= (unsigned int)(kT * 100);
biu::RNF::getRNG().setSeed(modified_seed + seed);
/*
diff --git a/src/latFoldVec.cc b/src/latFoldVec.cc
index 51e4ee6..f336058 100755
--- a/src/latFoldVec.cc
+++ b/src/latFoldVec.cc
@@ -602,7 +602,7 @@ int main(int argc, char** argv) {
// (sbdm hash)
modified_seed = it + (modified_seed << 6) + (modified_seed << 16) - modified_seed;
}
- modified_seed *= (unsigned int)(kT * 100)
+ modified_seed *= (unsigned int)(kT * 100);
biu::RNF::getRNG().setSeed(modified_seed + seed);
// output parameter setting
--
2.1.0
From 290bafbbd215ae1ee0b9948fb82e5254e1226d34 Mon Sep 17 00:00:00 2001
From: Victor Zhao <[email protected]>
Date: Tue, 13 Sep 2016 13:25:10 -0400
Subject: [PATCH 03/11] comment [0,max] --> [0,max)
---
biu-2.3.7/src/biu/RandomNumberFactory.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/biu-2.3.7/src/biu/RandomNumberFactory.cc b/biu-2.3.7/src/biu/RandomNumberFactory.cc
index 091439b..57fccc7 100644
--- a/biu-2.3.7/src/biu/RandomNumberFactory.cc
+++ b/biu-2.3.7/src/biu/RandomNumberFactory.cc
@@ -63,7 +63,7 @@ namespace biu
unsigned int rn = getRN();
while ( rn > maxAllowedRn )
rn = getRN();
- // compute final random number within [0,max]
+ // compute final random number within [0,max)
return rn%max;
}
--
2.1.0
From 58819d4982b5a190da1fdf522ae7592f50000551 Mon Sep 17 00:00:00 2001
From: Victor Zhao <[email protected]>
Date: Mon, 9 Jan 2017 14:45:21 -0500
Subject: [PATCH 04/11] quick syntax error fix (add dereference) for hash
algorithm to give unique seed
---
src/latFold.cc | 6 +++---
src/latFoldVec.cc | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/latFold.cc b/src/latFold.cc
index 6dfefb7..2548b20 100755
--- a/src/latFold.cc
+++ b/src/latFold.cc
@@ -591,13 +591,13 @@ int main(int argc, char** argv) {
// (but different sequences and/or temperature), a modified seed is generated
// based on the user seed, as well as temperature and sequence.
// At the moment, different starting conformations will have the same seed however.
- // This design is not robust.
// See Sindhikara et al. JCTC 2009, 5
// "Bad Seeds Sprout Perilous Dynamics: Stochastic Thermostat Induced Trajectory Synchronization in Biomolecules"
+ // Robustness of multiplication and addition after hash uncertain.
unsigned int modified_seed = 0;
for (std::string::iterator it=seqStr.begin(); it!=seqStr.end(); ++it) {
- // (sbdm hash)
- modified_seed = it + (modified_seed << 6) + (modified_seed << 16) - modified_seed;
+ // (sdbm hash)
+ modified_seed = *it + (modified_seed << 6) + (modified_seed << 16) - modified_seed;
}
modified_seed *= (unsigned int)(kT * 100);
biu::RNF::getRNG().setSeed(modified_seed + seed);
diff --git a/src/latFoldVec.cc b/src/latFoldVec.cc
index f336058..32557f3 100755
--- a/src/latFoldVec.cc
+++ b/src/latFoldVec.cc
@@ -594,13 +594,13 @@ int main(int argc, char** argv) {
// To avoid using the same RN sequence for all simulations with the same user seed
// (but different sequences and/or temperature), a modified seed is generated
// based on the user seed, as well as temperature and sequence.
- // This design is not robust.
// See Sindhikara et al. JCTC 2009, 5
// "Bad Seeds Sprout Perilous Dynamics: Stochastic Thermostat Induced Trajectory Synchronization in Biomolecules"
+ // Robustness of multiplication and addition after hash uncertain.
unsigned int modified_seed = 0;
for (std::string::iterator it=seqStr.begin(); it!=seqStr.end(); ++it) {
- // (sbdm hash)
- modified_seed = it + (modified_seed << 6) + (modified_seed << 16) - modified_seed;
+ // (sdbm hash)
+ modified_seed = *it + (modified_seed << 6) + (modified_seed << 16) - modified_seed;
}
modified_seed *= (unsigned int)(kT * 100);
biu::RNF::getRNG().setSeed(modified_seed + seed);
--
2.1.0
From 4d52a6b12f04b78149ad9918777011848c06c3c8 Mon Sep 17 00:00:00 2001
From: Victor Zhao <[email protected]>
Date: Mon, 9 Jan 2017 14:52:15 -0500
Subject: [PATCH 05/11] added english translation for gitterbasis in a comment
---
biu-2.3.7/src/biu/LatticeDescriptorCUB.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/biu-2.3.7/src/biu/LatticeDescriptorCUB.cc b/biu-2.3.7/src/biu/LatticeDescriptorCUB.cc
index 1578386..5602171 100755
--- a/biu-2.3.7/src/biu/LatticeDescriptorCUB.cc
+++ b/biu-2.3.7/src/biu/LatticeDescriptorCUB.cc
@@ -11,7 +11,7 @@ namespace biu
: LatticeDescriptor("cub")
{
- // gitterbasis
+ // gitterbasis (lattice base)
latBase.push_back(IntPoint(1,0,0)); // x
latBase.push_back(IntPoint(0,1,0)); // y
latBase.push_back(IntPoint(0,0,1)); // z
--
2.1.0
From 217251fd4e4eb3b35ab5ef77f54d23e408589528 Mon Sep 17 00:00:00 2001
From: Victor Zhao <[email protected]>
Date: Fri, 20 Jan 2017 14:16:09 -0500
Subject: [PATCH 06/11] added eng. translation
---
biu-2.3.7/src/biu/LatticeModel.hh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/biu-2.3.7/src/biu/LatticeModel.hh b/biu-2.3.7/src/biu/LatticeModel.hh
index c367406..ef66a08 100755
--- a/biu-2.3.7/src/biu/LatticeModel.hh
+++ b/biu-2.3.7/src/biu/LatticeModel.hh
@@ -106,7 +106,7 @@ namespace biu
virtual std::string getString( const MoveSequence& moveSeq ) const;
//////////////////////////////////////////////////////
- // nachbarschaft im gitter
+ // nachbarschaft im gitter (neighborhood in the grid)
//////////////////////////////////////////////////////
//! Calculates all neighbored points to the given center based
--
2.1.0
From fb7e564ba30fd99eb4acee7c9e25e4b4f21f7558 Mon Sep 17 00:00:00 2001
From: Victor Zhao <[email protected]>
Date: Fri, 20 Jan 2017 14:16:53 -0500
Subject: [PATCH 07/11] ribosome feature added to latticeprotein code
---
biu-2.3.7/src/biu/LatticeProtein.hh | 6 ++++
biu-2.3.7/src/biu/LatticeProtein_Ipnt.cc | 51 ++++++++++++++++++++++++++++----
biu-2.3.7/src/biu/LatticeProtein_Ipnt.hh | 21 +++++++++++--
3 files changed, 70 insertions(+), 8 deletions(-)
diff --git a/biu-2.3.7/src/biu/LatticeProtein.hh b/biu-2.3.7/src/biu/LatticeProtein.hh
index c211dad..a7117e8 100755
--- a/biu-2.3.7/src/biu/LatticeProtein.hh
+++ b/biu-2.3.7/src/biu/LatticeProtein.hh
@@ -68,6 +68,12 @@ namespace biu
//! are neighbored in the lattice.
virtual bool isConnected() const = 0;
+ //! Reports whether the structure is anchored at one end to a wall
+ virtual bool isRibosomeBound() const = 0;
+
+ //! Tests whether or not the structure obeys ribosome criterion
+ virtual bool isRibosomeValid() const = 0;
+
//! Returns the lattice model this lattice protein is basing on
virtual const LatticeModel* getLatticeModel() const = 0;
diff --git a/biu-2.3.7/src/biu/LatticeProtein_Ipnt.cc b/biu-2.3.7/src/biu/LatticeProtein_Ipnt.cc
index 790ed6e..97218bb 100755
--- a/biu-2.3.7/src/biu/LatticeProtein_Ipnt.cc
+++ b/biu-2.3.7/src/biu/LatticeProtein_Ipnt.cc
@@ -3,7 +3,7 @@
#include "biu/LatticeProtein_Ipnt.hh"
#include <limits.h>
-
+#include <algorithm>
namespace biu
{
@@ -18,12 +18,14 @@ namespace biu
const Sequence* seq,
const bool seqShared,
const std::string& moveString,
- const bool isAbsoluteMove)
+ const bool isAbsoluteMove,
+ const bool isRibosomeBound)
: LatticeProtein_I(lattice, energyFunc, seq, seqShared),
points( new IPointVec() ),
energy(NAN_DOUBLE),
selfavoiding(MyNaN),
- connected(MyNaN)
+ connected(MyNaN),
+ ribosomeBound(isRibosomeBound)
{
if (isAbsoluteMove) {
*points = lattice->absMovesToPoints(
@@ -62,8 +64,14 @@ namespace biu
energy = l2->energy;
selfavoiding = l2->selfavoiding;
connected = l2->connected;
+ // copy ribosomeBound property
+ ribosomeBound = l2->ribosomeBound;
} else { // via copied objects
*points = latPr.getPoints();
+ ribosomeBound = latPr.isRibosomeBound(); // added by VZ
+ // but is it ok to call this pure virtual function?
+ // note, latPr.getPoints() is also pure virtual function...
+ // maybe within this else clause has never been tested?
// inform the object that the structure has changed
updateProperties();
}
@@ -74,7 +82,8 @@ namespace biu
points( new IPointVec(latPr.points->size())),
energy(latPr.energy),
selfavoiding(latPr.selfavoiding),
- connected(latPr.connected)
+ connected(latPr.connected),
+ ribosomeBound(latPr.ribosomeBound)
{
assertbiu (lattice != NULL && energyFunc != NULL,
"no lattice model or energy function available");
@@ -379,7 +388,39 @@ namespace biu
connected = MyTrue;
return true;
}
-
+
+ //! Reports on whether this is a ribosome bound structure
+ bool
+ LatticeProtein_Ipnt::isRibosomeBound() const {
+ return ribosomeBound;
+ }
+
+ //! Tests the ribosome criterion
+ //! If the last residue of the structure can be placed next to a plane
+ //! such that no residues in the structure breaches that plane, then the structure
+ //! is ribosome valid
+ bool
+ LatticeProtein_Ipnt::isRibosomeValid() const {
+ assertbiu(points != NULL, "no structure available");
+ // do the check
+ IntPoint anchorPoint = points->back();
+ int max_x=anchorPoint.getX(), min_x=anchorPoint.getX();
+ int max_y=anchorPoint.getY(), min_y=anchorPoint.getY();
+ int max_z=anchorPoint.getZ(), min_z=anchorPoint.getZ();
+ if (points->size() < 2)
+ return true;
+ for (biu::IPointVec::iterator it = points->begin(); it != points->end()-1; ++it) {
+ max_x = std::max(it->getX(), max_x);
+ min_x = std::min(it->getX(), min_x);
+ max_y = std::max(it->getY(), max_y);
+ min_y = std::min(it->getY(), min_y);
+ max_z = std::max(it->getZ(), max_z);
+ min_z = std::min(it->getZ(), min_z);
+ }
+ return max_x <= anchorPoint.getX() || min_x >= anchorPoint.getX() ||
+ max_y <= anchorPoint.getY() || min_y >= anchorPoint.getY() ||
+ max_z <= anchorPoint.getZ() || min_z >= anchorPoint.getZ();
+ }
// additional functions (LatticeProtein_Ipnt)
diff --git a/biu-2.3.7/src/biu/LatticeProtein_Ipnt.hh b/biu-2.3.7/src/biu/LatticeProtein_Ipnt.hh
index 2ffe7d6..b1cd811 100755
--- a/biu-2.3.7/src/biu/LatticeProtein_Ipnt.hh
+++ b/biu-2.3.7/src/biu/LatticeProtein_Ipnt.hh
@@ -28,7 +28,7 @@ namespace biu
//! the structure in 3D coordinates
- IPointVec* points;
+ IPointVec* points;
//! the energy of this structure that is calculated lazily on demand
mutable double energy;
@@ -39,6 +39,9 @@ namespace biu
//! lazy calculated connectedness
mutable MyBool connected;
+ //! whether the last residue is anchored to a wall
+ bool ribosomeBound;
+
public:
@@ -60,20 +63,26 @@ namespace biu
* @param isAbsoluteMove true if moveString is an absolute move
* string or false if it is a relative
* move string
+ * @param isRibosomeBound true if last residue should be anchored to a wall
+ * added by VZ to this class
+ * default false saves changes to existing code
*/
LatticeProtein_Ipnt(const LatticeModel* lattice,
const DistanceEnergyFunction* energy,
const Sequence* seq,
const bool seqShared,
const std::string& moveString,
- const bool isAbsoluteMove);
+ const bool isAbsoluteMove,
+ const bool isRibosomeBound = false);
LatticeProtein_I* clone() const;
LatticeProtein_I* fromString(const std::string& stringRep) const;
// copy constructors
-
+
+ // VZ: property of RibosomeBound is inherited unless downcasting fails
LatticeProtein_Ipnt(const LatticeProtein& latProt);
+ // VZ: property of RibosomeBound is inherited
LatticeProtein_Ipnt(const LatticeProtein_Ipnt& latProt);
/*! Destruction of the lattice protein object.
@@ -145,6 +154,12 @@ namespace biu
//! are neighbored in the lattice.
virtual bool isConnected() const;
+ //! Tests whether or not the structure is bound to a "ribosome" (wall)
+ virtual bool isRibosomeBound() const;
+
+ //! Tests whether or not the structure obeys ribosome criterion
+ virtual bool isRibosomeValid() const;
+
virtual LatticeProtein_Ipnt& operator= (const LatticeProtein_Ipnt& latProt2);
virtual LatticeProtein_I& operator= (const LatticeProtein_I& latProt2);
virtual bool operator== (const LatticeProtein& latProt2) const;
--
2.1.0
From 0ab7182ae5a42f22defeededdfae3a145ab0a772 Mon Sep 17 00:00:00 2001
From: Victor Zhao <[email protected]>
Date: Fri, 20 Jan 2017 14:17:13 -0500
Subject: [PATCH 08/11] correction to pull moveset
---
biu-2.3.7/src/biu/PullMoveSet.cc | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/biu-2.3.7/src/biu/PullMoveSet.cc b/biu-2.3.7/src/biu/PullMoveSet.cc
index 8cb2089..f57284e 100755
--- a/biu-2.3.7/src/biu/PullMoveSet.cc
+++ b/biu-2.3.7/src/biu/PullMoveSet.cc
@@ -533,6 +533,12 @@ namespace biu
return NULL;
}
+ // VZ: And move must not produce a hook conformation
+ // see "'Pull moves' for rectangular lattice polymer models are not fully reversible" by Gyorffy et al. 2012.
+ // hook conformation results if second pullpoint and the second to last prot residue are neighbored
+ if (lattice->areNeighbored( pullPoints.second, todoPoints->at(relPos-1) ))
+ return NULL;
+
// save undo information
undoRec.hasChanged = true;
undoRec.lastChangedObject = todo;
--
2.1.0
From 3859383adbee78639e019384ac4290c5053c50cf Mon Sep 17 00:00:00 2001
From: Victor Zhao <[email protected]>
Date: Fri, 20 Jan 2017 14:18:49 -0500
Subject: [PATCH 09/11] added ribosome option to latfold{,vec} programs, count
total steps in latfoldvec
---
src/latFold.cc | 28 +++++++++++++++++++++++++---
src/latFoldVec.cc | 21 +++++++++++++++++----
2 files changed, 42 insertions(+), 7 deletions(-)
diff --git a/src/latFold.cc b/src/latFold.cc
index 2548b20..c7f035d 100755
--- a/src/latFold.cc
+++ b/src/latFold.cc
@@ -116,6 +116,8 @@ static const std::string helpInfo =
"display program parameters and help";
static const std::string moveSetInfo =
"which move set to use: PullM or PivotM";
+static const std::string ribosomeInfo =
+ "simulate with a non-interacting wall that acts as a barrier and anchors the last residue. 3D-only";
int main(int argc, char** argv) {
@@ -211,6 +213,12 @@ int main(int argc, char** argv) {
biu::COption::STRING,
moveSetInfo,
DEFAULT_MOVES));
+
+ options.push_back(biu::COption(
+ "ribosome",
+ optional,
+ biu::COption::BOOL,
+ ribosomeInfo));
options.push_back(biu::COption(
"out",
@@ -286,6 +294,7 @@ int main(int argc, char** argv) {
unsigned int outFreq;
std::ostream* outstream = &std::cout;
ell::SC_MinE* sc;
+ bool ribosome;
bool timing;
int verbosity;
OUT_MODE simOutMode = OUT_NO;
@@ -518,6 +527,9 @@ int main(int argc, char** argv) {
return PARSE_ERROR;
}
}
+
+ // ribosome options
+ ribosome = parser.argExist("ribosome");
// check for simulation output mode
switch (parser.getCharVal("out")) {
@@ -610,7 +622,7 @@ int main(int argc, char** argv) {
biu::Sequence seq = alph->getSequence(seqStr);
biu::LatticeProtein_I* latProt = new biu::LatticeProtein_Ipnt
(lattice,energy,&seq,seqShared,absMoveStr,
- isAbsMove);
+ isAbsMove,ribosome);
if (!latProt->isSelfAvoiding())
{
@@ -621,6 +633,15 @@ int main(int argc, char** argv) {
return DATA_ERROR;
}
+ if (ribosome && !latProt->isRibosomeValid())
+ {
+ std::cerr << "Error: cannot anchor move sequence \'"
+ << absMoveStr << "\'"
+ << " to a wall. Not ribosome valid"
+ << std::endl;
+ return DATA_ERROR;
+ }
+
/*
* Building State related objects
*/
@@ -659,6 +680,7 @@ int main(int argc, char** argv) {
<< "\n - Sequence : " << seqStr
<< "\n - Abs. moves : " << absMoveStr
<< "\n - Move set : " << moves
+ << "\n - Ribosome? : " << (ribosome ? "tethered" : "untethered")
<< "\n - Simulations : " << runs
<< "\n - Seed (rand) : " << seed
<< "\n - kT (MC) : " << kT
@@ -691,10 +713,10 @@ int main(int argc, char** argv) {
switch(simOutMode)
{
case OUT_ES:
- sc = new SC_OutAbs(*simOut, absMoveStr.length(), outFreq);
+ sc = new SC_OutAbs(*simOut, absMoveStr.length(), outFreq, 0);
break;
case OUT_E:
- sc = new SC_OutEnergy(*simOut, outFreq);
+ sc = new SC_OutEnergy(*simOut, outFreq, 0);
break;
case OUT_NO:
sc = new SC_MinE();
diff --git a/src/latFoldVec.cc b/src/latFoldVec.cc
index 32557f3..621ad2c 100755
--- a/src/latFoldVec.cc
+++ b/src/latFoldVec.cc
@@ -214,6 +214,8 @@ static const std::string helpInfo =
"display program parameters and help";
static const std::string moveSetInfo =
"which move set to use: PullM or PivotM";
+static const std::string ribosomeInfo =
+ "simulate with a non-interacting wall that acts as a barrier and anchors the last residue. 3D-only";
int main(int argc, char** argv) {
@@ -278,6 +280,9 @@ int main(int argc, char** argv) {
"moveSet", optional, biu::COption::STRING, moveSetInfo, DEFAULT_MOVES));
options.push_back(biu::COption(
+ "ribosome", optional, biu::COption::BOOL, ribosomeInfo));
+
+ options.push_back(biu::COption(
"out", optional, biu::COption::CHAR,
"output mode along the folding simulation: (N)o, (E)nergy, (S)tructure+Energy",
"N"));
@@ -326,6 +331,7 @@ int main(int argc, char** argv) {
unsigned int outFreq;
std::ostream* outstream = &std::cout;
ell::SC_MinE* sc;
+ bool ribosome;
bool timing;
size_t verbosity;
OUT_MODE simOutMode = OUT_NO;
@@ -522,6 +528,9 @@ int main(int argc, char** argv) {
return PARSE_ERROR;
}
}
+
+ // ribosome options
+ ribosome = parser.argExist("ribosome");
// check for simulation output mode
switch (parser.getCharVal("out")) {
@@ -679,6 +688,9 @@ int main(int argc, char** argv) {
// hold the current chain length
// size_t curLength = 2;
size_t curLength = 3;
+
+ // track total number of steps in simulation
+ size_t totalSteps = 0;
// initialize with a ONE move
@@ -786,7 +798,7 @@ int main(int argc, char** argv) {
bool isAbsMove = true;
// create lattice protein instance
biu::LatticeProtein_Ipnt
- latProt(lattice,energy,&seq,seqShared,absMoveStr,isAbsMove);
+ latProt(lattice,energy,&seq,seqShared,absMoveStr,isAbsMove,ribosome);
curEnergy = latProt.getEnergy();
break;
@@ -910,7 +922,7 @@ int main(int argc, char** argv) {
bool isAbsMove = true;
// create lattice protein instance
biu::LatticeProtein_Ipnt
- latProt(lattice,energy,&seq,seqShared,absMoveStr,isAbsMove);
+ latProt(lattice,energy,&seq,seqShared,absMoveStr,isAbsMove,ribosome);
// update energy
curEnergy = latProt.getEnergy();
@@ -954,10 +966,10 @@ int main(int argc, char** argv) {
switch(simOutMode)
{
case OUT_ES:
- sc = new SC_OutAbs(*simOut, absMoveStr.length(), outFreq);
+ sc = new SC_OutAbs(*simOut, absMoveStr.length(), outFreq, totalSteps);
break;
case OUT_E:
- sc = new SC_OutEnergy(*simOut, outFreq);
+ sc = new SC_OutEnergy(*simOut, outFreq, totalSteps);
break;
case OUT_NO:
sc = new SC_MinE();
@@ -980,6 +992,7 @@ int main(int argc, char** argv) {
// update
curEnergy = sc->getLastAdded()->getEnergy();
absMoveStr = sc->getLastAdded()->toString();
+ totalSteps += sc->size();
if (absMoveStr.find("(") != std::string::npos) {
absMoveStr = absMoveStr.substr(0,absMoveStr.find("("));
}
--
2.1.0
From 8d6302537f5fbaf4675e3f676258bdfa229a5f79 Mon Sep 17 00:00:00 2001
From: Victor Zhao <[email protected]>
Date: Fri, 20 Jan 2017 14:19:43 -0500
Subject: [PATCH 10/11] better output formatting, tracking of step number
---
src/SC_MinE.cc | 5 +++++
src/SC_MinE.hh | 1 +
src/SC_OutAbs.cc | 26 +++++++++++++++++++++++---
src/SC_OutAbs.hh | 4 +++-
src/SC_OutEnergy.cc | 14 +++++++++++---
src/SC_OutEnergy.hh | 3 ++-
6 files changed, 45 insertions(+), 8 deletions(-)
diff --git a/src/SC_MinE.cc b/src/SC_MinE.cc
index fdc1170..37335d4 100755
--- a/src/SC_MinE.cc
+++ b/src/SC_MinE.cc
@@ -11,6 +11,11 @@ namespace ell
{
}
+ SC_MinE::SC_MinE(size_t previousCount)
+ : SC_Counting(previousCount), minE((double)INT_MAX)
+ {
+ }
+
SC_MinE::~SC_MinE()
{
}
diff --git a/src/SC_MinE.hh b/src/SC_MinE.hh
index 26c95a1..7f70380 100755
--- a/src/SC_MinE.hh
+++ b/src/SC_MinE.hh
@@ -20,6 +20,7 @@ namespace ell
public:
SC_MinE();
+ SC_MinE(size_t previousCount);
virtual ~SC_MinE();
diff --git a/src/SC_OutAbs.cc b/src/SC_OutAbs.cc
index fc1c493..b61c9bf 100755
--- a/src/SC_OutAbs.cc
+++ b/src/SC_OutAbs.cc
@@ -1,12 +1,22 @@
#include "SC_OutAbs.hh"
#include <biu/assertbiu.hh>
+#include <iomanip>
+
+#include <biu/Point.hh> // added
+#include <biu/LatticeProtein_I.hh> // added
+#include <ell/protein/S_LP.hh> // added
namespace ell
{
- SC_OutAbs::SC_OutAbs( std::ostream& out_, size_t cutoff_, size_t outFreq_)
- : SC_MinE(), out(out_), cutoff(cutoff_), outFreq(outFreq_)
+ SC_OutAbs::SC_OutAbs( std::ostream& out_, size_t cutoff_)
+ : SC_MinE(), out(out_), cutoff(cutoff_), outFreq(1)
+ {
+ }
+
+ SC_OutAbs::SC_OutAbs( std::ostream& out_, size_t cutoff_, size_t outFreq_, size_t previousCount)
+ : SC_MinE(previousCount), out(out_), cutoff(cutoff_), outFreq(outFreq_)
{
}
@@ -28,7 +38,17 @@ namespace ell
// extract structure information
std::string abs = s.toString();
abs = abs.substr(0, cutoff);
- out << s.getEnergy() << " " << abs << std::endl;
+ out << std::setw(10) << totalCount - 1 << " "
+ << std::setw(6) << s.getEnergy() << " "
+ << abs << std::endl;
+ // below is added for debugging
+ // const S_LP* slp = dynamic_cast<const S_LP*>(&s);
+ // biu::LatticeProtein_I* latProt = slp->getProtein();
+ // biu::IPointVec points = latProt->getPoints();
+ // for (biu::IPointVec::iterator it = points.begin(); it!= points.end(); ++it) {
+ // out << *it << std::endl;
+ // }
+
}
}
diff --git a/src/SC_OutAbs.hh b/src/SC_OutAbs.hh
index f3f7ff9..6779e26 100755
--- a/src/SC_OutAbs.hh
+++ b/src/SC_OutAbs.hh
@@ -5,6 +5,7 @@
#include <string>
#include "SC_MinE.hh"
+#include <ell/protein/S_LP.hh> // added
namespace ell
{
@@ -24,7 +25,8 @@ namespace ell
public:
- SC_OutAbs( std::ostream& out, size_t cutoff, size_t outFreq = 1);
+ SC_OutAbs( std::ostream& out, size_t cutoff);
+ SC_OutAbs( std::ostream& out, size_t cutoff, size_t outFreq, size_t previousCount);
virtual ~SC_OutAbs();
diff --git a/src/SC_OutEnergy.cc b/src/SC_OutEnergy.cc
index 6947a18..1481f5f 100755
--- a/src/SC_OutEnergy.cc
+++ b/src/SC_OutEnergy.cc
@@ -1,10 +1,17 @@
#include "SC_OutEnergy.hh"
+#include <iomanip>
+
namespace ell
{
- SC_OutEnergy::SC_OutEnergy( std::ostream& out_, const size_t outFreq_)
- : SC_MinE(), out(out_), outFreq(outFreq_)
+ SC_OutEnergy::SC_OutEnergy( std::ostream& out_)
+ : SC_MinE(), out(out_), outFreq(1)
+ {
+ }
+
+ SC_OutEnergy::SC_OutEnergy( std::ostream& out_, size_t outFreq_, size_t previousCount)
+ : SC_MinE(previousCount), out(out_), outFreq(outFreq_)
{
}
@@ -22,7 +29,8 @@ namespace ell
// print to stream
// stateCount starts at 1 (original structure)
if ( !((stateCount-1) % outFreq) )
- out << s.getEnergy() << std::endl;
+ out << std::setw(10) << totalCount - 1 << " "
+ << std::setw(6) << s.getEnergy() << std::endl;
}
}
diff --git a/src/SC_OutEnergy.hh b/src/SC_OutEnergy.hh
index 90d8fd9..eb0473e 100755
--- a/src/SC_OutEnergy.hh
+++ b/src/SC_OutEnergy.hh
@@ -23,7 +23,8 @@ namespace ell
public:
- SC_OutEnergy( std::ostream& out, size_t outFreq = 1);
+ SC_OutEnergy( std::ostream& out);
+ SC_OutEnergy( std::ostream& out, size_t outFreq, size_t previousCount);
virtual ~SC_OutEnergy();
--
2.1.0
From c331462c109423462a9fc74ee7498d19d80830c9 Mon Sep 17 00:00:00 2001
From: Victor Zhao <[email protected]>
Date: Fri, 20 Jan 2017 14:53:18 -0500
Subject: [PATCH 11/11] VERSION NO: latpack 1.9.1-3, biu 2.3.7-1. autotools
files updated too
---
Makefile.in | 383 +--
aclocal.m4 | 890 +++---
biu-2.3.7/Makefile.in | 385 +--
biu-2.3.7/aclocal.m4 | 725 ++---
biu-2.3.7/configure | 5295 ++++++++++++++++++++----------------
biu-2.3.7/configure.ac | 4 +-
biu-2.3.7/misc/Makefile.in | 286 +-
biu-2.3.7/misc/doxygen/Makefile.in | 114 +-
biu-2.3.7/src/Makefile.in | 452 ++-
biu-2.3.7/tests/Makefile.in | 113 +-
configure | 3990 +++++++++++++++------------
configure.ac | 4 +-
doc/Makefile.in | 116 +-
energy/Makefile.in | 136 +-
src/Makefile.in | 276 +-
15 files changed, 6608 insertions(+), 6561 deletions(-)
diff --git a/Makefile.in b/Makefile.in
index a9433a6..9e01a9e 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -24,51 +25,6 @@
#SUBDIRS = src doc energy
#endif
VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
- case $${target_option-} in \
- ?) ;; \
- *) echo "am__make_running_with_option: internal error: invalid" \
- "target option '$${target_option-}' specified" >&2; \
- exit 1;; \
- esac; \
- has_opt=no; \
- sane_makeflags=$$MAKEFLAGS; \
- if $(am__is_gnu_make); then \
- sane_makeflags=$$MFLAGS; \
- else \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- bs=\\; \
- sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
- | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
- esac; \
- fi; \
- skip_next=no; \
- strip_trailopt () \
- { \
- flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
- }; \
- for flg in $$sane_makeflags; do \
- test $$skip_next = yes && { skip_next=no; continue; }; \
- case $$flg in \
- *=*|--*) continue;; \
- -*I) strip_trailopt 'I'; skip_next=yes;; \
- -*I?*) strip_trailopt 'I';; \
- -*O) strip_trailopt 'O'; skip_next=yes;; \
- -*O?*) strip_trailopt 'O';; \
- -*l) strip_trailopt 'l'; skip_next=yes;; \
- -*l?*) strip_trailopt 'l';; \
- -[dEDm]) skip_next=yes;; \
- -[JT]) skip_next=yes;; \
- esac; \
- case $$flg in \
- *$$target_option*) has_opt=yes; break;; \
- esac; \
- done; \
- test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -86,10 +42,10 @@ NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
subdir = .
-DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \
- $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/configure $(am__configure_deps) COPYING TODO \
- compile config.guess config.sub depcomp install-sh missing
+DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in $(top_srcdir)/configure AUTHORS COPYING \
+ ChangeLog INSTALL NEWS TODO compile config.guess config.sub \
+ depcomp install-sh missing
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -99,72 +55,30 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
mkinstalldirs = $(install_sh) -d
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
-AM_V_P = $(am__v_P_@AM_V@)
-am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-am__v_GEN_1 =
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 =
SOURCES =
DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
- ctags-recursive dvi-recursive html-recursive info-recursive \
- install-data-recursive install-dvi-recursive \
- install-exec-recursive install-html-recursive \
- install-info-recursive install-pdf-recursive \
- install-ps-recursive install-recursive installcheck-recursive \
- installdirs-recursive pdf-recursive ps-recursive \
- tags-recursive uninstall-recursive
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-dvi-recursive install-exec-recursive \
+ install-html-recursive install-info-recursive \
+ install-pdf-recursive install-ps-recursive install-recursive \
+ installcheck-recursive installdirs-recursive pdf-recursive \
+ ps-recursive uninstall-recursive
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
-am__recursive_targets = \
- $(RECURSIVE_TARGETS) \
- $(RECURSIVE_CLEAN_TARGETS) \
- $(am__extra_recursive_targets)
-AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
- cscope distdir dist dist-all distcheck
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-# Read a list of newline-separated strings from the standard input,
-# and print each of them once, without duplicates. Input order is
-# *not* preserved.
-am__uniquify_input = $(AWK) '\
- BEGIN { nonempty = 0; } \
- { items[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in items) print i; }; } \
-'
-# Make sure the list of sources is unique. This is necessary because,
-# e.g., the same source file might be shared among _SOURCES variables
-# for different programs/libraries.
-am__define_uniq_tagged_files = \
- list='$(am__tagged_files)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | $(am__uniquify_input)`
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+ distdir dist dist-all distcheck
ETAGS = etags
CTAGS = ctags
-CSCOPE = cscope
DIST_SUBDIRS = $(SUBDIRS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
- if test -d "$(distdir)"; then \
- find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
- && rm -rf "$(distdir)" \