chemaxon.struc
Class Molecule

java.lang.Object
  extended bychemaxon.struc.CGraph
      extended bychemaxon.struc.MoleculeGraph
          extended bychemaxon.struc.Molecule
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable, StereoConstants
Direct Known Subclasses:
RgMolecule, RxnMolecule

public class Molecule
extends MoleculeGraph

Molecule class. A MoleculeGraph that may also contain S-groups.

Version:
3.3, 12/17/2003
Author:
Peter Csizmadia, Andras Volford
See Also:
Serialized Form

Field Summary
 
Fields inherited from class chemaxon.struc.MoleculeGraph
DIM_MASK, flags, isMultiChiral, orix, oriy, oriz, RMCLEANUP_STEREO
 
Fields inherited from class chemaxon.struc.CGraph
btab, ctab, edgeCount, edges, fragIds, grinv, grinvCC, INITIAL_CAPACITY, nFrags, nGrinv, nodeCount, nodes, parentGraph, RMCLEANUP_ALL, RMCLEANUP_EDGES, RMCLEANUP_NONE, sssr, superGraph
 
Fields inherited from interface chemaxon.struc.StereoConstants
ATOMSTEREO_EITHER, ATOMSTEREO_MASK, ATOMSTEREO_NONE, ATOMSTEREO_SPECIFIC, CHIRALITY_MASK, CHIRALITY_R, CHIRALITY_S, CHIRALITYSUPPORT_ALL, CHIRALITYSUPPORT_NONE, CHIRALITYSUPPORT_SELECTED, CIS, CTUMASK, CTUNKNOWN, CTUNSPEC, DBS_ALL, DBS_MARKED, DBS_NONE, PARITY_EITHER, PARITY_EVEN, PARITY_MASK, PARITY_ODD, PARITY_UNSPEC, STGRP_ABS, STGRP_AND, STGRP_NONE, STGRP_OR, TRANS
 
Constructor Summary
Molecule()
          Construct a molecule.
Molecule(Molecule p)
          Construct a molecule or fragment.
Molecule(Molecule p, int na, int nb)
          Construct a molecule or fragment with the specified number of atoms and bonds.
Molecule(Molecule p, MolAtom a)
          Construct a graph consisting of a single vertex (atom).
Molecule(Molecule p, MolBond b)
          Construct a graph consisting of a single edge (bond).
 
Method Summary
protected  void addNode0(CNode node)
          Adds a node.
protected  void addSgroupsOf(Molecule m)
          Adds S-groups to this object and its parent.
 double bondlength()
          Calculate the regular bond length for the unified structure.
 void clear()
          Clears the molecule.
 void clearCalcResults()
           
 void clearForImport(java.lang.String format)
          Initializes molecule for import.
 void clearProperties()
          Clears RDfile/SDfile properties.
 java.lang.Object clone()
          Make an identical copy of the molecule.
 void clonecopy(CGraph g)
          Make another molecule identical to this one.
 void clonelesscopy(CGraph g)
          Copy to selection.
 boolean contractSgroups()
          Contracts all S-groups.
 Molecule[] convertToFrags()
          Converts this molecule to its disconnected fragments.
 void draw(java.awt.Graphics g, java.lang.String opts)
          Draws the molecule into a graphics context.
 void endReuse(int n)
          End reusing atoms.
 boolean expandSgroups()
          Expands all S-groups.
 boolean expandSgroups(int opts)
          Expands all S-groups.
protected  void fillSelectionMolecule(SelectionMolecule s)
          Adds all atoms and bonds to the specified molecule.
 Sgroup findContractableSgroup()
          Finds an expanded residue.
 Sgroup findExpandableSgroup()
          Finds a contracted residue.
 SelectionMolecule[] findFrags()
          Determines the disconnected fragments and puts them into an array.
 Sgroup findSgroupContaining(MolAtom a)
          Finds the S-group that contains the specified node.
 Sgroup findSgroupOf(MolAtom a)
          Finds the S-group related to the specified node.
 java.lang.String getComment()
          Gets the comment.
 long getEndPosition()
          Gets the end position of this molecule in the input file.
