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, MTransformable, chemaxon.struc.ReadableMolecule, chemaxon.struc.RgMoleculeGraphIface, java.io.Serializable, StereoConstants

public class RgMolecule
extends Molecule
implements chemaxon.struc.RgMoleculeGraphIface

A molecule or reaction containing R-groups.

Since:
Marvin 2.6
Version:
4.1.2, 09/20/2006
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_FLAG
          Other R-group ID's presence flag 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.Molecule
RMCLEANUP_FROMSGROUPS, RMCLEANUP_SGROUPATOMS
 
Fields inherited from class chemaxon.struc.MoleculeGraph
AROM_BASIC, AROM_CHEMAXON, AROM_DAYLIGHT, AROM_GENERAL, CACHE_REMOVE_AROMATAMODULE, CACHE_REMOVE_GRINVMODULE, CACHE_REMOVE_PARITYMODULE, CACHE_REMOVE_SSSRMODULE, DIM_MASK, flags, GRINV_DONT_STORE, GRINV_NOHYDROGEN, GRINV_OLDSTEREO, GRINV_STEREO, GRINV_VALUE_OPTIONS, INVALID_LINKNODE_MESSAGE, isMultiChiral, MIN_RING_SIZE_FOR_TRANS_DB, orix, oriy, oriz, propertyContainer, RMCLEANUP_MOBJECT, RMCLEANUP_STEREO
 
Fields inherited from class chemaxon.struc.CGraph
btab, CACHE_REMOVE_ALL, CACHE_REMOVE_CACHEMEMORY, cacheMemory, ctab, edgeCount, edges, fragIds, grinv, grinvCC, grinvOptions, INITIAL_CAPACITY, nFrags, nGrinv, nodeCount, nodes, parentGraph, RMCLEANUP_ALL, RMCLEANUP_EDGES, RMCLEANUP_NONE, sssr, sssrl2idx, superGraph
 
Fields inherited from interface chemaxon.struc.ReadableMolecule
HS_S, HS_SP, HS_SP2, HS_SP3, HS_UNKNOWN
 
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 rl, Molecule m)
          Adds an R-group member.
 RgMolecule addRgroupsTo(Molecule m)
          Creates a read only RgMolecule from a simple molecule object.
 void aromatize(int method)
          Aromatize molecule.
 java.lang.String checkRlogicRange(int index, java.lang.String range)
          Checks an R-logic occurence range string for syntax errors and returns a "normalized" string.
 void cleanupRemovedRgroupMember(MoleculeGraph m, int f)
          Clean-up after R-group removal.
 void clearForImport(java.lang.String fmt)
          Clear the edges vector and the properties.
 void clonecopy(CGraph g)
          Make another molecule identical to this one.
 void clonelesscopy(CGraph g)
          Copy to selection.
 Molecule cloneMolecule()
          Make an identical copy of the molecule.
 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)
          Deprecated. As of Marvin 3.4, MolImportIface.createMol() must be used.
 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 rgid)
          Finds R-group R#.
 void fuse(CGraph g)
          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.
protected  MDocument getDocumentForChild(MoleculeGraph g)
          Gets the parent document for a child graph.
 CEdge getEdge(int i)
          Gets an edge in the graph union.
 int getEdgeCount()
          Gets the number of edges in the root structure.
 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.
 int getGrinv(int[] gi, int options)
          Gets the graph invariants (canonical labels).
 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 in the graph union.
 int getNodeCount()
          Gets the number of nodes in the root structure.
 int getRgroupCount()
          Gets the number of R-groups.
 int getRgroupId(int i)
          Gets the ID of an R-group.
 int getRgroupIndex(long id)
          Gets the R-group index from the R-group member ID.
 Molecule getRgroupMember(int i, int j)
          Gets an R-group member.
 int getRgroupMemberCount(int i)
          Gets the number of R-group members.
 MoleculeGraph getRgroupMemberG(int i, int j)
          Gets an R-group member.
 long getRgroupMemberID(CNode node)
          Gets the unique indentifier of the R-group member that contains the specified atom.
 int getRgroupMemberIndex(long id)
          Gets the R-group member index from the R-group member ID.
 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.
 MoleculeGraph getRootG()
          Gets the root structure.
 Molecule getSimplifiedMolecule()
          Gets the simplified molecule object.
