Package schrodinger :: Package application :: Package matsci :: Module enumeration :: Class ElementAlchemist
[hide private]
[frames] | no frames]

Class ElementAlchemist

object --+    
         |    
 Alchemist --+
             |
            ElementAlchemist

An alchemist class that transmutes elements in a Structure

Instance Methods [hide private]
 
__init__(self, master, targets, new_items, path, child=None)
Create an Alchemist object
schrodinger.structure.Structure
performTransmutation(self, struct, index, item)
Perform a transmutation on a copy of struct at index.
 
fixHydrogens(self, struct, used)
Correct the number of hydrogens bonded to each transmuted atom
 
allTransmutationsCompleted(self, struct, used)
All transmutations have been performed on struct, write it out to a file if we are keeping this result
 
runTransmutations(self, data, used=None)
Begin transmuating atoms.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, master, targets, new_items, path, child=None)
(Constructor)

 

Create an Alchemist object

Parameters:
  • master (AlchemyEnumerationPanel) - The master panel for this Alchemist
  • targets (list) - list of possible atoms for this Alchemist to mutate
  • new_items (list of tuple) - Each item of the list is an (element, color) tuple, where element is the atomic symbol of the element to mutate to, and color is the new color for that atom in a form accepted by the _StructAtom.color property
  • path (str) - The path to a temporary file to write structures to
  • child (Alchemist) - The Alchemist to call each time this Alchemist transmutes an atom. If child is None, than this Alchemist is the last in the line.
Overrides: object.__init__

performTransmutation(self, struct, index, item)

 

Perform a transmutation on a copy of struct at index. It is very important that this happen on a copy of struct, not struct itself.

Parameters:
  • struct (schrodinger.structure.Structure) - The structure to transmute a copy of
  • index (int) - An index that tells what atom to transmute
  • item (tuple) - An (element, color) tuple, where element is the atomic symbol of the element to mutate to, and color is the new color for that atom in a form accepted by the _StructAtom.color property
Returns: schrodinger.structure.Structure
A COPY of struct with atom index transmuted
Overrides: Alchemist.performTransmutation

fixHydrogens(self, struct, used)

 

Correct the number of hydrogens bonded to each transmuted atom

Parameters:

allTransmutationsCompleted(self, struct, used)

 

All transmutations have been performed on struct, write it out to a file if we are keeping this result

Parameters:
Overrides: Alchemist.allTransmutationsCompleted

runTransmutations(self, data, used=None)

 

Begin transmuating atoms.

This Alchemist will determine what target atoms to transmute based on its set of original targets minus those targets that have been used by previous Alchemists. Each time this Alchemist transmute an atom, it calls its child Alchemist to do its mutations (which calls its child Alchemist each time it transmutes an atom). Thus is the iterative process of transmutating all possible combinations acheived.

If this Alchemist does not have any children, than it is the last in the Alchemist line and it should add a new project entry each time it transmute an atom.

Parameters:
  • struct (schrodinger.structure.Structure) - The structure object with the transmuted atoms
  • used (list of int) - The atom indexes of the transmuted atoms by parent Alchemists. The last atom in this list is used to ensure that this Alchemist does not mutate any target already covered by parent Alchemists.
Overrides: Alchemist.runTransmutations