protected  SelectionMolecule getGraphUnionAsSelection()
          Gets a selection molecule containing all the atoms and bonds.
 chemaxon.marvin.util.MolImageSize getImageSize(java.lang.String fmt)
          Gets size information of an image created with the specified format string.
 java.lang.String getInputFormat()
          Gets the input file format.
 java.lang.String getName()
          Gets the molecule name.
 java.lang.String getProperty(java.lang.String key)
          Gets an RDfile/SDfile property.
 int getPropertyCount()
          Gets the total number of RDfile/SDfile properties.
 java.lang.String getPropertyKey(int n)
          Gets an RDfile/SDfile property key.
 java.util.Enumeration getPropertyKeys()
          Gets the keys for the RDfile/SDfile properties.
 java.lang.Object getPropertyObject(java.lang.String key)
          Gets an RDfile/SDfile property object.
 Sgroup getSgroup(int i)
          Gets an S-group.
 Sgroup[] getSgroupArray()
          Gets the array of S-groups.
 int getSgroupCount()
          Gets the number of S-groups.
 MolAtom[] getSgroupLigands()
          Gets the S-group's ligands if the structure represents an S-group.
 Molecule getSimplifiedMolecule()
          Gets the simplified molecule object.
 long getStartPosition()
          Gets the starting position of this molecule in the input file.
 int indexOf(Sgroup sg)
          Gets the array index of an S-group.
 boolean isReaction()
          Checks if the structure represents a reaction or not.
 boolean isSgroup()
          Checks if the structure represents an S-group or not.
protected  void makeItSimilar(CGraph g)
          Copies some properties of this molecule to the other one specified as argument.
 void mergeNodes(CNode that, CNode node)
          Merges bonds of an atom with another atom, then add the atom to the molecule.
 CGraph newInstance()
          Creates a new Molecule object.
 void removeAll()
          Removes all the nodes and edges.
 void removeAllEdges()
          Removes all edges.
protected  void removeAllSgroups()
          Removes all S-groups.
protected  void removeEdge(CEdge edge, int cleanupFlags)
          Removes an edge by reference.
protected  void removeEdge(int i, int cleanupFlags)
          Removes an edge.
protected  void removeNode(CNode node, int cleanupFlags)
          Removes a node and its edges.
protected  void removeNode(int i, int cleanupFlags)
          Remove a node and its edges.
protected  void removeSgroupsOf(Molecule m)
          Removes S-groups from this object and its parent.
protected  void reparentSgroups(Molecule p)
          Change parents of all S-groups in this molecule.
static java.lang.String residueSymbolOf(int id)
          Gets the name of a residue.
static int residueTypeOf(java.lang.String name)
          Gets the residue identifier for a residue name.
 MolAtom reuseAtom(int z, int i)
          Reuse an atom or create a new one.
 void setComment(java.lang.String s)
          Sets the comment.
 void setDim(int d)
          Sets the dimension.
 void setEndPosition(long off)
          Sets the end position of this molecule in the input file.
 void setInputFormat(java.lang.String format)
          Sets the input file format.
 void setName(java.lang.String s)
          Sets the molecule name.
protected  void setNode0(int i, CNode node)
          Sets the node at the specified index.
 void setProperty(java.lang.String key, java.lang.String value)
          Sets an RDfile/SDfile property.
 void setPropertyObject(java.lang.String key, java.lang.Object value)
          Sets an RDfile/SDfile property object.
 void setSgroupParent(MolAtom a, Sgroup sg, boolean set)
          Sets or unsets an S-group as a parent of an atom.
 void setStartPosition(long off)
          Sets the starting position of this molecule in the input file.
 byte[] toBinFormat(java.lang.String fmt)
          Creates a binary representation of the molecule.
 java.lang.String toFormat(java.lang.String fmt)
          Creates a string representation of the molecule.
 java.lang.Object toObject(java.lang.String fmt)
          Creates a String, byte[] array or Image representation of the molecule.
 boolean ungroupSgroups()
          Expand and ungroup all S-groups.
 
