RMF
RMF Namespace Reference

The namespace for all functionality in the library. More...

Namespaces

 decorator
 See Decorators and Attributes for more information.
 
 HDF5
 The namespace for all HDF5 functionality in the library.
 

Classes

class  BufferConstHandle
 Manage a shared buffer for loading a RMF. More...
 
class  BufferHandle
 Manage a shared buffer for storing a RMF. More...
 
class  CoordinateTransformer
 Transform coordinates into the global reference frame. More...
 
class  Decorator
 The base class for decorators. More...
 
class  Enum
 A strong enum with an associated string name for each value. More...
 
class  Exception
 
class  Factory
 The base class for Factories. More...
 
class  FileConstHandle
 A handle for a read-only RMF file. More...
 
class  FileHandle
 A handle for an RMF file. More...
 
class  ID
 A general purpose ID in RMF used, with different tags, to identify things. More...
 
class  IndexException
 
class  InternalException
 
class  IOException
 
class  Label
 A decorator-like class to mark certain nodes (e.g. molecule boundaries) More...
 
class  NodeConstHandle
 A handle for a particular node in a read-only hierarchy. More...
 
class  NodeHandle
 A handle for a particular node in the hierarchy. More...
 
class  Nullable
 Return a possibly null value. More...
 
class  RestoreCurrentFrame
 Restore the frame that was current on creation upon destruction. More...
 
class  SetCurrentFrame
 Set the current frame to a value and then return it to the old value when this goes out of scope. More...
 
struct  Traits
 Traits classes describing how RMF uses types for storing data. More...
 
class  TraverseHelper
 Track common data that one needs to keep as one traverses the hierarchy. More...
 
class  UsageException
 
class  Vector
 Represent a point in some dimension. More...
 

Typedefs

typedef std::vector< CategoryCategories
 
typedef ID< CategoryTag > Category
 
typedef std::vector
< CoordinateTransformer
CoordinateTransformers
 A list of them.
 
typedef std::vector
< FileConstHandle
FileConstHandles
 Pass a list of them.
 
typedef std::vector< FileHandleFileHandles
 Pass a list of them.
 
typedef float Float
 
typedef std::vector< FloatFloats
 
typedef std::vector< FloatsFloatsList
 
typedef FloatsTraits FloatsTag
 
typedef Traits< FloatsFloatsTraits
 
typedef FloatTraits FloatTag
 
typedef Traits< FloatFloatTraits
 
typedef ID< FrameTag > FrameID
 
typedef std::vector< FrameIDFrameIDs
 
typedef Enum< FrameTypeTag > FrameType
 
typedef int Int
 
typedef std::array< int, 2 > IntRange
 
typedef std::vector< IntInts
 
typedef std::vector< IntsIntsList
 
typedef IntsTraits IntsTag
 
typedef Traits< IntsIntsTraits
 
typedef IntTraits IntTag
 
typedef Traits< IntIntTraits
 
typedef std::vector
< NodeConstHandle
NodeConstHandles
 Pass a list of them.
 
typedef std::vector< NodeHandleNodeHandles
 Pass a list of them.
 
typedef ID< NodeTag > NodeID
 
typedef std::vector< NodeIDNodeIDs
 
typedef Enum< NodeTypeTag > NodeType
 
typedef Enum
< RepresentationTypeTag > 
RepresentationType
 
typedef std::string String
 
typedef std::vector< StringStrings
 
typedef std::vector< StringsStringsList
 
typedef StringsTraits StringsTag
 
typedef Traits< StringsStringsTraits
 
typedef StringTraits StringTag
 
typedef Traits< StringStringTraits
 
typedef std::vector
< TraverseHelper
TraverseHelpers
 
typedef Vector< 3U > Vector3
 
typedef std::vector< Vector3Vector3s
 
typedef Vector3sTraits Vector3sTag
 
typedef Traits< std::vector
< Vector< 3 > > > 
Vector3sTraits
 
typedef Vector3Traits Vector3Tag
 
typedef Traits< Vector< 3 > > Vector3Traits
 
typedef Vector< 4U > Vector4
 
typedef std::vector< Vector4Vector4s
 
typedef Vector4sTraits Vector4sTag
 
typedef Traits< std::vector
< Vector< 4 > > > 
Vector4sTraits
 
typedef Vector4Traits Vector4Tag
 
typedef Traits< Vector< 4 > > Vector4Traits
 
