IMP  2.1.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-2013 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(
29  assignment.get_centers(),
30  *(assignment.get_edges()));
31  return ad;
32 }
33 
34 IMPMULTIFITEXPORT
35 //! Generate anchors in several formats for a given density map.
36 void get_anchors_for_density(em::DensityMap *dmap, int number_of_means,
37  float density_threshold,
38  std::string pdb_filename,
39  std::string cmm_filename,
40  std::string seg_filename,
41  std::string txt_filename);
42 
43 //! Get lists of anchors that match a sequence of secondary structures
44 /**
45  \param[in] ad The AnchorsData
46  \param[in] ssrs The SecondaryStructureResidue particles to match
47  \param[in] max_rmsd SecondaryStructureResidue match must be
48  below this value (0.816 is rmsd of known SSE to random)
49 */
50 IMPMULTIFITEXPORT
52  const AnchorsData &ad,
53  const atom::SecondaryStructureResidues &ssrs,
54  Float max_rmsd=0.7);
55 
56 IMPMULTIFIT_END_NAMESPACE
57 
58 #endif /* IMPMULTIFIT_ANCHOR_UTILITIES_H */
Hierarchies get_leaves(Hierarchy 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.
#define IMP_NEW(Typename, varname, args)
Declare a ref counted pointer to a new object.
Tools for data points assignment, after anchor point segmentation.
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::base::Vector< Ints > IntsList
Standard way to pass a bunch of Ints values.
Definition: base/types.h:56
double Float
Basic floating-point value (could be float, double...)
Definition: base/types.h:20
handles reading of anchors data