Skip to content
Snippets Groups Projects
Commit 884e6219 authored by Marco Biasini's avatar Marco Biasini
Browse files

cosmetic changes to qa module

parent f2fc43a3
Branches
Tags
No related merge requests found
...@@ -237,7 +237,7 @@ void export_Interaction() ...@@ -237,7 +237,7 @@ void export_Interaction()
.def("SaveToFile", &InteractionStatistics::SaveToFile, args("file_name")) .def("SaveToFile", &InteractionStatistics::SaveToFile, args("file_name"))
.def("LoadFromFile", &InteractionStatistics::LoadFromFile).staticmethod("LoadFromFile") .def("LoadFromFile", &InteractionStatistics::LoadFromFile).staticmethod("LoadFromFile")
.def("RepairCbetaStatistics", &InteractionStatistics::RepairCbetaStatistics) .def("RepairCbetaStatistics", &InteractionStatistics::RepairCbetaStatistics)
.def("isCbetaStaistics", &InteractionStatistics::isCbetaStaistics) .def("IsCBetaOnly", &InteractionStatistics::IsCBetaOnly)
; ;
class_<AllAtomPotentialOpts>("AllAtomPotentialOpts", init<>()) class_<AllAtomPotentialOpts>("AllAtomPotentialOpts", init<>())
......
...@@ -153,36 +153,25 @@ AllAtomPotentialPtr AllAtomPotential::LoadFromFile(const String& filename) ...@@ -153,36 +153,25 @@ AllAtomPotentialPtr AllAtomPotential::LoadFromFile(const String& filename)
return all_atom_p; return all_atom_p;
} }
float AllAtomPotential::GetTotalEnergy(mol::EntityView view,
float AllAtomPotential::GetTotalEnergy(mol::EntityView view, mol::EntityView target_view) mol::EntityView target_view)
{ {
AllAtomPotentialCalculator c(energies_, options_, target_view); AllAtomPotentialCalculator c(energies_, options_, target_view);
mol::EntityHandle e=view.GetHandle(); mol::EntityHandle e=view.GetHandle();
view.Apply(c); view.Apply(c);
interaction_counts_member_=c.GetEnergyCounts(); interaction_counts_=c.GetEnergyCounts();
return c.GetEnergy(); return c.GetEnergy();
} }
float AllAtomPotential::GetEnergy(atom::ChemType type_a, atom::ChemType type_b, float distance)
{
return energies_.Get(type_a, type_b, distance);
}
float AllAtomPotential::GetTotalEnergy(mol::EntityView view) float AllAtomPotential::GetTotalEnergy(mol::EntityView view)
{ {
AllAtomPotentialCalculator c(energies_, options_, view); AllAtomPotentialCalculator c(energies_, options_, view);
mol::EntityHandle e=view.GetHandle(); mol::EntityHandle e=view.GetHandle();
view.Apply(c); view.Apply(c);
interaction_counts_member_=c.GetEnergyCounts(); interaction_counts_=c.GetEnergyCounts();
return c.GetEnergy(); return c.GetEnergy();
} }
int AllAtomPotential::GetEnergyCounts() const {
return interaction_counts_member_;
}
void AllAtomPotential::SetSequenceSeparation(int seq_sep) { void AllAtomPotential::SetSequenceSeparation(int seq_sep) {
options_.sequence_sep=seq_sep; options_.sequence_sep=seq_sep;
} }
...@@ -258,7 +247,7 @@ void AllAtomPotential::Fill(const InteractionStatisticsPtr& stats) ...@@ -258,7 +247,7 @@ void AllAtomPotential::Fill(const InteractionStatisticsPtr& stats)
// potential is only calculated for Cbeta atoms: // potential is only calculated for Cbeta atoms:
// copy the potential for Calpha (Calphas are selected if // copy the potential for Calpha (Calphas are selected if
// Cbetas are not present) // Cbetas are not present)
if (stats->isCbetaStaistics() == true) { if (stats->IsCBetaOnly() == true) {
//check if Cbeta (has counts) and not Glycin-Calpha //check if Cbeta (has counts) and not Glycin-Calpha
if (t3 != 0) { if (t3 != 0) {
if (i==3) { if (i==3) {
......
...@@ -76,8 +76,11 @@ public: ...@@ -76,8 +76,11 @@ public:
/// \brief extract energy of a specific interaction /// \brief extract energy of a specific interaction
/// (for plotting pseudo Lennard-Jones potential). /// (for plotting pseudo Lennard-Jones potential).
float GetEnergy(atom::ChemType type_a, atom::ChemType type_b, float distance); float GetEnergy(atom::ChemType type_a, atom::ChemType type_b,
float distance)
{
return energies_.Get(type_a, type_b, distance);
}
/// \brief calculate all-atom interaction between two entities. /// \brief calculate all-atom interaction between two entities.
/// Two entities need to be provided: /// Two entities need to be provided:
/// the atoms for which the energy should be derived and /// the atoms for which the energy should be derived and
...@@ -85,7 +88,7 @@ public: ...@@ -85,7 +88,7 @@ public:
float GetTotalEnergy(mol::EntityView view, mol::EntityView target_view); float GetTotalEnergy(mol::EntityView view, mol::EntityView target_view);
/// \brief retrieve total number of interactions (for normalisation) /// \brief retrieve total number of interactions (for normalisation)
int GetEnergyCounts() const; int GetEnergyCounts() const { return interaction_counts_; }
/// \brief set different seqeunce separation than used for training /// \brief set different seqeunce separation than used for training
void SetSequenceSeparation(int seq_sep); void SetSequenceSeparation(int seq_sep);
...@@ -102,7 +105,7 @@ private: ...@@ -102,7 +105,7 @@ private:
AllAtomPotentialOpts options_; AllAtomPotentialOpts options_;
AllAtomEnergies energies_; AllAtomEnergies energies_;
mol::EntityView target_view_; mol::EntityView target_view_;
int interaction_counts_member_; int interaction_counts_;
}; };
}} }}
......
...@@ -111,7 +111,7 @@ public: ...@@ -111,7 +111,7 @@ public:
virtual bool VisitResidue(const mol::ResidueHandle& r); virtual bool VisitResidue(const mol::ResidueHandle& r);
virtual bool VisitAtom(const mol::AtomHandle& a); virtual bool VisitAtom(const mol::AtomHandle& a);
inline bool isCbetaStaistics() {return isCbetaStatisticsFlag_;} inline bool IsCBetaOnly() {return isCbetaStatisticsFlag_;}
private: private:
......
...@@ -84,7 +84,7 @@ public: ...@@ -84,7 +84,7 @@ public:
/// ///
/// See documentation for PackingStatistics::Extract() /// See documentation for PackingStatistics::Extract()
Real GetTotalEnergy(const mol::EntityView& view, Real GetTotalEnergy(const mol::EntityView& view,
const mol::EntityViewList& views); const mol::EntityViewList& views);
int GetEnergyCounts(); int GetEnergyCounts();
...@@ -109,7 +109,7 @@ private: ...@@ -109,7 +109,7 @@ private:
// used to calculate total energy... // used to calculate total energy...
mol::EntityView view_; mol::EntityView view_;
mol::EntityViewList views_; mol::EntityViewList views_;
Real energy_; Real energy_;
int energy_counts_; int energy_counts_;
}; };
......
...@@ -70,8 +70,8 @@ public: ...@@ -70,8 +70,8 @@ public:
Real next_phi_angle, Real next_psi_angle) const; Real next_phi_angle, Real next_psi_angle) const;
uint64_t GetCount(Real prev_phi_angle, Real prev_psi_angle, uint64_t GetCount(Real prev_phi_angle, Real prev_psi_angle,
Real central_phi_angle, Real central_psi_angle, Real central_phi_angle, Real central_psi_angle,
Real next_phi_angle, Real next_psi_angle) const; Real next_phi_angle, Real next_psi_angle) const;
uint64_t GetCount(const AminoAcidSet& central_aa) const; uint64_t GetCount(const AminoAcidSet& central_aa) const;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment