IMP  2.0.1
The Integrative Modeling Platform
IMP::kernel Namespace Reference

See IMP.kernel Overview for more information.

Classes

class  CommandDispatcher
 Allow applications to easily implement commmands. More...
 
class  Configuration
 A class to store a configuration of a model. More...
 
class  ConfigurationSet
 A class to store a set of configurations of a model. More...
 
class  Constraint
 Implement a constraint on the Model. More...
 
class  Container
 Abstract class for containers of particles. More...
 
class  Decorator
 
class  DerivativeAccumulator
 Class for adding derivatives from restraints to the model. More...
 
struct  EvaluationState
 
struct  FloatIndex
 
class  GenericScopedRemoveRestraint
 Removes the Restraint until RAII object is destroyed. More...
 
class  GenericScopedRemoveScoreState
 Removes the ScoreState until RAII object is destroyed. More...
 
class  GenericScopedRestraint
 Removes the Restraint when the RAII object is destroyed. More...
 
class  GenericScopedScoreState
 Removes the ScoreState when the RAII object is destroyed. More...
 
class  Key
 A base class for Keys. More...
 
class  Model
 Class for storing model, its restraints, constraints, and particles. More...
 
class  ModelObject
 
class  Optimizer
 Base class for all optimizers. More...
 
class  OptimizerState
 Shared optimizer state. More...
 
class  OptionParser
 IMP-specific subclass of optparse.OptionParser. More...
 
class  PairContainer
 A shared container for Pairs. More...
 
class  PairContainerAdaptor
 
class  PairModifier
 A base class for modifiers of ParticlePairsTemp. More...
 
class  PairPredicate
 Abstract predicate function. More...
 
class  PairScore
 Abstract score function. More...
 
class  Particle
 Class to handle individual model particles. More...
 
class  PythonDirectedGraph
 
class  QuadContainer
 A shared container for Quads. More...
 
class  QuadContainerAdaptor
 
class  QuadModifier
 A base class for modifiers of ParticleQuadsTemp. More...
 
class  QuadPredicate
 Abstract predicate function. More...
 
class  QuadScore
 Abstract score function. More...
 
class  Refiner
 Abstract class to implement hierarchical methods. More...
 
class  Restraint
 A restraint is a term in an IMP ScoringFunction. More...
 
class  RestraintSet
 Object used to hold a set of restraints. More...
 
struct  RestraintStatistics
 
class  Sampler
 Base class for all samplers. More...
 
class  ScopedAddCacheAttribute
 
class  ScopedSetAttribute
 
class  ScoreAccumulator
 Class for adding up scores during ScoringFunction evaluation. More...
 
class  ScoreState
 ScoreStates maintian invariants in the Model. More...
 
class  ScoringFunction
 
class  ScoringFunctionAdaptor
 
class  SingletonContainer
 A shared container for Singletons. More...
 
class  SingletonContainerAdaptor
 
class  SingletonModifier
 A base class for modifiers of ParticlesTemp. More...
 
class  SingletonPredicate
 Abstract predicate function. More...
 
class  SingletonScore
 Abstract score function. More...
 
class  TripletContainer
 A shared container for Triplets. More...
 
class  TripletContainerAdaptor
 
class  TripletModifier
 A base class for modifiers of ParticleTripletsTemp. More...
 
class  TripletPredicate
 Abstract predicate function. More...
 
class  TripletScore
 Abstract score function. More...
 
class  UnaryFunction
 Abstract single variable functor class for score functions. More...
 
class  Undecorator
 

Typedefs

typedef IMP::base::Vector
< IMP::base::Pointer
< Configuration > > 
Configurations
 
typedef IMP::base::Vector
< IMP::base::Pointer
< ConfigurationSet > > 
ConfigurationSets
 
typedef IMP::base::Vector
< IMP::base::Pointer
< Constraint > > 
Constraints
 
typedef IMP::base::Vector
< IMP::base::Pointer
< Container > > 
Containers
 
