ProSHADE  0.6.5 (NOV 2018)
Protein Shape Descriptors and Symmetry Detection
All Classes Namespaces Files Functions Variables Pages
useDatabase.py
1 
4 
5 
7 import sys;
8 import os;
9 
10 cwd = os.getcwd ( );
11 proshadePath = cwd + "/../install/python";
12 
13 sys.path.append ( proshadePath );
14 import proshade;
15 
16 
18 setUp = proshade.ProSHADE_settings ();
19 
20 
22 setUp.energyLevelDist = True;
23 setUp.traceSigmaDist = True;
24 setUp.fullRotFnDist = True;
25 
26 # Settings regarding hierarchical distance computation
27 setUp.enLevelsThreshold = -999.9;
28 setUp.trSigmaThreshold = -999.9;
29 
30 # ... Settings regarding the task
31 setUp.taskToPerform = proshade.Distances;
32 
33 # Settings regarding the database
34 setUp.databaseName = "";
35 setUp.volumeTolerance = 0.4;
36 setUp.clearMapData = False;
37 
38 # ... Settings regarding loudness
39 setUp.verbose = -1;
40 setUp.htmlReport = False;
41 
42 # Get command line info
43 if len(sys.argv) != 3:
44  print ( "Usage: python useDatabase.py [dbName] [filename1] to get distances from [filename1] to all files in the database." );
45  quit ( -1 );
46 else:
47  setUp.databaseName = str( sys.argv[1] );
48  setUp.appendStructure ( str( sys.argv[ 2 ] ) );
49 
50 
52 runProshade = proshade.ProSHADE ( setUp );
53 
54 
56 crossCorrDists = runProshade.getCrossCorrDists ( );
57 traceSigmaDists = runProshade.getTraceSigmaDists ( );
58 rotationFunctionDists = runProshade.getRotFunctionDists ( );
59 
60 
62 sys.stdout.write ( "ProSHADE module version: " + runProshade.getProSHADEVersion() + "\n" );
63 sys.stdout.write ( "\n" );
64 sys.stdout.flush ( );
65 
66 if len(crossCorrDists) > 0:
67  ccOut = "Cross-correlation distances : " + "%+1.5f" % crossCorrDists[0];
68  for it in range ( 1, len(crossCorrDists) ):
69  ccOut = ccOut + "\t" + "%+1.5f" % crossCorrDists[it];
70  sys.stdout.write ( ccOut + "\n" );
71 sys.stdout.flush ( );
72 
73 if len(traceSigmaDists) > 0:
74  tsOut = "Trace sigma distances : " + "%+1.5f" % traceSigmaDists[0];
75  for it in range ( 1, len(traceSigmaDists) ):
76  tsOut = tsOut + "\t" + "%+1.5f" % traceSigmaDists[it];
77  sys.stdout.write ( tsOut + "\n" );
78 sys.stdout.flush ( );
79 
80 if len(rotationFunctionDists) > 0:
81  rfOut = "Rotation function distances : " + "%+1.5f" % rotationFunctionDists[0];
82  for it in range ( 1, len(rotationFunctionDists) ):
83  rfOut = rfOut + "\t" + "%+1.5f" % rotationFunctionDists[it];
84  sys.stdout.write ( rfOut + "\n" );
85 sys.stdout.flush ( );
86 
87 
89 quit ( );