main page
namespaces
classes
files
GGL home
Generated on Wed Apr 29 2015 11:51:40 for GGL-4.1.2 by
doxygen
1.8.3.1
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
src
sgm
GraphScaffold.hh
Go to the documentation of this file.
1
#ifndef SGM_GRAPHSCAFFOLD_HH_
2
#define SGM_GRAPHSCAFFOLD_HH_
3
4
5
#include "
sgm/Graph_Interface.hh
"
6
#include "
sgm/RP_Hanser96.hh
"
7
8
namespace
sgm {
9
10
11
/*!
12
* Computes the scaffold annotation of each node, ie. whether it is part of
13
* a ring, a ring linker, or a dangling end (side chain).
14
*
15
* See
16
* The Properties of Known Drugs. 1. Molecular Frameworks
17
* Guy W. Bemis and Mark A. Murcko
18
* J. Med. Chem. 1996, 39, 2887-2893
19
*
20
* @author Martin Mann (c) 2013 http://www.bioinf.uni-freiburg.de/~mmann/
21
*
22
*/
23
class
GraphScaffold
:
public
RP_Hanser96
{
24
25
public
:
26
27
//! possible scaffold types of graph nodes
28
enum
ScaffoldType
{
29
GST_UNKNOWN
,
//!< nodes of this type are not processed yet
30
GST_RING
,
//!< nodes of this type are part of a ring
31
GST_LINKER
,
//!< nodes of this type are part of a ring linker
32
GST_DANGLING
//!< nodes of this type are part of a dangling end / side chain
33
};
34
35
//! assignment of scaffold types for each node index
36
typedef
std::vector< ScaffoldType >
ScaffoldAnnotation
;
37
38
protected
:
39
40
//! the P-graph to be compressed during the ring perception
41
using
RP_Hanser96::pGraph
;
42
43
//! the index access for pGraph
44
using
RP_Hanser96::pGraphIndex
;
45
//! the edge label access for pGraph, i.e. the according RingList
46
using
RP_Hanser96::pGraphPath
;
47
48
//! the degree of each node in pGraph
49
using
RP_Hanser96::pGraphDegree
;
50
//! the nodes to be removed during the ring perception from pGraph
51
using
RP_Hanser96::toRemove
;
52
53
54
public
:
55
56
//! construction
57
GraphScaffold
();
58
59
//! destruction
60
virtual
~GraphScaffold
();
61
62
/*!
63
* Identifies the scaffold type for each node in the graph and returns
64
* the according scaffold annotation.
65
*
66
* @param graph the graph to annotate
67
* @param maxRingSize the maximal size of rings to consider
68
* @return the scaffold type for each node within the graph, ie. the
69
* container has as many entries as the graph nodes.
70
*/
71
ScaffoldAnnotation
72
getScaffoldAnnotation
(
const
Graph_Interface
& graph
73
,
const
size_t
maxRingSize = std::numeric_limits<size_t>::max() );
74
75
/*!
76
* Identifies the scaffold type for each node in the graph and returns
77
* the according scaffold annotation.
78
*
79
* @param graph the graph to annotate
80
* @param reporter the ring reporter to forward all rings to
81
* @param maxRingSize the maximal size of rings to consider
82
* @return the scaffold type for each node within the graph, ie. the
83
* container has as many entries as the graph nodes.
84
*/
85
ScaffoldAnnotation
86
getScaffoldAnnotation
(
const
Graph_Interface
& graph
87
,
RingReporter
& reporter
88
,
const
size_t
maxRingSize = std::numeric_limits<size_t>::max());
89
90
protected
:
91
92
93
94
95
/*!
96
* Identifies the scaffold type for each node in the graph and returns
97
* the according scaffold annotation.
98
*
99
* @param graph the graph to annotate
100
* @param reporter the ring reporter to forward all rings to (can be
101
* NULL such that no reporting is done)
102
* @param maxRingSize the maximal size of rings to consider
103
* @return the scaffold type for each node within the graph, ie. the
104
* container has as many entries as the graph nodes.
105
*/
106
ScaffoldAnnotation
107
getScaffoldAnnotation
(
const
Graph_Interface
& graph
108
,
RingReporter
* reporter
109
,
const
size_t
maxRingSize );
110
111
112
/*!
113
* Ring reporter that stores ring annotations and forwards the
114
* reporting to another ring reporter if given.
115
*/
116
class
RR_Annotation
:
public
RingReporter
{
117
118
protected
:
119
120
//! the annotation to update with ring information
121
ScaffoldAnnotation
&
annotation
;
122
//! the next reporter to forward the ring information to if not NULL
123
RingReporter
*
nextReporter
;
124
125
public
:
126
127
/*!
128
* Constructions
129
* @param annotation the annotation to update with ring information
130
* @param nextReporter the next reporter to forward the ring
131
* information to if not NULL
132
*/
133
RR_Annotation
(
ScaffoldAnnotation
&
annotation
134
,
RingReporter
*
nextReporter
= NULL)
135
: annotation(annotation)
136
,
nextReporter
(
nextReporter
)
137
{}
138
139
virtual
140
~RR_Annotation
()
141
{}
142
/*!
143
* Nodes of the reported ring are accordingly annotated and the
144
* ring information is forwarded to the next ring reporter
145
* @param graph the graph that contains the ring
146
* @param ringList the ring to report
147
*/
148
virtual
149
void
150
reportRing
(
const
Graph_Interface
& graph,
const
RingList
& ringList );
151
152
};
153
154
};
155
156
}
// namespace sgm
157
158
#endif
/* SGM_GRAPHSCAFFOLD_HH_ */