IMP logo
IMP Reference Guide  2.16.0
The Integrative Modeling Platform
restraint_io.h
Go to the documentation of this file.
1 /**
2  * \file IMP/rmf/restraint_io.h
3  * \brief Manage read/write of Restraints from/to RMF files.
4  *
5  * Copyright 2007-2021 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPRMF_RESTRAINT_IO_H
10 #define IMPRMF_RESTRAINT_IO_H
11 
12 #include <IMP/rmf/rmf_config.h>
13 #include "link_macros.h"
14 #include <IMP/object_macros.h>
15 #include <IMP/Restraint.h>
16 
17 IMPRMF_BEGIN_NAMESPACE
18 
19 /** \name Restraint I/O
20  Restraints are written as RMF::FEATURE nodes with subnodes for
21  the decomposed restraints
22  (Restraint::create_current_decomposition()).
23  The Restraints::get_last_score() value is what is saved to the file,
24  so make sure that the restraints have been evaluated before saving
25  a frame.
26 
27  Any particles returned by Restraint::get_input_particles() that are
28  also linked in the RMF file will be included in the RMF file as
29  inputs for the Restraint. This allows external software like e.g.,
30  Chimera to associate these restraints with a certain set of particles.
31  @{
32 */
33 IMP_DECLARE_LINKERS(Restraint, restraint, restraints, Restraint *,
34  Restraints,
35  (RMF::FileConstHandle fh, Model *m), );
36 
37 //! Add a list of restraints to the file as (static) bonds.
38 /** There restraints must decompose into pairwise restraints.
39  Their scores will not be recorded in the file. */
40 IMPRMFEXPORT void add_restraints_as_bonds(RMF::FileHandle fh,
41  const Restraints &rs);
42 
43 //! Limit the number of restraint terms.
44 /** Certain restraints are made from a really large number of terms.
45  Tracking and displaying all those
46  terms can be very time consuming. If the number of terms is larger
47  than the maximum, the terms are not displayed. By default this is 100. */
48 IMPRMFEXPORT void set_maximum_number_of_terms(RMF::FileHandle fh,
49  unsigned int num);
50 /** @} */
51 
52 IMPRMF_END_NAMESPACE
53 
54 #endif /* IMPRMF_RESTRAINT_IO_H */
Helper macros for implementing IMP Objects.
IMP::Vector< IMP::Pointer< Restraint > > Restraints
Definition: base_types.h:86
void add_restraints_as_bonds(RMF::FileHandle fh, const Restraints &rs)
Add a list of restraints to the file as (static) bonds.
void set_maximum_number_of_terms(RMF::FileHandle fh, unsigned int num)
Limit the number of restraint terms.
Abstract base class for all restraints.