|
|||||||||
| Home >> All >> org >> xmlcml >> cml >> [ topology overview ] | PREV PACKAGE NEXT PACKAGE | ||||||||
Package org.xmlcml.cml.topology
CoreCML index
See:
Description
| Interface Summary | |
| ChainSet | |
| Ring | |
| RingNucleus | a nucleus of rings (e.g. |
| RingOverlap | holds information about overlap between two rings (fused or bridged). |
| SubstituentList | a list of substituents (Chains, RingNucleus)- usually on an CMLAtom in a Ring(Nucleus) |
| Topology | simple Spanning tree, independent of CMLMolecule (contains pointer into that). |
Package org.xmlcml.cml.topology Description
CMLDOM Interface
Overview
This is the central package for the CML-DOM. It consists of a set of interfaces, based on CML V1.0 DTD and expounded in CMLDOM (both specifications published in J.Chem.Inf.Comp.Sci). Essentially:
- Each element has an interface, instantiable as a class
- Each communal attribute (usually a parameter entity in the DTD) has an interface, which the appropriate classes implement.
Example:
<molecule convention="PDB" count="4">
is represented by the interfaces:
- Interface CMLMolecule.java
- Interface HasConvention.java
- Interface HasCount.java
CMLMolecule will be implemented as a class; we have used org.xmlcml.jumbo3.MoleculeImpl in our prototypes:
public class org.xmlcml.jumbo3.MoleculeImpl
extends org.xmlcml.jumbo3.CMLBaseImpl
implements org.xmlcml.cml.CMLMolecule {
Thus these classes will (directly or indirectly)
implement the HasConvention and HasCount interfaces.
CMLDOM 1.0 is defined by the interfaces in this package (org.xmlcml.cml). There are several conventions to help navigation:
- All interfaces or classes with the substring "Abstract" (e.g. AbstractAngle) are to mainly to help class maintenance more than providing modelling information. They often declare public final static variables, or methods and fields shared by subclasses. Any class implementing *Abstract* interfaces is likely to be an abstract class.
- classes corresponding to elements in the DTD are usually named with a "CML" prefix. This helps readbility and lessens the chance of name collisions.
- Interfaces corresponding to commonly used attributes (e.g convention, count which occur on several elements) are named Has* (e.g. HasCount).
- There are a very few instantiable classes in org.xmlcml.cml, at present: CMLUnits, CMLException and CMLSymbol.
- Factories are used to create CMLAtom, CMLBond, CMLMolecule and CMLDocuments. This allows subclasses to create subclasses of these for specialised purposes.
CMLCore
There is a subset of classes, and their methods which is useful for a wide range of applications involved well-defined single molecules. This subset is referred to as "CoreCML" and can be used by itself. One application of this is a "core" for the OMG LifeScienceResearch definition of molecular objects. We are working closely with the OMG to make sure that this core can be used for their purposes and also forms a useful subset.
The components of CoreCML are:
- CMLAngle
- CMLAtomParity
- CMLAtom
- CMLBond
- CMLBondStereo
- CMLCrystal
- CMLCoordinate2
- CMLCoordinate3
- CMLDocument
- CMLIsotope
- CMLMolecule
- CMLTorsion
Interfaces and methods than belong to CMLCore are annotated and an implementation that uses only these should be viable and useful.
Data types
CML uses the following data types:
primitives
- String
- int
- double (in fact any class called "Float" uses doubles)
W3-DOM
- org.w3.dom.Node, etc. CML-DOM supports the complete XML-DOM and so Elements can return child Nodes, attributes, etc. Most methods using these will be inherited from the XML-DOM.
Collections
- java.util.Vector. Elements often contain specific types of children and these are often returned in Vectors. The type of the elements will depend on the method, and hopefully should be obvious or annotated.
- Enumerated values. ElementType is selected from an extended Periodic Table.
CML datatypes
Certain elements and builtin attributes are defined in the CML DTD and require complex datatypes. They include (prefix omitted):
- Coordinate2. 2-D coordinates (x,y). Primarily used for 2-D structural diagrams.
- Coordinate3. 3-D coordinates (x,y,z). Used for atomic coordinates, either Cartesian or fractional.
- Units. Still under development and awaiting the development of UnitsML (e.g. from LBL and NIST).
- AngleUnits. A class to avoid confusion between degrees and radians. This is not necessary but may be useful.
- Symbol. We expect to see symbolic representations of variables in the future (e.g. for stereochemistry).
- Isotope. This may be a complex concept required a mixture of double and int, and with sets of values
- AtomParity. Required to hold a signed value and also the atomRefs defining the parity.
- BondStereo. Required to hold a symbolic value and also the atomRefs defining the stereochemistry.
- AtomRefs. A set of atoms is often required to define a quantity.
|
|||||||||
| Home >> All >> org >> xmlcml >> cml >> [ topology overview ] | PREV PACKAGE NEXT PACKAGE | ||||||||