Package schrodinger :: Package application :: Package desmond :: Module fepdiff
[hide private]
[frames] | no frames]

Module fepdiff

A module to compare various block of mmffio and mmfepio blocks.

Copyright Schrodinger, LLC. All rights reserved.

Classes [hide private]
  IndexDict
  TupleDict
A dictionary class that has a tuple as its key.
  BiDirTupleDict
A dictionary class that uses tuple as its key which treats the tuple and its reversed counterpart the same.
  LooseOrderTupleDict
A dictionary class that uses tuple as its key which does not care about the actual order of individual element of the tuple.
  ConstraintTupleDict
A dictionary class that uses tuple as its key.
  ImproperTupleDict
A dictionary class that uses tuple as its key.
  IndexMapper
  BaseBlockProperty
  FFIOBlockProperty
  VdwtypeBlockProperty
  ConstraintBlockProperty
  SiteBlockProperty
  BlockDiffer
  DihedralBlockDiffer
A class to compare the difference of dihedral block of two FFIOStructure instance.
  FFIOProperty
  BiDirDualTupleDict
A dictionary class that uses tuple of tuple as its key which treats the inner tuple and its reversed counterpart the same.
  ImproperDualTupleDict
ImproperDualTupleDict use two element tuple of tuple as it key.
  FEPIOBlockProperty
  FEPIOAtommapBlockProperty
  FEPIOProperty
  DualIndexMapper
  DihedmapBlockDiffer
A class to compare the difference of dihedral block of two FFIOStructure instance.
  DictDiffer
Calculate the difference between two dictionaries as: (1) items added (2) items removed (3) keys same in both but changed values (4) keys same in both and unchanged values
Functions [hide private]
 
error(s)
 
get_temp_fname()
Return temporary file name
 
reorder_tuple(key)
 
reorder_improper(key)
 
identical_mapping(key)
 
is_ffio_funct(funct_name)
 
create_ffio_block_property(block_name, handle)
create block property instance based on the block_name
 
create_ffio_differ(block_name, block_prop1, block_prop2, index_map)
create ffio differ based on the block name.
 
diff_ffio_prop(prop1, prop2, index_map)
 
diff_ffio(st1, st2, index_map)
 
create_fepio_block_property(name, handle)
 
create_fepio_differ(name, prop1, prop2, index_map_pair)
create ffio differ based on the block name.
 
diff_fepio_prop(prop1, prop2, index_map_pair)
 
diff_fepio(st_pair1, st_pair2, index_map_pair)
A function to compare two fepio blocks.
 
randomize_st(st)
Create a new ct from the given one, with atoms reordered randomly.
 
run_desmond_ff_builder(input_fname, output_fname, ff)
 
assign_forcefield(st_list, forcefiled=minimize.OPLS_FFLD16_NAME)
Assign forcefield return a list of FFioStruct instances that contain right forcefield information.
 
is_anchor_atom(num)
anchor atom has code like 98, 198 etc.
 
is_ring_bridge_atom(num)
ring bridge atom has code like 97, 197 etc.
 
is_normal_bridge_atom(num)
bridge atom usually has subst property like 99, 199 etc.
 
get_mapping_from_i_fep_subst(st1, st2)
mmfepio library uses very complicated code to facilitate the mapping.
 
get_mapping_from_i_fep_mapping(st1, st2)
i_fep_mapping only exists in the second strucutre of fep structure pair.
 
get_mapping_from_fepio_fep(st1, st2)
fepio_fep block only exists in the second strucutre of fep structure pair.
 
get_ligand_cts(input_fname)
 
compare_atom(atom1, atom2)
compare attributes between two atoms.
 
get_atom_property(atom)
 
compare_st(st1, st2, index_map)
 
