IMP logo
Classes | Functions
Hierarchies of particles

Detailed Description

These functions and classes aid in manipulating particles representing molecules at multiple levels.

Classes

class  IMP::atom::Atom
 A decorator for a particle representing an atom. More...
class  IMP::core::ChildrenRefiner
 Return the hierarchy children of a particle. More...
class  IMP::atom::Hierarchy
 The standard decorator for manipulating molecular structures. More...
struct  IMP::core::HierarchyCounter
 A simple functor to count the number of particles in a hierarchy. More...
class  IMP::core::HierarchyVisitor
 A visitor for traversal of a hierarchy. More...
class  IMP::core::LeavesRefiner
 Return the hierarchy leaves under a particle. More...
class  IMP::core::ModifierVisitor
 A which applies a singleton modifier to each Particle in a hierarchy. More...
class  IMP::atom::Residue
 A decorator for a residue. More...

Functions

Hierarchy IMP::atom::create_fragment (const Hierarchies &ps)
 Create a fragment containing the specified nodes.
Hierarchy create_fragment (const Hierarchies &ps)
 Create a fragment containing the specified nodes.
template<class HD , class F >
HD IMP::core::find_breadth_first (HD h, F f)
 Find the first node which matches some criteria.
template<class HD , class F >
HD find_breadth_first (HD h, F f)
 Find the first node which matches some criteria.
template<class H , class Out , class F >
Out IMP::core::gather (H h, F f, Out out)
 Gather all the particles in the hierarchy which meet some criteria.
template<class H , class Out , class F >
Out gather (H h, F f, Out out)
 Gather all the particles in the hierarchy which meet some criteria.
template<class H , class Out , class K , class V >
Out IMP::core::gather_by_attribute (H h, K k, V v, Out out)
 Gather all the particles in the hierarchy which match on an attribute.
template<class H , class Out , class K , class V >
Out gather_by_attribute (H h, K k, V v, Out out)
 Gather all the particles in the hierarchy which match on an attribute.
template<class H , class Out , class K0 , class V0 , class K1 , class V1 >
Out IMP::core::gather_by_attributes (H h, K0 k0, V0 v0, K1 k1, V1 v1, Out out)
 Gather all the particles in the hierarchy which match on two attributes.
template<class H , class Out , class K0 , class V0 , class K1 , class V1 >
Out gather_by_attributes (H h, K0 k0, V0 v0, K1 k1, V1 v1, Out out)
 Gather all the particles in the hierarchy which match on two attributes.
template<class H , class Out , class F >
Out IMP::core::gather_slice (H h, F f, Out out)
 Gather all the particles in the hierarchy which meet some criteria.
template<class H , class Out , class F >
Out gather_slice (H h, F f, Out out)
 Gather all the particles in the hierarchy which meet some criteria.
Hierarchies IMP::atom::get_by_type (Hierarchy mhd, GetByType t)
Hierarchies get_by_type (Hierarchy mhd, GetByType t)
Hierarchy IMP::atom::get_residue (Hierarchy mhd, unsigned int index)
 Get the residue with the specified index.
Hierarchy get_residue (Hierarchy mhd, unsigned int index)
 Get the residue with the specified index.
template<class ND >
std::ostream & IMP::core::show (Hierarchy h, std::ostream &out=std::cout)
 Print the hierarchy using a given decorator as to display each node.
template<class ND >
std::ostream & show (Hierarchy h, std::ostream &out=std::cout)
 Print the hierarchy using a given decorator as to display each node.
template<class HD , class F >
IMP::core::visit_breadth_first (HD d, F f)
 Apply the visitor to each particle, breadth first.
template<class HD , class F >
visit_breadth_first (HD d, F f)
 Apply the visitor to each particle, breadth first.
template<class HD , class F >
IMP::core::visit_breadth_first_with_data (HD d, F f, typename F::result_type i)
 Apply functor F to each particle, traversing the hierarchy breadth first.