typedef boost::graph DependencyGraph
 A directed graph on the interactions between the various objects in the model. More...
 
typedef
DependencyGraph::EdgeNameMap 
DependencyGraphConstEdgeName
 
typedef
DependencyGraph::VertexNameMap 
DependencyGraphConstVertexName
 
typedef
DependencyGraph::edge_descriptor 
DependencyGraphEdge
 
typedef boost::graph_traits
< DependencyGraph
DependencyGraphTraits
 
typedef
DependencyGraph::vertex_descriptor 
DependencyGraphVertex
 
typedef IMP::base::Vector
< DerivativeAccumulator
DerivativeAccumulators
 
typedef IMP::base::Vector
< EvaluationState
EvaluationStates
 
typedef IMP::base::Vector
< FloatIndex
FloatIndexes
 
typedef IMP::base::Vector
< IMP::base::Pointer
< ModelObject > > 
ModelObjects
 
typedef base::Vector
< ModelObjectsTemp > 
ModelObjectsTemps
 
typedef IMP::base::Vector
< IMP::base::Pointer< Model > > 
Models
 
typedef IMP::base::Vector
< IMP::base::Pointer
< Optimizer > > 
Optimizers
 
typedef IMP::base::Vector
< IMP::base::Pointer
< OptimizerState > > 
OptimizerStates
 
typedef IMP::base::Vector
< IMP::base::Pointer
< PairContainer > > 
PairContainers
 
typedef PairModifier PairDerivativeModifier
 
typedef IMP::base::Vector
< IMP::base::Pointer
< PairModifier > > 
PairModifiers
 
typedef IMP::base::Vector
< IMP::base::Pointer
< PairPredicate > > 
PairPredicates
 
typedef IMP::base::Vector
< IMP::base::Pointer
< PairScore > > 
PairScores
 
typedef base::Index
< ParticleIndexTag > 
ParticleIndex
 
typedef base::Vector
< ParticleIndex
ParticleIndexes
 
typedef base::Array
< 2, ParticleIndex
ParticleIndexPair
 
typedef IMP::base::Vector
< ParticleIndexPair
ParticleIndexPairs
 
typedef base::Array
< 4, ParticleIndex
ParticleIndexQuad
 
typedef IMP::base::Vector
< ParticleIndexQuad
ParticleIndexQuads
 
typedef base::Array
< 3, ParticleIndex
ParticleIndexTriplet
 
typedef IMP::base::Vector
< ParticleIndexTriplet
ParticleIndexTriplets
 
typedef base::Array
< 2, base::WeakPointer
< Particle >, Particle * > 
ParticlePair
 
typedef IMP::base::Vector
< ParticlePair
ParticlePairsTemp
 
typedef base::Array
< 4, base::WeakPointer
< Particle >, Particle * > 
ParticleQuad
 
typedef IMP::base::Vector
< ParticleQuad
ParticleQuadsTemp
 
typedef base::Vector
< base::Pointer< Particle > > 
Particles
 
typedef base::Vector
< base::WeakPointer< Particle > > 
ParticlesTemp
 
typedef base::Vector
< ParticlesTemp
ParticlesTemps
 
typedef base::Array
< 3, base::WeakPointer
< Particle >, Particle * > 
ParticleTriplet
 
typedef IMP::base::Vector
< ParticleTriplet
ParticleTripletsTemp
 
typedef IMP::base::Vector
< IMP::base::Pointer
< QuadContainer > > 
QuadContainers
 
typedef QuadModifier QuadDerivativeModifier
 
typedef IMP::base::Vector
< IMP::base::Pointer
< QuadModifier > > 
QuadModifiers
 
typedef IMP::base::Vector
< IMP::base::Pointer
< QuadPredicate > > 
QuadPredicates
 
typedef IMP::base::Vector
< IMP::base::Pointer
< QuadScore > > 
QuadScores
 
typedef IMP::base::Vector
< IMP::base::Pointer< Refiner > > 
Refiners
 a collection of Refiner objects More...
 
typedef IMP::base::Vector
< IMP::base::Pointer
< Restraint > > 
Restraints
 
