chemaxon.struc
Class MoleculeGraph

java.lang.Object
  extended by chemaxon.struc.CGraph
      extended by chemaxon.struc.MoleculeGraph
All Implemented Interfaces:
MTransformable, chemaxon.struc.ReadableMolecule, StereoConstants, java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
Molecule, SelectionMolecule

public class MoleculeGraph
extends CGraph
implements chemaxon.struc.ReadableMolecule, MTransformable, StereoConstants

A graph consisting of MolAtom vertices and MolBond edges.

Since:
Marvin 3.0, 10/11/2002
Version:
5.0.2, 03/11/2008
Author:
Peter Csizmadia, Ferenc Csizmadia, Andras Volford, Gyorgy Pirok, Szilveszter Juhos, Szabolcs Csepregi, Erika Biro
See Also:
MolAtom, MolBond, Serialized Form

Field Summary
static int AROM_BASIC
          Basic aromatization.
static int AROM_CHEMAXON
          Deprecated. please use AROM_BASIC instead. Chemaxon aromatization.
static int AROM_DAYLIGHT
          Deprecated. please use AROM_GENERAL instead. Daylight aromatization (modified Huckel rule).
static int AROM_GENERAL
          General (Daylight conform) aromatization.
static int CACHE_REMOVE_AROMATAMODULE
          Cache removal option for remove module used in aromatization.
static int CACHE_REMOVE_GRINVMODULE
          Cache removal option for remove module used in graph invariant calculation.
static int CACHE_REMOVE_PARITYMODULE
          Cache removal option for remove module used in parity calculation.
static int CACHE_REMOVE_SSSRMODULE
          Cache removal option for remove module used in sssr.
protected static int DIM_MASK
          Dimension bits in flags.
static int GRINV_DONT_STORE
          Graph invariant option to instruct that the graph invariant should not be stored in MoleculeGraph.
static int GRINV_NOHYDROGEN
          Graph invariant option for ignoring explicit hydrogens.
static int GRINV_OLDSTEREO
          Graph invariant option for calculating graph invariants using the old stereo method.
static int GRINV_STEREO
          Graph invariant option for calculating graph invariants using stereo information.
static int GRINV_USEMAPS
          Graph invariant option for calculating graph invariants considering atom maps also.
static int GRINV_VALUE_OPTIONS
          Unified mask of graph invariant options affecting grinv value.
static java.lang.String INVALID_LINKNODE_MESSAGE
           
static int MIN_RING_SIZE_FOR_TRANS_DB
          The minimal size of the ring for the existence of TRANS double bond.
static int OMIT_POSTCLEAN
          Omit arranging process after the hydrogen addition.
protected  double orix
          Origin x.
protected  double oriy
          Origin y.
protected  double oriz
          Origin z.
protected  MPropertyContainer propertyContainer
           
static int RMCLEANUP_MOBJECT
          Remove graphics objects containing the removed node.
static int RMCLEANUP_PARENTDOC
          Remove atom from parent document.
static int RMCLEANUP_STEREO
          When removing a H atom, keep stereo information unchanged.
protected  boolean 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
MoleculeGraph()
          Construct a molecule.
MoleculeGraph(MoleculeGraph p, int na, int nb)
          Construct a molecule or fragment with the specified number of atoms and bonds.
 
