chemaxon.struc
Class RxnMolecule

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

public class RxnMolecule
extends Molecule
implements chemaxon.struc.MObjectContainer

Reaction.

Since:
Marvin 2.9
Version:
5.3, 10/16/2009
Author:
Peter Csizmadia, Szilveszter Juhos, Erika Biro, Zsuzsanna Szabo
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class chemaxon.struc.MoleculeGraph
MoleculeGraph.ValenceCheckState
 
Field Summary
static int AGENTS
          "Agent" structure type.
static int EQUILIBRIUM
          Resonance arrow, the same as the two-headed double reaction arrow.
static int PRODUCTS
          "Product" structure type.
static int REACTANTS
          "Reactant" structure type.
static int REGULAR_DOUBLE
          Regular double reaction arrow type.
static int REGULAR_SINGLE
          Regular single reaction arrow type.
static int RESONANCE
          Resonance arrow, the same as the two-headed single reaction arrow.
static int RETROSYNTHETIC
          Retrosynthetic arrow, the same as the regular double reaction arrow.
static int RGROUPED
          Add R-groups to component structure.
static int TWO_HEADED_DOUBLE
          Two headed double reaction arrow type.
static int TWO_HEADED_SINGLE
          Two headed single reaction arrow type.
static int TYPE_COUNT
          Number of structure types.
static int TYPE_MASK
          Component type mask.
 
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
RxnMolecule()
          Create a reaction.
 
Method Summary
 void add(MolAtom a)
          Adds an atom to a reactant, product or agent structure.
 void add(MolBond e)
          Adds a bond to a reactant, product, agent.
protected  void addAtomToFragment(MolAtom a)
          Adds an atom to a fragment.
 void addComponent(Molecule m, int type)
          Adds a reactant, product or agent.
 void addComponent(Molecule m, int type, boolean beNew)
          Adds a reactant, product or agent.
 void addReactionStep(java.util.ArrayList reactants, java.util.ArrayList products, java.util.ArrayList agents, chemaxon.struc.graphics.MRArrow arrow, int arrowType)
           
 void addStructure(Molecule m, int type)
          Deprecated. as of Marvin 4.1, replaced by addComponent(Molecule, int)
 void addStructure(Molecule m, int type, boolean beNew)
          Deprecated. as of Marvin 4.1, replaced by addComponent(Molecule, int, boolean)
 boolean canBeReactionComponent()
          Tests whether an object of this class can be a reaction component.
protected  void checkSgroupConsistency()
          Checks the consistency of S-groups.
 void clearForImport(java.lang.String fmt)
          Clear the edges vector and the properties.
 void clearObjects()
          Deletes the graphical objects from this.
 void clonecopy(int[] iatoms, MoleculeGraph g)
          Copies the specified nodes and edges 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 a reactant, agent or product structure contains the specified node.
 boolean contains(MolBond edge)
          Checks if a reactant, agent or product structure contains the specified edge.
 int[][] createBHtab()
          Creates the graph union's bond table extended with implicit hydrogen atoms.
 int[][] createCHtab()
          Creates the graph union's connection table extended with implicit hydrogen atoms.
protected  chemaxon.struc.gearch.MoleculeGraphGearch createGearch()
           
static RxnMolecule createReaction(Molecule mol, DPoint3[] arw, int art)
          Creates a reaction.
static RxnMolecule createReaction(MoleculeGraph mol, DPoint3[] arw)
          Creates a reaction.
static double determineArrowDistance(double x, double y, double z, DPoint3[] ar)
          Project the point (x,y,z) to the line of the reaction arrow 'ar'.
 int determineType(double x, double y, double z)
          Determines whether a point should be in a reactant, in a product or in an agent.
static int determineType(double x, double y, double z, DPoint3[] ar)
          Determines whether a point should be in a reactant, in a product or in an agent.
