CurlySMILES class Notation: method mf_compnt

Method mf_compnt belongs to class Notation, the core class for managing a CurlySMILES notation. A call to mf_compnt returns the molecular formula for a component of the notation. The formula format is based on the Hill convention, writing C first, H second, and then all other chemical elements in alphabetical order of their atomic symbols. A stoichiometric integer, if greater than 1, follows the symbol. A cation or anion formula, ends with an appended charge notation, (n+) or (n-), respectively, where n > 0.

Module file: csm_notation.py
Method: mf_compnt(iCompnt)
Argument: iCompnt (index of component); type: integer
Return: sMF, a string with the molecular formula of the iCompnt-th component or None, if component notation does not evaluate to a molecular formula.
Example: Cobalt(II) nitrate hexahydrate, Co(NO3)2·H2O
sNotation = "[Co+2].[O-]N(=O)=O{2}.O{6}"
iCompntsMF
1Co(2+)
2NO3(1-)
3NO3(1-)
4H2O
5H2O
6H2O
7H2O
8H2O
9H2O


Please, email comments and suggestions to axeleratio@yahoo.com
Custom Search