schrodinger.application.desmond.fepdiff module¶
A module to compare various block of mmffio and mmfepio blocks.
Copyright Schrodinger, LLC. All rights reserved.
-
class
schrodinger.application.desmond.fepdiff.
BaseBlockProperty
(handle, block_name, block_type, container)¶ -
getAllProperties
(map_func=<function identical_mapping>, filter_func=None, container=None)¶
-
getElementRepr
(n)¶
-
getPropertyName
()¶
-
-
class
schrodinger.application.desmond.fepdiff.
BiDirDualTupleDict
(*args, **kwargs)¶ Bases:
schrodinger.application.desmond.fepdiff.TupleDict
A dictionary class that uses tuple of tuple as its key which treats the inner tuple and its reversed counterpart the same. For instance, ((1, 2, 3), (3, 1, 2)) and ((1, 2, 3), (2, 1, 3)) are considered as the same key. However, ((1, 2, 3), (3, 1, 2)) is not equal to ((3, 1, 2), (1, 2, 3)).
-
class
schrodinger.application.desmond.fepdiff.
BiDirTupleDict
(*args, **kwargs)¶ Bases:
schrodinger.application.desmond.fepdiff.TupleDict
A dictionary class that uses tuple as its key which treats the tuple and its reversed counterpart the same. For instance, (1, 2, 3) and (3, 2, 1) are considered as same key.
-
class
schrodinger.application.desmond.fepdiff.
BlockDiffer
(name, block_prop1, block_prop2, map_func)¶ -
diff
()¶
-
-
class
schrodinger.application.desmond.fepdiff.
ConstraintBlockProperty
(handle)¶ Bases:
schrodinger.application.desmond.fepdiff.FFIOBlockProperty
-
class
schrodinger.application.desmond.fepdiff.
ConstraintTupleDict
(*args, **kwargs)¶ Bases:
schrodinger.application.desmond.fepdiff.TupleDict
A dictionary class that uses tuple as its key. For the key used in ConstraintTupleDict, the trailing zeros in the tuple are useless. For two equivalent keys. The first element of the tuple must be equal to each other. And the order from second element to the last none-zero element does not matter as long as all of the elements are the same. For instance, (1, 2, 3, 4, 0, 0), (1, 3, 2, 4, 0, 0) and (1, 4, 3, 2, 0, 0) are the same. However, (1, 2, 3, 4, 0, 0) is not the same as (2, 2, 3, 4, 0, 0)
-
class
schrodinger.application.desmond.fepdiff.
DictDiffer
(current_dict, past_dict)¶ Bases:
object
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
-
added
()¶
-
changed
()¶
-
removed
()¶
-
unchanged
()¶
-
-
class
schrodinger.application.desmond.fepdiff.
DihedmapBlockDiffer
(name, block_prop1, block_prop2, map_func)¶ Bases:
schrodinger.application.desmond.fepdiff.BlockDiffer
A class to compare the difference of dihedral block of two FFIOStructure instance. Note that the dihedral block in ffio_dihedral block contains both normal dihedral and improper dihedral terms. Normal dihedral term has in improper dihedral i_ffio_ak is the central atom.
-
class
schrodinger.application.desmond.fepdiff.
DihedralBlockDiffer
(name, block_prop1, block_prop2, map_func)¶ Bases:
schrodinger.application.desmond.fepdiff.BlockDiffer
A class to compare the difference of dihedral block of two FFIOStructure instance. Note that the dihedral block in ffio_dihedral block contains both normal dihedral and improper dihedral terms. Normal dihedral term has in improper dihedral i_ffio_ak is the central atom.
-
class
schrodinger.application.desmond.fepdiff.
DualIndexMapper
(index_map_pair)¶
-
class
schrodinger.application.desmond.fepdiff.
FEPIOAtommapBlockProperty
(handle, name, container=<class 'schrodinger.application.desmond.fepdiff.TupleDict'>)¶ Bases:
schrodinger.application.desmond.fepdiff.FEPIOBlockProperty
-
class
schrodinger.application.desmond.fepdiff.
FEPIOBlockProperty
(handle, name, container=<class 'schrodinger.application.desmond.fepdiff.BiDirDualTupleDict'>)¶ Bases:
schrodinger.application.desmond.fepdiff.BaseBlockProperty
-
block_prop_name
= {'atommap': {'i_fepio_ai': ['ai', <wrapped function mmfepio_atommap_get_ai>, <wrapped function mmfepio_atommap_set_ai>], 'i_fepio_aj': ['aj', <wrapped function mmfepio_atommap_get_aj>, <wrapped function mmfepio_atommap_set_aj>]}, 'bondmap': {'i_fepio_tj': [], 'i_fepio_ti': [], 'i_fepio_ai': [], 'i_fepio_aj': []}, 'pairmap': {'i_fepio_tj': [], 'i_fepio_ti': [], 'i_fepio_ai': [], 'i_fepio_aj': []}, 'dihedmap': {'i_fepio_al': [], 'i_fepio_ai': [], 'i_fepio_ak': [], 'i_fepio_aj': [], 'i_fepio_tj': [], 'i_fepio_ti': []}, 'anglemap': {'i_fepio_tj': [], 'i_fepio_ti': [], 'i_fepio_ai': [], 'i_fepio_ak': [], 'i_fepio_aj': []}, 'exclmap': {'i_fepio_tj': [], 'i_fepio_ti': [], 'i_fepio_ai': [], 'i_fepio_aj': []}}¶
-
-
class
schrodinger.application.desmond.fepdiff.
FEPIOProperty
(st1, st2)¶ Bases:
dict
-
block_list
= ['atommap', 'bondmap', 'anglemap', 'dihedmap', 'exclmap', 'pairmap']¶
-
getOrigAtomIndex
(i)¶
-
-
class
schrodinger.application.desmond.fepdiff.
FFIOBlockProperty
(handle, name, container=<class 'schrodinger.application.desmond.fepdiff.BiDirTupleDict'>)¶ Bases:
schrodinger.application.desmond.fepdiff.BaseBlockProperty
-
block_prop_name
= {'angle': {'s_ffio_funct': [], 'i_ffio_ai': [], 'i_ffio_ak': [], 'i_ffio_aj': [], 'r_ffio_c1': [], 'r_ffio_c2': []}, 'dihedral': {'s_ffio_funct': [], 'i_ffio_i1': [], 'r_ffio_t1': [], 'i_ffio_ai': [], 'i_ffio_ak': [], 'i_ffio_aj': [], 'i_ffio_al': [], 'r_ffio_c4': [], 'r_ffio_c5': [], 'r_ffio_c6': [], 'r_ffio_c7': [], 'r_ffio_c0': [], 'r_ffio_c1': [], 'r_ffio_c2': [], 'r_ffio_c3': []}, 'constraint': {'s_ffio_funct': [], 'i_ffio_ai': [], 'i_ffio_ak': [], 'i_ffio_aj': [], 'i_ffio_am': [], 'i_ffio_al': [], 'r_ffio_c4': [], 'r_ffio_c5': [], 'r_ffio_c6': [], 'r_ffio_c1': [], 'r_ffio_c2': [], 'r_ffio_c3': []}, 'restraint': {'i_ffio_ai': [], 's_ffio_funct': [], 'r_ffio_t1': [], 'r_ffio_t3': [], 'r_ffio_t2': [], 'r_ffio_c1': [], 'r_ffio_c2': [], 'r_ffio_c3': []}, 'improperfbhw': {'i_ffio_ai': [], 'r_ffio_sigma': [], 'i_ffio_ak': [], 'i_ffio_aj': [], 'r_ffio_phi0': [], 'i_ffio_al': [], 'r_ffio_fc': []}, 'pseudo': {'r_ffio_x_vel': ['x_vel', <wrapped function mmffio_pseudo_get_x_vel>, <wrapped function mmffio_pseudo_set_x_vel>], 'r_ffio_y_vel': ['y_vel', <wrapped function mmffio_pseudo_get_y_vel>, <wrapped function mmffio_pseudo_set_y_vel>], 'r_ffio_x_coord': ['x_coord', <wrapped function mmffio_pseudo_get_x_coord>, <wrapped function mmffio_pseudo_set_x_coord>], 'r_ffio_z_coord': ['z_coord', <wrapped function mmffio_pseudo_get_z_coord>, <wrapped function mmffio_pseudo_set_z_coord>], 'r_ffio_z_vel': ['z_vel', <wrapped function mmffio_pseudo_get_z_vel>, <wrapped function mmffio_pseudo_set_z_vel>], 'r_ffio_y_coord': ['y_coord', <wrapped function mmffio_pseudo_get_y_coord>, <wrapped function mmffio_pseudo_set_y_coord>]}, 'site': {'s_ffio_site': ['site', <wrapped function mmffio_site_get_site_name>, <wrapped function mmffio_site_set_site_name>], 's_ffio_vdwtype': ['vdwtype', <wrapped function mmffio_site_get_vdwtype>, <wrapped function mmffio_site_set_vdwtype>], 'r_ffio_charge': ['charge', <wrapped function mmffio_site_get_charge>, <wrapped function mmffio_site_set_charge>], 's_ffio_type': ['type', <wrapped function mmffio_site_get_type>, <wrapped function mmffio_site_set_type>], 'r_ffio_c1': ['c1', <wrapped function mmffio_site_get_c1>, <wrapped function mmffio_site_set_c1>], 'r_ffio_c2': ['c2', <wrapped function mmffio_site_get_c2>, <wrapped function mmffio_site_set_c2>], 'r_ffio_mass': ['mass', <wrapped function mmffio_site_get_mass>, <wrapped function mmffio_site_set_mass>]}, 'virtual': {'s_ffio_funct': [], 'i_ffio_index': ['virtual_index', <wrapped function mmffio_virtual_get_index>, <wrapped function mmffio_virtual_set_index>], 'i_ffio_ai': [], 'i_ffio_ak': [], 'i_ffio_aj': [], 'i_ffio_am': [], 'i_ffio_al': [], 'i_ffio_an': [], 'r_ffio_c4': [], 'r_ffio_c5': [], 'r_ffio_c6': [], 'r_ffio_c1': [], 'r_ffio_c2': [], 'r_ffio_c3': []}, 'exclusion': {'i_ffio_ai': [], 'i_ffio_aj': []}, 'anglefbhw': {'r_ffio_theta0': [], 'i_ffio_ai': [], 'r_ffio_sigma': [], 'i_ffio_ak': [], 'i_ffio_aj': [], 'r_ffio_fc': []}, 'pair': {'i_ffio_ai': [], 's_ffio_funct': [], 'i_ffio_aj': [], 'r_ffio_c1': [], 'r_ffio_c2': []}, 'vdwtypescombined': {'s_ffio_funct': [], 's_ffio_name1': [], 's_ffio_name2': [], 'r_ffio_t1': [], 'r_ffio_c1': [], 'r_ffio_c2': []}, 'vdwtype': {'r_ffio_t1': [], 's_ffio_funct': [], 's_ffio_name': [], 'r_ffio_c1': [], 'r_ffio_c2': []}, 'stretchfbhw': {'r_ffio_upper': [], 's_ffio_group2': [], 's_ffio_group1': [], 'r_ffio_beta': [], 'r_ffio_sigma': [], 'r_ffio_lower': [], 'r_ffio_fc': []}, 'posfbhw': {'i_ffio_ai': [], 'r_ffio_sigma': [], 'r_ffio_z0': [], 'r_ffio_fc': [], 'r_ffio_x0': [], 'r_ffio_y0': []}, 'bond': {'i_ffio_ai': [], 's_ffio_funct': [], 'i_ffio_aj': [], 'r_ffio_c1': [], 'r_ffio_c2': []}}¶
-
-
class
schrodinger.application.desmond.fepdiff.
FFIOProperty
(st)¶ Bases:
dict
-
block_list
= ['bond', 'angle', 'dihedral', 'exclusion', 'pair', 'restraint', 'constraint', 'vdwtype', 'site']¶
-
-
class
schrodinger.application.desmond.fepdiff.
ImproperDualTupleDict
(*args, **kwargs)¶ Bases:
schrodinger.application.desmond.fepdiff.TupleDict
ImproperDualTupleDict use two element tuple of tuple as it key. Its inner tuple has four element and the order is the same as ImproperTupleDict where the third element must match and the rest of the element also match but regardless of the order. ((1, 2, 3, 4),(2, 3, 1, 4)) == ((4, 2, 3, 1), (3, 2, 1, 4))
-
class
schrodinger.application.desmond.fepdiff.
ImproperTupleDict
(*args, **kwargs)¶ Bases:
schrodinger.application.desmond.fepdiff.TupleDict
A dictionary class that uses tuple as its key. For two equivalent keys used in ImproperTupleDict, the third element in the 4-element tuple must match, the rest of element must also match. But the order of them do not matter. In other words, (1, 3, 2, 4) == (4, 1, 2, 3) == (3, 4, 2, 1).
-
class
schrodinger.application.desmond.fepdiff.
IndexDict
(*args, **kwargs)¶ Bases:
dict
-
add
(index, key, val)¶
-
index
(key)¶
-
-
class
schrodinger.application.desmond.fepdiff.
IndexMapper
(index_map)¶
-
class
schrodinger.application.desmond.fepdiff.
LooseOrderTupleDict
(*args, **kwargs)¶ Bases:
schrodinger.application.desmond.fepdiff.TupleDict
A dictionary class that uses tuple as its key which does not care about the actual order of individual element of the tuple. For instance, (1, 2, 3), (1, 3, 2) and (3, 1, 2) etc are considered as same key.
are considered as same key.
-
class
schrodinger.application.desmond.fepdiff.
SiteBlockProperty
(handle)¶ Bases:
schrodinger.application.desmond.fepdiff.FFIOBlockProperty
-
class
schrodinger.application.desmond.fepdiff.
TupleDict
(*args, **kwargs)¶ Bases:
schrodinger.application.desmond.fepdiff.IndexDict
A dictionary class that has a tuple as its key. The key will be reordered before accessing or retrieving the object. Note that the built-in __init__ doesn’t call update, and the built-in update doesn’t call __setitem__. Have to call __setitem__ explicitly to make sure all setitem operations to go through our own implementation.
-
add
(index, key, val)¶
-
index
(key)¶
-
-
class
schrodinger.application.desmond.fepdiff.
VdwtypeBlockProperty
(handle)¶ Bases:
schrodinger.application.desmond.fepdiff.FFIOBlockProperty
-
schrodinger.application.desmond.fepdiff.
assign_forcefield
(st_list, forcefiled='OPLS3')¶ Assign forcefield return a list of FFioStruct instances that contain right forcefield information.
-
schrodinger.application.desmond.fepdiff.
compare_atom
(atom1, atom2)¶ compare attributes between two atoms. Return Ture if attributes are the same.
-
schrodinger.application.desmond.fepdiff.
compare_st
(st1, st2, index_map)¶
-
schrodinger.application.desmond.fepdiff.
create_fepio_block_property
(name, handle)¶
-
schrodinger.application.desmond.fepdiff.
create_fepio_differ
(name, prop1, prop2, index_map_pair)¶ create ffio differ based on the block name.
-
schrodinger.application.desmond.fepdiff.
create_ffio_block_property
(block_name, handle)¶ create block property instance based on the block_name :type block_name: string :param block_name: name of the FFIO/FEPIO block :type handle: :param hanle:
-
schrodinger.application.desmond.fepdiff.
create_ffio_differ
(block_name, block_prop1, block_prop2, index_map)¶ create ffio differ based on the block name.
-
schrodinger.application.desmond.fepdiff.
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:
Parameters: - st_pair2 (two element tuple of structure instances) –
- map_pair (two element tuple of list of integers) – 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.- 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
- ti or tj is 0 ti, tj, ai, aj = (-1, 50, 28, -48)
The interaction will only be scaled by either lambdaA or lambdaB.
- ti or tj is -2 ti, tj, ai, aj = (-2, 50, 28, -48)
The interaction will be scaled by (lambdaA+lambdaB)
-
schrodinger.application.desmond.fepdiff.
diff_fepio_prop
(prop1, prop2, index_map_pair)¶
-
schrodinger.application.desmond.fepdiff.
diff_ffio
(st1, st2, index_map)¶
-
schrodinger.application.desmond.fepdiff.
diff_ffio_prop
(prop1, prop2, index_map)¶
-
schrodinger.application.desmond.fepdiff.
error
(s)¶
-
schrodinger.application.desmond.fepdiff.
get_atom_property
(atom)¶
-
schrodinger.application.desmond.fepdiff.
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.
-
schrodinger.application.desmond.fepdiff.
get_ligand_cts
(input_fname)¶
-
schrodinger.application.desmond.fepdiff.
get_mapping_from_fepio_fep
(st1, st2)¶ fepio_fep block only exists in the second strucutre of fep structure pair.
-
schrodinger.application.desmond.fepdiff.
get_mapping_from_i_fep_mapping
(st1, st2)¶ i_fep_mapping only exists in the second strucutre of fep structure pair.
-
schrodinger.application.desmond.fepdiff.
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 of97: 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.
-
schrodinger.application.desmond.fepdiff.
get_temp_fname
()¶ Return temporary file name
-
schrodinger.application.desmond.fepdiff.
identical_mapping
(key)¶
-
schrodinger.application.desmond.fepdiff.
is_anchor_atom
(num)¶ anchor atom has code like 98, 198 etc.
-
schrodinger.application.desmond.fepdiff.
is_ffio_funct
(funct_name)¶
-
schrodinger.application.desmond.fepdiff.
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.
-
schrodinger.application.desmond.fepdiff.
is_ring_bridge_atom
(num)¶ ring bridge atom has code like 97, 197 etc.
-
schrodinger.application.desmond.fepdiff.
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]
-
schrodinger.application.desmond.fepdiff.
reorder_improper
(key)¶
-
schrodinger.application.desmond.fepdiff.
reorder_tuple
(key)¶
-
schrodinger.application.desmond.fepdiff.
run_desmond_ff_builder
(input_fname, output_fname, ff)¶