template<class HD , class F >
visit_breadth_first_with_data (HD d, F f, typename F::result_type i)
 Apply functor F to each particle, traversing the hierarchy breadth first.
template<class HD , class F >
visit_depth_first (HD d, F f)
 Apply functor F to each particle, traversing the hierarchy depth first.
template<class HD , class F >
IMP::core::visit_depth_first (HD d, F f)
 Apply functor F to each particle, traversing the hierarchy depth first.
template<class HD , class F >
IMP::core::visit_depth_first_with_data (HD d, F f, typename F::result_type i)
 Apply functor F to each particle, traversing the hierarchy depth first.
template<class HD , class F >
visit_depth_first_with_data (HD d, F f, typename F::result_type i)
 Apply functor F to each particle, traversing the hierarchy depth first.

Function Documentation

Hierarchy create_fragment ( const Hierarchies &  ps)

Create a fragment containing the specified nodes.

A particle representing the fragment is created and initialized.

The Fragment is inserted as a child of the parent (and the particles are removed). The particles become children of the fragment.

Exceptions:
ValueExceptionIf all the particles do not have the same parent.
Hierarchy create_fragment ( const Hierarchies &  ps)
related

Create a fragment containing the specified nodes.

A particle representing the fragment is created and initialized.

The Fragment is inserted as a child of the parent (and the particles are removed). The particles become children of the fragment.

Exceptions:
ValueExceptionIf all the particles do not have the same parent.
template<class HD , class F >
HD find_breadth_first ( HD  h,
f 
)

Find the first node which matches some criteria.

template<class HD , class F >
HD find_breadth_first ( HD  h,
f 
)
related

Find the first node which matches some criteria.

template<class H , class Out , class F >
Out gather ( h,
f,
Out  out 
)

Gather all the particles in the hierarchy which meet some criteria.

template<class H , class Out , class F >
Out gather ( h,
f,
Out  out 
)
related

Gather all the particles in the hierarchy which meet some criteria.

template<class H , class Out , class K , class V >
Out gather_by_attribute ( h,
k,
v,
Out  out 
)

Gather all the particles in the hierarchy which match on an attribute.

template<class H , class Out , class K , class V >
Out gather_by_attribute ( h,
k,
v,
Out  out 
)
related

Gather all the particles in the hierarchy which match on an attribute.

template<class H , class Out , class K0 , class V0 , class K1 , class V1 >
Out gather_by_attributes ( h,
K0  k0,
V0  v0,
K1  k1,
V1  v1,
Out  out 
)

Gather all the particles in the hierarchy which match on two attributes.

template<class H , class Out , class K0 , class V0 , class K1 , class V1 >
Out gather_by_attributes ( h,
K0  k0,
V0  v0,
K1  k1,
V1  v1,
Out  out 
)
related

Gather all the particles in the hierarchy which match on two attributes.

template<class H , class Out , class F >
Out gather_slice ( h,
f,
Out  out 
)

Gather all the particles in the hierarchy which meet some criteria.

Descent in the tree terminates when a node is gathered so that none of its children are explored.

template<class H , class Out , class F >
Out gather_slice ( h,
f,
Out  out 
)
related

Gather all the particles in the hierarchy which meet some criteria.

Descent in the tree terminates when a node is gathered so that none of its children are explored.

Hierarchies get_by_type ( Hierarchy  mhd,
GetByType  t 
)

Gather all the molecular particles of a certain level in the molecular hierarchy.

Hierarchies get_by_type ( Hierarchy  mhd,
GetByType  t 
)
related

Gather all the molecular particles of a certain level in the molecular hierarchy.

Hierarchy get_residue ( Hierarchy  mhd,
unsigned int  index 
)

Get the residue with the specified index.

Find the leaf containing the residue with the appropriate index. This is the PDB index, not the offset in the chain (if they are different).

The function returns a Hierarchy, rather than a Residue since the residue may not be explicitly represented and may just be part of some fragment.

