IMP logo
IMP Reference Guide  develop.7cb8855c60,2024/10/04
The Integrative Modeling Platform
CrossLinkRestraintSet.h
Go to the documentation of this file.
1 /**
2  * \file IMP/pmi/CrossLinkRestraintSet.h
3  * \brief A RestraintSet subclass to track cross-link metadata.
4  *
5  * Copyright 2007-2023 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPPMI_CROSS_LINK_RESTRAINT_SET_H
10 #define IMPPMI_CROSS_LINK_RESTRAINT_SET_H
11 
12 #include "pmi_config.h"
13 #include <IMP/RestraintSet.h>
14 #include <cereal/access.hpp>
15 #include <cereal/types/base_class.hpp>
16 
17 IMPPMI_BEGIN_NAMESPACE
18 
19 //! A RestraintSet subclass to track cross-link metadata.
20 /** This is provided so that we can write information about a set of
21  cross-links to an RMF file (e.g. the CSV file from which they were read).
22  */
23 class IMPPMIEXPORT CrossLinkRestraintSet : public RestraintSet
24 {
25  std::string filename_;
26  double length_, slope_;
27  std::string auth_name_, chemical_name_, smiles_, smiles_canonical_, inchi_,
28  inchi_key_;
29 
30  friend class cereal::access;
31  template<class Archive> void serialize(Archive &ar) {
32  ar(cereal::base_class<RestraintSet>(this),
33  filename_, length_, slope_, auth_name_, chemical_name_, smiles_,
34  smiles_canonical_, inchi_, inchi_key_);
35  }
37 
38  public:
40  const std::string &name = "CrossLinkRestraintSet %1%")
41  : RestraintSet(m, name) {}
43 
44  void set_metadata(std::string filename, double length, double slope) {
45  filename_ = filename;
46  length_ = length;
47  slope_ = slope;
48  }
49 
50  void set_linker_auth_name(std::string name) { auth_name_ = name; }
51  void set_linker_chemical_name(std::string name) { chemical_name_ = name; }
52  void set_linker_smiles(std::string name) { smiles_ = name; }
53  void set_linker_smiles_canonical(std::string name) {
54  smiles_canonical_ = name;
55  }
56  void set_linker_inchi(std::string name) { inchi_ = name; }
57  void set_linker_inchi_key(std::string name) { inchi_key_ = name; }
58 
59  virtual RestraintInfo *get_static_info() const override;
60 
62 };
63 
64 IMPPMI_END_NAMESPACE
65 
66 #endif /* IMPPMI_CROSS_LINK_RESTRAINT_SET_H */
virtual RestraintInfo * get_static_info() const
Definition: Restraint.h:178
Used to hold a set of related restraints.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
Object used to hold a set of restraints.
Definition: RestraintSet.h:41
Class for storing model, its restraints, constraints, and particles.
Definition: Model.h:86
A RestraintSet subclass to track cross-link metadata.
#define IMP_OBJECT_SERIALIZE_DECL(Name)
Declare methods needed for serialization of Object pointers.
Definition: object_macros.h:95
Report key:value information on restraints.
Definition: RestraintInfo.h:47