typedef IMP::base::Vector
< IMP::base::Pointer
< RestraintSet > > 
RestraintSets
 
typedef IMP::base::Vector
< RestraintStatistics
RestraintStatisticsList
 
typedef IMP::base::Vector
< IMP::base::Pointer< Sampler > > 
Samplers
 
typedef IMP::base::Vector
< IMP::base::Pointer
< SaveToConfigurationSetOptimizerState > > 
SaveToConfigurationSetOptimizerStates
 
typedef
GenericScopedRemoveRestraint
< Restraint
ScopedRemoveRestraint
 Remove a restraint until the object goes out of scope.
 
typedef
GenericScopedRemoveScoreState
< ScoreState
ScopedRemoveScoreState
 Remove a score state until the object goes out of scope.
 
typedef GenericScopedRestraint
< Restraint
ScopedRestraint
 Remove a restraint when the object goes out of scope.
 
typedef
GenericScopedScoreState
< ScoreState
ScopedScoreState
 Remove a score state when the object goes out of scope.
 
typedef ScopedSetAttribute
< FloatKey, Float
ScopedSetFloatAttribute
 
typedef IMP::base::Vector
< ScoreAccumulator
ScoreAccumulators
 
typedef IMP::base::Vector
< IMP::base::Pointer
< ScoreState > > 
ScoreStates
 
typedef IMP::base::Vector
< IMP::base::Pointer
< ScoringFunction > > 
ScoringFunctions
 
typedef IMP::base::Vector
< IMP::base::Pointer
< SingletonContainer > > 
SingletonContainers
 
typedef SingletonModifier SingletonDerivativeModifier
 
typedef IMP::base::Vector
< IMP::base::Pointer
< SingletonModifier > > 
SingletonModifiers
 
typedef IMP::base::Vector
< IMP::base::Pointer
< SingletonPredicate > > 
SingletonPredicates
 
typedef IMP::base::Vector
< IMP::base::Pointer
< SingletonScore > > 
SingletonScores
 
typedef IMP::base::Vector
< IMP::base::Pointer
< TripletContainer > > 
TripletContainers
 
typedef TripletModifier TripletDerivativeModifier
 
typedef IMP::base::Vector
< IMP::base::Pointer
< TripletModifier > > 
TripletModifiers
 
typedef IMP::base::Vector
< IMP::base::Pointer
< TripletPredicate > > 
TripletPredicates
 
typedef IMP::base::Vector
< IMP::base::Pointer
< TripletScore > > 
TripletScores
 
typedef IMP::base::Vector
< IMP::base::Pointer
< UnaryFunction > > 
UnaryFunctions
 
typedef IMP::base::Vector
< IMP::base::Pointer
< Undecorator > > 
Undecorators
 

Functions

template<class Before , class After >
Constraintcreate_constraint (Before *b, After *a, const typename Before::Argument &t, std::string name=std::string())
 
Restraints create_decomposition (const RestraintsTemp &rs)
 
ScoringFunctions create_decomposition (ScoringFunction *sf)
 
template<class Score >
Restraintcreate_restraint (Score *s, const typename Score::Argument &t, std::string name=std::string())
 
template<class Score >
Restraintcreate_restraint (const Score *s, const typename Score::Argument &t, std::string name=std::string())
 
template<class RestraintType >
ScoringFunctioncreate_scoring_function (RestraintType *rs, double weight=1.0, double max=NO_MAX, std::string name=std::string())
 
const algebra::BoundingBoxD< 3 > get_bounding_box_d_geometry (Particle *p)
 
std::string get_data_path (std::string file_name)
 Return the full path to installed data. More...
 
DependencyGraph get_dependency_graph (Model *m)
 
std::string get_example_path (std::string file_name)
 Return the path to installed example data for this module. More...
 
ParticleIndexes get_indexes (const ParticlesTemp &ps)
 
ParticleIndexPairs get_indexes (const ParticlePairsTemp &ps)
 
