Package Pmv :: Module editCommands :: Class FixHydrogenAtomNamesCommand
[hide private]
[frames] | no frames]

Class FixHydrogenAtomNamesCommand

source code

ViewerFramework.VFCommand.Command --+    
                                    |    
                  mvCommand.MVCommand --+
                                        |
                                       FixHydrogenAtomNamesCommand


This class checks hydrogen atom names and modifies them to conform to 'IUPAC-IUB' conventions 
    
Package:Pmv
    
Module :editCommands
    
Class:FixHydrogenAtomNamesCommand
    
Command:fixHNames
    
Synopsis:

        None <- fixHNames(nodes, **kw)
    
Required Arguments:

        nodes --- TreeNodeSet holding the current selection


    Hydrogen names have 4 spaces:'H _ _ _', (here referred to as 1-4).
 
    'H' is always in space 1.

    Space 2 references the name of the atom to which H is bonded 
        using the following scheme: 

    IF the name has 1 letter, space 2 is that letter. 

    IF the name has more than 1 letter, space 2 is the second letter 
        in that name and space 3 the third letter if it exists. 

(Please note that the second space in the bonded atom name is a 'remoteness'
indicator and the third used to number items equally remote.)


    In all cases, the LAST space (which could be space 3 or space 4 
depending on the bonded-atom's name) is used to number hydrogen atoms 
when more than one are bound to the same atom.


EXAMPLES:

        HN <- hydrogen bonded to atom named 'N'

        HA <- hydrogen bonded to atom named 'CA'

        HE <- hydrogen bonded to atom named 'NE'

        HH11 <- first hydrogen bonded to atom named 'NH1'

        HH12 <- second hydrogen bonded to atom named 'NH1'

        HD21 <- first hydrogen bonded to atom named 'CD2'

________________________________________________________________________

A final complexity results when these names are written in pdb files:

The name of the atom appears RIGHT-JUSTIFIED in the first two columns of
the 4 columns involved (13-16). Thus 'H' appears in column 14 for all hydrogen
atoms. This creates a problem for 4 character hydrogen names. They are 
accommodated by wrapping so that space 4 appears in column 13.


EXAMPLE:

        1HD2 <- first hydrogen bonded to atom named 'CD2' as represented 
in a pdb file.

    



Instance Methods [hide private]
  __init__(self, func=None)
  doit(self, nodes)
virtual method.
  __call__(self, nodes, **kw)
None <--- fixHNames(nodes, **kw)

Inherited from mvCommand.MVCommand: guiCallback, strArg

Inherited from mvCommand.MVCommand (private): _strArg

Inherited from ViewerFramework.VFCommand.Command: __repr__, addCallbackAfter, addCallbackBefore, addUndoCall, afterDoit, beforeDoit, buildFormDescr, buildLogArgList, checkDependencies, cleanup, customizeGUI, doitWrapper, getArguments, getHelp, getLastUsedValues, getLogArgs, getValNamedArgs, log, logString, onAddCmdToViewer, onAddNewCmd, onCmdRun, setLastUsedValues, setupUndoAfter, setupUndoBefore, showForm, tkCb, updateGeom, warningMsg


Class Variables [hide private]

Inherited from ViewerFramework.VFCommand.Command: negateKw, objArgOnly


Method Details [hide private]

__init__(self, func=None)
(Constructor)

source code 
None
Overrides: mvCommand.MVCommand.__init__

doit(self, nodes)

source code 
virtual method. Has to be implemented by the sub classes
Overrides: ViewerFramework.VFCommand.Command.doit
(inherited documentation)

__call__(self, nodes, **kw)
(Call operator)

source code 

None <--- fixHNames(nodes, **kw)

nodes --- TreeNodeSet holding the current selection
Overrides: ViewerFramework.VFCommand.Command.__call__