8#ifndef IMPPMI_UTILITIES_H
9#define IMPPMI_UTILITIES_H
11#include <IMP/pmi/pmi_config.h>
19#include <IMP/core/internal/dihedral_helpers.h>
21#include <boost/lexical_cast.hpp>
31 for (
int n1=0;n1<nps;n1++){
32 for (
int n2=n1+1;n2<nps;n2++){
35 if (dist<dist_cutoff){
40 rs->add_restraint(rx);
51 return core::internal::dihedral(p1,p2,p3,p4,
nullptr,
nullptr,
nullptr,
nullptr);
54inline Float get_bipartite_minimum_sphere_distance(
const IMP::core::XYZRs& m1,
55 const IMP::core::XYZRs& m2) {
57 double mindist = -1.0 ;
59 for (
unsigned int k1 = 0; k1 < m1.size(); ++k1) {
60 for (
unsigned int k2 = 0; k2 < m2.size(); ++k2) {
62 if (mindist < 0.0){mindist=dist;}
63 if (mindist > dist){mindist=dist;}
66 if (mindist < 0 ){mindist = 0;}
71inline Floats get_list_of_bipartite_minimum_sphere_distance(
const ParticlesTemps & pss) {
73 for (
unsigned int k1 = 0; k1 < pss.size()-1; ++k1) {
74 for (
unsigned int k2 = k1+1; k2 < pss.size(); ++k2) {
75 IMP::core::XYZRs xyzrs1=IMP::core::XYZRs(pss[k1]);
76 IMP::core::XYZRs xyzrs2=IMP::core::XYZRs(pss[k2]);
77 double dist = IMP::pmi::get_bipartite_minimum_sphere_distance(xyzrs1,xyzrs2);
78 mindistances.push_back(dist);
A decorator for keeping track of copies of a molecule.
Distance restraint between two particles.
A decorator for Molecules.
Select a subset of a hierarchy.
A class for storing lists of IMP items.
Decorator for a sphere-like particle.
Decorator for helping deal with a hierarchy of molecules.
Object used to hold a set of restraints.
A decorator for a particle representing an atom.
The standard decorator for manipulating molecular structures.
Score distance between two particle centers using a harmonic function.
A decorator for a particle with x,y,z coordinates.
A Score on the distance between a pair of particles.
std::string get_molecule_name(Hierarchy h)
int get_copy_index(Hierarchy h)
Walk up the hierarchy to find the current copy index.
double get_distance(const Surface &s, const XYZR &d)
Get distance from sphere to surface.
std::string get_molecule_name_and_copy(atom::Hierarchy h)
Walk up a PMI2 hierarchy/representations and get the "molname.copynum".
RestraintSet * create_elastic_network(const Particles &ps, Float dist_cutoff, Float strength)
Create an elastic network restraint set.
Vector< Pointer< Particle > > Particles
A list of reference-counted Particle objects.
double Float
Basic floating-point value (could be float, double...).
Restraint * create_restraint(Score *s, const typename Score::Argument &t, std::string name=std::string())
Array< 2, WeakPointer< Particle >, Particle * > ParticlePair
IMP::Vector< Float > Floats
Standard way to pass a bunch of Float values.
#define IMP_NEW(Typename, varname, args)
Declare a ref counted pointer to a new object.
A smart pointer to a reference counted object.