public abstract class MoleculeNtn extends Notation
A molecule is represented as a graph with atoms as nodes and bonds as edges.
General grammar for (linear) molecule descriptions:
Molecule ::= Atom Branch Branch ::= \epsilon | Bond Atom Branch | Bond Label Branch | "(" Branch ")" Branch Atom ::= Element LabelDef LabelDef ::= \epsilon | Label LabelDef
The definitions of the terms "Element", "Bond", and "Label" depend on the chosen description language. For the SMILES language it is:
Element ::= "[H]" | "[He]" | "[Li]" | "[Be]" | ... | "B" | "C" | "N" | "O" | "F" | ... Bond ::= \epsilon | "-" | "=" | "#" | ":" Label ::= [0-9] | "%" [0-9] [0-9]
Modifier and Type | Field and Description |
---|---|
protected java.lang.StringBuffer |
desc
the buffer for creating molecule descriptions
|
Constructor and Description |
---|
MoleculeNtn() |
Modifier and Type | Method and Description |
---|---|
protected int |
getHydros()
Read shorthand hydrogen atoms.
|
protected static int |
getHydros(Node atom,
Recoder coder)
Get the number of adjacent hydrogen atoms (and mark them).
|
boolean |
hasFixedTypes()
Whether this notation has a fixed set of (node and edge) types.
|
void |
setEdgeMgr(TypeMgr edgemgr)
Set the edge type manager.
|
void |
setNodeMgr(TypeMgr nodemgr)
Set the node type manager.
|
void |
write(Graph graph,
java.io.Writer writer)
Write a description of a molecule.
|
createNotation, describe, getDelim, getEdgeMgr, getNodeMgr, isLine, mark, parse, read, setReader, setTypeMgrs, unmark, unread
protected java.lang.StringBuffer desc
public boolean hasFixedTypes()
hasFixedTypes
in class Notation
true
, because types are atoms and bondspublic void setNodeMgr(TypeMgr nodemgr)
This function has no effect, because node types are fixed.
setNodeMgr
in class Notation
nodemgr
- the new node type managerhasFixedTypes()
public void setEdgeMgr(TypeMgr edgemgr)
This function has no effect, because edge types are fixed.
setEdgeMgr
in class Notation
edgemgr
- the new edge type managerhasFixedTypes()
protected int getHydros() throws java.io.IOException
java.io.IOException
protected static int getHydros(Node atom, Recoder coder)
atom
- the atom for which to get the adjacent hydrogenscoder
- the recoder for the atom types (if any)