Methods inherited from class chemaxon.struc.MoleculeGraph
adjustMultiChiralFlag, aromatize, calcCenter, calcCenter, calcDehydrogenizedGrinv, calcHeight, calcOutRectCenter, calcWidth, canBeCT, clean, contains, createBHtab, createCHtab, createDehydrogenizedReadOnlyGraph, getAromrings, getAromrings, getAtom, getAtomArray, getAtomCount, getBond, getBondCount, getChirality, getDesiredLength, getDesiredLength, getDim, getDocument, getFormula, getGraphUnion, getGrinv, getGrinv, getImplicitHcount, getLocation, getMass, getNonAromrings, getNonAromrings, getParity, getPoints, getSSSRBondSet, getStereo2, getStereo2, getStereo2, getStereo2, getStereo2, getStereo2, getStereo2, hasImplicitH, hydrogenize, implicitizeHydrogens, isAbsStereo, isAtom, isBond, isMultiChiral, isRingBond, moveTo, qpropCheck, setAbsStereo, setChirality, setLocation, setParity, setParity, setSetSeqs, stereoClean, transform, transform, valenceCheck, valenceCheck
 
Methods inherited from class chemaxon.struc.CGraph
add, add, addEdge0, addEdgeWithoutChangingIt, addNodeWithoutChangingIt, contains, findFrag, findFrags, fuse, fuse0, getBtab, getCtab, getEdge, getEdgeCount, getEdgeVector, getForefather, getFragCount, getFragIds, getGrinv, getGrinvCC, getLock, getNode, getNodeCount, getNodeVector, getParent, getSSSR, indexOf, indexOf, isEmpty, isRealNodeParent, pack, regenEdges, removeEdge, removeEdge, removeNode, removeNode, resetCtab, resetGrinvInParents, setEdge, setNode, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Molecule

public Molecule(Molecule p,
                int na,
                int nb)
Construct a molecule or fragment with the specified number of atoms and bonds.

Parameters:
p - the molecule that contains the created fragment
na - no reallocation needed until the number of atoms is less than this value
nb - no reallocation needed until the number of bonds is less than this value

Molecule

public Molecule(Molecule p,
                MolAtom a)
Construct a graph consisting of a single vertex (atom).

Parameters:
p - the parent structure
a - the atom

Molecule

public Molecule(Molecule p,
                MolBond b)
Construct a graph consisting of a single edge (bond).

Parameters:
p - the parent structure
b - the bond

Molecule

public Molecule(Molecule p)
Construct a molecule or fragment.

Parameters:
p - the parent structure

Molecule

public Molecule()
Construct a molecule.

Method Detail

setDim

public void setDim(int d)
Sets the dimension.

Overrides:
setDim in class MoleculeGraph
Parameters:
d - 0, 2, or 3
See Also:
MoleculeGraph.flags

clear

public void clear()
Clears the molecule.

Overrides:
clear in class MoleculeGraph
See Also:
MoleculeGraph.clearForImport(java.lang.String), CGraph.nodes

clearForImport

public void clearForImport(java.lang.String format)
Initializes molecule for import.

Overrides:
clearForImport in class MoleculeGraph
Parameters:
format - input file format
Since:
2.7
See Also:
CGraph.edges, MoleculeGraph.orix, MoleculeGraph.oriy, MoleculeGraph.oriz, MoleculeGraph.flags

getStartPosition

public long getStartPosition()
Gets the starting position of this molecule in the input file.

Returns:
the starting position

setStartPosition

public void setStartPosition(long off)
Sets the starting position of this molecule in the input file.

Parameters:
off - the starting position

getEndPosition

public long getEndPosition()
Gets the end position of this molecule in the input file.

Returns:
the end position

setEndPosition

public void setEndPosition(long off)
Sets the end position of this molecule in the input file.

Parameters:
off - the end position

getName

public java.lang.String getName()
Gets the molecule name.

Returns:
the molecule name or an empty string
Since:
2.7

setName

public void setName(java.lang.String s)
Sets the molecule name.

Parameters:
s - the molecule name, empty string or null (null is equivalent to empty string)
Since:
2.7

getComment

public final java.lang.String getComment()
Gets the comment.