typedef unsigned int VectorDimension
 Work around clang issue.
 

Functions

FileHandle create_rmf_buffer (BufferHandle buffer)
 Create an RMF in a buffer. More...
 
FileHandle create_rmf_file (std::string path)
 Create an RMF from a file system path. More...
 
void get_all_global_coordinates (FileConstHandle &fh, NodeConstHandle &nh, PyObject *coord)
 Get global XYZ coordinates for everything under the given node. More...
 
std::array< RMF::Vector3, 2 > get_bounding_box (NodeConstHandle root)
 
float get_diameter (NodeConstHandle root)
 
bool get_equal_current_values (FileConstHandle input, FileConstHandle out)
 
bool get_equal_static_values (FileConstHandle input, FileConstHandle out)
 
bool get_equal_structure (FileConstHandle input, FileConstHandle output, bool print_diff=false)
 
log4cxx::LoggerPtr get_logger ()
 
std::string get_message (const Exception &e)
 
std::string get_signature_string (FileConstHandle file)
 Return a string that captures information about the file. More...
 
std::size_t hash_value (const BufferConstHandle &t)
 Produce hash values for boost hash tables.
 
template<class TagT >
std::size_t hash_value (const Enum< TagT > &t)
 Produce hash values for boost hash tables.
 
template<class TagT >
std::size_t hash_value (const ID< TagT > &t)
 Produce hash values for boost hash tables.
 
std::size_t hash_value (const NodeConstHandle &t)
 Produce hash values for boost hash tables.
 
std::size_t hash_value (const FileConstHandle &t)
 Produce hash values for boost hash tables.
 
FileConstHandle open_rmf_buffer_read_only (BufferConstHandle buffer)
 
FileConstHandle open_rmf_file_read_only (std::string path)
 
BufferConstHandle read_buffer (std::string file_name)
 
void set_log_level (std::string level)
 
void show_info (RMF::FileConstHandle rh, std::ostream &out=std::cout)
 
void test_throw_exception ()
 
void validate (FileConstHandle fh)
 Validate the hierarchy, throwing an exception if any problems were found. More...
 
void write_buffer (BufferConstHandle buffer, std::string file_name)
 

Variables

static const FrameID ALL_FRAMES = FrameID(-1, FrameID::SpecialTag())
 

Node Types

The types nodes can take in an RMF file.

const NodeType INVALID_NODE_TYPE
 
const NodeType ROOT
 The root node.
 
const NodeType REPRESENTATION
 Represent part of a molecule.
 
const NodeType GEOMETRY
 Store a geometric object.
 
const NodeType FEATURE
 Store information about some feature of the system. More...
 
const NodeType ALIAS
 
const NodeType CUSTOM
 Arbitrary data that is not standardized. More...
 
const NodeType BOND
 A link between two atoms. More...
 
const NodeType ORGANIZATIONAL
 A node that is purely there for organizational purposes. More...
 
const NodeType PROVENANCE
 Represent the process by which a structure was created.
 

Frame Types

The types frames can take in an RMF file.

const FrameType INVALID_FRAME_TYPE
 
const FrameType STATIC
 The root frame.
 
const FrameType FRAME
 A frame in a sequence of frames.
 
const FrameType MODEL
 An independent model.
 
const FrameType CENTER
 A cluster center.
 
const FrameType FRAME_ALIAS
 An alias for another frame.
 
const FrameType ALTERNATE
 An alternate state for a frame or model.
 

Representation Types

The types that representations used in the decorator::Alternatives decorator can take.

const RepresentationType PARTICLE
 
const RepresentationType GAUSSIAN_PARTICLE
 

Batch data access

These methods provide batch access to attribute data to try to reduce the overhead of repeated function calls.

The missing_value argument is a placeholder that can fill in for values which are not found in the respective node.

Note
These methods are experimental and subject to change.
Floats get_values (const NodeConstHandles &nodes, FloatKey k, Float missing_value=std::numeric_limits< float >::max())
 

Key types

RMF files support storing a variety of different types of data. These include

  • IntKey: store an arbitrary integer as a 64 bit integer
  • FloatKey: store an arbitrary floating point number as a float
  • StringKey: store an arbitrary length string
  • IndexKey: store non-negative indexes as 64 bit integers
  • NodeIDKey: store the ID of a node in the hierarchy
  • NodeIDsKey: store a list of NodeIDs
  • DataSetKey: store a reference to an HDF5 data set via the path to the data set
  • IntsKey: store a list of arbitrary integers