protected  void fillSelectionMolecule(SelectionMolecule s)
          Adds all atoms and bonds of the root structure and the R-groups to the specified molecule.
 void fuse(MoleculeGraph graph, 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.
 Molecule getAgent(int i)
          Gets an agent.
 int getAgentCount()
          Gets the number of agents.
 Molecule[] getAgents()
          Gets all agents in an array.
 java.util.List<Molecule> getAllFragments()
          Gets the list of reaction fragments (product, reactant, agent components) that build up this reaction.
 java.util.List<MObject> getAllObjects()
           
 MPropertyContainer getArrowAsProperty()
          Gets the properties (type, endpoint coordinates) of the reaction arrow in this reaction.
 MolAtom getAtom(int i)
          Gets a node.
 int getAtomCount()
          Returns the number of nodes in the graph union.
 int getAtomCount(int atomicNumber)
          Gets the number of atoms with the given atomic number in the unified molecule graph of the reaction.
 MolBond getBond(int i)
          Gets an edge.
 int getBondCount()
          Gets the number of edges in the graph union.
 chemaxon.core.util.BondTable getBondTable()
          Gets the bond table for the graph union.
 int[][] getBtab()
          Deprecated. as of Marvin 5.4, please use getBondTable() instead
 DPoint3 getCenter(int type, int i)
          Gets the geometrical center of a reaction component.
 Molecule getComponent(int flags, int i)
          Gets a reactant, product or agent.
 Molecule getComponent(long id)
          Gets a reactant, product or agent.
 int getComponentCount(int type)
          Gets the number of reactants, products or agents.
 int getComponentFlags(long id)
          Gets the reaction component type flags from the ID.
 long getComponentID(MolAtom a)
          Gets the reaction component ID of an atom.
 long getComponentID(MolBond b)
          Gets the reaction component ID of a bond.
 long getComponentID(Molecule m)
          Gets the ID of a reaction component.
 int getComponentIndex(long id)
          Gets the reactant, product or agent index from the ID.
 int getComponentType(long id)
          Gets the reaction component type from the ID.
 int[][] getCtab()
          Gets the connection table for the graph union.
 java.lang.String getFormula()
          Gets the molecular formula in Hill order.
 MoleculeGraph getGraphUnion()
          Gets a graph containing all the atoms and bonds.
 chemaxon.struc.graphics.MRArrow getItsArrow()
          Gets the reaction arrow of this reaction.
 int getLocalParity(int i)
          Computes the local parity of an atom of the RxnMolecule instance based on both the coordinates of the neighboring atoms and the stereo information of the bonds to those.
 double getMass()
          Calculates the molecular weight of the molecule.
 java.util.Map<chemaxon.struc.graphics.MRArrow,RxnMolecule> getMSLogic()
          Gets the hash that stores arrow - reaction mapping.
 int getObjectCount()
           
 int getParity(int i)
          Computes the parity of an atom of the RxnMolecule instance based on both the coordinates of the neighboring atoms and the stereo information of the bonds to those.
 Molecule getProduct(int i)
          Gets a product.
 int getProductCount()
          Gets the number of products.
 Molecule[] getProducts()
          Gets all products in an array.
 Molecule getReactant(int i)
          Gets a reactant.
 int getReactantCount()
          Gets the number of reactants.
 Molecule[] getReactants()
          Gets all reactants in an array.
static RxnMolecule getReaction(MoleculeGraph g)
          Returns the reaction represented by the given molecule if exists, otherwise null.
 DPoint3[] getReactionArrow()
          Gets a two-element array containing the endpoints of the reaction arrow.
 chemaxon.struc.graphics.MRArrow getReactionArrow(boolean generate)
          Gets the reaction arrow of this reaction with the possibility to generate an arrow if the arrow is not yet set.
 java.util.List<chemaxon.struc.graphics.MRArrow> getReactionArrowList()
          Gets the list of the reaction arrows of this reaction.
 int getReactionArrowType()
          Gets the reaction arrow type.
 java.lang.String getReactionArrowTypeName()
          Gets the reaction arrow type name.
 java.util.ArrayList<RxnMolecule> getReactionSteps()
          Divides this reaction into simple step reactions if this is a multistep reaction.
 Molecule getStructure(int flags, int i)
          Deprecated. as of Marvin 4.1, replaced by getComponent(int, int)
 int getStructureCount(int type)
          Deprecated. as of Marvin 4.1, replaced by getComponentCount(int)
protected  int getSubGraphCount()
          Gets the number of all "submolecules".
protected  void getSubGraphs(MoleculeGraph[] arr, int off)
          Gets all "submolecules".
 int getType(MoleculeGraph selection)
          Checks whether the atoms in the selection are all in reactants, products or agents.
 boolean hasAtomSet()
          Tests whether the molecule graph has atom sets.
 boolean hasBondSet()
          Tests whether the molecule graph has atom sets.
 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.
 boolean isAtom()
          A reaction molecule cannot represent an atom.
 boolean isBond()
          A reaction molecule cannot represent a bond.
 boolean isEmpty()
          Ask if the reaction is empty or not.
 boolean isIncompleteReaction()
          Check whether the reaction is incomplete or not.
 boolean isMergedComponent(MoleculeGraph m)
          Check whether given molecule is reaction component with a set of intentionally merged fragments or not.
 boolean isReaction()
          Checks if the structure represents a reaction or not.
protected  boolean isRealAtomParent()
          Reaction molecules cannot be real node parents.
 boolean isSingleStepReaction()
          Decides wheter this reaction is a singlestep or multistep reaction.
protected  void makeItSimilar(MoleculeGraph g)
          Copies some properties of this molecule to the other one specified as argument.
 void mergeAtoms(MolAtom that, MolAtom node)
          Merges bonds of an atom with another atom, then add the atom to the molecule.
 void mergeComponentParts(MoleculeGraph m, int type, boolean isMergeStored)
          Finds those component parts that are contained in the molecule graph m and creates a new component containing all atoms of m, splitting them from the previous merges.
 MoleculeGraph newInstance()
          Creates a new RxnMolecule object.
 void rebuildStructures()
          For each structure (reactant or product) determines whether it should be a reactant or a product depending on its the relative position to the reaction arrow.
 void rebuildStructures(DPoint3[] arw, int art)
          Sets the reaction arrow.
 void recalcReactionArrow()
          Recalculates the coordinates of the reaction arrow from the reactants and products, forced recalculation.
 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()
          Removes all bonds from the reactants, products and agents.
 void removeAtom(int iu, int cleanupFlags)
          Removes an atom from the reactants, products or agents.
 void removeAtom(MolAtom node, int cleanupFlags)
          Removes an atom from the reactants, products or agents.
protected  void removeBond(int iu, int cleanupFlags)
          Removes an edge from a reactant, agent or product.
protected  void removeBond(MolBond edge, int cleanupFlags)
          Removes a bond from the reactants, products or agents.
 Molecule removeComponent(int flags, int i)
          Removes a reactant, product or agent.
 void removeEmptyComponents()
          Checks all the componentes and removes those that are empty (node count is zero).
 void removeObject(MObject o)
          Removes a graphical object from this.
 void removeReactionArrow()
          Removes the reaction arrow of this reacion.
 Molecule removeStructure(int flags, int i)
          Deprecated. as of Marvin 4.1, replaced by removeComponent(int, int)
 void replaceBond(MolBond olde, MolBond newe)
          Replaces an edge by another one.
 void revalidateCoordDependentProps()
          Revalidate coordinate dependent properties.
 void selectAllObjects(boolean s)
           
 void setAbsStereo(boolean c)
          Sets the absolute stereoconfiguration flag for all the structures.
 void setAtom(int iu, MolAtom node)
          Sets the node at the specified index.
 void setBond(int iu, MolBond edge)
          Sets the edge at the specified index.
 void setDim(int d)
          Sets the dimension for all the structures.
 void setLocation(DPoint3 p)
          Set the origin of the molecule.
 void setMSLogic(java.util.Map<chemaxon.struc.graphics.MRArrow,RxnMolecule> ms)
          Sets the hash that stores arrow - reaction mapping.
 void setReactionArrow()
          Sets the stored reaction arrow to its calculated value.
 void setReactionArrow(DPoint3[] arw)
          Sets the endpoint coordinates of the reaction arrow.
 void setReactionArrow(chemaxon.struc.graphics.MRArrow arrow)
          Sets the reaction arrow.
 void setReactionArrow0()
          Sets the stored reaction arrow 'arrowPoints' to its calculated value.
 void setReactionArrowEndPoints(DPoint3[] points)
          Sets the endpoints of the reaction arrow in this reaction.
 void setReactionArrowType(int type)
          Sets the reaction arrow type.
 void setReactionArrowType(java.lang.String name)
          Sets the reaction arrow type from type name.
 void setSgroupParent(MolAtom a, Sgroup sg, boolean set)
          Sets or unsets an S-group as a parent of an atom in reactants, products or agents.
 Molecule simplifyIncompleteReactionToMolecule()
          Simplify a reaction to a molecule if possible.
 Molecule simplifyToMolecule()
          Simplifies this RxnMolecule by moving the atoms and bonds from the reactants, products, and agents to a Molecule.
 void sortBondsAccordingTo(MolBond[] order)
          Sort edges in the same order as they appear in the specified array.
 void splitAllDisconnectedComponents()
          Replaces all disconnected reaction components by its connected fragments in the structure array.
 void splitComponentParts(MoleculeGraph m, int type)
          Finds those component parts that are contained in the molecule graph m and creates separate components from the fragments contained in m, splitting them from the previous merges.
 void splitDisconnectedComponent(int type, int index)
          Replaces a disconnected reaction component by its connected fragments in the structure array.
 void splitDisconnectedComponent(long id)
          Replaces a disconnected reaction component by its connected fragments in the structure array.
 boolean stereoClean()
          Reset the wedges of the molecule, based on the actual parity information in 2D remove wedges in 3D.
 java.lang.String toString()
          Overrides Object.toString() to ease debugging.
 void transform(CTransform3D t, boolean incg)
          Apply a transformation matrix to the atomic coordinates and the reaction arrow.
protected  void transformReactionArrow(CTransform3D t)
          Apply a transformation matrix to the reaction arrow.
 void updateComponentRoles()
          Updates fragment roles in the molecule.
 
Methods inherited from class chemaxon.struc.Molecule
addAtom0, addBond0, addSgroup, addSgroupClones, addSgroupsOf, aromatize, aromatize, bondlength, checkConsistency, clear, clearExtraLabels, clearProperties, clone, clonecopyWithoutSgroups, cloneMoleculeWithDocument, contractSgroups, convertToFrags, countExpandableContractableSgroups, countOrderedComponentSgroups, dearomatize, endReuse, expandSgroups, expandSgroups, exportToBinFormat, exportToFormat, exportToObject, findAllSgroupContaining, findContainingMulticenterSgroup, findContractableSgroup, findExpandableSgroup, findFrags, findSgroupContaining, findSgroupOf, findSmallestSgroupContaining, fixSelfReferringProperty, getComment, getEndPosition, getFreeAttachmentPoints, getFreeAttachmentPoints, getGraphUnionAsSelection, getInputFormat, getMostSimplifiedMolecule, getName, getProperty, getPropertyCount, getPropertyKey, getPropertyKeys, getPropertyObject, getRootSgroups, getSgroup, getSgroupArray, getSgroupCount, getSgroupLigands, getSimplifiedMolecule, getSortedSgroups, getStartPosition, getVisibleCoords, implicitizeHydrogens0, indexOf, isExpandable, isGUIContracted, isMolecule, isSgroup, mergeFrags, newSelectionMolecule, removeAllSgroups, removeSgroupFromList, removeSgroupsOf, removeSgroupsOf, reparentSgroups, replaceSgroup, residueSymbolOf, residueTypeOf, reuseAtom, setAtom0, setComment, setEndPosition, setGUIContracted, setGUIContracted, setInputFormat, setName, 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, 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, getDocumentForChild, getEdge, getEdgeArray, getEdgeCount, getEdgeVector, getEnclosingCube, getExactMass, getExplicitHcount, getExplicitLonePairCount, getFlags, getForefather, getFormalCharge, getFragCount, getFragCount, getFragIds, getFragIds, getGrinv, getGrinv, getGrinv, getGrinv, getGrinvCC, getGrinvOptions, getImplicitHcount, getImplicitHCount, getLigand, getLigandAtno, getLigandBondType, getLigandCount, getLocation, getLock, getLonePairCount, 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, insertNullAtoms, insertNullBonds, isAbsStereo, isAcceptedSpecialLigand, isAtomInRing, isGrinvCCValid, isLargeMolecule, isMultiChiral, isolate, isolate, isOnlyFirstAtomInStereoCalculation, isQuery, isRing, isRingBond, isSelfReference, isSimilarTo, isSymmetric, isValenceCheckEnabled, isValidLinkNode, mergeFrags, mergeFrags, mergeNodes, moveTo, pack, partialClean, partialClean, partialClean, properties, 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, setFlags, setFlags, setGrinvCC, setGrinvOptions, setLinkNodeDefaultOuters, setLocalParity, setLocalParity, setNode, setParity, setParity, setParity, setSetSeqs, setValenceCheckEnabled, setValenceCheckState, smol, sortEdgesAccordingTo, sumConservedQuantities, transform, updateDim, useOnlyFirstAtomInStereoCalculation, valenceCheck, valenceCheck
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE_COUNT

public static final int TYPE_COUNT
Number of structure types. Currently 3: REACTANTS, PRODUCTS, AGENTS.

See Also:
Constant Field Values

REACTANTS

public static final int REACTANTS
"Reactant" structure type.

See Also:
getComponent(int, int), Constant Field Values

PRODUCTS

public static final int PRODUCTS
"Product" structure type.

See Also:
getComponent(int, int), Constant Field Values

AGENTS

public static final int AGENTS
"Agent" structure type.

See Also:
getComponent(int, int), Constant Field Values

RGROUPED

public static final int RGROUPED
Add R-groups to component structure.

Since:
Marvin 3.1
See Also:
Constant Field Values

TYPE_MASK

public static final int TYPE_MASK
Component type mask.

Since:
Marvin 3.1
See Also:
REACTANTS, PRODUCTS, AGENTS, Constant Field Values

REGULAR_SINGLE

public static final int REGULAR_SINGLE
Regular single reaction arrow type.

Since:
Marvin 5.1, 02/28/2008
See Also:
Constant Field Values

TWO_HEADED_SINGLE

public static final int TWO_HEADED_SINGLE
Two headed single reaction arrow type.

Since:
Marvin 5.1, 02/28/2008
See Also:
Constant Field Values

REGULAR_DOUBLE

public static final int REGULAR_DOUBLE
Regular double reaction arrow type.

Since:
Marvin 5.1, 02/28/2008
See Also:
Constant Field Values

TWO_HEADED_DOUBLE

public static final int TWO_HEADED_DOUBLE
Two headed double reaction arrow type.

Since:
Marvin 5.1, 02/28/2008
See Also:
Constant Field Values

RESONANCE

public static final int RESONANCE
Resonance arrow, the same as the two-headed single reaction arrow.

Since:
Marvin 5.2 27/01/2009
See Also:
Constant Field Values

RETROSYNTHETIC

public static final int RETROSYNTHETIC
Retrosynthetic arrow, the same as the regular double reaction arrow.

Since:
Marvin 5.2 27/01/2009
See Also:
Constant Field Values

EQUILIBRIUM

public static final int EQUILIBRIUM
Resonance arrow, the same as the two-headed double reaction arrow.

Since:
Marvin 5.2 27/01/2009
See Also:
Constant Field Values
Constructor Detail

RxnMolecule

public RxnMolecule()
Create a reaction.

Method Detail

isEmpty

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

Overrides:
isEmpty in class Molecule
Returns:
true if there are no reactants, products or agents

isAtom

public boolean isAtom()
A reaction molecule cannot represent an atom.

Overrides:
isAtom in class MoleculeGraph
Returns:
false

isBond

public boolean isBond()
A reaction molecule cannot represent a bond.

Overrides:
isBond in class MoleculeGraph
Returns:
false

isReaction

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

Overrides:
isReaction in class Molecule
Returns:
true
Since:
Marvin 3.0

canBeReactionComponent

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

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

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. Always returns 0 for reactions

Overrides:
getMass in class MoleculeGraph
Returns:
the molecular weight

getReaction

public static RxnMolecule getReaction(MoleculeGraph g)
Returns the reaction represented by the given molecule if exists, otherwise null. The corresponding reaction molecule is either the molecule itself or its root structure.

Parameters:
g - the molecule graph
Returns:
the corresponding reaction molecule

getReactantCount

public int getReactantCount()
Gets the number of reactants.

Returns:
the number of reactants

getProductCount

public int getProductCount()
Gets the number of products.

Returns:
the number of products

getAgentCount

public int getAgentCount()
Gets the number of agents.

Returns:
the number of agents

getComponentCount

public int getComponentCount(int type)
Gets the number of reactants, products or agents.

Parameters:
type - REACTANTS, PRODUCTS or AGENTS
Returns:
the number of reactants, products or agents
Since:
Marvin 4.1, 11/19/2005

getReactant

public Molecule getReactant(int i)
Gets a reactant.

Parameters:
i - reactant index
Returns:
a reactant

getReactants

public Molecule[] getReactants()
Gets all reactants in an array.

Returns:
the reactants
Since:
Marvin 5.3

getProduct

public Molecule getProduct(int i)
Gets a product.

Parameters:
i - product index
Returns:
a product

getProducts

public Molecule[] getProducts()
Gets all products in an array.

Returns:
the products
Since:
Marvin 5.3

getAgent

public Molecule getAgent(int i)
Gets an agent.

Parameters:
i - agent index
Returns:
an agent

getAgents

public Molecule[] getAgents()
Gets all agents in an array.

Returns:
the agents
Since:
Marvin 5.3

getComponentID

public long getComponentID(Molecule m)
Gets the ID of a reaction component.

Parameters:
m - the reaction component
Returns:
the reaction component ID or -1 if not found
Since:
Marvin 4.1, 11/19/2005

getComponentID

public long getComponentID(MolAtom a)
Gets the reaction component ID of an atom.

Parameters:
a - the atom
Returns:
the reaction component ID or -1 if not found
Since:
Marvin 4.1, 11/19/2005

getComponentID

public long getComponentID(MolBond b)
Gets the reaction component ID of a bond.

Parameters:
b - the bond
Returns:
the reaction component ID or -1 if not found
Since:
Marvin 4.1, 11/19/2005

getComponentType

public int getComponentType(long id)
Gets the reaction component type from the ID.

Parameters:
id - the reaction component ID or -1
Returns:
the reaction component type or -1
Since:
Marvin 4.1, 11/19/2005

getComponentFlags

public int getComponentFlags(long id)
Gets the reaction component type flags from the ID.

Parameters:
id - the reaction component ID or -1
Returns:
the reaction component type or -1
Since:
Marvin 4.1, 11/19/2005

getComponentIndex

public int getComponentIndex(long id)
Gets the reactant, product or agent index from the ID.

Parameters:
id - the reaction component ID or -1
Returns:
the reaction component index or -1
Since:
Marvin 4.1, 11/19/2005

getComponent

public Molecule getComponent(long id)
Gets a reactant, product or agent.

Warning! The RGROUPED flag returns an RgMolecule object having the same atom objects as the original reactant/product/agent. The parent of the atom objects is unchanged (it is the original reactant/product/agent).

Parameters:
id - the reaction component ID
Returns:
a reactant, product or agent
Since:
Marvin 4.1, 11/19/2005
See Also:
getComponent(int, int)

getComponent

public Molecule getComponent(int flags,
                             int i)
Gets a reactant, product or agent.

Warning! The RGROUPED flag returns an RgMolecule object having the same atom objects as the original reactant/product/agent. The parent of the atom objects is unchanged (it is the original reactant/product/agent).

Parameters:
flags - REACTANTS, PRODUCTS or AGENTS, can be combined with RGROUPED
i - reactant, product or agent index
Returns:
a reactant, product or agent
Since:
Marvin 4.1, 11/19/2005

isMergedComponent

public boolean isMergedComponent(MoleculeGraph m)
Check whether given molecule is reaction component with a set of intentionally merged fragments or not.

Parameters:
m - the molecule to check
Returns:
true if merged

getCenter

public DPoint3 getCenter(int type,
                         int i)
Gets the geometrical center of a reaction component.

Parameters:
type - REACTANTS, PRODUCTS or AGENTS
i - reactant, product or agent index
Returns:
the center of mass

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

setReactionArrow0

public void setReactionArrow0()
Sets the stored reaction arrow 'arrowPoints' to its calculated value.


getReactionArrowType

public int getReactionArrowType()
Gets the reaction arrow type.

Returns:
the reaction arrow type, REGULAR_SINGLE if no reaction arrow is set.
Since:
Marvin 3.5
See Also:
REGULAR_SINGLE, RESONANCE, RETROSYNTHETIC, EQUILIBRIUM, REGULAR_DOUBLE, TWO_HEADED_SINGLE, TWO_HEADED_DOUBLE

getReactionArrowTypeName

public java.lang.String getReactionArrowTypeName()
Gets the reaction arrow type name. Used in molecule export.

Returns:
the reaction arrow type name:
  • "DEFAULT" for arrow type RxnMolecule.REGULAR_SINGLE or in case if no reaction arrow is set.
  • "RESONANCE" for arrow type RxnMolecule.RESONANCE or RxnMolecule.TWO_HEADED_SINGLE
  • "RETROSYNTHETIC" for arrow type RxnMolecule.RETROSYNTHETIC or RxnMolecule.REGULAR_DOUBLE
  • "EQUILIBRIUM" for arrow type RxnMolecule.EQUILIBRIUM or RxnMolecule.TWO_HEADED_DOUBLE
Since:
Marvin 3.5

setReactionArrowType

public void setReactionArrowType(int type)
Sets the reaction arrow type.

Parameters:
type - the reaction arrow type
Since:
Marvin 3.5

setReactionArrowType

public void setReactionArrowType(java.lang.String name)
Sets the reaction arrow type from type name. Used in molecule import.

Parameters:
name - the reaction arrow type name
Throws:
java.lang.IllegalArgumentException - for invalid type name
Since:
Marvin 3.5

getReactionArrow

public DPoint3[] getReactionArrow()
Gets a two-element array containing the endpoints of the reaction arrow.

Returns:
the arrow

getReactionArrow

public chemaxon.struc.graphics.MRArrow getReactionArrow(boolean generate)
Gets the reaction arrow of this reaction with the possibility to generate an arrow if the arrow is not yet set.

Parameters:
generate - if true then arrow is generated in case when the arrow is not yet set.
Returns:
the arrow of this reaction, null if the arrow is not set and the generate parameter was false.

setReactionArrow

public void setReactionArrow(DPoint3[] arw)
Sets the endpoint coordinates of the reaction arrow.

Parameters:
arw - endpoint coordinates of the reaction arrow

setReactionArrow

public void setReactionArrow()
Sets the stored reaction arrow to its calculated value.


setReactionArrow

public void setReactionArrow(chemaxon.struc.graphics.MRArrow arrow)
Sets the reaction arrow.

Parameters:
arrow -

removeReactionArrow

public void removeReactionArrow()
Removes the reaction arrow of this reacion.


setMSLogic

public void setMSLogic(java.util.Map<chemaxon.struc.graphics.MRArrow,RxnMolecule> ms)
Sets the hash that stores arrow - reaction mapping.

Parameters:
ms - the hash that stores the mapping.

getMSLogic

public java.util.Map<chemaxon.struc.graphics.MRArrow,RxnMolecule> getMSLogic()
Gets the hash that stores arrow - reaction mapping.

Returns:
returns the hash that stores the mapping.

recalcReactionArrow

public void recalcReactionArrow()
Recalculates the coordinates of the reaction arrow from the reactants and products, forced recalculation.


rebuildStructures

public void rebuildStructures()
For each structure (reactant or product) determines whether it should be a reactant or a product depending on its the relative position to the reaction arrow. Rebuilds the reactant and product vectors accordingly.


rebuildStructures

public void rebuildStructures(DPoint3[] arw,
                              int art)
Sets the reaction arrow. For each reaction component (reactant or product) determines whether it should be a reactant or a product depending on its the relative position to the reaction arrow. Rebuilds the reactant and product vectors accordingly.

Parameters:
arw - is the new reaction arrow
art - is the new reaction arrow type

determineArrowDistance

public static double determineArrowDistance(double x,
                                            double y,
                                            double z,
                                            DPoint3[] ar)
Project the point (x,y,z) to the line of the reaction arrow 'ar'. Return the signed distance of the projected point from the start-point of the arrow divided by the arrow length.

Parameters:
x - is the x coordinate of the point
y - is the y coordinate of the point
z - is the z coordinate of the point
ar - is the reaction arrow
Returns:
the signed distance of the projected point from the start-point of the arrow divided by the arrow length

determineType

public static int determineType(double x,
                                double y,
                                double z,
                                DPoint3[] ar)
Determines whether a point should be in a reactant, in a product or in an agent.

Parameters:
x - point x coordinate
y - point y coordinate
z - point z coordinate
ar - reaction arrow
Returns:
REACTANTS, PRODUCTS or AGENTS

determineType

public int determineType(double x,
                         double y,
                         double z)
Determines whether a point should be in a reactant, in a product or in an agent.

Parameters:
x - point x coordinate
y - point y coordinate
z - point z coordinate
Returns:
REACTANTS, PRODUCTS or AGENTS

getType

public int getType(MoleculeGraph selection)
Checks whether the atoms in the selection are all in reactants, products or agents.

Parameters:
selection - the molecule graph containing the selection
Returns:
REACTANTS, PRODUCTS or AGENTS or -1 if not of the same type or there is an atom which is not contained in any component

addComponent

public void addComponent(Molecule m,
                         int type)
                  throws java.lang.IllegalArgumentException
Adds a reactant, product or agent. If atoms in the specified structure are already part of some other reactants, products or agents then removes them from those structures.

Parameters:
m - the reactant, product or agent
type - REACTANTS, PRODUCTS or AGENTS
Throws:
java.lang.IllegalArgumentException - if m is of a subclass of Molecule for which the embedding in an RxnMolecule is not supported

addComponent

public void addComponent(Molecule m,
                         int type,
                         boolean beNew)
                  throws java.lang.IllegalArgumentException
Adds a reactant, product or agent. If atoms in the specified structure are already part of some other reactants, products or agents then removes them from those structures.

Parameters:
m - the reactant, product or agent
type - REACTANTS, PRODUCTS or AGENTS
beNew - m should be a new structure if true
Throws:
java.lang.IllegalArgumentException - if m is of a subclass of Molecule for which the embedding in an RxnMolecule is not supported

removeComponent

public Molecule removeComponent(int flags,
                                int i)
Removes a reactant, product or agent.

Warning! The RGROUPED flag returns an RgMolecule object having the same atom objects as the original reactant/product/agent. The parent of the atom objects is unchanged (it is the original reactant/product/agent).

Parameters:
flags - REACTANTS, PRODUCTS or AGENTS, can be combined with RGROUPED
i - reactant, product or agent index
Returns:
the removed reactant, product or agent
Since:
Marvin 4.1, 11/19/2005

mergeComponentParts

public void mergeComponentParts(MoleculeGraph m,
                                int type,
                                boolean isMergeStored)
                         throws java.lang.IllegalArgumentException
Finds those component parts that are contained in the molecule graph m and creates a new component containing all atoms of m, splitting them from the previous merges.

Parameters:
m - molecule graph that contains atoms of the fragments to merge
type - type of component parts to merge (only parts of components of the same type can be merged)
isMergeStored - if true then merged component remains merged until not splitted intentionnaly
Throws:
java.lang.IllegalArgumentException
See Also:
splitComponentParts(chemaxon.struc.MoleculeGraph, int)

splitComponentParts

public void splitComponentParts(MoleculeGraph m,
                                int type)
                         throws java.lang.IllegalArgumentException
Finds those component parts that are contained in the molecule graph m and creates separate components from the fragments contained in m, splitting them from the previous merges.

Parameters:
m - molecule graph that contains atoms of the fragments to split
type - type of component parts to merge (only parts of components of the same type can be merged)
Throws:
java.lang.IllegalArgumentException

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)