Returns:
the comment or empty string
Since:
2.9

setComment

public final void setComment(java.lang.String s)
Sets the comment.

Parameters:
s - the comment, empty string or null (null is equivalent to empty string)
Since:
2.9

getInputFormat

public final java.lang.String getInputFormat()
Gets the input file format. Set by the import module if the molecule is from a file.

Returns:
"mol", "csmol", "sdf", "cssdf", "rdf", "csrdf", "smiles", "sybyl", "pdb" or "xyz"
Since:
2.7

setInputFormat

public void setInputFormat(java.lang.String format)
Sets the input file format.

Parameters:
format - the input format
Since:
2.7
See Also:
getInputFormat()

clearProperties

public void clearProperties()
Clears RDfile/SDfile properties.


getPropertyCount

public int getPropertyCount()
Gets the total number of RDfile/SDfile properties.

Returns:
number of properties
Since:
2.7

getPropertyKeys

public java.util.Enumeration getPropertyKeys()
Gets the keys for the RDfile/SDfile properties.

Returns:
enumeration of keys (names)
Since:
2.7

getPropertyKey

public java.lang.String getPropertyKey(int n)
Gets an RDfile/SDfile property key.

Parameters:
n - property index
Returns:
the property name
Since:
2.7

getProperty

public java.lang.String getProperty(java.lang.String key)
Gets an RDfile/SDfile property.

Parameters:
key - property name
Returns:
the value of the property, or null if the key is not found

getPropertyObject

public java.lang.Object getPropertyObject(java.lang.String key)
Gets an RDfile/SDfile property object.

Parameters:
key - property name
Returns:
the value of the property, or null if the key is not found
Since:
3.1.2

setProperty

public void setProperty(java.lang.String key,
                        java.lang.String value)
Sets an RDfile/SDfile property. Setting null value removes the property.

Parameters:
key - the property name
value - the value or null

setPropertyObject

public void setPropertyObject(java.lang.String key,
                              java.lang.Object value)
Sets an RDfile/SDfile property object. Setting null value removes the property.

Parameters:
key - the property name
value - the value or null
Since:
3.1.2

residueTypeOf

public static int residueTypeOf(java.lang.String name)
Gets the residue identifier for a residue name.

Parameters:
name - residue name
Returns:
the residue type

residueSymbolOf

public static java.lang.String residueSymbolOf(int id)
Gets the name of a residue.

Parameters:
id - the residue identifier
Returns:
the residue symbol

setNode0

protected void setNode0(int i,
                        CNode node)
Sets the node at the specified index. Overridden because Sgroups must be set correctly in RgMolecule.clone() and RxnMolecule.clone().

Overrides:
setNode0 in class CGraph
Parameters:
i - the atom index
node - the atom

removeNode

protected void removeNode(CNode node,
                          int cleanupFlags)
Removes a node and its edges.

Overrides:
removeNode in class MoleculeGraph
Parameters:
node - the node
cleanupFlags - extra clean-up methods
Since:
3.1
See Also:
CGraph.RMCLEANUP_NONE, CGraph.RMCLEANUP_ALL, CGraph.RMCLEANUP_EDGES, MoleculeGraph.RMCLEANUP_STEREO

removeNode

protected void removeNode(int i,
                          int cleanupFlags)
Remove a node and its edges.

Overrides:
removeNode in class MoleculeGraph
Parameters:
i - the node index
cleanupFlags - extra clean-up methods
Since:
3.1
See Also:
CGraph.RMCLEANUP_NONE, CGraph.RMCLEANUP_ALL, CGraph.RMCLEANUP_EDGES, MoleculeGraph.RMCLEANUP_STEREO

removeEdge

protected void removeEdge(CEdge edge,
                          int cleanupFlags)
Removes an edge by reference.

Overrides:
removeEdge in class CGraph
Parameters:
edge - the edge
cleanupFlags - extra clean-up methods
Since:
3.1
See Also:
CGraph.RMCLEANUP_NONE, CGraph.RMCLEANUP_ALL, CGraph.RMCLEANUP_EDGES, MoleculeGraph.RMCLEANUP_STEREO