ParticlesTemp get_particles (Model *m, const ParticleIndexes &ps)
 
DependencyGraph get_pruned_dependency_graph (Model *m)
 
ScoreStatesTemp get_required_score_states (const ModelObjectsTemp &irs, const DependencyGraph &dg, const DependencyGraphVertexIndex &index)
 
template<class It >
RestraintsTemp get_restraints (It b, It e)
 
const algebra::Sphere3D get_sphere_d_geometry (Particle *p)
 
ScoreStatesTemp get_update_order (ScoreStatesTemp input)
 
const algebra::Vector3D get_vector_d_geometry (Particle *p)
 
DependencyGraphVertexIndex get_vertex_index (const DependencyGraph &g)
 
template<class Pred >
internal::PredicateEquals
< Pred, true > 
make_predicate_equal (const Pred *p, Model *m, int value)
 
template<class Pred >
internal::PredicateEquals
< Pred, false > 
make_predicate_not_equal (const Pred *p, Model *m, int value)
 
void set_score_state_update_order (const DependencyGraph &dg, const DependencyGraphVertexIndex &index)
 
void set_sphere_d_geometry (Particle *p, const algebra::Sphere3D &v)
 
void set_vector_d_geometry (Particle *p, const algebra::Vector3D &v)
 
void show_restraint_hierarchy (ScoringFunctionAdaptor rs, std::ostream &out=std::cout)
 Print the hierarchy of restraints. More...
 

Variables

const double BAD_SCORE
 
const double NO_MAX
 Use this value when you want to turn off maximum for restraint evaluation.
 

Attribute Keys

Each type of attribute has an associated type of key. The keys can be constructed from a string. Such construction can be expensive and so the resulting keys should be cached.

typedef Key< 0, true > FloatKey
 The type used to identify float attributes in the Particles.
 
typedef IMP::base::Vector
< FloatKey
FloatKeys
 
typedef Key< 1, true > IntKey
 The type used to identify int attributes in the Particles.
 
typedef IMP::base::Vector< IntKeyIntKeys
 
typedef Key< 2, true > StringKey
 The type used to identify string attributes in the Particles.
 
typedef IMP::base::Vector
< StringKey
StringKeys
 
typedef Key< 3, true > ParticleIndexKey
 The type used to identify a particle attribute in the Particles.
 
typedef IMP::base::Vector
< ParticleIndexKey
ParticleIndexKeys
 
typedef Key< 4, true > ObjectKey
 The type used to identify an Object attribute.
 
typedef IMP::base::Vector
< ObjectKey
ObjectKeys
 
typedef Key< 9, true > WeakObjectKey
 The type used to identify a non-ref counted Object attribute.
 
typedef IMP::base::Vector
< WeakObjectKey
WeakObjectKeys
 
typedef Key< 5, true > IntsKey
 The type used to identify int attributes in the Particles.
 
typedef IMP::base::Vector
< IntsKey
IntsKeys
 
typedef Key< 6, true > ParticleIndexesKey
 The type used to identify a particle attribute in the Particles.
 
typedef IMP::base::Vector
< ParticleIndexesKey
ParticleIndexesKeys
 
typedef Key< 7, true > ObjectsKey
 The type used to identify a particle attribute in the Particles.
 
typedef IMP::base::Vector
< ObjectsKey
ObjectsKeys
 
typedef Key< 8, true > ModelKey
 The type used to identify data stored directly in the model.
 
typedef IMP::base::Vector
< ModelKey
ModelKeys
 

Gathering restraints

It is sometimes useful to extract all the non-RestraintSet restraints from a hierarchy involving RestraintSets mixed with Restraints.

RestraintsTemp get_restraints (const RestraintsTemp &rs)
 

Getting required values

These functions use the dependency graph to determine all the objects of a given type that are needed by a particular object. An object is said to be needed by another if there is a path from the object to the dependent object through the dependency graph (see get_dependency_graph()) not passing through a node in all.