setDim

public void setDim(int d)
Sets the dimension for all the structures.

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

setAbsStereo

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

Overrides:
setAbsStereo in class MoleculeGraph
Parameters:
c - the absolute stereoconfiguration flag
See Also:
MoleculeGraph.setFlags(int)

getAtomCount

public int getAtomCount()
Returns the number of nodes in the graph union.

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

getAtomCount

public int getAtomCount(int atomicNumber)
Gets the number of atoms with the given atomic number in the unified molecule graph of the reaction. 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.

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.

Overrides:
setAtom in class MoleculeGraph
Parameters:
iu - node index in the graph union
node - new node reference

getCtab

public int[][] getCtab()
Gets the connection table for the graph union. 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 for the graph union. 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 for the graph union. 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

createCHtab

public int[][] createCHtab()
Creates the graph union's connection table extended with implicit hydrogen atoms.

Overrides:
createCHtab in class MoleculeGraph
Returns:
the chtab array
Since:
Marvin 3.0

createBHtab

public int[][] createBHtab()
Creates the graph union's bond table extended with implicit hydrogen atoms.

Overrides:
createBHtab in class MoleculeGraph
Returns:
the chtab array
Since:
Marvin 3.0

contains

public boolean contains(MolAtom node)
Checks if a reactant, agent or product structure 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 a reactant, agent or product structure contains the specified edge.

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

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

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

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