Method Summary
protected  void addAtomsAndBondsTo(MoleculeGraph s)
          Adds all atoms and bonds to the specified molecule.
 boolean addExplicitHydrogens(int f)
          Adds explicit H atoms instead of the current implicit ones.
 boolean addExplicitHydrogens(int f, MolAtom[] atoms)
          Adds explicit H atoms instead of the current implicit ones.
 void addExplicitLonePairs()
          Adds explicit lone pairs.
 void adjustMultiChiralFlag()
          Checks whether the molecule has multiple chiral centres
 void aromatize()
          Aromatize molecule using the default general aromatization method.
 void aromatize(boolean a)
          Aromatize (using the default general aromatization method) or dearomatize molecule.
 void aromatize(int method)
          Aromatize molecule.
 void arrangeComponents()
          Arranges molecule components (reactants, agents, products, R-group definitions) nicely.
 double bondlength()
          Calculates the regular bond length.
 DPoint3 calcCenter()
          Calculates the geometrical center.
 void calcCenter(DPoint3 p)
          Calculates the geometrical center.
 int calcDehydrogenizedGrinv(int[] gi)
          Calculates the graph invariants with the assumption that hydrogens are removed.
 double calcHeight()
          Calculates the molecule height.
 void calcHybridization()
          Calculates and sets hybridazation state for each atom.
 DPoint3 calcOutRect()
          Calculates the outer rectangle.
 void calcOutRect(DPoint3 p)
          Calculates the outer rectangle.
 DPoint3 calcOutRectCenter()
          Calculates the center of the outer rectangle.
 void calcOutRectCenter(DPoint3 p)
           
 double calcWidth()
          Calculates the molecule width.
 boolean canBeCT(int i2, int i3)
          Determines whether the bond between the specified atoms can be a CIS/TRANS or not.
 boolean canBeCT(int i2, int i3, boolean grcheck)
          Determines whether the bond between the specified atoms can be a CIS/TRANS or not.
 boolean clean(int dim, java.lang.String opts)
          Calculates atom coordinates.
 boolean clean(int dim, java.lang.String opts, MProgressMonitor pmon)
          Calculates atom coordinates.
 void clear()
          Clears the molecule.
 void clearCachedInfo(int options)
          Deletes the cached information depending on the given options.
 void clearForImport(java.lang.String format)
          Clears the edges vector, the properties, the flags, and sets the origin coordinates to 0.
 java.lang.Object clone()
          Make an identical copy of the molecule.
 void clonecopy(CGraph g)
          Make another molecule identical to this one.
 void clonecopy(int[] iatoms, MoleculeGraph g)
          Copies the specified nodes of this molecule graph to another one.
protected  boolean clonecopyCGraphWithoutSgroups(int[] cnodes, CEdge[] cedges, int nb, CGraph g)
          Copies the specified nodes and edges of this graph to another one.
 void clonelesscopy(CGraph g)
          Copy to selection.
 boolean contains(CGraph graph)
          Does the graph contain the specified fragment?
 int[][] createBHtab()
          Creates the bond table extended with implicit hydrogen atoms.
 int[][] createCHtab()
          Creates the connection table extended with implicit hydrogen atoms.
protected  MoleculeGraph createDehydrogenizedReadOnlyGraph()
          Creates a dehydrogenized version of the molecule.
 boolean dearomatize()
          Dearomatize molecule.
 MolAtom findAtomClone(MolAtom a)
          Finds the clone of an atom.
protected  boolean fixSelfReferringProperty(MProp prop)
          Fix a property containing reference to the molecule.
protected  void fuse0(CGraph g, boolean check)
          Add the atoms and bonds of another molecule.
 int[][][] getAromaticAndAliphaticRings(int aromatizationType, boolean onlyAromrings, boolean aromatize, int maxRingSize, int ringsLimit)
          Get aromatic and or aliphatic ring atom indexes.
 int[][] getAromrings()
          Deprecated. please use getAromaticAndAliphaticRings instead.
 int[][] getAromrings(int size)
          Deprecated. please use getAromaticAndAliphaticRings instead.
 MolAtom getAtom(int n)
          Gets the nth atom.
 MolAtom[] getAtomArray()
          Creates an array of atoms.
 int getAtomCount()
          Gets the number of atoms.
 MolBond getBond(int n)
          Gets the nth bond.
 MolBond[] getBondArray()
          Creates an array of bonds.
 int getBondCount()
          Gets the number of bonds.
 int getCharge(int k)
          Gets the charge of an atom.
 int getChirality(int i)
          Computes the chirality of an atom of the Molecule instance based on both the coordinates of the neighbouring atoms and the stereo information of the bonds to those.
 double getDesiredLength(int atno1, int atno2, int type)
          Gets the ideal bond length in Angstroms.
 double getDesiredLength(MolBond b)
          Gets the ideal bond length in Angstroms.
 int getDim()
          Gets the dimension.
 MDocument getDocument()
          Gets the document object.
