Package Chem :: Module Descriptors
[hide private]
[frames] | no frames]

Module Descriptors

source code

Functions [hide private]
 
MolWt(mol, heavyAtomsOnly=0)
The average molecular weight of the molecule...
source code
 
HeavyAtomMolWt(x)
The average molecular weight of the molecule ignoring hydrogens...
source code
 
NumValenceElectrons(mol)
The number of valence electrons the molecule has...
source code
 
_test() source code
Function Details [hide private]

MolWt(mol, heavyAtomsOnly=0)

source code 
The average molecular weight of the molecule

>>> '%.2f'%MolWt(Chem.MolFromSmiles('CC'))
'30.07'
>>> '%.2f'%MolWt(Chem.MolFromSmiles('CC'),1)
'24.02'
>>> '%.2f'%MolWt(Chem.MolFromSmiles('[NH4+].[Cl-]'))
'53.49'

HeavyAtomMolWt(x)

source code 
The average molecular weight of the molecule ignoring hydrogens

>>> '%.2f'%HeavyAtomMolWt(Chem.MolFromSmiles('CC'))
'24.02'
>>> '%.2f'%HeavyAtomMolWt(Chem.MolFromSmiles('[NH4+].[Cl-]'))
'49.46'

NumValenceElectrons(mol)

source code 
The number of valence electrons the molecule has

>>> NumValenceElectrons(Chem.MolFromSmiles('CC'))
14.0
>>> NumValenceElectrons(Chem.MolFromSmiles('C(=O)O'))
18.0
>>> NumValenceElectrons(Chem.MolFromSmiles('C(=O)[O-]'))
18.0
>>> NumValenceElectrons(Chem.MolFromSmiles('C(=O)'))
12.0