/usr/include/BALL/STRUCTURE/atomBijection.h is in libball1.4-dev 1.4.1+20111206-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 | // -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
#ifndef BALL_STRUCTURE_ATOMBIJECTION_H
#define BALL_STRUCTURE_ATOMBIJECTION_H
#ifndef BALL_COMMON_H
# include <BALL/common.h>
#endif
#ifndef BALL_KERNEL_ATOMCONTAINER_H
# include <BALL/KERNEL/atomContainer.h>
#endif
namespace BALL
{
/** Atom bijection.
This class implements a mapping of two sets of atoms onto each other.
It is used by the \link StructureMapper StructurMapper \endlink class
and the \link RMSDMinimizer RMSDMinimizer \endlink classes to define
which atoms are mapped onto each other.
\p
There are a few methods for general mappings (based on atom order, atom names, etc.)
that should suffice for most applications. If you want to match proteins based on
particular mappings (e.g. based on a pairwise alignment), you should create the mapping
yourself. This is easily done by pushing an AtomPair into the vector:
\code
Atom* atom1 = ...;
Atom* atom2 = ...;
// Create an empty bijection
AtomBijection bijection;
// Map atom1 onto atom2.
bijection.push_back(AtomBijection::AtomPair(atom1, atom2));
\endcode
\p
The class behaves more or less like the vector of atom pointer pairs it
truly is. In particular, the STL container interface has been fully
implemented.
\ingroup StructureMapping
*/
class BALL_EXPORT AtomBijection
: public std::vector<std::pair<Atom*, Atom*> >
{
public:
/** @name Type definitions */
//@{
/** A struct for representing an atom pair of the mapping.
*/
typedef std::pair<Atom*, Atom*> AtomPair;
typedef std::vector<std::pair<Atom*, Atom*> > PairVector;
//@}
/** @name Constructors and Destructors
*/
//@{
/** Default constructor
*/
AtomBijection() {}
/** Construct a trivial bijection between to atom containers.
Construct a simple bijection mapping the atoms of the two
atom containers onto each other. The mapping iterates
over the atoms and stops assigning pairs of atoms as soon
as the smalles of the two atom sets is fully assigned.
The larger of the two atom container can thus contain
unassigned atoms. No checking with respect to atom names,
elements or the like are being made.
\p
This corresponds to calling assignTrivial after default
construction
*/
AtomBijection(AtomContainer& A, AtomContainer& B);
/// Destructor
virtual ~AtomBijection() {}
//@}
/** @name Bijection construction */
//@{
/** Assign all atoms in the two atom containers in order.
Construct a simple bijection mapping the atoms of the two
atom containers onto each other. The mapping iterates
over the atoms and stops assigning pairs of atoms as soon
as the smalles of the two atom sets is fully assigned.
The larger of the two atom container can thus contain
unassigned atoms. No checking with respect to atom names,
elements or the like are being made.
\p
This trivial bijection is useful, if the two atom containers
correspond to exactly the same structure (i.e. they
just differ in their conformations).
Care must be taken that the order of atoms is correct.
Beware of adding hydrogens, which might mess up atom
order in some cases.
\p
The number of atoms mapped is returned.
*/
Size assignTrivial(AtomContainer& A, AtomContainer& B);
/** Assign the atom pairs through a name matching.
This method creates a mapping based on the atom names.
If the atom is contained in a Residue/Protein, the name consists
of the fully qualified name (<chain>:<residue name>:<residue id>:<atom name>).
If no pair of atoms could by matched this way, it will try to match by
atom names only (not considering residues, chains or the like).
\p
The method constructs a hash map for all atom names, so run time is linear
in the number of atoms.
\p
The number of atoms mapped is returned.
*/
Size assignByName(AtomContainer& A, AtomContainer& B);
/** Assign the C-alpha atoms ordered by sequence.
This method iterated over all residues and assigns
the C-alpha atoms (i.e. all atoms named "CA" in a
residue with the property AMINO_ACID) of the two proteins
in the order they are traversed. The size of the mapping
corresponds to the minimum of the number of C-alpha atoms
of both atom containers.
\p
\return The number of atom pairs mapped
*/
Size assignCAlphaAtoms(AtomContainer& A, AtomContainer& B);
/** Assign the backbone atoms ordered by sequence.
This method iterated over all residues and assigns
the backbone atoms (i.e. all atoms named "CA", "C",
"N", "H", and "O" in every residue with the property AMINO_ACID)
of the two proteins
in the order they are traversed. The mapping terminates,
if the traversal of the residues in one of the two atom containers
terminates.
\p
\return The number of atom pairs mapped
*/
Size assignBackboneAtoms(AtomContainer& A, AtomContainer& B);
//@}
/** @name Accessors */
//@{
/// Calculate the root mean squared deviation of the mapped atoms.
double calculateRMSD() const;
//@}
/** @name STL container compliance */
//@{
///
using PairVector::size;
///
using PairVector::push_back;
///
using PairVector::begin;
///
using PairVector::end;
///
using PairVector::rbegin;
///
using PairVector::rend;
//@}
};
} // namespace BALL
#endif // BALL_STRUCTURE_ATOMBIJECTION_H
|