9 #ifndef IMPMULTIFIT_ANCHORS_READER_H
10 #define IMPMULTIFIT_ANCHORS_READER_H
17 #include <IMP/multifit/multifit_config.h>
19 IMPMULTIFIT_BEGIN_NAMESPACE
22 class IMPMULTIFITEXPORT AnchorsData {
26 points_=points;edges_=edges;
27 secondary_structure_ps_=Particles();
29 for (
unsigned int i=0;i<points_.size();i++) {
30 consider_point_.push_back(
true);
34 void remove_edges_for_node(
int node_ind) {
37 for(
int i=0;i<(int)edges_.size();i++) {
38 if (! ((edges_[i].first==node_ind) || (edges_[i].second==node_ind))) {
39 new_edges.push_back(edges_[i]);
42 consider_point_[node_ind]=
false;
45 int get_number_of_points()
const {
return points_.size();}
46 int get_number_of_edges()
const {
return edges_.size();}
47 bool get_is_point_considered(
int node_ind)
const {
48 return consider_point_[node_ind];}
49 void show(std::ostream& out=std::cout)
const {
50 out<<
"==== "<<points_.size()<<
" Anchors:"<<std::endl;
51 for(
int i=0;i<(int)points_.size();i++) {
52 out<<points_[i]<<std::endl;
54 out<<
"===="<<edges_.size()<<
" Edges:"<<std::endl;
55 for(
int i=0;i<(int)edges_.size();i++) {
56 out<<
"("<<edges_[i].first<<
","<<edges_[i].second<<
") ";
63 bool get_secondary_structure_is_set(){
64 return (secondary_structure_ps_.size()==points_.size());
68 void setup_secondary_structure(
Model *mdl);
76 void set_secondary_structure_probabilities(
const Particles &ssres_ps,
79 inline Particles get_secondary_structure_particles()
const {
80 return secondary_structure_ps_;
83 std::vector<bool> consider_point_;
86 Particles secondary_structure_ps_;
90 IMPMULTIFITEXPORT AnchorsData read_anchors_data(
const char *txt_filename);
92 void write_txt(
const std::string &txt_filename,
93 const AnchorsData &ad);
95 void write_cmm(
const std::string &cmm_filename,
96 const std::string &marker_set_name,
97 const AnchorsData &dpa);
99 IMPMULTIFIT_END_NAMESPACE