Package csb :: Package apps |
[frames] | no frames]

# Package apps

source code

Root package for all executable CSB client programs.

# Introduction

There are roughly three types of CSB apps:

1. protocols: client applications, which make use of the core library to perform some action
2. wrappers: these provide python bindings for external programs
3. mixtures of (1) and (2).

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 Application is just a regular, importable python object, which never communicates directly with the command line interface or calls sys.exit(). The app's associated AppRunner will take care of those things.

# Getting Started

Follow these simple steps to write a new CSB app:

1. Create the app module in the `csb.apps` package.
2. Create a main class and derive it from csb.apps.Application. You need to implement the csb.apps.Application.main() abstract method - this is the app's entry point. You have the csb.apps.Application.args object at your disposal.
3. Create an AppRunner class, derived from csb.apps.AppRunner. You need to implement the following methods and properties:
   - property csb.apps.AppRunner.target -- just return YourApp's class
   - method csb.apps.AppRunner.command_line() -- make an instance of csb.apps.ArgHandler, define your command line parameters on that instance and return it
   - optionally, override csb.apps.AppRunner.initapp(args) if you need to customize the instantiation of the main app class, or to perform additional checks on the parsed application `args` and eventually call `YourApp.exit()`. Return an instance of your app at the end
4. Make it executable:

          if __name__ == '__main__':
              MyAppRunner().run()

See csb.apps.helloworld for a sample implementation.

Submodules
csb.apps.bfit: Python application for robust structure superposition of two structures. csb.apps.bfite: Python application for robust structure superposition of an ensemble of structures. csb.apps.buildhmm: Build an HMM from a FASTA sequence. csb.apps.csfrag: CSfrag: build a dynamic library of analogous fragments, given a list of assigned chemical shifts. csb.apps.embd: Sharpening of EM maps by non-negative blind deconvolution. csb.apps.helloworld: This is a CSB HelloWorld dummy application. csb.apps.hhfrag: HHfrag: build a dynamic variable-length fragment library for protein structure prediction with Rosetta AbInitio. csb.apps.hhsearch: Python bindings for the HHsearch program. csb.apps.precision: Measure the precision and coverage of a fragment library stored in Rosetta NNmake format. csb.apps.promix: ProMix: Take a protein structure ensemble and find a mixture of rigid segments or a mixture of conformers.

Classes
| AppExit Used to signal an immediate application exit condition (e.g.
| AppRunner A base abstract class for all application runners.
| Application Base CSB application class.
| ArgHandler Command line argument handler.
| ExitCodes Exit code constants.

Variables
| __package__ = ``'``csb.apps``'``