protected  int getSubGraphCount()
          Gets the number of all "submolecules".
protected  void getSubGraphs(MoleculeGraph[] arr, int off)
          Gets all "submolecules".
 boolean hasAtomSet()
          Tests whether the molecule graph has atom sets.
 boolean hasBondSet()
          Tests whether the molecule graph has atom sets.
 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 in the graph union.
 int indexOf(CNode node)
          Gets the index of the specified node in the graph union.
protected  void insertNullEdges(int i, int count)
          Insert nulls into the bond array.
protected  void insertNullNodes(int i, int count)
          Insert nulls into the atom array.
 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 isQuery()
          Indicates if the molecule has query features.
 boolean isReaction()
          Checks if the structure represents a reaction or not.
protected  boolean isRealNodeParent()
          R-group molecule objects cannot be real node parents.
protected  void makeItSimilar(CGraph g)
          Copies some properties of this molecule to the other one specified as argument.
 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.
 SelectionMolecule newSelectionMolecule()
          Creates a new SelectionMolecule object appropriate for storing selection from this molecule.
protected  void postClean()
          Operations performed after cleaning.
 MPropertyContainer properties()
          Gets the property container.
 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.
 void removeNode(CNode node, int cleanupFlags)
          Removes an atom and its bonds from the root structure and from all the R-groups.
 void removeNode(int i, int cleanupFlags)
          Removes an atom and its bonds from the root structure.
 void replaceAtomsWithNewRgroup(SelectionMolecule sel, int rgid)
          Replaces selected atoms with a new R-group.
 void replaceEdge(CEdge olde, CEdge newe)
          Replaces an edge by another one.
 MolAtom reuseAtom(int z, int i)
          Reuse an atom or create a new one.
 void revalidateCoordDependentProps()
          Revalidate coordinate dependent properties.
 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 setAbsStereo(boolean c, int i, int j)
          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 iu, CEdge edge)
          Sets the edge at the specified index in the graph union.
 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 iu, CNode node)
          Sets the node at the specified index in the graph union.
 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.
 void sortEdgesAccordingTo(CEdge[] order)
          Sort edges in the same order as they appear in the specified array.
 java.lang.String toString()
          Overrides Object.toString() to ease debugging.
 void transform(CTransform3D t, boolean incg)
          Apply a transformation matrix to the atomic coordinates.
 
Methods inherited from class chemaxon.struc.Molecule
addNode0, addSgroupClones, addSgroupsOf, bondlength, clean, cleanSgroups, clear, clearExtraLabels, clearProperties, clone, clonecopyWithoutSgroups, cloneMoleculeWithDocument, contractSgroups, convertToFrags, dearomatize, draw, expandSgroups, expandSgroups, exportToBinFormat, exportToFormat, exportToObject, findContractableSgroup, findExpandableSgroup, findFrags, findFrags, findSgroupContaining, findSgroupOf, findSmallestSgroupContaining, getComment, getEndPosition, getGraphUnionAsSelection, getImageSize, getInputFormat, getOrderedComponentSgroupCount, getProperty, getPropertyCount, getPropertyKey, getPropertyKeys, getPropertyObject, getSgroup, getSgroupArray, getSgroupCount, getSgroupLigands, getSortedSgroups, getStartPosition, getVisibleCoords, indexOf, isExpandable, isGUIContracted, isSgroup, removeAllSgroups, removeSgroupFromList, removeSgroupsOf, reparentSgroups, residueSymbolOf, residueTypeOf, setComment, setEndPosition, setGUIContracted, setNode0, setProperty, setPropertyObject, setStartPosition, toBinFormat, toFormat, toObject, ungroupSgroup, ungroupSgroup, ungroupSgroups
 
