Rosetta 3.5
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
core
scoring
packing
PoseBalls.hh
Go to the documentation of this file.
1
// -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
2
// vi: set ts=2 noet:
3
//
4
// (c) Copyright Rosetta Commons Member Institutions.
5
// (c) This file is part of the Rosetta software suite and is made available under license.
6
// (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
7
// (c) For more information, see http://www.rosettacommons.org. Questions about this can be
8
// (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
9
10
/// @file core/scoring/packing/PoseBalls.hh
11
/// @brief
12
/// @author
13
14
#ifndef INCLUDED_core_scoring_packing_PoseBalls_hh
15
#define INCLUDED_core_scoring_packing_PoseBalls_hh
16
17
18
#include <
core/pose/Pose.fwd.hh
>
19
#include <
core/id/AtomID.hh
>
20
#include <
core/id/AtomID_Map.hh
>
21
#include <
core/scoring/packing/Ball.hh
>
22
23
#include <utility/pointer/ReferenceCount.hh>
24
25
#include <utility/vector1.hh>
26
27
28
namespace
core {
29
namespace
scoring {
30
namespace
packing {
31
32
class
PoseBalls
:
public
utility::pointer::ReferenceCount
{
33
public
:
34
///@brief Automatically generated virtual destructor for class deriving directly from ReferenceCount
35
virtual
~PoseBalls
();
36
37
// hmode = 0 --> no hydrogens
38
// hmode = 1 --> polar H's
39
// hmode = 2 --> all H's
40
// in all cases, H area is added to the "parent" atom
41
PoseBalls
(
core::pose::Pose
const
& pose,
core::Size
Hmode = 0,
bool
ignore_water =
true
);
42
43
inline
core::Size
const
&
nballs
()
const
{
44
return
nballs_
;
45
}
46
47
inline
core::Size
const
&
id_to_index
(
core::id::AtomID
const
& aid )
const
{
48
return
id_to_index_
[aid];
49
}
50
51
inline
core::id::AtomID
const
&
index_to_id
(
core::Size
const
& index )
const
{
52
return
index_to_id_
[index];
53
}
54
55
inline
Ball
const
&
ball
(
core::Size
const
& index )
const
{
56
return
balls_
[index];
57
}
58
59
inline
Ball
const
&
ball
(
core::id::AtomID
const
&
id
)
const
{
60
return
balls_
[
id_to_index_
[id] ];
61
}
62
63
inline
Ball
&
ball
(
core::Size
const
& index ) {
return
balls_
[index]; }
64
inline
Ball
&
ball
(
core::id::AtomID
const
&
id
) {
return
balls_
[
id_to_index_
[id] ]; }
65
66
inline
std::string
const
&
atom_name
(
core::Size
const
& index )
const
{
67
return
atom_name_
[index];
68
}
69
70
inline
core::Size
const
&
atom_num
(
core::Size
const
& index )
const
{
71
return
atom_num_
[index];
72
}
73
74
inline
core::Size
const
&
atom_type
(
core::Size
const
& index )
const
{
75
return
atom_type_
[index];
76
}
77
78
inline
std::string
const
&
res_name
(
core::Size
const
& index )
const
{
79
return
res_name_
[index];
80
}
81
82
inline
core::Size
const
&
res_num
(
core::Size
const
& index )
const
{
83
return
res_num_
[index];
84
}
85
86
void
reset_surf
() {
87
surf_
.resize(
nballs_
);
88
for
(
core::Size
i = 1; i <=
nballs_
; i++ ) {
89
surf_
[i].resize(20);
90
for
(
core::Size
j = 1; j <= 20; j++ )
surf_
[i][j] = 0.0;
91
}
92
}
93
94
inline
void
set_surf
(
core::Size
const
& index,
core::Size
const
& ialpha,
Real
const
& val ) {
95
surf_
[
atom_parent_
[index] ][ialpha] += val;
// usually parent is self
96
// surf_[ index ][ialpha] += val; // usually parent is self // for testing
97
}
98
99
inline
Real
const
&
surf
(
core::Size
const
& index,
core::Size
const
& ialpha ) {
100
return
surf_
[index][ialpha];
101
}
102
103
inline
utility::vector1<Ball>
const
&
balls
()
const
{
104
return
balls_
;
105
}
106
107
inline
utility::vector1<core::id::AtomID>
const
&
atomids
()
const
{
108
return
index_to_id_
;
109
}
110
111
inline
char
const
&
secstruct
(
core::Size
const
& i )
const
{
112
return
secstruct_
[i];
113
}
114
inline
core::Real
const
&
smooth_nb
(
core::Size
const
& i )
const
{
115
return
smooth_nb_
[i];
116
}
117
inline
core::Real
const
&
bfac
(
core::Size
const
& i )
const
{
118
return
bfac_
[i];
119
}
120
inline
bool
havesurf
(
core::Size
const
& i )
const
{
121
return
atom_parent_
[i] == i;
122
}
123
124
inline
bool
is_heavy
(
core::Size
const
& i )
const
{
125
return
is_heavy_
[i];
126
}
127
128
inline
uint
nbhist
(
core::Size
atype,
core::Size
bin ) {
129
return
nbhist_
[atype][bin];
130
}
131
132
void
output_pdb
( std::ostream & out )
const
;
133
134
void
compute_smooth_nb
();
135
136
private
:
137
138
// core::pose::Pose pose_;
139
core::Size
nballs_
;
140
core::id::AtomID_Map<Size>
id_to_index_
;
141
utility::vector1<core::id::AtomID>
index_to_id_
;
142
utility::vector1<Ball>
balls_
;
143
utility::vector1<std::string>
atom_name_
;
144
utility::vector1<core::Size>
atom_num_
;
145
utility::vector1<std::string>
res_name_
;
146
utility::vector1<core::Size>
res_num_
;
147
utility::vector1<core::Size>
atom_type_
;
148
utility::vector1<core::Size>
atom_parent_
;
149
utility::vector1<core::Real>
smooth_nb_
;
150
utility::vector1<core::Real>
bfac_
;
151
utility::vector1<bool>
is_heavy_
;
152
utility::vector1<char>
secstruct_
;
153
utility::vector1<utility::vector1<Real>
>
surf_
;
154
utility::vector1<utility::vector1<uint>
>
nbhist_
;
155
156
};
157
158
template
<
class
T >
159
void
160
initialize_AtomID_Map
(
core::id::AtomID_Map<T>
& map,
PoseBalls
const
& pb ) {
161
for
(
Size
i = 1; i <= pb.
nballs
(); i++ ) {
162
Size
res_num = pb.
res_num
(i);
163
Size
atom_num = pb.
atom_num
(i);
164
map.
resize
( std::max(map.
size
(),res_num) );
165
map.
resize
( res_num, std::max(map.
n_atom
(res_num),atom_num) );
166
}
167
}
168
169
170
}
// namespace packing
171
}
// namespace scoring
172
}
// namespace core
173
174
175
#endif // INCLUDED_core_scoring_packing_PoseBalls_HHBalls_HH
Generated on Sat Jun 1 2013 11:39:31 for Rosetta 3.5 by
1.8.4