typedef ID< IntTag > IntKey
 
typedef std::vector< IntKeyIntKeys
 
typedef ID< FloatTag > FloatKey
 
typedef std::vector< FloatKeyFloatKeys
 
typedef ID< StringTag > StringKey
 
typedef std::vector< StringKeyStringKeys
 
typedef ID< IntsTag > IntsKey
 
typedef std::vector< IntsKeyIntsKeys
 
typedef ID< FloatsTag > FloatsKey
 
typedef std::vector< FloatsKeyFloatsKeys
 
typedef ID< StringsTag > StringsKey
 
typedef std::vector< StringsKeyStringsKeys
 
typedef ID< Vector3TagVector3Key
 
typedef std::vector< Vector3KeyVector3Keys
 
typedef ID< Vector4TagVector4Key
 
typedef std::vector< Vector4KeyVector4Keys
 
typedef ID< Vector3sTagVector3sKey
 
typedef std::vector< Vector3sKeyVector3sKeys
 

Names

std::string get_as_node_name (std::string input)
 Return a node name string that has been modified to obey the rules. More...
 
bool get_is_valid_key_name (std::string name)
 Return true iff the string is a valid key name.
 
bool get_is_valid_node_name (std::string name)
 Return true iff the string is a valid node name.
 

Showing the hierarchy

These functions print out the hierarchy with various extra information for each node. Each prints out an ASCII tree designed for human inspection.

void show_hierarchy (NodeConstHandle root, std::ostream &out)
 
void show_hierarchy (NodeConstHandle root)
 
void show_hierarchy_with_values (NodeConstHandle root, std::ostream &out)
 
void show_hierarchy_with_values (NodeConstHandle root)
 
void show_hierarchy_with_decorators (NodeConstHandle root, bool verbose=false, std::ostream &out=std::cout)
 
void show_frames (FileConstHandle fh, std::ostream &out=std::cout)
 

Copy functions

See the example cloning.py for a usage example.

void clone_file_info (FileConstHandle input, FileHandle output)
 
void clone_hierarchy (FileConstHandle input, FileHandle output)
 
void clone_loaded_frame (FileConstHandle input, FileHandle output)
 
void clone_static_frame (FileConstHandle input, FileHandle output)
 

Detailed Description

In python, the module is also called RMF.

Typedef Documentation

typedef std::vector<Category> RMF::Categories

List of categories.

Definition at line 117 of file ID.h.

typedef ID<CategoryTag> RMF::Category

Identify a category within a file.

Definition at line 110 of file ID.h.

typedef float RMF::Float

The type used to store lists of floating point values.

Definition at line 33 of file types.h.

typedef ID< FloatTag> RMF::FloatKey

Identify a value stored for a node.

Definition at line 41 of file keys.h.

typedef std::vector< FloatKey> RMF::FloatKeys

A list of identifiers.

Definition at line 41 of file keys.h.

typedef std::vector<Float> RMF::Floats

The type used to store lists of floating point values.

Definition at line 35 of file types.h.

typedef ID< FloatsTag> RMF::FloatsKey

Identify a value stored for a node.

Definition at line 41 of file keys.h.

typedef std::vector< FloatsKey> RMF::FloatsKeys

A list of identifiers.

Definition at line 41 of file keys.h.

typedef std::vector<Floats> RMF::FloatsList

The type used to store lists of floating point values.

Definition at line 37 of file types.h.

typedef ID<FrameTag> RMF::FrameID

Identify a frame within a file.

Definition at line 108 of file ID.h.

typedef std::vector<FrameID> RMF::FrameIDs

List of frame ids.

Definition at line 115 of file ID.h.

typedef Enum<FrameTypeTag> RMF::FrameType

The type for frames.

See Frame Types for a complete list of the possible values.

Definition at line 116 of file Enum.h.

typedef int RMF::Int

The type used to store integral values.

Definition at line 29 of file types.h.

typedef ID< IntTag> RMF::IntKey

Identify a value stored for a node.

Definition at line 41 of file keys.h.

typedef std::vector< IntKey> RMF::IntKeys

A list of identifiers.

Definition at line 41 of file keys.h.

typedef std::vector<Int> RMF::Ints

The type used to store lists of integral values.

Definition at line 31 of file types.h.

