IMP logo
IMP Reference Guide  2.11.1
The Integrative Modeling Platform
provenance.h
Go to the documentation of this file.
1 /**
2  * \file IMP/core/provenance.h
3  * \brief Classes to track how the model was created.
4  *
5  * Copyright 2007-2019 IMP Inventors. All rights reserved.
6  */
7 
8 #ifndef IMPCORE_PROVENANCE_H
9 #define IMPCORE_PROVENANCE_H
10 
11 #include <IMP/core/core_config.h>
12 
13 #include <IMP/base_types.h>
14 #include <IMP/Object.h>
15 #include <IMP/object_macros.h>
16 #include <IMP/Decorator.h>
17 #include <IMP/decorator_macros.h>
18 #include <IMP/file.h>
19 #include <set>
20 
21 IMPCORE_BEGIN_NAMESPACE
22 
23 //! Track how parts of the system were created.
24 /** Particles are linked with this decorator into a directed acyclic graph
25  that tracks all IMP transformations of the system all the way back to
26  raw inputs (such as PDB files).
27 
28  Typically, part of an IMP::Model (usually an atom::Hierarchy particle)
29  is decorated with Provenanced that points to the root of this graph.
30  */
31 class IMPCOREEXPORT Provenance : public Decorator {
32  static void do_setup_particle(Model *m, ParticleIndex pi) {
33  // Use self-index to indicate no previous provenance is set yet
34  m->add_attribute(get_previous_key(), pi, pi);
35  }
36 
37  static ParticleIndexKey get_previous_key();
38 
39 public:
40  static bool get_is_setup(Model *m, ParticleIndex pi) {
41  return m->get_has_attribute(get_previous_key(), pi);
42  }
43 
44  //! \return the previous provenance, or Provenance() if none exists.
46  ParticleIndex pi = get_model()->get_attribute(get_previous_key(),
48  // self-index indicates no previous provenance is set yet
49  if (pi == get_particle_index()) {
50  return Provenance();
51  } else {
52  return Provenance(get_model(), pi);
53  }
54  }
55 
56  //! Set the previous provenance.
57  /** This can be used to show that a given part of the system was
58  generated through multiple steps in order, for example by first
59  being read from a PDB file, then sampled, filtered, and finally
60  clustered.
61 
62  \note it is considered an error to try to set this more than once.
63  */
65  IMP_USAGE_CHECK(get_model()->get_attribute(get_previous_key(),
67  == get_particle_index(),
68  "Previous provenance is already set");
69  get_model()->set_attribute(get_previous_key(),
71  }
72 
75 };
76 
77 //! Track creation of a system fragment from a PDB file.
78 /** This tracks the filename of the PDB file, and the chain ID,
79  that was used to populate an IMP Model (if multiple chains are
80  read, IMP::atom::read_pdb() assigns a StructureProvenance to each
81  chain). The offset between the residue indexes in the PDB file and the
82  Model is also recorded. Normally this is zero, but can be used to indicate
83  that residues were renumbered, e.g. to match canonical numbering.
84  The convention is PDB residue # - offset = Model residue #.
85  */
86 class IMPCOREEXPORT StructureProvenance : public Provenance {
87  static void do_setup_particle(Model *m, ParticleIndex pi,
88  std::string filename,
89  std::string chain_id,
90  int residue_offset=0) {
92  IMP_USAGE_CHECK(!filename.empty(), "The filename cannot be empty.");
93  m->add_attribute(get_filename_key(), pi, get_absolute_path(filename));
94  m->add_attribute(get_chain_key(), pi, chain_id);
95  m->add_attribute(get_residue_offset_key(), pi, residue_offset);
96  }
97 
98  static void do_setup_particle(Model *m, ParticleIndex pi,
100  do_setup_particle(m, pi, o.get_filename(), o.get_chain_id(),
101  o.get_residue_offset());
102  }
103 
104  static StringKey get_filename_key();
105  static StringKey get_chain_key();
106  static IntKey get_residue_offset_key();
107 
108 public:
109  static bool get_is_setup(Model *m, ParticleIndex pi) {
110  return m->get_has_attribute(get_filename_key(), pi)
111  && m->get_has_attribute(get_chain_key(), pi)
112  && m->get_has_attribute(get_residue_offset_key(), pi);
113  }
114 
115  //! Set the filename
116  /** The path can be relative or absolute. Internally, an absolute
117  path will be stored (although generally it will be converted to
118  a relative path when storing in a file, such as RMF).
119  */
120  void set_filename(std::string filename) const {
121  IMP_USAGE_CHECK(!filename.empty(), "The filename cannot be empty");
122  return get_model()->set_attribute(get_filename_key(), get_particle_index(),
123  get_absolute_path(filename));
124  }
125 
126  //! \return the filename, as an absolute path
127  std::string get_filename() const {
128  return get_model()->get_attribute(get_filename_key(), get_particle_index());
129  }
130 
131  //! Set the chain ID
132  void set_chain_id(std::string chain_id) const {
133  return get_model()->set_attribute(get_chain_key(), get_particle_index(),
134  chain_id);
135  }
136 
137  //! \return the chain ID
138  std::string get_chain_id() const {
139  return get_model()->get_attribute(get_chain_key(), get_particle_index());
140  }
141 
142  //! Set the offset between PDB and internal numbering (defaults to 0)
143  void set_residue_offset(int residue_offset) const {
144  return get_model()->set_attribute(get_residue_offset_key(),
146  residue_offset);
147  }
148 
149  //! \return the offset between PDB and internal numbering (defaults to 0)
150  int get_residue_offset() const {
151  return get_model()->get_attribute(get_residue_offset_key(),
153  }
154 
156  IMP_DECORATOR_SETUP_3(StructureProvenance, std::string, filename,
157  std::string, chain_id, int, residue_offset);
158  IMP_DECORATOR_SETUP_2(StructureProvenance, std::string, filename,
159  std::string, chain_id);
161 };
162 
163 //! Track creation of a system fragment from sampling.
164 /** Part of the system (usually the top of a Hierarchy) tagged with this
165  decorator is understood to be a single frame from an ensemble of
166  multiple frames generated with some sampling method (e.g. Monte Carlo).
167  Additionally, the number of iterations of the sampler used to generate
168  each frame can be stored, if known and applicable.
169  The rest of the frames are generally stored in a file (e.g. an RMF file).
170 
171  \throw UsageException if invalid sampling method
172  */
173 class IMPCOREEXPORT SampleProvenance : public Provenance {
174  static void do_setup_particle(Model *m, ParticleIndex pi,
175  std::string method, int frames,
176  int iterations, int replicas=1) {
177  validate_method(method);
179  m->add_attribute(get_method_key(), pi, method);
180  m->add_attribute(get_frames_key(), pi, frames);
181  m->add_attribute(get_iterations_key(), pi, iterations);
182  m->add_attribute(get_replicas_key(), pi, replicas);
183  }
184 
185  static void do_setup_particle(Model *m, ParticleIndex pi,
186  SampleProvenance o) {
187  do_setup_particle(m, pi, o.get_method(), o.get_number_of_frames(),
190  }
191 
192  static StringKey get_method_key();
193  static IntKey get_frames_key();
194  static IntKey get_iterations_key();
195  static IntKey get_replicas_key();
196 
197  // get list of method names allowed in SamplingProvenance
198  static std::set<std::string>& get_allowed_methods();
199 
200  //! validate specified sampling method is in get_allowed_methods().
201  //! \throw IMP::UsageException if invalid
202  static void validate_method(std::string method) {
203  IMP_ALWAYS_CHECK(get_allowed_methods().find(method)
204  != get_allowed_methods().end(),
205  "Invalid sampling method",
207  }
208 
209 public:
210  static bool get_is_setup(Model *m, ParticleIndex pi) {
211  return m->get_has_attribute(get_method_key(), pi)
212  && m->get_has_attribute(get_iterations_key(), pi)
213  && m->get_has_attribute(get_frames_key(), pi);
214  }
215 
216  //! Set the sampling method
217  //! \throw IMP::UsageException invalid = not in get_allowed_methods().
218  void set_method(std::string method) const {
219  validate_method(method);
220  return get_model()->set_attribute(get_method_key(), get_particle_index(),
221  method);
222  }
223 
224  //! \return the sampling method
225  std::string get_method() const {
226  return get_model()->get_attribute(get_method_key(), get_particle_index());
227  }
228 
229  //! Set the number of frames
230  void set_number_of_frames(int frames) const {
231  return get_model()->set_attribute(get_frames_key(), get_particle_index(),
232  frames);
233  }
234 
235  //! \return the number of frames
236  int get_number_of_frames() const {
237  return get_model()->get_attribute(get_frames_key(), get_particle_index());
238  }
239 
240  //! Set the number of iterations
241  void set_number_of_iterations(int iterations) const {
242  return get_model()->set_attribute(get_iterations_key(),
243  get_particle_index(), iterations);
244  }
245 
246  //! \return the number of iterations
248  return get_model()->get_attribute(get_iterations_key(),
250  }
251 
252  //! Set the number of replicas
253  void set_number_of_replicas(int replicas) const {
254  return get_model()->set_attribute(get_replicas_key(),
255  get_particle_index(), replicas);
256  }
257 
258  //! \return the number of replicas
260  return get_model()->get_attribute(get_replicas_key(),
262  }
263 
265  IMP_DECORATOR_SETUP_4(SampleProvenance, std::string, method, int, frames,
266  int, iterations, int, replicas);
267  IMP_DECORATOR_SETUP_3(SampleProvenance, std::string, method, int, frames,
268  int, iterations);
270 };
271 
272 //! Track creation of a system fragment by combination.
273 /** Part of the system (usually the top of a Hierarchy) tagged with this
274  decorator is understood to be a single frame within an ensemble that
275  was created by combining a number of independent runs. One of those runs
276  should be the 'previous' provenance. The runs should be
277  essentially identical, differing at most only in the number of frames.
278  The total size of the resulting ensemble is stored here.
279  */
280 class IMPCOREEXPORT CombineProvenance : public Provenance {
281  static void do_setup_particle(Model *m, ParticleIndex pi, int runs,
282  int frames) {
284  m->add_attribute(get_runs_key(), pi, runs);
285  m->add_attribute(get_frames_key(), pi, frames);
286  }
287 
288  static void do_setup_particle(Model *m, ParticleIndex pi,
289  CombineProvenance o) {
290  do_setup_particle(m, pi, o.get_number_of_runs(), o.get_number_of_frames());
291  }
292 
293  static IntKey get_runs_key();
294  static IntKey get_frames_key();
295 
296 public:
297  static bool get_is_setup(Model *m, ParticleIndex pi) {
298  return m->get_has_attribute(get_frames_key(), pi)
299  && m->get_has_attribute(get_runs_key(), pi);
300  }
301 
302  //! Set the total number of frames
303  void set_number_of_frames(int frames) const {
304  return get_model()->set_attribute(get_frames_key(), get_particle_index(),
305  frames);
306  }
307 
308  //! \return the total number of frames
309  int get_number_of_frames() const {
310  return get_model()->get_attribute(get_frames_key(), get_particle_index());
311  }
312 
313  //! Set the number of runs
314  void set_number_of_runs(int runs) const {
315  return get_model()->set_attribute(get_runs_key(), get_particle_index(),
316  runs);
317  }
318 
319  //! \return the number of runs
320  int get_number_of_runs() const {
321  return get_model()->get_attribute(get_runs_key(), get_particle_index());
322  }
323 
325  IMP_DECORATOR_SETUP_2(CombineProvenance, int, runs, int, frames);
327 };
328 
329 //! Track creation of a system fragment by filtering.
330 /** Part of the system (usually the top of a Hierarchy) tagged with this
331  decorator is understood to be a single frame within an ensemble that
332  resulted from filtering a larger ensemble (the 'previous'
333  provenance) in some fashion, such as
334  - by discarding models with scores above the threshold;
335  - by ranking the models and keeping the best scoring subset;
336  - by keeping a fraction of models from the ensemble.
337 
338  \throw UsageException if method not in get_allowed_methods()
339  */
340 class IMPCOREEXPORT FilterProvenance : public Provenance {
341  static void do_setup_particle(Model *m, ParticleIndex pi, std::string method,
342  double threshold, int frames) {
343  validate_method(method);
345  m->add_attribute(get_method_key(), pi, method);
346  m->add_attribute(get_threshold_key(), pi, threshold);
347  m->add_attribute(get_frames_key(), pi, frames);
348  }
349  static void do_setup_particle(Model *m, ParticleIndex pi,
350  FilterProvenance o) {
351  do_setup_particle(m, pi, o.get_method(), o.get_threshold(),
353  }
354 
355  static StringKey get_method_key();
356  static FloatKey get_threshold_key();
357  static IntKey get_frames_key();
358 
359  // get list of method names allowed in FilterProvenance
360  static std::set<std::string>& get_allowed_methods();
361 
362  //! validate specified sampling method is in get_allowed_methods().
363  //! \throw IMP::UsageException if invalid
364  static void validate_method(std::string method) {
365  IMP_ALWAYS_CHECK(get_allowed_methods().find(method)
366  != get_allowed_methods().end(),
367  "Invalid filtering method",
369  }
370 
371 public:
372  static bool get_is_setup(Model *m, ParticleIndex pi) {
373  return m->get_has_attribute(get_method_key(), pi)
374  && m->get_has_attribute(get_threshold_key(), pi)
375  && m->get_has_attribute(get_frames_key(), pi);
376  }
377 
378  //! Set the filtering method
379  //! \throw IMP::UsageException if not a valid method for filtering
380  void set_method(std::string method) const {
381  validate_method(method);
382  return get_model()->set_attribute(get_method_key(), get_particle_index(),
383  method);
384  }
385 
386  //! \return the filtering method
387  std::string get_method() const {
388  return get_model()->get_attribute(get_method_key(), get_particle_index());
389  }
390 
391  //! Set the number of frames
392  void set_number_of_frames(int frames) const {
393  return get_model()->set_attribute(get_frames_key(), get_particle_index(),
394  frames);
395  }
396 
397  //! \return the number of frames
398  int get_number_of_frames() const {
399  return get_model()->get_attribute(get_frames_key(), get_particle_index());
400  }
401 
402  //! Set the score threshold
403  void set_threshold(double threshold) const {
404  return get_model()->set_attribute(get_threshold_key(), get_particle_index(),
405  threshold);
406  }
407 
408  //! \return the threshold
409  double get_threshold() const {
410  return get_model()->get_attribute(get_threshold_key(),
412  }
413 
415  IMP_DECORATOR_SETUP_3(FilterProvenance, std::string, method,
416  double, threshold, int, frames);
418 };
419 
420 //! Track creation of a system fragment from clustering.
421 /** Part of the system (usually the top of a Hierarchy) tagged with this
422  decorator is understood to be a single frame inside a cluster of
423  specified size. The rest of the cluster members are generally stored
424  in a file (e.g. an RMF file).
425  */
426 class IMPCOREEXPORT ClusterProvenance : public Provenance {
427  static void do_setup_particle(Model *m, ParticleIndex pi, int members) {
429  m->add_attribute(get_members_key(), pi, members);
430  }
431 
432  static void do_setup_particle(Model *m, ParticleIndex pi,
433  ClusterProvenance o) {
434  do_setup_particle(m, pi, o.get_number_of_members());
435  }
436 
437  static IntKey get_members_key();
438 
439 public:
440  static bool get_is_setup(Model *m, ParticleIndex pi) {
441  return m->get_has_attribute(get_members_key(), pi);
442  }
443 
444  //! Set the number of cluster members
445  void set_number_of_members(int members) const {
446  return get_model()->set_attribute(get_members_key(), get_particle_index(),
447  members);
448  }
449 
450  //! \return the number of cluster members
451  int get_number_of_members() const {
452  return get_model()->get_attribute(get_members_key(), get_particle_index());
453  }
454 
458 };
459 
460 //! Track creation of a system fragment from running a script.
461 /** Part of the system (usually the top of a Hierarchy) tagged with this
462  decorator is understood to have been generated by running a script
463  (usually a Python script).
464  */
465 class IMPCOREEXPORT ScriptProvenance : public Provenance {
466  static void do_setup_particle(Model *m, ParticleIndex pi,
467  std::string filename) {
469  IMP_USAGE_CHECK(!filename.empty(), "The filename cannot be empty.");
470  m->add_attribute(get_filename_key(), pi, get_absolute_path(filename));
471  }
472 
473  static void do_setup_particle(Model *m, ParticleIndex pi,
474  ScriptProvenance o) {
475  do_setup_particle(m, pi, o.get_filename());
476  }
477 
478  static StringKey get_filename_key();
479 
480 public:
481  static bool get_is_setup(Model *m, ParticleIndex pi) {
482  return m->get_has_attribute(get_filename_key(), pi);
483  }
484 
485  //! Set the filename
486  /** The path can be relative or absolute. Internally, an absolute
487  path will be stored (although generally it will be converted to
488  a relative path when storing in a file, such as RMF).
489  */
490  void set_filename(std::string filename) const {
491  IMP_USAGE_CHECK(!filename.empty(), "The filename cannot be empty");
492  return get_model()->set_attribute(get_filename_key(), get_particle_index(),
493  get_absolute_path(filename));
494  }
495 
496  //! \return the filename, as an absolute path
497  std::string get_filename() const {
498  return get_model()->get_attribute(get_filename_key(), get_particle_index());
499  }
500 
502  IMP_DECORATOR_SETUP_1(ScriptProvenance, std::string, filename);
504 };
505 
506 //! Track creation of a system fragment from running some software.
507 /** Part of the system (usually the top of a Hierarchy) tagged with this
508  decorator is understood to have been generated by running the given
509  software (e.g. IMP itself, or an extension module).
510 
511  \note While obviously every model has to be generated by IMP, it is
512  useful to track the version of IMP used, as during a long protocol
513  it's possible (although not ideal!) for different IMP versions
514  to be used for different steps.
515  */
516 class IMPCOREEXPORT SoftwareProvenance : public Provenance {
517  static void do_setup_particle(Model *m, ParticleIndex pi,
518  std::string name,
519  std::string version,
520  std::string location) {
522  m->add_attribute(get_name_key(), pi, name);
523  m->add_attribute(get_version_key(), pi, version);
524  m->add_attribute(get_location_key(), pi, location);
525  }
526 
527  static void do_setup_particle(Model *m, ParticleIndex pi,
528  SoftwareProvenance o) {
529  do_setup_particle(m, pi, o.get_software_name(), o.get_version(),
530  o.get_location());
531  }
532 
533  static StringKey get_name_key();
534  static StringKey get_version_key();
535  static StringKey get_location_key();
536 
537 public:
538  static bool get_is_setup(Model *m, ParticleIndex pi) {
539  return m->get_has_attribute(get_name_key(), pi)
540  && m->get_has_attribute(get_version_key(), pi)
541  && m->get_has_attribute(get_location_key(), pi);
542  }
543 
544  //! Set the name
545  void set_software_name(std::string name) const {
546  return get_model()->set_attribute(get_name_key(),
547  get_particle_index(), name);
548  }
549 
550  //! \return the name
551  std::string get_software_name() const {
552  return get_model()->get_attribute(get_name_key(), get_particle_index());
553  }
554 
555  //! Set the version
556  void set_version(std::string version) const {
557  return get_model()->set_attribute(get_version_key(),
558  get_particle_index(), version);
559  }
560 
561  //! \return the version
562  std::string get_version() const {
563  return get_model()->get_attribute(get_version_key(),
565  }
566 
567  //! Set the location
568  void set_location(std::string location) const {
569  return get_model()->set_attribute(get_location_key(),
570  get_particle_index(), location);
571  }
572 
573  //! \return the location
574  std::string get_location() const {
575  return get_model()->get_attribute(get_location_key(),
577  }
578 
580  IMP_DECORATOR_SETUP_3(SoftwareProvenance, std::string, name,
581  std::string, version, std::string, location);
583 };
584 
585 //! Tag part of the system to track how it was created.
586 class IMPCOREEXPORT Provenanced : public Decorator {
587  static void do_setup_particle(Model *m, ParticleIndex pi,
588  Provenance p) {
589  m->add_attribute(get_provenance_key(), pi, p.get_particle_index());
590  }
591 
592  static ParticleIndexKey get_provenance_key();
593 public:
594 
595  static bool get_is_setup(Model *m, ParticleIndex pi) {
596  return m->get_has_attribute(get_provenance_key(), pi);
597  }
598 
599  Provenance get_provenance() const {
600  ParticleIndex pi = get_model()->get_attribute(get_provenance_key(),
602  return Provenance(get_model(), pi);
603  }
604 
605  void set_provenance(Provenance p) const {
606  get_model()->set_attribute(get_provenance_key(), get_particle_index(),
607  p.get_particle_index());
608  }
609 
612 };
613 
614 //! Add provenance to part of the model.
615 IMPCOREEXPORT void add_provenance(Model *m, ParticleIndex pi,
616  Provenance p);
617 
618 //! Clone provenance (including previous provenance)
619 IMPCOREEXPORT Provenance create_clone(Provenance p);
620 
621 IMPCORE_END_NAMESPACE
622 
623 #endif /* IMPCORE_PROVENANCE_H */
The base class for decorators.
static Provenance setup_particle(Model *m, ParticleIndex pi)
Definition: provenance.h:74
Various general useful macros for IMP.
ParticleIndex get_particle_index() const
Returns the particle index decorated by this decorator.
Definition: Decorator.h:188
int get_number_of_frames() const
Definition: provenance.h:309
Basic types used by IMP.
void set_number_of_iterations(int iterations) const
Set the number of iterations.
Definition: provenance.h:241
Track creation of a system fragment from running some software.
Definition: provenance.h:516
int get_number_of_members() const
Definition: provenance.h:451
Hierarchy create_clone(Hierarchy d)
Clone the Hierarchy.
void set_version(std::string version) const
Set the version.
Definition: provenance.h:556
void set_threshold(double threshold) const
Set the score threshold.
Definition: provenance.h:403
std::string get_method() const
Definition: provenance.h:225
double get_threshold() const
Definition: provenance.h:409
#define IMP_DECORATOR_SETUP_1(Name, FirstArgumentType, first_argument_name)
An exception for an invalid usage of IMP.
Definition: exception.h:123
Model * get_model() const
Returns the Model containing the particle.
Definition: Decorator.h:191
std::string get_software_name() const
Definition: provenance.h:551
std::string get_location() const
Definition: provenance.h:574
void set_previous(Provenance p)
Set the previous provenance.
Definition: provenance.h:64
int get_number_of_replicas() const
Definition: provenance.h:259
void set_method(std::string method) const
Definition: provenance.h:218
void set_location(std::string location) const
Set the location.
Definition: provenance.h:568
Track creation of a system fragment from sampling.
Definition: provenance.h:173
Handling of file input/output.
void set_method(std::string method) const
Definition: provenance.h:380
void set_filename(std::string filename) const
Set the filename.
Definition: provenance.h:120
Track creation of a system fragment by combination.
Definition: provenance.h:280
void set_software_name(std::string name) const
Set the name.
Definition: provenance.h:545
Class for storing model, its restraints, constraints, and particles.
Definition: Model.h:72
void set_number_of_replicas(int replicas) const
Set the number of replicas.
Definition: provenance.h:253
std::string get_filename() const
Definition: provenance.h:127
Provenance get_previous() const
Definition: provenance.h:45
std::string get_version() const
Definition: provenance.h:562
void set_chain_id(std::string chain_id) const
Set the chain ID.
Definition: provenance.h:132
void add_attribute(TypeKey attribute_key, ParticleIndex particle, Type value)
add particle atribute with the specied key and initial value
Track creation of a system fragment by filtering.
Definition: provenance.h:340
std::string get_filename() const
Definition: provenance.h:497
Various general useful macros for IMP.
void set_number_of_runs(int runs) const
Set the number of runs.
Definition: provenance.h:314
Track creation of a system fragment from a PDB file.
Definition: provenance.h:86
#define IMP_DECORATOR_SETUP_2(Name, FirstArgumentType, first_argument_name,SecondArgumentType, second_argument_name)
void set_number_of_frames(int frames) const
Set the total number of frames.
Definition: provenance.h:303
void set_attribute(TypeKey attribute_key, ParticleIndex particle, Type value)
set the value of particle attribute with the specified key
#define IMP_DECORATOR_SETUP_0(Name)
void set_residue_offset(int residue_offset) const
Set the offset between PDB and internal numbering (defaults to 0)
Definition: provenance.h:143
#define IMP_DECORATOR_SETUP_4(Name, FirstArgumentType, first_argument_name,SecondArgumentType, second_argument_name,ThirdArgumentType, third_argument_name,FourthArgumentType, fourth_argument_name)
void set_number_of_members(int members) const
Set the number of cluster members.
Definition: provenance.h:445
int get_number_of_frames() const
Definition: provenance.h:236
Interface to specialized Particle types (e.g. atoms)
Definition: Decorator.h:118
std::string get_absolute_path(std::string file)
Convert a possibly relative path to an absolute path.
void set_filename(std::string filename) const
Set the filename.
Definition: provenance.h:490
A shared base class to help in debugging and things.
int get_number_of_runs() const
Definition: provenance.h:320
#define IMP_DECORATOR_METHODS(Name, Parent)
Track creation of a system fragment from clustering.
Definition: provenance.h:426
#define IMP_USAGE_CHECK(expr, message)
A runtime test for incorrect usage of a class or method.
Definition: check_macros.h:168
std::string get_method() const
Definition: provenance.h:387
bool get_has_attribute(TypeKey attribute_key, ParticleIndex particle) const
return true if particle has attribute with the specified key
Track how parts of the system were created.
Definition: provenance.h:31
#define IMP_ALWAYS_CHECK(condition, message, exception_name)
Throw an exception if a check fails.
Definition: check_macros.h:61
#define IMP_DECORATOR_SETUP_3(Name, FirstArgumentType, first_argument_name,SecondArgumentType, second_argument_name,ThirdArgumentType, third_argument_name)
int get_number_of_frames() const
Definition: provenance.h:398
void add_provenance(Model *m, ParticleIndex pi, Provenance p)
Add provenance to part of the model.
Tag part of the system to track how it was created.
Definition: provenance.h:586
std::string get_chain_id() const
Definition: provenance.h:138
Type get_attribute(TypeKey attribute_key, ParticleIndex particle)
get the value of the particle attribute with the specified key
int get_number_of_iterations() const
Definition: provenance.h:247
void set_number_of_frames(int frames) const
Set the number of frames.
Definition: provenance.h:392
Track creation of a system fragment from running a script.
Definition: provenance.h:465
void set_number_of_frames(int frames) const
Set the number of frames.
Definition: provenance.h:230