ParticlesTemp get_required_particles (ModelObject *p, const ModelObjectsTemp &all, const DependencyGraph &dg, const DependencyGraphVertexIndex &index)
 
ScoreStatesTemp get_required_score_states (ModelObject *p, const ModelObjectsTemp &all, const DependencyGraph &dg, const DependencyGraphVertexIndex &index)
 

Getting dependent values

These functions use the dependency graph to determine all the objects of a given type that depend on a particular object. An object is said to depend on another if there is a path from the object to the dependent object through the reversed dependency graph (see get_dependency_graph()).

ParticlesTemp get_dependent_particles (ModelObject *p, const ModelObjectsTemp &all, const DependencyGraph &dg, const DependencyGraphVertexIndex &index)
 
RestraintsTemp get_dependent_restraints (ModelObject *p, const ModelObjectsTemp &all, const DependencyGraph &dg, const DependencyGraphVertexIndex &index)
 
ScoreStatesTemp get_dependent_score_states (ModelObject *p, const ModelObjectsTemp &all, const DependencyGraph &dg, const DependencyGraphVertexIndex &index)
 

Inputs and outputs

These methods recursively find all inputs or outputs of a given type.

If you don't want recursive, use the non input/output variants.

ParticlesTemp get_input_particles (const ModelObjectsTemp &mos)
 
ContainersTemp get_input_containers (const ModelObjectsTemp &mos)
 
ParticlesTemp get_output_particles (const ModelObjectsTemp &mos)
 
ContainersTemp get_output_containers (const ModelObjectsTemp &mos)
 

Buffer I/O

Write/read the state of the particles to/from a buffer in memory.

Note
Not all particles need to have all the attributes, missing attributes will be skipped. However, the set of attributes must match on the write and read particles.
There is no handling of architectural issues. That is, this is only guaranteed to work if it is read and written on the same operating system and system bit length. We could probably fix this.
both these methods should be considered unstable.
base::Vector< char > write_particles_to_buffer (const ParticlesTemp &particles, const FloatKeys &keys)
 return a binary buffer with the data
 
void read_particles_from_buffer (const base::Vector< char > &buffer, const ParticlesTemp &particles, const FloatKeys &keys)
 load found attributes into the particles
 

Standard module methods

All IMP modules have a set of standard methods to help get information about the module and about files associated with the module.

std::string get_module_version ()
 
std::string get_module_name ()
 

Python Only

The following functions are only available in python.

void show_altgraph (Graph g)
 
networkx::DiGraph get_networkx_graph (Graph g)
 
std::string show_graphviz (Graph g)
 

Typedef Documentation

Store a set of objects.

Definition at line 51 of file kernel/Configuration.h.

Store a set of objects.

Definition at line 51 of file kernel/ConfigurationSet.h.

Store a set of objects.

Definition at line 70 of file kernel/Constraint.h.

Store a set of objects.

Definition at line 77 of file kernel/base_types.h.

typedef boost::graph IMP::kernel::DependencyGraph

The vertices are named by the associated Object*. There is an edge from a to b, if a is an input to b. For example, there is an edge from a particle to a restraint if the restraint directly reads the particle.

See Dependencies for more information about dependencies.See Graphs in IMP for more information.

Definition at line 34 of file kernel/dependency_graph.h.

Pass or store a set of EvaluationState .

Definition at line 36 of file kernel/ScoreAccumulator.h.

Pass or store a set of FloatIndex .

Definition at line 22 of file kernel/FloatIndex.h.

Pass or store a set of FloatKey .

Definition at line 32 of file kernel/base_types.h.

Pass or store a set of IntKey .

Definition at line 34 of file kernel/base_types.h.

Pass or store a set of IntsKey .

Definition at line 44 of file kernel/base_types.h.

Pass or store a set of ModelKey .

Definition at line 58 of file kernel/base_types.h.

Store a set of objects.

Definition at line 65 of file kernel/base_types.h.

Store a set of objects.

Definition at line 69 of file kernel/base_types.h.

Pass or store a set of ObjectKey .

Definition at line 40 of file kernel/base_types.h.

