API¶
Package¶
The aesop submodule contains all relevant classes and functions for the AESOP package.
AESOP contents¶
-
class
aesop.aesop.
Alascan
(pdb, pdb2pqr_exe='pdb2pqr', apbs_exe='apbs', coulomb_exe='coulomb', selstr=['protein'], jobname=None, region=None, grid=1, ion=0.15, pdie=20.0, sdie=78.54, ff='parse', cfac=1.5, dx=False, minim=False)¶ Summary Summary of internal varialbles in the Alascan class. All parameters are set in the Alascan.__init__(...) and the analysis is run with Alascan.run().
Attributes
apbs (str) Full path to APBS executable. Must be compatible with OS. apbs_results (str) Full path to output from APBS cfac (float) Scaling factor for grid dimensions. We suggest to leave this unchanged. coulomb (str) Full path to coulomb executable from APBS package. Must be compatible with OS. coulomb_results (str) Full path to folder containing results from coulomb. dime (list) List of three integers. Parameter required for APBS. Please see description at: http://www.poissonboltzmann.org/docs/apbs-overview/ disu (bool, optional) If True, Modeller will guess the patches for disulfide bridges within the provided protein structures. Only relevant if minim is set to Trueself. dx (bool) Variable that specifies if potential files should be written to disk. Default is False. dx_files (list) If written to disk, list of potential files written to disk. The folder containing these files is given by Alascan.apbs_results. E_ref (ndarray) Description E_solv (ndarray) Description ff (str) Force-field to use for PDB2PQR file_pdb_template (TYPE) Description gcent (list) List of three integers. Parameter required for APBS. Please see description at: http://www.poissonboltzmann.org/docs/apbs-overview/ Gcoul (ndarray) Coulombic free energies, corresponding to Alascan.mutid. glen (list) List of three integers. Parameter required for APBS. Please see description at: http://www.poissonboltzmann.org/docs/apbs-overview/ Gref (ndarray) Reference-state free energies, corresponding to Alascan.mutid. grid (numeric) Distance spacing of grid points. If the grid dimensions are not divisible by three, resolution will be increased (smaller grid spacing) until grid dimensions are divisible by three. Gsolv (ndarray) Solvated-state free energies, corresponding to Alascan.mutid. ion (numeric) Ionic strength to be used in the solvated-state APBS calculations. jobdir (str) [Optional] Path to folder containing results. If not specified, a directory will be generated. jobname (str) [Optional] Name for current job, will be used to create the jobdir. list_chids (list) Chain ID where mutation was made. Corresponds to Alascan.mutid. list_resnames (list) Residue names where mutation was made. Corresponds to Alascan.mutid. list_resnums (list) Residue numbers where mutation was made. Corresponds to Alascan.mutic. logs (list) List of strings that represent the log files from every executable called (namely, PDB2PQR and APBS) logs_apbs_dir (str) Folder in jobdir containing output from APBS (logs, input files, dx files) mask_by_sel (ndarray) Matrix containing selection masks. The first column corresponds to the selection string for the parent and each column thereafter corresponds to an element of the selection string (selstr) in the same order. max_iter (integer, optional) If minimization is to be performed, this parameter limits the maximum number of calls to the objective function before minimization is terminated. Default is 1000 iterations. min_atom_shift (float, optional) If minimization is to be performed, this parameter will determine the convergence criteria. If the maximum atomic shift for all atoms between minimization steps is less than this value, then minimization is terminated. Default value is 0.1 angstroms. minim (bool, optional) If True, minimization will be performed with Modeller’s conjugate gradient descent algorithm. Default is False for the Alanine scan class as no clashes should result from mutations. mutid (list) List of mutant IDs. The first element corresponds to the parent. Subsequent elements correspond to each element of the selection string list (selstr). Please use Alascan.getMutids() to get vectorized version. output (string, optional) If minimization is performed, this parameter deterimines what output to STDOUT Modeller will use. ‘NO_REPORT’ results in a minimal output to STDOUT, while ‘REPORT’ results in a more verbose output to STDOUT. pdb (str) Path to PDB file with atomic coordinates. Must follow formatting conventions of the Protein Databank. pdb2pqr (str) Full path to PDB2PQR executable. pdb_complex_dir (str) Folder name in the job directory that contains the PDB file(s) of the complex structures. pdie (numeric) Protein dielectric constant to be used in APBS. pqr_complex_dir (str) Folder name in the job directory containing PQR files for each protein complex. pqr_sel_dir (list) List of folder names in the job directory that contain PQR files for selection strings (selstr). Each element of pqr_sel_dir corresponds to the same element of selstr. region (list) List of additional selection strings specifying the zone where mutations should occur. Generally unused, unless a region of interest is involved. Each element of region should correspond to the same element of selstr. That is, each region selection string will futher narrow down the initial selection string. sdie (numeric) Solvent dielectric constant to be used in APBS. selstr (list) List of selection strings. Typically each selection string will correspond to a chain in a protein complex. We advise users to specify two or more selection strings. (Ex: [‘chain A’, ‘chain B’]) Methods
calcAPBS
()Summary Run APBS on each structure in mutant library, in serial. calcAPBS_parallel
([n_workers])Summary Run APBS on each structure in mutant library, in parallel. calcCoulomb
()Summary Calculates Coulombic free energies with coulomb.exe from the APBS toolbox. calcCoulomb_parallel
([n_workers])Summary Calculates Coulombic free energies with coulomb.exe from the APBS toolbox in a parallel manner. calcESI
([idx])Summary checkerrors
()checkwarnings
()dGsolv_rel
()Summary Calculates and returns the free energy of a solvation for each mutant relative to the parent free energy of solvation. ddGa_rel
()Summary Calculates and returns the free energy of association relative to the parent free energy of association. find_grid
()Summary genDirs
()Summary This subroutine will generate all directories needed to contain structural files, logs, etc. genMutid
()Summary This subroutine reads the input PDB, selects the structure where mutations will occur, and saves all mutant IDs in the class. genParent
()Summary Reads PDB file specified in the constructor; applies and combines results from the selection strings; and saves the final template structure in the job directory. genTruncatedPQR
()Summary Generate a structure for each mutant ID by truncating the side chain to form alanine. getMutids
()Summary run
()Summary Perform a compuational alanine scan on the initialized Alascan class. run_parallel
([n_workers])Summary Perform a computational alanine scan on the initialized Alascan class using multiple processes in parallel. set_grid
(dime, glen, gcent)Summary In the case that the user wishes to manually specify grid dimension, this may be accomplished with the set_grid method. summary
([filename])Summary Summarize results from the computational alanine scan once complete. viewLogs
()writeLogs
([filename])-
calcAPBS
()¶ Summary Run APBS on each structure in mutant library, in serial.
Returns: None
Stores energies from APBS in Gref and Gsolv class attributes.
-
calcAPBS_parallel
(n_workers=None)¶ Summary Run APBS on each structure in mutant library, in parallel.
Parameters: n_workers : int
Number of processes to run. If None, method will use all available threads.
Returns: None
Saves solvated-state and reference-state free energies as class attributes.
-
calcCoulomb
()¶ Summary Calculates Coulombic free energies with coulomb.exe from the APBS toolbox.
Returns: None
Saves Coulombic free energies as a class attribute.
-
calcCoulomb_parallel
(n_workers=None)¶ Summary Calculates Coulombic free energies with coulomb.exe from the APBS toolbox in a parallel manner.
Parameters: n_workers : int
Number of processes to run. If None, method will use all available threads.
Returns: None
Saves Coulombic free energies as a class attribute.
-
calcESI
(idx=-1)¶ Summary
Compare potential files and calculate the similarity index. Values closer to 1 imply similarity while values closer to zero imply dissimilarity.
Parameters: method : str, optional
This parameter will allow for other metrics to compare grid potentials; however, for now only ‘AND’ is implemented.
idx : int
Index of original PDB files supplied containing reference structure. Set to None to perform all pairwise comparisons.
Returns: None
Writes esi files to the esi_files directory within the job directory.
-
checkerrors
()¶
-
checkwarnings
()¶
-
dGsolv_rel
()¶ Summary Calculates and returns the free energy of a solvation for each mutant relative to the parent free energy of solvation.
Returns: ndarray
Array of solvation free energies corresponding to mutant IDs from the Alascan.getMutIDs() method.
-
ddGa_rel
()¶ Summary Calculates and returns the free energy of association relative to the parent free energy of association.
Returns: ndarray
Array of free energies corresponding to the mutant IDs from the Alascan.getMutIDs() method.
-
find_grid
()¶ Summary Calculate grid dimensions for APBS (dime, glen, gcent)
Returns: TYPE
Sets class attributes dime, glen, and gcent
-
genDirs
()¶ Summary This subroutine will generate all directories needed to contain structural files, logs, etc. In the future we may implement a method to remove such files when outputs are more standardized.
Returns: None
No output, operates on the class and generates folders in the job directory.
-
genMutid
()¶ Summary This subroutine reads the input PDB, selects the structure where mutations will occur, and saves all mutant IDs in the class. If region is specified in the constructor, then the constraint will be applied here.
Returns: None
Operates on the class to generate a list of mutant IDs for each selection string. The following class variables will be generated (see class description):
- mutid
- list_chids
- list_resnums
- list_resnames
- mask_by_sel
-
genParent
()¶ Summary Reads PDB file specified in the constructor; applies and combines results from the selection strings; and saves the final template structure in the job directory.
Returns: None
Template pdb written in job directory and location saved in Alascan.file_pdb_template.
-
genTruncatedPQR
()¶ Summary Generate a structure for each mutant ID by truncating the side chain to form alanine.
Returns: None
Write library of mutant structures to disk for subsequent analysis.
-
getMutids
()¶ Summary
Returns: list
Returns vectorized format of mutids.
-
run
()¶ Summary Perform a compuational alanine scan on the initialized Alascan class.
Returns: None
Outputs text to STDOUT when run is complete, will be made optional in the future.
-
run_parallel
(n_workers=None)¶ Summary Perform a computational alanine scan on the initialized Alascan class using multiple processes in parallel.
Parameters: n_workers : int
Number of processes to run. If None, method will use all available threads.
Returns: None
Outputs text to STDOUT when run is complete, will be made optional in the future.
-
set_grid
(dime, glen, gcent)¶ Summary In the case that the user wishes to manually specify grid dimension, this may be accomplished with the set_grid method. Typically, this is used when grid space parameters must be consistent for many analyses. Please see description at: http://www.poissonboltzmann.org/docs/apbs-overview/ for description of parameters.
Parameters: dime : list
List of three integers.
glen : list
List of three integers.
gcent : list
List of three integers.
Returns: TYPE
Description
-
summary
(filename=None)¶ Summary Summarize results from the computational alanine scan once complete.
Parameters: filename : str, optional
In order to write summary to a text file, supply the filename (full path).
Returns: None
Prints summary of residues and energies relative to the parent structure if no filename is provided. Otherwise, writes to text file.
-
viewLogs
()¶
-
writeLogs
(filename=None)¶
-
-
class
aesop.aesop.
DirectedMutagenesis
(pdb, target, mutation, pdb2pqr_exe='pdb2pqr', apbs_exe='apbs', coulomb_exe='coulomb', selstr=['protein'], jobname=None, grid=1, ion=0.15, pdie=20.0, sdie=78.54, ff='parse', cfac=1.5, dx=False, minim=True)¶ Summary
Attributes
apbs (str) Full path to APBS executable. Must be compatible with OS. apbs_results (str) Full path to output from APBS cfac (numeric) Scaling factor for grid dimensions. We suggest to leave this unchanged. coulomb (str) Full path to coulomb executable from APBS package. Must be compatible with OS. coulomb_results (str) Full path to folder containing results from coulomb. dime (list) List of three integers. Parameter required for APBS. Please see description at: http://www.poissonboltzmann.org/docs/apbs-overview/ disu (bool, optional) If true, Modeller will guess patches for disulfide bridges. Only relevant if minim is set to True. dx (bool) Variable that specifies if potential files should be written to disk. Default is False. dx_files (list) If written to disk, list of potential files written to disk. The folder containing these files is given by Alascan.apbs_results. E_ref (ndarray) Reference state energy values for each structure from APBS. E_solv (ndarray) Solvated state energy values for each structure from APBS. ff (string) Force-field to use for PDB2PQR file_pdb_template (string) Full path to template PDB file. gcent (list) List of three integers. Parameter required for APBS. Please see description at: http://www.poissonboltzmann.org/docs/apbs-overview/ Gcoul (ndarray) Coulombic free energies, corresponding to Alascan.mutid. glen (list) List of three integers. Parameter required for APBS. Please see description at: http://www.poissonboltzmann.org/docs/apbs-overview/ Gref (ndarray) Reference-state free energies, corresponding to Alascan.mutid. grid (numeric) Distance spacing of grid points. If the grid dimensions are not divisible by three, resolution will be increased (smaller grid spacing) until grid dimensions are divisible by three. Gsolv (ndarray) Solvated-state free energies, corresponding to Alascan.mutid. ion (numeric) Ionic strength to be used in the solvated-state APBS calculations. jobdir (str) [Optional] Path to folder containing results. If not specified, a directory will be generated. jobname (str) [Optional] Name for current job, will be used to create the jobdir. list_chids (list) Chain ID where mutation was made. Corresponds to Alascan.mutid. list_resnames (list) Residue names where mutation was made. Corresponds to Alascan.mutid. list_resnums (list) Residue numbers where mutation was made. Corresponds to Alascan.mutic. logs (list) List of strings that represent the log files from every executable called (namely, PDB2PQR and APBS) logs_apbs_dir (str) Folder in jobdir containing output from APBS (logs, input files, dx files) mask_by_sel (ndarray) Matrix containing selection masks. The first column corresponds to the selection string for the parent and each column thereafter corresponds to an element of the selection string (selstr) in the same order. max_iter (integer, optional) Maximum number of calls to the objective function. If this value is reached, then minimization is terminated. Default value is 1000 iterations. min_atom_shift (float, optional) If the maximimum atomic shift between minimization steps is less thant this value, convergence is reached and minimization is terminated. Default value is 0.1 angstroms. minim (bool, optional) If true, structures will be minimzed with Modeller’s conjugate gradient descent algorithm. mutation (list) Identity of amino acid for mutation of corresponding target. Must be the same length as target and each residue must use the standard 3-letter amino acid code. mutid (list) List of mutant IDs. The first element corresponds to the parent. Subsequent elements correspond to each element of the selection string list (selstr). Please use Alascan.getMutids() to get vectorized version. output (string, optional) Modeller option specifying whether to print verbose output to STDOUT (‘REPORT’), or to print minimal output to STDOUT (‘NO_ REPORT’) pdb (str) Path to PDB file with atomic coordinates. Must follow formatting conventions of the Protein Databank. pdb2pqr (str) Full path to PDB2PQR executable. pdb_complex_dir (str) Folder name in the job directory that contains the PDB file(s) of the complex structures. pdie (numeric) Protein dielectric constant to be used in APBS. pqr_complex_dir (str) Folder name in the job directory containing PQR files for each protein complex. pqr_sel_dir (list) List of folder names in the job directory that contain PQR files for selection strings (selstr). Each element of pqr_sel_dir corresponds to the same element of selstr. sdie (numeric) Solvent dielectric constant to be used in APBS. selstr (list) List of selection strings. Typically each selection string will correspond to a chain in a protein complex. We advise users to specify two or more selection strings. (Ex: [‘chain A’, ‘chain B’]) target (list) List of residue numbers to mutate. Must correspond element-wise to mutation attribute. Methods
calcAPBS
()Summary Call apbs to calculate reference-state and solvation-state energies for all structures in library. calcAPBS_parallel
([n_workers])Summary Run APBS on each structure in mutant library, in parallel. calcCoulomb
()Summary Calculates Coulombic free energies with coulomb.exe from the APBS toolbox. calcCoulomb_parallel
([n_workers])Summary Calculates Coulombic free energies with coulomb.exe from the APBS toolbox in a parallel manner. checkerrors
()checkwarnings
()dGsolv_rel
()Summary Calculates and returns the free energy of a solvation for each mutant relative to the parent free energy of solvation. ddGa_rel
()Summary Calculates and returns the free energy of association relative to the parent free energy of association. find_grid
()Summary genDirs
()Summary This subroutine will generate all directories needed to contain structural files, logs, etc. genMutid
()Summary This subroutine reads the input PDB, selects the structure where mutations will occur, and saves all mutant IDs in the class. genPDB
([minim])Summary genPQR
()Summary Generates PQR for each PDB in library. genParent
()Summary Reads PDB file specified in the constructor; applies and combines results from the selection strings; and saves the final template structure in the job directory. getMutids
()Summary run
()Summary Perform a directed mutagenesis scan on the initialized class. run_parallel
([n_workers])Summary Perform a computational directed mutagenesis scan on the initialized class using multiple processes in parallel. set_grid
(dime, glen, gcent)Summary In the case that the user wishes to manually specify grid dimension, this may be accomplished with the set_grid method. summary
([filename])Summary Summarize results from the computational alanine scan once complete. viewLogs
()writeLogs
([filename])-
calcAPBS
()¶ Summary Call apbs to calculate reference-state and solvation-state energies for all structures in library.
Returns: None
Sets class attributes Gsolv and Gref
-
calcAPBS_parallel
(n_workers=None)¶ Summary Run APBS on each structure in mutant library, in parallel.
Parameters: n_workers : int
Number of processes to run. If None, method will use all available threads.
Returns: None
Saves solvated-state and reference-state free energies as class attributes.
-
calcCoulomb
()¶ Summary Calculates Coulombic free energies with coulomb.exe from the APBS toolbox.
Returns: None
Saves Coulombic free energies as a class attribute.
-
calcCoulomb_parallel
(n_workers=None)¶ Summary Calculates Coulombic free energies with coulomb.exe from the APBS toolbox in a parallel manner.
Parameters: n_workers : int
Number of processes to run. If None, method will use all available threads.
Returns: None
Saves Coulombic free energies as a class attribute.
-
checkerrors
()¶
-
checkwarnings
()¶
-
dGsolv_rel
()¶ Summary Calculates and returns the free energy of a solvation for each mutant relative to the parent free energy of solvation.
Returns: ndarray
Array of solvation free energies corresponding to mutant IDs from the Alascan.getMutIDs() method.
-
ddGa_rel
()¶ Summary Calculates and returns the free energy of association relative to the parent free energy of association.
Returns: ndarray
Array of free energies corresponding to the mutant IDs from the Alascan.getMutIDs() method.
-
find_grid
()¶ Summary Calculate grid dimensions for APBS (dime, glen, gcent)
Returns: TYPE
Sets class attributes dime, glen, and gcent
-
genDirs
()¶ Summary This subroutine will generate all directories needed to contain structural files, logs, etc. In the future we may implement a method to remove such files when outputs are more standardized.
Returns: None
No output, operates on the class and generates folders in the job directory.
-
genMutid
()¶ Summary This subroutine reads the input PDB, selects the structure where mutations will occur, and saves all mutant IDs in the class. If region is specified in the constructor, then the constraint will be applied here.
Returns: None
Operates on the class to generate a list of mutant IDs for each selection string. The following class variables will be generated (see class description):
- mutid
- list_chids
- list_resnums
- list_resnames
- mask_by_sel
-
genPDB
(minim=True)¶ Summary Generates mutations by calling function to mutate PDB with modeller
Returns: None
Write PDB library to expected path according to class attributes.
-
genPQR
()¶ Summary Generates PQR for each PDB in library.
Returns: None
Calls PDB2PQR and writes PQR to expected path according to class attributes.
-
genParent
()¶ Summary Reads PDB file specified in the constructor; applies and combines results from the selection strings; and saves the final template structure in the job directory.
Returns: None
Template pdb written in job directory and location saved in Alascan.file_pdb_template.
-
getMutids
()¶ Summary
Returns: list
Returns vectorized format of mutids.
-
run
()¶ Summary Perform a directed mutagenesis scan on the initialized class.
Returns: None
Outputs text to STDOUT when run is complete, will be made optional in the future.
-
run_parallel
(n_workers=None)¶ Summary Perform a computational directed mutagenesis scan on the initialized class using multiple processes in parallel.
Parameters: n_workers : int
Number of processes to run. If None, method will use all available threads.
Returns: None
Outputs text to STDOUT when run is complete, will be made optional in the future.
-
set_grid
(dime, glen, gcent)¶ Summary In the case that the user wishes to manually specify grid dimension, this may be accomplished with the set_grid method. Typically, this is used when grid space parameters must be consistent for many analyses. Please see description at: http://www.poissonboltzmann.org/docs/apbs-overview/ for description of parameters.
Parameters: dime : list
List of three integers.
glen : list
List of three integers.
gcent : list
List of three integers.
Returns: TYPE
Sets class attributes for dime, glen, gcent
-
summary
(filename=None)¶ Summary Summarize results from the computational alanine scan once complete.
Parameters: filename : str, optional
In order to write summary to a text file, supply the filename (full path).
Returns: None
Prints summary of residues and energies relative to the parent structure if no filename is provided. Otherwise, writes to text file.
-
viewLogs
()¶
-
writeLogs
(filename=None)¶
-
-
class
aesop.aesop.
ElecSimilarity
(pdbfiles, pdb2pqr_exe='pdb2pqr', apbs_exe='apbs', selstr=None, jobname=None, grid=1, ion=0.15, pdie=20.0, sdie=78.54, ff='parse', cfac=1.5, minim=False)¶ Summary
Attributes
apbs (str) Full path to APBS executable. Must be compatible with OS. cfac (numeric) Scaling factor for grid dimensions. We suggest to leave this unchanged. dim_dx (list) Dimensions of grid space dime (list) List of three integers. Parameter required for APBS.Please see description at: http://www.poissonboltzmann.org/docs/apbs-overview/ disu (bool, optional) If True, Modeller will guess the patches for disulfide bridges within the provided protein structures. Only relevant if minim is set to True. dx (bool) Variable that specifies if potential files should be written to disk. Default is False. dxdir (str) Folder in job directory where potential files are stored. dxfiles (list) List of all potential files. edges (ndarray) Edges of grid space. esd (ndarray) Matrix of pairwise electrostatic similarities. ff (str) Forcefield to use in assigning charges to PDB files. gcent (list) List of three integers. Parameter required for APBS. Please see description at: http://www.poissonboltzmann.org/docs/apbs-overview/ glen (list) List of three integers. Parameter required for APBS. Please see description at: http://www.poissonboltzmann.org/docs/apbs-overview/ grid (int) Desired grid spacing in Angstroms. Actual grid spacing may be slightly lower. ids (list) List of IDs for each structure being compared with the ESD metric. ion (numeric) Ionic strength to be used in the solvated-state APBS calculations. jobdir (TYPE) Description jobname (str) [Optional] Name for current job, will be used to create the jobdir. logs (list) List of strings that represent the log files from every executable called (namely, PDB2PQR and APBS) max_iter (integer, optional) Maximum number of calls to the objective function. If this value is reached, then minimization is terminated. Default value is 1000 iterations. midpoints (ndarray) Midpoints of grid space min_atom_shift (float, optional) If the maximimum atomic shift between minimization steps is less thant this value, convergence is reached and minimization is terminated. Default value is 0.1 angstroms. minim (bool, optional) If true, structures will be minimzed with Modeller’s conjugate gradient descent algorithm. output (string, optional) Modeller option specifying whether to print verbose output to STDOUT (‘REPORT’), or to print minimal output to STDOUT (‘NO_ REPORT’) pdb2pqr (str) Full path to PDB2PQR executable. pdbdir (str) Folder in job directory where PDB files are located. pdbfiles (list) List of PDB file names. pdie (numeric) Protein dielectric constant to be used in APBS. pqrdir (str) Folder in job directory containing PQR files. pqrfiles (list) List of PQR files in pqrdir sdie (numeric) Solvent dielectric constant to be used in APBS. Methods
calcESD
([method])Summary Compare potential files and calculate the similarity distance. calcESI
([method, idx])Summary centerPDB
()Summary checkerrors
()checkwarnings
()genDX
()Summary Generates potential files using APBS. genDX_parallel
([n_workers])Summary Generates multiple potential files in parallel by calling APBS multiple times according to how many threads are available/specified. genPQR
()Summary initializeGrid
()Summary Method to find grid parameters and ensure that the product of dimensions is divisible by three. minimPDB
()Summary Re-reads PDB files in pdbdir and performs energy minimization. mutatePQR
([selstr, minim])Summary run
([center, superpose, esi, esd, selstr, ...])run_parallel
([n_workers, center, superpose, ...])superposePDB
()Summary Superpose each structure in pdbfiles with first element in pdbfiles list. viewLogs
()writeLogs
([filename])-
calcESD
(method='AND')¶ Summary Compare potential files and calculate the similarity distance. Smaller distances imply similarity.
Parameters: method : str, optional
This parameter will allow for other metrics to compare grid potentials; however, for now only ‘AND’ is implemented.
Returns: None
Stores esd matrix as class attribute.
-
calcESI
(method='AND', idx=0)¶ Summary
Compare potential files and calculate the similarity index. Values closer to 1 imply similarity while values closer to zero imply dissimilarity.
Parameters: method : str, optional
This parameter will allow for other metrics to compare grid potentials; however, for now only ‘AND’ is implemented.
idx : int
Index of original PDB files supplied containing reference structure. Set to None to perform all pairwise comparisons.
Returns: None
Writes esi files to the esi_files directory within the job directory.
-
centerPDB
()¶ Summary Re-reads PDB file in pdbdir and centers coordinates at (0, 0, 0)
Returns: TYPE
Overwrites previous PDB files in pdbdir
-
checkerrors
()¶
-
checkwarnings
()¶
-
genDX
()¶ Summary Generates potential files using APBS.
Returns: None
Generates DX files in dxdir
-
genDX_parallel
(n_workers=None)¶ Summary Generates multiple potential files in parallel by calling APBS multiple times according to how many threads are available/specified.
Parameters: n_workers : int
Number of processes to run. If None, method will use all available threads.
Returns: TYPE
Generates DX files in dxdir.
-
genPQR
()¶ Summary Convert all PDB files to PQR files with charges allocated according to a compatible force-field
Returns: None
Generates PQR files in the pqrdir
-
initializeGrid
()¶ Summary Method to find grid parameters and ensure that the product of dimensions is divisible by three.
Returns: None
Sets class attributes dime, glen, gcent.
-
minimPDB
()¶ Summary Re-reads PDB files in pdbdir and performs energy minimization.
Returns: TYPE
Overwrites previous PDB files in pdbdir
-
mutatePQR
(selstr=['protein'], minim=False)¶ Summary Mutate all PQR files, optional method
Returns: None
Generates PQR files in the pqrdir
-
run
(center=False, superpose=False, esi=False, esd=True, selstr=None, idx=0, minim=False)¶
-
run_parallel
(n_workers=None, center=False, superpose=False, esi=False, esd=True, selstr=None, idx=0, minim=False)¶
-
superposePDB
()¶ Summary Superpose each structure in pdbfiles with first element in pdbfiles list. This uses Modeller to perform the superpositioning.
Returns: TYPE
Overwrites PDB files in pdbdir with new coordinate information.
-
viewLogs
()¶
-
writeLogs
(filename=None)¶
-
-
class
aesop.aesop.
Grid
(filename=None)¶ Summary
The grid class facilitates parsing and writing of OpenDX file formats. In the current state, the class is quite rudimentary and only supports changing vectors for the grid data.
Attributes
filename (string) DX file to import pot (ndarray) Vectors at each grid point. For AESOP, these will typically be electrostatic potentials or an electrostatic similarity index. header (list) List of grid parameters from the OpenDX format prior to vectors. footer (list) List of grid parameters from the OpenDX format subsequent to the vectors. Methods
readDX
([filename])Summary writeDX
([filename])Summary -
re
= <module 're' from '/home/docs/checkouts/readthedocs.org/user_builds/aesop/envs/v1.1.0/lib/python2.7/re.pyc'>¶
-
readDX
(filename=None)¶ Summary
Method to parse a DX file
Parameters: filename : string
Name for the OpenDX file to be imported. If unspecified, this parameter defaults to the class attribute.
-
writeDX
(filename=None)¶ Summary
Function to write OpenDX files
Parameters: filename : string
Name for OpenDX file that will be written. This should be a full path if you wish to place the file somewhere other than the current working directory.
-
-
aesop.aesop.
batchAPBS
(kernel)¶ Summary Function required to run multiple APBS jobs simultaneously. Not intended for general use.
Parameters: kernel : tuple
Tuple of parameters required for APBS.
Returns: ndarray
i, j represent the index in the matrix with which the calculated energies correspond. The last two elements are the solvation and reference energies, respectively.
-
aesop.aesop.
batchCalcDX
(kernel)¶ Summary Function required to run multiple APBS jobs simultaneously. Not intended for general use.
Parameters: kernel : tuple
Tuple of parameters required for APBS.
Returns: None
Writes files according to calcDX function.
-
aesop.aesop.
batchCoulomb
(kernel)¶ Summary Function required to run multiple Coulomb jobs simultaneously. Not intended for general use.
Parameters: kernel : tuple
Tuple of parameters required for APBS.
Returns: ndarray
i, j represent the index in the matrix with which the calculated energies correspond. The last element is the Coulombic energy.
-
aesop.aesop.
calcDX
(path_apbs_exe, pqrfile, prefix=None, grid=1.0, ion=0.15, pdie=20.0, sdie=78.54, cfac=1.5, glen=None, gcent=array([ 0., 0., 0.]), dime=None)¶ Summary Calls the APBS executable after generating the APBS inputfile. Generates a potential file (DX).
Parameters: path_apbs_exe : str
Full path to APBS executable, EX: ‘C:APBSapbs.exe’.
pqrfile : str
The PQR file that will be used to generate a grid of electrostatic potentials. Must be a full path if file is not in current path.
prefix : str, optional
Phrase to prepend before any file that is generated before writing.
grid : float, optional
Distance spacing of grid points. If the grid dimensions are not divisible by three, resolution will be increased (smaller grid spacing) until grid dimensions are divisible by three.
ion : float, optional
Ionic strength for APBS calculation.
pdie : float, optional
Protein dielectric constant for APBS calculation.
sdie : float, optional
Solvent dielectric constant for APBS calculation.
cfac : float, optional
Scaling factor for grid dimensions. We suggest to leave this unchanged.
glen : None, optional
List of three integers. Parameter required for APBS. Please see description at: http://www.poissonboltzmann.org/docs/apbs-overview/
gcent : TYPE, optional
List of three integers. Parameter required for APBS. Please see description at: http://www.poissonboltzmann.org/docs/apbs-overview/
dime : None, optional
List of three integers. Parameter required for APBS. Please see description at: http://www.poissonboltzmann.org/docs/apbs-overview/
Returns: (log, err) : tuple
When APBS runs, outputs that would have been sent to STDOUT are captured. Log contains the run log and err contains errors.
-
aesop.aesop.
complete_structure
(pdb, dest=None, disu=False)¶ Summary Function to fill in residues with missing atoms. This method simply calls complete_pdb from Modeller.
Parameters: pdb : str
Full path to pdbfile that will be modified.
dest : str (optional)
Full path to destination where completed pdb will be written. If not specified, the model object from Modeller will be returned.
disu : bool (optional)
If True, complete_pdb will predict and patch all disulfide bridges. Default is False.
-
aesop.aesop.
execAPBS
(path_apbs_exe, pqr_chain, dime, glen, gcent, prefix=None, ion=0.15, pdie=20.0, sdie=78.54, dx=False)¶ Summary Calls the APBS executable after generating the APBS inputfile. Calculates solvation and reference energies.
Parameters: path_apbs_exe : str
Full path to APBS executable, EX: ‘C:APBSapbs.exe’.
pqr_chain : str
PQR file name containing the segment that will undergo electrostatic calculations.
dime : list
List of three integers. Parameter required for APBS. Please see description at: http://www.poissonboltzmann.org/docs/apbs-overview/
glen : list
List of three integers. Parameter required for APBS. Please see description at: http://www.poissonboltzmann.org/docs/apbs-overview/
gcent : list
List of three integers. Parameter required for APBS. Please see description at: http://www.poissonboltzmann.org/docs/apbs-overview/
prefix : str, optional
Phrase to prepend before any file that is generated before writing.
ion : float, optional
Ionic strength for APBS calculation.
pdie : float, optional
Protein dielectric constant for APBS calculation.
sdie : float, optional
Solvent dielectric constant for APBS calculation.
dx : bool, optional
If true, potential files are written.
Returns: file_apbs_log : str
File name for the log file that APBS generates. This file contains results from performed calculations.
-
aesop.aesop.
execCoulomb
(path_coulomb_exe, pqr)¶ Summary Call Coulomb from APBS tools to calculate Coulombic energies.
Parameters: path_coulomb_exe : str
Full path to coulomb executable.
pqr : TYPE
Filename for PQR to use for Coulombic energy calculation. Must be full path if not in current path.
Returns: float
Coulombic energy associated with input PQR file.
-
aesop.aesop.
execPDB2PQR
(path_pdb2pqr_exe, pdbfile, outfile=None, ff='parse')¶ Summary Calls the APBS executable according to: <path to pdb2pqr appropriate for OS> –ff=parse –chain inputfile outputfile
Parameters: path_pdb2pqr_exe : str
Full path to pdb2pqr executable
pdbfile : str
PDB file to be converted to a PQR. Should be a full path if not in current working directory.
outfile : str, optional
File name for PQR file that will be generated. May be a full path if desired output is not in current working directory.
ff : str, optional
String instructing PDB2PQR what force field to employ. For more information visit: http://www.poissonboltzmann.org/docs/pdb2pqr-usage/
Returns: (log, err) : tuple
When PDB2PQR runs, outputs that would have been sent to STDOUT are captured. Log contains the run log and err contains errors.
-
aesop.aesop.
minimize_cg
(struct, dest=None, disu=True, min_atom_shift=0.1, max_iter=1000, output='NO_REPORT', log=None, report_iter=10)¶ Summary Function to perform conjugate gradient descent minimization in Modeller on a user-provided structural file (PDB).
Parameters: struct : str
String for path to PDB file
dest : str
String for path to location where minimized structure will be written
disu : bool
If true, positions of disulfide bridges will be automatically detected
min_atom_shift : float
If the max atomic shift between minimization steps is less than this value, then convergence is reached and minimization is terminated
max_iter : int
Maximum number of calls of objective function before minimization is terminated
output : str
Valid options are ‘NO_REPORT’ and ‘REPORT’. If set to ‘REPORT’, then a log file during minimation will be printed to screen
log : str or None
String for path to location where minimization report will be saved. If None, no report will be saved. Report contains only values of objective function at after each report interval.
report_iter : int
Integer that describes the number of minimization steps to perform before reporting the objective function.
Returns: mdl : Model object from Modeller
If dest is None, the function will return the minimized model. If dest is specified, then no model will be returned but the minimized model will be written to file.
-
aesop.aesop.
mutatePDB
(pdb, mutid, resnum, chain=None, resid='ALA')¶ Summary Function to generate a mutant structure given a local PDB file using MODELLER.
Parameters: pdb : str
Full path to pdbfile that will be modified.
mutid : str
Prefix for mutated structure that will be written. May be a full path without file extension if desired output path is not in working directory.
resnum : int, or type that can be forced to int
Integer number specifying residue number to be mutated.
chain : str, optional
Chain ID where specified residue number is to be mutated. This is necessary to specify if residue numbers are not unique on each chain.
resid : str, optional
Three letter amino acid code specifying the type of mutation. Default mutation is to alanine (‘ALA’).
Returns: None
Writes mutated structure to file.
-
aesop.aesop.
mutatePQR
(pqrfile, mutid, resnum, chain=None)¶ Summary Mutate PQR file via side-chain truncation scheme (mutate to Alanine)
Parameters: pqrfile : str
Full path to PQR file
mutid : str
Prefix to use when writing mutated PQR. Should be a full path if destination is not in working directory.
resnum : int
Residue number to mutate to alanine.
chain : str, optional
Chain where residue that will be mutated is located.
Returns: None
Writes mutated PQR to file specified by the prefix mutid.
-
aesop.aesop.
plotDend
(esd, filename=None)¶ Summary Function to display an electrostatic similarity dendrogram from a previously run ElecSimilarity class.
Parameters: esd : ElecSimilarity class
ElecSimilarity class containing final esd matrix.
filename : str, optional
If the resulting plot should be written to disk, specify a filename. Otherwise, the image will only be saved.
Returns: None
Writes image to disk, if desired.
-
aesop.aesop.
plotESD
(esd, filename=None, cmap='hot')¶ Summary Function to display an electrostatic similarity heatmap from a previously run ElecSimilarity class.
Parameters: esd : ndarray
ESD matrix from ElecSimilarity class (ElecSimilarity.esd).
filename : str, optional
If the resulting plot should be written to disk, specify a filename. Otherwise, the image will only be saved.
cmap : str, optional
Colormap from matplotlib to use.
Returns: None
Writes image to disk, if desired.
-
aesop.aesop.
plotESD_interactive
(esd, filename=None, cmap='YIGnBu', display_output='external')¶ Summary Function to display an electrostatic similarity heatmap from a previously run ElecSimilarity class. Figure is more interactive that the standard matplotlib figure.
Parameters: esd : ElecSimilarity class
ElecSimilarity class containing final esd matrix.
filename : str, optional
If the resulting plot should be written to disk, specify a filename. Otherwise, the image will only be saved.
cmap : str, optional
Colormap from matplotlib to use.
display_output : str
Set output to either open local html file in browser or inline plot in notebook.
Returns: None
Writes image to disk, if desired.
-
aesop.aesop.
plotNetwork
(scan, filename=None, title='', dpi=300, cutoff=5.0, E=2.5, node_size=1500, font_size=12, alpha=0.8, edge_color='g', edge_width=3.0, layout=None, **kwargs)¶ Summary Function to visualize electrostatic interactions from a scan class (Alascan or Directed Mutagenesis). Requires networkx to be installed.
Parameters: scan : Alascan or DirectedMutagenesis class
Scan class where calculation of free energies is complete.
filename : str or None
Full path to file where figure will be saved. If None, no figure is saved, but the plot is displayed and the graph is returned.
title : str
Matplotlib style title for plot.
dpi : int
Integer specifying the dots per inch, or image resolution.
cutoff : float
Distance cutoff in Angstroms for determining if a electrostatic interaction occurs. Default value is 5 Angstroms.
E : float
Threshold for determing those nodes that should be included in the network based on the value of the free energy perturbation that results from mutating the amino acid. If the magnitude of the free energy of association relative to the parent structure is greater than E, then the node is included. Default is 2.5 kJ/mol.
node_size : int
Parameter to scale size of nodes in network. Larger values result in nodes with larger diameter.
font_size : int
Font size for text within network. 12 pt font is default.
alpha : float
Set transparency of nodes. Default is 0.8. Accepted range is [0, 1].
edge_color : str
Matplotlib-style specification of line color. Default is ‘g’ (green).
edge_width : int
Set the line width for edges. Default is 3 pt font.
layout : Networkx layout kernel or None
Network layout from networkx. Extra arguments for this layout may be passed as key word arguments to plotNetwork.
-
aesop.aesop.
plotNetwork_interactive
(scan, filename=None, title='', cutoff=5.0, E=2.5, font_size=14, node_size=20, edge_color='#888', edge_width=0.5, display_output='external', layout=None, **kwargs)¶ Summary Function to visualize electrostatic interactions from a scan class (Alascan or Directed Mutagenesis). Figure is more interactive than the standard matplotlib figure. Requires networkx to be installed.
Parameters: scan : Alascan or DirectedMutagenesis class
Scan class where calculation of free energies is complete.
filename : str or None
Full path to file where figure will be saved. If None, no figure is saved, but the plot is displayed and the graph is returned.
title : str
Matplotlib style title for plot.
cutoff : float
Distance cutoff in Angstroms for determining if a electrostatic interaction occurs. Default value is 5 Angstroms.
E : float
Threshold for determing those nodes that should be included in the network based on the value of the free energy perturbation that results from mutating the amino acid. If the magnitude of the free energy of association relative to the parent structure is greater than E, then the node is included. Default is 2.5 kJ/mol.
node_size : int
Parameter to scale size of nodes in network. Larger values result in nodes with larger diameter.
font_size : int
Font size for text within network. 12 pt font is default.
edge_color : str
Matplotlib-style specification of line color. Default is ‘g’ (green).
edge_width : int
Set the line width for edges. Default is 3 pt font.
display_output : str
Set output to either open local html file in browser or inline plot in notebook.
layout : Networkx layout kernel or None
Network layout from networkx. Extra arguments for this layout may be passed as key word arguments to plotNetwork.
-
aesop.aesop.
plotScan
(Alascan, filename=None)¶ Summary Function to display results from the computational alanine or directed mutagenesis scan.
Parameters: Alascan : scan class
Alascan or DirectedMutagenesis class after running the complete analysis.
filename : None, optional
If the resulting plot should be written to disk, specify a filename. Otherwise, the image will only be saved.
Returns: tuple
Handles to generated figure.
-
aesop.aesop.
plotScan_interactive
(Alascan, display_output='external', filename=None)¶ Summary Function to display results from the computational alanine or directed mutagenesis scan. Figure is more interactive than the standard matplotlib figure.
Parameters: Alascan : scan class
Alascan or DirectedMutagenesis class after running the complete analysis.
display_output : str
Set output to either open local html file in browser or inline plot in notebook.
filename : None, optional
If the resulting plot should be written to disk, specify a filename. Otherwise, the image will only be saved.
Returns: None
Saves image of figure, if desired.
-
aesop.aesop.
runProcess
(command)¶ Summary Simple function intended to capture outputs from processes that write to STDOUT.
Parameters: command : list
Lists of strings where each element is a part of the entire command. Ex: [‘script’,’arg1’,’arg2’,...]
Returns: tuple
return tuple where first element is output that would have been sent to STDOUT and the second element captures errors.
-
aesop.aesop.
superpose
(ref, pdb, atype='CA', output=None)¶ Summary Uses Modeller to superpose a PDB file (pdb) to a reference PDB (ref).
Parameters: ref : str
Full path to PDB file (or name of file in working directory) that will be used as the reference for superpositioning.
pdb : str
Full path to PDB file (or name of file in working directory) that will be used as the mobile structure for superpositioning.
atype : str
Modeller-compatible string selection for atoms to be used in superpositioning. We suggest using ‘CA’.
output : str or None
If output is None, the file specified by pdb will be updated with the superposed structure. If specified, output should be a full path where the superposed structure will be saved.
-
aesop.aesop.
writePDB
(alascan, filename=None)¶ Summary Function to write free energies of association/solvation into B-factor column of PDB for easy visualization of results.
Parameters: alascan : scan class
Alascan or DirectedMutagenesis class after running the complete analysis.
filename : str, optional
Full path to file where PDB file will be written. Defaults to job directory.