chemaxon.struc
Class RgMolecule

java.lang.Object
  extended by chemaxon.struc.MoleculeGraph
      extended by chemaxon.struc.Molecule
          extended by chemaxon.struc.RgMolecule
All Implemented Interfaces:
chemaxon.core.calculations.valencecheck.MoleculeWithValence<MolAtom>, Incomplecule, chemaxon.struc.MObjectContainer, chemaxon.struc.MoleculeForBuilder, MTransformable, chemaxon.struc.RgMoleculeGraphIface, StereoConstants, java.io.Serializable

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.3, 10/07/2009
Author:
Peter Csizmadia, Szilveszter Juhos
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class chemaxon.struc.MoleculeGraph
MoleculeGraph.ValenceCheckState
 
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_AMBIGUOUS, AROM_BASIC, AROM_CHEMAXON, AROM_DAYLIGHT, AROM_GENERAL, AROM_LOOSE, AROM_SUBSTRUCTURE, atomCount, AUTO_UNGROUP, bondCount, btab, CACHE_REMOVE_ALL, CACHE_REMOVE_AROMATAMODULE, CACHE_REMOVE_CACHEMEMORY, CACHE_REMOVE_GRINVMODULE, CACHE_REMOVE_PARITYMODULE, CACHE_REMOVE_SSSRMODULE, CACHE_REMOVE_TABS, cacheMemory, ctab, DEAROM_GENERAL, DEAROM_HUCKELCHECK, DEAROM_HUCKELCHECK_EX, DIM_MASK, FRAG_BASIC, FRAG_KEEPING_MULTICENTERS, FRAG_KEEPING_SGROUPS, FRAG_TYPE_COUNT, gearch, GRINV_DONT_STORE, GRINV_NOHYDROGEN, GRINV_OLDSTEREO, GRINV_STEREO, GRINV_USEMAPS, GRINV_VALUE_OPTIONS, grinvCC, INITIAL_CAPACITY, INVALID_LINKNODE_MESSAGE, MIN_RING_SIZE_FOR_TRANS_DB, OMIT_POSTCLEAN, orix, oriy, oriz, parentGraph, propertyContainer, RMCLEANUP_ALL, RMCLEANUP_EDGES, RMCLEANUP_FIXCOMPONENT, RMCLEANUP_MOBJECT, RMCLEANUP_NONE, RMCLEANUP_PARENTDOC, RMCLEANUP_STEREO, superGraph, theAtoms, theBonds, useOnlyFirstAtomInStereoCalculation, VALENCE_CHECK, VALENCE_CHECK_AMBIGUOUS
 
Fields inherited from interface chemaxon.struc.StereoConstants
ANTI, ATOMSTEREO_EITHER, ATOMSTEREO_MASK, ATOMSTEREO_NONE, ATOMSTEREO_SPECIFIC, CHIRALITY_M, CHIRALITY_MASK, CHIRALITY_P, CHIRALITY_r, CHIRALITY_R, CHIRALITY_s, CHIRALITY_S, CHIRALITYSUPPORT_ALL, CHIRALITYSUPPORT_NONE, CHIRALITYSUPPORT_SELECTED, CIS, CTUMASK, CTUNKNOWN, CTUNSPEC, DBS_ALL, DBS_MARKED, DBS_NONE, ENDO, EXO, PARITY_ALLENE, PARITY_EITHER, PARITY_EVEN, PARITY_MASK, PARITY_ODD, PARITY_TETRAHEDRAL, PARITY_UNSPEC, STGRP_ABS, STGRP_AND, STGRP_NONE, STGRP_OR, SYN, TRANS
 
Constructor Summary
RgMolecule()
          Creates a 2 dimensional RgMolecule.
 
Method Summary
 void add(MolAtom node)
          Adds an atom to the root structure.
 void add(MolBond edge)
          Adds a bond to the root structure.
protected  void addAtomToFragment(MolAtom atom)
          Adds an atom to a fragment.
 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)
          Aromatizes molecule.
 void aromatize(int method, boolean checkAmbiguity)
          Aromatizes molecule.
 boolean canBeReactionComponent()
          Tests whether an object of this class can be a reaction component.
 void checkConsistency()
          Deprecated.  
 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()
           
 void clonecopy(int[] iatoms, MoleculeGraph g)
          Copies the specified atoms of this graph to another one.
 void clonecopy(MoleculeGraph g)
          Make another molecule identical to this one.
 void clonelesscopy(MoleculeGraph g)
          Copy to selection.
 Molecule cloneMolecule()
          Make an identical copy of the molecule.
 boolean contains(MolAtom node)
          Checks if the root structure or an R-group contains the specified node.
 boolean contains(MolBond edge)
          Checks if the root structure or an R-group contains the specified edge.
