chemaxon.struc
Class RgMolecule

java.lang.Object
  extended by chemaxon.struc.CGraph
      extended by chemaxon.struc.MoleculeGraph
          extended by chemaxon.struc.Molecule
              extended by chemaxon.struc.RgMolecule
All Implemented Interfaces:
chemaxon.struc.MObjectContainer, MTransformable, chemaxon.struc.ReadableMolecule, chemaxon.struc.RgMoleculeGraphIface, StereoConstants, java.io.Serializable, java.lang.Cloneable

public class RgMolecule
extends Molecule
implements chemaxon.struc.RgMoleculeGraphIface, chemaxon.struc.MObjectContainer

A molecule or reaction containing R-groups.

Since:
Marvin 2.6
Version:
5.1.1, 08/28/2008
Author:
Peter Csizmadia, Szilveszter Juhos
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
DEFAULT_UNGROUP, RECURSIVE_UNGROUP, RMCLEANUP_FROMSGROUPS, RMCLEANUP_SGROUPATOMS, RMSG_DEFAULT, RMSG_KEEP_CHILDREN, RMSG_KEEP_MULTICENTER, RMSG_KEEP_PARENT
 
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, GRINV_DONT_STORE, GRINV_NOHYDROGEN, GRINV_OLDSTEREO, GRINV_STEREO, GRINV_USEMAPS, GRINV_VALUE_OPTIONS, INVALID_LINKNODE_MESSAGE, MIN_RING_SIZE_FOR_TRANS_DB, OMIT_POSTCLEAN, orix, oriy, oriz, propertyContainer, RMCLEANUP_MOBJECT, RMCLEANUP_PARENTDOC, RMCLEANUP_STEREO, useOnlyFirstAtomInStereoCalculation
 
Fields inherited from class chemaxon.struc.CGraph
btab, CACHE_REMOVE_ALL, CACHE_REMOVE_CACHEMEMORY, cacheMemory, cssr, ctab, edgeCount, edges, fragIds, grinv, grinvCC, grinvOptions, INITIAL_CAPACITY, nFrags, nGrinv, nodeCount, nodes, parentGraph, RMCLEANUP_ALL, RMCLEANUP_EDGES, RMCLEANUP_FIXCOMPONENT, RMCLEANUP_NONE, sssr, sssr2idx, 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.
 boolean canBeReactionComponent()
          Tests whether an object of this class can be a reaction component.
 void checkConsistency()
          Checks the internal consistency of the structure.
 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.
protected  void checkSgroupConsistency()
          Checks the consistency of S-groups.
 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 clearObjects()
          Removes all objects that belong to a chemical structure.
 void clonecopy(CGraph g)
          Make another molecule identical to this one.
 void clonecopy(int[] iatoms, MoleculeGraph g)
          Copies the specified atoms of this graph to another one.
 void clonelesscopy(CGraph g)
          Copy to selection.
 Molecule cloneMolecule()
          Make an identical copy of the molecule.
 boolean contains(CEdge edge)
          Checks if the root structure or an R-group contains the specified edge.
 boolean contains(CNode node)
          Checks if the root structure or an R-group contains the specified node.
static Molecule createMol(java.lang.String fmt)
          Deprecated. As of Marvin 3.4, MolImportModule.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#.
protected  boolean fixSelfReferringProperty(MProp prop)
          Fix a property containing reference to the molecule.
 void fuse(CGraph g, boolean check)
          Add the atoms and bonds of another molecule.
protected  void fuse0(CGraph graph, boolean check)
          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.
 int getFlags()
          Gets the dimension and chiral flags.
 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).
 int getLonePairCount(int i)
          Gets the number of lone pairs.
 double getMass()
          Calculates the molecular weight of the molecule.
protected  Molecule getMostSimplifiedMolecule()
          Gets the simplified molecule object even if there is a parent document with other objects.
 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.
 MObject getObject(int index)
          Returns the graphical object that belongs to a chemical structure.
 int getObjectCount()
          Returns the count of the graphical objects that belong to a chemical 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.
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.
 boolean hasRgroupContainedBy(java.util.Set set)
          Tests whether the molecule has an R-group that is a subset of the specified set of atoms.
 void implicitizeHydrogens(int f, MolAtom[] atoms)
          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.
 int indexOf(MObject mo)
          Searches for an object that belongs to a chemical structure.
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.
 boolean isSelfReference(MProp p)
          Tests whether the specified property is a self reference to the molecule.
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 removeObject(MObject mo)
          Removes an object that belongs to a chemical 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 selectAllObjects(boolean s)
          Selects or deselects all objects that belong to a chemical structure.
 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)
          Deprecated. as of Marvin 5.1.1, please call MoleculeGraph.setAbsStereo(boolean) for the component
 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.
protected  void setFlags(int f)
          Sets the dimension and chiral flags.
 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.
protected  void sumConservedQuantities(MolAtom a, int[] atoms, int sign)
          For internal use only.
 java.lang.String toString()
          Overrides Object.toString() to ease debugging.
 void transform(CTransform3D t, boolean incg)
          Apply a transformation matrix to the atomic coordinates.
 int unRgroupAtoms(java.util.Set set)
          Ungroup R-groups consisting of the specified atoms and make the be part of root.
 
