コード例 #1
0
RadiusOfGyrationRestraint::RadiusOfGyrationRestraint(kernel::Particles ps,
                                                     int num_residues,
                                                     Float scale):
    kernel::Restraint(IMP::internal::get_model(ps),
                      "RadiusOfGyrationRestraint"){
  if (ps.size()==0) return;
  add_particles(ps);
  mdl_=ps[0]->get_model();
  predicted_rog_ = get_approximated_radius_of_gyration(num_residues);
  scale_=scale;
  hub_=new core::HarmonicUpperBound(predicted_rog_*scale_,1);
}
コード例 #2
0
ファイル: simplify_restraint.cpp プロジェクト: apolitis/imp
SimpleDistance create_simple_distance(const kernel::Particles &ps)
{
  IMP_USAGE_CHECK(ps.size() == 2, "Two particles should be given");

  /****** Set the restraint ******/

  IMP_NEW(core::HarmonicUpperBound, h, (0, 1));
  IMP_NEW(core::DistanceRestraint, dr, (h, ps[0], ps[1]));

  /****** Add restraint to the model ******/

  //Model *mdl = (*ps)[0]->get_model();
  //mdl->add_restraint(dr);

  /****** Return a SimpleDistance object ******/

  return SimpleDistance(dr, h);
}
コード例 #3
0
ファイル: simplify_restraint.cpp プロジェクト: apolitis/imp
SimpleDiameter create_simple_diameter(const kernel::Particles &ps, Float diameter)
{
  IMP_USAGE_CHECK(ps.size() >= 2, "At least two particles should be given");

  /****** Set the restraint ******/

  IMP_NEW(core::HarmonicUpperBound, h, (0, 1));
  IMP_NEW(container::ListSingletonContainer, lsc, (get_as<kernel::ParticlesTemp>(ps)));
  IMP_NEW(core::DiameterRestraint, dr, (h, lsc, diameter));

  /****** Add restraint to the model ******/

  //Model *mdl = (*ps)[0]->get_model();
  //mdl->add_restraint(dr);

  /****** Return a SimpleDiameter object ******/

  return SimpleDiameter(dr, h);
}