Skip to content
Snippets Groups Projects
Commit 72b56a1a authored by Studer Gabriel's avatar Studer Gabriel
Browse files

make rigidity of stem residues optional in BackboneRelaxer

parent 318d10f8
No related branches found
No related tags found
No related merge requests found
......@@ -90,6 +90,16 @@ boost::python::list KIC_VecList(const promod3::loop::BackboneList& bb_list, cons
return return_list;
}
//wrapper for BackboneRelaxer constructor
//promod3::loop::BackboneRelaxerPtr BBRelaxerWrapper(const promod3::loop::BackboneList& bb_list,
// const ost::mol::mm::MMSettingsPtr settings,
// bool fix_nterm, bool fix_cterm){
// promod3::loop::BackboneRelaxerPtr
// p(new promod3::loop::BackboneRelaxer(bb_list,settings,
// fix_nterm,fix_cterm));
// return p;
//}
}
void export_LoopClosure(){
......@@ -107,7 +117,8 @@ void export_LoopClosure(){
def("KIC",&KIC_ResidueHandle,(arg("n_stem"),arg("c_stem"),arg("pivot_one"),arg("pivot_two"),arg("pivot_three")));
def("KIC",&KIC_VecList,(arg("n_stem_positions"),arg("c_stem_positions"),arg("pivot_one"),arg("pivot_two"),arg("pivot_three")));
class_<BackboneRelaxer> ("BackboneRelaxer", init<const BackboneList&, ost::mol::mm::MMSettingsPtr>())
class_<BackboneRelaxer> ("BackboneRelaxer", init<const BackboneList&, ost::mol::mm::MMSettingsPtr,optional<bool,bool> >())
//.def("__init__",make_constructor(&BBRelaxerWrapper))
.def("Run",&BackboneRelaxer::Run,(arg("bb_list"),arg("steps")=100,arg("stop_criterion")=0.01))
;
......
......
......@@ -8,7 +8,8 @@ namespace promod3 { namespace loop {
BackboneRelaxer::BackboneRelaxer(const BackboneList& bb_list,
ost::mol::mm::MMSettingsPtr settings){
ost::mol::mm::MMSettingsPtr settings,
bool fix_nterm, bool fix_cterm){
if(bb_list.size() < 2){
throw promod3::Error("bb_list must be at least of length 2 for BackboneRelaxer!");
......@@ -23,7 +24,8 @@ BackboneRelaxer::BackboneRelaxer(const BackboneList& bb_list,
}
ost::mol::mm::TopologyPtr top = CreateBBListTop(bb_list,settings->forcefield);
ost::mol::mm::TopologyPtr top = CreateBBListTop(bb_list,settings->forcefield,
fix_nterm, fix_cterm);
positions_.resize(top->GetNumParticles());
......@@ -154,7 +156,8 @@ void BackboneRelaxer::ExtractSimulationPositions(BackboneList& bb_list){
ost::mol::mm::TopologyPtr BackboneRelaxer::CreateBBListTop(const BackboneList& bb_list,
ost::mol::mm::ForcefieldPtr ff){
ost::mol::mm::ForcefieldPtr ff,
bool fix_nterm, bool fix_cterm){
std::vector<String> atom_types;
std::vector<Real> masses;
......@@ -223,16 +226,20 @@ ost::mol::mm::TopologyPtr BackboneRelaxer::CreateBBListTop(const BackboneList& b
charges.push_back(0.0); //let's neglect electrostatic interactions
}
if(fix_nterm){
//set nterm rigid but let the c and o atoms move...
masses[0] = 0.0;
masses[1] = 0.0;
if(bb_list[0].aa != ost::conop::GLY) masses[2] = 0.0;
}
if(fix_cterm){
//set cterm rigid but let the n atom move
masses[masses.size()-1] = 0.0;
masses[masses.size()-2] = 0.0;
masses[masses.size()-3] = 0.0;
if(bb_list.back().aa != ost::conop::GLY) masses[masses.size()-4] = 0.0;
}
//initialize mm-topology
ost::mol::mm::TopologyPtr top(new ost::mol::mm::Topology(masses));
......
......
......@@ -16,7 +16,8 @@ struct BackboneRelaxer;
typedef boost::shared_ptr<BackboneRelaxer> BackboneRelaxerPtr;
struct BackboneRelaxer {
BackboneRelaxer(const BackboneList& bb, ost::mol::mm::MMSettingsPtr settings);
BackboneRelaxer(const BackboneList& bb, ost::mol::mm::MMSettingsPtr settings,
bool fix_nterm = true, bool fix_c_term = true);
Real Run(BackboneList& bb_list, int steps = 100, Real stop_criterion = 0.01);
private:
......@@ -30,7 +31,8 @@ private:
void ExtractSimulationPositions(BackboneList& bb_list);
ost::mol::mm::TopologyPtr CreateBBListTop(const BackboneList& bb_list,
ost::mol::mm::ForcefieldPtr ff);
ost::mol::mm::ForcefieldPtr ff,
bool fix_nterm, bool fix_cterm);
std::vector<ost::conop::AminoAcid> s_;
ost::mol::mm::SimulationPtr simulation_;
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment