IMP  2.4.0
The Integrative Modeling Platform
protein_anchors_mapping_reader.h
Go to the documentation of this file.
1 /**
2  * \file IMP/multifit/protein_anchors_mapping_reader.h
3  * \brief handles reading matches between a protein and its anchors
4  *
5  * Copyright 2007-2015 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPMULTIFIT_PROTEIN_ANCHORS_MAPPING_READER_H
10 #define IMPMULTIFIT_PROTEIN_ANCHORS_MAPPING_READER_H
11 
12 #include <IMP/multifit/multifit_config.h>
17 
18 IMPMULTIFIT_BEGIN_NAMESPACE
19 
20 //! stores the anchors sampling space for each protein
21 class IMPMULTIFITEXPORT ProteinsAnchorsSamplingSpace {
22  public:
24  : prots_(prots) {}
25  void set_anchors(const multifit::AnchorsData &data) { anchors_data_ = data; }
26  multifit::AnchorsData get_anchors() const { return anchors_data_; }
27  inline std::string get_anchors_filename() const { return anchors_fn_; }
28  void set_anchors_filename(const std::string &fn) { anchors_fn_ = fn; }
29  multifit::ProteomicsData *get_proteomics_data() const { return prots_; }
30  void add_protein(const multifit::ProteinRecordData &rec) {
31  prots_->add_protein(rec);
32  }
33  IntsList get_paths_for_protein(const std::string &prot_name) const {
34  IMP_USAGE_CHECK(paths_map_.find(prot_name) != paths_map_.end(),
35  "Protein:" << prot_name << " is not found");
36  return paths_map_.find(prot_name)->second;
37  }
38  void set_paths_filename_for_protein(const std::string &prot_name,
39  const std::string &paths_filename) {
40  IMP_USAGE_CHECK(paths_filename_.find(prot_name) == paths_filename_.end(),
41  "Protein:" << prot_name << " is already set");
42  paths_filename_[prot_name] = paths_filename;
43  }
44  std::string get_paths_filename_for_protein(const std::string &prot_name)
45  const {
46  IMP_USAGE_CHECK(paths_filename_.find(prot_name) != paths_filename_.end(),
47  "Protein:" << prot_name << " is not found");
48  return paths_filename_.find(prot_name)->second;
49  }
50  void set_paths_for_protein(const std::string &prot_name, IntsList paths) {
51  IMP_USAGE_CHECK(paths_map_.find(prot_name) == paths_map_.end(),
52  "Protein:" << prot_name << " is already set");
53  paths_map_[prot_name] = paths;
54  }
55 
56  void show(std::ostream &s = std::cout) const;
57 
58  protected:
59  std::map<std::string, IntsList> paths_map_;
60  std::map<std::string, std::string> paths_filename_;
61  multifit::AnchorsData anchors_data_;
63  std::string anchors_fn_;
64 };
66 
67 IMPMULTIFITEXPORT
68 ProteinsAnchorsSamplingSpace read_protein_anchors_mapping(
69  multifit::ProteomicsData *prots, const std::string &anchors_prot_map_fn,
70  int max_paths = INT_MAX);
71 IMPMULTIFITEXPORT
72 void write_protein_anchors_mapping(
73  const std::string &anchors_prot_map_fn, const std::string &anchors_fn,
74  const std::vector<std::pair<String, String> > &prot_paths);
75 
76 // write the protein anchors mapping
77 IMPMULTIFITEXPORT
78 void write_protein_anchors_mapping(const std::string &anchors_prot_map_fn,
80  const Strings &prot_names);
81 
82 //! Get the sampling space of few of the proteins
83 IMPMULTIFITEXPORT
85  const ProteinsAnchorsSamplingSpace &prots_ss, const Strings &prot_names);
86 //! Get the assembly data for a few of the proteins
87 IMPMULTIFITEXPORT
89  multifit::SettingsData *prots_sd, const Strings &prot_names);
90 
91 IMPMULTIFIT_END_NAMESPACE
92 
93 #endif /* IMPMULTIFIT_PROTEIN_ANCHORS_MAPPING_READER_H */
handles reading of proteomics data
Storage of proteomics data.
A smart pointer to a ref-counted Object that is a class member.
Definition: Pointer.h:147
Storage of anchors (points and edges)
stores the anchors sampling space for each protein
ProteinsAnchorsSamplingSpace get_part_of_sampling_space(const ProteinsAnchorsSamplingSpace &prots_ss, const Strings &prot_names)
Get the sampling space of few of the proteins.
multifit::SettingsData * get_partial_assembly_setting_data(multifit::SettingsData *prots_sd, const Strings &prot_names)
Get the assembly data for a few of the proteins.
int add_protein(std::string name, int start_res, int end_res, const std::string &mol_fn, const std::string &surface_fn, const std::string &ref_fn)
stored multifit settings data
#define IMP_VALUES(Name, PluralName)
Define the type for storing sets of values.
Definition: value_macros.h:23
Holds header data for optimization.
Definition: SettingsData.h:135
void show(Hierarchy h, std::ostream &out=std::cout)
Print out a molecular hierarchy.
#define IMP_USAGE_CHECK(expr, message)
A runtime test for incorrect usage of a class or method.
Definition: check_macros.h:170
Sample best solutions using Domino.
handles reading of anchors data