typedef ID< IntsTag> RMF::IntsKey

Identify a value stored for a node.

Definition at line 41 of file keys.h.

typedef std::vector< IntsKey> RMF::IntsKeys

A list of identifiers.

Definition at line 41 of file keys.h.

typedef std::vector<Ints> RMF::IntsList

The type used to store lists of lists of integers values.

Definition at line 45 of file types.h.

typedef ID<NodeTag> RMF::NodeID

Identify a node within a file.

Definition at line 106 of file ID.h.

typedef std::vector<NodeID> RMF::NodeIDs

List of node ids.

Definition at line 113 of file ID.h.

typedef Enum<NodeTypeTag> RMF::NodeType

The type for nodes.

See Node Types for a complete list of the possible values.

Definition at line 121 of file Enum.h.

typedef Enum<RepresentationTypeTag> RMF::RepresentationType

The type for representations used in decorator::Alternatives.

See Representation Types for a complete list of the possible values.

Definition at line 127 of file Enum.h.

typedef std::string RMF::String

The type used to store lists of string values.

Definition at line 39 of file types.h.

typedef ID< StringTag> RMF::StringKey

Identify a value stored for a node.

Definition at line 41 of file keys.h.

typedef std::vector< StringKey> RMF::StringKeys

A list of identifiers.

Definition at line 41 of file keys.h.

typedef std::vector<String> RMF::Strings

The type used to store lists of string values.

Definition at line 41 of file types.h.

typedef ID< StringsTag> RMF::StringsKey

Identify a value stored for a node.

Definition at line 41 of file keys.h.

typedef std::vector< StringsKey> RMF::StringsKeys

A list of identifiers.

Definition at line 41 of file keys.h.

typedef std::vector<Strings> RMF::StringsList

The type used to store lists of strings values.

Definition at line 43 of file types.h.

typedef Vector<3U> RMF::Vector3

A Vector3

Definition at line 48 of file types.h.

Identify a value stored for a node.

Definition at line 41 of file keys.h.

typedef std::vector< Vector3Key> RMF::Vector3Keys

A list of identifiers.

Definition at line 41 of file keys.h.

typedef std::vector<Vector3> RMF::Vector3s

Many Vector3s

Definition at line 52 of file types.h.

Identify a value stored for a node.

Definition at line 41 of file keys.h.

typedef std::vector< Vector3sKey> RMF::Vector3sKeys

A list of identifiers.

Definition at line 41 of file keys.h.

typedef Vector<4U> RMF::Vector4

A Vector3

Definition at line 50 of file types.h.

Identify a value stored for a node.

Definition at line 41 of file keys.h.

typedef std::vector< Vector4Key> RMF::Vector4Keys

A list of identifiers.

Definition at line 41 of file keys.h.

typedef std::vector<Vector4> RMF::Vector4s

Many Vector4s

Definition at line 54 of file types.h.

Function Documentation

void RMF::clone_file_info ( FileConstHandle  input,
FileHandle  output 
)

Copy the hierarchy structure and set structure from one RMF file to another.

void RMF::clone_hierarchy ( FileConstHandle  input,
FileHandle  output 
)

Copy the hierarchy structure and set structure from one RMF file to another.

void RMF::clone_loaded_frame ( FileConstHandle  input,
FileHandle  output 
)

Copy the data of a single frame from between two files.

void RMF::clone_static_frame ( FileConstHandle  input,
FileHandle  output 
)

Copy the data of a single frame from between two files. Parts missing in the output file will be skipped.

FileHandle RMF::create_rmf_buffer ( BufferHandle  buffer)
Parameters
bufferThe buffer to place the contents in.
Examples:
benchmark/benchmark_rmf.cpp.
FileHandle RMF::create_rmf_file ( std::string  path)
Parameters
paththe system path to the rmf file
Exceptions
RMF::IOExceptioncouldn't create file, or unsupported file format
Examples:
benchmark/benchmark_rmf.cpp.
void RMF::get_all_global_coordinates ( FileConstHandle &  fh,
NodeConstHandle &  nh,
PyObject *  coord 
)

This will traverse the subset of the RMF file rooted at the given node in a depth first manner and put the XYZ coordinates for all appropriate nodes into the provided NumPy array, which must be an N*3 float array where N is the number of XYZ particles. The coordinates are global, i.e. they are transformed by any parent ReferenceFrame nodes.

