chemaxon.struc
Class RgMolecule

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

public class RgMolecule
extends Molecule

A molecule or reaction containing R-groups.

Since:
2.6
Version:
3.3, 12/25/2003
Author:
Peter Csizmadia
See Also:
Serialized Form

Field Summary
static int RG_ID_MASK
          R-group id mask in R-logic.
static int RG_ID2_MASK
          Mask of the other R-group's id in R-logic.
static int RG_ID2_OFF
          Offset of the other R-group's id in R-logic.
static int RG_RESTH
          The RestH flag in R-logic.
 
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
RgMolecule()
          Creates an RgMolecule.
 
Method Summary
 void add(CEdge edge)
          Adds a bond to the root structure.
 void add(CNode node)
          Adds an atom to the root structure.
 int addRgroup(int rgid, Molecule m)
          Adds an R-group member.
 RgMolecule addRgroupsTo(Molecule m)
          Creates a read only RgMolecule from a simple molecule object.
 void clearForImport(java.lang.String fmt)
          Clear the edges vector and the properties.
 void clearProperties()
          Clears RDfile/SDfile properties in the root structure.
 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 contains(java.lang.Object o)
          Checks if the root structure or an R-group contains the specified node or edge.
static Molecule createMol(java.lang.String fmt)
          Create molecule object for the specified input file format.
 void endReuse(int n)
          End reusing atoms.
protected  void fillSelectionMolecule(SelectionMolecule s)
          Adds all atoms and bonds of the root structure and the R-groups to the specified molecule.
 int findRgroupIndex(int rgroup)
          Finds R-group R#.
 void fuse(CGraph graph)
          Add the atoms and bonds of another molecule.
protected  void fuse0(CGraph graph)
          Add those nodes and edges of a graph that are not already elements.
 int[][] getBtab()
          Gets the bond table of the root structre.
 int[][] getCtab()
          Gets the connection table of the root structure.
 CEdge getEdge(int i)
          Gets an edge of the root structure.
 int getEdgeCount()
          Gets the number of edges.
 java.lang.String getFormula()
          Gets the molecular formula in Hill order.
 MoleculeGraph getGraphUnion()
          Gets a graph containing all the atoms and bonds.
protected  int[] getGrinv()
          Gets the graph invariants of the root structure.
 int getGrinv(int[] gi)
          Gets the graph invariants of the root structure.
 double getMass()
          Calculates the molecular weight of the molecule.
 java.lang.String getName()
          Gets the name of the root molecule.
 CNode getNode(int i)
          Gets a node of the root structure.
 int getNodeCount()
          Gets the number of nodes in the root structure.
 java.lang.String getProperty(java.lang.String key)
          Gets an RDfile/SDfile property in the root structure.
 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 in the root structure.
 int getRgroupCount()
          Gets the number of R-groups.
 int getRgroupId(int i)
          Gets the id of an R-group.
 Molecule getRgroupMember(int i, int j)
          Gets an R-group member.
 int getRgroupMemberCount(int i)
          Gets the number of R-group members.
 int getRlogic(int i)
          Gets R-logic flags.
 java.lang.String getRlogicRange(int i)
          Gets R-logic occurence range.
 Molecule getRoot()
          Gets the root structure.
 Molecule getSimplifiedMolecule()
          Gets the simplified molecule object.
 void implicitizeHydrogens(int f)
          Removes explicit bound Hydrogens from the graph and converts them to implicit.
 int indexOf(CEdge edge)
          Gets the index of the specified edge.
 int indexOf(CNode node)
          Gets the index of the specified node.
 boolean isAtom()
          Determines whether the structure represents only one atom and an arbitrary number of bonds.
 boolean isBond()
          Determines whether the structure represents only one bond and zero or two atoms.
 boolean isEmpty()
          Ask if the molecule is empty or not.
 boolean isIncompleteReaction()
          Check whether the reaction is incomplete or not.
 boolean isReaction()
          Checks if the structure represents a reaction or not.
protected  boolean isRealNodeParent()
          R-group molecule objects cannot be real node parents.
 void mergeNodes(CNode that, CNode a)
          Merges bonds of an atom with another atom, then add the atom to the molecule.
 CGraph newInstance()
          Creates a new RgMolecule object.
 void regenEdges()
          Regenerate the edge vectors: remove their elements, then put the edge objects from the nodes into it.
 void removeAll()
          Remove all the atoms and bonds from the root structure, and from all the R-groups.
 void removeAllEdges()
          Remove all bonds from the root structure, and from all the R-groups.
