IMP logo
IMP Reference Guide  develop.27926d84dc,2024/04/19
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-2023 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 SparseParticleIndexKey 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 SparseStringKey get_filename_key();
105  static SparseStringKey get_chain_key();
106  static SparseIntKey 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 SparseStringKey get_method_key();
193  static SparseIntKey get_frames_key();
194  static SparseIntKey get_iterations_key();
195  static SparseIntKey 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 SparseIntKey get_runs_key();
294  static SparseIntKey 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 SparseStringKey get_method_key();
356  static SparseFloatKey get_threshold_key();
357  static SparseIntKey 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,
428  double precision=0., std::string density="") {
430  m->add_attribute(get_members_key(), pi, members);
431  m->add_attribute(get_precision_key(), pi, precision);
432  if (density.empty()) {
433  m->add_attribute(get_density_key(), pi, density);
434  } else {
435  m->add_attribute(get_density_key(), pi, get_absolute_path(density));
436  }
437  }
438 
439  static void do_setup_particle(Model *m, ParticleIndex pi,
440  ClusterProvenance o) {
441  do_setup_particle(m, pi, o.get_number_of_members()), o.get_precision(),
442  o.get_density();
443  }
444 
445  static SparseIntKey get_members_key();
446  static SparseFloatKey get_precision_key();
447  static SparseStringKey get_density_key();
448 
449 public:
450  static bool get_is_setup(Model *m, ParticleIndex pi) {
451  return m->get_has_attribute(get_members_key(), pi)
452  && m->get_has_attribute(get_precision_key(), pi)
453  && m->get_has_attribute(get_density_key(), pi);
454  }
455 
456  //! Set the number of cluster members
457  void set_number_of_members(int members) const {
458  return get_model()->set_attribute(get_members_key(), get_particle_index(),
459  members);
460  }
461 
462  //! \return the number of cluster members
463  int get_number_of_members() const {
464  return get_model()->get_attribute(get_members_key(), get_particle_index());
465  }
466 
467  //! Set the cluster precision
468  void set_precision(double precision) const {
469  return get_model()->set_attribute(get_precision_key(), get_particle_index(),
470  precision);
471  }
472 
473  //! \return the cluster precision
474  double get_precision() const {
475  return get_model()->get_attribute(get_precision_key(),
477  }
478 
479  //! Set the path to the localization probability density for this cluster
480  /** Typically, this is used to point to an MRC file, but can be empty if
481  no such density is available. The path can be relative or absolute.
482  Internally, an absolute path will be stored (although generally it will
483  be converted to a relative path when storing in a file, such as RMF).
484  */
485  void set_density(std::string density) const {
486  if (!density.empty()) {
487  density = get_absolute_path(density);
488  }
489  return get_model()->set_attribute(get_density_key(), get_particle_index(),
490  density);
491  }
492 
493  //! \return the localization probability density filename, as an absolute path
494  std::string get_density() const {
495  return get_model()->get_attribute(get_density_key(), get_particle_index());
496  }
497 
500  IMP_DECORATOR_SETUP_2(ClusterProvenance, int, members, double, precision);
501  IMP_DECORATOR_SETUP_3(ClusterProvenance, int, members, double, precision,
502  std::string, density);
504 };
505 
506 //! Track creation of a system fragment from running a script.
507 /** Part of the system (usually the top of a Hierarchy) tagged with this
508  decorator is understood to have been generated by running a script
509  (usually a Python script).
510  */
511 class IMPCOREEXPORT ScriptProvenance : public Provenance {
512  static void do_setup_particle(Model *m, ParticleIndex pi,
513  std::string filename) {
515  IMP_USAGE_CHECK(!filename.empty(), "The filename cannot be empty.");
516  m->add_attribute(get_filename_key(), pi, get_absolute_path(filename));
517  }
518 
519  static void do_setup_particle(Model *m, ParticleIndex pi,
520  ScriptProvenance o) {
521  do_setup_particle(m, pi, o.get_filename());
522  }
523 
524  static SparseStringKey get_filename_key();
525 
526 public:
527  static bool get_is_setup(Model *m, ParticleIndex pi) {
528  return m->get_has_attribute(get_filename_key(), pi);
529  }
530 
531  //! Set the filename
532  /** The path can be relative or absolute. Internally, an absolute
533  path will be stored (although generally it will be converted to
534  a relative path when storing in a file, such as RMF).
535  */
536  void set_filename(std::string filename) const {
537  IMP_USAGE_CHECK(!filename.empty(), "The filename cannot be empty");
538  return get_model()->set_attribute(get_filename_key(), get_particle_index(),
539  get_absolute_path(filename));
540  }
541 
542  //! \return the filename, as an absolute path
543  std::string get_filename() const {
544  return get_model()->get_attribute(get_filename_key(), get_particle_index());
545  }
546 
548  IMP_DECORATOR_SETUP_1(ScriptProvenance, std::string, filename);
550 };
551 
552 //! Track creation of a system fragment from running some software.
553 /** Part of the system (usually the top of a Hierarchy) tagged with this
554  decorator is understood to have been generated by running the given
555  software (e.g. IMP itself, or an extension module).
556 
557  \note While obviously every model has to be generated by IMP, it is
558  useful to track the version of IMP used, as during a long protocol
559  it's possible (although not ideal!) for different IMP versions
560  to be used for different steps.
561  */
562 class IMPCOREEXPORT SoftwareProvenance : public Provenance {
563  static void do_setup_particle(Model *m, ParticleIndex pi,
564  std::string name,
565  std::string version,
566  std::string location) {
568  m->add_attribute(get_name_key(), pi, name);
569  m->add_attribute(get_version_key(), pi, version);
570  m->add_attribute(get_location_key(), pi, location);
571  }
572 
573  static void do_setup_particle(Model *m, ParticleIndex pi,
574  SoftwareProvenance o) {
575  do_setup_particle(m, pi, o.get_software_name(), o.get_version(),
576  o.get_location());
577  }
578 
579  static SparseStringKey get_name_key();
580  static SparseStringKey get_version_key();
581  static SparseStringKey get_location_key();
582 
583 public:
584  static bool get_is_setup(Model *m, ParticleIndex pi) {
585  return m->get_has_attribute(get_name_key(), pi)
586  && m->get_has_attribute(get_version_key(), pi)
587  && m->get_has_attribute(get_location_key(), pi);
588  }
589 
590  //! Set the name
591  void set_software_name(std::string name) const {
592  return get_model()->set_attribute(get_name_key(),
593  get_particle_index(), name);
594  }
595 
596  //! \return the name
597  std::string get_software_name() const {
598  return get_model()->get_attribute(get_name_key(), get_particle_index());
599  }
600 
601  //! Set the version
602  void set_version(std::string version) const {
603  return get_model()->set_attribute(get_version_key(),
604  get_particle_index(), version);
605  }
606 
607  //! \return the version
608  std::string get_version() const {
609  return get_model()->get_attribute(get_version_key(),
611  }
612 
613  //! Set the location
614  void set_location(std::string location) const {
615  return get_model()->set_attribute(get_location_key(),
616  get_particle_index(), location);
617  }
618 
619  //! \return the location
620  std::string get_location() const {
621  return get_model()->get_attribute(get_location_key(),
623  }
624 
626  IMP_DECORATOR_SETUP_3(SoftwareProvenance, std::string, name,
627  std::string, version, std::string, location);
629 };
630 
631 //! Tag part of the system to track how it was created.
632 class IMPCOREEXPORT Provenanced : public Decorator {
633  static void do_setup_particle(Model *m, ParticleIndex pi,
634  Provenance p) {
635  m->add_attribute(get_provenance_key(), pi, p.get_particle_index());
636  }
637 
638  static SparseParticleIndexKey get_provenance_key();
639 public:
640 
641  static bool get_is_setup(Model *m, ParticleIndex pi) {
642  return m->get_has_attribute(get_provenance_key(), pi);
643  }
644 
645  Provenance get_provenance() const {
646  ParticleIndex pi = get_model()->get_attribute(get_provenance_key(),
648  return Provenance(get_model(), pi);
649  }
650 
651  void set_provenance(Provenance p) const {
652  get_model()->set_attribute(get_provenance_key(), get_particle_index(),
653  p.get_particle_index());
654  }
655 
658 };
659 
660 //! Add provenance to part of the model.
661 IMPCOREEXPORT void add_provenance(Model *m, ParticleIndex pi,
662  Provenance p);
663 
664 //! Clone provenance (including previous provenance)
665 IMPCOREEXPORT Provenance create_clone(Provenance p);
666 
667 IMPCORE_END_NAMESPACE
668 
669 #endif /* IMPCORE_PROVENANCE_H */
The base class for decorators.
static Provenance setup_particle(Model *m, ParticleIndex pi)
Definition: provenance.h:74
Helper macros for implementing IMP Objects.
ParticleIndex get_particle_index() const
Returns the particle index decorated by this decorator.
Definition: Decorator.h:211
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:562
int get_number_of_members() const
Definition: provenance.h:463
Hierarchy create_clone(Hierarchy d)
Clone the Hierarchy.
void set_version(std::string version) const
Set the version.
Definition: provenance.h:602
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
std::string get_density() const
Definition: provenance.h:494
#define IMP_DECORATOR_SETUP_1(Name, FirstArgumentType, first_argument_name)
An exception for an invalid usage of IMP.
Definition: exception.h:122
Model * get_model() const
Returns the Model containing the particle.
Definition: Decorator.h:214
std::string get_software_name() const
Definition: provenance.h:597
std::string get_location() const
Definition: provenance.h:620
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:614
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:591
Class for storing model, its restraints, constraints, and particles.
Definition: Model.h:86
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
void set_precision(double precision) const
Set the cluster precision.
Definition: provenance.h:468
Provenance get_previous() const
Definition: provenance.h:45
std::string get_version() const
Definition: provenance.h:608
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 attribute with the specified key and initial value
Track creation of a system fragment by filtering.
Definition: provenance.h:340
std::string get_filename() const
Definition: provenance.h:543
Helper macros for implementing Decorators.
void set_number_of_runs(int runs) const
Set the number of runs.
Definition: provenance.h:314
double get_precision() const
Definition: provenance.h:474
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
A base class for Keys.
Definition: Key.h:45
#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:457
int get_number_of_frames() const
Definition: provenance.h:236
Interface to specialized Particle types (e.g. atoms)
Definition: Decorator.h:119
std::string get_absolute_path(std::string file)
Convert a possibly relative path to an absolute path.
void set_density(std::string density) const
Set the path to the localization probability density for this cluster.
Definition: provenance.h:485
void set_filename(std::string filename) const
Set the filename.
Definition: provenance.h:536
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:632
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:511
void set_number_of_frames(int frames) const
Set the number of frames.
Definition: provenance.h:230