protected  MDocument getDocumentForChild(MoleculeGraph g)
          Gets the parent document for a child graph.
 CEdge[] getEdgeArray()
          Creates an array of bonds.
 java.util.Vector getEdgeVector()
          Creates an array of atoms.
 double getExactMass()
          Calculates the molecular exact weight of the molecule.
 int getExplicitHcount()
          Gets the total number of explicit hydrogens attached to the molecule.
 int getExplicitLonePairCount(int i)
           
 int getFlags()
          Gets the dimension and chiral flags.
 java.lang.String getFormula()
          Gets the molecular formula.
 MoleculeGraph getGraphUnion()
          Gets a graph containing all the atoms and bonds.
 int getGrinv(int[] gi)
          Gets the graph invariants.
 int getGrinv(int[] gi, boolean uniqueFlag)
          Deprecated. Please use getGrinv(int[], int) instead.
 int getGrinv(int[] gi, int options)
          Gets the graph invariants (canonical labels).
 int getGrinvOptions()
          Gets graph invariant calculation options passed to the module.
 int getHybridizationState(int k)
          Gets the hybridization state.
 int getImplicitHcount()
          Gets the total number of implicit hydrogens attached to the molecule.
 int getLocalChirality(int idx, int[] ch)
          Get local chirality.
 int getLocalParity(int i)
          Computes the local parity of an atom of the Molecule instance based on both the coordinates of the neighbouring atoms and the stereo information of the bonds to those.
 DPoint3 getLocation()
          Gets the origin of the molecule.
 int getLonePairCount(int i)
          Gets the number of lone pairs.
 double getMass()
          Calculates the molecular weight of the molecule.
 int getMassno(int k)
          Gets the mass number of an atom.
 java.lang.String getName()
          Gets the molecule name.
 int getNeighbor(int k, int i)
          Gets the index of a neighbor of an atom.
 int getNeighborCount(int k)
          Gets the number of neighbors of an atom.
 java.util.Vector getNodeVector()
          Creates an array of atoms.
 int[][] getNonAromrings()
          Deprecated. please use getAromaticAndAliphaticRings instead.
 int[][] getNonAromrings(int size)
          Deprecated. please use getAromaticAndAliphaticRings instead.
protected  MDocument getParentDocument()
          Gets the document or the document of the parent graph.
 int getParity(int i)
          Computes the parity of an atom of the Molecule instance based on both the coordinates of the neighbouring atoms and the stereo information of the bonds to those.
 DPoint3[] getPoints()
          Gets an array containing the atom coordinates.
 int getRadical(int k)
          Gets the radical value of an atom.
 int[] getSSSRBondSet()
          Deprecated. please use getSSSRBondSetInLong() instead.
 long[] getSSSRBondSetInLong()
          Get SSSR bond bitsets in long array.
 int getStereo2(CNode a1, int i2, int i3, CNode a4)
          Gets cis/trans stereo information for an A1-A2=A3-A4 atom configuration.
 int getStereo2(int i1, int i2, int i3, int i4)
          Gets cis/trans stereo information for an A1-A2=A3-A4 atom configuration.
 int getStereo2(MolBond b)
          Gets cis/trans (Z/E) stereo information for the given bond.
 int getStereo2(MolBond b, CNode a1, CNode a4)
          Gets cis/trans stereo information for an A1-A2=A3-A4 atom configuration.
 int getStereo2(MolBond b, CNode a1, CNode a4, boolean grcheck)
          Gets cis/trans stereo information for an A1-A2=A3-A4 atom configuration.
protected  int getStereo2(MolBond b, CNode a1, int i2, int i3, CNode a4)
          Gets cis/trans stereo information for an A1-A2=A3-A4 atom configuration.
protected  int getStereo2(MolBond b, CNode a1, int i2, int i3, CNode a4, boolean grcheck)
          Gets cis/trans stereo information for an A1-A2=A3-A4 atom configuration.
protected  int getSubGraphCount()
          Gets the number of all "submolecules".
 MoleculeGraph[] getSubGraphs()
          Gets all "submolecules".