protected  void removeEdge(CEdge edge, int cleanupFlags)
          Remove a bond from the root structure, and from all the R-groups.
protected  void removeEdge(int i, int cleanupFlags)
          Remove a bond from the root structure.
protected  void removeNode(CNode node, int cleanupFlags)
          Removes an atom and its bonds from the root structure and from all the R-groups.
protected  void removeNode(int i, int cleanupFlags)
          Removes an atom and its bonds from the root structure.
 MolAtom reuseAtom(int z, int i)
          Reuse an atom or create a new one.
 int rgroupIdOf(CNode node)
          Finds the ID of the R-group (the number in R#) that contains the specified atom.
 int rgroupIndexOf(CNode node)
          Finds the index of the R-group (the number in R#) that contains the specified atom.
 void setAbsStereo(boolean c)
          Sets the absolute stereoconfiguration flag for the root structure and the R-groups.
 void setDim(int d)
          Sets the dimension of the root structure and the R-groups.
 void setEdge(int i, CEdge edge)
          Sets the edge at the specified index.
 void setInputFormat(java.lang.String format)
          Sets the input file format.
 void setLocation(DPoint3 p)
          Set the origin of the molecule.
 void setName(java.lang.String s)
          Sets the name of the root molecule.
 void setNode(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 in the root structure.
 void setPropertyObject(java.lang.String key, java.lang.Object value)
          Sets an RDfile/SDfile property in the root structure.
 void setRlogic(int i, int f)
          Sets R-logic flags.
 void setRlogicRange(int index, java.lang.String range)
          Sets R-logic occurence range.
 void setRoot(Molecule mol)
          Sets the root structure.
 void setSgroupParent(MolAtom a, Sgroup sg, boolean set)
          Sets or unsets an S-group as a parent of an atom in the root structure or an R-group.
protected  void transform(CTransform3D t, boolean incg)
          Apply a transformation matrix to the atomic coordinates.
 
Methods inherited from class chemaxon.struc.Molecule
addNode0, addSgroupsOf, bondlength, clear, clearCalcResults, contractSgroups, convertToFrags, draw, expandSgroups, expandSgroups, findContractableSgroup, findExpandableSgroup, findFrags, findSgroupContaining, findSgroupOf, getComment, getEndPosition, getGraphUnionAsSelection, getImageSize, getInputFormat, getSgroup, getSgroupArray, getSgroupCount, getSgroupLigands, getStartPosition, indexOf, isSgroup, makeItSimilar, removeAllSgroups, removeSgroupsOf, reparentSgroups, residueSymbolOf, residueTypeOf, setComment, setEndPosition, setNode0, setStartPosition, toBinFormat, toFormat, toObject, ungroupSgroups
 
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, getGrinv, getImplicitHcount, getLocation, getNonAromrings, getNonAromrings, getParity, getPoints, getSSSRBondSet, getStereo2, getStereo2, getStereo2, getStereo2, getStereo2, getStereo2, getStereo2, hasImplicitH, hydrogenize, isAbsStereo, isMultiChiral, isRingBond, moveTo, qpropCheck, setChirality, setParity, setParity, setSetSeqs, stereoClean, transform, valenceCheck, valenceCheck
 
Methods inherited from class chemaxon.struc.CGraph
addEdge0, addEdgeWithoutChangingIt, addNodeWithoutChangingIt, findFrag, findFrags, getEdgeVector, getForefather, getFragCount, getFragIds, getGrinvCC, getLock, getNodeVector, getParent, getSSSR, pack, removeEdge, removeEdge, removeNode, removeNode, resetCtab, resetGrinvInParents, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RG_ID_MASK

public static final int RG_ID_MASK
R-group id mask in R-logic.

See Also:
getRlogic(int), setRlogic(int, int), Constant Field Values

RG_ID2_OFF

public static final int RG_ID2_OFF
Offset of the other R-group's id in R-logic.

See Also:
getRlogic(int), setRlogic(int, int), Constant Field Values

RG_ID2_MASK

public static final int RG_ID2_MASK
Mask of the other R-group's id in R-logic.

See Also:
getRlogic(int), setRlogic(int, int), Constant Field Values

RG_RESTH

public static final int RG_RESTH
The RestH flag in R-logic.

See Also:
getRlogic(int), setRlogic(int, int), Constant Field Values
Constructor Detail

RgMolecule

public RgMolecule()
Creates an RgMolecule.

Method Detail

setRoot

public void setRoot(Molecule mol)
Sets the root structure.

Parameters:
mol - the root structure

getRoot

public Molecule getRoot()
Gets the root structure.

Returns:
the root

getRgroupCount

public int getRgroupCount()
Gets the number of R-groups.

Returns:
number of R-groups

getRgroupId

public int getRgroupId(int i)
Gets the id of an R-group.

Parameters:
i - R-group index
Returns:
number between 1 and 32, or -1 if not found

findRgroupIndex

public int findRgroupIndex(int rgroup)
Finds R-group R#.

Parameters:
rgroup - number between 1 and 32
Returns:
R-group index, or -1 if not found

getRgroupMemberCount

public int getRgroupMemberCount(int i)
Gets the number of R-group members.

Parameters:
i - R-group index
Returns:
number of R-group members

getRgroupMember

public Molecule getRgroupMember(int i,
                                int j)
Gets an R-group member.

Parameters:
i - R-group index
j - member index
Returns:
the R-group member

addRgroup

public int addRgroup(int rgid,
                     Molecule m)
Adds an R-group member.

Parameters:
rgid - number between 1 and 32
m - the R-group
Returns:
the Rgroup index

getRlogic

public int getRlogic(int i)
Gets R-logic flags.

Parameters:
i - R-group index
Returns:
number between 1 and 32, or -1 if not found

setRlogic

public void setRlogic(int i,
                      int f)
Sets R-logic flags.

Parameters:
i - R-group index
f - R-logic flags

getRlogicRange

public java.lang.String getRlogicRange(int i)
Gets R-logic occurence range.

Parameters:
i - R-group index
Returns:
the occurence range

setRlogicRange

public void setRlogicRange(int index,
                           java.lang.String range)
                    throws java.lang.IllegalArgumentException
Sets R-logic occurence range.

Parameters:
index - R-group index
range - range of occurance
Throws:
java.lang.IllegalArgumentException - bad occurence range

clearForImport

public void clearForImport(java.lang.String fmt)
Clear the edges vector and the properties.

Overrides:
clearForImport in class Molecule
Parameters:
fmt - input file format

setName

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

Overrides:
setName in class Molecule
Parameters:
s - the molecule name, empty string or null (null is equivalent to empty string)

getName

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

Overrides:
getName in class Molecule
Returns:
the molecule name or an empty string

setInputFormat

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

Overrides:
setInputFormat in class Molecule
Parameters:
format - the input format
See Also:
Molecule.getInputFormat()

clearProperties

public void clearProperties()
Clears RDfile/SDfile properties in the root structure.

Overrides:
clearProperties in class Molecule

getPropertyCount

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

Overrides:
getPropertyCount in class Molecule
Returns:
number of properties

getPropertyKeys

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

Overrides:
getPropertyKeys in class Molecule
Returns:
enumeration of keys (names)

getPropertyKey

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

Overrides:
getPropertyKey in class Molecule
Parameters:
n - property index
Returns:
the property name

getProperty

public java.lang.String getProperty(java.lang.String key)
Gets an RDfile/SDfile property in the root structure.

Overrides:
getProperty in class Molecule
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 in the root structure.

Overrides:
getPropertyObject in class Molecule
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 in the root structure. Setting null value removes the property.

Overrides:
setProperty in class Molecule
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 in the root structure. Setting null value removes the property.

Overrides:
setPropertyObject in class Molecule
Parameters:
key - the property name
value - the value or null
Since:
3.1.2

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.

Overrides:
reuseAtom in class Molecule
Parameters:
z - atomic number
i - atom index
Returns:
the new or old atom

endReuse

public void endReuse(int n)
End reusing atoms.

Overrides:
endReuse in class Molecule
Parameters:
n - number of atoms
Since:
2.6

getCtab

public int[][] getCtab()
Gets the connection table of the root structure. If there is no connection table for the molecule, then create it. ctab[i][j] will be the index of the jth neighbor of the ith atom.

Overrides:
getCtab in class CGraph
Returns:
the ctab array

getBtab

public int[][] getBtab()
Gets the bond table of the root structre. If there is no bond table for the molecule, then create it. btab[i][j] will be the index of the bond between atoms i and j, or -1 if there is no bond.

Overrides:
getBtab in class CGraph
Returns:
the btab array

getGrinv

public int getGrinv(int[] gi)
Gets the graph invariants of the root structure.

Overrides:
getGrinv in class MoleculeGraph
Parameters:
gi - the output array
Returns:
zero

getGrinv

protected int[] getGrinv()
Gets the graph invariants of the root structure.

Overrides:
getGrinv in class CGraph
Returns:
the graph invariants array

rgroupIdOf

public int rgroupIdOf(CNode node)
Finds the ID of the R-group (the number in R#) that contains the specified atom.

Parameters:
node - the atom
Returns:
the R-group ID if found or -1 if not found

rgroupIndexOf

public int rgroupIndexOf(CNode node)
Finds the index of the R-group (the number in R#) that contains the specified atom.

Parameters:
node - the atom
Returns:
the R-group index if found or -1 if not found

setDim

public void setDim(int d)
Sets the dimension of the root structure and the R-groups.

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

setAbsStereo

public void setAbsStereo(boolean c)
Sets the absolute stereoconfiguration flag for the root structure and the R-groups.

Overrides:
setAbsStereo in class MoleculeGraph
Parameters:
c - the absolute stereoconfiguration flag
See Also:
MoleculeGraph.flags

getNodeCount

public int getNodeCount()
Gets the number of nodes in the root structure.

Overrides:
getNodeCount in class CGraph
Returns:
number of nodes

getNode

public CNode getNode(int i)
Gets a node of the root structure.

Overrides:
getNode in class CGraph
Parameters:
i - node index
Returns:
the node object

setNode

public void setNode(int i,
                    CNode node)
Sets the node at the specified index.

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

add

public void add(CNode node)
Adds an atom to the root structure.

Overrides:
add in class CGraph
Parameters:
node - the atom

getEdgeCount

public int getEdgeCount()
Description copied from class: CGraph
Gets the number of edges.

Overrides:
getEdgeCount in class CGraph
Returns:
number of edges

getEdge

public CEdge getEdge(int i)
Gets an edge of the root structure.

Overrides:
getEdge in class CGraph
Parameters:
i - edge index
Returns:
the edge object

setEdge

public void setEdge(int i,
                    CEdge edge)
Sets the edge at the specified index.

Overrides:
setEdge in class CGraph
Parameters:
i - the bond index
edge - the bond

add

public void add(CEdge edge)
Adds a bond to the root structure.

Overrides:
add in class CGraph
Parameters:
edge - the bond to add

indexOf

public int indexOf(CNode node)
Gets the index of the specified node.

Overrides:
indexOf in class CGraph
Parameters:
node - the node
Returns:
the index, or -1 if not found

indexOf

public int indexOf(CEdge edge)
Gets the index of the specified edge.

Overrides:
indexOf in class CGraph
Parameters:
edge - the edge
Returns:
the index, or -1 if not found

contains

public boolean contains(java.lang.Object o)
Checks if the root structure or an R-group contains the specified node or edge.

Overrides:
contains in class CGraph
Parameters:
o - the node or edge object
Returns:
true if the graph contains the object, false otherwise

isEmpty

public boolean isEmpty()
Ask if the molecule is empty or not.

Overrides:
isEmpty in class CGraph
Returns:
true if the graph does not contain any nodes or edges.

isAtom

public boolean isAtom()
Determines whether the structure represents only one atom and an arbitrary number of bonds.

Overrides:
isAtom in class MoleculeGraph
Returns:
true the root structure represents an atom and there are no R-groups, false otherwise

isBond

public boolean isBond()
Determines whether the structure represents only one bond and zero or two atoms. Determines whether the structure represents only one atom and an arbitrary number of bonds.

Overrides:
isBond in class MoleculeGraph
Returns:
true the root structure represents a bond and there are no R-groups, false otherwise

isReaction

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

Overrides:
isReaction in class Molecule
Returns:
true if the root structure is a reaction
Since:
3.0

getSimplifiedMolecule

public Molecule getSimplifiedMolecule()
Gets the simplified molecule object.

Overrides:
getSimplifiedMolecule in class Molecule
Returns:
the root structure if there are no R-groups present, this otherwise
Since:
3.0.1

addRgroupsTo

public RgMolecule addRgroupsTo(Molecule m)
Creates a read only RgMolecule from a simple molecule object.

Parameters:
m - the simple molecule object
Returns:
RgMolecule containing R-groups from this object and the specified molecule as root
Since:
3.1

removeNode

protected void removeNode(CNode node,
                          int cleanupFlags)
Removes an atom and its bonds from the root structure and from all the R-groups.

Overrides:
removeNode in class Molecule
Parameters:
node - the atom
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)
Removes an atom and its bonds from the root structure.

Overrides:
removeNode in class Molecule
Parameters:
i - the atom 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)
Remove a bond from the root structure, and from all the R-groups.

Overrides:
removeEdge in class Molecule
Parameters:
edge - the bond
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)
Remove a bond from the root structure.

Overrides:
removeEdge in class Molecule
Parameters:
i - the bond 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()
Remove all bonds from the root structure, and from all the R-groups.

Overrides:
removeAllEdges in class Molecule

removeAll

public void removeAll()
Remove all the atoms and bonds from the root structure, and from all the R-groups.

Overrides:
removeAll in class Molecule

isRealNodeParent

protected boolean isRealNodeParent()
R-group molecule objects cannot be real node parents.

Overrides:
isRealNodeParent in class CGraph
Returns:
false
Since:
3.0

regenEdges

public void regenEdges()
Regenerate the edge vectors: remove their elements, then put the edge objects from the nodes into it.

Overrides:
regenEdges in class CGraph

setLocation

public void setLocation(DPoint3 p)
Set the origin of the molecule. The MolAtom coordinates are relative to this origin.

Overrides:
setLocation in class MoleculeGraph
Parameters:
p - the location
See Also:
MoleculeGraph.orix

fuse

public void fuse(CGraph graph)
Add the atoms and bonds of another molecule.

Overrides:
fuse in class CGraph
Parameters:
graph - the other molecule

fuse0

protected void fuse0(CGraph graph)
Add those nodes and edges of a graph that are not already elements. If the graph is a reaction and the root structure is not a reaction then the root structure will become a reaction determined by the reaction arrow corresponding to the graph. For each connected component of the graph checks if it contains an atom connected to an RGgroup in this RgMolecule; if yes then also adds the component to that RGroup, otherwise adds it to the root structure.

Overrides:
fuse0 in class CGraph
Parameters:
graph - the graph that will be fused into this molecule

mergeNodes

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

Overrides:
mergeNodes in class Molecule
Parameters:
that - the atom
a - the other atom

setSgroupParent

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

Overrides:
setSgroupParent in class Molecule
Parameters:
a - the atom
sg - the S-group
set - set (true) or unset (false)
Throws:
java.lang.IllegalArgumentException - if neither root, nor any R-group contains the atom
Since:
3.0

clonecopy

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

Overrides:
clonecopy in class Molecule
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 props.

Overrides:
clonelesscopy in class Molecule
Parameters:
g - the target molecule

clone

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

Overrides:
clone in class Molecule
Returns:
the copy

getFormula

public java.lang.String getFormula()
Gets the molecular formula in Hill order.

Overrides:
getFormula in class MoleculeGraph
Returns:
the formula

getMass

public double getMass()
Calculates the molecular weight of the molecule. Returns 0 if the molecule contains R-group or reaction

Overrides:
getMass in class MoleculeGraph

newInstance

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

Overrides:
newInstance in class Molecule
Returns:
an RgMolecule object

isIncompleteReaction

public boolean isIncompleteReaction()
Check whether the reaction is incomplete or not.

Returns:
true if something is missing, false if it seems to be okay
Since:
2.9

transform

protected void transform(CTransform3D t,
                         boolean incg)
Apply a transformation matrix to the atomic coordinates.

Overrides:
transform in class MoleculeGraph
Parameters:
t - the transformation matrix
incg - increase grinvCC or not

createMol

public static Molecule createMol(java.lang.String fmt)
Create molecule object for the specified input file format.

Parameters:
fmt - the file format
Returns:
a Molecule, RgMolecule or RxnMolecule object

getGraphUnion

public MoleculeGraph getGraphUnion()
Gets a graph containing all the atoms and bonds.

Overrides:
getGraphUnion in class MoleculeGraph
Returns:
root.getGraphUnion() if there are no R-groups, getGraphUnionAsSelection() otherwise
Since:
3.0, 11/11/2002
See Also:
Molecule.getGraphUnionAsSelection()

fillSelectionMolecule

protected void fillSelectionMolecule(SelectionMolecule s)
Adds all atoms and bonds of the root structure and the R-groups to the specified molecule.

Overrides:
fillSelectionMolecule in class Molecule
Parameters:
s - the selection molecule
Since:
3.0, 11/05/2002

implicitizeHydrogens

public void implicitizeHydrogens(int f)
Removes explicit bound Hydrogens from the graph and converts them to implicit. Only those explicit H atoms are converted for which MolAtom.isImplicitizableH(int) returns true.

Overrides:
implicitizeHydrogens in class MoleculeGraph
Parameters:
f - flags specifying special H atom types to include
Since:
3.1
See Also:
MolAtom.LONELY_H, MolAtom.ISOTOPE_H, MolAtom.CHARGED_H, MolAtom.RADICAL_H, MolAtom.MAPPED_H