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

Module fep_mapping

Classes [hide private]
  AtomMappingData
Class to store intermediary and final data structures for atom mapping
Functions [hide private]
 
cleanup(topdir=None)
Cleanup function to be run atexit
 
map_core_hydrogen(source_ct, dest_ct, core_map, s_remaining_indices, d_remaining_indices)
Mapping hydrogen atoms connected to the core.
 
find_fragment_by_cond(bridge_atom, cond)
 
find_noncore_fragment(bridge_atom, core_atom_indices)
Finding non-core fragment from bridged
 
find_noncore_subfragment(bridge_atom, core_atom_indices, frag_atom_indices)
Finding non-core fragment from bridged
 
find_all_fragment_pairs(source_ct, dest_ct, attachment_points, core_atom_indices)
 
get_atom_mapping(data)
mapping atoms based on the result from RGA
 
get_fepio_atom_mapping(atom_mapping)
converting to atom mapping format required by mmfepio library.
 
fragment_size_cond(frag1, frag2, threshold=FRAGMENT_SIZE_THRESHOLD)
 
heavy_atom_num_cond(frag1, frag2, threshold=HEAVY_ATOM_NUM_THERESHOLD)
 
get_heavy_fragment(frag)
 
find_fragment_MCS(data, cond=heavy_atom_num_cond, atomtype=DEFAULT_ATOM_TYPE)
Finding MCS in fragment if the fragment pair satisfied specified conditions.
 
convert_rga_data(rga_data, input_file)
Converting RGA internal data to AtomMappingData object
 
convert_data(source_ct, dest_ct, source_core_atoms, dest_core_atoms, source_attachments, dest_attachments)
source_ct: dest_ct: source_core_atoms: list of source core atoms dest_core_atoms: list of dest core atoms source_attachments: list of source attachment points dest_attachments: list of dest attachment points
 
get_atom_mapping_data(input_file, atomtype=DEFAULT_ATOM_TYPE)
 
run_rga(input_file, atomtype=11)
 
unique_list(seq, idfun=None)
A fast function to remove duplicate element from sequence by preserving the order at the same time.
 
get_atom_marking(data, output_file)
 
get_bridge_atoms(data)
 
check_mapping(data, n1, n2)
 
reorder_st(st, index_map)
 
is_ring_open_or_closed(s_frag_indices, d_frag_indices, s2d_bridge_atom, d2s_bridge_atom)
 
write_fepsubst_to_file(data, filename, overwrite=True)
 
reorder_atoms(data, source_ct, dest_ct)
 
check1_subst_code(source_ct, dest_ct)
take input cts and check single ring-atom/attachment subst_code, return true if pass
 
random_shuffle(data, atomtype)
generate atommap with random shuffled atom order, return atommaps in original order
 
__raw_fepsubst(mol, noncore, cor, non)
Assigns raw fep_subst code to the given molecule.
 
__is_dummy(atom)
Returns true if this atom can become a dummy atom in an alchemical FEP mutation, or false if not.
 
__fix_97atoms(mol)
We loop through all <97> atoms and check if a <97> atom is connected to more than 1 physical-physical hybrid atoms.
 
__fix_99atoms(atom98, code98, atom99_set)
This function reassigns the 'fep_subst' code for <99> atoms that are bonded to the given <98> atom.
 