protected  chemaxon.struc.gearch.MoleculeGraphGearch createGearch()
           
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(MoleculeGraph g, boolean check)
          Add the atoms and bonds of another molecule.
protected  void fuse0(MoleculeGraph graph, boolean check)
          Add those nodes and edges of a graph that are not already elements.
 java.util.List<MObject> getAllObjects()
           
 MolAtom getAtom(int i)
          Gets a node in the graph union.
 int getAtomCount()
          Gets the number of nodes in the root structure.
 int getAtomCount(int atomicNumber)
          Gets the number of atoms with the given atomic number in the root structure.
 MolBond getBond(int i)
          Gets an edge in the graph union.
 int getBondCount()
          Gets the number of edges in the root structure.
 chemaxon.core.util.BondTable getBondTable()
          Gets the bond table of the root structre.
 int[][] getBtab()
          Deprecated. as of Marvin 5.4, please use getBondTable() instead
 java.lang.String getComment()
          Gets the comment of the root molecule.
 int[][] getCtab()
          Gets the connection table of the root structure.
protected  MDocument getDocumentForChild(MoleculeGraph g)
          Gets the parent document for a child graph.
 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.
 int getLocalParity(int i)
          Computes the local parity of an atom of the RgMolecule instance based on both the coordinates of the neighboring atoms and the stereo information of the bonds to those.
 int getLonePairCount(int i)
          Gets the number of lone pairs.
 double getMass()
          Calculates the molecular weight of the molecule.
 int getMaxAttachmentPointOrder(int rgroupID)
          Gets the maximal attachment point order of R-group definition molecules specified by an R-group ID.
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.
 int getObjectCount()
           
 int getParity(int i)
          Computes the parity of an atom of the RgMolecule instance based on both the coordinates of the neighboring atoms and the stereo information of the bonds to those.
 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(MolAtom 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.
 int indexOf(MolAtom node)
          Gets the index of the specified node in the graph union.
 int indexOf(MolBond edge)
          Gets the index of the specified edge in the graph union.
protected  void insertNullAtoms(int i, int count)
          Insert nulls into the atom array.
protected  void insertNullBonds(int i, int count)
          Insert nulls into the bond 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 isRealAtomParent()
          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(MoleculeGraph g)
          Copies some properties of this molecule to the other one specified as argument.
 void mergeAtoms(MolAtom that, MolAtom a)
          Merges bonds of an atom with another atom, then add the atom to the molecule.
 MoleculeGraph newInstance()
          Creates a new RgMolecule object.
 SelectionMolecule newSelectionMolecule()
          Creates a new SelectionMolecule object appropriate for storing selection from this molecule.
 MPropertyContainer properties()
          Gets the property container.
 void regenBonds()
          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 removeAllBonds()
          Remove all bonds from the root structure, and from all the R-groups.
 void removeAtom(int i, int cleanupFlags)
          Removes an atom and its bonds from the root structure.
 void removeAtom(MolAtom node, int cleanupFlags)
          Removes an atom and its bonds from the root structure and from all the R-groups.
protected  void removeBond(int i, int cleanupFlags)
          Remove a bond from the root structure.
protected  void removeBond(MolBond edge, int cleanupFlags)
          Remove a bond from the root structure, and from all the R-groups.
 void removeObject(MObject mo)
           
 void removeRgroup(int definition)
          Removes an R-group Note: the R-group definitions are always indexed continuously starting with 0
 void removeRgroupMember(int definition, int member)
          Removes an R-group member.
 void removeRgroupMembers(int definition, int[] members)
          Removes R-group members.
 void replaceAtomsWithNewRgroup(SelectionMolecule sel, int rgid)
          Replaces selected atoms with a new R-group.
 void replaceBond(MolBond olde, MolBond 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(MolAtom node)
          Finds the ID of the R-group (the number in R#) that contains the specified atom.
 int rgroupIndexOf(MolAtom node)
          Finds the index of the R-group (the number in R#) that contains the specified atom.
 void selectAllObjects(boolean s)
           
 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 setAtom(int iu, MolAtom node)
          Sets the node at the specified index in the graph union.
 void setBond(int iu, MolBond edge)
          Sets the edge at the specified index in the graph union.
 void setComment(java.lang.String s)
          Sets the comment of the root molecule.
 void setDim(int d)
          Sets the dimension of the root structure and the R-groups.
protected  void setFlags(int f)
          Sets the dimension and chiral flags.
protected  void setFlags(int f, int mask)
          Sets specified bits in the 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 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 sortBondsAccordingTo(MolBond[] order)
          Sort edges in the same order as they appear in the specified array.
 boolean stereoClean()
          Reset the wedges of the molecule, based on the actual parity information in 2D remove wedges in 3D.
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
addAtom0, addBond0, addSgroup, addSgroupClones, addSgroupsOf, bondlength, clear, clearExtraLabels, clearProperties, clone, clonecopyWithoutSgroups, cloneMoleculeWithDocument, contractSgroups, convertToFrags, countExpandableContractableSgroups, countOrderedComponentSgroups, dearomatize, expandSgroups, expandSgroups, exportToBinFormat, exportToFormat, exportToObject, findAllSgroupContaining, findContainingMulticenterSgroup, findContractableSgroup, findExpandableSgroup, findFrags, findSgroupContaining, findSgroupOf, findSmallestSgroupContaining, getEndPosition, getFreeAttachmentPoints, getFreeAttachmentPoints, getGraphUnionAsSelection, getInputFormat, getProperty, getPropertyCount, getPropertyKey, getPropertyKeys, getPropertyObject, getRootSgroups, getSgroup, getSgroupArray, getSgroupCount, getSgroupLigands, getSimplifiedMolecule, getSortedSgroups, getStartPosition, getVisibleCoords, implicitizeHydrogens0, indexOf, isExpandable, isGUIContracted, isMolecule, isSgroup, mergeFrags, removeAllSgroups, removeSgroupFromList, removeSgroupsOf, removeSgroupsOf, reparentSgroups, replaceSgroup, residueSymbolOf, residueTypeOf, setAtom0, setEndPosition, setGUIContracted, setGUIContracted, setProperty, setPropertyObject, setStartPosition, sortSgroupXBonds, toBinFormat, toFormat, toObject, ungroupSgroup, ungroupSgroup, ungroupSgroup, ungroupSgroup, ungroupSgroups, ungroupSgroups
 
Methods inherited from class chemaxon.struc.MoleculeGraph
addAtomsAndBondsTo, addAtomWithoutChangingIt, addBondWithoutChangingIt, addExplicitHydrogens, addExplicitHydrogens, addExplicitLonePairs, adjustMultiChiralFlag, aromatize, aromatize, arrangeComponents, calcCenter, calcCenter, calcDehydrogenizedGrinv, calcHeight, calcHybridization, calcOutRect, calcOutRect, calcOutRectCenter, calcOutRectCenter, calcWidth, canBeCT, canBeCT, canBeCT, checkBondConsistency, clean, clean, clearCachedInfo, clonecopyMoleculeGraphWithoutSgroups, contains, createBHtab, createCHtab, createDehydrogenizedReadOnlyGraph, createSmolecule, dearomatize, findAtom, findAtomClone, findBasicFrags, findBond, findComponentIds, findComponentIds, findFrag, findFrag, findFragById, findFragById, findFrags, findFrags, findInArray, fuse, getAromaticAndAliphaticRings, getAromrings, getAromrings, getAtomArray, getAtomicNumber, getAtomReferenceList, getBondArray, getBonds, getCharge, getChirality, getCSSR, getDesiredLength, getDesiredLength, getDim, getDocument, getEdge, getEdgeArray, getEdgeCount, getEdgeVector, getEnclosingCube, getExactMass, getExplicitHcount, getExplicitLonePairCount, getForefather, getFormalCharge, getFragCount, getFragCount, getFragIds, getFragIds, getGrinv, getGrinv, getGrinv, getGrinv, getGrinvCC, getGrinvOptions, getImplicitHcount, getImplicitHCount, getLigand, getLigandAtno, getLigandBondType, getLigandCount, getLocation, getLock, getMaxRgroupAttachmentPointOrder, getNode, getNodeCount, getNodeVector, getNonAromrings, getNonAromrings, getParent, getParentDocument, getParityType, getPoints, getPossibleAttachmentPoints, getRadicalCount, getSmallestRingSizeForIdx, getSSSR, getSSSRBonds, getSSSRBondSet, getSSSRBondSetInLong, getSSSRIdxesForAtoms, getStereo2, getStereo2, getStereo2, getStereo2, getStereo2, getStereo2, getStereo2, getSubGraphs, getTotalCharge, getValenceCheckState, getValenceProperty, hasExplicitLonePairs, hasExtraLabelSet, hasImplicitH, hasSelfReferringProperty, hasValenceError, hydrogenize, implicitizeHydrogens, implicitizeHydrogens, implicitizeHydrogens, incGrinvCC, incGrinvCCOnly, insertAtom, insertBond, insertBondInOrder, insertEdge, insertEdgeInOrder, insertNode, isAbsStereo, isAcceptedSpecialLigand, isAtomInRing, isGrinvCCValid, isLargeMolecule, isMultiChiral, isolate, isolate, isOnlyFirstAtomInStereoCalculation, isRing, isRingBond, isSimilarTo, isSymmetric, isValenceCheckEnabled, isValidLinkNode, mergeFrags, mergeFrags, mergeNodes, moveTo, pack, partialClean, partialClean, partialClean, qpropCheck, regenCtabs, regenEdges, regenGearch, removeAllEdges, removeAtom, removeAtom, removeBond, removeBond, removeEdge, removeEdge, removeExplicitLonePairs, removeIsolatedAtoms, removeIsolatedBonds, removeNode, removeNode, removeNode, removeNode, replaceEdge, resetCtab, resetGrinvInParents, restoreCache, saveCache, setAtomSetSeqs, setBondSetSeqs, setChirality, setEdge, setGrinvCC, setGrinvOptions, setLinkNodeDefaultOuters, setLocalParity, setLocalParity, setNode, setParity, setParity, setParity, setSetSeqs, setValenceCheckEnabled, setValenceCheckState, smol, sortEdgesAccordingTo, transform, updateDim, useOnlyFirstAtomInStereoCalculation, valenceCheck, valenceCheck
 
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 a 2 dimensional 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

removeRgroupMember

public void removeRgroupMember(int definition,
                               int member)
                        throws chemaxon.struc.IllegalRgroupDefinitionException,
                               chemaxon.struc.IllegalRgroupMemberException
Removes an R-group member. If it is the last member to be removed then the whole R-group definition will be removed Note: the R-group members are always indexed continuously starting with 0

Parameters:
definition - the iteration number of the R-group definition
member - the iteration number of the member
Throws:
IllegalRgroupDefinitionException - If the definition index is not valid
IllegalRgroupMemberException - If the member index is not valid
Since:
5.10 2012.05.10

removeRgroupMembers

public void removeRgroupMembers(int definition,
                                int[] members)
                         throws chemaxon.struc.IllegalRgroupDefinitionException,
                                chemaxon.struc.IllegalRgroupMemberException
Removes R-group members. If the last member is removed then the whole R-group definition will be removed Note: the R-group members are always indexed continuously starting with 0

Parameters:
definition - the iteration number of the R-group definition
members - the array of the iteration numbers of the members
Throws:
IllegalRgroupDefinitionException - If the definition index is not valid
IllegalRgroupMemberException - If a member index is not valid
Since:
5.10 2012.05.10

removeRgroup

public void removeRgroup(int definition)
                  throws chemaxon.struc.IllegalRgroupDefinitionException
Removes an R-group Note: the R-group definitions are always indexed continuously starting with 0

Parameters:
definition - the iteration number of the R-group definition
Throws:
IllegalRgroupDefinitionException - If the definition index is not valid
Since:
5.10 2012.05.10

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:
MoleculeGraph.theBonds, 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 Incomplecule
Overrides:
getName in class Molecule
Returns:
the molecule name or an empty string

setComment

public void setComment(java.lang.String s)
Sets the comment of the root molecule.

Overrides:
setComment in class Molecule
Parameters:
s - the comment, empty string or null (null is equivalent to empty string)

getComment

public java.lang.String getComment()
Gets the comment of the root molecule.

Overrides:
getComment in class Molecule
Returns:
the comment or empty string

properties

public MPropertyContainer properties()
Gets the property container.

Specified by:
properties in interface Incomplecule
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 MoleculeGraph
Returns:
the ctab array

getBtab

public int[][] getBtab()
Deprecated. as of Marvin 5.4, please use getBondTable() instead

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 MoleculeGraph
Returns:
the btab array

getBondTable

public chemaxon.core.util.BondTable getBondTable()
Gets the bond table of the root structre. If there is no bond table for the molecule, then create it. btab.elementAt(i, j) will be the index of the bond between atoms i and j, or -1 if there is no bond.

Overrides:
getBondTable in class MoleculeGraph
Returns:
the btab array
Since:
Marvin 5.4

rgroupIdOf

public int rgroupIdOf(MolAtom 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(MolAtom 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(MolAtom 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
See Also:
MoleculeGraph.flags

setFlags

protected void setFlags(int f,
                        int mask)
Sets specified bits in the flags.

Overrides:
setFlags in class MoleculeGraph
Parameters:
f - new value of the specified bits
mask - bits to set

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)

getAtomCount

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

Specified by:
getAtomCount in interface Incomplecule
Overrides:
getAtomCount in class MoleculeGraph
Returns:
number of nodes

getAtomCount

public int getAtomCount(int atomicNumber)
Gets the number of atoms with the given atomic number in the root structure. When atomicNumber is 1, sum includes only explicit Hydrogen atoms (but also D and T isotopes).

Overrides:
getAtomCount in class MoleculeGraph
Parameters:
atomicNumber - atomic number of atoms looked for
Returns:
number of atoms with the given atomic number
Since:
Marvin 5.5, 27/01/2011

getAtom

public MolAtom getAtom(int i)
Gets a node in the graph union.

Overrides:
getAtom in class MoleculeGraph
Parameters:
i - node index
Returns:
the node object

setAtom

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

Overrides:
setAtom in class MoleculeGraph
Parameters:
iu - the atom index
node - the atom

add

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

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

addAtomToFragment

protected void addAtomToFragment(MolAtom atom)
Adds an atom to a fragment. S-groups are added only if all atoms are already in the molecule.

Overrides:
addAtomToFragment in class Molecule
Parameters:
atom - the atom reference

insertNullAtoms

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

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

insertNullBonds

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

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

getBondCount

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

Specified by:
getBondCount in interface Incomplecule
Overrides:
getBondCount in class MoleculeGraph
Returns:
number of edges

getBond

public MolBond getBond(int i)
Gets an edge in the graph union.

Overrides:
getBond in class MoleculeGraph
Parameters:
i - edge index
Returns:
the edge object

setBond

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

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

replaceBond

public void replaceBond(MolBond olde,
                        MolBond newe)
Replaces an edge by another one.

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

add

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

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

indexOf

public int indexOf(MolAtom node)
Gets the index of the specified node in the graph union.

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

indexOf

public int indexOf(MolBond edge)
Gets the index of the specified edge in the graph union.

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

contains

public boolean contains(MolAtom node)
Checks if the root structure or an R-group contains the specified node.

Overrides:
contains in class Molecule
Parameters:
node - the node object
Returns:
true if the graph contains the object, false otherwise

contains

public boolean contains(MolBond edge)
Checks if the root structure or an R-group contains the specified edge.

Overrides:
contains in class MoleculeGraph
Parameters:
edge - the 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
See Also:
MolAtom.isQuery(), MolBond.isQuery()

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

canBeReactionComponent

public boolean canBeReactionComponent()
Tests whether an object of this class can be a reaction component. This implementation returns false, an RgMolecule cannot be a reaction component.

Overrides:
canBeReactionComponent in class Molecule
Returns:
true if it can be a reactant, product or agent, false if adding it to an RxnMolecule is not supported
Since:
Marvin 4.1.13, 09/19/2007

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

getMostSimplifiedMolecule

protected Molecule getMostSimplifiedMolecule()
Gets the simplified molecule object even if there is a parent document with other objects.

Overrides:
getMostSimplifiedMolecule in class Molecule
Returns:
the root structure if there are no R-groups present, this otherwise
Since:
Marvin 4.1.13, 09/20/2007

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

removeAtom

public void removeAtom(MolAtom 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 MoleculeGraph.removeAtom(MolAtom) instead unless you are sure what you are doing.

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

removeAtom

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

Overrides:
removeAtom in class Molecule
Parameters:
i - the atom index
cleanupFlags - extra clean-up methods
Since:
Marvin 3.1
See Also:
MoleculeGraph.RMCLEANUP_NONE, MoleculeGraph.RMCLEANUP_ALL, MoleculeGraph.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

removeBond

protected void removeBond(MolBond edge,
                          int cleanupFlags)
Remove a bond from the root structure, and from all the R-groups.

Overrides:
removeBond in class Molecule
Parameters:
edge - the bond
cleanupFlags - extra clean-up methods
Since:
Marvin 3.1
See Also:
MoleculeGraph.RMCLEANUP_NONE, MoleculeGraph.RMCLEANUP_ALL, MoleculeGraph.RMCLEANUP_EDGES, MoleculeGraph.RMCLEANUP_STEREO, Molecule.RMCLEANUP_SGROUPATOMS, Molecule.RMCLEANUP_FROMSGROUPS

removeBond

protected void removeBond(int i,
                          int cleanupFlags)
Remove a bond from the root structure.

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

removeAllBonds

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

Overrides:
removeAllBonds 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

isRealAtomParent

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

Overrides:
isRealAtomParent in class MoleculeGraph
Returns:
false
Since:
Marvin 3.0

regenBonds

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

Overrides:
regenBonds in class MoleculeGraph

sortBondsAccordingTo

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

Overrides:
sortBondsAccordingTo in class MoleculeGraph
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(MoleculeGraph g,
                 boolean check)
Add the atoms and bonds of another molecule.

Overrides:
fuse in class MoleculeGraph
Parameters:
g - the other molecule
check - true if a containment check should be performed to ensure that only those nodes and edges are added that are not already elements - false if the graph is known to be disjoint from this graph and this check can be safely skipped
Since:
Marvin 5.0

checkConsistency

public void checkConsistency()
Deprecated. 

Checks the internal consistency of the structure. Use this method for debugging.

Overrides:
checkConsistency in class Molecule
Throws:
java.lang.RuntimeException - if inconsistency found
Since:
Marvin 5.0, 11/06/2007

fuse0

protected void fuse0(MoleculeGraph graph,
                     boolean check)
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
check - true if a containment check should be performed to ensure that only those nodes and edges are added that are not already elements - false if the graph is known to be disjoint from this graph and this check can be safely skipped
Since:
Marvin 5.0

mergeAtoms

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

Overrides:
mergeAtoms 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(MoleculeGraph g)
Make another molecule identical to this one.

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

clonecopy

public void clonecopy(int[] iatoms,
                      MoleculeGraph g)
Copies the specified atoms of this graph to another one. The RgMolecule implementation of this method is incomplete, R-groups are not handled.

Overrides:
clonecopy in class Molecule
Parameters:
iatoms - array of atom indices to copy
g - the target graph
Since:
Marvin 5.0.2, 03/11/2008

isSelfReference

public boolean isSelfReference(MProp p)
Tests whether the specified property is a self reference to the molecule.

Overrides:
isSelfReference in class MoleculeGraph
Parameters:
p - the property
Since:
Marvin 4.1.6, 02/11/2007

fixSelfReferringProperty

protected boolean fixSelfReferringProperty(MProp prop)
Fix a property containing reference to the molecule. Called from clonelesscopy().

Overrides:
fixSelfReferringProperty in class Molecule
Parameters:
prop - the property
Since:
Marvin 4.1.6, 02/14/2007
See Also:
MoleculeGraph.clonecopy(MoleculeGraph)

clonelesscopy

public void clonelesscopy(MoleculeGraph 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 MoleculeGraph 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(MoleculeGraph 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, MolImportModule.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

getLonePairCount

public int getLonePairCount(int i)
Gets the number of lone pairs.

Overrides:
getLonePairCount in class MoleculeGraph
Parameters:
i - atom index
Returns:
the number of lone pairs

aromatize

public void aromatize(int method)
Aromatizes molecule. Changes 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

aromatize

public void aromatize(int method,
                      boolean checkAmbiguity)
Aromatizes molecule. Changes 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
checkAmbiguity - Specifies whether ANY bonds should be considered during aromatization.
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

checkSgroupConsistency

protected void checkSgroupConsistency()
Checks the consistency of S-groups.

Overrides:
checkSgroupConsistency in class Molecule
Throws:
java.lang.RuntimeException - if inconsistency found
Since:
Marvin 5.0, 11/06/2007

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

sumConservedQuantities

protected void sumConservedQuantities(MolAtom a,
                                      int[] atoms,
                                      int sign)
For internal use only.

Overrides:
sumConservedQuantities in class MoleculeGraph
Since:
Marvin 4.1.13, 09/19/2007
See Also:
RxnMolecule.isIncompleteReaction()

createGearch

protected chemaxon.struc.gearch.MoleculeGraphGearch createGearch()
Overrides:
createGearch in class Molecule

getMaxAttachmentPointOrder

public int getMaxAttachmentPointOrder(int rgroupID)
Gets the maximal attachment point order of R-group definition molecules specified by an R-group ID. The attachment point order of an R-gruop definition molecule is the maximal attachment point order of its atoms.

Parameters:
rgroupID - the rgroup identifier to specify the R-group definition molecules.
Returns:
the maximal attachment point order of the definition molecules.
Since:
Marvin 5.4

clearObjects

public void clearObjects()
Specified by:
clearObjects in interface chemaxon.struc.MObjectContainer
Overrides:
clearObjects in class Molecule

getObjectCount

public int getObjectCount()
Specified by:
getObjectCount in interface chemaxon.struc.MObjectContainer
Overrides:
getObjectCount in class Molecule

removeObject

public void removeObject(MObject mo)
Specified by:
removeObject in interface chemaxon.struc.MObjectContainer
Overrides:
removeObject in class Molecule

selectAllObjects

public void selectAllObjects(boolean s)
Specified by:
selectAllObjects in interface chemaxon.struc.MObjectContainer
Overrides:
selectAllObjects in class Molecule

getAllObjects

public java.util.List<MObject> getAllObjects()
Specified by:
getAllObjects in interface chemaxon.struc.MObjectContainer
Overrides:
getAllObjects in class Molecule

getParity

public int getParity(int i)
Computes the parity of an atom of the RgMolecule instance based on both the coordinates of the neighboring atoms and the stereo information of the bonds to those. Leaves the imported parity unchanged.

Overrides:
getParity in class MoleculeGraph
Parameters:
i - the index of the atom whose parity is to be determined
Returns:
0 for nonchiral, PARITY_ODD or PARITY_EVEN for atoms of odd or even parity, PARITY_ODD|PARITY_EVEN for atoms whose parity is unspecified or cannot be assigned -as they are defined in MolAtom
Throws:
java.lang.SecurityException - the Parity module cannot be loaded because of security reasons (firewall)
See Also:
StereoConstants.PARITY_ODD, StereoConstants.PARITY_EVEN, MoleculeGraph.isAbsStereo(), setAbsStereo(boolean, int, int), MoleculeGraph.getParity(int)

getLocalParity

public int getLocalParity(int i)
Computes the local parity of an atom of the RgMolecule instance based on both the coordinates of the neighboring atoms and the stereo information of the bonds to those. The molecule symmetry is not checked, so even an atom with same ligands can have parity. Leaves the imported parity unchanged. Contracted sgroups must be expanded to achieve consistent result.

Overrides:
getLocalParity in class MoleculeGraph
Parameters:
i - the index of the atom whose parity is to be determined
Returns:
PARITY_ODD or PARITY_EVEN for atoms of odd or even parity, PARITY_EITHER for atoms with wiggly bond 0 for atoms whose parity is unspecified or not known.
Throws:
java.lang.SecurityException - the Parity module cannot be loaded because of security reasons (firewall)
See Also:
StereoConstants.PARITY_ODD, StereoConstants.PARITY_EVEN, StereoConstants.PARITY_EITHER, MoleculeGraph.isAbsStereo(), setAbsStereo(boolean, int, int), MoleculeGraph.getLocalParity(int)

stereoClean

public boolean stereoClean()
Reset the wedges of the molecule, based on the actual parity information in 2D remove wedges in 3D. Take care of expanding the molecule if neccessary.

Overrides:
stereoClean in class MoleculeGraph
Returns:
true if succesful
See Also:
MoleculeGraph.stereoClean()