add

public void add(MolAtom a)
Adds an atom to a reactant, product or agent structure. If a neighbour of the atom is in a reactant, product or agent, then adds the atom to that structure. Otherwise creates a new reactant or product.

Overrides:
add in class MoleculeGraph
Parameters:
a - the new atom

addAtomToFragment

protected void addAtomToFragment(MolAtom a)
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:
a - the atom reference

getBondCount

public int getBondCount()
Gets the number of edges in the graph union.

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

getBond

public MolBond getBond(int i)
Gets an edge.

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

setBond

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

Overrides:
setBond in class MoleculeGraph
Parameters:
iu - edge index in the graph union
edge - new node reference

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 e)
Adds a bond to a reactant, product, agent. If an endpoint of the edge is in a reactant, product or agent, then adds the edge to that structure.

Overrides:
add in class MoleculeGraph
Parameters:
e - the new edge

simplifyIncompleteReactionToMolecule

public Molecule simplifyIncompleteReactionToMolecule()
Simplify a reaction to a molecule if possible. If the reaction is incomplete and it only contains one reactant, one product or one agent, then that object is returned. Otherwise, simplification is impossible and this is returned.

Returns:
a reactant, product, agent or this
Since:
Marvin 4.0
See Also:
Molecule.getSimplifiedMolecule()