protected  void getSubGraphs(MoleculeGraph[] m, int off)
          Gets all "submolecules".
 int getTotalCharge()
          Gets the total (formal) charge of the molecule.
 double[] getVisibleCoords(MolAtom ma)
          Returns the coordinates of the given atom (contained in the molecule).
 boolean hasAtomSet()
          Tests whether the molecule graph has atom sets.
 boolean hasBondSet()
          Tests whether the molecule graph has atom sets.
 boolean hasExplicitLonePairs()
          Tests whether the molecule has implicit explici lone pair nodes.
 boolean hasExtraLabelSet()
           
 boolean hasImplicitH()
          Indicates, whether the molecule has implicit hydrogen atoms.
 boolean hasSelfReferringProperty()
          Tests whether the property list contains the molecule.
 boolean hasValenceError()
          Determines if this molecule has a valence error on any of its atoms.
 boolean hydrogenize(boolean add)
          Implicit/explicit Hydrogen conversion.
 void implicitizeHydrogens(int f)
          Removes explicit bound Hydrogens from the graph and converts them to implicit.
 void implicitizeHydrogens(int f, MolAtom[] atoms)
          Removes explicit bound Hydrogens from the graph and converts them to implicit.
 void implicitizeHydrogens(int f, MolAtom[] atoms, boolean check)
          Removes explicit bound Hydrogens from the graph and converts them to implicit.
 boolean isAbsStereo()
          Gets the absolute stereoconfiguration flag.
 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 isMultiChiral()
          Returns the multiple chirality flag.
 boolean isOnlyFirstAtomInStereoCalculation()
          Get how parity module interpret wedes.
 boolean isQuery()
          Indicates if the molecule has query features.
 boolean isRingBond(int idx)
          Is this bond in ring?
 boolean isSelfReference(MProp p)
          Tests whether the specified property is a self reference to the molecule.
 boolean isSimilarTo(CGraph g)
          Checks if the graph is similar to another graph.
 boolean isValidLinkNode(int linkAtomIdx, int outer1, int outer2)
          Checks whether the specified link atom is valid or not.
protected  void makeItSimilar(CGraph g)
          Copies some properties of this molecule to the other one specified as argument.
 void mergeNodes(CNode that, CNode a)
          Merges edges of a node with another node, then adds the node to the molecule.
 void moveTo(DPoint3 o)
          Move the molecule.
 CGraph newInstance()
          Creates a new MoleculeGraph object.
 boolean partialClean(int dim, int[] fixed, java.lang.String opts)
          Calculates atom coordinates by using fixed atoms.
 boolean partialClean(MoleculeGraph template, int[] map, java.lang.String opts)
          Calculates atom coordinates by using the given template molecule.
 MPropertyContainer properties()
          Gets the property container.
 void qpropCheck(java.util.Vector v)
          Check for query property errors.
protected  void removeEdge(int i, int cleanupFlags)
          Removes an edge by reference.
 void removeExplicitLonePairs()
          Removes explicit lone pairs.
 void removeNode(CNode node, int cleanupFlags)
          Removes a node and its edges with extra options.
 void removeNode(int i, int cleanupFlags)
          Removes a node and its edges with extra options.
protected  java.lang.Object[] restoreCache(int n)
          Restores caches like connection table, bond table, etc.
 void revalidateCoordDependentProps()
          Revalidate coordinate dependent properties.
protected  java.lang.Object[] saveCache(int n)
          Saves caches like connection table, bond table, etc.
 void setAbsStereo(boolean c)
          Sets the absolute stereoconfiguration flag.
 void setAtomSetSeqs(int id)
          Sets the set sequence number of all atoms.
 void setBondSetSeqs(int id)
          Sets the set sequence number of all bonds.
 boolean setChirality(int i, int c)
          Set chirality of an atom of the Molecule instance based on both the coordinates of the neighbouring atoms and the stereo information of the bonds to those.
 void setDim(int d)
          Sets the dimension.
 void setEdge(int i, CEdge edge)
          Sets the edge at the specified index.
protected  void setFlags(int f)
          Sets the dimension and chiral flags.
 void setGrinvOptions(int opt)
          Sets graph invariant calculation options passed to the module.
 void setLinkNodeDefaultOuters(MolAtom atom)
          Sets link node outer atoms to default values, if they are not set yet; making sure that the resulting link node configuration is valid.
 boolean setLocalParity(int[] p, boolean useActualWedges)
          In case of 2D molecule change the bonds flag (UP/DOWN), in case of 0D molecule set the atom flags to achieve the specified parity array.
 void setLocation(DPoint3 o)
          Set the origin of the molecule.