Methods inherited from class chemaxon.struc.Molecule
addNode0, addSgroup, addSgroupClones, addSgroupsOf, bondlength, clean, cleanSgroups, clear, clearExtraLabels, clearProperties, clone, clonecopyWithoutSgroups, cloneMoleculeWithDocument, contractExpandedSgroups, contractSgroups, convertToFrags, countExpandableContractableSgroups, countOrderedComponentSgroups, dearomatize, draw, expandSgroups, expandSgroups, exportToBinFormat, exportToFormat, exportToObject, findAllSgroupContaining, findContainingMulticenterSgroup, findContractableSgroup, findExpandableSgroup, findFrags, findFrags, findSgroupContaining, findSgroupOf, findSmallestSgroupContaining, getComment, getEndPosition, getGraphUnionAsSelection, getImageSize, getInputFormat, getProperty, getPropertyCount, getPropertyKey, getPropertyKeys, getPropertyObject, getSgroup, getSgroupArray, getSgroupCount, getSgroupLigands, getSimplifiedMolecule, getSortedSgroups, getStartPosition, getVisibleCoords, indexOf, isExpandable, isGUIContracted, isPeptideChain, isSgroup, makeBiopolymerSnake, partialClean, regenFragIds, removeAllSgroups, removeSgroupFromList, removeSgroupsOf, removeSgroupsOf, reparentSgroups, residueSymbolOf, residueTypeOf, setComment, setEndPosition, setGUIContracted, setNode0, setProperty, setPropertyObject, setStartPosition, sortSgroupXBonds, toBinFormat, toFormat, toObject, ungroupSgroup, ungroupSgroup, ungroupSgroup, ungroupSgroup, ungroupSgroups
 
Methods inherited from class chemaxon.struc.MoleculeGraph
addAtomsAndBondsTo, addExplicitHydrogens, addExplicitHydrogens, addExplicitLonePairs, adjustMultiChiralFlag, aromatize, aromatize, arrangeComponents, calcCenter, calcCenter, calcDehydrogenizedGrinv, calcHeight, calcHybridization, calcOutRect, calcOutRect, calcOutRectCenter, calcOutRectCenter, calcWidth, canBeCT, canBeCT, clean, clearCachedInfo, clonecopyCGraphWithoutSgroups, contains, createBHtab, createCHtab, createDehydrogenizedReadOnlyGraph, findAtomClone, getAromaticAndAliphaticRings, getAromrings, getAromrings, getAtom, getAtomArray, getAtomCount, getBond, getBondArray, getBondCount, getCharge, getChirality, getDesiredLength, getDesiredLength, getDim, getDocument, getEdgeArray, getEdgeVector, getExactMass, getExplicitHcount, getExplicitLonePairCount, getFormalCharge, getGrinv, getGrinvOptions, getHybridizationState, getImplicitHcount, getLocalChirality, getLocalParity, getLocation, getMassno, getNeighbor, getNeighborCount, getNodeVector, getNonAromrings, getNonAromrings, getParentDocument, getParity, getPoints, getRadical, getSSSRBondSet, getSSSRBondSetInLong, getStereo2, getStereo2, getStereo2, getStereo2, getStereo2, getStereo2, getStereo2, getSubGraphs, getTotalCharge, hasExplicitLonePairs, hasExtraLabelSet, hasImplicitH, hasSelfReferringProperty, hasValenceError, hydrogenize, implicitizeHydrogens, implicitizeHydrogens, isAbsStereo, isMultiChiral, isOnlyFirstAtomInStereoCalculation, isRingBond, isSimilarTo, isValidLinkNode, moveTo, partialClean, qpropCheck, removeExplicitLonePairs, restoreCache, saveCache, setAtomSetSeqs, setBondSetSeqs, setChirality, setGrinvOptions, setLinkNodeDefaultOuters, setLocalParity, setParity, setParity, setParity, setSetSeqs, stereoClean, transform, updateDim, useOnlyFirstAtomInStereoCalculation, valenceCheck, valenceCheck
 
Methods inherited from class chemaxon.struc.CGraph
addEdge0, addEdgeWithoutChangingIt, addNodeWithoutChangingIt, checkEdgeConsistency, findBasicFrags, findComponentIds, findComponentIds, findEdge, findFrag, findFragById, findInArray, findNode, fuse, fuse0, getCSSR, getEdgeList, getForefather, getFragCount, getFragIds, getGrinvCC, getLock, getParent, getSmallestRingSizeForIdx, getSSSR, getSSSREdges, getSSSRIdxesForAtoms, incGrinvCC, incGrinvCCOnly, insertEdge, insertEdgeInOrder, insertNode, isGrinvCCValid, isolate, isolate, isRing, isSymmetric, mergeFrags, pack, regenCtabs, removeEdge, removeEdge, removeIsolatedEdges, removeIsolatedNodes, 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

hasRgroupContainedBy

public boolean hasRgroupContainedBy(java.util.Set set)
Tests whether the molecule has an R-group that is a subset of the specified set of atoms.

Parameters:
set - set of atoms
Since:
5.0, 02/24/2007

unRgroupAtoms

public int unRgroupAtoms(java.util.Set set)
Ungroup R-groups consisting of the specified atoms and make the be part of root.

Parameters:
set - selected atoms
Returns:
the number of ungrouped R-group members
Since:
5.0, 02/24/2007

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.
See Also:
CGraph.edges, MoleculeGraph.orix, MoleculeGraph.oriy, MoleculeGraph.oriz, MoleculeGraph.setFlags(int)

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

getFlags

public int getFlags()
Gets the dimension and chiral flags.

Overrides:
getFlags in class MoleculeGraph
Returns:
the flags
Since:
Marvin 5.0.1, 02/10/2008

setFlags

protected void setFlags(int f)
Sets the dimension and chiral flags.

Overrides:
setFlags in class MoleculeGraph
Parameters:
f - the flags
Since:
Marvin 5.0.1, 02/10/2008

setAbsStereo

public void setAbsStereo(boolean c,
                         int i,
                         int j)
Deprecated. as of Marvin 5.1.1, please call MoleculeGraph.setAbsStereo(boolean) for the component


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.setFlags(int)

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(CNode node)
Checks if the root structure or an R-group contains