OpenStructure
Loading...
Searching...
No Matches
distance_test_common.hh
Go to the documentation of this file.
1//------------------------------------------------------------------------------
2// This file is part of the OpenStructure project <www.openstructure.org>
3//
4// Copyright (C) 2008-2020 by the OpenStructure authors
5//
6// This library is free software; you can redistribute it and/or modify it under
7// the terms of the GNU Lesser General Public License as published by the Free
8// Software Foundation; either version 3.0 of the License, or (at your option)
9// any later version.
10// This library is distributed in the hope that it will be useful, but WITHOUT
11// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13// details.
14//
15// You should have received a copy of the GNU Lesser General Public License
16// along with this library; if not, write to the Free Software Foundation, Inc.,
17// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18//------------------------------------------------------------------------------
19#ifndef OST_MOL_ALG_DISTANCE_TEST_COMMON_HH
20#define OST_MOL_ALG_DISTANCE_TEST_COMMON_HH
21
24
25namespace ost { namespace mol { namespace alg {
26
33
38bool DLLEXPORT_OST_MOL_ALG Swappable(const String& rname, const String& aname);
39
44{
45
46public:
48 UniqueAtomIdentifier(const String& chain,const ResNum& residue,const String& residue_name, const String& atom): chain_(chain),residue_(residue),residue_name_(residue_name),atom_(atom) {}
49
50 // to make the compiler happy (boost python map suite)
51 UniqueAtomIdentifier(): chain_(""),residue_(ResNum(1)),residue_name_(""),atom_("") {}
52
54 String GetChainName() const { return chain_; }
55
57 ResNum GetResNum() const { return residue_; }
58
60 String GetResidueName() const { return residue_name_; }
61
63 String GetAtomName() const { return atom_; }
64
67
68 // required because UniqueAtomIdentifier is used as a key for a std::map
69 bool operator==(const UniqueAtomIdentifier& rhs) const ;
70
71 // required because UniqueAtomIdentifier is used as a key for a std::map
72 bool operator<(const UniqueAtomIdentifier& rhs) const;
73
74private:
75
76 String chain_;
77 ResNum residue_;
78 String residue_name_;
79 String atom_;
80};
81
82// typedef used to make the code cleaner
83typedef std::pair<UniqueAtomIdentifier,UniqueAtomIdentifier> UAtomIdentifiers;
84
89typedef std::map<std::pair<UniqueAtomIdentifier,UniqueAtomIdentifier>,std::pair<Real,Real> > ResidueRDMap;
90
95typedef std::map<ost::mol::ResNum,ResidueRDMap> GlobalRDMap;
96
97// used by the multi-reference distance-list generator function
98typedef std::map<UniqueAtomIdentifier,int> ExistenceMap;
99
100}}}
101
102#endif
Contains the infomation needed to uniquely identify an atom in a structure.
String GetQualifiedAtomName() const
Returns the qualified name of the atom, as a String.
String GetAtomName() const
Returns the name of the atom, as a String.
String GetResidueName() const
Returns the name of the residue to which the atom belongs, as a String.
bool operator<(const UniqueAtomIdentifier &rhs) const
ResNum GetResNum() const
Returns the ResNum of the residue to which the atom belongs.
bool operator==(const UniqueAtomIdentifier &rhs) const
String GetChainName() const
Returns the name of the chain to which the atom belongs, as a String.
UniqueAtomIdentifier(const String &chain, const ResNum &residue, const String &residue_name, const String &atom)
Constructor with all the relevant information.
std::string String
Definition base.hh:54
#define DLLEXPORT_OST_MOL_ALG
String DLLEXPORT_OST_MOL_ALG SwappedName(const String &name)
Returns the name of the symmetry equivalent atom in residues with symmetric side-chains.
std::map< ost::mol::ResNum, ResidueRDMap > GlobalRDMap
Global distance list.
bool DLLEXPORT_OST_MOL_ALG Swappable(const String &rname, const String &aname)
Checks if an atom in a residue has a symmetry equivalent.
std::map< UniqueAtomIdentifier, int > ExistenceMap
std::pair< UniqueAtomIdentifier, UniqueAtomIdentifier > UAtomIdentifiers
std::map< std::pair< UniqueAtomIdentifier, UniqueAtomIdentifier >, std::pair< Real, Real > > ResidueRDMap
Residue distance list.
Definition base.dox:1