Package chemaxon.struc
Class RgMolecule
- java.lang.Object
-
- chemaxon.struc.MoleculeGraph
-
- chemaxon.struc.Molecule
-
- chemaxon.struc.RgMolecule
-
- All Implemented Interfaces:
chemaxon.core.calculations.valencecheck.MoleculeWithValence<MolAtom>
,chemaxon.core.structure.MarkushStructureForBuilder
,chemaxon.core.structure.MoleculeForBuilder
,chemaxon.core.structure.RootStructureForBuilder
,chemaxon.core.structure.StructureForBuilder
,Incomplecule
,chemaxon.struc.MObjectContainer
,MTransformable
,chemaxon.struc.RgMoleculeGraphIface
,StereoConstants
,Serializable
@PublicAPI public class RgMolecule extends Molecule implements chemaxon.struc.RgMoleculeGraphIface, chemaxon.struc.MObjectContainer, chemaxon.core.structure.MarkushStructureForBuilder
A molecule or reaction containing R-groups.- Since:
- Marvin 2.6
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class chemaxon.struc.MoleculeGraph
MoleculeGraph.ValenceCheckState
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_RLOGIC_RANGE
Default R-logic range.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, RM_KEEP_LEAVINGGROUPS, 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_CHUCKEL, 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_ALL_POSSIBLE, CHIRALITYSUPPORT_NONE, CHIRALITYSUPPORT_SELECTED, CIS, CIS_TRANS, CTUMASK, CTUNKNOWN, CTUNSPEC, DBS_ALL, DBS_MARKED, DBS_NONE, ENDO, EXO, PARITY_ALLENE, PARITY_EITHER, PARITY_EVEN, PARITY_MASK, PARITY_NONE, PARITY_ODD, PARITY_TETRAHEDRAL, PARITY_UNSPEC, STGRP_ABS, STGRP_AND, STGRP_NONE, STGRP_OR, SYN, TRANS
-
-
Constructor Summary
Constructors Constructor Description RgMolecule()
Creates a 2 dimensional RgMolecule.RgMolecule(Molecule root)
Creates an RgMolecule with the given root structure.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
add(MolAtom node)
Adds an atom to the root structure.void
add(MolBond bond)
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.void
addRgroupBridgeMember(chemaxon.struc.RgroupBridgeId bridgeId, Molecule m)
Adds a definition member to an R-group bridge.RgMolecule
addRgroupsTo(Molecule m)
Creates an RgMolecule containing R-groups of this object from the 'simplified molecule' object made of 'm'.void
addSgroup(Sgroup sg, boolean setparent)
Adds an S-group to this object.void
aromatize(int method)
Aromatizes molecule.void
aromatize(int method, boolean checkAmbiguity)
Aromatizes molecule.boolean
canBeCT(int i2, int i3, boolean grcheck)
Determines whether the bond between the specified atoms can be a CIS/TRANS or not.boolean
canBeReactionComponent()
Tests whether an object of this class can be a reaction component.void
checkConsistency()
Deprecated.As of Marvin 5.7, no replacement.
Not intended for public use, it was intended only for internal debugging.String
checkRlogicRange(int index, String range)
Checks an R-logic occurrence 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(String fmt)
Clear the edges vector and the properties.void
clearObjects()
RgMolecule
clone()
Clone the markush structure.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)
Deprecated.as of Marvin 6.3.
Not supported feature.RgMolecule
cloneMoleculeWithDocument()
Makes an identical copy of the molecule and its document.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()
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.chemaxon.struc.RgroupBridgeId
findRgroupBridgeId(int index)
Finds the correspondingRgroupBridgeId
for an R-group index.int
findRgroupIndex(int rgid)
Finds the index of an R-group based on the R-group number.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.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.IteratorFactory.AtomIterator
getAtomIterator()
Returns an iterator over the atoms in this molecule in proper sequence.MolBond
getBond(int i)
Gets an edge in the graph union.int
getBondCount()
Gets the number of edges in the root structure.IteratorFactory.BondIterator
getBondIterator()
Returns an iterator over the bonds in this molecule in proper sequence.BondTable
getBondTable()
Gets the bond table of the root structre.String
getComment()
Gets the comment of the root molecule.int[][]
getCtab()
Gets the connection table of the root structure.int
getDependentRgroupDefinition(int rgroupIndex)
Gets the R-group definition's index which depends on the referenced R-group definition.int
getFlags()
Gets the dimension and chiral flags.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.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
getRgroupBridgeCount()
Returns the number of R-group bridges defined in this structure.List<chemaxon.struc.RgroupBridgeId>
getRgroupBridgeIds()
Returns the list of R-group bridge IDs defined in this structure.Molecule
getRgroupBridgeMember(chemaxon.struc.RgroupBridgeId bridgeId, int memberIndex)
Returns a definition member of the given R-group bridge.int
getRgroupBridgeMemberCount(chemaxon.struc.RgroupBridgeId bridgeId)
Returns the number of definition members of the given R-group bridge.int
getRgroupCount()
Gets the number of R-groups.String
getRgroupDisplayLabel(int rgroupIndex)
int
getRgroupId(int i)
Gets the ID of an R-group.int
getRgroupId(chemaxon.struc.RgroupBridgeId bridgeId)
int
getRgroupIndex(chemaxon.struc.RgroupBridgeId bridgeId)
Returns the index of the ordinary R-group that actually represents the given R-group bridge.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 identifier of the R-group member that contains the specified atom.int
getRlogic(int i)
Gets R-logic flags.String
getRlogicRange(int i)
Gets R-logic occurrence range.Molecule
getRoot()
Gets the root structure.MoleculeGraph
getRootG()
Gets the root structure.int
getStereo2(MolBond bond, MolAtom leftAtom, MolAtom rightAtom, boolean performGrinvCheck)
Gets cis/trans stereo information for an A1-A2=A3-A4 atom configuration.protected int
getSubGraphCount()
Gets the number of all "submolecules".protected void
getSubGraphs(MoleculeGraph[] arr, int off)
Gets all "submolecules".ValenceCheckOptions
getValenceCheckOptions()
Returns the options for valence checking.boolean
hasAtomSet()
Tests whether the molecule graph has atom sets.boolean
hasBondSet()
Tests whether the molecule graph has atom sets.boolean
hasRgroupContainedBy(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()
Deprecated.As of Marvin 14.7.7, no replacement.
Not supported feature.boolean
isBond()
Deprecated.As of Marvin 14.7.7, no replacement.
Not supported feature.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
isRestH(int rgroupIndex)
Informs whether the restH condition is set to the referenced R-group definition.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)
Deprecated.As of Marvin 6.2, useMergeUtil.mergeAtoms(MolAtom, MolAtom, boolean)
instead.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
removeDependentRgroupDefinition(int rgroupIndex)
Removes the dependent R-group definition of the referenced R-group definition.void
removeObject(MObject mo)
void
removeRestH(int rgroupIndex)
Removes the restH condition from an R-group definition.void
removeRgroup(int rgroupIndex)
Removes an R-group.void
removeRgroupBridge(chemaxon.struc.RgroupBridgeId bridgeId)
Removes an R-group bridge.void
removeRgroupBridgeMember(chemaxon.struc.RgroupBridgeId bridgeId, int memberIndex)
Removes a definition member of an R-group bridge.void
removeRgroupMember(int rgroupIndex, int memberIndex)
Removes an R-group definition member.void
removeRgroupMembers(int rgroupIndex, int[] memberIndexes)
Removes R-group members.void
replaceAtomsWithNewRgroup(SelectionMolecule sel, int rgid)
Replaces selected atoms with a new R-group.void
replaceBond(MolBond olde, MolBond newe)
Deprecated.as of Marvin 6.2, may constructs inconsistentMoleculeGraph
.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
setAtom(int iu, MolAtom node)
Deprecated.as of Marvin 6.2, may constructs inconsistentMoleculeGraph
.void
setBond(int iu, MolBond edge)
Deprecated.as of Marvin 6.2, may constructs inconsistentMoleculeGraph
.void
setComment(String s)
Sets the comment of the root molecule.void
setDependentRgroupDefinition(int rgroupIndexIf, int rgroupIndexThen)
Sets the dependent R-group definition (rgroupIndexThen
) for the referenced R-group definition (rgroupIndexIf
).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(String format)
Sets the input file format.void
setLocation(DPoint3 p)
Set the origin of the molecule.void
setName(String s)
Sets the name of the root molecule.void
setRestH(int rgroupIndex)
Sets the restH condition on an R-group definition.void
setRlogic(int i, int f)
Sets R-logic flags.void
setRlogicRange(int index, String range)
Sets R-logic occurrence 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
setValenceCheckOptions(ValenceCheckOptions options)
Sets the options for valence checking.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.String
toString()
Overrides Object.toString() to ease debugging.void
transform(CTransform3D t, boolean incg)
Apply a transformation matrix to the atomic coordinates.int
unRgroupAtoms(Set<?> set)
Ungroup R-groups consisting of the specified atoms and make them be part of root.-
Methods inherited from class chemaxon.struc.Molecule
addAtom0, addBond0, addSgroupClones, addSgroupsOf, bondlength, clear, clearExtraLabels, clearProperties, cloneAtoms, clonecopyWithoutSgroups, cloneMolecule, connectOriginalBondsToNewAtom, contractSgroups, contractSgroups, convertToFrags, countExpandableContractableSgroups, countOrderedComponentSgroups, dearomatize, expandSgroups, expandSgroups, exportToBinFormat, exportToFormat, exportToObject, findAllSgroupContaining, findContainingMulticenterSgroup, findContractableSgroup, findExpandableSgroup, findFrags, findFrags, findSgroupContaining, findSgroupOf, findSmallestSgroupContaining, getBonds, getEndPosition, getGraphUnionAsSelection, getId, getInputFormat, getProperty, getPropertyCount, getPropertyKey, getPropertyKeys, getPropertyObject, getRootSgroups, getSgroup, getSgroupArray, getSgroupCount, getSgroupIterator, getSgroupLigands, getSimplifiedMolecule, getSortedSgroups, getStartPosition, getVisibleCoords, hasContractedSgroup, hasId, implicitizeHydrogens0, indexOf, isExpandable, isGUIContracted, isSgroup, rearrangeSgroups, removeAllSgroups, removeAtomFromChildren, removeSgroupFromList, removeSgroupsOf, removeSgroupsOf, reparentSgroups, replaceAtom, replaceSgroup, residueSymbolOf, residueTypeOf, setAtom0, setEndPosition, setGUIContracted, setGUIContracted, setId, setProperty, setPropertyObject, setStartPosition, sortSgroupXBonds, toBinFormat, toFormat, toObject, ungroupSgroup, ungroupSgroup, ungroupSgroup, ungroupSgroup, ungroupSgroups, ungroupSgroups, ungroupSgroups
-
Methods inherited from class chemaxon.struc.MoleculeGraph
add, addAtomsAndBondsTo, addAtomWithoutChangingIt, addBondWithoutChangingIt, addExplicitHydrogens, addExplicitHydrogens, addExplicitLonePairs, addSimpleAtomWithoutChangingIt, adjustMultiChiralFlag, aromatize, aromatize, arrangeComponents, atoms, bonds, calcCenter, calcCenter, calcDehydrogenizedGrinv, calcHeight, calcHybridization, calcOutRect, calcOutRect, calcOutRectCenter, calcOutRectCenter, calcWidth, canBeCT, canBeCT, checkBondConsistency, clean, clean, clearCachedInfo, clonecopyMoleculeGraphWithoutSgroups, contains, createDehydrogenizedReadOnlyGraph, createSmolecule, dearomatize, findAtom, findAtomClone, findBasicFrags, findBond, findComponentIds, findComponentIds, findFrag, findFrag, findFragById, findFrags, findInArray, fixProperties, fuse, getAromaticAndAliphaticRings, getAtomArray, getAtomicNumber, getAtomReferenceList, getBondArray, getCharge, getChirality, getCSSR, getCSSRIdxesForAtoms, getDesiredLength, getDesiredLength, getDim, getDocument, getDocumentForChild, getEnclosingCube, getExactMass, getExplicitHcount, getExplicitLonePairCount, getEZStereo, getForefather, getFormalCharge, getFragCount, getFragCount, getFragIds, getFreeAttachmentPoints, getGrinv, getGrinv, getGrinv, getGrinv, getGrinvCC, getGrinvOptions, getImplicitHcount, getImplicitHCount, getLigand, getLigandAtno, getLigandBondType, getLigandCount, getLocation, getLock, getMaxRgroupAttachmentPointOrder, getParent, getParentDocument, getParityType, getPoints, getPossibleAttachmentPoints, getRadicalCount, getSmallestRingSizeForIdx, getSSSR, getSSSRBonds, getSSSRBondsAsBitSet, getSSSRBondSet, getSSSRBondSetInLong, getSSSRIdxesForAtoms, getStereo2, getStereo2, getStereo2, getStereo2, getStereo2, getStereo2, getSubGraphs, getTotalCharge, getValenceCheckState, getValenceProperty, hasExplicitLonePairs, hasExtraLabelSet, hasImplicitH, hasSelfReferringProperty, hasValenceError, hydrogenize, implicitizeHydrogens, implicitizeHydrogens, implicitizeHydrogens, incGrinvCC, incGrinvCC, incGrinvCCOnly, insertAtom, insertBond, insertBondInOrder, isAbsStereo, isAcceptedSpecialLigand, isAtomInRing, isBondParallelWith, isGrinvCCValid, isLargeMolecule, isMolecule, isMultiChiral, isolate, isolate, isOnlyFirstAtomInStereoCalculation, isRing, isRingBond, isSimilarTo, isSymmetric, isValenceCheckEnabled, isValidLinkNode, mergeFrags, moveTo, pack, partialClean, partialClean, partialClean, qpropCheck, regenBtab, regenCtab, regenGearch, removeAtom, removeAtom, removeBond, removeBond, removeExplicitLonePairs, removeIsolatedAtoms, removeIsolatedBonds, resetCtab, resetGrinvInParents, restoreCache, saveCache, setAtomSetSeqs, setBondSetSeqs, setChirality, setChirality, setGrinvCC, setGrinvOptions, setLinkNodeDefaultOuters, setLocalParity, setLocalParity, setParity, setParity, setParity, setSupergraph, setValenceCheckEnabled, setValenceCheckState, smol, transform, updateDim, useOnlyFirstAtomInStereoCalculation, valenceCheck, valenceCheck
-
-
-
-
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
-
DEFAULT_RLOGIC_RANGE
public static final String DEFAULT_RLOGIC_RANGE
Default R-logic range. It is an empty string.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RgMolecule
public RgMolecule()
Creates a 2 dimensional RgMolecule.
-
RgMolecule
public RgMolecule(Molecule root)
Creates an RgMolecule with the given root structure.
-
-
Method Detail
-
setRoot
public void setRoot(Molecule mol)
Sets the root structure.- Parameters:
mol
- the root structure
-
getStereo2
public int getStereo2(MolBond bond, MolAtom leftAtom, MolAtom rightAtom, boolean performGrinvCheck)
Gets cis/trans stereo information for an A1-A2=A3-A4 atom configuration. Calculates the stereo information if the molecule is 2D or 3D, reports previously set information if it is 0D. Atoms A2 and A3 are atom1 and atom2 of the specified bond. Both (A2, A3) = (atom1, atom2) and (A2, A3) = (atom2, atom1) works. If A1 or A4 is null 0 is returned. Not checking if the bond is in small ring (MoleculeGraph.MIN_RING_SIZE_FOR_TRANS_DB
(so chemically the double bond with its ring ligand can be cis only), but due to the perspective depiction in two dimension the double bond ligand arrangement looks trans. In this case the chemically incorrect trans returned.- Overrides:
getStereo2
in classMoleculeGraph
- Parameters:
bond
- the bondleftAtom
- atom A1rightAtom
- atom A4performGrinvCheck
- true if check atom equivalences using graph invariants- Returns:
- the stereo flags
- See Also:
StereoConstants.CTUMASK
,MolBond.calcStereo2()
,for detailed examples.
-
getRoot
public Molecule getRoot()
Gets the root structure.- Returns:
- the root
-
getRootG
public final MoleculeGraph getRootG()
Gets the root structure.- Specified by:
getRootG
in interfacechemaxon.struc.RgMoleculeGraphIface
- Returns:
- the root
-
getRgroupCount
public int getRgroupCount()
Gets the number of R-groups.- Specified by:
getRgroupCount
in interfacechemaxon.struc.RgMoleculeGraphIface
- Returns:
- number of R-groups
-
getRgroupMemberCount
public int getRgroupMemberCount(int i)
Gets the number of R-group members.- Specified by:
getRgroupMemberCount
in interfacechemaxon.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 indexj
- 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 interfacechemaxon.struc.RgMoleculeGraphIface
- Parameters:
i
- R-group indexj
- member index- Returns:
- the R-group member
-
getRgroupId
public int getRgroupId(int i)
Gets the ID of an R-group.- Specified by:
getRgroupId
in interfacechemaxon.struc.RgMoleculeGraphIface
- Parameters:
i
- R-group index- Returns:
- number between 0 and
MolAtom.RGROUP_MAX
-
findRgroupIndex
public int findRgroupIndex(int rgid)
Finds the index of an R-group based on the R-group number.- Specified by:
findRgroupIndex
in interfacechemaxon.struc.RgMoleculeGraphIface
- Parameters:
rgid
- number between 0 andMolAtom.RGROUP_MAX
- Returns:
- R-group index, or -1 if not found
-
addSgroup
public void addSgroup(Sgroup sg, boolean setparent)
Adds an S-group to this object.
-
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 andMolAtom.RGROUP_MAX
m
- the R-group- Returns:
- the Rgroup index
-
getRgroupIndex
public int getRgroupIndex(chemaxon.struc.RgroupBridgeId bridgeId)
Returns the index of the ordinary R-group that actually represents the given R-group bridge.- Parameters:
bridgeId
- R-group bridge ID- Returns:
- the index of the ordinary R-group that actually represents the given R-group bridge or
-1
if the given bridge is not defined in the structure - Since:
- Marvin 14.10.13
- See Also:
RgroupBridgeId
-
getRgroupId
public int getRgroupId(chemaxon.struc.RgroupBridgeId bridgeId)
- Specified by:
getRgroupId
in interfacechemaxon.struc.RgMoleculeGraphIface
-
findRgroupBridgeId
public chemaxon.struc.RgroupBridgeId findRgroupBridgeId(int index)
Finds the correspondingRgroupBridgeId
for an R-group index.- Parameters:
index
- the index of an R-group- Returns:
- the corresponding
RgroupBridgeId
if the specified R-group is actually representing an R-group bridge,null
otherwise - Since:
- Marvin 14.10.13
- See Also:
RgroupBridgeId
-
getRgroupBridgeCount
public int getRgroupBridgeCount()
Returns the number of R-group bridges defined in this structure.- Returns:
- the number of R-group bridges
- Since:
- Marvin 14.10.13
- See Also:
RgroupBridgeId
-
getRgroupBridgeIds
public List<chemaxon.struc.RgroupBridgeId> getRgroupBridgeIds()
Returns the list of R-group bridge IDs defined in this structure.- Returns:
- the sorted list of R-group bridge IDs
- Since:
- Marvin 14.10.13
- See Also:
RgroupBridgeId
-
getRgroupBridgeMemberCount
public int getRgroupBridgeMemberCount(chemaxon.struc.RgroupBridgeId bridgeId)
Returns the number of definition members of the given R-group bridge.- Parameters:
bridgeId
- R-group bridge ID- Returns:
- the number of definition members of the given R-group bridge or
0
if the bridge is not defined in this structure - Since:
- Marvin 14.10.13
- See Also:
RgroupBridgeId
-
getRgroupBridgeMember
public Molecule getRgroupBridgeMember(chemaxon.struc.RgroupBridgeId bridgeId, int memberIndex)
Returns a definition member of the given R-group bridge.- Parameters:
bridgeId
- R-group bridge IDmemberIndex
- index of the definition member- Returns:
- the definition member molecule
- Since:
- Marvin 14.10.13
- See Also:
RgroupBridgeId
-
addRgroupBridgeMember
public void addRgroupBridgeMember(chemaxon.struc.RgroupBridgeId bridgeId, Molecule m)
Adds a definition member to an R-group bridge.- Parameters:
bridgeId
- R-group bridge IDm
- the member molecule- Since:
- Marvin 14.10.13
- See Also:
RgroupBridgeId
-
removeRgroupMember
public void removeRgroupMember(int rgroupIndex, int memberIndex)
Removes an R-group definition 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:
rgroupIndex
- the index of the R-group definitionmemberIndex
- the index of the member- Throws:
IndexOutOfBoundsException
- If the definition index is not valid or if the member index is not valid- Since:
- 5.10 2012.05.10
-
removeRgroupBridgeMember
public void removeRgroupBridgeMember(chemaxon.struc.RgroupBridgeId bridgeId, int memberIndex)
Removes a definition member of an R-group bridge. If it is the last member to be removed, then the whole R-group bridge will be removed. Note: the R-group bridge members are always indexed continuously starting with 0.- Parameters:
bridgeId
- R-group bridge IDmemberIndex
- the index of the member- Since:
- Marvin 14.10.13
- See Also:
RgroupBridgeId
-
removeRgroupMembers
public void removeRgroupMembers(int rgroupIndex, int[] memberIndexes)
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:
rgroupIndex
- the index of the R-group definitionmemberIndexes
- the array of the member indexes- Throws:
IndexOutOfBoundsException
- If the definition index is not valid or if a member index is not valid- Since:
- 5.10 2012.05.10
-
removeRgroup
public void removeRgroup(int rgroupIndex)
Removes an R-group. Note: the R-group definitions are always indexed continuously starting with 0.- Parameters:
rgroupIndex
- the index of the R-group definition- Throws:
IndexOutOfBoundsException
- If the definition index is not valid- Since:
- 5.10 2012.05.10
-
removeRgroupBridge
public void removeRgroupBridge(chemaxon.struc.RgroupBridgeId bridgeId)
Removes an R-group bridge.- Parameters:
bridgeId
- R-group bridge ID- Since:
- Marvin 14.10.13
- See Also:
RgroupBridgeId
-
hasRgroupContainedBy
public boolean hasRgroupContainedBy(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(Set<?> set)
Ungroup R-groups consisting of the specified atoms and make them 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 atomsrgid
- R-group ID- Since:
- 4.0, 06/30/2005
-
getRlogic
public int getRlogic(int i)
Gets R-logic flags.- Specified by:
getRlogic
in interfacechemaxon.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 indexf
- R-logic flags- See Also:
RG_ID_MASK
,RG_ID2_FLAG
,RG_ID2_OFF
,RG_ID2_MASK
,RG_RESTH
-
getRlogicRange
public String getRlogicRange(int i)
Gets R-logic occurrence range.- Specified by:
getRlogicRange
in interfacechemaxon.struc.RgMoleculeGraphIface
- Parameters:
i
- R-group index- Returns:
- the occurrence range: By default it is an empty string which means "as drawn".
-
setRlogicRange
public void setRlogicRange(int index, String range) throws IllegalArgumentException
Sets R-logic occurrence range. If null is given as range, de R-logic range is set to default empty string.- Parameters:
index
- R-group indexrange
- range of occurrance.- Throws:
IllegalArgumentException
- bad occurrence range
-
checkRlogicRange
public String checkRlogicRange(int index, String range) throws IllegalArgumentException
Checks an R-logic occurrence range string for syntax errors and returns a "normalized" string.- Parameters:
index
- R-group indexrange
- range of occurrence- Returns:
- the normalized occurrence range string
- Throws:
IllegalArgumentException
- bad occurrence range- Since:
- Marvin 3.4
-
clearForImport
public void clearForImport(String fmt)
Clear the edges vector and the properties.- Overrides:
clearForImport
in classMolecule
- 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(String s)
Sets the name of the root molecule.
-
getName
public String getName()
Gets the name of the root molecule.- Specified by:
getName
in interfaceIncomplecule
- Overrides:
getName
in classMolecule
- Returns:
- the molecule name or an empty string
-
setComment
public void setComment(String s)
Sets the comment of the root molecule.- Overrides:
setComment
in classMolecule
- Parameters:
s
- the comment, empty string or null (null is equivalent to empty string)
-
getComment
public String getComment()
Gets the comment of the root molecule.- Overrides:
getComment
in classMolecule
- Returns:
- the comment or empty string
-
properties
public MPropertyContainer properties()
Gets the property container.- Specified by:
properties
in interfaceIncomplecule
- Overrides:
properties
in classMoleculeGraph
- 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 classMoleculeGraph
- Since:
- Marvin 4.1, 08/03/2006
-
setInputFormat
public void setInputFormat(String format)
Sets the input file format.- Overrides:
setInputFormat
in classMolecule
- 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.
-
endReuse
public void endReuse(int n)
End reusing atoms.
-
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 classMoleculeGraph
- Returns:
- the ctab array
-
getBondTable
public 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 classMoleculeGraph
- 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 interfacechemaxon.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 interfacechemaxon.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 identifier of the R-group member that contains the specified atom.- Specified by:
getRgroupMemberId
in interfacechemaxon.struc.RgMoleculeGraphIface
- Parameters:
node
- the atom- Returns:
- the ID 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 classMolecule
- Parameters:
d
- 0, 2 or 3- See Also:
MoleculeGraph.getFlags()
-
getFlags
public int getFlags()
Gets the dimension and chiral flags.- Overrides:
getFlags
in classMoleculeGraph
- 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 classMoleculeGraph
- 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 classMoleculeGraph
- Parameters:
f
- new value of the specified bitsmask
- bits to set
-
setAbsStereo
public void setAbsStereo(boolean c)
Sets the absolute stereoconfiguration flag for the root structure and the R-groups.- Overrides:
setAbsStereo
in classMoleculeGraph
- 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 interfaceIncomplecule
- Specified by:
getAtomCount
in interfacechemaxon.core.structure.StructureForBuilder
- Overrides:
getAtomCount
in classMoleculeGraph
- 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 classMoleculeGraph
- 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 classMoleculeGraph
- Parameters:
i
- node index- Returns:
- the node object
-
setAtom
@Deprecated public void setAtom(int iu, MolAtom node)
Deprecated.as of Marvin 6.2, may constructs inconsistentMoleculeGraph
. UseMoleculeGraph.removeAtom(MolAtom)
andadd(MolAtom)
to modify the structure.Sets the node at the specified index in the graph union.- Overrides:
setAtom
in classMoleculeGraph
- Parameters:
iu
- the atom indexnode
- the atom
-
clone
public RgMolecule clone()
Clone the markush structure. Document is not cloned!
-
cloneMoleculeWithDocument
public RgMolecule cloneMoleculeWithDocument()
Description copied from class:Molecule
Makes an identical copy of the molecule and its document. If the molecule does not have a parent, then copies non-molecular data: graphics objects, electron flows, text boxes, atom and bond sets (color, font and thickness). Otherwise (root, rgroup, component molecule) creates a new document.- Overrides:
cloneMoleculeWithDocument
in classMolecule
- Returns:
- the copy
-
add
public void add(MolAtom node)
Adds an atom to the root structure.- Overrides:
add
in classMoleculeGraph
- 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 classMolecule
- Parameters:
atom
- the atom reference
-
insertNullAtoms
protected void insertNullAtoms(int i, int count)
Insert nulls into the atom array.- Overrides:
insertNullAtoms
in classMoleculeGraph
- Parameters:
i
- starting indexcount
- 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 classMoleculeGraph
- Parameters:
i
- starting indexcount
- 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 interfaceIncomplecule
- Overrides:
getBondCount
in classMoleculeGraph
- Returns:
- number of edges
-
getBond
public MolBond getBond(int i)
Gets an edge in the graph union.- Overrides:
getBond
in classMoleculeGraph
- Parameters:
i
- edge index- Returns:
- the edge object
-
setBond
@Deprecated public void setBond(int iu, MolBond edge)
Deprecated.as of Marvin 6.2, may constructs inconsistentMoleculeGraph
. UseMoleculeGraph.removeBond(MolBond)
for bond removal andadd(MolBond)
for adding a new bond to the molecule.Sets the edge at the specified index in the graph union.- Overrides:
setBond
in classMoleculeGraph
- Parameters:
iu
- the bond indexedge
- the bond
-
replaceBond
@Deprecated public void replaceBond(MolBond olde, MolBond newe)
Deprecated.as of Marvin 6.2, may constructs inconsistentMoleculeGraph
. UseMoleculeGraph.removeBond(MolBond)
for bond removal andadd(MolBond)
for adding a new bond to the molecule.Replaces an edge by another one.- Overrides:
replaceBond
in classMoleculeGraph
- Parameters:
olde
- the old edgenewe
- the new edge- Since:
- Marvin 4.1, 11/24/2005
-
add
public void add(MolBond bond)
Adds a bond to the root structure.
-
indexOf
public int indexOf(MolAtom node)
Gets the index of the specified node in the graph union.- Overrides:
indexOf
in classMoleculeGraph
- 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 classMoleculeGraph
- Parameters:
edge
- the edge- Returns:
- the index, or -1 if not found
- See Also:
Object.equals(Object)
-
contains
public boolean contains(MolAtom node)
Checks if the root structure or an R-group contains the specified node.
-
contains
public boolean contains(MolBond edge)
Checks if the root structure or an R-group contains the specified edge.- Overrides:
contains
in classMoleculeGraph
- Parameters:
edge
- the edge object- Returns:
- true if the graph contains the object, false otherwise
- See Also:
Object.equals(Object)
-
isEmpty
public boolean isEmpty()
Ask if the molecule is empty or not.
-
isQuery
public boolean isQuery()
Indicates if the molecule has query features.- Overrides:
isQuery
in classMoleculeGraph
- 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
@Deprecated public boolean isAtom()
Deprecated.As of Marvin 14.7.7, no replacement.
Not supported feature.Determines whether the structure represents only one atom and an arbitrary number of bonds.- Overrides:
isAtom
in classMoleculeGraph
- Returns:
true
the root structure represents an atom and there are no R-groups,false
otherwise
-
isBond
@Deprecated public boolean isBond()
Deprecated.As of Marvin 14.7.7, no replacement.
Not supported feature.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 classMoleculeGraph
- Returns:
true
if 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 classMolecule
- 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 returnsfalse
, an RgMolecule cannot be a reaction component.- Overrides:
canBeReactionComponent
in classMolecule
- Returns:
true
if it can be a reactant, product or agent,false
if adding it to anRxnMolecule
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 classMolecule
- 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 classMoleculeGraph
- 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 classMolecule
- Returns:
- the root structure if there are no R-groups present,
this
otherwise - Since:
- Marvin 4.1.13, 09/20/2007
-
addRgroupsTo
public RgMolecule addRgroupsTo(Molecule m)
Creates an RgMolecule containing R-groups of this object from the 'simplified molecule' object made of 'm'.- Parameters:
m
- the simple molecule object- Returns:
- RgMolecule 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. UseMoleculeGraph.removeAtom(MolAtom)
instead unless you are sure what you are doing.- Overrides:
removeAtom
in classMolecule
- Parameters:
node
- the atomcleanupFlags
- 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. UseMoleculeGraph.removeAtom(MolAtom)
instead unless you are sure what you are doing.- Overrides:
removeAtom
in classMolecule
- Parameters:
i
- the atom indexcleanupFlags
- 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 interfacechemaxon.struc.RgMoleculeGraphIface
- Parameters:
m
- the removed R-group memberf
- 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 classMolecule
- Parameters:
edge
- the bondcleanupFlags
- 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 classMolecule
- Parameters:
i
- the bond indexcleanupFlags
- 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 classMolecule
-
removeAll
public void removeAll()
Remove all the atoms and bonds from the root structure, and from all the R-groups.
-
isRealAtomParent
protected boolean isRealAtomParent()
R-group molecule objects cannot be real node parents.- Overrides:
isRealAtomParent
in classMoleculeGraph
- 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 classMoleculeGraph
-
sortBondsAccordingTo
public void sortBondsAccordingTo(MolBond[] order)
Sort edges in the same order as they appear in the specified array.- Overrides:
sortBondsAccordingTo
in classMoleculeGraph
- 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 classMoleculeGraph
- 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 classMoleculeGraph
- Parameters:
g
- the other moleculecheck
-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
@Deprecated public void checkConsistency()
Deprecated.As of Marvin 5.7, no replacement.
Not intended for public use, it was intended only for internal debugging.Checks the internal consistency of the structure. Use this method for debugging.- Overrides:
checkConsistency
in classMolecule
- Throws:
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 R-group in this RgMolecule; if yes then also adds the component to that R-group, otherwise adds it to the root structure.- Overrides:
fuse0
in classMolecule
- Parameters:
graph
- the graph that will be fused into this moleculecheck
-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
@Deprecated public void mergeAtoms(MolAtom that, MolAtom a)
Deprecated.As of Marvin 6.2, useMergeUtil.mergeAtoms(MolAtom, MolAtom, boolean)
instead.Merges bonds of an atom with another atom, then add the atom to the molecule.- Overrides:
mergeAtoms
in classMolecule
- Parameters:
that
- the atoma
- 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 classMolecule
- Parameters:
a
- the atomsg
- the S-groupset
- set (true) or unset (false)- Throws:
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. If the target molecule is not an RgMolecule, then only the root structure will be cloned.
-
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.
-
isSelfReference
public boolean isSelfReference(MProp p)
Tests whether the specified property is a self reference to the molecule.- Overrides:
isSelfReference
in classMoleculeGraph
- 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 classMolecule
- Parameters:
prop
- the property- Since:
- Marvin 4.1.6, 02/14/2007
- See Also:
MoleculeGraph.clonecopy(MoleculeGraph)
-
clonelesscopy
@Deprecated public void clonelesscopy(MoleculeGraph g)
Deprecated.as of Marvin 6.3.
Not supported feature.Copy to selection. Make another molecule identical to this one, but do not clone atoms, bonds, and the props.- Overrides:
clonelesscopy
in classMolecule
- Parameters:
g
- the target molecule
-
getFormula
public String getFormula()
Gets the molecular formula in Hill order.- Overrides:
getFormula
in classMoleculeGraph
- 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 classMoleculeGraph
- 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 classMolecule
- Returns:
- an RgMolecule object
-
newSelectionMolecule
public SelectionMolecule newSelectionMolecule()
Creates a new SelectionMolecule object appropriate for storing selection from this molecule.- Overrides:
newSelectionMolecule
in classMolecule
- 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 classMolecule
- 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.
-
getGraphUnion
public MoleculeGraph getGraphUnion()
Gets a graph containing all the atoms and bonds.- Overrides:
getGraphUnion
in classMoleculeGraph
- 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 classMoleculeGraph
- 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 classMoleculeGraph
- Parameters:
arr
- the output arrayoff
- 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 classMolecule
- 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 classMoleculeGraph
- Parameters:
i
- atom index- Returns:
- the number of lone pairs
-
aromatize
public void aromatize(int method)
Aromatizes molecule. Changes the bonds.- Overrides:
aromatize
in classMolecule
- Parameters:
method
- Specifies the algorithm for aromatization. Possible values:- AROM_BASIC - Basic aromatization
- AROM_GENERAL - General (Daylight compatible) aromatization
- AROM_BASIC: only up to 18 membered rings are checked
- AROM_GENERAL: no ring system limit
- Throws:
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 classMolecule
- Parameters:
method
- Specifies the algorithm for aromatization. Possible values:- AROM_BASIC - Basic aromatization
- AROM_GENERAL - General (Daylight compatible) aromatization
- 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:
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 classMolecule
- Throws:
RuntimeException
- if inconsistency found- Since:
- Marvin 5.0, 11/06/2007
-
toString
public String toString()
Overrides Object.toString() to ease debugging.- Overrides:
toString
in classMoleculeGraph
- 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 classMoleculeGraph
- Since:
- Marvin 4.1.13, 09/19/2007
- See Also:
RxnMolecule.isIncompleteReaction()
-
createGearch
protected chemaxon.struc.gearch.MoleculeGraphGearch createGearch()
- Overrides:
createGearch
in classMolecule
-
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 interfacechemaxon.struc.MObjectContainer
- Overrides:
clearObjects
in classMolecule
-
getObjectCount
public int getObjectCount()
- Specified by:
getObjectCount
in interfacechemaxon.struc.MObjectContainer
- Overrides:
getObjectCount
in classMolecule
-
removeObject
public void removeObject(MObject mo)
- Specified by:
removeObject
in interfacechemaxon.struc.MObjectContainer
- Overrides:
removeObject
in classMolecule
-
selectAllObjects
public void selectAllObjects(boolean s)
- Specified by:
selectAllObjects
in interfacechemaxon.struc.MObjectContainer
- Overrides:
selectAllObjects
in classMolecule
-
getAllObjects
public List<MObject> getAllObjects()
- Specified by:
getAllObjects
in interfacechemaxon.struc.MObjectContainer
- Overrides:
getAllObjects
in classMolecule
-
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 classMoleculeGraph
- 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:
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 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 classMoleculeGraph
- 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:
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 classMoleculeGraph
- Returns:
- true if succesful
- See Also:
MoleculeGraph.stereoClean()
-
setValenceCheckOptions
public void setValenceCheckOptions(ValenceCheckOptions options)
Sets the options for valence checking. To just enable/disable valence check in the molecule useMoleculeGraph.setValenceCheckEnabled(boolean)
. Calling this function with a not null parameter automatically enables the valence check.- Overrides:
setValenceCheckOptions
in classMoleculeGraph
- Parameters:
options
- the new valence check options- See Also:
ValenceCheckOptions
-
getValenceCheckOptions
public ValenceCheckOptions getValenceCheckOptions()
Returns the options for valence checking. To see if the valence check is enabled on the molecule useMoleculeGraph.isValenceCheckEnabled()
- Overrides:
getValenceCheckOptions
in classMoleculeGraph
- Returns:
- the valence check options
- See Also:
ValenceCheckOptions
-
canBeCT
public boolean canBeCT(int i2, int i3, boolean grcheck)
Determines whether the bond between the specified atoms can be a CIS/TRANS or not. In case of ring bonds the ring sizes of the ring for the existence of CIS/TRANS specific bond should be checked before calling this method as ring sizes are not checked in this method.- Overrides:
canBeCT
in classMoleculeGraph
- Parameters:
i2
- index of the first atomi3
- index of the second atomgrcheck
- true if check atom equivalences using graph invariants- Returns:
- true if this is a double bond that can be either CIS, TRANS or EITHER, false otherwise.
- Since:
- Marvin 4.0 1/23/2005
-
getAtomIterator
public IteratorFactory.AtomIterator getAtomIterator()
Returns an iterator over the atoms in this molecule in proper sequence.- Overrides:
getAtomIterator
in classMoleculeGraph
- Returns:
- an iterator over the atoms in this molecule in proper sequencer
- Since:
- Marvin 6.2, 2013.09.09.
-
getBondIterator
public IteratorFactory.BondIterator getBondIterator()
Returns an iterator over the bonds in this molecule in proper sequence.- Overrides:
getBondIterator
in classMoleculeGraph
- Returns:
- an iterator over the bonds in this molecule in proper sequence
- Since:
- Marvin 6.2, 2013.09.09.
-
setRestH
public void setRestH(int rgroupIndex)
Sets the restH condition on an R-group definition.- Parameters:
rgroupIndex
- the index of the R-group definition
-
removeRestH
public void removeRestH(int rgroupIndex)
Removes the restH condition from an R-group definition.- Parameters:
rgroupIndex
- the index of the R-group definition
-
isRestH
public boolean isRestH(int rgroupIndex)
Informs whether the restH condition is set to the referenced R-group definition.- Parameters:
rgroupIndex
- the index of the R-group definition- Returns:
- true if the restH condition is set false otherwise
-
setDependentRgroupDefinition
public void setDependentRgroupDefinition(int rgroupIndexIf, int rgroupIndexThen)
Sets the dependent R-group definition (rgroupIndexThen
) for the referenced R-group definition (rgroupIndexIf
).- Parameters:
rgroupIndexIf
- the R-group definition on which the other one dependsrgroupIndexThen
- the R-group definition which depends on the other one
-
getDependentRgroupDefinition
public int getDependentRgroupDefinition(int rgroupIndex)
Gets the R-group definition's index which depends on the referenced R-group definition.- Parameters:
rgroupIndex
- the R-group definition index- Returns:
- the index of the dependent R-group definition or -1 if none exists
-
removeDependentRgroupDefinition
public void removeDependentRgroupDefinition(int rgroupIndex)
Removes the dependent R-group definition of the referenced R-group definition.- Parameters:
rgroupIndex
- the R-group definition ID
-
getRgroupDisplayLabel
public String getRgroupDisplayLabel(int rgroupIndex)
- Specified by:
getRgroupDisplayLabel
in interfacechemaxon.struc.RgMoleculeGraphIface
-
-