7 #if defined(_MSC_VER) && (_MSC_VER >= 1400) 9 #pragma warning(disable:4244) 16 #include <boost/bind.hpp> 17 #include <boost/noncopyable.hpp> 20 #include "EnergyNucleo.h" 30 struct ConnectPair :
public std::pair<Chain::const_iterator, Chain::const_iterator> {
34 :
std::pair<
Chain::const_iterator,
Chain::const_iterator>(f,s) {}
38 if(first != pair.first)
39 return first < pair.first;
40 return pair.second < second;
46 os <<
'(' << p.first - p.first.getChain().begin()
47 <<
',' << p.second - p.second.getChain().begin() <<
')';
71 foldings_ = s.foldings_;
79 void append(
const SecStruct& s) { foldings_.insert(s.foldings_.begin(), s.foldings_.end() ); }
88 int size()
const {
return static_cast<int>( foldings_.size() ); }
108 struct EnergyFunctor {
109 EnergyFunctor(
const EnergyNucleo& energy_matrix) : energy_(energy_matrix) {}
111 return sum + energy_.getEnergy( *(p.first), *(p.second) );
116 EnergyFunctor& operator=(
const EnergyFunctor&);
121 EnergyFunctor functor(energy_matrix);
122 return std::accumulate( foldings_.begin(), foldings_.end(), 0, functor );
127 std::copy(sec_struct.foldings_.begin(), sec_struct.foldings_.end(), std::ostream_iterator<ConnectPair>(os,
"") );
The pair of nucleotides which are join by Watson-Crick interaction.
Definition: SecStruct.h:30
int EnergyValue
Definition: EnergyNucleo.h:15
The DNA strand (single).
Definition: Chain.h:25
std::set< SecStruct > SecStructures
Definition: SecStruct.h:104
bool operator<(const ConnectPair &pair) const
Definition: SecStruct.h:37
the maps between pair of nucleotides and its energy
Definition: EnergyNucleo.h:37
SecStruct()
Definition: SecStruct.h:61
void append(const SecStruct &s)
Definition: SecStruct.h:79
SecStruct & operator=(const SecStruct &s)
Definition: SecStruct.h:70
bool operator<(const SecStruct &s) const
Definition: SecStruct.h:85
void addPair(const ConnectPair &p)
Definition: SecStruct.h:76
std::ostream & operator<<(std::ostream &os, const Chain &chain)
Definition: Chain.h:162
int size() const
Definition: SecStruct.h:88
std::set< ConnectPair > Foldings
Definition: SecStruct.h:58
~SecStruct()
Definition: SecStruct.h:67
bool operator==(const SecStruct &s) const
Definition: SecStruct.h:82
ConnectPair(const Chain::const_iterator &f, const Chain::const_iterator &s)
Definition: SecStruct.h:33
const Foldings & getFoldings() const
Definition: SecStruct.h:94
the secondary structure
Definition: SecStruct.h:55
EnergyValue energy(const EnergyNucleo &energy_matrix) const
Definition: SecStruct.h:120
SecStruct(const SecStruct &s)
Definition: SecStruct.h:64