6.2. ligandparam.multiresp.parmhelper

class ligandparam.multiresp.parmhelper.BASH(numnodes)[source]

Bases: Computer

Generates 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

open(fname)[source]

Open the bash file

Parameters:

fname (str) – The name of the file to open

class ligandparam.multiresp.parmhelper.Computer(numnodes)[source]

Bases: object

Base class for computer objects

Methods

get_num_cores()

Get the number of cores

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 computer object

Parameters:

numnodes (int) – The number of nodes to use

Methods

get_num_cores()

Get the number of cores

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

get_array()[source]
get_num_cores()[source]

Get the number of cores

set_exclude(x)[source]

Set the exclude variable

unset_amberhome()[source]

Unset the amberhome variable

use_gpu(x=True)[source]

Use the gpu

Parameters:

x (bool, optional) – If True, use the gpu

write_array(fh)[source]

Write the array to the file handle

Parameters:

fh (file handle) – The file handle to write to

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: object

A fragment

Methods

GetAtomsBondedToIdx(idx)

Get the atoms bonded to the index

GetConnectionAtoms()

Get the connection atoms

GetLinkPairs()

Get the link pairs

GetMMBoundaryTerms()

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_selected_mmcharge_from_each_touched_residue()

Get the selected mm charge from each touched residue

get_touched_residues()

Get the touched residues

redistribute_residue_charges()

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

GetConnectionAtoms()

Get the connection atoms

GetLinkPairs()

Get the link pairs

GetMMBoundaryTerms()

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_selected_mmcharge_from_each_touched_residue()

Get the selected mm charge from each touched residue

get_touched_residues()

Get the touched residues

redistribute_residue_charges()

Redistribute the residue charges

GetAtomsBondedToIdx(idx)[source]

Get the atoms bonded to the index

Parameters:

idx (int) – The index

GetConnectionAtoms()[source]

Get the connection atoms

GetLinkPairs()[source]

Get the link pairs

GetMMBoundaryTerms()[source]

Get the MM boundary terms

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

get_selected_mmcharge_from_each_touched_residue()[source]

Get the selected mm charge from each touched residue

get_touched_residues()[source]

Get the touched residues

redistribute_residue_charges()[source]

Redistribute the residue charges

class ligandparam.multiresp.parmhelper.FragmentedSys(parmobj, compobj)[source]

Bases: object

A fragmented system

Methods

GetMMTermsForQMRegion()

Get the MM terms for the QM region

GetQMAtoms()

Get the QM atoms

MakeNewMMBoundaryTerms()

Make new MM boundary terms

add_fragment(ambmask, coef0[, coef1, method])

Add a fragment

add_mm()

Add the MM fragment

check_overlaps()

Check for overlaps

get_coefs([lam])

Get the coefficients

get_dvdl(fragenes)

Get the dvdl

get_dvdl_coefs()

Get the dvdl coefficients

get_energy(fragenes[, lam])

Get the energy

get_mbar(fragenes[, nlam])

Get the mbar

get_noshake_selection()

Get the no shake selection

has_ab_initio()

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_cores()

Redistribute the cores

redistribute_residue_charges()

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

GetMMTermsForQMRegion()

Get the MM terms for the QM region

GetQMAtoms()

Get the QM atoms

MakeNewMMBoundaryTerms()

Make new MM boundary terms

add_fragment(ambmask, coef0[, coef1, method])

Add a fragment

add_mm()

Add the MM fragment

check_overlaps()

Check for overlaps

get_coefs([lam])

Get the coefficients

get_dvdl(fragenes)

Get the dvdl

get_dvdl_coefs()

Get the dvdl coefficients

get_energy(fragenes[, lam])

Get the energy

get_mbar(fragenes[, nlam])

Get the mbar

get_noshake_selection()

Get the no shake selection

has_ab_initio()

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_cores()

Redistribute the cores

redistribute_residue_charges()

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

GetMMTermsForQMRegionAsDict()[source]
GetQMAtoms()[source]

Get the QM atoms

Returns:

The QM atoms

Return type:

list

MakeNewMMBoundaryTerms()[source]

Make new MM boundary terms

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

add_mm()[source]

Add the MM fragment

check_overlaps()[source]

Check for overlaps

Raises:

Exception – If an overlap is found

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_dvdl_coefs()[source]

Get the dvdl coefficients

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

get_noshake_selection()[source]

Get the no shake selection

has_ab_initio()[source]

Check if there is ab initio

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

redistribute_cores()[source]

Redistribute the cores

redistribute_residue_charges()[source]

Redistribute the residue charges

set_mm_parm(fname)[source]

Set the MM parm file

sort()[source]

Sort the fragments

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

write_mm_optimization(reftraj, refmdin=None)[source]
write_parm(parmname='frag.parm7', overwrite=True)[source]

Write the parameter file

Parameters:
  • parmname (str, optional) – The parameter name. Default is “frag.parm7”

  • overwrite (bool, optional) – If True, overwrite the file. Default is True

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

ligandparam.multiresp.parmhelper.MakeUniqueDihedralParams(p, xlist, scale=1.0)[source]

Make unique dihedral parameters

Parameters:
  • p (parmed object) – The parmed object

  • xlist (list) – The list of dihedrals

  • scale (float, optional) – The scale factor. Default is 1.0

ligandparam.multiresp.parmhelper.OpenParm(fname, xyz=None)[source]

Open a file with parmed.

Parameters:
  • fname (str) – The name of the file to open

  • xyz (str, optional) – The name of the xyz file to open

Returns:

The parmed object

Return type:

parmed object