IMP logo
IMP Reference Guide  2.16.0
The Integrative Modeling Platform
anchor_utilities.h
Go to the documentation of this file.
1 /**
2  * \file IMP/multifit/anchor_utilities.h
3  * \brief Common functions in anchor calculations
4  *
5  * Copyright 2007-2021 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPMULTIFIT_ANCHOR_UTILITIES_H
10 #define IMPMULTIFIT_ANCHOR_UTILITIES_H
11 
12 #include <IMP/multifit/multifit_config.h>
13 #include <IMP/atom/Hierarchy.h>
14 #include <IMP/statistics/internal/VQClustering.h>
15 #include <IMP/statistics/internal/DataPoints.h>
16 #include "DataPointsAssignment.h"
17 #include "anchors_reader.h"
18 
19 IMPMULTIFIT_BEGIN_NAMESPACE
20 
21 IMPMULTIFITEXPORT
22 inline AnchorsData molecule2anchors(atom::Hierarchy mh, int k) {
23  IMP_NEW(IMP::statistics::internal::ParticlesDataPoints, ddp,
24  (core::get_leaves(mh)));
25  IMP::statistics::internal::VQClustering vq(ddp, k);
26  vq.run();
27  multifit::DataPointsAssignment assignment(ddp, &vq);
28  multifit::AnchorsData ad(assignment.get_centers(), *(assignment.get_edges()));
29  return ad;
30 }
31 
32 IMPMULTIFITEXPORT
33 //! Generate anchors in several formats for a given density map.
34 void get_anchors_for_density(em::DensityMap *dmap, int number_of_means,
35  float density_threshold, std::string pdb_filename,
36  std::string cmm_filename, std::string seg_filename,
37  std::string txt_filename);
38 
39 //! Get lists of anchors that match a sequence of secondary structures
40 /**
41  \param[in] ad The AnchorsData
42  \param[in] ssrs The SecondaryStructureResidue particles to match
43  \param[in] max_rmsd SecondaryStructureResidue match must be
44  below this value (0.816 is rmsd of known SSE to random)
45 */
46 IMPMULTIFITEXPORT
48  const AnchorsData &ad, const atom::SecondaryStructureResidues &ssrs,
49  Float max_rmsd = 0.7);
50 
51 IMPMULTIFIT_END_NAMESPACE
52 
53 #endif /* IMPMULTIFIT_ANCHOR_UTILITIES_H */
IntsList get_anchor_indices_matching_secondary_structure(const AnchorsData &ad, const atom::SecondaryStructureResidues &ssrs, Float max_rmsd=0.7)
Get lists of anchors that match a sequence of secondary structures.
Tools for data points assignment, after anchor point segmentation.
#define IMP_NEW(Typename, varname, args)
Declare a ref counted pointer to a new object.
Definition: object_macros.h:64
Decorator for helping deal with a hierarchy of molecules.
void get_anchors_for_density(em::DensityMap *dmap, int number_of_means, float density_threshold, std::string pdb_filename, std::string cmm_filename, std::string seg_filename, std::string txt_filename)
Generate anchors in several formats for a given density map.
IMP::Vector< Ints > IntsList
Standard way to pass a bunch of Ints values.
Definition: types.h:56
double Float
Basic floating-point value (could be float, double...)
Definition: types.h:20
Hierarchies get_leaves(const Selection &h)
handles reading of anchors data