Exceptions:
ValueExceptionif mhd's type is not one of CHAIN, PROTEIN, NUCLEOTIDE
Returns:
Hierarchy() if that residue is not found.
Hierarchy get_residue ( Hierarchy  mhd,
unsigned int  index 
)
related

Get the residue with the specified index.

Find the leaf containing the residue with the appropriate index. This is the PDB index, not the offset in the chain (if they are different).

The function returns a Hierarchy, rather than a Residue since the residue may not be explicitly represented and may just be part of some fragment.

Exceptions:
ValueExceptionif mhd's type is not one of CHAIN, PROTEIN, NUCLEOTIDE
Returns:
Hierarchy() if that residue is not found.
template<class ND >
std::ostream & show ( Hierarchy  h,
std::ostream &  out = std::cout 
)

Print the hierarchy using a given decorator as to display each node.

The last argument limits how deep will be printed out.

template<class ND >
std::ostream & show ( Hierarchy  h,
std::ostream &  out = std::cout 
)
related

Print the hierarchy using a given decorator as to display each node.

The last argument limits how deep will be printed out.

template<class HD , class F >
F visit_breadth_first ( HD  d,
f 
)

Apply the visitor to each particle, breadth first.

Parameters:
[in]dThe Hierarchy for the tree in question
[in]fThe visitor to be applied. This is passed by reference. A branch of the traversal stops when f returns false.
template<class HD , class F >
F visit_breadth_first ( HD  d,
f 
)
related

Apply the visitor to each particle, breadth first.

Parameters:
[in]dThe Hierarchy for the tree in question
[in]fThe visitor to be applied. This is passed by reference. A branch of the traversal stops when f returns false.
template<class HD , class F >
F visit_breadth_first_with_data ( HD  d,
f,
typename F::result_type  i 
)

Apply functor F to each particle, traversing the hierarchy breadth first.

This method allows data to be associated with each visited node. The data of the parent is passed to each invocation of the child.

Parameters:
[in]dThe Hierarchy for the tree in question
[in]fThe functor to be applied F must define a type Data which is returned by each call. The result of the parent call is passed as the second argument to the operator() of the child. e.g. struct DepthVisitor { typedef int result_type; result_type operator()(Particle *p, int i) const { if (p==nullptr) return 0; else return i+1; } };
[in]iThe data to be used for d (since it has no relevant parent)
Returns:
A copy of the functor passed in. Use this if you care about the functor state.
template<class HD , class F >
F visit_breadth_first_with_data ( HD  d,
f,
typename F::result_type  i 
)
related

Apply functor F to each particle, traversing the hierarchy breadth first.

This method allows data to be associated with each visited node. The data of the parent is passed to each invocation of the child.

Parameters:
[in]dThe Hierarchy for the tree in question
[in]fThe functor to be applied F must define a type Data which is returned by each call. The result of the parent call is passed as the second argument to the operator() of the child. e.g. struct DepthVisitor { typedef int result_type; result_type operator()(Particle *p, int i) const { if (p==nullptr) return 0; else return i+1; } };
[in]iThe data to be used for d (since it has no relevant parent)
Returns:
A copy of the functor passed in. Use this if you care about the functor state.
template<class HD , class F >
F visit_depth_first ( HD  d,
f 
)
related

Apply functor F to each particle, traversing the hierarchy depth first.

See breadth_first_traversal() for documentation.

template<class HD , class F >
F visit_depth_first ( HD  d,
f 
)

Apply functor F to each particle, traversing the hierarchy depth first.

See breadth_first_traversal() for documentation.

template<class HD , class F >
F visit_depth_first_with_data ( HD  d,
f,
typename F::result_type  i 
)

Apply functor F to each particle, traversing the hierarchy depth first.

See breadth_first_traversal for documentation.

template<class HD , class F >
F visit_depth_first_with_data ( HD  d,
f,
typename F::result_type  i 
)
related

Apply functor F to each particle, traversing the hierarchy depth first.

See breadth_first_traversal for documentation.


Generated on Tue May 22 2012 23:33:23 for IMP by doxygen 1.8.1