get_index_map_from_coord(st1, st2)
A function to use use coordinate as key to match atoms between two Structure instances and return an index map, in which index1 = index_map[index2]
Variables [hide private]
  logger = log.get_output_logger(name= "fepdiff")
  DEFAULT_SEED = 0xdeadbeaf
  FFIO_BLOCK_LIST = ['bond', 'angle', 'dihedral', 'exclusion', '...
  FEPIO_BLOCK_LIST = ['atommap', 'bondmap', 'anglemap', 'dihedma...
  FEPIO_FFIO_MAP = {'atommap': 'site', 'bondmap': 'bond', 'angle...
  SEPERATE_LINE = '-'* 80
  ATOM_ATTRIBUTES = ['alt_xyz', 'atom_name', 'atom_type', 'atom_...
Function Details [hide private]

create_ffio_block_property(block_name, handle)

 

create block property instance based on the block_name

Parameters:
  • block_name (string) - name of the FFIO/FEPIO block
  • hanle
  • handle ()

diff_fepio(st_pair1, st_pair2, index_map_pair)

 

A function to compare two fepio blocks.
@type st_pair1: two element tuple of structure instances
@param st_pair1: 

@type st_pair2: two element tuple of structure instances
@param st_pair2: 

@type map_pair: two element tuple of list of integers
@param map_pair: each element of the tuple is a mapping of atom indices 
from the correspondent element of st_pair1 to correspondent element of
st_pair2

Again, fepio_fep block has very stupid and confusing coding scheme. 
bondmap, anglemap, dihedmap, exclmap and pairmap all contain ti, tj properies.
ai and aj are the atom indices in combined structure.

Lets look at a concrete bondmap item
(1) ti or tj has positive number 
    ti, tj, ai, aj  = (2, 50, 28, 34)
    bond in state A will be scaled by lambdaA, bond in state B will be
    scaled state B.

(2) ti or tj is -1
    ti, tj, ai, aj  = (-1, 50, 28, -48)
    
It can be considered as non-alchemical bond. in state A, there is a bond
between one physical atom and one dummy. In state B, there is a bond between
two physical atoms.The bond in state A has the same force constant at state B.
And it will not be scaled by lambda schedule    

(3) ti or tj is 0
    ti, tj, ai, aj  = (-1, 50, 28, -48)
The interaction will only be scaled by either lambdaA or lambdaB.        

(4) ti or tj is -2 
    ti, tj, ai, aj  = (-2, 50, 28, -48)
The interaction will be scaled by (lambdaA+lambdaB)

randomize_st(st)

 

Create a new ct from the given one, with atoms reordered randomly. @return a tuple of two element as (new_st, new_to_old_map), where new_st is a structure instance and new_indices is a list of ints. Since the atom index at mmshare is 1-based. To make it easy, we add 0 as the first element. old_index = new_to_old_map[new_index]

is_normal_bridge_atom(num)

 

bridge atom usually has subst property like 99, 199 etc. If there are multiple bridge atoms connecting to one anchor atom, they could have code like 89, 79, 289 etc.

get_mapping_from_i_fep_subst(st1, st2)

 

mmfepio library uses very complicated code to facilitate the mapping.
Unfortunately, the concept of these code are not orthogonal. 
Each atom will have one i_fep_subst atom property
1: core atom (atoms that are not going through alchemical change)
2: its couterpart in other structure is dummy
99: normal bridge atom 
98: anchor atom, by which bridge atom connects to the core atom.
    in terms of
97: ring bridge atom or linker atom

Note that mmfepio library has implicit mapping by default. In other words,
mmfepio library use below algorithm to dectect the core pair.
The first core atom (i_fep_subst is equal to 1) at first structure will match the
first core atom at second structure. Keep looping over the core atoms until
no more core pair can be found.

compare_atom(atom1, atom2)

 

compare attributes between two atoms. Return Ture if attributes are the same.

get_index_map_from_coord(st1, st2)

 

A function to use use coordinate as key to match atoms between two Structure instances and return an index map, in which index1 = index_map[index2]

index map will have n+1 element, 0 is set as first element to alleviate the confusion of 1-based atom index.


Variables Details [hide private]

FFIO_BLOCK_LIST

Value:
['bond', 'angle', 'dihedral', 'exclusion', 'pair', 'restraint', 'const\
raint', 'vdwtype', 'site']

FEPIO_BLOCK_LIST

Value:
['atommap', 'bondmap', 'anglemap', 'dihedmap', 'exclmap', 'pairmap']

FEPIO_FFIO_MAP

Value:
{'atommap': 'site', 'bondmap': 'bond', 'anglemap': 'angle', 'dihedmap'\
: 'dihedral', 'exclmap': 'exclusion', 'pairmap': 'pair'}

ATOM_ATTRIBUTES

Value:
['alt_xyz', 'atom_name', 'atom_type', 'atom_type_name', 'atomic_number\
', 'atomic_weight', 'bond_total', 'chain', 'chirality', 'element', 'en\
try_id', 'formal_charge', 'growname', 'inscode', 'isotope', 'label_col\
or', 'label_format', 'label_user_text', 'molecule_number', 'name', 'pa\
rtial_charge', 'pdbcode', 'pdbname', 'pdbres', 'resnum', 'secondary_st\
ructure', 'solvation_charge', 'style', 'temperature_factor', 'vdw_radi\
us', 'visible', 'x', 'xyz', 'y', 'z']