-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1.9.1-1.patch
170 lines (154 loc) · 6.19 KB
/
1.9.1-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
diff --git a/biu-2.3.7/src/biu/HashMap.hh b/biu-2.3.7/src/biu/HashMap.hh
index 313e131..4f38364 100644
--- a/biu-2.3.7/src/biu/HashMap.hh
+++ b/biu-2.3.7/src/biu/HashMap.hh
@@ -3,7 +3,7 @@
#define BIU_HASHMAP_HH_
// is set to 1 if header <unordered_map> is available, 0 otherwise
-#define HAVE_UNORDERED_MAP 0
+#define HAVE_UNORDERED_MAP 1
// is set to 1 if header <tr1/unordered_map> is available, 0 otherwise
#define HAVE_TR1_UNORDERED_MAP 1
diff --git a/configure.ac b/configure.ac
index 4450929..e3d3aed 100755
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
#
AC_PREREQ(2.59)
-AC_INIT([LatPack],[1.9.1], [http://www.bioinf.uni-freiburg.de/Software/LatPack/])
+AC_INIT([LatPack],[1.9.1-1], [http://www.bioinf.uni-freiburg.de/Software/LatPack/])
AC_CONFIG_SRCDIR([src/latFit.cc])
AC_CONFIG_AUX_DIR([.])
diff --git a/src/energyFileSupport.hh b/src/energyFileSupport.hh
index 7f672fd..1bdb12e 100755
--- a/src/energyFileSupport.hh
+++ b/src/energyFileSupport.hh
@@ -5,12 +5,34 @@
#include <iostream>
#include <sstream>
+#include <cctype>
#include <limits.h>
#include <biu/Alphabet.hh>
#include <biu/DistanceEnergyFunction.hh>
+/**
+ * Initializes a distance interval based energy function from the
+ * given stream.
+ *
+ * @param alph the alphabet to fill
+ * @param energyMatrix the energy function contact table to fill
+ * @param cAlphaDistScale a factor to scale the distances of the energy file to
+ * the corresponding distances in the used lattice model
+ * @param input the input stream to read the information from
+ * @return Status of reading : 0 = ok, -1 = read error
+ */
+void
+trim_whitespace( std::string &str )
+{
+ while(std::isspace(*str.begin()))
+ str.erase(str.begin());
+
+ while(std::isspace(*str.rbegin()))
+ str.erase(str.length()-1);
+}
+
/**
* Initializes a distance interval based energy function from the
@@ -49,6 +71,7 @@ initIntervalEnergyFunction( biu::Alphabet *& alph,
// read first line that contains alphabet info
// get first line content
getline( input, line, '\n' );
+ trim_whitespace(line);
if (line.size() == 0) {
std::cerr <<"\n ERROR : energy file : first line does not contain allowed alphabet !\n\n";
@@ -149,6 +172,7 @@ initContactEnergyFunction( biu::Alphabet *& alph,
// read first line that contains alphabet info
// get first line content
getline( input, line, '\n' );
+ trim_whitespace(line);
if (line.size() == 0) {
std::cerr <<"\n ERROR : energy file : first line does not contain allowed alphabet !\n\n";
diff --git a/src/latFold.cc b/src/latFold.cc
index e348ea1..b7b1a30 100755
--- a/src/latFold.cc
+++ b/src/latFold.cc
@@ -100,7 +100,7 @@ static const std::string seedInfo =
"seed for random number generator "
"[uses biu::RNG_ARS4x32, a counter-based generator from the Random123 library]";
static const std::string runsInfo =
- "number of folding simulations to perform; Note, for each run the random number generator initialized with 'seed'+runNumber";
+ "number of folding simulations to perform";
static const std::string latticeInfo =
"which lattice to use: CUB, SQR or FCC";
static const std::string ofileInfo =
@@ -567,7 +567,15 @@ int main(int argc, char** argv) {
biu::RandomNumberGenerator* rng = new biu::RNG_ARS4x32();
biu::RNF::setRNG( rng );
delete rng;
- biu::RNF::getRNG().setSeed(seed);
+ // 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.
+ // 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;
+ for (std::string::iterator it=seqStr.begin(); it!=seqStr.end(); ++it)
+ modified_seed *= *it;
+ biu::RNF::getRNG().setSeed(modified_seed);
/*
* Building Protein related objects.
@@ -636,8 +644,6 @@ int main(int argc, char** argv) {
*outstream <<std::endl;
}
- std::vector<size_t> foundCount(maxLength,0);
-
if (verbosity > 0) {
*outstream << "\n Folding simulations :"
<< "\n ====================="
@@ -651,8 +657,8 @@ int main(int argc, char** argv) {
globalTime.start();
for (int i=1; i<=runs; i++)
{
- // restart RNG
- biu::RNF::getRNG().setSeed(seed + i);
+ // // restart RNG
+ // biu::RNF::getRNG().setSeed(seed + i);
// build StateCollector
switch(simOutMode)
diff --git a/src/latFoldVec.cc b/src/latFoldVec.cc
index 9b638f0..68cf31b 100755
--- a/src/latFoldVec.cc
+++ b/src/latFoldVec.cc
@@ -198,7 +198,7 @@ static const std::string seedInfo =
"seed for random number generator "
"[uses biu::RNG_ARS4x32, a counter-based generator from the Random123 library]";
static const std::string runsInfo =
- "number of folding simulations to perform; Note, for each run the random number generator initialized with 'seed'+runNumber";
+ "number of folding simulations to perform";
static const std::string latticeInfo =
"which lattice to use: CUB, SQR or FCC";
static const std::string ofileInfo =
@@ -575,6 +575,14 @@ int main(int argc, char** argv) {
biu::RNF::setRNG( rng );
delete rng;
biu::RNF::getRNG().setSeed(seed);
+ // 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.
+ // 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;
+ for (std::string::iterator it=seqStr.begin(); it!=seqStr.end(); ++it)
+ modified_seed *= *it;
// output parameter setting
if (verbosity > 0) {
@@ -621,8 +629,8 @@ int main(int argc, char** argv) {
// start simulation runs
for (int doneRuns=0; doneRuns<runs; doneRuns++)
{
- // restart RNG
- biu::RNF::getRNG().setSeed(seed + doneRuns);
+ // // restart RNG
+ // biu::RNF::getRNG().setSeed(seed + doneRuns);
/////////////////// BEGIN CHAIN GROWTH ///////////////////////////