Pass or store a set of ObjectsKey .

Definition at line 55 of file kernel/base_types.h.

Store a set of objects.

Definition at line 242 of file kernel/Optimizer.h.

Store a set of objects.

Definition at line 83 of file kernel/base_types.h.

Store a set of objects.

Definition at line 87 of file kernel/base_types.h.

Store a set of objects.

Definition at line 114 of file kernel/base_types.h.

Store a set of objects.

Definition at line 105 of file kernel/base_types.h.

Store a set of objects.

Definition at line 96 of file kernel/base_types.h.

typedef base::Index<ParticleIndexTag> IMP::kernel::ParticleIndex

A unique identifier for a particle within a Model. Use it to get attributes and do other operations.

Definition at line 140 of file kernel/base_types.h.

Pass or store a set of ParticleIndexesKey .

Definition at line 46 of file kernel/base_types.h.

Pass or store a set of ParticleIndexKey .

Definition at line 38 of file kernel/base_types.h.

Pass or store a set of ParticleIndexPair .

Definition at line 147 of file kernel/base_types.h.

Pass or store a set of ParticleIndexQuad .

Definition at line 149 of file kernel/base_types.h.

Pass or store a set of ParticleIndexTriplet .

Definition at line 148 of file kernel/base_types.h.

An ordered pair of particles.

Definition at line 119 of file kernel/base_types.h.

Pass or store a set of ParticlePair .

Definition at line 126 of file kernel/base_types.h.

An ordered quad of particles.

Definition at line 133 of file kernel/base_types.h.

Pass or store a set of ParticleQuad .

Definition at line 134 of file kernel/base_types.h.

An ordered triplet of particles.

Definition at line 129 of file kernel/base_types.h.

Pass or store a set of ParticleTriplet .

Definition at line 130 of file kernel/base_types.h.

Store a set of objects.

Definition at line 91 of file kernel/base_types.h.

Store a set of objects.

Definition at line 118 of file kernel/base_types.h.

Store a set of objects.

Definition at line 109 of file kernel/base_types.h.

Store a set of objects.

Definition at line 100 of file kernel/base_types.h.

Store a set of objects.

Definition at line 73 of file kernel/Refiner.h.

Store a set of objects.

Definition at line 63 of file kernel/base_types.h.

Store a set of objects.

Definition at line 71 of file kernel/base_types.h.

Store a set of objects.

Definition at line 59 of file kernel/Sampler.h.

Store a set of objects.

Definition at line 73 of file kernel/base_types.h.

Store a set of objects.

Definition at line 75 of file kernel/base_types.h.

Store a set of objects.

Definition at line 85 of file kernel/base_types.h.

Store a set of objects.

Definition at line 112 of file kernel/base_types.h.

Store a set of objects.

Definition at line 103 of file kernel/base_types.h.

Store a set of objects.

Definition at line 94 of file kernel/base_types.h.

Pass or store a set of StringKey .

Definition at line 36 of file kernel/base_types.h.

Store a set of objects.

Definition at line 89 of file kernel/base_types.h.

Store a set of objects.

Definition at line 116 of file kernel/base_types.h.

Store a set of objects.

Definition at line 107 of file kernel/base_types.h.

Store a set of objects.

Definition at line 98 of file kernel/base_types.h.

Store a set of objects.

Definition at line 58 of file kernel/UnaryFunction.h.

Store a set of objects.

Definition at line 32 of file kernel/Undecorator.h.

Pass or store a set of WeakObjectKey .

Definition at line 42 of file kernel/base_types.h.

Function Documentation

template<class Before , class After >
Constraint* IMP::kernel::create_constraint ( Before *  b,
After *  a,
const typename Before::Argument &  t,
std::string  name = std::string() 
)

When programming in C++, you can use generic constraint instead of a SingletonConstraint, PairConstraint, etc. The result is somewhat faster (20% or so).

Definition at line 63 of file kernel/generic.h.

Restraints IMP::kernel::create_decomposition ( const RestraintsTemp rs)