removeEdge

protected void removeEdge(int i,
                          int cleanupFlags)
Removes an edge.

Overrides:
removeEdge in class CGraph
Parameters:
i - the edge index
cleanupFlags - extra clean-up methods
Since:
3.1
See Also:
CGraph.RMCLEANUP_NONE, CGraph.RMCLEANUP_ALL, CGraph.RMCLEANUP_EDGES, MoleculeGraph.RMCLEANUP_STEREO

removeAllEdges

public void removeAllEdges()
Removes all edges.

Overrides:
removeAllEdges in class CGraph

removeAll

public void removeAll()
Removes all the nodes and edges.

Overrides:
removeAll in class CGraph

clonecopy

public void clonecopy(CGraph g)
Make another molecule identical to this one.

Overrides:
clonecopy in class MoleculeGraph
Parameters:
g - the target molecule

clonelesscopy

public void clonelesscopy(CGraph g)
Copy to selection. Make another molecule identical to this one, but do not clone atoms, bonds, and the properties.

Overrides:
clonelesscopy in class MoleculeGraph
Parameters:
g - the target molecule object (the selection)

clone

public java.lang.Object clone()
Make an identical copy of the molecule.

Overrides:
clone in class MoleculeGraph
Returns:
the copy

getImageSize

public chemaxon.marvin.util.MolImageSize getImageSize(java.lang.String fmt)
Gets size information of an image created with the specified format string. Examples:
 MolImageSize g1 = mol.getImageSize("image:scale24");
     // (g1.width, g2.width) is the bounding box size for an image created
     // with scaling factor 24
 MolImageSize g2 = mol.getImageSize("image:w100h100");
     // g2.scale is the maximum scaling factor for 100x100 image
 

Parameters:
fmt - format string that contains the image export options
Returns:
an object containing the image size and the scaling factor
Throws:
java.lang.IllegalArgumentException - Invalid format string.
java.lang.SecurityException - Export module cannot be loaded because of security reasons (firewall).
Since:
2.9.11
See Also:
toBinFormat(java.lang.String), toObject(java.lang.String)

toFormat

public final java.lang.String toFormat(java.lang.String fmt)
Creates a string representation of the molecule. The format descriptor string can also contain export options. Format and options are separated by a colon, multiple options can be separated by commas. See the text formats and their options on the File Formats in Marvin page. Examples:
 s1 = mol.toFormat("mol");
 s2 = mol.toFormat("smiles:a-H"); // aromatize and remove Hydrogens
 

Parameters:
fmt - the format descriptor string
Returns:
string representation of the molecule in the specified format
Throws:
java.lang.IllegalArgumentException - Invalid format string.
java.lang.SecurityException - Export module cannot be loaded because of security reasons (firewall).
See Also:
toObject(java.lang.String)

toBinFormat

public final byte[] toBinFormat(java.lang.String fmt)
Creates a binary representation of the molecule. Works with all the text formats that are supported by the toFormat method, and also with the binary image formats (jpeg, png, ppm). When creating an image, display options can also be specified in the format descriptor string. Format and options are separated by a colon, multiple options can be separated by commas. See the possible formats and their options on the File Formats in Marvin page. Examples:
 byte[] d1 = mol.toBinFormat("mol");
 byte[] d2 = mol.toBinFormat("smiles:a-H"); // aromatize and remove H
 byte[] d3 = mol.toBinFormat("ppm:w300,h300,#ffff00");
 byte[] d4 = mol.toBinFormat("png:w300,h300,b32,#00ffff00");
 byte[] d5 = mol.toBinFormat("jpeg:w300,h300,Q95,#ffff00,spacefill");
 

Parameters:
fmt - the format descriptor string
Returns:
a binary representation of the molecule in the specified format
Throws:
java.lang.IllegalArgumentException - Invalid format string.
java.lang.SecurityException - Export module cannot be loaded because of security reasons (firewall).
Since:
2.7.11
See Also:
toObject(java.lang.String), getImageSize(java.lang.String)

toObject

