Desktop and Enterprise Software, Solutions and Services for Chemists and Biologists.

Desktop Support » FAQ » Details

Question:

While tying to use the "countAtoms()" function, ChemScript skips the implicit hydrogen atoms. Is their way to get the correct value in ChemScript?

Answer:

The ‘countAtom’ function doesn’t add implicit hydrogen atoms and the ;exactMass’ works correctly, which doesn’t include the implicit hydrogen atoms. You can able to add hydrogen by applying the function ‘convertTo3DStructure’.
Please try the following.
Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on win 32

Type "help", "copyright", "credits" or "license" for more information.
>>> from ChemScript import *
----------------------------------------------------------------------------
Welcome to CS ChemScript Pro for Python (11.0.504 June 21, 2007)
Copyright (C) 2005-2007 CambridgeSoft Corp., all rights reserved.
----------------------------------------------------------------------------


For help: use the "help()" command. For example, type: "help(Mol)".
>>> m=Mol.loadData('CCC(N(CO)CC)=O')

Open molecule successfully: chemical/x-smiles
>>> m.formula()
'C6H13NO2'

>>> m.countAtoms()
9

>>> m.exactMass()
131.0946286667


>>> m.averageMass()
118.0697


>>> m.convertTo3DStructure()
True


>>> m.formula()
'C6H13NO2'


>>> m.countAtoms()
22

>>> m.averageMass()
131.17292


>>> m.exactMass()
131.09462866669998
>>>


Created on: 3/5/2012