Return the decomposition of a list of restraints.

ScoringFunctions IMP::kernel::create_decomposition ( ScoringFunction *  sf)

Return a list of ScoringFunction objects where each is as simple as possible and evaluating the sum (and anding the good score bits) is exactly like evaluating the one ScoringFunction.

template<class Score >
Restraint* IMP::kernel::create_restraint ( Score *  s,
const typename Score::Argument &  t,
std::string  name = std::string() 
)

When programming in C++, you can use generic restraint instead of a SingletonRestraint, PairRestraint, etc. The result is somewhat faster (20% or so).

Definition at line 37 of file kernel/generic.h.

+ Here is the call graph for this function:

template<class RestraintType >
ScoringFunction* IMP::kernel::create_scoring_function ( RestraintType *  rs,
double  weight = 1.0,
double  max = NO_MAX,
std::string  name = std::string() 
)

Create a ScoringFunction on a single restraints. This can be faster than using a RestraintsScoringFunction.

Definition at line 24 of file kernel/generic.h.

const algebra::BoundingBoxD<3> IMP::kernel::get_bounding_box_d_geometry ( Particle *  p)

Definition at line 237 of file XYZR.h.

+ Here is the call graph for this function:

std::string IMP::kernel::get_data_path ( std::string  file_name)

Each module has its own data directory, so be sure to use the version of this function in the correct module. To read the data file "data_library" that was placed in the data directory of module "mymodule", do something like

std::ifstream in(IMP::mymodule::get_data_path("data_library"));

This will ensure that the code works when IMP is installed or used via the tools/imppy.sh script.

DependencyGraph IMP::kernel::get_dependency_graph ( Model *  m)

The dependency graph captures the interactions between Restraint, ScoreState and Particle objects. The graph has a directed edge if the source of the edge is an input for the target of the edge or the target of the edge is an output for the source. eg, there is an edge connecting a Container to the Restraint which gets its particles from the Container.

See Also
get_pruned_dependency_graph()
RestraintsTemp IMP::kernel::get_dependent_restraints ( ModelObject *  p,
const ModelObjectsTemp all,
const DependencyGraph &  dg,
const DependencyGraphVertexIndex &  index 
)

Return all the restraints that depend on p as an input, even indirectly.

ScoreStatesTemp IMP::kernel::get_dependent_score_states ( ModelObject *  p,
const ModelObjectsTemp all,
const DependencyGraph &  dg,
const DependencyGraphVertexIndex &  index 
)

Return all the score states that depend on p as an input, even indirectly.

std::string IMP::kernel::get_example_path ( std::string  file_name)

Each module has its own example directory, so be sure to use the version of this function in the correct module. For example to read the file example_protein.pdb located in the examples directory of the IMP::atom module, do

IMP::atom::read_pdb(IMP::atom::get_example_path("example_protein.pdb", model));

This will ensure that the code works when IMP is installed or used via the tools/imppy.sh script.

ParticleIndexes IMP::kernel::get_indexes ( const ParticlesTemp &  ps)

Get the indexes from a list of particles.

ParticleIndexPairs IMP::kernel::get_indexes ( const ParticlePairsTemp &  ps)

Get the indexes from a list of particle pairs.

ContainersTemp IMP::kernel::get_input_containers ( const ModelObjectsTemp mos)

Return all the input particles for a given ModelObject.

ParticlesTemp IMP::kernel::get_input_particles ( const ModelObjectsTemp mos)

Return all the input particles for a given ModelObject.

networkx::DiGraph IMP::kernel::get_networkx_graph ( Graph  g)
Export an IMP graph to a <a href="http://networkx.lanl.gov/">networkx</a> graph.
The resulting graph can be analyzed and displaye, although the graph
layout algorithms in networkx seem to be quite poor compared to
graphviz.

One a mac, such graphs can be displayed by
import matplotlib
# the engine to be used must be selected before pyplot is imported
matplotlib.use("macosx")
import matplotlib.pyplot as plt
import networkx
networkx.draw_spring(xg)
plt.show()
ContainersTemp IMP::kernel::get_output_containers ( const ModelObjectsTemp mos)