public java.lang.Object toObject(java.lang.String fmt)
Creates a String, byte[] array or Image representation of the molecule. When creating an image, display options can also be specified in the format descriptor string. Format and options are separated by a colon, multiple options can be separated by commas. See the possible formats and their options on the File Formats in Marvin page. Examples:
 import java.awt.Image;
 ...
 String s1 = (String)mol.toObject("mol");
 String s2 = (String)mol.toObject("smiles:a-H"); // aromatize, remove H
 Image img = (Image)mol.toObject("image:w300,h300,#ffff00");
 byte[] d3 = (byte[])mol.toObject("ppm:w300,h300,#ffff00");
 byte[] d4 = (byte[])mol.toObject("png:w300,h300,b32,#00ffff00");
 byte[] d5 = (byte[])mol.toObject("jpeg:w300,h300,Q95,#ffff00,spacefill");
 

Parameters:
fmt - the format descriptor string
Returns:
a String, a byte[] array or an Image
Throws:
java.lang.IllegalArgumentException - Invalid format string.
java.lang.SecurityException - Export module cannot be loaded because of security reasons (firewall).
Since:
2.8.1
See Also:
toFormat(java.lang.String), toBinFormat(java.lang.String), getImageSize(java.lang.String)

draw

public void draw(java.awt.Graphics g,
                 java.lang.String opts)
Draws the molecule into a graphics context.

Parameters:
g - the graphics context
opts - the export options
Throws:
java.lang.SecurityException - Export module cannot be loaded because of security reasons (firewall).
Since:
3.3
See Also:
toObject(java.lang.String)

reuseAtom

public MolAtom reuseAtom(int z,
                         int i)
Reuse an atom or create a new one. If an atom is reused, all its properties except the corners are initialized.

Parameters:
z - the atomic number
i - the atom index
Returns:
the atom reference
Since:
2.6

endReuse

public void endReuse(int n)
End reusing atoms.

Parameters:
n - number of atoms
Since:
2.6

newInstance

public CGraph newInstance()
Creates a new Molecule object. The dimension and the origin coordinates will be the same as in the original molecule.

Overrides:
newInstance in class MoleculeGraph
Returns:
a Molecule object

makeItSimilar

protected void makeItSimilar(CGraph g)
Copies some properties of this molecule to the other one specified as argument. Copies the input format.

Overrides:
makeItSimilar in class MoleculeGraph
Parameters:
g - the molecule to change

getSimplifiedMolecule

public Molecule getSimplifiedMolecule()
Gets the simplified molecule object. It returns this usually. In case of RgMolecule, it returns the root structure if there are no R-groups present.

Returns:
this
Since:
3.0.1

isReaction

public boolean isReaction()
Checks if the structure represents a reaction or not.

Returns:
false
Since:
3.0

isSgroup

public boolean isSgroup()
Checks if the structure represents an S-group or not.

Returns:
true if the structure is an S-group
Since:
3.0

getSgroupLigands

public MolAtom[] getSgroupLigands()
Gets the S-group's ligands if the structure represents an S-group.

Returns:
the array of ligands if the structure is an S-group with ligands, null otherwise
Since:
3.0

findExpandableSgroup

public final Sgroup findExpandableSgroup()
Finds a contracted residue.

Returns:
the S-group if found, null if all S-groups are expanded
Since:
3.0

findContractableSgroup

public final Sgroup findContractableSgroup()
Finds an expanded residue.

Returns:
the S-group if found, null if all S-groups are contracted
Since:
3.0

getSgroupArray

public final Sgroup[] getSgroupArray()
Gets the array of S-groups.

Returns:
an array containing all the S-groups
Since:
3.0

getSgroupCount

public final int getSgroupCount()
Gets the number of S-groups.

Returns:
the number of S-groups
Since:
3.0

getSgroup

public final Sgroup getSgroup(int i)
Gets an S-group.

Parameters:
i - S-group index
Since:
3.0

indexOf

public final int indexOf(Sgroup sg)
Gets the array index of an S-group.

Parameters:
sg - the S-group
Since:
3.0

findSgroupOf

public final Sgroup findSgroupOf(MolAtom a)
Finds the S-group related to the specified node.