Methods inherited from class chemaxon.struc.MoleculeGraph
addAtomsAndBondsTo, addExplicitLonePairs, adjustMultiChiralFlag, aromatize, aromatize, arrangeComponents, calcCenter, calcCenter, calcDehydrogenizedGrinv, calcHeight, calcHybridization, calcOutRect, calcOutRect, calcOutRectCenter, calcOutRectCenter, calcWidth, canBeCT, canBeCT, clean, clearCachedInfo, contains, createBHtab, createCHtab, createDehydrogenizedReadOnlyGraph, findAtomClone, getAromaticAndAliphaticRings, getAromrings, getAromrings, getAtom, getAtomArray, getAtomCount, getBond, getBondArray, getBondCount, getCharge, getChirality, getDesiredLength, getDesiredLength, getDim, getDocument, getEdgeArray, getEdgeVector, getExactMass, getExplicitHcount, getGrinv, getHybridizationState, getImplicitHcount, getLocalChirality, getLocalParity, getLocation, getLonePairCount, getMassno, getNeighbor, getNeighborCount, getNodeVector, getNonAromrings, getNonAromrings, getParentDocument, getParity, getPoints, getRadical, getSSSRBondSet, getSSSRBondSetInLong, getStereo2, getStereo2, getStereo2, getStereo2, getStereo2, getStereo2, getStereo2, getSubGraphs, hasExplicitLonePairs, hasExtraLabelSet, hasImplicitH, hasValenceError, hydrogenize, isAbsStereo, isMultiChiral, isRingBond, isSimilarTo, isValidLinkNode, moveTo, partialClean, qpropCheck, removeExplicitLonePairs, restoreCache, saveCache, setAtomSetSeqs, setBondSetSeqs, setChirality, setLinkNodeDefaultOuters, setParity, setParity, setParity, setSetSeqs, stereoClean, transform, updateDim, valenceCheck, valenceCheck
 
Methods inherited from class chemaxon.struc.CGraph
addEdge0, addEdgeWithoutChangingIt, addNodeWithoutChangingIt, findComponentIds, findComponentIds, findEdge, findFrag, findFragById, findNode, getForefather, getFragCount, getFragIds, getGrinvCC, getLock, getParent, getSmallestRingSizeForIdx, getSSSR, incGrinvCC, incGrinvCCOnly, insertEdge, insertNode, isRing, isSymmetric, pack, regenCtabs, removeEdge, removeEdge, removeNode, removeNode, resetCtab, resetGrinvInParents, setGrinvCC
 
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_FLAG

public static final int RG_ID2_FLAG
Other R-group ID's presence flag 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

getRootG

public final MoleculeGraph getRootG()
Gets the root structure.

Specified by:
getRootG in interface chemaxon.struc.RgMoleculeGraphIface
Returns:
the root

getRgroupCount

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

Specified by:
getRgroupCount in interface chemaxon.struc.RgMoleculeGraphIface
Returns:
number of R-groups

getRgroupMemberCount

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

Specified by:
getRgroupMemberCount in interface chemaxon.struc.RgMoleculeGraphIface
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

getRgroupMemberG

public final MoleculeGraph getRgroupMemberG(int i,
                                            int j)
Gets an R-group member.

Specified by:
getRgroupMemberG in interface chemaxon.struc.RgMoleculeGraphIface
Parameters:
i - R-group index
j - member index
Returns:
the R-group member

getRgroupId

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

Specified by:
getRgroupId in interface chemaxon.struc.RgMoleculeGraphIface
Parameters:
i - R-group index
Returns:
number between 0 and MolAtom.RGROUP_MAX

findRgroupIndex

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

Specified by:
findRgroupIndex in interface chemaxon.struc.RgMoleculeGraphIface
Parameters:
rgid - number between 0 and MolAtom.RGROUP_MAX
Returns:
R-group index, or -1 if not found

addRgroup

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

Parameters:
rl - R-logic flags or an R-group ID number between 0 and MolAtom.RGROUP_MAX
m - the R-group
Returns:
the Rgroup index

replaceAtomsWithNewRgroup

public void replaceAtomsWithNewRgroup(SelectionMolecule sel,
                                      int rgid)