Return all the output particles for a given ModelObject.

ParticlesTemp IMP::kernel::get_output_particles ( const ModelObjectsTemp mos)

Return all the output particles for a given ModelObject.

ParticlesTemp IMP::kernel::get_particles ( Model *  m,
const ParticleIndexes &  ps 
)

Get the particles from a list of indexes.

DependencyGraph IMP::kernel::get_pruned_dependency_graph ( Model *  m)

The pruned dependency graph merges all particles which have the same dependencies to produce a simpler graph.

ScoreStatesTemp IMP::kernel::get_required_score_states ( ModelObject *  p,
const ModelObjectsTemp all,
const DependencyGraph &  dg,
const DependencyGraphVertexIndex &  index 
)

Return all the score states that depend on p as an input, even indirectly.

ScoreStatesTemp IMP::kernel::get_required_score_states ( const ModelObjectsTemp irs,
const DependencyGraph &  dg,
const DependencyGraphVertexIndex &  index 
)

Return the required score states for the restraints ordered in a valid evaluation order. Make sure you include any score states that are simply needed to update optimized particles.

const algebra::Sphere3D IMP::kernel::get_sphere_d_geometry ( Particle *  p)

Definition at line 226 of file XYZR.h.

+ Here is the call graph for this function:

ScoreStatesTemp IMP::kernel::get_update_order ( ScoreStatesTemp  input)

Return the passed list of score states ordered based on how they need to be ordered during update calls.

const algebra::Vector3D IMP::kernel::get_vector_d_geometry ( Particle *  p)

Definition at line 198 of file XYZ.h.

+ Here is the call graph for this function:

template<class Pred >
internal::PredicateEquals<Pred, true> IMP::kernel::make_predicate_equal ( const Pred *  p,
Model *  m,
int  value 
)

Return a functor that returns true when the predicate has a certain value.

Definition at line 21 of file kernel/functor.h.

template<class Pred >
internal::PredicateEquals<Pred, false> IMP::kernel::make_predicate_not_equal ( const Pred *  p,
Model *  m,
int  value 
)

Return a functor that returns true when the predicate doesn't have a certain value.

Definition at line 31 of file kernel/functor.h.

void IMP::kernel::set_score_state_update_order ( const DependencyGraph &  dg,
const DependencyGraphVertexIndex &  index 
)

Assign an order to the score states in the dependency graph in which they can safetly be updated.

void IMP::kernel::set_sphere_d_geometry ( Particle *  p,
const algebra::Sphere3D &  v 
)

Definition at line 231 of file XYZR.h.

+ Here is the call graph for this function:

void IMP::kernel::set_vector_d_geometry ( Particle *  p,
const algebra::Vector3D &  v 
)

Definition at line 202 of file XYZ.h.

+ Here is the call graph for this function:

void IMP::kernel::show_altgraph ( Graph  g)

Use the python altgraph package to graphically display a graph. Note that is requires X11 to be running (you can find it in your Utilities folder in MacOS) and the window produced is shockingly retro.

An alterntative is to write the graph to a dot file

g.show_graphviz(open("graph.dot", "w"));

then turn it to pdf with dot

dot -Tpdf graph.dot > graph.pdf

and finally view the pdf.

std::string IMP::kernel::show_graphviz ( Graph  g)

Generate a nice pdf of the graph and attempt to open the pdf. The name of the pdf will be returned in case the attempt to open it fails.

void IMP::kernel::show_restraint_hierarchy ( ScoringFunctionAdaptor  rs,
std::ostream &  out = std::cout 
)

The maximum accepted score (Restraint::get_maximum_score()) and the weight (Restraint::get_weight()) are printed for each restraint.

Variable Documentation

const double IMP::kernel::BAD_SCORE

Evaluation can return this value if limits are exceeded and it is a ScoringFunction::evaluate_if_below() or ScoringFunction::evaluate_if_good