LOOS  v2.3.2
fid-lib.hpp
1 /*
2  Fiducial library
3 */
4 
5 
6 /*
7 
8  This file is part of LOOS.
9 
10  LOOS (Lightweight Object-Oriented Structure library)
11  Copyright (c) 2010, Tod D. Romo
12  Department of Biochemistry and Biophysics
13  School of Medicine & Dentistry, University of Rochester
14 
15  This package (LOOS) is free software: you can redistribute it and/or modify
16  it under the terms of the GNU General Public License as published by
17  the Free Software Foundation under version 3 of the License.
18 
19  This package is distributed in the hope that it will be useful,
20  but WITHOUT ANY WARRANTY; without even the implied warranty of
21  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  GNU General Public License for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with this program. If not, see <http://www.gnu.org/licenses/>.
26 */
27 
28 // @cond PACKAGES_INTERNAL
29 
30 #if !defined(LOOS_FIDLIB_HPP)
31 #define LOOS_FIDLIB_HPP
32 
33 
34 
35 #include <loos.hpp>
36 
37 
38 typedef std::vector<int> vecInt;
39 typedef std::vector<uint> vecUint;
40 typedef std::vector<loos::AtomicGroup> vecGroup;
41 typedef std::vector<double> vecDouble;
42 
43 
44 
45 
46 // Return indices of non-zero entries in the vector (i.e. frames that are not assigned)
47 vecUint findFreeFrames(const vecInt& map);
48 
49 // Given a set of reference structures and a trajectory, classify the trajectory
50 // based on which reference structure is closest to each trajectory frame
51 vecUint assignStructures(loos::AtomicGroup& model, loos::pTraj& traj, const vecUint& frames, const vecGroup& refs);
52 
53 // Given a vector that contains indices into a trajectory, will trim off the
54 // end so the # of frames is an even multiple of the requested bin size (via frac)
55 vecUint trimFrames(const vecUint& frames, const double frac);
56 
57 // Randomly partition trajectory space
58 // f = the fractional bin size (i.e. probability)
59 boost::tuple<vecGroup, vecUint> pickFiducials(loos::AtomicGroup& model, loos::pTraj& traj, const vecUint& frames, const double f);
60 
61 // Find the max value in the vector
62 int findMaxBin(const vecInt& assignments);
63 
64 // Simple histogram of bin assignments
65 vecUint histogramBins(const vecInt& assignments);
66 
67 // @endcond TOOLS_INTERNAL
68 
69 #endif
Class for handling groups of Atoms (pAtoms, actually)
Definition: AtomicGroup.hpp:87