protected  void setNode0(int i, CNode node)
          Sets the node at the specified index.
 boolean setParity(int[] p)
          Change the bonds flag (UP/DOWN) connected to the whole molecule to achieve the specified parity array.
 boolean setParity(int[] p, boolean useActualWedges)
          Change the bonds flag (UP/DOWN) connected to the whole molecule to achieve the specified parity array.
 boolean setParity(int i, int p)
          Change the bonds flag (UP/DOWN) connected to the given atom to achieve the specified parity.
 void setSetSeqs(int id)
          Deprecated. as of Marvin 4.0, replaced by setAtomSetSeq
 boolean stereoClean()
          Reset the wedges of the molecule, based on the actual parity information.
protected  void sumConservedQuantities(MolAtom a, int[] atoms, int sign)
          For internal use only.
 java.lang.String toString()
          Overrides CGraph.toString() to ease debugging.
 void transform(CTransform3D t)
          Apply a transformation matrix to the atomic coordinates.
 void transform(CTransform3D t, boolean incg)
          Apply a transformation matrix to the atomic coordinates.
protected  void updateDim(MoleculeGraph m)
          Updates the dimensions when fusing two structures.
 void useOnlyFirstAtomInStereoCalculation(boolean f)
          Set how parity module should interpret wedes.
 void valenceCheck()
          Check valence and query property errors for each atoms.
 void valenceCheck(java.util.Vector v)
          Check valence and query property errors.
 
Methods inherited from class chemaxon.struc.CGraph
add, add, addEdge0, addEdgeWithoutChangingIt, addNode0, addNodeWithoutChangingIt, checkConsistency, checkEdgeConsistency, contains, contains, findBasicFrags, findComponentIds, findComponentIds, findEdge, findFrag, findFragById, findFrags, findInArray, findNode, fuse, fuse, fuse0, getBtab, getCSSR, getCtab, getEdge, getEdgeCount, getEdgeList, getForefather, getFragCount, getFragIds, getGrinv, getGrinvCC, getLock, getNode, getNodeCount, getParent, getSmallestRingSizeForIdx, getSSSR, getSSSREdges, getSSSRIdxesForAtoms, incGrinvCC, incGrinvCCOnly, indexOf, indexOf, insertEdge, insertEdgeInOrder, insertNode, insertNullEdges, insertNullNodes, isEmpty, isGrinvCCValid, isolate, isolate, isRealNodeParent, isRing, isSymmetric, mergeFrags, pack, regenCtabs, regenEdges, regenFragIds, removeAll, removeAllEdges, removeEdge, removeEdge, removeEdge, removeIsolatedEdges, removeIsolatedNodes, removeNode, removeNode, replaceEdge, resetCtab, resetGrinvInParents, setGrinvCC, setNode, sortEdgesAccordingTo
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

AROM_BASIC

public static final int AROM_BASIC
Basic aromatization.

Since:
Marvin 4.1, 12/09/2005
See Also:
aromatize(int), Constant Field Values

AROM_CHEMAXON

public static final int AROM_CHEMAXON
Deprecated. please use AROM_BASIC instead. Chemaxon aromatization.
Since:
Marvin 3.4, 05/10/2004
See Also:
aromatize(int), Constant Field Values

AROM_GENERAL

public static final int AROM_GENERAL
General (Daylight conform) aromatization.

Since:
Marvin 4.1, 12/09/2005
See Also:
aromatize(int), Constant Field Values

AROM_DAYLIGHT

public static final int AROM_DAYLIGHT
Deprecated. please use AROM_GENERAL instead. Daylight aromatization (modified Huckel rule).
Since:
Marvin 3.4, 05/10/2004
See Also:
aromatize(int), Constant Field Values

INVALID_LINKNODE_MESSAGE

public static final java.lang.String INVALID_LINKNODE_MESSAGE
See Also:
Constant Field Values

DIM_MASK

protected static final int DIM_MASK
Dimension bits in flags.

See Also:
getFlags(), Constant Field Values

RMCLEANUP_STEREO

public static final int RMCLEANUP_STEREO
When removing a H atom, keep stereo information unchanged.

Since:
Marvin 3.1
See Also:
removeNode(CNode, int), removeNode(int, int), CGraph.RMCLEANUP_ALL, Constant Field Values

RMCLEANUP_MOBJECT

public static final int RMCLEANUP_MOBJECT
Remove graphics objects containing the removed node.

