Routines that wrap AmberTools programs
This module defines two public functions: run_antechamber run_parmchk
Can be executed from the command line as a stand-alone program
Wrapper for antechamber with default parameters and AM1-BCC charges
Parameters: | lig : PDBFile or string
charge : int
resnam : string, optional
|
---|---|
Returns: | string
|
Wrapper for parmcheck with default parameters
Parameters: | lig : PDBFile or string
|
---|---|
Returns: | string
|
Routines to build a ProtoMS template file
The module defines a two public function build_template make_zmat
Can be executed from the command line as a stand-alone program
Class to encapsulate an atom in an Amber prepi file and its connectivity
Attributes
atype | (string) the atom type |
bondidx | (int) the index of the atom this atom is bonded to in the prepi z-matrix |
bonds | (list) names of all atoms this atom is bonded to |
charge | (float) the charge |
index | (int) the serial number in the prepi file |
is_on_loop | (dictionary) a flag for each atom in bonds indicating if the bond is part of a loop |
loop_closure | (dictionary) a flag for each atom in bonds indicating if the bond was part of a loop statement in the prepi file |
name | (string) the atom name |
traversed | (dictionary) a flag for each atom in bonds indicating if the bond has been traversed |
zmat | (list) atom names of the atoms defined to this atom in the z-matrix |
Methods
add_bond(atomname[, loop_closure]) | Add a bond to this atom |
backward_bond(exclude, defined) | Find an atom, bonded to this atom that has |
improper_dihedral(exclude, defined) | Look for the definition of an improper dihedral: |
next_bond(defined[, update]) | Find an atom, bonded to this atom that |
read(record, atomlist) | Read a line from an Amber prepi-file |
sort_bonds(metric) | Sort the bonds based on some metric |
Add a bond to this atom
Find an atom, bonded to this atom that has already been defined but is not in the list of excluded atoms
Look for the definition of an improper dihedral: see if at least two bonds to this atom has been defined, excluding the bond in the exclude list
Find an atom, bonded to this atom that has not been defined and where the bond has not been traversed
Read a line from an Amber prepi-file
Sort the bonds based on some metric
Build a ProtoMS template file
Parameters: | temfile : string
prepifile : string
translate : float, optional
rotate : float, optional
zmatfile : string, optional
frcmodfile : string, optional
resname : string, optional
|
---|---|
Returns: | TemplateFile
|
Make a ProtoMS z-matrix for a solute
Parameters: | prepifile : string
|
---|---|
Returns: | atoms : dictionary
all_zmat : list
|
Program to do BAR
This module defines a single public function: bar
Can be executed from the command line as a stand-alone program
Do Bennet Acceptance Ratio for a set of ProtoMS output files
Parameters: | path : string
res_tem : string
skip : int
maxread : int
RT : float
verbose : dictionary of booleans
nboots : int, optional
|
---|---|
Returns: | numpy array
numpy array
numpy array
|
Routines to cluster molecules from simulations.
Can be executed from the command line as a stand-alone program
Clusters the supplied conformations in a hierarchical fasion
Parameters: | conformations : Numpy array
method : String
cutoff : Float
|
---|---|
Returns: | NumpyArray
NumpyArray
|
Finds the coordinates of a specified molecule name or a named atom from supplied PDB files.
Parameters: | pdbfiles : PDBSet
residue : string
atom : string
|
---|---|
Returns: | NumpyArray of coordinates
Integer
|
Routine to calculate a density from a set of PDB files
This module defines a these public functions: calc_density writeDX
Can be executed from the command line as a stand-alone program
Calculate the density from a set of PDB files
Parameters: | pdbfiles : PDBSet
residue : string
atom : string
padding : float, optional
extent : float, optional
spacing : float, optional
norm : int, optional
smoothing : string, optional
|
---|---|
Returns: | NumpyArray of integers
NumpyArray
dictionary
|
Write the grid to file in DX-format
Parameters: | grid : Numpy array
origin : NumpyArray
spacing : float
filename : string
|
---|
Program to calculate free energies using TI, BAR and MBAR
Program to analyze GCMC simulations
Program to analyze and plot replica paths
This module defines the following public functions: replica_path
Can be executed from the command line as a stand-alone program
Extract replica path from a set of results files
Parameters: | filenames : list of strings
evalthis : list
replicakind : string
|
---|---|
Returns: | numpy array
list
|
Routine to calculate the RMSD of the center of a ligand
This module defines a these public functions: calc_rmsd
Can be executed from the command line as a stand-alone program
Calculate RMSD of ligand centre or a specific atom
Parameters: | ref : PDBFile object
structures : PDBSet object
resname : string
atomname : string, optional
|
---|---|
Returns: | float :
|
Program to analyze and plot data series
This module defines the following public functions: find_equilibration stats_inefficiency maximize_samples running moving parse_series parse_files plot_series write_series
Can be executed from the command line as a stand-alone program
Find the equilibration time of a data series
Parameters: | x : Numpy array
y : Numpy array
atleast : int, optional
threshold : float, optional
nperm : int, optional
|
---|---|
Returns: | int
|
Find the minimum of the statistical inefficiency by varying the equlibration period, i.e. maximizing the number of uncorrelated samples
Parameters: | y : Numpy array
atleast : int, optional
|
---|---|
Returns: | int
float
int
|
Returns a moving/rolling average of the data
Parameters: | data : NumpyArray
window : int
|
---|---|
Returns: | NumpyArray
|
Parse multiple results file
If a data serie in series can be calculated over multiple input files, the data serie is replaced by some calculation over all input files
Parameters: | filenames : list of strings
series : list of strings
all_results : list of SnapshotResults
ys : list of NumpyArrays
labels : list of strings
**kwargs : dictionary
|
---|---|
Returns: | bool
|
Extract data series and label from a results file based on a label
Parameters: | series : list of string
results : SnapshotResults object
|
---|---|
Returns: | list of NumpyArrays
list of string
|
Plot a series
Parameters: | ys : list of Numpy arrays
yprop : list of dictionary
labels : list of strings
offset : int
plotkind : string
outprefix : string
|
---|
Returns a running average of the data
Value at position i of the returned data is the average of the input data from point zero to point i
Parameters: | data : NumpyArray
|
---|---|
Returns: | NumpyArray
|
Calculates the statistical inefficiency, g.
g = 1 + 2*tau, where tau is the autocorrelation time
Parameters: | y : Numpy array
|
---|---|
Returns: | float
float
|
Write a series to disc
Parameters: | ys : list of Numpy arrays
yprop : list of dictionary
labels : list of strings
offset : int
filekind : string
outprefix : string
|
---|
Program to do thermodynamic integration
This module defines a single public function: ti
Can be executed from the command line as a stand-alone program
Fit the PMF to a polynomial function Parameters ———- lambdas : list
list of lambda values
Returns: | numpy array
|
---|
Do thermodynamic integration
Parameters: | path : string
res_tem : string
skip : int
maxread : int
verbose : dictionary of booleans
numkind : string
useanalytical : boolean
|
---|---|
Returns: | numpy array
numpy array
numpy array
numpy array
numpy array
|
Routine to remove solvent molecules from a GCMC/JAWS-1 simulation box
This module defines a single public function: clear_gcmcbox
Can be executed from the command line as a stand-alone program
Removes solvent molecules from the GCMC/JAWS-1 box as they will not be able to move during the simulation
Parameters: | gcmcbox : string or PDBFile object
waters : string or PDBFile object
|
---|---|
Returns: | int
PDBFile
|
Routines to convert atom names in a PDB-file
This module defines two public functions: read_convfile pdb2pms
Can be executed from the command line as a stand-alone program
Convert atom names to ProtoMS standard
The protein object is not modified by this routine, but the Residue and Atom objects are.
Parameters: | pdb_in : PDBFile
forcefield : string
conversion_file :
|
---|---|
Returns: | a PDBFile instance with ProtoMS names |
Reads a conversion file into a dictionary
Parameters: | file : string
inmode : string
outmode : string
|
---|---|
Returns: | a dictionary of the conversion |
Raises: | ValueError
|
Routines to convert water molecules to water models from a PDB file.
This module defines a single public function convertwater
Can be executed from the command line as a stand-alone program
Rotates a template water molecule such that it has the same orientation as a reference water molecule. Useful for converting between different water models in cases when one wishes to retain the same orientations of hydrogens. It assumes that both the template and the reference water have maching oxygen locations.
Parameters: | watcoords : numpy array
template : numpy array
tol : float
|
---|---|
Returns: | numpy array
|
Converts water in a pdb object to ideal water geometries of an input model
The protein object is not modified by this routine, but the Residue and Atom objects are.
Parameters: | pdb_in : PDBFile
watermodel : string
ignorH : bool
|
---|---|
Returns: | PDBFile
|
Rotates a molecule about the centre of geometry (the mean of x,y,z of each atom in the molecule).
Parameters: | solutecoords : numpy array
alpha : float or integer
beta : float or integer
gamma : float or integer
|
---|---|
Returns: | numpy array
|
Rotates a water molecule about the oxygen atom, which is assumed to be the first element in the coordinate array.
Parameters: | watcoords : numpy array
alpha : float or integer
beta : float or integer
gamma : float or integer
|
---|---|
Returns: | numpy array
|
3D rotation matrix for rotations about x-axis.
Parameters: | alpha : float or integer
|
---|---|
Returns: | numpy array
|
3D rotation matrix for rotations about x-axis.
Parameters: | beta : float or integer
|
---|---|
Returns: | numpy array
|
3D rotation matrix for rotations about x-axis.
Parameters: | gamma : float or integer
|
---|---|
Returns: | numpy array
|
Program to generate a set of n molecules contained within given box dimenstions or to redistribute molecules given in a pdb object or file within the given box dimensions
This program takes the box dimensions as a list of strings convertible to floats, in the following order :
origin in x | origin in y | origin in z | length in x | length in y | length in z
And either the number of molecules as a string convertible to integer, or the pdb, which can be provided as a string with the name of the file, or an object.
It produces a pdb file with the randomly distributed molecules with their oxigen atoms within the box limits.
Initially thought to generate JAWS or GCMC molecules
Can be executed from the command line as a stand-alone program
Create a residue object
Parameters: | atnames : list of strings
resname : string
positions : list of numpy arrays
|
---|---|
Returns: | Residue object
|
Randomly distribute molecules in a box
Parameters: | box : a list or dictionary
particles : string or PDB object
watermodel : string, optional
partnumb : string,optional
|
---|---|
Returns: | pdb object
|
Program to split a multi pdb file into individual files
This program divides a multi pdb file in individual files. The individual pdbs must be separated by a line starting with END.
Initially thought to divide the multi-snapshot pdb file produced as ProtoMS output into individual snapshot pdb files. Required for an easy visualization of GCMC and JAWS stage 1 results.
Can be executed from the command line as a stand-alone program
Divide a pdb file in individual pdbfiles. Division is controled by lines starting with END
Parameters: | common : string
prefix : string
|
---|
Classes and routines to make ProtoMS command files
This module defines a single public function generate_input
and the following public classes: ProtoMSSimulation ProteinLigandSimulation Equilibration Sampling DualTopology
Can be executed from the command line as a stand-alone program
Bases: tools.generate_input.ProteinLigandSimulation
This a command file for a dual-topology protein-ligand simulation Generates input for proteins, solutes and solvent write dual-toplogy parameters, lambda-replica exchange, dump results, pdb and restart files equilibrate and production run
Methods
clear() | Clear the simulation description |
readCommandFile(filename) | Read in a simulation from a command file |
run(exe[, cmdfile]) | Run this simulation |
setChunk(chunk) | This adds the simulation chunk to ‘chunk’. |
setDump(dump, freq) | This adds the simulation dump to ‘dump’ with frequnecy freq |
setForceField(filename) | Set the filename for parfile |
setParameter(parameter, value) | Set the parameter to value |
setProtein(n, filename) | Set the filename for proteinN. |
setSolute(n, filename) | Set the filename for soluteN. |
setSolvent(n, filename) | Set the filename for solventN. |
setStream(stream, filename) | Set the direction of the output stream to a filename |
writeCommandFile(filename) | Write the contents of this simulation object to disc |
Bases: tools.generate_input.ProteinLigandSimulation
This a command file for equilibration of a protein-ligand system Generates input for proteins, solutes and solvent and write an equilibration and a pdb chunk
Methods
clear() | Clear the simulation description |
readCommandFile(filename) | Read in a simulation from a command file |
run(exe[, cmdfile]) | Run this simulation |
setChunk(chunk) | This adds the simulation chunk to ‘chunk’. |
setDump(dump, freq) | This adds the simulation dump to ‘dump’ with frequnecy freq |
setForceField(filename) | Set the filename for parfile |
setParameter(parameter, value) | Set the parameter to value |
setProtein(n, filename) | Set the filename for proteinN. |
setSolute(n, filename) | Set the filename for soluteN. |
setSolvent(n, filename) | Set the filename for solventN. |
setStream(stream, filename) | Set the direction of the output stream to a filename |
writeCommandFile(filename) | Write the contents of this simulation object to disc |
Bases: tools.generate_input.ProteinLigandSimulation
This a command file for a GCMC simulation Generates input for proteins, solutes and solvent write GCMC parameters dump results, pdb and restart files equilibrate and production run
Methods
clear() | Clear the simulation description |
readCommandFile(filename) | Read in a simulation from a command file |
run(exe[, cmdfile]) | Run this simulation |
setChunk(chunk) | This adds the simulation chunk to ‘chunk’. |
setDump(dump, freq) | This adds the simulation dump to ‘dump’ with frequnecy freq |
setForceField(filename) | Set the filename for parfile |
setParameter(parameter, value) | Set the parameter to value |
setProtein(n, filename) | Set the filename for proteinN. |
setSolute(n, filename) | Set the filename for soluteN. |
setSolvent(n, filename) | Set the filename for solventN. |
setStream(stream, filename) | Set the direction of the output stream to a filename |
writeCommandFile(filename) | Write the contents of this simulation object to disc |
Bases: tools.generate_input.ProteinLigandSimulation
This a command file for a JAWS-1 simulation Generates input for proteins, solutes and solvent write JAWS-1 parameters dump results, pdb and restart files equilibrate and production run
Methods
clear() | Clear the simulation description |
readCommandFile(filename) | Read in a simulation from a command file |
run(exe[, cmdfile]) | Run this simulation |
setChunk(chunk) | This adds the simulation chunk to ‘chunk’. |
setDump(dump, freq) | This adds the simulation dump to ‘dump’ with frequnecy freq |
setForceField(filename) | Set the filename for parfile |
setParameter(parameter, value) | Set the parameter to value |
setProtein(n, filename) | Set the filename for proteinN. |
setSolute(n, filename) | Set the filename for soluteN. |
setSolvent(n, filename) | Set the filename for solventN. |
setStream(stream, filename) | Set the direction of the output stream to a filename |
writeCommandFile(filename) | Write the contents of this simulation object to disc |
Bases: tools.generate_input.ProteinLigandSimulation
This a command file for a JAWS-2 simulation Generates input for proteins, solutes and solvent write JAWS-2 parameters dump results, pdb and restart files equilibrate and production run
Methods
clear() | Clear the simulation description |
readCommandFile(filename) | Read in a simulation from a command file |
run(exe[, cmdfile]) | Run this simulation |
setChunk(chunk) | This adds the simulation chunk to ‘chunk’. |
setDump(dump, freq) | This adds the simulation dump to ‘dump’ with frequnecy freq |
setForceField(filename) | Set the filename for parfile |
setParameter(parameter, value) | Set the parameter to value |
setProtein(n, filename) | Set the filename for proteinN. |
setSolute(n, filename) | Set the filename for soluteN. |
setSolvent(n, filename) | Set the filename for solventN. |
setStream(stream, filename) | Set the direction of the output stream to a filename |
writeCommandFile(filename) | Write the contents of this simulation object to disc |
Bases: tools.generate_input.ProtoMSSimulation
This a generic command file for a protein-ligand simulation Generates input for proteins, solutes and solvent but does not write any chunks
Methods
clear() | Clear the simulation description |
readCommandFile(filename) | Read in a simulation from a command file |
run(exe[, cmdfile]) | Run this simulation |
setChunk(chunk) | This adds the simulation chunk to ‘chunk’. |
setDump(dump, freq) | This adds the simulation dump to ‘dump’ with frequnecy freq |
setForceField(filename) | Set the filename for parfile |
setParameter(parameter, value) | Set the parameter to value |
setProtein(n, filename) | Set the filename for proteinN. |
setSolute(n, filename) | Set the filename for soluteN. |
setSolvent(n, filename) | Set the filename for solventN. |
setStream(stream, filename) | Set the direction of the output stream to a filename |
writeCommandFile(filename) | Write the contents of this simulation object to disc |
This is a ProtoMS command file object.This object holds all of the information about the simulation and can either run the simulation with this information, or can write this information to a command file.
Attributes
lines : | list of strings all the lines of the ProtoMS command file |
Methods
clear() | Clear the simulation description |
readCommandFile(filename) | Read in a simulation from a command file |
run(exe[, cmdfile]) | Run this simulation |
setChunk(chunk) | This adds the simulation chunk to ‘chunk’. |
setDump(dump, freq) | This adds the simulation dump to ‘dump’ with frequnecy freq |
setForceField(filename) | Set the filename for parfile |
setParameter(parameter, value) | Set the parameter to value |
setProtein(n, filename) | Set the filename for proteinN. |
setSolute(n, filename) | Set the filename for soluteN. |
setSolvent(n, filename) | Set the filename for solventN. |
setStream(stream, filename) | Set the direction of the output stream to a filename |
writeCommandFile(filename) | Write the contents of this simulation object to disc |
Clear the simulation description
Read in a simulation from a command file
Parameters: | filename : string
|
---|
Run this simulation
Parameters: | exe : string
cmdfile : string, optional
|
---|
This adds the simulation chunk to ‘chunk’.
Parameters: | chunk : string
|
---|
This adds the simulation dump to ‘dump’ with frequnecy freq
Parameters: | dump : string
freq : int
|
---|
Set the filename for parfile
Parameters: | filename : string
|
---|
Set the parameter to value
Parameters: | parameter : string
value : string
|
---|
Set the filename for proteinN. It then returns n+1
Parameters: | n : int
filename : string
|
---|---|
Returns: | int
|
Set the filename for soluteN. It then returns n+1
Parameters: | n : int
filename : string
|
---|---|
Returns: | int
|
Set the filename for solventN. It then returns n+1
Parameters: | n : int
filename : string
|
---|---|
Returns: | int
|
Set the direction of the output stream to a filename
Parameters: | stream : string
filename : string
|
---|
Write the contents of this simulation object to disc
Parameters: | filename : string
|
---|
Bases: tools.generate_input.ProteinLigandSimulation
This a command file for MC sampling of a protein-ligand system Generates input for proteins, solutes and solvent and write chunks for equilibration and simulation, as well as dumps
Methods
clear() | Clear the simulation description |
readCommandFile(filename) | Read in a simulation from a command file |
run(exe[, cmdfile]) | Run this simulation |
setChunk(chunk) | This adds the simulation chunk to ‘chunk’. |
setDump(dump, freq) | This adds the simulation dump to ‘dump’ with frequnecy freq |
setForceField(filename) | Set the filename for parfile |
setParameter(parameter, value) | Set the parameter to value |
setProtein(n, filename) | Set the filename for proteinN. |
setSolute(n, filename) | Set the filename for soluteN. |
setSolvent(n, filename) | Set the filename for solventN. |
setStream(stream, filename) | Set the direction of the output stream to a filename |
writeCommandFile(filename) | Write the contents of this simulation object to disc |
Bases: tools.generate_input.ProteinLigandSimulation
This a command file for a single-topology protein-ligand simulation Generates input for proteins, solutes and solvent write lambda-replica exchange, dump results, pdb and restart files equilibrate and production run
Methods
clear() | Clear the simulation description |
readCommandFile(filename) | Read in a simulation from a command file |
run(exe[, cmdfile]) | Run this simulation |
setChunk(chunk) | This adds the simulation chunk to ‘chunk’. |
setDump(dump, freq) | This adds the simulation dump to ‘dump’ with frequnecy freq |
setForceField(filename) | Set the filename for parfile |
setParameter(parameter, value) | Set the parameter to value |
setProtein(n, filename) | Set the filename for proteinN. |
setSolute(n, filename) | Set the filename for soluteN. |
setSolvent(n, filename) | Set the filename for solventN. |
setStream(stream, filename) | Set the direction of the output stream to a filename |
writeCommandFile(filename) | Write the contents of this simulation object to disc |
Generates ProtoMS command files
If protein is a valid filename a protein(-ligand) simulation is setup, and if ligands contains at least one valid filename a ligand simulation is setup.
Parameters: | protein : string
ligands : list of strings
templates : list of strings
protein_water : string
ligand_water : string
settings : Namespace object (from argparse)
|
---|---|
Returns: | free_cmd : ProtoMSSimulation
bnd_cmd : ProtoMSSimulation
gas_cmd : ProtoMSSimulation
|
Routine to make a dummy PDB structure for a solute
This module defines a single public function: make_dummy
Can be executed from the command line as a stand-alone program
Make a dummy PDB structure to match a molecule
It will place the dummy at the centre of the molecule
Parameters: | pdbfile : string or PDBFile
|
---|---|
Returns: | PDBFile instance
|
Routine to make a GCMC/JAWS-1 simulation box from a ligand
This module defines a single public function: make_gcmcbox
Can be executed from the command line as a stand-alone program
Make a GCMC/JAWS-1 simulation box around a PDB-structure
Parameters: | pdb : PDBFile object
filename : string
padding : float, optional
|
---|
Routines to make ProtoMS single topology template
This module defines these public function make_single write_map summarize
Can be executed from the command line as a stand-alone program
Make single topology templates
Parameters: | tem1 : TemplateFile or string
tem2 : TemplateFile or string
pdb1 : PDBFile or string
pdb2 : PDBFile or string
mapfile : string, optional
|
---|---|
Returns: | TemplateFile
TemplateFile
TemplateFile
dictionary of strings
|
Raises: | SetupError
|
Print single topology parameter summary
Parameters: | eletem : TemplateFile
vdwtem : TemplateFile
loggfunc : logger function
|
---|
Write a correspondance map to disc
Parameters: | cmap : a dictionary of strings
filename : string
|
---|
Routine to merge a series of ProtoMS template files
This module defines a single public function: merge_templates
Can be executed from the command line as a stand-alone program
Merge a series of ProtoMS template files
Parameters: | templates : list of string
|
---|---|
Returns: | TemplateFile
|
Program to prepare ProtoMS output for pymbar
This module defines two public functions: extract_energies mbar
Can be executed from the command line as a stand-alone program
Calculates the BAR free energy using the PyMBAR package
Parameters: | lambdas : numpy array
energies : list of numpy array
RT : float
|
---|---|
Returns: | float
float
|
Extract total energies from a number of folders
Parameters: | path : string
res_tem : string
skip : int
maxread : int
|
---|---|
Returns: | list of float
list of numpy array
list of strings
|
Calculates the MBAR free energy using the PyMBAR package
Parameters: | lambdas : numpy array
energies : list of numpy array
RT : float
|
---|---|
Returns: | numpy array
numpy array
|
Routines to build a protein scoop
This module defines a single public function scoop
Can be executed from the command line as a stand-alone program
Generates a scoop from protein structure
The protein object is not modified by this routine.
Parameters: | protein : PDBFile
ligand : PDBFile or string
innercut : float, optional
outercut : float, optional
flexin : string, optional
flexout : string, optional
terminal : string, optional
excluded : list of int
added : list of int
|
---|---|
Returns: | PDBFile
|
Useful classes for setup and analysis of ProtoMS simulations. Contain classes to
- Read, modify and write structures in PDB format
- Store parameter collections
- Read and store ProtoMS results files
- Read, modify and write ProtoMS template files
Bases: object
Class for holding a PDB atom record
Attributes
index | (integer) the number of the atom in the pdb file |
resindex | (integer) the number of the residue in the pdb file |
name | (string) the name of the atom |
resname | (string) the name of the residue |
coords | (NumpyArray) Cartesian coordinates |
type | (string) either atom or hetatm |
element | (string) the element of the atom |
Methods
getElement() | Set the element of this atom |
Set the element of this atom
Class to hold a set of atoms and their associated parameter
Attributes
atoms | (list of strings) the atoms in this set |
param | (int or ForceFieldParameter) the parameter associated with the atoms |
Methods
parse(record) | Parse a line from a ProtoMS file |
Parse a line from a ProtoMS file
Parameters: | record : string
|
---|
Class to hold energy results
Attributes
curr | (float) the energy at the current lambda |
back | (float) the energy at the previous lambda |
forward | (float) the energy at the next lambda |
type | (string) a label |
Methods
parse_line(line) | Parse energies from the result file |
Parse energies from the result file
Parameters: | line : string
|
---|
Class to hold a general parameter set
Attributes
key | (string) a label |
index | (integer) a serial number |
params | (list) either a list of strings or a list of ForceFieldParameter, containing the actual parameters |
Methods
parse(record) | Parse a line from a ProtoMS file |
Parse a line from a ProtoMS file
Parameters: | record : string
|
---|
Class to hold a ProtoMS template
Attributes
name | (string) the name of the template |
type | (string) the kind of template, e.g. solute |
translate | (float) the translation displacement |
rot | (float) the rotational displacement |
atoms | (list of TemplateAtom objects) the atoms in this template |
connectivity | (list of TemplateConnectivity objects) the connectivity in this template |
variables | (list of string) the variable geometries |
atomclass | (TemplateAtom class) the class to create objects of atoms |
Methods
parse_from(fileobj) | Parse a full template from a file |
write_to(fileobj) | Write the template to disc |
write_zmat(filename) | Write the z-matrix of this template to disc |
Parse a full template from a file
Terminates when found another mode or end of file
Parameters: | fileobj : file object
|
---|
Write the template to disc
Parameters: | fileobj : file object
|
---|
Write the z-matrix of this template to disc
Parameters: | filename : string
|
---|
Bases: argparse.ArgumentParser
Extention to ArgumentParser to allow separation of of help in to help for most common options and full help that list all arguments
Methods
add_argument(dest, ...[, name, name]) | |
add_argument_group(*args, **kwargs) | |
add_mutually_exclusive_group(**kwargs) | |
add_subparsers(**kwargs) | |
convert_arg_line_to_args(arg_line) | |
error(message: string) | Prints a usage message incorporating the message to stderr and exits. |
exit([status, message]) | |
format_help([fullhelp]) | |
format_usage() | |
format_version() | |
get_default(dest) | |
parse_args([args, namespace]) | |
parse_known_args([args, namespace]) | |
print_fullhelp([file]) | |
print_help([file]) | |
print_usage([file]) | |
print_version([file]) | |
register(registry_name, value, object) | |
set_defaults(**kwargs) |
Class for holding the atoms and residues of a PDB file
Attributes
center | (NumPy array) the center of coordinates of all atoms |
header | (string) additional lines to print before ATOM records |
name | (string) the name of the file |
residues | (dictionary of Residue objects) all non-solvent residues |
solvents | (dictionary of Residue objects) all solvent residues |
Methods
copy() | Make a copy of the residues and solvents dictionaries, |
getBox([atomlist, reslist]) | Calculate the smallest box to encompass the atoms |
getCenter() | Calculate the center of geometry |
read(filename) | Read a pdb-file from disc |
read_from(f[, resname]) | Read a pdb structure from a fileobject |
write(filename[, renumber, header, solvents]) | Write the PDB file to disc |
Make a copy of the residues and solvents dictionaries, not the Residue and Atom objects themselves
Returns: | PDBFile
|
---|
Calculate the smallest box to encompass the atoms
Parameters: | atomlist = list, optional
reslist = list, optional
|
---|---|
Returns: | dictionary of Numpy arrays
|
Calculate the center of geometry
Returns: | NumPy array
|
---|
Read a pdb-file from disc
It will overwrite existing residues and renumber all residues from 1
Parameters: | filename : string
|
---|
Read a pdb structure from a fileobject
Terminates reading when found a record starting with END
Parameters: | f : file object
resname : string, optional
|
---|
Write the PDB file to disc
Parameters: | filename : string
renumber : boolean, optional
header : string, optional
solvents : boolean, optional
|
---|
Hold a collection of PDBFile objects
Attributes
pdbs | (list of PDBFile objects) the pdb files |
Methods
from_residues(pdbfile) | Split a PDB file into a set by residue |
read(filename[, resname]) | Read a set of pdb structures from a file |
write(filenames[, solvents]) | Write the set to disc |
Split a PDB file into a set by residue
Parameters: | pdbfile : PDBFile object
|
---|
Read a set of pdb structures from a file
Parameters: | filename : string
resname : string, optional
|
---|
Write the set to disc
If one filename is given all PDB-files are written to one file
Parameters: | filenames : list of strings
solvents : boolean
|
---|
Class to hold a parameter from a ProtoMS template file
Not valid for dihedral parameters but contains sufficient information to check that a parameter exists
Attributes
index | (integer) the serial number of the parameter |
ats | (list of string) the name of the atoms associated with the parameter |
k | (float) the force constant |
b0 | (float) the equilibrium value |
Class to hold a collection of parameters
Attributes
file_name | (string) the name of the file where the parameters originated |
params | (list of Parameter objects) the parameters in this collection |
Methods
get_params(ats) | Find parameters for specific atoms |
Find parameters for specific atoms
Parameters: | ats : list of string
|
---|---|
Returns: | Parameter object
|
Bases: object
Class for holding a set of PDB atoms
Attributes
atoms | (list of Atom objects) the atom of this residue |
index | (integer) the number of the residue in the pdb file |
name | (string) the name of the residue |
center | (NumPy array) the center of coordinates of all atoms |
Methods
addAtom(atom) | Adds an atom to this residue |
getCenter() | Sets the center of coordinates for this residue |
isAminoacid() | Checks is the residue name is an aminoacid name |
Adds an atom to this residue
Parameters: | atom : Atom object
|
---|
Sets the center of coordinates for this residue
Checks is the residue name is an aminoacid name
Class to hold the information on a restart file
Attributes
filename | (string) the name of the restart file |
nsolutes | (int) the number of solute molecules |
ngcsolutes | (int) the number of gcsolute molecules |
solutesdic | (dict) the correlation of solute ids with residue names |
gcsolutesdic | (dict) the correlation of gcsolutes ids with residue names |
Methods
read(filename) | Read the restart file from disc |
Read the restart file from disc
Parameters: | filename : string
|
---|
Class to store a collection of results
Attributes
filename | (string) the name of the file |
snapshots | (list of SnapshotResult) all the results |
series | (SnapshotResult) all the results in a single object |
Methods
make_series() | Make a snapshot with all the results |
read(filename[, skip, readmax]) | Read results from disc |
Make a snapshot with all the results
This routine creates a special SnapshotResults object, which has the same attributes as the objects in the snapshots list, but rather than storing single floats and integers, this object stores NumpyArrays of all the results
Returns: | SnapshotResults
|
---|
Read results from disc
The filename parameter can be either a single filename, in case it is assumed that it is a ProtoMS3.0 results file, i.e. it contains several snapshots if it is a list of strings, two behaviors are supported:
- if the length of the list is 2, and the first filename
is a dictionary, a glob is used to list all filenames in that directory that starts with the second filename in the list
- if the length is not two or you give two filenames,
each of them are processed individually and treated as individual snapshots
Parameters: | filename : string or list of strings
skip : int, optional
readmax : int, optional
|
---|
Bases: exceptions.Exception
A general exception class to be raised by setup code
Class to store a single snapshot of results
Not all attributes might not be set as they might not exists in the result file
internal_energies and interaction_energies are dictionary where the key is is the molecules involved in the energy, e.g. protein1, or protein1-solute1. The value is a list of EnergyResults objects, for the various energy components.
Attributes
lam | (float) the current lambda value |
lamb | (float) the previous lambda value |
lamf | (float) the next lambda value |
datastep | (int) the number of steps the averages are calculate over |
lambdareplica | (int) the index of the lambda replica |
temperature | (float) the temperature of the simulation |
ngcsolutes | (int) the number of GC solutes |
nthetasolutes | (int) the number of theta solutes |
bvalue | (float) the Adams value |
solventson | (int) the number of GC solutes that are turned on |
pressure | (float) the pressure |
volume | (float) the volume |
seed | (int) the random seed |
backfe | (float) the free energy to the previous lambda |
forwfe | (float) the free energy to the next lambda |
total | (EnergyResults object) the total energy |
internal_energies | (dictionary of lists of EnergyResults object) the internal energies |
interaction_energies | (dictionary of lists of EnergyResults objects) the interaction energies |
capenergy | (EnergyResults object) the energy of the cap |
extraenergy | (EnergyResults object) all extra energies |
feenergies | (dictionary of float) the total energy at various lambda values |
gradient | (float) the numerical gradient of lambda |
agradient | (float) the analytical gradient of lambda |
thetavals | (list of float) the theta values of all GC solutes |
thetasolvals | (list of float) the theta values of all theta solutes |
Methods
parse(fileobj) | Parse a file for results |
Parse a file for results
Parameters: | fileobj : file object
|
---|
Class to hold a template atom
Attributes
name | (string) the name of the atom |
residue | (string) the residue of the atom |
param0 | (int or ForceFieldParameter) the parameter associated with this atom at v0 |
param1 | (int or ForceFieldParameter) the parameter associated with this atom at v1 |
bondedto | (string or TemplateAtom) the atom this atom is bonded to |
angleto | (string or TemplateAtom) the atom this atom forms an angle with |
dihedto | (string or TemplateAtom) the atom this atom forms a dihedral with |
Methods
parse(record) | Parse a line from a ProtoMS file |
zmat() | Produces a simple z-matrix representation of this atom |
Parse a line from a ProtoMS file
Parameters: | record : string
|
---|
Produces a simple z-matrix representation of this atom
Returns: | returns
|
---|
Class to hold a solute bond, angle or dihedral
Attributes
type | (string) the kind of connectivity, i.e. bond, angle or dihedral |
atoms | (list of strings or TemplateAtom objects) the atoms involved in this connectivity |
flex | (float) the flexibility |
param0 | (int or ForceFieldParameter) the parameter associated with this connectivity at v0 |
param1 | (int or ForceFieldParameter) the parameter associated with this connectivity at v1 |
dummy | (bool) flag to indicate if this should be treated as a dummy |
Methods
parse(record) | Parse a line from a ProtoMS file |
Parse a line from a ProtoMS file
Parameters: | record : string
|
---|
Class to hold a ProtoMS template file
Attributes
bondparams | (list of ForceFieldParameter objects) all bond parameters |
bondatoms | (list of AtomSet objects) all atoms associated with bond parameters |
angleparams | (list of ForceFieldParameter objects) all angle parameters |
angleatoms | (list of AtomSet objects) all atoms associated with angle parameters |
dihedralterms | (list of ForceFieldParameter objects) all dihedral term parameters |
dihedralparams | (list of ForceFieldParameter objects) all dihedral parameters |
dihedralatoms | (list of AtomSet objects) all atoms associated with dihedral parameters |
cljparams | (list of ForceFieldParameter objects) all clj parameters |
templates | (list of MolTemplate objects) all templates in this file |
Methods
append(other) | Adds another template file to this one |
assign_paramobj() | Replaces integers and strings with objects |
read(filename) | Read a template file from disc |
write(filename) | Write a template file to disc |
Adds another template file to this one
Will renumber the parameters of the other file
Parameters: | other : TemplateFile
|
---|
Replaces integers and strings with objects
It replaces all indices to force field parameters with references to ForceFieldParameter objects
It replaces all atom in templates with references to TemplateAtom objects
Read a template file from disc
Parameters: | filename : string
|
---|
Write a template file to disc
Parameters: | filename : string
|
---|
Bases: tools.simulationobjects.TemplateAtom
Class to hold a solute atom
This is a sub-class that implements functions that are specific for solute templates
Has the same attributes as TemplateAtom
Methods
parse(record) | Parse a line from a ProtoMS file |
zmat() | Produces a simple z-matrix representation of this atom |
Parse a line from a ProtoMS file
Parameters: | record : string
|
---|
Produces a simple z-matrix representation of this atom
Returns: | returns
|
---|
Calculates the angle between two vectors
Parameters: | v1 : Numpy array
v2 : Numpy array
|
---|---|
Returns: | float
|
Calculates the angle between three atoms
Parameters: | a1 : Numpy array
a2 : Numpy array
a3 : Numpy array
|
---|---|
Returns: | float
|
Returns a color of index
For instances when the index is larger than the number of defined colors, this routine takes care of this by periodicity, i.e. color at idx=0 is the same color as idx=n
Parameters: | idx : int
|
---|---|
Returns: | list of floats
|
Parse box information from a pdb file
Looks for CENTER, DIMENSIONS and box keywords in the header of the pdb file
Parameters: | pdbobj : PDBFile object
|
---|---|
Returns: | dictionary of Numpy arrays
|
Merge pdb files
Create a new PDBFile instance and add all residues and solvents from all pdb files given, renumbering residues
Parameters: | pdbobjs : list of PDBFile objects |
---|---|
Returns: | PDBFile object
|
Setup ProtoMS logging system
Uses the standard logging module with two handlers, one that prints everything above DEBUG to standard output and one that prints everything, even DEBUG to a file
If filename is None no file handler is created
This should be called by protoms.py and all other stand-alone programs that uses the tools
Parameters: | filename : string, optional
|
---|---|
Returns: | a reference to the created logger |
Generates the filename of file in the standard ProtoMS file hierarchy
If $PROTOMSHOME is set, it uses it as the base-path, otherwise, it uses the location of this module as to create the base-path
Parameters: | filename : string
folder : string
|
---|---|
Returns: | the full path to the file |
Write a box in PDB file format
Parameters: | filename : string
box : dictionary of Numpy array
|
---|
Routines to solvate a structure
This module defines a single public function: solvate
Can be executed from the command line as a stand-alone program
Function to solvate ligand and/or protein structures using a pre-equilibrated box of waters.
Parameters: | box : String
ligand : PDBFile or string, optional
protein : PDBFile or string, optional
geometry : string, optional
padding : float, optional
radius : float, optional
center : string, optional
namescheme : string, optional
|
---|---|
Returns: | PDBFile
|
Raises: | SetupError
|
Routine to split JAWS-1 water into PDBs for JAWS-2
This module defines a single public function: split_water
Can be executed from the command line as a stand-alone program
Sets the header of the pdbs containing one single solvent molecule to define a box around the first atom
Split waters in a PDB file to many PDB-files for JAWS-2
Parameters: | waters : string or PDBFile object
|
---|---|
Returns: | PDBSet
PDBSet
|