Replaces selected atoms with a new R-group.

Parameters:
sel - selected atoms
rgid - R-group ID
Since:
4.0, 06/30/2005

getRlogic

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

Specified by:
getRlogic in interface chemaxon.struc.RgMoleculeGraphIface
Parameters:
i - R-group index
Returns:
R-logic flags
See Also:
RG_ID_MASK, RG_ID2_FLAG, RG_ID2_OFF, RG_ID2_MASK, RG_RESTH

setRlogic

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

Parameters:
i - R-group index
f - R-logic flags
See Also:
RG_ID_MASK, RG_ID2_FLAG, RG_ID2_OFF, RG_ID2_MASK, RG_RESTH

getRlogicRange

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

Specified by:
getRlogicRange in interface chemaxon.struc.RgMoleculeGraphIface
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

checkRlogicRange

public java.lang.String checkRlogicRange(int index,
                                         java.lang.String range)
                                  throws java.lang.IllegalArgumentException
Checks an R-logic occurence range string for syntax errors and returns a "normalized" string.

Parameters:
index - R-group index
range - range of occurance
Returns:
the normalized occurence range string
Throws:
java.lang.IllegalArgumentException - bad occurence range
Since:
Marvin 3.4

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. See the text formats on the File Formats in Marvin page.

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.

Specified by:
getName in interface chemaxon.struc.ReadableMolecule
Overrides:
getName in class Molecule
Returns:
the molecule name or an empty string

properties

public MPropertyContainer properties()
Gets the property container.

Specified by:
properties in interface chemaxon.struc.ReadableMolecule
Overrides:
properties in class MoleculeGraph
Returns:
the property container
Since:
Marvin 4.0, 06/20/2005

revalidateCoordDependentProps

public void revalidateCoordDependentProps()
Revalidate coordinate dependent properties. This method should be called at molecule import, after all atomic coordinates and bonds are parsed.

Overrides:
revalidateCoordDependentProps in class MoleculeGraph
Since:
Marvin 4.1, 08/03/2006

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()

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:
Marvin 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

getGrinv

public int getGrinv(int[] gi,
                    int options)
Gets the graph invariants (canonical labels). Same like getGrinv() but depending on the options chiral info is also added to invariants (needed for unique SMILES) and/or hydrogens are ignored. In the latter case -1 graph invariant is assigned to explicit hydrogens.

Overrides:
getGrinv in class MoleculeGraph
Parameters:
gi - output array, its length must be equal to the number of atoms
options - options for the generation of graph invariants
Returns:
the number of different graph invariants
Throws:
java.lang.SecurityException - the GraphInvariants module cannot be loaded because of security reasons (firewall)
Since:
Marvin 4.0 7/08/2005
See Also:
MoleculeGraph.GRINV_NOHYDROGEN, MoleculeGraph.GRINV_STEREO

rgroupIdOf

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

Specified by:
rgroupIdOf in interface chemaxon.struc.RgMoleculeGraphIface
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.

Specified by:
rgroupIndexOf in interface chemaxon.struc.RgMoleculeGraphIface
Parameters:
node - the atom
Returns:
the R-group index if found or -1 if not found

getRgroupMemberID

public long getRgroupMemberID(CNode node)
Gets the unique indentifier of the R-group member that contains the specified atom.

Specified by:
getRgroupMemberID in interface chemaxon.struc.RgMoleculeGraphIface
Parameters:
node - the atom
Returns:
the ID or -1
Since:
Marvin 4.1, 11/23/2005

getRgroupIndex

public int getRgroupIndex(long id)
Gets the R-group index from the R-group member ID.

Specified by:
getRgroupIndex in interface chemaxon.struc.RgMoleculeGraphIface
Parameters:
id - the R-group member ID or -1
Returns:
the R-group ID or -1
Since:
Marvin 4.1, 11/23/2005

getRgroupMemberIndex

public int getRgroupMemberIndex(long id)
Gets the R-group member index from the R-group member ID.