Since:
Marvin 4.1, 03/07/2006
See Also:
removeNode(CNode, int), removeNode(int, int), CGraph.RMCLEANUP_ALL, Constant Field Values

RMCLEANUP_PARENTDOC

public static final int RMCLEANUP_PARENTDOC
Remove atom from parent document.

Since:
Marvin 4.1.13, 09/06/2007
See Also:
removeNode(CNode, int), removeNode(int, int), CGraph.RMCLEANUP_ALL, Constant Field Values

GRINV_NOHYDROGEN

public static final int GRINV_NOHYDROGEN
Graph invariant option for ignoring explicit hydrogens.

See Also:
getGrinv(int[], int), Constant Field Values

GRINV_STEREO

public static final int GRINV_STEREO
Graph invariant option for calculating graph invariants using stereo information. (Chirality & E/Z)

See Also:
getGrinv(int[], int), Constant Field Values

GRINV_OLDSTEREO

public static final int GRINV_OLDSTEREO
Graph invariant option for calculating graph invariants using the old stereo method. (Chirality only.)

See Also:
getGrinv(int[], int), Constant Field Values

GRINV_USEMAPS

public static final int GRINV_USEMAPS
Graph invariant option for calculating graph invariants considering atom maps also.

See Also:
getGrinv(int[], int), Constant Field Values

GRINV_VALUE_OPTIONS

public static final int GRINV_VALUE_OPTIONS
Unified mask of graph invariant options affecting grinv value. But see values below that are not included into this value when introducing a new one to avoid undesired side-effects.

See Also:
Constant Field Values

GRINV_DONT_STORE

public static final int GRINV_DONT_STORE
Graph invariant option to instruct that the graph invariant should not be stored in MoleculeGraph.

See Also:
getGrinv(int[], int), Constant Field Values

CACHE_REMOVE_GRINVMODULE

public static final int CACHE_REMOVE_GRINVMODULE
Cache removal option for remove module used in graph invariant calculation.

See Also:
clearCachedInfo(int), Constant Field Values

CACHE_REMOVE_PARITYMODULE

public static final int CACHE_REMOVE_PARITYMODULE
Cache removal option for remove module used in parity calculation.

See Also:
clearCachedInfo(int), Constant Field Values

CACHE_REMOVE_AROMATAMODULE

public static final int CACHE_REMOVE_AROMATAMODULE
Cache removal option for remove module used in aromatization.

See Also:
clearCachedInfo(int), Constant Field Values

CACHE_REMOVE_SSSRMODULE

public static final int CACHE_REMOVE_SSSRMODULE
Cache removal option for remove module used in sssr.

See Also:
clearCachedInfo(int), Constant Field Values

MIN_RING_SIZE_FOR_TRANS_DB

public static final int MIN_RING_SIZE_FOR_TRANS_DB
The minimal size of the ring for the existence of TRANS double bond.

See Also:
Constant Field Values

OMIT_POSTCLEAN

public static final int OMIT_POSTCLEAN
Omit arranging process after the hydrogen addition.

See Also:
addExplicitHydrogens(int), Constant Field Values

orix

protected transient double orix
Origin x.


oriy

protected transient double oriy
Origin y.


oriz

protected transient double oriz
Origin z.


propertyContainer

protected transient MPropertyContainer propertyContainer

useOnlyFirstAtomInStereoCalculation

protected transient boolean useOnlyFirstAtomInStereoCalculation
Constructor Detail

MoleculeGraph

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

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

MoleculeGraph

public MoleculeGraph()
Construct a molecule.

Method Detail

getDocument

public MDocument getDocument()
Gets the document object.

Returns:
a Marvin document object
Since:
Marvin 3.3

getParentDocument

protected MDocument getParentDocument()
Gets the document or the document of the parent graph. Moved to separate method because R-groups in RgMolecule should not have a normal document parent. If two R-groups would have a common document parent, then their bounds would be determined incorrectly because the graphics objects are common.

Returns:
the parent document
Since:
Marvin 4.1.1, 08/23/2006

getDocumentForChild

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

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

setDim

public void setDim(int d)
Sets the dimension.

Parameters:
d - 0, 2, or 3
See Also:
setFlags(int)

getDim

public int getDim()
Gets the dimension.