removeAtom

public void removeAtom(MolAtom node,
                       int cleanupFlags)
Removes an atom from the reactants, products or agents. 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 iu,
                       int cleanupFlags)
Removes an atom from the reactants, products or agents. 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:
iu - atom index in the graph union
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(MolBond edge,
                          int cleanupFlags)
Removes a bond from the reactants, products or agents.

Overrides:
removeBond in class Molecule
Parameters:
edge - the edge
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 iu,
                          int cleanupFlags)
Removes an edge from a reactant, agent or product.

Overrides:
removeBond in class Molecule
Parameters:
iu - edge index in the graph union
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()
Removes all bonds from the reactants, products and agents.

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()
Reaction molecules 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 origin
See Also:
MoleculeGraph.orix

mergeAtoms

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

Overrides:
mergeAtoms in class Molecule
Parameters:
that - the atom
node - the other atom

fuse

public void fuse(MoleculeGraph graph,
                 boolean check)
Add the atoms and bonds of another molecule.

Overrides:
fuse in class MoleculeGraph
Parameters:
graph - 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

fuse0

protected void fuse0(MoleculeGraph graph,
                     boolean check)
Add those nodes and edges of a graph that are not already elements. If the graph has an atom connected to a reactant or product, then also adds the graph to that structure. Handles one connected component.

