| Home | Trees | Indices | Help |
|
|---|
|
|
ViewerFramework.VFCommand.Command --+
|
mvCommand.MVCommand --+
|
AddHydrogensCommand
This command adds hydrogen atoms to all atoms in all molecules that have at least one member (i.e atom, residue, chain, base-pair etc..) specified in the first argument.
Package:Pmv
Module :editCommands
Class:AddHydrogensCommand
Command:add_h
Synopsis:
AtomSet<---add_h(nodes, polarOnly=0, method='noBondOrder,
renumber=1,**kw)
Required Arguments:
nodes --- TreeNodeSet holding the current selection
polarOnly --- default is 0
method --- Hydrogen atoms can be added using 2 different methods, ex: method='withBondOrder', default is 'noBondOrder'
renumber --- default is 1
Returns an atomSet containing the created H atoms
NOTE: This command adds hydrogens to all atoms in the molecule specified using the nodes argument.
The hydrogen atoms added to each molecule are also saved as a set called mol.name + '_addedH'
This class uses the AddHydrogens class from the PyBabel package.
Before this AddHydrogens object can be used, atoms must have been assigned
a type see (AtomHybridization in types.py).
Hydrogen atoms can be added using 2 different methods. The first one requires
bondOrders to have been calculated previousely.
example:
>>> atype = AtomHybridization()
>>> atype.assignHybridization(atoms)
>>> addh = AddHydrogens()
>>> hat = addh.addHydrogens(atoms)
atoms has to be a list of atom objects
Atom:
a .coords : 3-sequence of floats
a .bonds : list of Bond objects
babel_type: string
babel_atomic_number: int
Bond:
b .atom1 : instance of Atom
b .atom2 : instance of Atom
or
>>> addh = AddHydrogens()
>>> hat = addh.addHydrogens(atoms, method='withBondOrder')
atoms has to be a list of atom objects as above and
Bond:
b .atom1 : instance of Atom
b .atom2 : instance of Atom
b .bondOrder : integer
these calls return a list 'hat' containing a tuple for each Hydrogen
atom to be added. This tuple provides:
coordsH : 3-float coordinates of the H atom
atom : the atom to which the H atom is to be connected
atomic_number : the babel_atomic_number of the H atom
type : tyhe b:wabel_type of the H atom
reimplementation of Babel1.6 in Python by Michel Sanner April 2000
Original code by W. Patrick Walters and Matthew T. Stahl
|
|||
| __init__(self, func=None) | ||
|
onAddCmdToViewer(self) method called when an instance of this command is added to the viewer. |
||
|
__call__(self,
nodes,
polarOnly=False,
method='noBondOrder',
renumber=True,
**kw) AtomSet <- add_h(nodes, polarOnly=0, method='noBondOrder, renumber=1,**kw) nodes --- TreeNodeSet holding the current selection polarOnly --- default is False method --- Hydrogen atoms can be added using 2 different methods, ex --- method='withBondOrder', default is 'noBondOrder' renumber --- default is True Returns an atomSet containing the created H atoms NOTE: This command adds hydrogens to all atoms in the molecule specified using the nodes argument. |
||
|
doit(self,
nodes,
polarOnly=False,
method='noBondOrder',
renumber=True) None <- add_h(nodes, polarOnly=False, method='noBondOrder', renumber=True) |
||
|
Inherited from Inherited from Inherited from |
|||
|
|||
|
Inherited from |
|||
|
|||
|
|
AtomSet <- add_h(nodes, polarOnly=0, method='noBondOrder,
renumber=1,**kw)
nodes --- TreeNodeSet holding the current selection
polarOnly --- default is False
method --- Hydrogen atoms can be added using 2 different methods,
ex --- method='withBondOrder', default is 'noBondOrder'
renumber --- default is True
Returns an atomSet containing the created H atoms
NOTE: This command adds hydrogens to all atoms in the molecule
specified using the nodes argument.
The hydrogen atoms added to each molecule are also saved as a set
called mol.name + '_addedH'
|
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0alpha3 on Fri Nov 2 14:14:30 2007 | http://epydoc.sourceforge.net |