This function is primarily intended to extract trajectory frames for visualization packages such as ChimeraX. It is only available to Python and if RMF is built with NumPy support.

std::string RMF::get_as_node_name ( std::string  input)

Node and key names have to obey certain rules, such as no quotes in the name.

std::array<RMF::Vector3, 2> RMF::get_bounding_box ( NodeConstHandle  root)

Return a lower bound/upper bound pair that bounds the data stored in the tree.

float RMF::get_diameter ( NodeConstHandle  root)

Return the diameter of the system. Unlike bounding box, this one can be called from python.

bool RMF::get_equal_current_values ( FileConstHandle  input,
FileConstHandle  out 
)

Return true of the two have the same values in the current frame.

bool RMF::get_equal_static_values ( FileConstHandle  input,
FileConstHandle  out 
)

Return true if the two have the same values in the static frame.

bool RMF::get_equal_structure ( FileConstHandle  input,
FileConstHandle  output,
bool  print_diff = false 
)

Return true of the two have the same structure.

std::string RMF::get_message ( const Exception &  e)

Use this instead of the more standard what() to get the message as what() presents issues for memory management with dynamically generated messages.

std::string RMF::get_signature_string ( FileConstHandle  file)

This string can be saved and compared against the string generated with future versions of the library to make sure that the old files parse reasonably well. The strings are diffable.

FileConstHandle RMF::open_rmf_buffer_read_only ( BufferConstHandle  buffer)

Open an RMF from a buffer in read-only mode.

Exceptions
RMF::IOExceptioncouldn't open file, or unsupported file format
Examples:
benchmark/benchmark_rmf.cpp.
FileConstHandle RMF::open_rmf_file_read_only ( std::string  path)

Open an RMF from a file system path in read-only mode.

Parameters
paththe system path to the rmf file
Exceptions
RMF::IOExceptioncouldn't open file, or unsupported file format
Examples:
benchmark/benchmark_rmf.cpp.
void RMF::set_log_level ( std::string  level)

Set the log level from a string. Supported values are:

  • Trace
  • Info
  • Warn
  • Error
  • Off

Log4CXX is required for logging to be supported.

Examples:
benchmark/benchmark_rmf.cpp.
void RMF::show_frames ( FileConstHandle  fh,
std::ostream &  out = std::cout 
)

Show the frame hierarchy rather than the node hierarchy.

void RMF::show_hierarchy ( NodeConstHandle  root,
std::ostream &  out 
)

Print out just the node names and types.

void RMF::show_hierarchy_with_decorators ( NodeConstHandle  root,
bool  verbose = false,
std::ostream &  out = std::cout 
)

Print out the list of decorators that can be used to decorate each node based on the current attributes in the loaded frame..

void RMF::show_hierarchy_with_values ( NodeConstHandle  root,
std::ostream &  out 
)

Print out all attributes for each node for the current frame.

void RMF::show_info ( RMF::FileConstHandle  rh,
std::ostream &  out = std::cout 
)

Show various statistics about the file such as attributes and how often they are used.

void RMF::test_throw_exception ( )

This function simply throws an exception. It is here for testing.

void RMF::validate ( FileConstHandle  fh)
Exceptions
exceptionif it is not valid and log any errors encountered.

Checks invariants, such as all representation leaves having coordinates and radii.

Variable Documentation

const NodeType RMF::ALIAS

Store a reference to another node. This node should be an alias decorator node and have no other data, at least for now. Aliases should be thought of as simply referencing existing objects in the scene, not creating new objects.

const FrameID RMF::ALL_FRAMES = FrameID(-1, FrameID::SpecialTag())
static

A constant used to denote that the particular operation refers to all frames in the file.

Definition at line 20 of file constants.h.

const NodeType RMF::BOND

These are mostly for display purposes e.g. to show a wireframe view of the molecule.

const NodeType RMF::CUSTOM

Programs can use these keys to store any extra data they want to put into the file.

const NodeType RMF::FEATURE

For example, the particles involved in scoring functions and their score can be encoded as feature nodes.

const RepresentationType RMF::GAUSSIAN_PARTICLE

Represent the structure with at set of decorator::GaussianParticle nodes.

const NodeType RMF::ORGANIZATIONAL

This includes nodes that are just RMF::ReferenceFrame nodes.

const RepresentationType RMF::PARTICLE

Representation via decorator::Particle nodes, the default.