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
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module src.utilities</title>
<meta charset="utf-8">
</head><body bgcolor="#f0f0f8">
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="src.html"><font color="#ffffff">src</font></a>.utilities</strong></big></big> (6 November 2007)</font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/Users/d3y382/workspaces/apbs-pdb2pqr/pdb2pqr/src/utilities.py">/Users/d3y382/workspaces/apbs-pdb2pqr/pdb2pqr/src/utilities.py</a></font></td></tr></table>
<p><tt>Utilities for PDB2PQR Suite<br>
<br>
This module provides various utilities for the PDB2PQR suite to be<br>
imported into other Python scripts.<br>
<br>
----------------------------<br>
<br>
PDB2PQR -- An automated pipeline for the setup, execution, and analysis of<br>
Poisson-Boltzmann electrostatics calculations<br>
<br>
Copyright (c) 2002-2011, Jens Erik Nielsen, University College Dublin; <br>
Nathan A. Baker, Battelle Memorial Institute, Developed at the Pacific <br>
Northwest National Laboratory, operated by Battelle Memorial Institute, <br>
Pacific Northwest Division for the U.S. Department Energy.; <br>
Paul Czodrowski & Gerhard Klebe, University of Marburg.<br>
<br>
All rights reserved.<br>
<br>
Redistribution and use in source and binary forms, with or without modification, <br>
are permitted provided that the following conditions are met:<br>
<br>
* Redistributions of source code must retain the above copyright notice, <br>
this list of conditions and the following disclaimer.<br>
* Redistributions in binary form must reproduce the above copyright notice, <br>
this list of conditions and the following disclaimer in the documentation <br>
and/or other materials provided with the distribution.<br>
* Neither the names of University College Dublin, Battelle Memorial Institute,<br>
Pacific Northwest National Laboratory, US Department of Energy, or University<br>
of Marburg nor the names of its contributors may be used to endorse or promote<br>
products derived from this software without specific prior written permission.<br>
<br>
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND <br>
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED <br>
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. <br>
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, <br>
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, <br>
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, <br>
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF <br>
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE <br>
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED <br>
OF THE POSSIBILITY OF SUCH DAMAGE.<br>
<br>
----------------------------</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="math.html">math</a><br>
</td><td width="25%" valign=top><a href="os.html">os</a><br>
</td><td width="25%" valign=top><a href="sys.html">sys</a><br>
</td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="src.utilities.html#ExtraOptions">ExtraOptions</a>
</font></dt></dl>
</dd>
</dl>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="ExtraOptions">class <strong>ExtraOptions</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td>
<td width="100%">Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list of weak references to the object (if defined)</tt></dd>
</dl>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
<tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td>
<td width="100%"><dl><dt><a name="-add"><strong>add</strong></a>(coords1, coords2)</dt><dd><tt>Add one 3-dimensional point to another<br>
<br>
Parameters<br>
coords1: coordinates of form [x,y,z]<br>
coords2: coordinates of form [x,y,z]<br>
Returns<br>
list: List of coordinates equal to coords2 + coords1 (list)</tt></dd></dl>
<dl><dt><a name="-analyzeConnectivity"><strong>analyzeConnectivity</strong></a>(map, key)</dt><dd><tt>Analyze the connectivity of a given map using the key value.<br>
<br>
Parameters<br>
map: The map to analyze (dict)<br>
key: The key value (variable)<br>
Returns<br>
list: A list of connected values to the key (list)</tt></dd></dl>
<dl><dt><a name="-appendToLogFile"><strong>appendToLogFile</strong></a>(jobName, fileName, logInput)</dt></dl>
<dl><dt><a name="-createPropkaOptions"><strong>createPropkaOptions</strong></a>(pH, verbose<font color="#909090">=False</font>, reference<font color="#909090">='neutral'</font>)</dt><dd><tt>Create a propka options <a href="__builtin__.html#object">object</a> for running propka.</tt></dd></dl>
<dl><dt><a name="-cross"><strong>cross</strong></a>(coords1, coords2)</dt><dd><tt>Find the cross product of two 3-dimensional points<br>
<br>
Parameters<br>
coords1: coordinates of form [x,y,z]<br>
coords2: coordinates of form [x,y,z]<br>
Returns<br>
list: Cross product coords2 and coords1 (list)</tt></dd></dl>
<dl><dt><a name="-distance"><strong>distance</strong></a>(coords1, coords2)</dt><dd><tt>Calculate the distance between two coordinates, as denoted by<br>
<br>
dist = sqrt((x2- x1)^2 + (y2 - y1)^2 + (z2 - z1)^2))<br>
<br>
Parameters<br>
coords1: Coordinates of form [x,y,z]<br>
coords2: Coordinates of form [x,y,z]<br>
Returns<br>
dist: Distance between the two coordinates (float)</tt></dd></dl>
<dl><dt><a name="-dot"><strong>dot</strong></a>(coords1, coords2)</dt><dd><tt>Find the dot product of two 3-dimensional points<br>
<br>
Parameters<br>
coords1: coordinates of form [x,y,z]<br>
coords2: coordinates of form [x,y,z]<br>
Returns<br>
value: Dot product coords2 and coords1 (float)</tt></dd></dl>
<dl><dt><a name="-factorial"><strong>factorial</strong></a>(n)</dt><dd><tt>Returns the factorial of the given number n</tt></dd></dl>
<dl><dt><a name="-getAngle"><strong>getAngle</strong></a>(coords1, coords2, coords3)</dt><dd><tt>Get the angle between three coordinates<br>
<br>
Parameters<br>
coords1: The first coordinate set (atom)<br>
coords2: The second (vertex) coordinate set (atom)<br>
coords3: The third coordinate set (atom)<br>
Returns<br>
angle: The angle between the atoms (float)</tt></dd></dl>
<dl><dt><a name="-getDatFile"><strong>getDatFile</strong></a>(name)</dt><dd><tt>Grab a data file. If the file cannot be found in the<br>
given directory, try the current system path.<br>
<br>
Parameters<br>
name: The name of the file to get (string)<br>
Returns<br>
path: The path to the file (string)</tt></dd></dl>
<dl><dt><a name="-getDihedral"><strong>getDihedral</strong></a>(coords1, coords2, coords3, coords4)</dt><dd><tt>Calculate the angle using the four atoms<br>
<br>
Parameters<br>
coords1: First of four coordinates of form [x,y,z]<br>
coords2: Second of four<br>
coords3: Third of four<br>
coords4: Fourth of four<br>
Returns<br>
value: Size of the angle (float)</tt></dd></dl>
<dl><dt><a name="-getEventTrackingString"><strong>getEventTrackingString</strong></a>(category, action, label, value<font color="#909090">=None</font>)</dt></dl>
<dl><dt><a name="-getFFfile"><strong>getFFfile</strong></a>(name)</dt><dd><tt>Grab the forcefield file. May or may not residue in the dat/<br>
directory.</tt></dd></dl>
<dl><dt><a name="-getNamesFile"><strong>getNamesFile</strong></a>(name)</dt><dd><tt>Grab the *.names file that contains the XML mapping.<br>
<br>
Parameters<br>
name: The name of the forcefield (string)<br>
Returns<br>
path: The path to the file (string)</tt></dd></dl>
<dl><dt><a name="-getPDBFile"><strong>getPDBFile</strong></a>(path)</dt><dd><tt>Obtain a PDB file. First check the path given on the command<br>
line - if that file is not available, obtain the file from the<br>
PDB webserver at <a href="http://www.rcsb.org/pdb/">http://www.rcsb.org/pdb/</a> .<br>
<br>
Parameters<br>
path: Name of PDB file to obtain (string)<br>
<br>
Returns<br>
file: File <a href="__builtin__.html#object">object</a> containing PDB file (file <a href="__builtin__.html#object">object</a>)</tt></dd></dl>
<dl><dt><a name="-getPQRBaseFileName"><strong>getPQRBaseFileName</strong></a>(filename)</dt></dl>
<dl><dt><a name="-getTrackingScriptString"><strong>getTrackingScriptString</strong></a>(jobid<font color="#909090">=None</font>)</dt><dd><tt>For injecting tracking script into a web page.<br>
<br>
jobid -> current jobid. Adds "jobid" custom variable to events and page views on this page.</tt></dd></dl>
<dl><dt><a name="-normalize"><strong>normalize</strong></a>(coords)</dt><dd><tt>Normalize a set of coordinates<br>
<br>
Parameters<br>
coords: coordinates of form [x,y,z]<br>
Returns<br>
list: normalized coordinates (list)</tt></dd></dl>
<dl><dt><a name="-resetLogFile"><strong>resetLogFile</strong></a>(jobName, fileName)</dt><dd><tt>For clearing out old log files if needed.<br>
Used mainly for removing apbs_end_time if apbs is rerun.</tt></dd></dl>
<dl><dt><a name="-shortestPath"><strong>shortestPath</strong></a>(graph, start, end, path<font color="#909090">=[]</font>)</dt><dd><tt>Uses recursion to find the shortest path from one node to<br>
another in an unweighted graph. Adapted from<br>
<a href="http://www.python.org/doc/essays/graphs.html">http://www.python.org/doc/essays/graphs.html</a> .<br>
<br>
Parameters:<br>
graph: A mapping of the graph to analyze, of the form<br>
{0: [1,2], 1:[3,4], ...} . Each key has a list<br>
of edges.<br>
start: The ID of the key to start the analysis from<br>
end: The ID of the key to end the analysis<br>
path: Optional argument used during the recursive step<br>
to keep the current path up to that point<br>
<br>
Returns:<br>
(variable): Returns a list of the shortest path (list)<br>
Returns None if start and end are not<br>
connected</tt></dd></dl>
<dl><dt><a name="-sortDictByValue"><strong>sortDictByValue</strong></a>(inputdict)</dt><dd><tt>Sort a dictionary by its values<br>
<br>
Parameters<br>
inputdict: The dictionary to sort (inputdict)<br>
Returns<br>
items: The dictionary sorted by value (list)</tt></dd></dl>
<dl><dt><a name="-startLogFile"><strong>startLogFile</strong></a>(jobName, fileName, logInput)</dt></dl>
<dl><dt><a name="-subtract"><strong>subtract</strong></a>(coords1, coords2)</dt><dd><tt>Subtract one 3-dimensional point from another<br>
<br>
Parameters<br>
coords1: coordinates of form [x,y,z]<br>
coords2: coordinates of form [x,y,z]<br>
Returns<br>
list: List of coordinates equal to coords1 - coords2 (list)</tt></dd></dl>
</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
<tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td>
<td width="100%"><strong>DIHEDRAL</strong> = 57.2958<br>
<strong>INSTALLDIR</strong> = '/Users/d3y382/pdb2pqr/'<br>
<strong>SMALL</strong> = 1e-07<br>
<strong>TMPDIR</strong> = 'tmp/'<br>
<strong>__author__</strong> = 'Todd Dolinsky, Yong Huang'<br>
<strong>__date__</strong> = '6 November 2007'</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#7799ee">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Author</strong></big></font></td></tr>
<tr><td bgcolor="#7799ee"><tt> </tt></td><td> </td>
<td width="100%">Todd Dolinsky, Yong Huang</td></tr></table>
</body></html>
|