public final class AtomicCompositionParser extends Object
A composition may also contains groups of atoms simplifying some composition definition
Example: "CH3(CH2)2OH"
Observe the two occurrences of CH2 group in the previous propanol molecule.
Composition : AtomicExpression+ ('(' Charge ')') ?
AtomicExpression : HomoAtoms | AtomGroup
HomoAtoms : AtomicSymbol ('[' MassNumber ']')? Count?
AtomGroup : '(' HomoAtoms ')' Count
AtomicSymbol : [A-Z][a-z]?
MassNumber : [0-9]+
Count : [+-]?[0-9]+
Charge : [0-9]* [+-]
An intuitive way of writing it would be "H-1(+)" but it is wrong as it leads to subtracting an hydrogen and an electron (-H-e) whereas it should be subtracting an hydrogen and adding an electron (H+ = H-1e => -H+ = -H+1e).
As a result the right way of defining it is "H-1(-)" with the correct overall deduced charge given to the parser.
| Modifier and Type | Method and Description |
|---|---|
static AtomicCompositionParser |
getInstance() |
int |
parse(String content,
gnu.trove.map.TObjectIntMap<Atom> composition)
Parses the given string content and transmit data to builder.
|
public static AtomicCompositionParser getInstance()
Copyright © 2016. All Rights Reserved.