Specified by:
getRgroupMemberIndex in interface chemaxon.struc.RgMoleculeGraphIface
Parameters:
id - the R-group member ID or -1
Returns:
the R-group member index or -1
Since:
Marvin 4.1, 11/23/2005

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,
                         int i,
                         int j)
Sets the absolute stereoconfiguration flag for the root structure and the R-groups.

Parameters:
c - the absolute stereoconfiguration flag

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 in the graph union.

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

setNode

public void setNode(int iu,
                    CNode node)
Sets the node at the specified index in the graph union.

Overrides:
setNode in class CGraph
Parameters:
iu - 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

insertNullNodes

protected void insertNullNodes(int i,
                               int count)
Insert nulls into the atom array.

Overrides:
insertNullNodes in class CGraph
Parameters:
i - starting index
count - number of new entries
Since:
Marvin 3.4

insertNullEdges

protected void insertNullEdges(int i,
                               int count)
Insert nulls into the bond array.

Overrides:
insertNullEdges in class CGraph
Parameters:
i - starting index
count - number of new entries
Since:
Marvin 3.5.5

getEdgeCount

public int getEdgeCount()
Gets the number of edges in the root structure.

Overrides:
getEdgeCount in class CGraph
Returns:
number of edges

getEdge

public CEdge getEdge(int i)
Gets an edge in the graph union.

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

setEdge

public void setEdge(int iu,
                    CEdge edge)
Sets the edge at the specified index in the graph union.

Overrides:
setEdge in class MoleculeGraph
Parameters:
iu - the bond index
edge - the bond

replaceEdge

public void replaceEdge(CEdge olde,
                        CEdge newe)
Replaces an edge by another one.

Overrides:
replaceEdge in class CGraph
Parameters:
olde - the old edge
newe - the new edge
Since:
Marvin 4.1, 11/24/2005

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 in the graph union.

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 in the graph union.

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 Molecule
Returns:
true if the graph does not contain any nodes or edges.

isQuery

public boolean isQuery()
Indicates if the molecule has query features.

Overrides:
isQuery in class MoleculeGraph
Returns:
true if there are R-definitions for this molecule or the root has query features.
Since:
Marvin 4.1.2 08/30/2006

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:
Marvin 3.0

hasAtomSet

public boolean hasAtomSet()
Tests whether the molecule graph has atom sets.

Overrides:
hasAtomSet in class MoleculeGraph
Returns:
true if there are atom sets, false otherwise
Since:
Marvin 4.0, 03/02/2005

hasBondSet

public boolean hasBondSet()
Tests whether the molecule graph has atom sets.

Overrides:
hasBondSet in class MoleculeGraph
Returns:
true if there are atom sets, false otherwise
Since:
Marvin 4.0, 03/02/2005

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:
Marvin 3.0.1

getDocumentForChild

protected MDocument getDocumentForChild(MoleculeGraph g)
Gets the parent document for a child graph.

Overrides:
getDocumentForChild in class MoleculeGraph
Parameters:
g - the child graph or this
Returns:
the parent document
Since:
Marvin 4.1.1, 08/23/2006

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:
Marvin 3.1

removeNode

public void removeNode(CNode node,
                       int cleanupFlags)
Removes an atom and its bonds from the root structure and from all the R-groups. This method is for internal use only. Use CGraph.removeNode(CNode) instead unless you are sure what you are doing.

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

removeNode

public void removeNode(int i,
                       int cleanupFlags)
Removes an atom and its bonds from the root structure. This method is for internal use only. Use CGraph.removeNode(CNode) instead unless you are sure what you are doing.

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

cleanupRemovedRgroupMember

public void cleanupRemovedRgroupMember(MoleculeGraph m,
                                       int f)
Clean-up after R-group removal.

