OpenProspect has been designed to allow access to all major functions through a common C++ API (with an additional set Python bindings for scripting).  The command line program prospect is nothing more then a program to parse the command line and call the appropriate API functions.  If you wanted, you could easily write your own threading program, or integrate OpenProspect functionality into your own scripts.

We've provided an online copy of the documentation that is automatically by doxygen.


Python Support


First, you'll need to build with python support.  For this, you'll need SWIG installed.  You'll also need to configure with the option '--enable-python'.  The library will be then installed in the directory (PREFIX)/lib/python2.4/site-packages/prospect/ (If you are using Python 2.4).  Make sure that the PYTHONPATH environmental variable includes that directory.





Code Examples


C++: Open and Thread

int main(int argc, char **argv) {
TargetStruct target_data;
target_data.LoadSSP( argv[1] );
ProspectOutput output;
ProspectParam param;
WeightArray weights;
param.Weight_Find("default", weights);
char *template_path = param.TemplateFind( argv[2] );
if ( template_path ) {
TemplateStruct template_data;
if ( !template_data.LoadFile(template_path) ) {
printf("Threading: %s", template_path );
DynamicAlign dynamic_align(align_profile, weight);
dynamic_align.CalcEnergyTable( &param, weights, &template_data, &target_data);
dynamic_align.Align();
dynamic_align.TraceAlign( &alignment );
ScoreStruct scores;
scores.ScoreRaw( &param,
weights,
&template_data,
&target_data,
&alignment );

output.AddThreadingInfo( &param,
weights,
&template_data,
&target_data,
&scores,
&alignment);
output.Save( argv[3] );
}
}
return 0;
}





Python: open PDB and count Neighbors within a given distance for every residue

#!/usr/bin/python

import open_prospect
import getopt
import sys
import string
import math


pdb_path = sys.argv[1]
dist = float(sys.argv[2])

target = open_prospect.TargetStruct( )
target.LoadPDB( pdb_path )
ca = target.GetCaArray()
for i in range( target.len ):
count = 0
for j in range( i+1, target.len ):
tmp = open_prospect.smDistance(
open_prospect.GetVec3FromArray(ca, i),
open_prospect.GetVec3FromArray(ca, j) )
if ( dist >= tmp ):
count += 1
print i, ":", count




SourceForge.net Logo