Overrides:
fuse0 in class MoleculeGraph
Parameters:
graph - the structure to fuse into this one
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

setSgroupParent

public void setSgroupParent(MolAtom a,
                            Sgroup sg,
                            boolean set)
Sets or unsets an S-group as a parent of an atom in reactants, products or agents.

Overrides:
setSgroupParent in class Molecule
Parameters:
a - the atom
sg - the S-group
set - set (true) or unset (false)
Throws:
java.lang.IllegalArgumentException - neither reactants, nor products or agents contain 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 structure

clonecopy

public void clonecopy(int[] iatoms,
                      MoleculeGraph g)
Copies the specified nodes and edges of this graph to another one. The RxnMolecule implementation of this method is incomplete.

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

getAllFragments

public java.util.List<Molecule> getAllFragments()
Gets the list of reaction fragments (product, reactant, agent components) that build up this reaction.

Returns:
the list of fragments (Molecule)
Since:
Marvin 5.0, 12/06/2007
See Also:
Molecule

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 structure

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

newInstance

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

Overrides:
newInstance in class Molecule
Returns:
the new reaction

makeItSimilar

protected void makeItSimilar(MoleculeGraph g)
Copies some properties of this molecule to the other one specified as argument. Copies the reaction arrow.

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

splitAllDisconnectedComponents