Parameters:
a - the node
Returns:
the S-group or null if not found
Since:
3.0

findSgroupContaining

public final Sgroup findSgroupContaining(MolAtom a)
Finds the S-group that contains the specified node.

Parameters:
a - the node
Returns:
the S-group or null if not found
Since:
3.0

setSgroupParent

public void setSgroupParent(MolAtom a,
                            Sgroup sg,
                            boolean set)
Sets or unsets an S-group as a parent of an atom.

Parameters:
a - the atom
sg - the S-group
set - set (true) or unset (false)
Throws:
java.lang.IllegalArgumentException - molecule does not contain the atom
Since:
3.0

reparentSgroups

protected final void reparentSgroups(Molecule p)
Change parents of all S-groups in this molecule.

Parameters:
p - the new parent
Throws:
java.lang.IllegalArgumentException - molecule does not contain the atom
Since:
3.0

mergeNodes

public void mergeNodes(CNode that,
                       CNode node)
Merges bonds of an atom with another atom, then add the atom to the molecule.

Overrides:
mergeNodes in class CGraph
Parameters:
that - the atom
node - the other atom

addNode0

protected void addNode0(CNode node)
Adds a node.

Overrides:
addNode0 in class CGraph
Parameters:
node - the node reference

contractSgroups

public final boolean contractSgroups()
Contracts all S-groups.

Returns:
true if the operation was successful, false if nothing changed
Since:
3.0
See Also:
Expandable.contract(int), Expandable.DEFAULT_OPTIONS

expandSgroups

public final boolean expandSgroups(int opts)
Expands all S-groups.

Parameters:
opts - expansion options
Returns:
true if the operation was successful, false if nothing changed
Since:
3.3
See Also:
Expandable.expand(int), Expandable.DEFAULT_OPTIONS, Expandable.MDL_EXPAND

expandSgroups

public final boolean expandSgroups()
Expands all S-groups.

Returns:
true if the operation was successful, false if nothing changed
Since:
3.0
See Also:
expandSgroups(int)

ungroupSgroups

public final boolean ungroupSgroups()
Expand and ungroup all S-groups.

Returns:
true if the operation was successful, false if nothing changed
Since:
3.0

addSgroupsOf

protected final void addSgroupsOf(Molecule m)
Adds S-groups to this object and its parent.


removeSgroupsOf

protected final void removeSgroupsOf(Molecule m)
Removes S-groups from this object and its parent.


removeAllSgroups

protected void removeAllSgroups()
Removes all S-groups.


getGraphUnionAsSelection

protected final SelectionMolecule getGraphUnionAsSelection()
Gets a selection molecule containing all the atoms and bonds. Returns the same object until the unified structure is (or might be) changed, then recreates it.

Returns:
a selection molecule object containing the unified structure
Since:
3.0, 11/05/2002
See Also:
SelectionMolecule

bondlength

public double bondlength()
Calculate the regular bond length for the unified structure.

Overrides:
bondlength in class MoleculeGraph
Returns:
the regular bond length

convertToFrags

public final Molecule[] convertToFrags()
Converts this molecule to its disconnected fragments.

Warning: Atoms are removed from the original molecule object to the created fragments, therefore the original molecule becomes inconsistent.

The original node order is preserved in the returned fragments. Fragment order is also determined by the original node order. The first fragment is the one containing node 0, the second fragment is the one containing the smallest indexed node not in the first fragment, etc.

Returns:
array of fragments
Since:
3.1

findFrags

public final SelectionMolecule[] findFrags()
Determines the disconnected fragments and puts them into an array.

The original node order is preserved in the returned fragments. Fragment order is also determined by the original node order. The first fragment is the one containing node 0, the second fragment is the one containing the smallest indexed node not in the first fragment, etc.

Returns:
array of fragments
Since:
3.0

fillSelectionMolecule

protected void fillSelectionMolecule(SelectionMolecule s)
Adds all atoms and bonds to the specified molecule.

Parameters:
s - the selection molecule
Since:
3.0, 11/05/2002

clearCalcResults

public void clearCalcResults()