Specified by:
cleanupRemovedRgroupMember in interface chemaxon.struc.RgMoleculeGraphIface
Parameters:
m - the removed R-group member
f - clean-up flags
Since:
Marvin 4.1, 11/25/2005

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:
Marvin 3.1
See Also:
CGraph.RMCLEANUP_NONE, CGraph.RMCLEANUP_ALL, CGraph.RMCLEANUP_EDGES, MoleculeGraph.RMCLEANUP_STEREO, Molecule.RMCLEANUP_SGROUPATOMS, Molecule.RMCLEANUP_FROMSGROUPS

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:
Marvin 3.1
See Also:
CGraph.RMCLEANUP_NONE, CGraph.RMCLEANUP_ALL, CGraph.RMCLEANUP_EDGES, MoleculeGraph.RMCLEANUP_STEREO, Molecule.RMCLEANUP_SGROUPATOMS, Molecule.RMCLEANUP_FROMSGROUPS

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:
Marvin 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

sortEdgesAccordingTo

public void sortEdgesAccordingTo(CEdge[] order)
Sort edges in the same order as they appear in the specified array.

Overrides:
sortEdgesAccordingTo in class CGraph
Parameters:
order - the array
Since:
Marvin 3.5, 09/02/2004

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 g)
Add the atoms and bonds of another molecule.

Overrides:
fuse in class CGraph
Parameters:
g - 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 MoleculeGraph
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:
Marvin 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

cloneMolecule

public Molecule cloneMolecule()
Make an identical copy of the molecule.

Overrides:
cloneMolecule in class Molecule
Returns:
the copy
Since:
Marvin 3.5.1, 11/20/2004

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
Returns:
the molecular weight

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

newSelectionMolecule

public SelectionMolecule newSelectionMolecule()
Creates a new SelectionMolecule object appropriate for storing selection from this molecule.

Overrides:
newSelectionMolecule in class Molecule
Returns:
an empty selection molecule
Since:
Marvin 4.1, 11/24/2005

makeItSimilar

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

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

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:
Marvin 2.9

transform

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

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

createMol

public static Molecule createMol(java.lang.String fmt)
Deprecated. As of Marvin 3.4, MolImportIface.createMol() must be used.

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:
Marvin 3.0, 11/11/2002
See Also:
Molecule.getGraphUnionAsSelection()

getSubGraphCount

protected final int getSubGraphCount()
Gets the number of all "submolecules".

Overrides:
getSubGraphCount in class MoleculeGraph
Returns:
the number of submolecules
Since:
Marvin 4.1.2
See Also:
MoleculeGraph.getSubGraphs(MoleculeGraph[], int)

getSubGraphs

protected final void getSubGraphs(MoleculeGraph[] arr,
                                  int off)
Gets all "submolecules".

Overrides:
getSubGraphs in class MoleculeGraph
Parameters:
arr - the output array
off - offset
Since:
Marvin 4.1.2
See Also:
MoleculeGraph.getSubGraphs(), MoleculeGraph.getSubGraphCount()

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:
Marvin 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:
Marvin 3.1
See Also:
MolAtom.LONELY_H, MolAtom.ISOTOPE_H, MolAtom.CHARGED_H, MolAtom.RADICAL_H, MolAtom.MAPPED_H, MolAtom.WEDGED_H, MolAtom.HCONNECTED_H

aromatize

public void aromatize(int method)
Aromatize molecule. Change the bonds

Overrides:
aromatize in class Molecule
Parameters:
method - specifies the algorithm for aromatization. Possible values:
  • AROM_BASIC - Basic aromatization
  • AROM_GENERAL - General (Daylight compatible) aromatization
Limits:
  • AROM_BASIC: only up to 18 membered rings are checked
  • AROM_GENERAL: no ring system limit
Throws:
java.lang.SecurityException - cannot load module because of a security problem (firewall)
Since:
Marvin 3.4, Marvin 4.1
See Also:
MoleculeGraph.AROM_BASIC, MoleculeGraph.AROM_GENERAL, Document about aromatization

postClean

protected void postClean()
Operations performed after cleaning. Makes a 2D clean, calculates atom coordinates and creates a peptide snake if needed

Overrides:
postClean in class Molecule
Since:
Marvin 4.1, 07/31/2006

toString

public java.lang.String toString()
Overrides Object.toString() to ease debugging.

Overrides:
toString in class MoleculeGraph
Returns:
a string representation of the object
Since:
4.1, 11/28/2005