public void splitAllDisconnectedComponents()
Replaces all disconnected reaction components by its connected fragments in the structure array.

Since:
Marvin 5.4, 07/07/2010
See Also:
splitDisconnectedComponent(int, int)

splitDisconnectedComponent

public void splitDisconnectedComponent(long id)
Replaces a disconnected reaction component by its connected fragments in the structure array.

Parameters:
id - the reaction component ID
Since:
Marvin 4.1, 11/19/2005
See Also:
splitDisconnectedComponent(int, int)

splitDisconnectedComponent

public void splitDisconnectedComponent(int type,
                                       int index)
Replaces a disconnected reaction component by its connected fragments in the structure array.

Parameters:
type - is the structure type: REACTANTS, PRODUCTS or AGENTS
index - is the structure index
Since:
Marvin 4.1, 11/19/2005

transform

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

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

transformReactionArrow

protected void transformReactionArrow(CTransform3D t)
Apply a transformation matrix to the reaction arrow.

Parameters:
t - the transformation matrix

createReaction

public static RxnMolecule createReaction(Molecule mol,
                                         DPoint3[] arw,
                                         int art)
Creates a reaction.

Parameters:
mol - contains the atoms of reactants and products
arw - two-element array containing the endpoints of the reaction arrow
art - the arrow type
Returns:
the reaction

