-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcsb.apps-module.html
289 lines (277 loc) · 12.3 KB
/
csb.apps-module.html
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>csb.apps</title>
<link rel="stylesheet" href="epydoc.css" type="text/css" />
<script type="text/javascript" src="epydoc.js"></script>
</head>
<body bgcolor="white" text="black" link="blue" vlink="#204080"
alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
bgcolor="#a0c0ff" cellspacing="0">
<tr valign="middle">
<!-- Home link -->
<th> <a
href="csb-module.html">Home</a> </th>
<!-- Tree link -->
<th> <a
href="module-tree.html">Trees</a> </th>
<!-- Index link -->
<th> <a
href="identifier-index.html">Indices</a> </th>
<!-- Help link -->
<th> <a
href="help.html">Help</a> </th>
<!-- Project homepage -->
<th class="navbar" align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><th class="navbar" align="center"
>CSB v1.2.5.d7fd331</th>
</tr></table></th>
</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
<tr valign="top">
<td width="100%">
<span class="breadcrumbs">
<a href="csb-module.html">Package csb</a> ::
Package apps
</span>
</td>
<td>
<table cellpadding="0" cellspacing="0">
<!-- hide/show private -->
<tr><td align="right"><span class="options"
>[<a href="frames.html" target="_top">frames</a
>] | <a href="csb.apps-module.html"
target="_top">no frames</a>]</span></td></tr>
</table>
</td>
</tr>
</table>
<!-- ==================== PACKAGE DESCRIPTION ==================== -->
<h1 class="epydoc">Package apps</h1><p class="nomargin-top"><span class="codelink"><a href="csb.apps-pysrc.html">source code</a></span></p>
<p>Root package for all executable CSB client programs.</p>
<h1 class="heading">Introduction</h1>
<p>There are roughly three types of CSB apps:</p>
<ol start="1">
<li>
protocols: client applications, which make use of the core library
to perform some action
</li>
<li>
wrappers: these provide python bindings for external programs
</li>
<li>
mixtures of (1) and (2).
</li>
</ol>
<p>The main design goal of this framework is to provide a way for
writing executable code with minimal effort, without the hassle of
repeating yourself over and over again. Creating a professional-grade
CLI, validating and consuming the command line arguments is therefore
really straightforward. On the other hand, one frequently feels the
need to reuse some apps or their components in other apps. For such
reasons, a CSB <a href="csb.apps.Application-class.html"
class="link">Application</a> is just a regular, importable python
object, which never communicates directly with the command line
interface or calls sys.exit(). The app's associated <a
href="csb.apps.AppRunner-class.html" class="link">AppRunner</a> will
take care of those things.</p>
<h1 class="heading">Getting Started</h1>
<p>Follow these simple steps to write a new CSB app:</p>
<ol start="1">
<li>
Create the app module in the <code>csb.apps</code> package.
</li>
<li>
Create a main class and derive it from <a
href="csb.apps.Application-class.html"
class="link">csb.apps.Application</a>. You need to implement the <a
href="csb.apps.Application-class.html#main"
class="link">csb.apps.Application.main()</a> abstract method - this
is the app's entry point. You have the <a
href="csb.apps.Application-class.html#args"
class="link">csb.apps.Application.args</a> object at your disposal.
</li>
<li>
Create an AppRunner class, derived from csb.apps.AppRunner. You
need to implement the following methods and properties:
<ul>
<li>
property <a href="csb.apps.AppRunner-class.html#target"
class="link">csb.apps.AppRunner.target</a> -- just return
YourApp's class
</li>
<li>
method <a href="csb.apps.AppRunner-class.html#command_line"
class="link">csb.apps.AppRunner.command_line()</a> -- make an
instance of <a href="csb.apps.ArgHandler-class.html"
class="link">csb.apps.ArgHandler</a>, define your command line
parameters on that instance and return it
</li>
<li>
optionally, override <a
href="csb.apps.AppRunner-class.html#initapp"
class="link">csb.apps.AppRunner.initapp(args)</a> if you need
to customize the instantiation of the main app class, or to
perform additional checks on the parsed application
<code>args</code> and eventually call
<code>YourApp.exit()</code>. Return an instance of your app at
the end
</li>
</ul>
</li>
<li>
Make it executable:
<pre class="literalblock">
if __name__ == '__main__':
MyAppRunner().run()
</pre>
</li>
</ol>
<p>See <a href="csb.apps.helloworld-module.html"
class="link">csb.apps.helloworld</a> for a sample implementation.</p>
<!-- ==================== SUBMODULES ==================== -->
<a name="section-Submodules"></a>
<table class="summary" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
<td align="left" colspan="2" class="table-header">
<span class="table-header">Submodules</span></td>
</tr>
<tr><td class="summary">
<ul class="nomargin">
<li> <strong class="uidlink"><a href="csb.apps.bfit-module.html">csb.apps.bfit</a></strong>: <em class="summary">Python application for robust structure superposition of two
structures.</em> </li>
<li> <strong class="uidlink"><a href="csb.apps.bfite-module.html">csb.apps.bfite</a></strong>: <em class="summary">Python application for robust structure superposition of an
ensemble of structures.</em> </li>
<li> <strong class="uidlink"><a href="csb.apps.buildhmm-module.html">csb.apps.buildhmm</a></strong>: <em class="summary">Build an HMM from a FASTA sequence.</em> </li>
<li> <strong class="uidlink"><a href="csb.apps.csfrag-module.html">csb.apps.csfrag</a></strong>: <em class="summary">CSfrag: build a dynamic library of analogous fragments, given a
list of assigned chemical shifts.</em> </li>
<li> <strong class="uidlink"><a href="csb.apps.embd-module.html">csb.apps.embd</a></strong>: <em class="summary">Sharpening of EM maps by non-negative blind deconvolution.</em> </li>
<li> <strong class="uidlink"><a href="csb.apps.helloworld-module.html">csb.apps.helloworld</a></strong>: <em class="summary">This is a CSB HelloWorld dummy application.</em> </li>
<li> <strong class="uidlink"><a href="csb.apps.hhfrag-module.html">csb.apps.hhfrag</a></strong>: <em class="summary">HHfrag: build a dynamic variable-length fragment library for
protein structure prediction with Rosetta AbInitio.</em> </li>
<li> <strong class="uidlink"><a href="csb.apps.hhsearch-module.html">csb.apps.hhsearch</a></strong>: <em class="summary">Python bindings for the HHsearch program.</em> </li>
<li> <strong class="uidlink"><a href="csb.apps.precision-module.html">csb.apps.precision</a></strong>: <em class="summary">Measure the precision and coverage of a fragment library stored in
Rosetta NNmake format.</em> </li>
<li> <strong class="uidlink"><a href="csb.apps.promix-module.html">csb.apps.promix</a></strong>: <em class="summary">ProMix: Take a protein structure ensemble and find a mixture of
rigid segments or a mixture of conformers.</em> </li>
</ul></td></tr>
</table>
<br />
<!-- ==================== CLASSES ==================== -->
<a name="section-Classes"></a>
<table class="summary" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
<td align="left" colspan="2" class="table-header">
<span class="table-header">Classes</span></td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="csb.apps.AppExit-class.html" class="summary-name">AppExit</a><br />
Used to signal an immediate application exit condition (e.g.
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="csb.apps.AppRunner-class.html" class="summary-name">AppRunner</a><br />
A base abstract class for all application runners.
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="csb.apps.Application-class.html" class="summary-name">Application</a><br />
Base CSB application class.
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="csb.apps.ArgHandler-class.html" class="summary-name">ArgHandler</a><br />
Command line argument handler.
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a href="csb.apps.ExitCodes-class.html" class="summary-name">ExitCodes</a><br />
Exit code constants.
</td>
</tr>
</table>
<!-- ==================== VARIABLES ==================== -->
<a name="section-Variables"></a>
<table class="summary" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
<td align="left" colspan="2" class="table-header">
<span class="table-header">Variables</span></td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a name="__package__"></a><span class="summary-name">__package__</span> = <code title="'csb.apps'"><code class="variable-quote">'</code><code class="variable-string">csb.apps</code><code class="variable-quote">'</code></code>
</td>
</tr>
</table>
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
bgcolor="#a0c0ff" cellspacing="0">
<tr valign="middle">
<!-- Home link -->
<th> <a
href="csb-module.html">Home</a> </th>
<!-- Tree link -->
<th> <a
href="module-tree.html">Trees</a> </th>
<!-- Index link -->
<th> <a
href="identifier-index.html">Indices</a> </th>
<!-- Help link -->
<th> <a
href="help.html">Help</a> </th>
<!-- Project homepage -->
<th class="navbar" align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><th class="navbar" align="center"
>CSB v1.2.5.d7fd331</th>
</tr></table></th>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
Generated by Epydoc 3.0.1 on Tue Jul 4 20:19:03 2017
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
>http://epydoc.sourceforge.net</a>
</td>
</tr>
</table>
<script type="text/javascript">
<!--
// Private objects are initially displayed (because if
// javascript is turned off then we want them to be
// visible); but by default, we want to hide them. So hide
// them unless we have a cookie that says to show them.
checkCookie();
// -->
</script>
</body>
</html>