get_subst_from_mapping(mol0, mol1)
Given two CTs: ct0 and ct1, with i_fep_mapping atom properties properly set for all atoms of ct1, sets the i_fep_subst atom properties for both CTs.
Variables [hide private]
  logger = log.get_output_logger(name= "fep_mapping")
  schrod_tmp = mm.mmfile_get_schrodinger_temp()
  TEMP_DIR = tempfile.mkdtemp(prefix= "fep-mapping-tmp", dir= sc...
  FRAGMENT_SIZE_THRESHOLD = 10
  HEAVY_ATOM_NUM_THERESHOLD = 7
  FEP_MAPPING_ORIGINAL_INDEX = 'i_fep_mapping_origial_index'
  FEP_MAPPING_BRIDGE = 'i_fep_mapping_bridge'
  DEFAULT_ATOM_TYPE = 11
Function Details [hide private]

map_core_hydrogen(source_ct, dest_ct, core_map, s_remaining_indices, d_remaining_indices)

 

Mapping hydrogen atoms connected to the core. The number of hydrogen atoms connected to the corresponding atoms should be equal except the core atoms which have attachment.

find_noncore_fragment(bridge_atom, core_atom_indices)

 

Finding non-core fragment from bridged

Parameters:
  • bridge_atom (_StructureAtom) - atom bonded to the attachment core atom.
  • core_atoms (set of int) - a set of core atom indices. @return a list of atoms.

find_noncore_subfragment(bridge_atom, core_atom_indices, frag_atom_indices)

 

Finding non-core fragment from bridged

Parameters:
  • bridge_atom (_StructureAtom) - atom bonded to the attachment core atom.
  • core_atom_indices (set of int) - a set of core atom indices. @return a list of atoms.

get_atom_mapping(data)

 

mapping atoms based on the result from RGA

Parameters:
  • data (AtomMappingData) - intermediary and finals data structures from RGA

get_fepio_atom_mapping(atom_mapping)

 

converting to atom mapping format required by mmfepio library. Below is an example: 1 1 2 2 3 -1 4 -1 5 3 -6 4 -7 5

convert_rga_data(rga_data, input_file)

 

Converting RGA internal data to AtomMappingData object

Parameters:
  • rga_data (r_group_analysis.Data)
  • input_file (string) - input file

reorder_st(st, index_map)

 
Parameters:
  • ct (Structure) - Structure object
  • index_map (list of tuple) - index mapping between old and new index [(new_index, old_index), ...]

__raw_fepsubst(mol, noncore, cor, non)

 

Assigns raw fep_subst code to the given molecule. We assign only the following values: 1, 2, 97, 98, and 99, and here we ignore the other forms of values (i.e., 197, 297, 198, 298, 89, 79, etc.).

Parameters:
  • mol (structure.Structure) - The molecule that we will set the "i_fep_subst" atom property
  • noncore (set of int) - All noncore atoms' indices
  • cor (list of int) - All core atoms' indices
  • non (list of int) - Noncore-but-matched atoms' indices

__fix_97atoms(mol)

 

We loop through all <97> atoms and check if a <97> atom is connected to more than 1 physical-physical hybrid atoms. If so, we leave the atom's fep_subst code to be 97, otherwise we change it to 2 (so it becomes a physical-dummy hybrid atom). We repeat this process until there is no change of the fep_subst code.

__fix_99atoms(atom98, code98, atom99_set)

 

This function reassigns the 'fep_subst' code for <99> atoms that are bonded to the given <98> atom. Here I use the <99> nomenclature to mean 99, 199, 299, and so on. -YW

This reassignment is for two purposes:

  1. Ensure the code consistency between the two molecules.
  2. Adjust some 99 codes to be 89 or 79 or 69.

This reassignment has to be done after that we obtain an overall knowledge of which atoms are <98>, <99>, and <97>.

The assigned 'fep_subst' code is based the given <98> code: if it's 98, <99> will be 99 (or 89, 79, etc.); if it's 198, <99> will be 199 (or 189, 179, etc.), and so on.

Parameters:
  • atom98 (Structure.Atom) - The <98> atom which we will reassign the <99> and <97> atoms that are bonded to
  • code98 (int) - The <98> fep_subst code. The value will be one of 98, 198, 298, ... and so on.
  • atom99_set (set of Structure.Atom objects) - A set that we use to keep track of the <99> atoms that have already been reassigned. For each atom, we reassign at most once.

Variables Details [hide private]

TEMP_DIR

Value:
tempfile.mkdtemp(prefix= "fep-mapping-tmp", dir= schrod_tmp)