createReaction

public static RxnMolecule createReaction(MoleculeGraph mol,
                                         DPoint3[] arw)
Creates a reaction.

Parameters:
mol - contains the atoms of reactants and products
arw - two-element array containing the endpoints of the reaction arrow
Returns:
the reaction

getGraphUnion

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

Overrides:
getGraphUnion in class MoleculeGraph
Returns:
the unified structure
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

getStructureCount

public int getStructureCount(int type)
Deprecated. as of Marvin 4.1, replaced by getComponentCount(int)

Gets the number of reactants, products or agents.

Parameters:
type - reaction component type
Returns:
the number of reactants, products or agents

getStructure

public Molecule getStructure(int flags,
                             int i)
Deprecated. as of Marvin 4.1, replaced by getComponent(int, int)

Gets a reactant, product or agent.

Parameters:
flags - component type and other flags
i - reactant, product or agent index
Returns:
a reactant, product or agent

addStructure

public void addStructure(Molecule m,
                         int type)
Deprecated. as of Marvin 4.1, replaced by addComponent(Molecule, int)

Adds a reactant, product or agent.

Parameters:
m - the reactant, product or agent
type - reaction component type

addStructure

public void addStructure(Molecule m,
                         int type,
                         boolean beNew)
Deprecated. as of Marvin 4.1, replaced by addComponent(Molecule, int, boolean)

Adds a reactant, product or agent.

Parameters:
m - the reactant, product or agent
type - reaction component type
beNew - m should be a new structure if true

removeStructure

public Molecule removeStructure(int flags,
                                int i)
Deprecated. as of Marvin 4.1, replaced by removeComponent(int, int)

Removes a reactant, product or agent.

Parameters:
flags - reaction component type and other flags
i - reactant, product or agent index
Returns:
the removed reactant, product or agent
Since:
Marvin 3.4.3

toString

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

Overrides:
toString in class MoleculeGraph
Returns:
a string representation of the object

isIncompleteReaction

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

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

getItsArrow

public chemaxon.struc.graphics.MRArrow getItsArrow()
Gets the reaction arrow of this reaction. If the arrow is not yet set creates one.

Returns:
the reaction arrow of this reaction
Since:
Marvin 5.0, 12/06/2007

getArrowAsProperty

public MPropertyContainer getArrowAsProperty()
Gets the properties (type, endpoint coordinates) of the reaction arrow in this reaction.

Returns:
the properties

setReactionArrowEndPoints

public void setReactionArrowEndPoints(DPoint3[] points)
Sets the endpoints of the reaction arrow in this reaction. If the arrow is not yet set creates one with the given endpoint coordinates.

Parameters:
points - the endpoint coordinates of the arrow
Since:
Marvin 5.0, 12/06/2007

removeEmptyComponents

public void removeEmptyComponents()
Checks all the componentes and removes those that are empty (node count is zero).


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

createGearch

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

addReactionStep

public void addReactionStep(java.util.ArrayList reactants,
                            java.util.ArrayList products,
                            java.util.ArrayList agents,
                            chemaxon.struc.graphics.MRArrow arrow,
                            int arrowType)

isSingleStepReaction

public boolean isSingleStepReaction()
Decides wheter this reaction is a singlestep or multistep reaction.

Returns:
true if this reaction is a singlestep reaction false otherwise

updateComponentRoles

public void updateComponentRoles()
Updates fragment roles in the molecule. roles are like: - nodes that are sources only: are REACTANTS - nodes that are sinks only: are PRODUCTS - all other nodes: are AGENTS For single step reactions: if the reaction is stored as single step, does nothing. If the single reaction is stored in the hash, transforms it into a single step one.


getReactionSteps

public java.util.ArrayList<RxnMolecule> getReactionSteps()
Divides this reaction into simple step reactions if this is a multistep reaction.

Returns:
the list of RxnMolecule-s if this is a multistep reaction empty list otherwise.
Since:
Marvin 5.0

getReactionArrowList

public java.util.List<chemaxon.struc.graphics.MRArrow> getReactionArrowList()
Gets the list of the reaction arrows of this reaction.

Returns:
the list of MRArrow-s
Since:
Marvin 5.0
See Also:
MRArrow

simplifyToMolecule

public Molecule simplifyToMolecule()
Simplifies this RxnMolecule by moving the atoms and bonds from the reactants, products, and agents to a Molecule. Clears reactans, products, agents.

Returns:
the simplified molecule
Since:
Marvin 5.0

clearObjects

public void clearObjects()
Deletes the graphical objects from this.

Specified by:
clearObjects in interface chemaxon.struc.MObjectContainer
Overrides:
clearObjects in class Molecule

removeObject

public void removeObject(MObject o)
Removes a graphical object from this.

Specified by:
removeObject in interface chemaxon.struc.MObjectContainer
Overrides:
removeObject in class Molecule
Parameters:
o - the graphical object

getObjectCount

public int getObjectCount()
Specified by:
getObjectCount in interface chemaxon.struc.MObjectContainer
Overrides:
getObjectCount 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 RxnMolecule 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), MoleculeGraph.getParity(int)

getLocalParity

public int getLocalParity(int i)
Computes the local parity of an atom of the RxnMolecule 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), 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()