6.2. ligandparam.multiresp.parmhelper
- class ligandparam.multiresp.parmhelper.BASH(numnodes)[source]
Bases:
ComputerGenerates a bash script
Methods
get_num_cores()Get the number of cores
open(fname)Open the bash file
set_exclude(x)Set the exclude variable
unset_amberhome()Unset the amberhome variable
use_gpu([x])Use the gpu
write_array(fh)Write the array to the file handle
get_array
Initialize the bash object
- Parameters:
numnodes (int) – The number of nodes to use
Methods
get_num_cores()Get the number of cores
open(fname)Open the bash file
set_exclude(x)Set the exclude variable
unset_amberhome()Unset the amberhome variable
use_gpu([x])Use the gpu
write_array(fh)Write the array to the file handle
get_array
- class ligandparam.multiresp.parmhelper.Computer(numnodes)[source]
Bases:
objectBase class for computer objects
Methods
Get the number of cores
set_exclude(x)Set the exclude variable
Unset the amberhome variable
use_gpu([x])Use the gpu
write_array(fh)Write the array to the file handle
get_array
Initialize the computer object
- Parameters:
numnodes (int) – The number of nodes to use
Methods
Get the number of cores
set_exclude(x)Set the exclude variable
Unset the amberhome variable
use_gpu([x])Use the gpu
write_array(fh)Write the array to the file handle
get_array
- ligandparam.multiresp.parmhelper.CopyParm(parm)[source]
Copy the parmed object
- Parameters:
parm (parmed object) – The parmed object to copy
- Returns:
The copied parmed object
- Return type:
parmed object
- class ligandparam.multiresp.parmhelper.Fragment(parmobj, ambmask, coef0=None, coef1=None, method='AM1D')[source]
Bases:
objectA fragment
Methods
GetAtomsBondedToIdx(idx)Get the atoms bonded to the index
Get the connection atoms
Get the link pairs
Get the MM boundary terms
funkify_residue_name(ires)Funkify the residue name for the given residue index
get_coef([lam])Get the coefficient
get_funkified_residue_name(origname)Get the funkified residue name
Get the selected mm charge from each touched residue
Get the touched residues
Redistribute the residue charges
Initialize the fragment
- Parameters:
parmobj (parmed object) – The parmed object
ambmask (str) – The ambmask
coef0 (float, optional) – The coefficient for lambda=0. Default is None
coef1 (float, optional) – The coefficient for lambda=1. Default is None
method (str, optional) – The method. Default is AM1D
Methods
GetAtomsBondedToIdx(idx)Get the atoms bonded to the index
Get the connection atoms
Get the link pairs
Get the MM boundary terms
funkify_residue_name(ires)Funkify the residue name for the given residue index
get_coef([lam])Get the coefficient
get_funkified_residue_name(origname)Get the funkified residue name
Get the selected mm charge from each touched residue
Get the touched residues
Redistribute the residue charges
- GetAtomsBondedToIdx(idx)[source]
Get the atoms bonded to the index
- Parameters:
idx (int) – The index
- funkify_residue_name(ires)[source]
Funkify the residue name for the given residue index
- Parameters:
ires (int) – The residue index
- get_coef(lam=0)[source]
Get the coefficient
- Parameters:
lam (int, optional) – The lambda value. Default is 0
- Returns:
The coefficient
- Return type:
float
- get_funkified_residue_name(origname)[source]
Get the funkified residue name
- Parameters:
origname (str) – The original name
- Returns:
The funkified residue name
- Return type:
str
- class ligandparam.multiresp.parmhelper.FragmentedSys(parmobj, compobj)[source]
Bases:
objectA fragmented system
Methods
Get the MM terms for the QM region
Get the QM atoms
Make new MM boundary terms
add_fragment(ambmask, coef0[, coef1, method])Add a fragment
add_mm()Add the MM fragment
Check for overlaps
get_coefs([lam])Get the coefficients
get_dvdl(fragenes)Get the dvdl
Get the dvdl coefficients
get_energy(fragenes[, lam])Get the energy
get_mbar(fragenes[, nlam])Get the mbar
Get the no shake selection
Check if there is ab initio
mdouts_to_pymbar([name, nlam, datadir])Convert the mdouts to pymbar
read_mdout([prefix, lam, nlam])Read the mdout file
Redistribute the cores
Redistribute the residue charges
set_mm_parm(fname)Set the MM parm file
sort()Sort the fragments
write_mdin([prefix, init, lam, ...])Write the mdin file
write_parm([parmname, overwrite])Write the parameter file
GetMMTermsForQMRegionAsDict
write_mm_optimization
Initialize the fragmented system
- Parameters:
parmobj (parmed object) – The parmed object
compobj (BASH) – The computer object
Methods
Get the MM terms for the QM region
Get the QM atoms
Make new MM boundary terms
add_fragment(ambmask, coef0[, coef1, method])Add a fragment
add_mm()Add the MM fragment
Check for overlaps
get_coefs([lam])Get the coefficients
get_dvdl(fragenes)Get the dvdl
Get the dvdl coefficients
get_energy(fragenes[, lam])Get the energy
get_mbar(fragenes[, nlam])Get the mbar
Get the no shake selection
Check if there is ab initio
mdouts_to_pymbar([name, nlam, datadir])Convert the mdouts to pymbar
read_mdout([prefix, lam, nlam])Read the mdout file
Redistribute the cores
Redistribute the residue charges
set_mm_parm(fname)Set the MM parm file
sort()Sort the fragments
write_mdin([prefix, init, lam, ...])Write the mdin file
write_parm([parmname, overwrite])Write the parameter file
GetMMTermsForQMRegionAsDict
write_mm_optimization
- GetMMTermsForQMRegion()[source]
Get the MM terms for the QM region
- Returns:
bonds (list) – The bonds
angles (list) – The angles
dihes (list) – The dihedrals
- add_fragment(ambmask, coef0, coef1=None, method='AM1D')[source]
Add a fragment
- Parameters:
ambmask (str) – The ambmask
coef0 (float) – The coefficient for lambda=0
coef1 (float, optional) – The coefficient for lambda=1. Default is None
method (str, optional) – The method. Default is AM1D
- get_coefs(lam=0)[source]
Get the coefficients
- Parameters:
lam (int, optional) – The lambda value. Default is 0
- get_dvdl(fragenes)[source]
Get the dvdl
- Parameters:
fragenes (list) – The list of fragment energies
- Returns:
The dvdl
- Return type:
float
- get_energy(fragenes, lam=0)[source]
Get the energy
- Parameters:
fragenes (list) – The list of fragment energies
lam (int, optional) – The lambda value. Default is 0
- get_mbar(fragenes, nlam=11)[source]
Get the mbar
- Parameters:
fragenes (list) – The list of fragment energies
nlam (int, optional) – The number of lambdas. Default is 11
- Returns:
The mbar
- Return type:
list
- mdouts_to_pymbar(name='frag', nlam=11, datadir='mbar/data')[source]
Convert the mdouts to pymbar
- Parameters:
name (str, optional) – The name. Default is “frag”
nlam (int, optional) – The number of lambdas. Default is 11
datadir (str, optional) – The data directory. Default is “mbar/data”
- Raises:
Exception – If no files match the glob ‘prod*.%s%s’
- read_mdout(prefix='frag', lam=0, nlam=11)[source]
Read the mdout file
- Parameters:
prefix (str, optional) – The prefix. Default is “frag”
lam (int, optional) – The lambda value. Default is 0
nlam (int, optional) – The number of lambdas. Default is 11
- Returns:
float – The time step
list – The dvdl
list – The mbar
- write_mdin(prefix='frag', init='init', lam=0, init_from_same_rst=False, directory=None, dipout=False, same_ntpr=False)[source]
Write the mdin file
- Parameters:
prefix (str, optional) – The prefix. Default is “frag”
init (str, optional) – The initialization. Default is “init”
lam (int, optional) – The lambda value. Default is 0
init_from_same_rst (bool, optional) – If True, initialize from the same restart. Default is False
directory (str, optional) – The directory. Default is None
dipout (bool, optional) – If True, output the dipole. Default is False
same_ntpr (bool, optional) – If True, use the same ntpr. Default is False
- ligandparam.multiresp.parmhelper.GetSelectedAtomIndices(param, maskstr)[source]
Get the selected atom indices
- Parameters:
param (parmed object) – The parmed object
maskstr (str) – The mask string
- ligandparam.multiresp.parmhelper.GetSelectedResidueIndices(param, maskstr)[source]
Get the selected residue indices
- Parameters:
param (parmed object) – The parmed object
maskstr (str) – The mask string
- ligandparam.multiresp.parmhelper.ListToSelection(atomlist)[source]
Convert a list to a selection
- Parameters:
atomlist (list) – The list of atoms
- Returns:
The selection
- Return type:
str
- ligandparam.multiresp.parmhelper.MakeUniqueAngleParams(p, xlist, scale=1.0)[source]
Make unique angle parameters
- Parameters:
p (parmed object) – The parmed object
xlist (list) – The list of angles
scale (float, optional) – The scale factor. Default is 1.0
- ligandparam.multiresp.parmhelper.MakeUniqueBondParams(p, xlist, scale=1.0)[source]
Make unique bond parameters
- Parameters:
p (parmed object) – The parmed object
xlist (list) – The list of bonds
scale (float, optional) – The scale factor. Default is 1.0