Returns:
0, 2, or 3
See Also:
getFlags()

getFlags

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

Returns:
the flags
Since:
Marvin 5.0.1, 02/10/2008

setFlags

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

Parameters:
f - the flags
Since:
Marvin 5.0.1, 02/10/2008

isAbsStereo

public boolean isAbsStereo()
Gets the absolute stereoconfiguration flag. "Chiral flag" in MDL molfiles.

Returns:
true for absolute, false for relative configuration
See Also:
getFlags()

setAbsStereo

public void setAbsStereo(boolean c)
Sets the absolute stereoconfiguration flag.

Parameters:
c - the absolute stereoconfiguration flag
See Also:
setFlags(int)

clear

public void clear()
Clears the molecule. Does the same as clearForImport() but also clears the nodes vector.

See Also:
clearForImport(java.lang.String), CGraph.nodes

clearForImport

public void clearForImport(java.lang.String format)
Clears the edges vector, the properties, the flags, and sets the origin coordinates to 0. The molecule dimension is set to 2.

Parameters:
format - input file format, neglected
See Also:
CGraph.edges, orix, oriy, oriz, setFlags(int)

removeNode

public void removeNode(CNode node,
                       int cleanupFlags)
Removes a node and its edges with extra options. This method is for internal use only. Use CGraph.removeNode(CNode) instead unless you are sure what you are doing.

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

removeNode

public void removeNode(int i,
                       int cleanupFlags)
Removes a node and its edges with extra options. This method is for internal use only. Use CGraph.removeNode(CNode) instead unless you are sure what you are doing.

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

removeEdge

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

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

setNode0

protected void setNode0(int i,
                        CNode node)
Sets the node at the specified index.

Overrides:
setNode0 in class CGraph
Parameters:
i - node index
node - new node reference

setEdge

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

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

setAtomSetSeqs

public final void setAtomSetSeqs(int id)
Sets the set sequence number of all atoms.

Parameters:
id - the set sequence number
Since:
Marvin 4.0

setBondSetSeqs

public final void setBondSetSeqs(int id)
Sets the set sequence number of all bonds.

Parameters:
id - the set sequence number
Since:
Marvin 4.0

setSetSeqs

public final void setSetSeqs(int id)
Deprecated. as of Marvin 4.0, replaced by setAtomSetSeq

Parameters:
id - the set sequence number
Since:
Marvin 2.9.1

addExplicitHydrogens

public boolean addExplicitHydrogens(int f)
Adds explicit H atoms instead of the current implicit ones.

Parameters:
f - flags specifying special features, otherwise if f is 0, then the result equals with hydrogenize(true).
Returns:
true for success, false if an error occured
Throws:
java.lang.SecurityException - cannot load module because of a security problem (firewall)
Since:
Marvin 4.1.3, 02/11/2006
See Also:
OMIT_POSTCLEAN

addExplicitHydrogens

public boolean addExplicitHydrogens(int f,
                                    MolAtom[] atoms)
Adds explicit H atoms instead of the current implicit ones.

Parameters:
f - flags specifying special features, otherwise if f is 0, then the result equals with hydrogenize(true).
atoms - add hydrogens to these atoms only
Returns:
true for success, false if an error occured
Throws:
java.lang.SecurityException - cannot load module because of a security problem (firewall)
Since:
Marvin 5.0, 02/23/2007
See Also:
OMIT_POSTCLEAN

hydrogenize

public boolean hydrogenize(boolean add)
Implicit/explicit Hydrogen conversion. Adds explicit H atoms instead of the current implicit ones, or removes explicit H atoms and increases the number of implicit hydrogens.

Parameters:
add - add explicit H atoms if true, remove if false
Returns:
true for success, false if an error occured
Throws:
java.lang.SecurityException - cannot load module because of a security problem (firewall)

addExplicitLonePairs

public void addExplicitLonePairs()
Adds explicit lone pairs.

Throws:
java.lang.SecurityException - cannot load module because of a security problem (firewall)
Since:
Marvin 3.5, 07/06/2004

removeExplicitLonePairs

public void removeExplicitLonePairs()
Removes explicit lone pairs.

Throws:
java.lang.SecurityException - cannot load module because of a security problem (firewall)
Since:
Marvin 3.5, 07/06/2004

implicitizeHydrogens

public