Package chemaxon.struc
Class MoleculeGraph
- java.lang.Object
-
- chemaxon.struc.MoleculeGraph
-
- All Implemented Interfaces:
chemaxon.core.calculations.valencecheck.MoleculeWithValence<MolAtom>
,chemaxon.core.structure.MoleculeForBuilder
,chemaxon.core.structure.RootStructureForBuilder
,chemaxon.core.structure.StructureForBuilder
,Incomplecule
,MTransformable
,StereoConstants
,Serializable
- Direct Known Subclasses:
Molecule
,SelectionMolecule
@PublicAPI public class MoleculeGraph extends Object implements chemaxon.core.structure.MoleculeForBuilder, Incomplecule, MTransformable, StereoConstants, Serializable, chemaxon.core.calculations.valencecheck.MoleculeWithValence<MolAtom>
A graph consisting of MolAtom nodes and MolBond edges.- Since:
- Marvin 3.0, 10/11/2002
- See Also:
MolAtom
,MolBond
, Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MoleculeGraph.ValenceCheckState
Deprecated.As of Marvin 6.0, replaced bysetValenceCheckOptions(ValenceCheckOptions)
andValenceCheckOptions
.
-
Field Summary
Fields Modifier and Type Field Description static int
AROM_AMBIGUOUS
Aromatization type for ambiguous 5-membered rings.static int
AROM_BASIC
Basic aromatization.static int
AROM_CHUCKEL
Huckel aromatization.static int
AROM_GENERAL
General (Daylight conform) aromatization.static int
AROM_LOOSE
Loose aromatization.static int
AROM_SUBSTRUCTURE
Substructure aromatization.protected int
atomCount
The number of atoms.protected static int
AUTO_UNGROUP
Automatic ungroup bit in flags.protected int
bondCount
The number of bonds.protected BondTable
btab
Bond table.static int
CACHE_REMOVE_ALL
Cache removal option for clearing all cached info.static int
CACHE_REMOVE_AROMATAMODULE
Cache removal option for remove module used in aromatization.static int
CACHE_REMOVE_CACHEMEMORY
Cache removal option for cacheMemory.static int
CACHE_REMOVE_GRINVMODULE
Cache removal option for remove module used in graph invariant calculation.static int
CACHE_REMOVE_PARITYMODULE
Cache removal option for remove module used in parity calculation.static int
CACHE_REMOVE_SSSRMODULE
Cache removal option for remove module used in sssr.static int
CACHE_REMOVE_TABS
Cache remove option to clear ctab and btab.protected List<Object[]>
cacheMemory
protected int[][]
ctab
Connection table.static int
DEAROM_GENERAL
General dearomatization.static int
DEAROM_HUCKELCHECK
Dearomatize method which dearomatizes only that molecules which fullfills the Huckel's rule.static int
DEAROM_HUCKELCHECK_EX
Dearomatize method which dearomatizes only that molecules which fullfills the Huckel's rule.protected static int
DIM_MASK
Dimension bits in flags.static int
FRAG_BASIC
Basic fragmentation, only atom - atom connections (bond) are considered.static int
FRAG_KEEPING_MULTICENTERS
Fragmentation without breaking multicenter S-groups.static int
FRAG_KEEPING_SGROUPS
Fragmentation without breaking S-groups.static int
FRAG_TYPE_COUNT
Number of fragmentation types.chemaxon.struc.gearch.MoleculeGraphGearch
gearch
static int
GRINV_DONT_STORE
Graph invariant option to instruct that the graph invariant should not be stored in MoleculeGraph.static int
GRINV_NOHYDROGEN
Graph invariant option for ignoring explicit hydrogens.static int
GRINV_OLDSTEREO
Graph invariant option for calculating graph invariants using the old stereo method.static int
GRINV_STEREO
Graph invariant option for calculating graph invariants using stereo information.static int
GRINV_USEMAPS
Graph invariant option for calculating graph invariants considering atom maps also.static int
GRINV_VALUE_OPTIONS
Unified mask of graph invariant options affecting grinv value.protected long
grinvCC
Graph invariant change count.protected static int
INITIAL_CAPACITY
Initial capacity of the atoms and bonds vectors.static String
INVALID_LINKNODE_MESSAGE
static int
MIN_RING_SIZE_FOR_TRANS_DB
The minimal size of the ring for the existence of TRANS double bond.static int
OMIT_POSTCLEAN
Omit arranging process after the hydrogen addition.protected double
orix
Origin x.protected double
oriy
Origin y.protected double
oriz
Origin z.protected MoleculeGraph
parentGraph
The structure that contains this molecule graph as a substructure.protected MPropertyContainer
propertyContainer
static int
RMCLEANUP_ALL
Perform all clean-up methods when removing an atom or a bond.static int
RMCLEANUP_EDGES
When removing an atom or a bond, also remove the bond(s) from the atom object(s).protected static int
RMCLEANUP_FIXCOMPONENT
Remove called from RxnMolecule.fixComponent.static int
RMCLEANUP_MOBJECT
Remove graphics objects containing the removed atom.static int
RMCLEANUP_NONE
Do not perform any clean-up methods when removing an atom or a bond.static int
RMCLEANUP_PARENTDOC
Remove atom from parent document.static int
RMCLEANUP_STEREO
When removing a H atom, keep stereo information unchanged.protected MoleculeGraph
superGraph
Parent of all parents.protected MolAtom[]
theAtoms
The atoms (nodes).protected MolBond[]
theBonds
The bonds (edges).protected boolean
useOnlyFirstAtomInStereoCalculation
protected static int
VALENCE_CHECK
Valence check calculation bit in flags.protected static int
VALENCE_CHECK_AMBIGUOUS
Deprecated.As of Marvin 6.0, replaced byValenceCheckOptions
.-
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 MoleculeGraph()
Construct a 2 dimensional molecule.MoleculeGraph(MoleculeGraph p, int na, int nb)
Construct a molecule or fragment with the specified number of atoms and bonds.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
add(MolAtom atom)
Adds an atom to the molecule.void
add(MolBond bond)
Adds a bond to the molecule.void
add(MolBond bond, boolean checkParallel)
Add a bond to the molecule.protected void
addAtom0(MolAtom atom)
Adds an atom.protected void
addAtomsAndBondsTo(MoleculeGraph s)
Adds all atoms and bonds to the specified molecule.protected void
addAtomToFragment(MolAtom atom)
Adds an atom to a fragment.protected int
addAtomWithoutChangingIt(MolAtom atom)
Adds an atom without setting its parentGraph and index fields.protected void
addBond0(MolBond bond)
Adds a bond.protected int
addBondWithoutChangingIt(MolBond bond)
Adds a bond without setting its parentGraph and index fields.boolean
addExplicitHydrogens(int f)
Deprecated.As of Marvin 5.7, replaced byHydrogenize.convertImplicitHToExplicit(MoleculeGraph, MolAtom[], int)
.
Usage:boolean
addExplicitHydrogens(int f, MolAtom[] atoms)
Deprecated.As of Marvin 5.7, replaced byHydrogenize.convertImplicitHToExplicit(MoleculeGraph, MolAtom[], int)
.
Usage:void
addExplicitLonePairs()
Deprecated.As of Marvin 5.7, replaced byHydrogenize.convertImplicitLonePairsToExplicit(MoleculeGraph, MolAtom[])
.
Usage:protected int
addSimpleAtomWithoutChangingIt(MolAtom atom)
Adds a non-SgroupAtom atom without setting its parentGraph and index fields.void
adjustMultiChiralFlag()
Checks whether the molecule has multiple chiral centresvoid
aromatize()
Aromatize molecule using the default general aromatization method.void
aromatize(boolean a)
Aromatize (using the default general aromatization method) or dearomatize molecule.void
aromatize(int method)
Aromatizes molecule.void
aromatize(int method, boolean checkAmbiguity)
Aromatizes molecule.boolean
arrangeComponents()
Deprecated.As of Marvin 5.7, replaced byCleanUtil.arrangeComponents(MoleculeGraph, boolean, boolean)
.
Usage:List<MolAtom>
atoms()
Provides a list view of the atoms in the molecule.double
bondlength()
Calculates the regular bond length.List<MolBond>
bonds()
Provides a list view of the bonds in the molecule.DPoint3
calcCenter()
Calculates the geometrical center.void
calcCenter(DPoint3 p)
Calculates the geometrical center.int
calcDehydrogenizedGrinv(int[] gi)
Calculates the graph invariants with the assumption that hydrogens are removed.double
calcHeight()
Calculates the molecule height.void
calcHybridization()
Calculates and sets hybridazation state for each atom.DPoint3
calcOutRect()
Calculates the outer rectangle.void
calcOutRect(DPoint3 p)
Calculates the outer rectangle.DPoint3
calcOutRectCenter()
Calculates the center of the outer rectangle.void
calcOutRectCenter(DPoint3 p)
Calculates the center of the outer rectangle.double
calcWidth()
Calculates the molecule width.boolean
canBeCT(int i2, int i3)
Determines whether the bond between the specified atoms can be a CIS/TRANS or not.boolean
canBeCT(int i2, int i3, boolean grcheck)
Determines whether the bond between the specified atoms can be a CIS/TRANS or not.boolean
canBeCT(MolBond bond)
Determines whether the given bond can be a CIS/TRANS or not.protected void
checkBondConsistency()
void
checkConsistency()
Deprecated.As of Marvin 5.7, no replacement.
Not intended for public use, it was intended only for internal debugging.boolean
clean(int dim, String opts)
Deprecated.As of Marvin 5.7, replaced byCleaner.clean(MoleculeGraph, int, String)
.boolean
clean(int dim, String opts, MProgressMonitor pmon)
Deprecated.As of Marvin 5.7, replaced byCleaner.clean(MoleculeGraph, int, String, MProgressMonitor)
.void
clear()
Clears the molecule.void
clearCachedInfo(int options)
Deletes the cached information depending on the given options.void
clearForImport(String format)
Clears the bonds vector, the properties, the flags, and sets the origin coordinates to 0.MoleculeGraph
clone()
Make an identical copy of the molecule.protected int
cloneAtoms(int[] cnodes, MoleculeGraph graph)
Copies the specified atoms.void
clonecopy(int[] iatoms, MoleculeGraph g)
Copies the specified atoms of this molecule graph to another one.void
clonecopy(MoleculeGraph m)
Make another molecule identical to this one.protected boolean
clonecopyMoleculeGraphWithoutSgroups(int[] cnodes, MolBond[] cedges, int nb, MoleculeGraph graph)
Copies the specified atoms and bonds of this molecule graph to another one.void
clonelesscopy(MoleculeGraph graph)
Deprecated.as of Marvin 6.3.
Not supported feature.protected void
connectOriginalBondsToNewAtom(MolAtom newAtom, MolAtom orig, MolBond[] bonds)
Sets the original connections to the new atom.boolean
contains(MolAtom atom)
Checks if the molecule graph contains the specified atom.boolean
contains(MolBond bond)
Checks if the molecule graph contains the specified bond, or a bond which is equals with the given bond.boolean
contains(MoleculeGraph graph)
Does the molecule graph contain the specified fragment?protected MoleculeGraph
createDehydrogenizedReadOnlyGraph()
Creates a dehydrogenized version of the molecule.protected chemaxon.struc.gearch.MoleculeGraphGearch
createGearch()
protected Smolecule
createSmolecule()
Creates aSmolecule
represenation of this molecule.boolean
dearomatize()
Dearomatize molecule.boolean
dearomatize(int method)
Dearomatize molecule.protected int
findAtom(MolAtom atom)
Finds an atom in the atoms array.MolAtom
findAtomClone(MolAtom a)
Finds the clone of an atom.<C extends MoleculeGraph>
C[]findBasicFrags(Class<C> cl)
Determines the disconnected fragments and puts them into an array.protected int
findBond(MolBond bond)
Finds a bond in the bonds array.int[]
findComponentIds()
Deprecated.int[]
findComponentIds(int[] inds)
Assigns a component ID to each connected component formed by the specified atom indexes.void
findFrag(int i, int fragmentationType, MoleculeGraph frag)
Determines the subgraph connected to the specified atom.void
findFrag(int i, MoleculeGraph frag)
Deprecated.As of Marvin 5.6, replaced byfindFrag(int, int, MoleculeGraph)
andFRAG_KEEPING_MULTICENTERS
.
Usage:void
findFragById(int fragId, int fragmentationType, MoleculeGraph frag)
Determines the subgraph corresponding to the specific fragment ID.<C extends MoleculeGraph>
C[]findFrags(Class<C> cl)
Deprecated.<C extends MoleculeGraph>
C[]findFrags(Class<C> cl, int fragmentationType)
Determines the disconnected fragments and puts them into an array.protected static int
findInArray(Object[] array, int[] indices, int n, Object o)
Finds an object in an array.void
fixProperties()
Delegates to tracker's fixProperties().protected boolean
fixSelfReferringProperty(MProp prop)
Fix a property containing reference to the molecule.void
fuse(MoleculeGraph graph)
Adds those atoms and bonds of another molecule to this one that are not already elements.void
fuse(MoleculeGraph graph, boolean check)
Adds atoms and bonds of another molecule to this one.protected void
fuse0(MoleculeGraph g, boolean check)
Adds the atoms and bonds of another molecule to this one.int[][][]
getAromaticAndAliphaticRings(int aromatizationType, boolean onlyAromrings, boolean aromatize, int maxRingSize, int ringsLimit)
Returns the aromatic and or aliphatic ring atom indexes.
Note: This method does not aromatize the already aromatized rings.MolAtom
getAtom(int n)
Gets the nth atom.MolAtom[]
getAtomArray()
Creates an array of atoms.int
getAtomCount()
Gets the number of atoms.int
getAtomCount(int atomicNumber)
Gets the number of atoms with the given atomic number.int
getAtomicNumber(MolAtom atom)
IteratorFactory.AtomIterator
getAtomIterator()
Returns an iterator over the atoms in this molecule in proper sequence.List<MolAtom>
getAtomReferenceList()
Deprecated.Useatoms()
instead.MolBond
getBond(int n)
Gets the nth bond.MolBond[]
getBondArray()
Creates an array of bonds.int
getBondCount()
Gets the number of bonds.IteratorFactory.BondIterator
getBondIterator()
Returns an iterator over the bonds in this molecule in proper sequence.protected MolBond[]
getBonds(MolAtom atom)
Returns the bonds attached to the given atom in this molecule graph.BondTable
getBondTable()
Gets the bond (edge) table.int
getCharge(MolAtom atom)
int
getChirality(int i)
Computes the chirality of an atom of the Molecule instance based on both the coordinates of the neighboring atoms and the stereo information of the bonds to those.int[][]
getCSSR()
Gets the Complete Set of Smallest Ring atom indexes array.int[][]
getCSSRIdxesForAtoms()
Get the cssr ring indexes in which the atom (specified with it's index) can be located.int[][]
getCtab()
Gets the connection table.double
getDesiredLength(int atno1, int atno2, int type)
Deprecated.double
getDesiredLength(MolBond b)
Deprecated.As of Marvin 5.11, replaced byMolBond.desiredLength(int, int, int, int)
,MolBond.getType()
andgetDim()
.
Usage:int
getDim()
Gets the dimension.MDocument
getDocument()
Gets the document object.protected MDocument
getDocumentForChild(MoleculeGraph g)
Gets the parent document for a child molecule graph.DPoint3[]
getEnclosingCube()
Gets the cube that encloses the atoms of molecule graph.double
getExactMass()
Calculates the molecular weight of the molecule using the mass of the most frequent natural isotope of the atoms.int
getExplicitHcount()
Gets the total number of explicit hydrogens attached to the molecule.int
getExplicitLonePairCount(int i)
Deprecated.useMDocument.getExplicitLonePairCount()
insteadchemaxon.struc.stereo.EZConfiguration
getEZStereo(MolBond bond)
Deprecated.as of Marvin 15.2.16 replaced byCIPStereoCalculator.calculateCIPStereoDescriptors(MoleculeGraph, boolean)
.int
getFlags()
Gets the dimension and chiral flags.MoleculeGraph
getForefather()
Gets the first parent.int
getFormalCharge()
Gets the (total) formal charge of the molecule.String
getFormula()
Gets the molecular formula.int
getFragCount()
Deprecated.int
getFragCount(int fragmentationType)
Returns the number of fragments for the given fragmentation type.int[]
getFragIds(int fragmentationType)
Gets an array containing the fragment id for each atom for the given fragmentation type.int
getFreeAttachmentPoints(MolAtom atom)
MoleculeGraph
getGraphUnion()
Gets a molecule graph containing all the atoms and bonds.protected int[]
getGrinv()
Gets the graph invariants array.int
getGrinv(int[] gi)
Gets the graph invariants (canonical labels).int
getGrinv(int[] gi, boolean uniqueFlag)
Deprecated.As of Marvin 4.0, replaced bygetGrinv(int[], int)
.
Usage:int
getGrinv(int[] gi, int options)
Gets the graph invariants (canonical labels).long
getGrinvCC()
Gets the graph invariant change count.int
getGrinvOptions()
Gets graph invariant calculation options passed to the module.int
getImplicitHcount()
Gets the total number of implicit hydrogens attached to the molecule.int
getImplicitHCount(MolAtom atom)
MolAtom
getLigand(MolAtom atom, int n)
int
getLigandAtno(MolAtom atom, int n)
chemaxon.struc.BondType
getLigandBondType(MolAtom atom, int i)
int
getLigandCount(MolAtom atom)
int
getLocalParity(int i)
Computes the local parity of an atom of the Molecule instance based on both the coordinates of the neighboring atoms and the stereo information of the bonds to those.DPoint3
getLocation()
Gets the origin of the molecule.Object
getLock()
Gets the lock object for synchronization.int
getLonePairCount(int i)
Deprecated.useMDocument.getLonePairCount()
insteaddouble
getMass()
Calculates the molecular weight of the molecule.int
getMaxRgroupAttachmentPointOrder()
Returns the maximal attachment point order of R-group attachment point atoms in this molecule graph.String
getName()
Gets the molecule title/name.MoleculeGraph
getParent()
Gets the parent graph that contains this substructure.protected MDocument
getParentDocument()
Gets the document or the document of the parent graph.int
getParity(int i)
Computes the parity of an atom of the Molecule instance based on both the coordinates of the neighboring atoms and the stereo information of the bonds to those.int
getParityType(int idx)
Gets parity type.DPoint3[]
getPoints()
Gets an array containing the atom coordinates.protected int
getPossibleAttachmentPoints(MolAtom molAtom)
Deprecated.As of Marvin 6.0, replaced bySuperatomSgroup.getAttachmentPointOrders(MolAtom)
andMolAtom.getAttachParentSgroup()
.
Usage:int
getRadicalCount(MolAtom atom)
int[]
getSmallestRingSizeForIdx()
Get the smallest ring size in which the atom (specified with it's index) can be located.int[][]
getSSSR()
Gets the Smallest Set of Smallest Ring atom indexes array.int[][]
getSSSRBonds()
Gets the Smallest Set of Smallest Ring bond indexes array.BitSet[]
getSSSRBondsAsBitSet()
Gets the Smallest Set of Smallest Ring edges as an array of BitSets, one BitSet for each ring.BitSet
getSSSRBondSet()
Get SSSR bond index bitset.long[]
getSSSRBondSetInLong()
Deprecated.as of 15.09.2014, usegetSSSRBondSet()
insteadint[][]
getSSSRIdxesForAtoms()
Get the sssr ring indexes in which the atom (specified with it's index) can be located.int
getStereo2(int i1, int i2, int i3, int i4)
Gets cis/trans stereo information for an A1-A2=A3-A4 atom configuration.int
getStereo2(MolAtom a1, int i2, int i3, MolAtom a4)
Gets cis/trans stereo information for an A1-A2=A3-A4 atom configuration.int
getStereo2(MolBond b)
Deprecated.as of Marvin 6.3 replaced bygetEZStereo(MolBond)
.protected int
getStereo2(MolBond b, MolAtom a1, int i2, int i3, MolAtom a4)
Gets cis/trans stereo information for an A1-A2=A3-A4 atom configuration.protected int
getStereo2(MolBond b, MolAtom a1, int i2, int i3, MolAtom a4, boolean grcheck)
Gets cis/trans stereo information for an A1-A2=A3-A4 atom configuration.int
getStereo2(MolBond b, MolAtom a1, MolAtom a4)
Gets cis/trans stereo information for an A1-A2=A3-A4 atom configuration.int
getStereo2(MolBond b, MolAtom a1, MolAtom a4, boolean grcheck)
Gets cis/trans stereo information for an A1-A2=A3-A4 atom configuration.protected int
getSubGraphCount()
Gets the number of all "submolecules".MoleculeGraph[]
getSubGraphs()
Gets all "submolecules".protected void
getSubGraphs(MoleculeGraph[] m, int off)
Gets all "submolecules".int
getTotalCharge()
Gets the total (formal) charge of the molecule.ValenceCheckOptions
getValenceCheckOptions()
Returns the options for valence checking.MoleculeGraph.ValenceCheckState
getValenceCheckState()
Deprecated.int
getValenceProperty(MolAtom atom)
double[]
getVisibleCoords(MolAtom ma)
Returns the coordinates of the given atom (contained in the molecule).boolean
hasAtomSet()
Tests whether the molecule graph has atom sets.boolean
hasBondSet()
Tests whether the molecule graph has atom sets.boolean
hasExplicitLonePairs()
Deprecated.useMDocument.hasExplicitLonePairs()
insteadboolean
hasExtraLabelSet()
boolean
hasImplicitH()
Tests whether the molecule has implicit hydrogen atoms.boolean
hasSelfReferringProperty()
Tests whether the property list contains the molecule.boolean
hasValenceError()
Determines if this molecule has a valence error on any of its atoms.boolean
hydrogenize(boolean add)
Deprecated.As of Marvin 5.7, replaced byHydrogenize.convertImplicitHToExplicit(MoleculeGraph)
andHydrogenize.convertExplicitHToImplicit(MoleculeGraph)
.void
implicitizeHydrogens(int f)
Deprecated.As of Marvin 5.7, replaced byHydrogenize.convertExplicitHToImplicit(MoleculeGraph, int)
.
Usage:void
implicitizeHydrogens(int f, MolAtom[] atoms)
Deprecated.As of Marvin 5.7, replaced byHydrogenize.convertExplicitHToImplicit(MoleculeGraph, MolAtom[], int)
.
Usage:void
implicitizeHydrogens(int f, MolAtom[] atoms, boolean check)
Deprecated.As of Marvin 5.7, replaced byHydrogenize.convertExplicitHToImplicit(MoleculeGraph, MolAtom[], int, boolean)
.
Usage:protected boolean
implicitizeHydrogens0(int f, MolAtom[] atoms, boolean check)
Deprecated.As of Marvin 5.7, replaced byHydrogenize.convertExplicitHToImplicit(MoleculeGraph, MolAtom[], int, boolean)
.
Usage:protected void
incGrinvCC()
Increases the graph invariant change count and sets grinv to null.protected void
incGrinvCC(boolean isSSSRReset)
void
incGrinvCCOnly()
Increases the graph invariant change count, but does not change grinv.int
indexOf(MolAtom atom)
Gets the index of the specified atom.int
indexOf(MolBond bond)
Gets the index of the specified bond.void
insertAtom(int i, MolAtom atom)
Deprecated.as of Marvin 6.2, may construct inconsistentMoleculeGraph
.void
insertBond(int i, MolBond bond)
Deprecated.as of Marvin 6.2, may constructs inconsistentMoleculeGraph
.void
insertBondInOrder(MolBond e, MolBond[] order)
Insert a bond in the order specified as the second argument.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
isAbsStereo()
Gets the absolute stereoconfiguration flag.boolean
isAcceptedSpecialLigand(MolAtom atom)
boolean
isAtom()
Deprecated.As of Marvin 14.7.7, no replacement.
Not supported feature.boolean
isAtomInRing(MolAtom atom)
boolean
isBond()
Deprecated.As of Marvin 14.7.7, no replacement.
Not supported feature.protected boolean
isBondParallelWith(MolBond b)
Checks if there is a bond parallel (having same endpoints) with the given bond in this MoleculeGraph.boolean
isEmpty()
Tests whether the molecule graph is empty.protected boolean
isGrinvCCValid()
Tests whether the graph invariant change count is valid.boolean
isLargeMolecule()
Returnstrue
if large molecule (number of atoms exceeds1000
).boolean
isMolecule()
Deprecated.as of Marvin 14.7.7, no replacement.
Usage:boolean
isMultiChiral()
Returns the multiple chirality flag.protected void
isolate(MolAtom node)
Isolates atom: a more efficient way of removing an atom thanremoveAtom(chemaxon.struc.MolAtom)
, especially for large molecule graphs.protected void
isolate(MolBond edge)
Isolates bond: a more efficient way of removing a bond thanremoveBond(chemaxon.struc.MolBond)
, especially for large molecule graphs.boolean
isOnlyFirstAtomInStereoCalculation()
Get how parity module interpret wedges.boolean
isQuery()
Indicates if the molecule has query features: query atoms or query bonds.protected boolean
isRealAtomParent()
Can it be a real atom parent?boolean
isRing()
Deprecated.As of Marvin 14.7.7, no replacement.
Not supported feature.boolean
isRingBond(int idx)
Is this bond in ring?boolean
isSelfReference(MProp p)
Tests whether the specified property is a self reference to the molecule.boolean
isSimilarTo(MoleculeGraph g)
Tests if the molecule graph is similar to another graph.boolean
isSymmetric()
Tests whether the molecule graph is symmetric.boolean
isValenceCheckEnabled()
Determines whether valence check is enabled on this molecule graph.boolean
isValidLinkNode(int linkAtomIdx, int outer1, int outer2)
Checks whether the specified link atom is valid or not.protected void
makeItSimilar(MoleculeGraph g)
Copies some properties of this molecule to the other one specified as argument.void
mergeAtoms(MolAtom replacementAtom, MolAtom origAtom)
Deprecated.As of Marvin 6.2, useMergeUtil.mergeAtoms(MolAtom, MolAtom, boolean)
instead.int
mergeFrags(int id1, int id2, int fragmentationType)
Merges two connected components of the given fragmentation type.void
moveTo(DPoint3 o)
Move the molecule.MoleculeGraph
newInstance()
Creates a new MoleculeGraph object.void
pack()
Reduce memory usage.boolean
partialClean(int dim, int[] fixed, String opts)
Deprecated.As of Marvin 5.7, replaced byCleaner.partialClean(MoleculeGraph, int, int[], String)
.boolean
partialClean(Molecule[] template, String opts)
Deprecated.As of Marvin 5.7, replaced byCleaner.partialClean(Molecule, Molecule[], String)
.boolean
partialClean(MoleculeGraph template, int[] map, String opts)
Deprecated.As of Marvin 5.7, replaced byCleaner.partialClean(MoleculeGraph, MoleculeGraph, int[], String)
.MPropertyContainer
properties()
Gets the property container.void
qpropCheck(List<MolAtom> v)
Check for query property errors.void
regenBonds()
Regenerates the bond vector: remove its elements, then put the bond objects from the atoms into it.protected void
regenBtab()
Regenerates the bond table.protected void
regenCtab()
Regenerates the connection table.protected void
regenGearch()
Recreate graph search results object.void
removeAll()
Removes all the atoms and bonds.void
removeAllBonds()
Removes all bonds.void
removeAtom(int i)
Removes an atom and its bonds by index.void
removeAtom(int i, int cleanupFlags)
Removes an atom and its bonds with extra clean-up options.void
removeAtom(MolAtom atom)
Removes an atom and its bonds by reference.void
removeAtom(MolAtom atom, int cleanupFlags)
Removes an atom and its bonds with extra clean-up options.void
removeBond(int i)
Removes a bond by index.protected void
removeBond(int i, int cleanupFlags)
Removes a bond by index.void
removeBond(MolBond bond)
Removes a bond by reference.protected void
removeBond(MolBond bond, int cleanupFlags)
Removes a bond by reference.void
removeExplicitLonePairs()
Deprecated.As of Marvin 5.7, replaced byHydrogenize.convertExplicitLonePairsToImplicit(MoleculeGraph)
.protected void
removeIsolatedAtoms()
Removes thenull
atom entries in the atoms array and sets the index fields appropriately.protected void
removeIsolatedBonds()
Removes thenull
bond entries in the bonds array and sets the index fields appropriately.void
replaceAtom(int i, MolAtom newAtom)
Replaces the atom on the given index with the parameter atom and removes the parameter atom from its original parent molecule if needed.void
replaceBond(MolBond oldb, MolBond newb)
Deprecated.as of Marvin 6.2, may constructs inconsistentMoleculeGraph
.protected void
resetCtab()
An operation performed that changed the connection table and the graph invariants.protected void
resetGrinvInParents()
Graph invariants must be recalculated for this graph and all parent graphs.protected Object[]
restoreCache(int n)
Restores caches like connection table, bond table, etc.void
revalidateCoordDependentProps()
Revalidate coordinate dependent properties.protected Object[]
saveCache(int n)
Saves caches like connection table, bond table, etc.void
setAbsStereo(boolean c)
Sets the absolute stereoconfiguration flag.void
setAtom(int i, MolAtom atom)
Deprecated.as of Marvin 6.2, may construct inconsistentMoleculeGraph
.protected void
setAtom0(int i, MolAtom atom)
Sets the atom at the specified index.void
setAtomSetSeqs(int id)
Sets the set sequence number of all atoms.void
setBond(int i, MolBond b)
Deprecated.as of Marvin 6.2, may constructs inconsistentMoleculeGraph
.void
setBondSetSeqs(int id)
Sets the set sequence number of all bonds.boolean
setChirality(int i, int c)
Set chirality of an atom of the Molecule instance based on both the coordinates of the neighboring atoms and the stereo information of the bonds to those.boolean
setChirality(Map<Integer,Integer> chiralities)
Sets the chiralities of atoms.void
setDim(int d)
Sets the dimension.protected void
setFlags(int f)
Sets the flags of the molecule.protected void
setFlags(int f, int mask)
Sets specified bits in the flags.protected void
setGrinvCC(long g)
Sets the graph invariant change count.void
setGrinvOptions(int opt)
Sets graph invariant calculation options passed to the module.void
setLinkNodeDefaultOuters(MolAtom atom)
Sets link node outer atoms to default values, if they are not set yet; making sure that the resulting link node configuration is valid.boolean
setLocalParity(int[] p, boolean useActualWedges)
In case of 2D molecule change the bonds flag (UP/DOWN), in case of 0D molecule set the atom flags to achieve the specified parity array.boolean
setLocalParity(int[] idxes, int[] p, boolean useActualWedges)
Set given local parity for the given atomic indexes.void
setLocation(DPoint3 o)
Set the origin of the molecule.boolean
setParity(int[] p)
Change the bonds flag (UP/DOWN) connected to the whole molecule to achieve the specified parity array.boolean
setParity(int[] p, boolean useActualWedges)
Change the bonds flag (UP/DOWN) connected to the whole molecule to achieve the specified parity array.boolean
setParity(int i, int p)
Change the bonds flag (UP/DOWN) connected to the given atom to achieve the specified parity.protected void
setSupergraph(MoleculeGraph molecule)
Sets the given molecule as the supergraph of this graph.void
setValenceCheckEnabled(boolean b)
Enables or disables valence check on this molecule graph, depending on the value of the parameter b.void
setValenceCheckOptions(ValenceCheckOptions options)
Sets the options for valence checking.void
setValenceCheckState(MoleculeGraph.ValenceCheckState state)
Deprecated.As of Marvin 6.0, replaced bysetValenceCheckOptions(ValenceCheckOptions)
andsetValenceCheckEnabled(boolean)
.
Usage:Smolecule
smol()
Gets aSmolecule
representation of this molecule.void
sortBondsAccordingTo(MolBond[] order)
Sorts bonds in the same order as they appear in another chemical graph.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 MoleculeGraph.toString() to ease debugging.void
transform(CTransform3D t)
Apply a transformation matrix to the atomic coordinates.void
transform(CTransform3D t, boolean incg)
Apply a transformation matrix to the atomic coordinates.protected void
updateDim(MoleculeGraph m)
Updates the dimensions when fusing two structures.void
useOnlyFirstAtomInStereoCalculation(boolean f)
Set how parity module should interpret wedes.void
valenceCheck()
Check valence and query property errors for atoms.void
valenceCheck(List<MolAtom> v)
Check valence and query property errors.
-
-
-
Field Detail
-
INITIAL_CAPACITY
protected static final int INITIAL_CAPACITY
Initial capacity of the atoms and bonds vectors.- See Also:
- Constant Field Values
-
AROM_BASIC
public static final int AROM_BASIC
Basic aromatization.- Since:
- Marvin 4.1, 12/09/2005
- See Also:
aromatize(int)
, Constant Field Values
-
AROM_GENERAL
public static final int AROM_GENERAL
General (Daylight conform) aromatization.- Since:
- Marvin 4.1, 12/09/2005
- See Also:
aromatize(int)
, Constant Field Values
-
AROM_LOOSE
public static final int AROM_LOOSE
Loose aromatization.- Since:
- Marvin 5.2, 01/11/2008
- See Also:
aromatize(int)
, Constant Field Values
-
AROM_SUBSTRUCTURE
public static final int AROM_SUBSTRUCTURE
Substructure aromatization. Used internally.- Since:
- Marvin 5.3, 09/14/2009
- See Also:
aromatize(int)
, Constant Field Values
-
AROM_AMBIGUOUS
public static final int AROM_AMBIGUOUS
Aromatization type for ambiguous 5-membered rings. This option of aromatization checks 5-membered rings with bond pattern similar to pyrrole and having A, AH, Q, QH, atom list (with ambiguous atom types) or not list at the N position (with the two single bonds). In that particular ring, the bonds are replaced by "single or aromatic" and "double or aromatic" bonds. Fusion with aromatic rings are tricky, the aromatic rings should be aromatized first.- Since:
- Marvin 5.4, 08/14/2010
- See Also:
aromatize(int)
, Constant Field Values
-
AROM_CHUCKEL
public static final int AROM_CHUCKEL
Huckel aromatization.- Since:
- Marvin 16.12, 09/12/2016
- See Also:
CHuckelAromatization
, Constant Field Values
-
DEAROM_GENERAL
public static final int DEAROM_GENERAL
General dearomatization.- Since:
- Marvin 5.2.3, 06/29/2008
- See Also:
dearomatize(int)
, Constant Field Values
-
DEAROM_HUCKELCHECK
public static final int DEAROM_HUCKELCHECK
Dearomatize method which dearomatizes only that molecules which fullfills the Huckel's rule.- Since:
- Marvin 5.2.3, 06/29/2008
- See Also:
dearomatize(int)
, Constant Field Values
-
DEAROM_HUCKELCHECK_EX
public static final int DEAROM_HUCKELCHECK_EX
Dearomatize method which dearomatizes only that molecules which fullfills the Huckel's rule. The same as DEAROM_HUCKELCHECK but throws exception if dearomatization fails.- Since:
- Marvin 5.2.3, 06/29/2008
- See Also:
dearomatize(int)
, Constant Field Values
-
INVALID_LINKNODE_MESSAGE
public static final String INVALID_LINKNODE_MESSAGE
- See Also:
- Constant Field Values
-
DIM_MASK
protected static final int DIM_MASK
Dimension bits in flags.- See Also:
getFlags()
, Constant Field Values
-
AUTO_UNGROUP
protected static final int AUTO_UNGROUP
Automatic ungroup bit in flags. Specified changes will result in an automatic ungroup of the affected S-groups. Changes causing ungroup:- changes in atom type
- changes in bond type
- See Also:
- Constant Field Values
-
VALENCE_CHECK
protected static final int VALENCE_CHECK
Valence check calculation bit in flags. Valence check will be called according to this flag.- Since:
- Marvin 5.4
- See Also:
- Constant Field Values
-
VALENCE_CHECK_AMBIGUOUS
@Deprecated protected static final int VALENCE_CHECK_AMBIGUOUS
Deprecated.As of Marvin 6.0, replaced byValenceCheckOptions
.Valence check calculation bit in flags for checking ambiguous aromatic atoms requiring . Valence check of ambiguous atoms will be called according to this flag.- Since:
- Marvin 5.9
- See Also:
- Constant Field Values
-
RMCLEANUP_NONE
public static final int RMCLEANUP_NONE
Do not perform any clean-up methods when removing an atom or a bond.- Since:
- Marvin 3.1
- See Also:
removeAtom(MolAtom, int)
,removeAtom(int, int)
,removeBond(MolBond, int)
,removeBond(int, int)
, Constant Field Values
-
RMCLEANUP_FIXCOMPONENT
protected static final int RMCLEANUP_FIXCOMPONENT
Remove called from RxnMolecule.fixComponent. For internal use only.- Since:
- Marvin 4.1.3, 11/16/2006
- See Also:
RMCLEANUP_ALL
, Constant Field Values
-
RMCLEANUP_ALL
public static final int RMCLEANUP_ALL
Perform all clean-up methods when removing an atom or a bond.- Since:
- Marvin 3.1
- See Also:
removeAtom(MolAtom, int)
,removeAtom(int, int)
,removeBond(MolBond, int)
,removeBond(int, int)
, Constant Field Values
-
RMCLEANUP_EDGES
public static final int RMCLEANUP_EDGES
When removing an atom or a bond, also remove the bond(s) from the atom object(s).- Since:
- Marvin 3.1
- See Also:
removeAtom(MolAtom, int)
,removeAtom(int, int)
,removeBond(MolBond, int)
,removeBond(int, int)
, Constant Field Values
-
CACHE_REMOVE_ALL
public static final int CACHE_REMOVE_ALL
Cache removal option for clearing all cached info.- See Also:
clearCachedInfo(int)
, Constant Field Values
-
CACHE_REMOVE_CACHEMEMORY
public static final int CACHE_REMOVE_CACHEMEMORY
Cache removal option for cacheMemory.- See Also:
cacheMemory
,clearCachedInfo(int)
, Constant Field Values
-
RMCLEANUP_STEREO
public static final int RMCLEANUP_STEREO
When removing a H atom, keep stereo information unchanged.- Since:
- Marvin 3.1
- See Also:
removeAtom(MolAtom, int)
,removeAtom(int, int)
,RMCLEANUP_ALL
, Constant Field Values
-
RMCLEANUP_MOBJECT
public static final int RMCLEANUP_MOBJECT
Remove graphics objects containing the removed atom.- Since:
- Marvin 4.1, 03/07/2006
- See Also:
removeAtom(MolAtom, int)
,removeAtom(int, int)
,RMCLEANUP_ALL
, Constant Field Values
-
RMCLEANUP_PARENTDOC
public static final int RMCLEANUP_PARENTDOC
Remove atom from parent document.- Since:
- Marvin 4.1.13, 09/06/2007
- See Also:
removeAtom(MolAtom, int)
,removeAtom(int, int)
,RMCLEANUP_ALL
, Constant Field Values
-
GRINV_NOHYDROGEN
public static final int GRINV_NOHYDROGEN
Graph invariant option for ignoring explicit hydrogens.- See Also:
getGrinv(int[], int)
, Constant Field Values
-
GRINV_STEREO
public static final int GRINV_STEREO
Graph invariant option for calculating graph invariants using stereo information. (Chirality & E/Z)- See Also:
getGrinv(int[], int)
, Constant Field Values
-
GRINV_OLDSTEREO
public static final int GRINV_OLDSTEREO
Graph invariant option for calculating graph invariants using the old stereo method. (Chirality only.)- See Also:
getGrinv(int[], int)
, Constant Field Values
-
GRINV_USEMAPS
public static final int GRINV_USEMAPS
Graph invariant option for calculating graph invariants considering atom maps also.- See Also:
getGrinv(int[], int)
, Constant Field Values
-
GRINV_VALUE_OPTIONS
public static final int GRINV_VALUE_OPTIONS
Unified mask of graph invariant options affecting grinv value. But see values below that are not included into this value when introducing a new one to avoid undesired side-effects.- See Also:
- Constant Field Values
-
GRINV_DONT_STORE
public static final int GRINV_DONT_STORE
Graph invariant option to instruct that the graph invariant should not be stored in MoleculeGraph.- See Also:
getGrinv(int[], int)
, Constant Field Values
-
CACHE_REMOVE_GRINVMODULE
public static final int CACHE_REMOVE_GRINVMODULE
Cache removal option for remove module used in graph invariant calculation.- See Also:
clearCachedInfo(int)
, Constant Field Values
-
CACHE_REMOVE_PARITYMODULE
public static final int CACHE_REMOVE_PARITYMODULE
Cache removal option for remove module used in parity calculation.- See Also:
clearCachedInfo(int)
, Constant Field Values
-
CACHE_REMOVE_AROMATAMODULE
public static final int CACHE_REMOVE_AROMATAMODULE
Cache removal option for remove module used in aromatization.- See Also:
clearCachedInfo(int)
, Constant Field Values
-
CACHE_REMOVE_SSSRMODULE
public static final int CACHE_REMOVE_SSSRMODULE
Cache removal option for remove module used in sssr.- See Also:
clearCachedInfo(int)
, Constant Field Values
-
CACHE_REMOVE_TABS
public static final int CACHE_REMOVE_TABS
Cache remove option to clear ctab and btab.- See Also:
clearCachedInfo(int)
, Constant Field Values
-
MIN_RING_SIZE_FOR_TRANS_DB
public static final int MIN_RING_SIZE_FOR_TRANS_DB
The minimal size of the ring for the existence of TRANS double bond.- See Also:
- Constant Field Values
-
OMIT_POSTCLEAN
public static final int OMIT_POSTCLEAN
Omit arranging process after the hydrogen addition.- See Also:
addExplicitHydrogens(int)
, Constant Field Values
-
FRAG_BASIC
public static final int FRAG_BASIC
Basic fragmentation, only atom - atom connections (bond) are considered.- See Also:
- Constant Field Values
-
FRAG_KEEPING_MULTICENTERS
public static final int FRAG_KEEPING_MULTICENTERS
Fragmentation without breaking multicenter S-groups.- See Also:
- Constant Field Values
-
FRAG_KEEPING_SGROUPS
public static final int FRAG_KEEPING_SGROUPS
Fragmentation without breaking S-groups.- See Also:
- Constant Field Values
-
FRAG_TYPE_COUNT
public static final int FRAG_TYPE_COUNT
Number of fragmentation types.- See Also:
- Constant Field Values
-
superGraph
protected transient MoleculeGraph superGraph
Parent of all parents.
-
parentGraph
protected transient MoleculeGraph parentGraph
The structure that contains this molecule graph as a substructure.
-
theAtoms
protected transient MolAtom[] theAtoms
The atoms (nodes).
-
atomCount
protected transient int atomCount
The number of atoms.
-
theBonds
protected transient MolBond[] theBonds
The bonds (edges).
-
bondCount
protected transient int bondCount
The number of bonds.
-
orix
protected transient double orix
Origin x.
-
oriy
protected transient double oriy
Origin y.
-
oriz
protected transient double oriz
Origin z.
-
grinvCC
protected transient long grinvCC
Graph invariant change count. The number of times the molecule (and the corresponding graph invariants) may have changed since the creation of the molecule.- See Also:
getGrinvCC()
,incGrinvCC()
,incGrinvCCOnly()
,getGrinv(int[])
-
ctab
protected transient int[][] ctab
Connection table.
-
btab
protected transient BondTable btab
Bond table.
-
gearch
public transient chemaxon.struc.gearch.MoleculeGraphGearch gearch
-
propertyContainer
protected transient MPropertyContainer propertyContainer
-
useOnlyFirstAtomInStereoCalculation
protected transient boolean useOnlyFirstAtomInStereoCalculation
-
-
Constructor Detail
-
MoleculeGraph
public MoleculeGraph(MoleculeGraph p, int na, int nb)
Construct a molecule or fragment with the specified number of atoms and bonds.- Parameters:
p
- the molecule that contains the created fragmentna
- no reallocation needed until the number of atoms is less than this valuenb
- no reallocation needed until the number of bonds is less than this value
-
MoleculeGraph
public MoleculeGraph()
Construct a 2 dimensional molecule.
-
-
Method Detail
-
getParent
public final MoleculeGraph getParent()
Gets the parent graph that contains this substructure.- Returns:
- the parent, or null if this is the supergraph
- Since:
- Marvin 2.6
-
getForefather
public final MoleculeGraph getForefather()
Gets the first parent.- Returns:
- parent of all parents
- Since:
- Marvin 2.9.11
-
getLock
public final Object getLock()
Gets the lock object for synchronization. The lock object is the top parent.- Returns:
- the lock object
- Since:
- Marvin 2.6
-
add
public void add(MolAtom atom)
Adds an atom to the molecule.- Parameters:
atom
- the atom object
-
add
public void add(MolBond bond)
Adds a bond to the molecule. If the molecule graph is a superGraph, the bond is also added to its endpoints (two MolAtom objects).- Parameters:
bond
- the bond object
-
add
public void add(MolBond bond, boolean checkParallel)
Add a bond to the molecule. If the second parameter is true, there an exception thrown when there is already a bond between the given MolAtoms. There is no checking if either is SgroupAtom. If the molecule graph is a superGraph, the bond is also added to its endpoints (two MolAtom objects).- Parameters:
bond
- the bond objectcheckParallel
-
-
addAtom0
protected void addAtom0(MolAtom atom)
Adds an atom.- Parameters:
atom
- the atom reference
-
addAtomWithoutChangingIt
protected int addAtomWithoutChangingIt(MolAtom atom)
Adds an atom without setting its parentGraph and index fields.- Parameters:
atom
- the atom reference- Returns:
- the new atom index
-
addSimpleAtomWithoutChangingIt
protected int addSimpleAtomWithoutChangingIt(MolAtom atom)
Adds a non-SgroupAtom atom without setting its parentGraph and index fields.- Parameters:
atom
- the atom reference- Returns:
- the new atom index
-
addAtomToFragment
protected void addAtomToFragment(MolAtom atom)
Adds an atom to a fragment.- Parameters:
atom
- the atom reference
-
addBond0
protected void addBond0(MolBond bond)
Adds a bond.- Parameters:
bond
- the bond reference
-
addBondWithoutChangingIt
protected final int addBondWithoutChangingIt(MolBond bond)
Adds a bond without setting its parentGraph and index fields.- Parameters:
bond
- the bond reference- Returns:
- the new bond index
-
pack
public void pack()
Reduce memory usage.
-
removeAtom
public void removeAtom(MolAtom atom)
Removes an atom and its bonds by reference.- Parameters:
atom
- the atom- Since:
- Marvin 5.3, 04/30/2009
-
removeAtom
public void removeAtom(int i)
Removes an atom and its bonds by index.- Parameters:
i
- the atom index- Since:
- Marvin 5.3, 04/30/2009
-
removeBond
public void removeBond(MolBond bond)
Removes a bond by reference.- Parameters:
bond
- the bond- Since:
- Marvin 5.3, 04/30/2009
-
removeBond
public void removeBond(int i)
Removes a bond by index.- Parameters:
i
- the bond index- Since:
- Marvin 5.3, 04/30/2009
-
removeAllBonds
public void removeAllBonds()
Removes all bonds.- Since:
- Marvin 5.3, 04/30/2009
-
removeAll
public void removeAll()
Removes all the atoms and bonds.
-
getDocument
public MDocument getDocument()
Gets the document object.- Returns:
- a Marvin document object
- Since:
- Marvin 3.3
-
getParentDocument
protected MDocument getParentDocument()
Gets the document or the document of the parent graph. Moved to separate method because R-groups in RgMolecule should not have a normal document parent. If two R-groups would have a common document parent, then their bounds would be determined incorrectly because the graphics objects are common.- Returns:
- the parent document
- Since:
- Marvin 4.1.1, 08/23/2006
-
getDocumentForChild
protected MDocument getDocumentForChild(MoleculeGraph g)
Gets the parent document for a child molecule graph.- Parameters:
g
- the child graph orthis
- Returns:
- the parent document
- Since:
- Marvin 4.1.1, 08/23/2006
-
smol
public final Smolecule smol()
Gets aSmolecule
representation of this molecule.- Returns:
- the
Smolecule
implementation - Since:
- Marvin 5.2.2, 04/24/2009
-
createSmolecule
protected final Smolecule createSmolecule()
Creates aSmolecule
represenation of this molecule.- Returns:
- the new
Smolecule
- Since:
- Marvin 5.2.2, 04/24/2009
-
setDim
public void setDim(int d)
Sets the dimension.- Parameters:
d
- 0, 2, or 3- See Also:
setFlags(int)
-
getDim
public int getDim()
Gets the dimension.- Returns:
- 0, 2, or 3
- See Also:
getFlags()
-
getFlags
public int getFlags()
Gets the dimension and chiral flags.- Returns:
- the flags
- Since:
- Marvin 5.0.1, 02/10/2008
-
setFlags
protected void setFlags(int f)
Sets the flags of the molecule.- Parameters:
f
- the flags- Since:
- Marvin 5.0.1, 02/10/2008
- See Also:
flags
-
isAbsStereo
public boolean isAbsStereo()
Gets the absolute stereoconfiguration flag. "Chiral flag" in MDL molfiles.- Returns:
- true for absolute, false for relative configuration
- See Also:
getFlags()
-
setAbsStereo
public void setAbsStereo(boolean c)
Sets the absolute stereoconfiguration flag.- Parameters:
c
- the absolute stereoconfiguration flag- See Also:
setFlags(int)
-
clear
public void clear()
Clears the molecule. Does the same as clearForImport() but also clears the atoms vector.- See Also:
clearForImport(java.lang.String)
,theAtoms
-
clearForImport
public void clearForImport(String format)
Clears the bonds vector, the properties, the flags, and sets the origin coordinates to 0. The molecule dimension is set to 2.- Parameters:
format
- input file format, neglected- See Also:
theBonds
,orix
,oriy
,oriz
,setFlags(int)
-
removeAtom
public void removeAtom(MolAtom atom, int cleanupFlags)
Removes an atom and its bonds with extra clean-up options. This method is for internal use only. UseremoveAtom(MolAtom)
instead unless you are sure what you are doing.- Parameters:
atom
- the atomcleanupFlags
- extra clean-up methods- Since:
- Marvin 5.3, 04/30/2009
- See Also:
RMCLEANUP_NONE
,RMCLEANUP_ALL
,RMCLEANUP_EDGES
-
removeAtom
public void removeAtom(int i, int cleanupFlags)
Removes an atom and its bonds with extra clean-up options. This method is for internal use only. UseremoveAtom(int)
instead unless you are sure what you are doing.- Parameters:
i
- the atom indexcleanupFlags
- extra clean-up methods- Since:
- Marvin 5.3, 04/30/2009
- See Also:
RMCLEANUP_NONE
,RMCLEANUP_ALL
,RMCLEANUP_EDGES
-
setAtom0
protected void setAtom0(int i, MolAtom atom)
Sets the atom at the specified index.- Parameters:
i
- atom indexatom
- new atom reference
-
setBond
@Deprecated public void setBond(int i, MolBond b)
Deprecated.as of Marvin 6.2, may constructs inconsistentMoleculeGraph
. UseremoveBond(MolBond)
for bond removal andadd(MolBond)
for adding a new bond to the molecule.Sets the bond at the specified index.- Parameters:
i
- bond indexb
- the bond reference
-
replaceBond
@Deprecated public void replaceBond(MolBond oldb, MolBond newb)
Deprecated.as of Marvin 6.2, may constructs inconsistentMoleculeGraph
. UseremoveBond(MolBond)
for removal andadd(MolBond)
for adding a new bond to the molecule.Replaces an bond by another one.- Parameters:
oldb
- the old bondnewb
- the new bond- Since:
- Marvin 5.3, 04/30/2009
-
setAtomSetSeqs
public final void setAtomSetSeqs(int id)
Sets the set sequence number of all atoms.- Parameters:
id
- the set sequence number- Since:
- Marvin 4.0
-
setBondSetSeqs
public final void setBondSetSeqs(int id)
Sets the set sequence number of all bonds.- Parameters:
id
- the set sequence number- Since:
- Marvin 4.0
-
getGrinv
public int getGrinv(int[] gi)
Gets the graph invariants (canonical labels). The graph invariants are copied into the specified array, that must have the same length as the number of atoms in the molecule.Notes: 1. For normal molecules and R-groups, graph invariants are recalculated only if an atom or bond changed, removed or added.
2. For selections, graph invariants are recalculated each time this function is called, because atoms and bonds cannot notify selections about their changes.- Parameters:
gi
- output array, its length must be equal to the number of atoms- Returns:
- the number of different graph invariants
- Throws:
SecurityException
- the GraphInvariants module cannot be loaded because of security reasons (firewall)
-
getGrinv
@Deprecated public int getGrinv(int[] gi, boolean uniqueFlag)
Deprecated.As of Marvin 4.0, replaced bygetGrinv(int[], int)
.
Usage:getGrinv(gi, uniqueFlag ? GRINV_OLDSTEREO : 0);
Gets the graph invariants (canonical labels). Same like the former method but if the boolean flag is true, chiral info is also added to invariants (needed for unique SMILES).- Parameters:
gi
- output array, its length must be equal to the number of atomsuniqueFlag
- boolean flag- Returns:
- the number of different graph invariants
- Throws:
SecurityException
- the GraphInvariants module cannot be loaded because of security reasons (firewall)- Since:
- Marvin 3.3
- See Also:
getGrinv(int[], int)
-
getGrinv
public int getGrinv(int[] gi, int options)
Gets the graph invariants (canonical labels). Optionally, chiral info can be added to the invariants and hydrogens can be ignored. Graph invariants are copied into the specified array, that must have the same length as the number of atoms in the molecule.Notes: 1. For normal molecules and R-groups, graph invariants are recalculated only if an atom or bond changed, removed or added.
2. For selections, graph invariants are recalculated each time this function is called, because atoms and bonds cannot notify selections about their changes.- Parameters:
gi
- output array, its length must be equal to the number of atomsoptions
- graph invariant generation options- Returns:
- the number of different graph invariants
- Throws:
SecurityException
- the GraphInvariants module cannot be loaded because of security reasons (firewall)- Since:
- Marvin 4.0 7/08/2005
- See Also:
GRINV_NOHYDROGEN
,GRINV_STEREO
,GRINV_DONT_STORE
-
calcDehydrogenizedGrinv
public int calcDehydrogenizedGrinv(int[] gi)
Calculates the graph invariants with the assumption that hydrogens are removed. Entries corresponding to hydrogens are filled with -1 values in the output array. Only normal Hydrogen atoms are removed, isotopes (Deuterium and Tricium) are not.- Parameters:
gi
- output array, its length must be equal to the number of atoms- Returns:
- the number of different graph invariants
- Throws:
SecurityException
- the GraphInvariants module cannot be loaded because of security reasons (firewall)- Since:
- Marvin 3.1
- See Also:
getGrinv(int[])
-
createDehydrogenizedReadOnlyGraph
protected MoleculeGraph createDehydrogenizedReadOnlyGraph()
Creates a dehydrogenized version of the molecule. The same atom and bond objects are used as in the original molecule, so the returned structure must be used for reading only. Hydrogen isotopes (Deuterium and Tricium) are not removed.- Returns:
- dehydrogenized structure
- Since:
- Marvin 3.1
-
getGrinv
protected int[] getGrinv()
Gets the graph invariants array. This array is cached, so clone it if you plan to modify it.- Returns:
- the grinv field
- Since:
- Marvin 3.0
- See Also:
grinvCC
-
getGrinvCC
public final long getGrinvCC()
Gets the graph invariant change count. Returns the number of times the graph invariants may have changed since the creation of the molecule.- Returns:
- graph invariant change count
- See Also:
grinvCC
,incGrinvCC()
,incGrinvCCOnly()
,getGrinv(int[])
-
setGrinvCC
protected final void setGrinvCC(long g)
Sets the graph invariant change count.- Parameters:
g
- graph invariant change count- Since:
- Marvin 3.4
- See Also:
grinvCC
,getGrinvCC()
-
incGrinvCC
protected final void incGrinvCC()
Increases the graph invariant change count and sets grinv to null. Incremented in the following cases:- atom, bond addition, removal, property change
- atomic coordinate change
- dimension change
- Since:
- Marvin 3.5
- See Also:
incGrinvCCOnly()
,grinvCC
,getGrinvCC()
,getGrinv(int[])
-
incGrinvCC
protected final void incGrinvCC(boolean isSSSRReset)
-
incGrinvCCOnly
public final void incGrinvCCOnly()
Increases the graph invariant change count, but does not change grinv. Handle with care, it may force certain data to be recalculated!- Since:
- Marvin 4.0 5/07/2005
- See Also:
incGrinvCC()
,grinvCC
,getGrinvCC()
,getGrinv(int[])
-
resetCtab
protected void resetCtab()
An operation performed that changed the connection table and the graph invariants.- Since:
- Marvin 2.6
-
resetGrinvInParents
protected final void resetGrinvInParents()
Graph invariants must be recalculated for this graph and all parent graphs.
-
regenCtab
protected void regenCtab()
Regenerates the connection table. SeegetCtab()
.- Since:
- Marvin 16.6.6
-
regenBtab
protected void regenBtab()
Regenerates the bond table. See#getBtab()
.- Since:
- Marvin 16.6.6
-
addExplicitHydrogens
@Deprecated public boolean addExplicitHydrogens(int f)
Deprecated.As of Marvin 5.7, replaced byHydrogenize.convertImplicitHToExplicit(MoleculeGraph, MolAtom[], int)
.
Usage:Hydrogenize.convertImplicitHToExplicit(molecule, null, f);
Adds explicit H atoms instead of the current implicit ones.- Parameters:
f
- flags specifying special features, otherwise if f is 0, then the result equals with hydrogenize(true).- Returns:
- true for success, false if an error occurred
- Throws:
SecurityException
- cannot load module because of a security problem (firewall)- Since:
- Marvin 4.1.3, 02/11/2006
- See Also:
OMIT_POSTCLEAN
-
addExplicitHydrogens
@Deprecated public boolean addExplicitHydrogens(int f, MolAtom[] atoms)
Deprecated.As of Marvin 5.7, replaced byHydrogenize.convertImplicitHToExplicit(MoleculeGraph, MolAtom[], int)
.
Usage:Hydrogenize.convertImplicitHToExplicit(molecule, atoms, f);
Adds explicit H atoms instead of the current implicit ones.- Parameters:
f
- flags specifying special features, otherwise if f is 0, then the result equals with hydrogenize(true).atoms
- add hydrogens to these atoms only- Returns:
- true for success, false if an error occurred
- Throws:
SecurityException
- cannot load module because of a security problem (firewall)- Since:
- Marvin 5.0, 02/23/2007
- See Also:
OMIT_POSTCLEAN
-
hydrogenize
@Deprecated public boolean hydrogenize(boolean add)
Deprecated.As of Marvin 5.7, replaced byHydrogenize.convertImplicitHToExplicit(MoleculeGraph)
andHydrogenize.convertExplicitHToImplicit(MoleculeGraph)
.Implicit/explicit Hydrogen conversion. Adds explicit H atoms instead of the current implicit ones, or removes explicit H atoms and increases the number of implicit hydrogens.- Parameters:
add
- add explicit H atoms if true, remove if false- Returns:
- true for success, false if an error occurred
- Throws:
SecurityException
- cannot load module because of a security problem (firewall)
-
addExplicitLonePairs
@Deprecated public void addExplicitLonePairs()
Deprecated.As of Marvin 5.7, replaced byHydrogenize.convertImplicitLonePairsToExplicit(MoleculeGraph, MolAtom[])
.
Usage:Hydrogenize.convertImplicitLonePairsToExplicit(molecule, null);
Adds explicit lone pairs.- Throws:
SecurityException
- cannot load module because of a security problem (firewall)- Since:
- Marvin 3.5, 07/06/2004
-
removeExplicitLonePairs
@Deprecated public void removeExplicitLonePairs()
Deprecated.As of Marvin 5.7, replaced byHydrogenize.convertExplicitLonePairsToImplicit(MoleculeGraph)
.Removes explicit lone pairs.- Throws:
SecurityException
- cannot load module because of a security problem (firewall)- Since:
- Marvin 3.5, 07/06/2004
-
implicitizeHydrogens
@Deprecated public final void implicitizeHydrogens(int f)
Deprecated.As of Marvin 5.7, replaced byHydrogenize.convertExplicitHToImplicit(MoleculeGraph, int)
.
Usage:Hydrogenize.convertExplicitHToImplicit(molecule, f);
Removes explicit bound Hydrogens from the molecule graph and converts them to implicit.- Parameters:
f
- flags specifying special H atom types to include- Since:
- Marvin 3.1
-
implicitizeHydrogens
@Deprecated public void implicitizeHydrogens(int f, MolAtom[] atoms)
Deprecated.As of Marvin 5.7, replaced byHydrogenize.convertExplicitHToImplicit(MoleculeGraph, MolAtom[], int)
.
Usage:Hydrogenize.convertExplicitHToImplicit(mol, atoms, f);
Removes explicit bound Hydrogens from the molecule graph and converts them to implicit.- Parameters:
f
- flags specifying special H atom types to includeatoms
- the subset of H atoms to include or null for all- Since:
- Marvin 4.1.3, 11/09/2006
-
implicitizeHydrogens
@Deprecated public void implicitizeHydrogens(int f, MolAtom[] atoms, boolean check)
Deprecated.As of Marvin 5.7, replaced byHydrogenize.convertExplicitHToImplicit(MoleculeGraph, MolAtom[], int, boolean)
.
Usage:Hydrogenize.convertExplicitHToImplicit(mol, atoms, f, check);
Removes explicit bound Hydrogens from the molecule graph and converts them to implicit.- Parameters:
f
- flags specifying special H atom types to includeatoms
- the subset of H atoms to include ornull
for allcheck
-false
if H atoms not belonging to the molecule should be skipped,true
if such atoms should generate aRuntimeException
- Since:
- Marvin 5.0, 06/29/2007
-
implicitizeHydrogens0
@Deprecated protected boolean implicitizeHydrogens0(int f, MolAtom[] atoms, boolean check)
Deprecated.As of Marvin 5.7, replaced byHydrogenize.convertExplicitHToImplicit(MoleculeGraph, MolAtom[], int, boolean)
.
Usage:Hydrogenize.convertExplicitHToImplicit(mol, atoms, f, check);
- Parameters:
f
-atoms
-check
-- Returns:
- true if success else false
-
fuse
public void fuse(MoleculeGraph graph, boolean check)
Adds atoms and bonds of another molecule to this one.- Parameters:
graph
- the other molecule graphcheck
-true
if a containment check should be performed to ensure that only those atoms and bonds are added that are not already elements -false
if the molecule is known to be disjoint from this one and this check can be safely skipped- Since:
- Marvin 5.0
-
fuse
public final void fuse(MoleculeGraph graph)
Adds those atoms and bonds of another molecule to this one that are not already elements. Made final in Marvin 5.0. From Marvin 5.0, subclasses should implementfuse(chemaxon.struc.MoleculeGraph, boolean)
instead.- Parameters:
graph
- the other molecule graph
-
fuse0
protected void fuse0(MoleculeGraph g, boolean check)
Adds the atoms and bonds of another molecule to this one.- Parameters:
g
- the other moleculecheck
-true
if a containment check should be performed to ensure that only those atoms and bonds are added that are not already elements -false
if the molecule is known to be disjoint from this one 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.- Throws:
RuntimeException
- if inconsistency found- Since:
- Marvin 5.0, 11/06/2007
-
checkBondConsistency
protected void checkBondConsistency()
-
updateDim
protected final void updateDim(MoleculeGraph m)
Updates the dimensions when fusing two structures.- Parameters:
m
- the other molecule- Since:
- Marvin 4.0.2, 08/26/2005
-
mergeAtoms
@Deprecated public void mergeAtoms(MolAtom replacementAtom, MolAtom origAtom)
Deprecated.As of Marvin 6.2, useMergeUtil.mergeAtoms(MolAtom, MolAtom, boolean)
instead.Merges the bonds of an atom with another atom, then adds the atom to the molecule.- Parameters:
replacementAtom
- the atom which will take place in the molecule after the mergeorigAtom
- the original atom which's bonds will be added to the new atom
-
hasValenceError
public boolean hasValenceError()
Determines if this molecule has a valence error on any of its atoms.- Returns:
true
if there is an atom with valence error,false
if there is no valence error- Since:
- Marvin 4.1
- See Also:
valenceCheck()
,MolAtom.hasValenceError()
-
valenceCheck
public void valenceCheck()
Check valence and query property errors for atoms. During this check implicit hydrogens are calculated and the valence error flag is set in case of error. It can be set by a previous call ofsetValenceCheckOptions(ValenceCheckOptions)
; which atoms are checked.
-
valenceCheck
public void valenceCheck(List<MolAtom> v)
Check valence and query property errors. Check all the atoms if the argument isnull
. During this check implicit hydrogens are calculated and the valence error flag is set in case of error.- Parameters:
v
- contains the atoms to check- See Also:
MolAtom.valenceCheck()
,valenceCheck()
-
qpropCheck
public void qpropCheck(List<MolAtom> v)
Check for query property errors. Check all the atoms if the argument isnull
.- Parameters:
v
- contains the atoms to check- See Also:
MolAtom.qpropCheck()
-
isSimilarTo
public boolean isSimilarTo(MoleculeGraph g)
Tests if the molecule graph is similar to another graph. Two graphs are similar if:- they have the same number of atoms and bonds,
- for each atom ai in the first graph, there is a corresponding atom aj in the other graph, with the same graph invariant, "equal properties" and "similar bonds".
- Parameters:
g
- the molecule graph- Returns:
true
if the graphs are similar,false
otherwise- Since:
- Marvin 3.4.1, 07/21/2004
- See Also:
MolAtom.haveEqualProperties(MolAtom)
,MolAtom.haveSimilarBonds(MolAtom)
-
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. Note: a one-atom structure has bonds only if it is a fragment.- Returns:
- true if the number of atoms is one
-
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 Carbon orMolAtom.EMPTY
atoms.- Returns:
true
if the structure is the representation of a bond
-
isRing
@Deprecated public boolean isRing()
Deprecated.As of Marvin 14.7.7, no replacement.
Not supported feature.Tests whether the molecule graph represents a ring.- Returns:
true
if the graph is a ring, false otherwise- Since:
- Marvin 4.1, 01/27/2006
-
isSymmetric
public boolean isSymmetric()
Tests whether the molecule graph is symmetric. The graph is symmetric if each atom has the same graph invariant value.- Returns:
- true if the graph is a symmetric, false otherwise
- Since:
- Marvin 4.1, 01/27/2006
-
getName
public String getName()
Gets the molecule title/name. This method is implemented for theIncomplecule
interface but it returns empty string in this basic implementation.- Specified by:
getName
in interfaceIncomplecule
- Returns:
- empty string
- Since:
- Marvin 4.1, 05/28/2006
-
properties
public MPropertyContainer properties()
Gets the property container.- Specified by:
properties
in interfaceIncomplecule
- Returns:
- the property container
- Since:
- Marvin 4.1, 05/28/2006
-
revalidateCoordDependentProps
public void revalidateCoordDependentProps()
Revalidate coordinate dependent properties. This method should be called at molecule import, after all atomic coordinates and bonds are parsed.- Since:
- Marvin 4.1, 08/03/2006
-
getAtomCount
public int getAtomCount()
Gets the number of atoms.- Specified by:
getAtomCount
in interfaceIncomplecule
- Specified by:
getAtomCount
in interfacechemaxon.core.structure.StructureForBuilder
- Returns:
- the number of atoms
-
getAtomCount
public int getAtomCount(int atomicNumber)
Gets the number of atoms with the given atomic number. When atomicNumber is 1, sum includes only explicit Hydrogen atoms (but also D and T isotopes).- Parameters:
atomicNumber
- atomic number of atoms looked for- Returns:
- number of atoms with the given atomic number
- Since:
- Marvin 5.5, 27/01/2011
-
getBondCount
public int getBondCount()
Gets the number of bonds.- Specified by:
getBondCount
in interfaceIncomplecule
- Returns:
- number of bonds
-
getFormalCharge
public int getFormalCharge()
Gets the (total) formal charge of the molecule.- Returns:
- the formal charge of the molecule
- Since:
- Marvin 5.1.3
-
getTotalCharge
public int getTotalCharge()
Gets the total (formal) charge of the molecule. Does the same as thegetFormalCharge()
method.- Returns:
- the total charge of the molecule
- Since:
- Marvin 4.1.10
-
isRealAtomParent
protected boolean isRealAtomParent()
Can it be a real atom parent?- Returns:
- true
- Since:
- Marvin 3.0
-
getAtom
public MolAtom getAtom(int n)
Gets the nth atom.- Parameters:
n
- the atom index- Returns:
- the atom object
-
getBond
public MolBond getBond(int n)
Gets the nth bond.- Parameters:
n
- the bond index- Returns:
- the bond object
-
setAtom
@Deprecated public void setAtom(int i, MolAtom atom)
Deprecated.as of Marvin 6.2, may construct inconsistentMoleculeGraph
. UseremoveAtom(int)
for atom removal andadd(MolAtom)
for adding new atoms.Sets the atom at the specified index.- Parameters:
i
- atom indexatom
- new atom reference- Since:
- Marvin 5.3, 04/30/2009
-
insertAtom
@Deprecated public final void insertAtom(int i, MolAtom atom)
Deprecated.as of Marvin 6.2, may construct inconsistentMoleculeGraph
. Similar functionality is performed byadd(MolAtom)
.Inserts the atom at the specified index.- Parameters:
i
- atom indexatom
- new atom reference- Since:
- Marvin 5.3, 04/30/2009
-
insertNullAtoms
protected void insertNullAtoms(int i, int count)
Insert nulls into the atom array.- Parameters:
i
- starting indexcount
- number of new entries- Since:
- Marvin 5.3, 04/30/2009
-
insertBond
@Deprecated public final void insertBond(int i, MolBond bond)
Deprecated.as of Marvin 6.2, may constructs inconsistentMoleculeGraph
. Similar functionality is performed byadd(MolBond)
.Inserts the bond at the specified index.- Parameters:
i
- bond indexbond
- new bond reference- Since:
- Marvin 5.3, 04/30/2009
-
insertBondInOrder
public void insertBondInOrder(MolBond e, MolBond[] order)
Insert a bond in the order specified as the second argument.- Parameters:
e
- the bond to insertorder
- array of bonds defining the order- Since:
- Marvin 5.3, 04/30/2009
-
insertNullBonds
protected void insertNullBonds(int i, int count)
Insert nulls into the bond array.- Parameters:
i
- starting indexcount
- number of new entries- Since:
- Marvin 5.3, 04/30/2009
-
sortBondsAccordingTo
public void sortBondsAccordingTo(MolBond[] order)
Sorts bonds in the same order as they appear in another chemical graph.- Parameters:
order
- the bonds in the other chemical graph- Since:
- Marvin 5.3, 04/30/2009
-
getAtomArray
public MolAtom[] getAtomArray()
Creates an array of atoms.- Returns:
- array of atom objects
- Since:
- Marvin 2.6
-
getBondArray
public MolBond[] getBondArray()
Creates an array of bonds.- Returns:
- array of bond objects
- Since:
- Marvin 3.5, 09/02/2004
-
calcCenter
public void calcCenter(DPoint3 p)
Calculates the geometrical center.- Parameters:
p
- reference to the object that will hold the result- Since:
- Marvin 2.7
-
calcOutRect
public DPoint3 calcOutRect()
Calculates the outer rectangle.- Returns:
- the outer rectangle (x, y, and z direction width of the outer rectangle)
- Since:
- Marvin 4.1
-
calcOutRect
public void calcOutRect(DPoint3 p)
Calculates the outer rectangle.- Parameters:
p
- reference to the object that will hold the result (x, y, and z direction width of the outer rectangle)- Since:
- Marvin 4.1
-
calcOutRectCenter
public DPoint3 calcOutRectCenter()
Calculates the center of the outer rectangle.- Returns:
- the center
- Since:
- Marvin 4.1
-
calcOutRectCenter
public void calcOutRectCenter(DPoint3 p)
Calculates the center of the outer rectangle.- Parameters:
p
- reference to the object that will hold the result
-
calcCenter
public DPoint3 calcCenter()
Calculates the geometrical center.- Returns:
- center point
-
calcWidth
public double calcWidth()
Calculates the molecule width.- Returns:
- the molecule width
- Since:
- Marvin 3.0
-
calcHeight
public double calcHeight()
Calculates the molecule height.- Returns:
- the molecule height
- Since:
- Marvin 3.0
-
getDesiredLength
@Deprecated public double getDesiredLength(int atno1, int atno2, int type)
Deprecated.As of Marvin 5.11, replaced byMolBond.desiredLength(int, int, int, int)
andgetDim()
.
Usage:MolBond.desiredLength(atno1, atno2, type, getDim());
Gets the ideal bond length in Angstroms.- Parameters:
atno1
- atomic number of first moleculeatno2
- atomic number of second moleculetype
- bond type- Returns:
- the ideal bond length
-
getDesiredLength
@Deprecated public double getDesiredLength(MolBond b)
Deprecated.As of Marvin 5.11, replaced byMolBond.desiredLength(int, int, int, int)
,MolBond.getType()
andgetDim()
.
Usage:MolBond.desiredLength(atno1, atno2, b.getType, getDim());
Gets the ideal bond length in Angstroms.- Parameters:
b
- the bond- Returns:
- the ideal bond length
- Since:
- Marvin 2.7
-
bondlength
public double bondlength()
Calculates the regular bond length.- Returns:
- the calculated length in Angstroms, or MolBond.CCLENGTH if the molecule has no bonds
-
getLocation
public DPoint3 getLocation()
Gets the origin of the molecule.- Returns:
- the origin
- Since:
- Marvin 2.7
- See Also:
orix
-
setLocation
public void setLocation(DPoint3 o)
Set the origin of the molecule.- Parameters:
o
- the origin- Since:
- Marvin 2.7
- See Also:
orix
-
moveTo
public void moveTo(DPoint3 o)
Move the molecule.- Parameters:
o
- the new origin- Since:
- Marvin 2.7
- See Also:
orix
-
transform
public void transform(CTransform3D t)
Apply a transformation matrix to the atomic coordinates.- Specified by:
transform
in interfaceMTransformable
- Parameters:
t
- the transformation matrix- Since:
- Marvin 2.7
-
transform
public void transform(CTransform3D t, boolean incg)
Apply a transformation matrix to the atomic coordinates.- Parameters:
t
- the transformation matrixincg
- graph invariants are changed (true) or not (false)- Since:
- Marvin 3.0
-
getPoints
public DPoint3[] getPoints()
Gets an array containing the atom coordinates.- Returns:
- atom coordinates array
- Since:
- Marvin 2.9.1
-
getEnclosingCube
public DPoint3[] getEnclosingCube()
Gets the cube that encloses the atoms of molecule graph.- Returns:
- Array of the two corners of the cube: bottom left and top right
- Since:
- Marvin 5.3.2
-
clonecopy
public void clonecopy(MoleculeGraph m)
Make another molecule identical to this one.- Parameters:
m
- the target molecule
-
clonecopy
public void clonecopy(int[] iatoms, MoleculeGraph g)
Copies the specified atoms of this molecule graph to another one.- Parameters:
iatoms
- array of atom indices to copy ornull
g
- the target molecule graph- Since:
- Marvin 5.0.2, 03/11/2008
-
clonecopyMoleculeGraphWithoutSgroups
protected boolean clonecopyMoleculeGraphWithoutSgroups(int[] cnodes, MolBond[] cedges, int nb, MoleculeGraph graph)
Copies the specified atoms and bonds of this molecule graph to another one.- Parameters:
cnodes
- array of atom indices to copy ornull
cedges
- array of bonds to copy ornull
to copy bonds in cnodes onlynb
- number of bondsgraph
- the target molecule graph- Returns:
false
if the atoms array contains all bond end points,true
if there is at least one external bond- Since:
- Marvin 5.0.2, 03/07/2008
-
cloneAtoms
protected int cloneAtoms(int[] cnodes, MoleculeGraph graph)
Copies the specified atoms.- Parameters:
cnodes
- array of atom indices to copy ornull
graph
- the target molecule graph- Returns:
- the atom count
- Since:
- Marvin 6.0, 2013.02.25.
-
getBonds
protected MolBond[] getBonds(MolAtom atom)
Returns the bonds attached to the given atom in this molecule graph. By default, returns the bond array stored in the atom.- Parameters:
atom
- the atom- Returns:
- the bonds attached to the given atom in this molecule graph
- Since:
- Marvin 5.5
-
findInArray
protected static final int findInArray(Object[] array, int[] indices, int n, Object o)
Finds an object in an array.- Parameters:
array
- the arrayindices
- array indices ornull
n
- the number of elements- Returns:
- the object index or -1 if not found
- Since:
- Marvin 5.0.2, 03/07/2008
-
clonelesscopy
@Deprecated public void clonelesscopy(MoleculeGraph graph)
Deprecated.as of Marvin 6.3.
Not supported feature.Copy to selection. Copies without cloning. Make another molecule identical to this one, but do not clone atoms, bonds, and the properties.- Parameters:
graph
- the target molecule graph (the selection)
-
hasSelfReferringProperty
public final boolean hasSelfReferringProperty()
Tests whether the property list contains the molecule.- Returns:
true
if the property list contains the molecule,false
otherwise- Since:
- Marvin 4.1.6, 02/11/2007
-
isSelfReference
public boolean isSelfReference(MProp p)
Tests whether the specified property is a self reference to the molecule.- 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().- Parameters:
prop
- the property- Since:
- Marvin 4.1.6, 02/14/2007
- See Also:
clonecopy(MoleculeGraph)
-
toString
public String toString()
Overrides MoleculeGraph.toString() to ease debugging. Returns a string consisting of the classname (without the package name!), the at-sign character `@
', and the unsigned hexadecimal representation of the hash code of the object. If the graph is not empty and it has more than one atom, then the string also contains the number of atoms and bonds in "[Na,Mb]" form. If there is only one atom, then its symbol appears between the square brackets.
-
clone
public MoleculeGraph clone()
Make an identical copy of the molecule. The clone is deep clone including atom and bond cloning.
-
getParityType
public int getParityType(int idx)
Gets parity type. Currently tetrahedral and allene type parity supported. Only basic parity conditions are checked so return value not 0 does not mean that the atom has parity value different from 0.- Parameters:
idx
- the index of the atom whose parity type is to be determined- Returns:
- PARITY_ALLENE type for atoms having two double bond, and PARITY_TETRAHEDRAL for atoms having 3 or 4 bonds, else 0.
- See Also:
StereoConstants.PARITY_ALLENE
,StereoConstants.PARITY_TETRAHEDRAL
-
getParity
public int getParity(int i)
Computes the parity of an atom of the Molecule instance based on both the coordinates of the neighboring atoms and the stereo information of the bonds to those. Leaves the imported parity unchanged.
Parity for tetrahedral center is defined as follows:
Number the atoms surrounding the stereo center with 1, 2, 3, and 4 in order of increasing atom number (position in the atom block) (a hydrogen atom should be considered the highest numbered atom, in this case atom 4). View the center from a position such that the bond connecting the highest-numbered atom (4) projects behind the plane formed by atoms 1, 2, and 3. Sighting towards atom number 4 through the plane (123), you see that the three remaining atoms can be arranged in either a clockwise or counterclockwise direction in ascending numerical order. Parity value of ODD is for a clockwise arrangement at the stereo center and EVEN for counterclockwise.
Allene like parity is defined as follows:
The two pair of atoms which connects to the central atom through one single and odd number of double bond connections defines a tetrahedron. Number the tetrahedron atoms with 1, 2, 3, and 4 in order of increasing atom number (position in the atom block). Hydrogen atom should be considered the highest numbered atom, in this case atom 4. We may have two Hydrogen atoms for allene like parity type. So the two Hydrogen atoms are differentiated by the atom indexes connected to the central atom with double bond. The Hydrogen atom which is on the same side of the double bond connecting to the central atom with higher atom index's ligand gets the smaller value (3). View the center from a position such that the bond connecting the highest-numbered atom (4) projects behind the plane formed by atoms 1, 2, and 3. Sighting towards atom number 4 through the plane (123), you see that the three remaining atoms can be arranged in either a clockwise or counterclockwise direction in ascending numerical order. Parity value ODD is assigned for a clockwise arrangement at the stereo center and EVEN for counterclockwise.- 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
,isAbsStereo()
,setAbsStereo(boolean)
-
getLocalParity
public int getLocalParity(int i)
Computes the local parity of an atom of the Molecule 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.- 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. Corresponding PARITY_UNSPEC flag is also returned if set.
- Throws:
SecurityException
- the Parity module cannot be loaded because of security reasons (firewall)- See Also:
StereoConstants.PARITY_ODD
,StereoConstants.PARITY_EVEN
,StereoConstants.PARITY_EITHER
,StereoConstants.PARITY_UNSPEC
,isAbsStereo()
,setAbsStereo(boolean)
-
setParity
public boolean setParity(int i, int p)
Change the bonds flag (UP/DOWN) connected to the given atom to achieve the specified parity. If all atom parities will be set thensetParity(int[] p)
is more efficient.- Parameters:
i
- the index of the atom whose parity is to be setp
- parity to be set (PARITY_ODD,PARITY_EVEN)- Returns:
- true if successful
- Throws:
SecurityException
- the Parity module cannot be loaded because of security reasons (firewall)- See Also:
StereoConstants.PARITY_ODD
,StereoConstants.PARITY_EVEN
,MolBond.UP
,MolBond.DOWN
,setParity(int[] p)
,getParity(int i)
-
setParity
public boolean setParity(int[] p)
Change the bonds flag (UP/DOWN) connected to the whole molecule to achieve the specified parity array. Take care of expanding the molecule if necessary. In 2D, use actual wedge setup and change it if necessary.- Parameters:
p
- the parity for each atom in the molecule- Returns:
- true if successful
- See Also:
StereoConstants.PARITY_ODD
,StereoConstants.PARITY_EVEN
,isAbsStereo()
,setAbsStereo(boolean)
,MolBond.UP
,MolBond.DOWN
,getParity(int i)
-
setParity
public boolean setParity(int[] p, boolean useActualWedges)
Change the bonds flag (UP/DOWN) connected to the whole molecule to achieve the specified parity array. Take care of expanding the molecule if necessary.- Parameters:
p
- the parity for each atom in the moleculeuseActualWedges
- if true use actual wedge setup and change it if necessary, otherwise remove the wedges and set them again- Returns:
- true if successful
- Since:
- Marvin 3.5, 12/18/2004
- See Also:
StereoConstants.PARITY_ODD
,StereoConstants.PARITY_EVEN
,isAbsStereo()
,setAbsStereo(boolean)
,MolBond.UP
,MolBond.DOWN
,getParity(int i)
-
setLocalParity
public boolean setLocalParity(int[] p, boolean useActualWedges)
In case of 2D molecule change the bonds flag (UP/DOWN), in case of 0D molecule set the atom flags to achieve the specified parity array. Parity setting is allowed for non-stereogenic center. (This means that the central carbon of an isobutane can get parity value.) The molecule is not expanded. Parity calculation use only the narrow end of a wedge in case of 2D molecules (useOnlyFirstAtomInStereoCalculation = true). If useOnlyFirstAtomInStereoCalculation is false then the function returns false.- Parameters:
p
- the parity for each atom in the moleculeuseActualWedges
- if true use actual wedge setup and change it if necessary, otherwise remove the wedges and set them again- Returns:
- true if successful
- Since:
- Marvin 5.0.1, 01/18/2008
- See Also:
StereoConstants.PARITY_ODD
,StereoConstants.PARITY_EVEN
,isAbsStereo()
,setAbsStereo(boolean)
,useOnlyFirstAtomInStereoCalculation
,MolBond.UP
,MolBond.DOWN
-
setLocalParity
public boolean setLocalParity(int[] idxes, int[] p, boolean useActualWedges)
Set given local parity for the given atomic indexes. In case of 2D molecule change the bonds flag (UP/DOWN), in case of 0D molecule set the atom flags to achieve the specified parity array. Parity setting is allowed for non-stereogenic center. (This means that the central carbon of an isobutane can get parity value.) The molecule is not expanded. Parity calculation use only the narrow end of a wedge in case of 2D molecules (useOnlyFirstAtomInStereoCalculation = true). If useOnlyFirstAtomInStereoCalculation is false then the function returns false.- Parameters:
idxes
- atom indexes to set the local parity forp
- the corresponding local parity informationuseActualWedges
- if true use actual wedge setup and change it if necessary, otherwise remove the wedges and set them again- Returns:
- true if successful
- Since:
- Marvin 5.3.6, 06/30/2010
- See Also:
StereoConstants.PARITY_ODD
,StereoConstants.PARITY_EVEN
,isAbsStereo()
,setAbsStereo(boolean)
,useOnlyFirstAtomInStereoCalculation
,MolBond.UP
,MolBond.DOWN
-
getChirality
public int getChirality(int i)
Computes the chirality of an atom of the Molecule instance based on both the coordinates of the neighboring atoms and the stereo information of the bonds to those. Leaves the imported configuration unchanged. Contracted sgroups are expanded for calculation purposes. Though this method works only for valid atom indices.- Parameters:
i
- the index of the atom whose chirality is to be determined- Returns:
- 0 for nonchiral, CHIRALITY_R, CHIRALITY_S, CHIRALITY_r, CHIRALITY_s, CHIRALITY_M, CHIRALITY_P for atoms of R, S or r, s or M, P configuration, PARITY_EITHER for atoms whose configuration 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.CHIRALITY_R
,StereoConstants.CHIRALITY_S
,StereoConstants.CHIRALITY_r
,StereoConstants.CHIRALITY_s
,StereoConstants.CHIRALITY_M
,StereoConstants.CHIRALITY_P
-
setChirality
public boolean setChirality(Map<Integer,Integer> chiralities)
Sets the chiralities of atoms. Using this method, R, S, r, s chirality values can be set. UseStereoConstants.CHIRALITY_R
,StereoConstants.CHIRALITY_S
,StereoConstants.CHIRALITY_r
, andStereoConstants.CHIRALITY_s
to define chirality. If chirality settings on at least on atom was not successful, chirality values on all atoms are reverted back to their original state.- Parameters:
chiralities
- Map of integers, where the key is the atom index, value is the chirality value.- Returns:
- true, if setting chirality on all atom was successful; false otherwise.
- Since:
- version 14.7.7.
-
setChirality
public boolean setChirality(int i, int c)
Set chirality of an atom of the Molecule instance based on both the coordinates of the neighboring atoms and the stereo information of the bonds to those. Take care of expanding the molecule if necessary.
Possible chirality values to set:- CHIRALITY_R
- set the stereocenter to R chirality value
- CHIRALITY_S
- set the stereocenter to S chirality value
- CHIRALITY_R|CHIRALITY_S, PARITY_EITHER or 0
- remove chirality value
- Parameters:
i
- the index of the atom whose chirality is to be setc
- chirality to be set (CHIRALITY_R,CHIRALITY_S. 0 or (CHIRALITY_R|CHIRALITY_S) to remove chirality)- Returns:
- true if successful
- Throws:
SecurityException
- the Parity module cannot be loaded because of security reasons (firewall)- See Also:
StereoConstants.CHIRALITY_R
,StereoConstants.CHIRALITY_S
-
getStereo2
public int getStereo2(int i1, int i2, int i3, int i4)
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. Not checking atom equivalences using graph invariants. Not checking if the bond is in small ring (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.- Parameters:
i1
- index of atom A1i2
- index of atom A2i3
- index of atom A3i4
- index of atom A4- Returns:
- the cis/trans information, or 0 if A2 and A3 are not connected
- See Also:
StereoConstants.CTUMASK
,MolBond.calcStereo2()
,for detailed examples.
-
getStereo2
public int getStereo2(MolAtom a1, int i2, int i3, MolAtom a4)
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. Not checking atom equivalences using graph invariants. Not checking if the bond is in small ring (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.- Parameters:
a1
- atom A1i2
- index of atom A2i3
- index of atom A3a4
- atom A4- Returns:
- the cis/trans information, or 0 if A2 and A3 are not connected
Returned values for the four Carbons ("O" means set flag):
Dihedral Returned flags Remark CIS TRANS CTUNSPEC SMARTS bonds: C/C=C/C - O - C/C=C\C O - - CC=CC O O - C/?C=C/C - O O C/?C=C\C O - O ISIS bonds: C-C=C-C O O - 180 degrees C-C X C-C O O - "Cis" or "Trans" bond C/C="C/T?"=C/C - O O "Not Cis" bond C/C="C/T?"=C\C O - O "Not trans" bond C-C="C/T?"=C-C O O O 180 degrees - See Also:
StereoConstants.CTUMASK
,MolBond.calcStereo2()
-
getStereo2
public int getStereo2(MolBond b, MolAtom a1, MolAtom a4)
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. Not checking atom equivalences using graph invariants. Not checking if the bond is in small ring (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.- Parameters:
b
- the bonda1
- atom A1a4
- atom A4- Returns:
- the stereo flags
- See Also:
StereoConstants.CTUMASK
,MolBond.calcStereo2()
,for detailed examples.
-
getStereo2
public int getStereo2(MolBond b, MolAtom a1, MolAtom a4, boolean grcheck)
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 (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.- Parameters:
b
- the bonda1
- atom A1a4
- atom A4grcheck
- true if check atom equivalences using graph invariants- Returns:
- the stereo flags
- See Also:
StereoConstants.CTUMASK
,MolBond.calcStereo2()
,for detailed examples.
-
getEZStereo
@Deprecated public chemaxon.struc.stereo.EZConfiguration getEZStereo(MolBond bond)
Deprecated.as of Marvin 15.2.16 replaced byCIPStereoCalculator.calculateCIPStereoDescriptors(MoleculeGraph, boolean)
.Gets E/Z stereo information for the given double bond. The calculation considers the following:- If the bond is ring bond then
EZConfiguration.NONE
is returned - If the molecule is zero dimensional then no calculation is performed but the values stored in the bond's flags are taken into consideration
- The CIP (Cahn-Ingold-Prelog) rules are used to determine the highest priority ligands around the double bond
- No graph invariant checking is performed
- The highest priority ligands are calculated (using the CIP rules), one ligand connected to each end atom of the double bond
- The CIS/TRANS stereo value is calculated for these two atoms and the double bond's end atoms
- The CIS/TRANS value is converted to E/Z by:
- CIS configuration is converted to
EZConfiguration.Z
- TRANS configuration is converted to
EZConfiguration.E
- CIS/TRANS configuration is converted to
EZConfiguration.E_OR_Z
- CIS/UNSPEC configuration is converted to
EZConfiguration.Z_OR_UNSPEC
- TRANS/UNSPEC configuration is converted to
EZConfiguration.E_OR_UNSPEC
- no configuration is converted to
EZConfiguration.NONE
- CIS configuration is converted to
- Parameters:
bond
- the bond for which the E/Z stereo will be calculated- Returns:
- the E/Z stereo value that is specified by the given bond
- If the bond is ring bond then
-
getStereo2
@Deprecated public int getStereo2(MolBond b)
Deprecated.as of Marvin 6.3 replaced bygetEZStereo(MolBond)
.Gets cis/trans (Z/E) stereo information for the given bond. Use the CIP rules to determine the A1, A4 atoms in 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. For ring bonds 0 is returned. Not checking atom equivalences using graph invariants.- Parameters:
b
- the bond- Returns:
- CIP stereo values for the given bond: CIS for Z stereo configuration, TRANS for E stereo configuration, CIS|TRANS for E/Z stereo configuration or 0
- Since:
- Marvin 4.1 4/13/2006
- See Also:
StereoConstants.CTUMASK
,StereoConstants.CIS
,StereoConstants.TRANS
,MolBond.calcStereo2()
,for detailed examples.
-
getStereo2
protected final int getStereo2(MolBond b, MolAtom a1, int i2, int i3, MolAtom a4)
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. Not checking atom equivalences using graph invariants.- Parameters:
b
- the bonda1
- atom A1i2
- index of atom A2i3
- index of atom A3a4
- atom A4- Returns:
- the stereo flags
- See Also:
StereoConstants.CTUMASK
,MolBond.calcStereo2()
,for detailed examples.
-
getStereo2
protected final int getStereo2(MolBond b, MolAtom a1, int i2, int i3, MolAtom a4, boolean grcheck)
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.- Parameters:
b
- the bonda1
- atom A1i2
- index of atom A2i3
- index of atom A3a4
- atom A4grcheck
- true if check atom equivalences using graph invariants- Returns:
- the stereo flags
- See Also:
StereoConstants.CTUMASK
,MolBond.calcStereo2()
,for detailed examples.
-
removeBond
protected void removeBond(MolBond bond, int cleanupFlags)
Removes a bond by reference.- Parameters:
bond
- the bondcleanupFlags
- extra clean-up methods- Since:
- Marvin 3.1
- See Also:
RMCLEANUP_NONE
,RMCLEANUP_ALL
,RMCLEANUP_EDGES
-
removeBond
protected void removeBond(int i, int cleanupFlags)
Removes a bond by index.- Parameters:
i
- the bond indexcleanupFlags
- extra clean-up methods- Since:
- Marvin 3.1
- See Also:
RMCLEANUP_NONE
,RMCLEANUP_ALL
,RMCLEANUP_EDGES
-
regenBonds
public void regenBonds()
Regenerates the bond vector: remove its elements, then put the bond objects from the atoms into it.
-
isolate
protected void isolate(MolAtom node)
Isolates atom: a more efficient way of removing an atom thanremoveAtom(chemaxon.struc.MolAtom)
, especially for large molecule graphs. Removes the atom but instead of shifting the atoms array, simply sets the corresponding entry tonull
. After isolating some atoms, callremoveIsolatedAtoms()
to get a valid molecule graph.- Parameters:
node
- the atom- Since:
- Marvin 5.0
-
isolate
protected void isolate(MolBond edge)
Isolates bond: a more efficient way of removing a bond thanremoveBond(chemaxon.struc.MolBond)
, especially for large molecule graphs. Removes the bond but instead of shifting the bonds array, simply sets the corresponding entry tonull
. After isolating some bonds, callremoveIsolatedBonds()
to get a valid molecule graph.- Parameters:
edge
- the bond- Since:
- Marvin 5.0
-
removeIsolatedAtoms
protected void removeIsolatedAtoms()
Removes thenull
atom entries in the atoms array and sets the index fields appropriately. Clean-up method after callingisolate(chemaxon.struc.MolAtom)
for some atoms.- Since:
- Marvin 5.0
-
removeIsolatedBonds
protected void removeIsolatedBonds()
Removes thenull
bond entries in the bonds array and sets the index fields appropriately. Clean-up method after callingisolate(chemaxon.struc.MolBond)
for some bonds.- Since:
- Marvin 5.0
-
canBeCT
public boolean canBeCT(int i2, int i3)
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.- Parameters:
i2
- index of the first atomi3
- index of the second atom- Returns:
- true if this is a double bond that can be either CIS, TRANS or EITHER, false otherwise.
-
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.- 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
-
canBeCT
public boolean canBeCT(MolBond bond)
Determines whether the given bond 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.- Parameters:
bond
- the bond to check- Returns:
- true if this is a double bond that can be either CIS, TRANS or EITHER, false otherwise.
- Since:
- Marvin 5.5
-
getLonePairCount
@Deprecated public int getLonePairCount(int i)
Deprecated.useMDocument.getLonePairCount()
insteadGets the number of lone pair atoms.- Parameters:
i
- atom index- Returns:
- the number of lone pair atoms connected to this atoms
- Since:
- Marvin 3.5, 09/29/2004
-
getExplicitLonePairCount
@Deprecated public int getExplicitLonePairCount(int i)
Deprecated.useMDocument.getExplicitLonePairCount()
insteadGets the explicit lone pair count of the submitted atom.- Parameters:
i
- atom index- Returns:
- the number of the explicit lone pairs
- Since:
- Marvin 4.1.2, 10/06/2005
-
aromatize
public void aromatize(boolean a) throws SecurityException
Aromatize (using the default general aromatization method) or dearomatize molecule.- Parameters:
a
- aromatize (true) or dearomatize (false)- Throws:
SecurityException
- cannot load module because of a security problem (firewall)- Since:
- Marvin 2.8
- See Also:
AROM_GENERAL
, Document about aromatization
-
aromatize
public final void aromatize()
Aromatize molecule using the default general aromatization method. Only single or double bonds are changed to aromatic, aromatic bonds are not changed.- Throws:
SecurityException
- cannot load module because of a security problem (firewall)- Since:
- Marvin 3.4, 05/10/2004
- See Also:
AROM_GENERAL
, Document about aromatization
-
dearomatize
public boolean dearomatize()
Dearomatize molecule.- Returns:
- true if success, else false.
- Throws:
SecurityException
- cannot load module because of a security problem (firewall)- Since:
- Marvin 5.0.1, 01/05/2008
-
dearomatize
public boolean dearomatize(int method)
Dearomatize molecule.- Parameters:
method
- Specifies the algorithm for dearomatization. Possible values:- DEAROM_GENERAL - General dearomatization
- DEAROM_HUCKELCHECK - Check Huckel rule during dearomatization.
- DEAROM_HUCKELCHECK_EX - The same as DEAROM_HUCKELCHECK but throw exception if dearomatization is not successful.
- Returns:
- true if success, else false.
- Throws:
SecurityException
- cannot load module because of a security problem (firewall)RuntimeException
- the molecule cannot be dearomatized with method DEAROM_HUCKELCHECK_EX- Since:
- Marvin 5.2.3, 06/29/2008
-
aromatize
public void aromatize(int method)
Aromatizes molecule. Only single or double bonds are changed to aromatic, aromatic bonds are not changed. For query molecules if the molecule contains ANY bond, then the aromaticity is checked as if the ANY bonds were aromatic bonds. If a ring or a ring system found to be aromatic then the single bonds are changed to SINGLE_OR_AROMATIC and the double bonds to DOUBLE_OR_AROMATIC type.- Parameters:
method
- Specifies the algorithm for aromatization. Possible values:- AROM_BASIC - Basic aromatization
- AROM_GENERAL - General (Daylight compatible) aromatization
- AROM_LOOSE - Loose 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
- See Also:
AROM_BASIC
,AROM_GENERAL
,AROM_LOOSE
, Document about aromatization
-
aromatize
public void aromatize(int method, boolean checkAmbiguity)
Aromatizes molecule. Only single or double bonds are changed to aromatic, aromatic bonds are not changed. For query molecules if checkAmbiguity set to true and the molecule contains ANY bond, then the aromaticity is checked as if the ANY bonds were aromatic bonds. If a ring or a ring system found to be aromatic then the single bonds are changed to SINGLE_OR_AROMATIC and the double bonds to DOUBLE_OR_AROMATIC type. Otherwise if checkAmbiguity is set to false a bond containing ANY bond cannot be aromatic.- Parameters:
method
- Specifies the algorithm for aromatization. Possible values:- AROM_BASIC - Basic aromatization
- AROM_GENERAL - General (Daylight compatible) aromatization
- AROM_LOOSE - Loose 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
- See Also:
AROM_BASIC
,AROM_GENERAL
,AROM_LOOSE
, Document about aromatization
-
calcHybridization
public void calcHybridization()
Calculates and sets hybridazation state for each atom. The calculation is based on simple rules that cannot be customized in the present implementation. However,setHybridizationState( int )
can be called to set the appropriate value directly. This sp-hybridization state reflects the spatial configuration of the C,N and O atoms rather than the sp-hybridization of the electron bands. It doesn't cover all the mixed orbitals of Si,S and P atoms. For hydrogens the "s"MolAtom.HS_S
state, for atoms with query bonds the unknown stateMolAtom.HS_UNKNOWN
is set. If the atom has aromatic bonds the sp2 state is set. Otherwise the sp-hybridization state is determined based on the number of double and tripple bonds. If the atom has a tripple bond or two double bonds the sp state is set. If the atom has one double bond the sp2 state is set. If the atom has more then one tripple bond or more than two double bonds the unknown state is set. If a heavy atom has only single bonds the sp3 state is set.- Since:
- Marvin 3.5
- See Also:
LonePairCounter
-
getFormula
public String getFormula()
Gets the molecular formula.- Returns:
- the formula
-
getMass
public double getMass()
Calculates the molecular weight of the molecule. Returns adouble
value.- Returns:
- the molecular weight
-
getExactMass
public double getExactMass()
Calculates the molecular weight of the molecule using the mass of the most frequent natural isotope of the atoms. Returns adouble
value.- Returns:
- the molecular exact weight
-
makeItSimilar
protected void makeItSimilar(MoleculeGraph g)
Copies some properties of this molecule to the other one specified as argument. Copies the flags and the origin coordinates.- Parameters:
g
- the molecule to change
-
newInstance
public MoleculeGraph newInstance()
Creates a new MoleculeGraph object. The dimension and the origin coordinates will be the same as in the original molecule.- Returns:
- a MoleculeGraph object
-
getGraphUnion
public MoleculeGraph getGraphUnion()
Gets a molecule graph containing all the atoms and bonds.- Returns:
- this object (in the default implementation)
- Since:
- Marvin 3.0, 11/11/2002
-
indexOf
public int indexOf(MolAtom atom)
Gets the index of the specified atom.- Parameters:
atom
- the atom- Returns:
- the index, or -1 if not found
- Since:
- Marvin 2.7
-
indexOf
public int indexOf(MolBond bond)
Gets the index of the specified bond. This method uses MolBond.equals() for the bond comparison.- Parameters:
bond
- the bond- Returns:
- the index, or -1 if not found
- Since:
- Marvin 2.7
- See Also:
Object.equals(Object)
-
findAtom
protected final int findAtom(MolAtom atom)
Finds an atom in the atoms array.- Returns:
- the atom index or -1 if not found
-
findBond
protected final int findBond(MolBond bond)
Finds a bond in the bonds array.- Returns:
- the bond index or -1 if not found
-
contains
public boolean contains(MolAtom atom)
Checks if the molecule graph contains the specified atom.- Parameters:
atom
- the atom object- Returns:
- true if the graph contains the object, false otherwise
-
contains
public boolean contains(MolBond bond)
Checks if the molecule graph contains the specified bond, or a bond which is equals with the given bond.- Parameters:
bond
- the bond object- Returns:
- true if the graph contains the object, false otherwise
- See Also:
Object.equals(Object)
-
contains
public boolean contains(MoleculeGraph graph)
Does the molecule graph contain the specified fragment?- Parameters:
graph
- the fragment- Returns:
- true if it contains the graph, false if not
-
isEmpty
public boolean isEmpty()
Tests whether the molecule graph is empty.- Returns:
true
if the graph does not contain any atoms or bonds,false
otherwise
-
getSubGraphs
public final MoleculeGraph[] getSubGraphs()
Gets all "submolecules".- Since:
- Marvin 4.1.2
- See Also:
getSubGraphCount()
-
getSubGraphCount
protected int getSubGraphCount()
Gets the number of all "submolecules". Submolecules are R-groups and the root structure in case of anRgMolecule
, reactants, products and agents of anRxnMolecule
etc.- Returns:
- the number of submolecules
- Since:
- Marvin 4.1.2
- See Also:
getSubGraphs(MoleculeGraph[], int)
-
getSubGraphs
protected void getSubGraphs(MoleculeGraph[] m, int off)
Gets all "submolecules".- Parameters:
m
- the output arrayoff
- offset- Since:
- Marvin 4.1.2
- See Also:
getSubGraphs()
,getSubGraphCount()
-
addAtomsAndBondsTo
protected void addAtomsAndBondsTo(MoleculeGraph s)
Adds all atoms and bonds to the specified molecule.- Parameters:
s
- the selection molecule- Since:
- Marvin 4.1, 11/25/2005
-
hasExplicitLonePairs
@Deprecated public boolean hasExplicitLonePairs()
Deprecated.useMDocument.hasExplicitLonePairs()
insteadTests whether the molecule has explicit lone pair atoms.- Returns:
- true if it has lone pair atoms, false otherwise
- Since:
- 3.5.1, 11/24/2004
-
hasImplicitH
public boolean hasImplicitH()
Tests whether the molecule has implicit hydrogen atoms.- Returns:
- true, if the molecule has at least one implicit hydrogen atom
- Since:
- Marvin 3.3, 01/14/2004
-
hasAtomSet
public boolean hasAtomSet()
Tests whether the molecule graph has atom sets.- 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.- Returns:
true
if there are atom sets,false
otherwise- Since:
- Marvin 4.0, 03/02/2005
-
hasExtraLabelSet
public boolean hasExtraLabelSet()
-
clean
@Deprecated public boolean clean(int dim, String opts)
Deprecated.As of Marvin 5.7, replaced byCleaner.clean(MoleculeGraph, int, String)
.Calculates atom coordinates.- Parameters:
dim
- dimensionsopts
- cleaning options- Returns:
- true for success, false if an error occurred
- Throws:
SecurityException
- cannot load module because of a security problem (firewall)
-
partialClean
@Deprecated public boolean partialClean(Molecule[] template, String opts)
Deprecated.As of Marvin 5.7, replaced byCleaner.partialClean(Molecule, Molecule[], String)
.Calculates atom coordinates by using the given template molecule array. Works only in 2D. Set the x and y coordinates for the substructure of this molecule which first match a molecule from template molecule array. Partially clean the rest atoms. Remark, that only the first matching template molecule is used despite any later match in the template molecules. If the template has no wedges, try to keep the wedges of the original molecule. Otherwise try to keep the template wedge settings.- Parameters:
template
- template molecule array (substructure of the target)opts
- cleaning options- Returns:
- true for success, false if no template match found or an error occurred
- Throws:
SecurityException
- cannot load module because of a security problem (firewall)- Since:
- Marvin 5.4, 02/23/2010
-
partialClean
@Deprecated public boolean partialClean(MoleculeGraph template, int[] map, String opts)
Deprecated.As of Marvin 5.7, replaced byCleaner.partialClean(MoleculeGraph, MoleculeGraph, int[], String)
.Calculates atom coordinates by using the given template molecule. Works only in 2D. Set the x and y coordinates of the molecule from the given template using the given mapping. Partially clean the rest atoms. Map length should be equal the atomcount of the template. If the template has no wedges, try to keep the wedges of the original molecule. Otherwise try to keep the template wedge settings.- Parameters:
template
- template molecule (substructure of the target)map
- hit list which describes the atom mapping (the size equals to the number of atoms in the template, contains target atom indexes or -1 to exclude)opts
- cleaning options- Returns:
- true for success, false if an error occurred
- Throws:
SecurityException
- cannot load module because of a security problem (firewall)- Since:
- Marvin 5.0, 09/09/2007
-
partialClean
@Deprecated public boolean partialClean(int dim, int[] fixed, String opts)
Deprecated.As of Marvin 5.7, replaced byCleaner.partialClean(MoleculeGraph, int, int[], String)
.Calculates atom coordinates by using fixed atoms. Internal use only. Works only in 2D. Store the needed stereo information in the atomflags!- Parameters:
dim
- dimensionsfixed
- atom indexes to be fixedopts
- cleaning options- Returns:
- true for success, false if an error occurred
- Throws:
SecurityException
- cannot load module because of a security problem (firewall)- Since:
- Marvin 3.5.2, 01/01/2005
-
clean
@Deprecated public boolean clean(int dim, String opts, MProgressMonitor pmon)
Deprecated.As of Marvin 5.7, replaced byCleaner.clean(MoleculeGraph, int, String, MProgressMonitor)
.Calculates atom coordinates. In a 3D it works only for Molecules (not for MoleculeGraphs).- Parameters:
dim
- dimensionsopts
- cleaning optionspmon
- progress monitor ornull
- Returns:
- true for success, false if an error occurred (for example 3D case for MoleculeGraphs).
- Throws:
SecurityException
- cannot load module because of a security problem (firewall)- Since:
- Marvin 3.4, 05/06/2004
- See Also:
clean(int, java.lang.String)
-
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 necessary. Only rings smaller then 19 atoms are examined.- Returns:
- true if successful
-
isGrinvCCValid
protected boolean isGrinvCCValid()
Tests whether the graph invariant change count is valid.- Returns:
true
- Since:
- Marvin 5.0, 11/30/2007
-
getAromaticAndAliphaticRings
public int[][][] getAromaticAndAliphaticRings(int aromatizationType, boolean onlyAromrings, boolean aromatize, int maxRingSize, int ringsLimit)
Returns the aromatic and or aliphatic ring atom indexes.
Note: This method does not aromatize the already aromatized rings. Use first thedearomatize()
ordearomatize(int)
methods to convert the molecule to Kekule form.
Handle maxRingSize, ringsLimit parameters with care, otherwise the calculation can take extremly long time or result in OutOfMemoryError. Suggested values are 18 for maxRingSize and 1000 for ringsLimit parameter.- Parameters:
aromatizationType
- use aromatization:- 0 - No aromatization. The molecule is used as it is.
- AROM_BASIC - basic aromatization
- AROM_GENERAL - general aromatization
onlyAromrings
- get only the aromatic rings (Aromatic ring detection is faster than calculating Aliphatic and Aromatic rings in case of BASIC aromatization, in case of GENERAL aromatization there is no difference in the speed),aromatize
- whether to set the bonds to aromatic (true), or keep the original form (false),maxRingSize
- the maximum ring size during ring detection (0: no limit)ringsLimit
- limit of the number of rings (0: no limit)- Returns:
- the aromatic ring atom indexes in the array 0th position, the aliphatic ring atom indexes in the array 1st position
- Since:
- Marvin 4.1
- See Also:
AROM_BASIC
,AROM_GENERAL
-
getSSSR
public final int[][] getSSSR()
Gets the Smallest Set of Smallest Ring atom indexes array. It follows all kind of bonds includingMolBond.ANY
,MolBond.COORDINATE
,MolBond.HYDROGEN
. If the SSSR array is not calculated for the molecule, then create it. sssr[i][j] is the j-th atom index at the i-th SSSR ring in the molecule. This array is cached, so clone it if you plan to modify it.- Returns:
- the sssr atom index arrays
- Since:
- Marvin 3.0
- See Also:
grinvCC
-
getCSSR
public final int[][] getCSSR()
Gets the Complete Set of Smallest Ring atom indexes array. CSSR is generated by adding the ring to CSSR which are xor of the SSSR but size smaller then 14 and also size not larger then the largest ring in the SSSR. If the CSSR array is not calculated for the molecule, then create it. cssr[i][j] is the j-th atom index at the i-th CSSR ring in the molecule. This array is cached, so clone it if you plan to modify it.- Returns:
- the cssr atom index arrays
- Since:
- Marvin 5.0
- See Also:
grinvCC
-
getSSSRBonds
public final int[][] getSSSRBonds()
Gets the Smallest Set of Smallest Ring bond indexes array. Values are recalculated each time from the array of BitSets. The bond indexes are not in connection order. UseTopologyUtil.convertSSSRBondSetsToConnectedBondIndexArray(BitSet[], MoleculeGraph)
to get bond indexes with connection order. WARNING! UsinggetSSSRBondsAsBitSet()
may be more efficient and requires less memory usage.- Returns:
- the sssr bond index arrays
- Since:
- Marvin 5.1.2
- See Also:
grinvCC
-
getSSSRIdxesForAtoms
public int[][] getSSSRIdxesForAtoms()
Get the sssr ring indexes in which the atom (specified with it's index) can be located. This array is cached, so clone it if you plan to modify it.- Returns:
- sssr ring indexes for each atom index.
- Since:
- Marvin 4.1.8 4/17/2007
- See Also:
getCSSRIdxesForAtoms()
,grinvCC
-
getCSSRIdxesForAtoms
public int[][] getCSSRIdxesForAtoms()
Get the cssr ring indexes in which the atom (specified with it's index) can be located.- Returns:
- cssr ring indexes for each atom index.
- Since:
- Marvin 16.11.7.0
- See Also:
getSSSRIdxesForAtoms()
,grinvCC
-
getSSSRBondSet
public BitSet getSSSRBondSet()
Get SSSR bond index bitset. Values are not recalculated but the result of a previous calculation returned. If no previous calculation result found the values are calculated.- Returns:
- the SSSR ring bond indexes in bitset.
- Since:
- Marvin 5.10
-
getSSSRBondsAsBitSet
public final BitSet[] getSSSRBondsAsBitSet()
Gets the Smallest Set of Smallest Ring edges as an array of BitSets, one BitSet for each ring. Values are cached.- Returns:
- the sssr bonds as an array of BitSets, one BitSet for each ring
-
getSSSRBondSetInLong
@Deprecated public long[] getSSSRBondSetInLong()
Deprecated.as of 15.09.2014, usegetSSSRBondSet()
insteadGet SSSR bond bitsets in long array. To get if the given 'n
' bond is in the sssr long array 'r
', use the following code:static boolean get(int n, long[] r) { return (r[n/64] & (((long)1) << (63-(n % 64)))) != 0 ;
}- Returns:
- the SSSR ring bond indexes in long array.
- Since:
- Marvin 4.1
- See Also:
grinvCC
-
getSmallestRingSizeForIdx
public int[] getSmallestRingSizeForIdx()
Get the smallest ring size in which the atom (specified with it's index) can be located. This array is cached, so clone it if you plan to modify it.- Returns:
- smallest ring size for each atom index.
- Since:
- Marvin 4.1 4/13/2006
- See Also:
grinvCC
-
isRingBond
public boolean isRingBond(int idx)
Is this bond in ring?- Parameters:
idx
- the bond index- Returns:
- true if the bond is in ring else false.
-
getImplicitHcount
public int getImplicitHcount()
Gets the total number of implicit hydrogens attached to the molecule.- Returns:
- the implicit hydrogen count or the number of query hydrogens
-
getExplicitHcount
public int getExplicitHcount()
Gets the total number of explicit hydrogens attached to the molecule.- Returns:
- the explicit hydrogen count
- Since:
- Marvin 3.4
-
findAtomClone
public MolAtom findAtomClone(MolAtom a)
Finds the clone of an atom.- Parameters:
a
- the original atom- Returns:
- the clone or null if not found
- Since:
- Marvin 3.4.1, 07/06/2004
-
isValidLinkNode
public boolean isValidLinkNode(int linkAtomIdx, int outer1, int outer2)
Checks whether the specified link atom is valid or not. Invalid link atoms are those where repetition is impossible due to rings.- Parameters:
linkAtomIdx
- atom index to be set to link atom.outer1
- outer bond to be set by setLinkNodeOuterAtom(0)outer2
- outer bond to be set by setLinkNodeOuterAtom(1)- Returns:
- whether repetition is possible on the given atom and outer bonds.
- Since:
- Marvin 4.0 12/29/2004
-
setLinkNodeDefaultOuters
public void setLinkNodeDefaultOuters(MolAtom atom)
Sets link node outer atoms to default values, if they are not set yet; making sure that the resulting link node configuration is valid.- Parameters:
atom
- Atom to set to link node.- Throws:
IllegalArgumentException
- if it is an invalid link node configuration.- Since:
- Marvin 4.0 12/29/2004
- See Also:
MolAtom.setLinkNodeDefaultOuters()
,MolAtom.setLinkNodeOuterAtom(int, int)
-
getVisibleCoords
public double[] getVisibleCoords(MolAtom ma)
Returns the coordinates of the given atom (contained in the molecule).- Parameters:
ma
- The atom to be queried.- Returns:
- The coordinates of ma.
- Since:
- Marvin 4.0 8/07/2005
-
saveCache
protected Object[] saveCache(int n)
Saves caches like connection table, bond table, etc.- Since:
- Marvin 3.4
-
restoreCache
protected Object[] restoreCache(int n)
Restores caches like connection table, bond table, etc.- Since:
- Marvin 3.4
-
isMultiChiral
public boolean isMultiChiral()
Returns the multiple chirality flag. To speed up the canonical label calculations, add chirality invariant to only those molecules that has at least two possible chiral centres.- Since:
- Marvin 3.3
-
adjustMultiChiralFlag
public void adjustMultiChiralFlag()
Checks whether the molecule has multiple chiral centres- Since:
- Marvin 3.3
-
isMolecule
@Deprecated public boolean isMolecule()
Deprecated.as of Marvin 14.7.7, no replacement.
Usage:use
myObject instanceof Molecule
insteadChecks if the object is an instance of Molecule or not.x.isMolecule()
is equivalent tox instanceof Molecule
, only faster.- Returns:
- false
- Since:
- Marvin 5.2
-
isQuery
public boolean isQuery()
Indicates if the molecule has query features: query atoms or query bonds.- Returns:
true
if the molecule has query features- Since:
- Marvin 4.0 04/02/2005
- See Also:
MolAtom.isQuery()
,MolBond.isQuery()
-
clearCachedInfo
public void clearCachedInfo(int options)
Deletes the cached information depending on the given options.- Parameters:
options
- options for the cache clearing- Since:
- Marvin 4.0.2 09/20/2005
- See Also:
CACHE_REMOVE_GRINVMODULE
,CACHE_REMOVE_PARITYMODULE
,CACHE_REMOVE_AROMATAMODULE
,CACHE_REMOVE_SSSRMODULE
,CACHE_REMOVE_TABS
,CACHE_REMOVE_ALL
-
arrangeComponents
@Deprecated public boolean arrangeComponents()
Deprecated.As of Marvin 5.7, replaced byCleanUtil.arrangeComponents(MoleculeGraph, boolean, boolean)
.
Usage:CleanUtil.arrangeComponents(molecule, true, true);
Arranges molecule components (fragments, reactants, agents, products, R-group definitions) nicely. Also arranges molecule fragments in root / main molecule, attached data and Sgroup brackets.- Returns:
true
if coordinates changed,false
if unchanged- Since:
- Marvin 4.1
-
setGrinvOptions
public void setGrinvOptions(int opt)
Sets graph invariant calculation options passed to the module.- Parameters:
opt
- the graph invariant calculation option- Since:
- Marvin 4.1.6
- See Also:
GRINV_NOHYDROGEN
,GRINV_DONT_STORE
,GRINV_OLDSTEREO
,GRINV_STEREO
,GRINV_USEMAPS
,GRINV_VALUE_OPTIONS
-
getGrinvOptions
public int getGrinvOptions()
Gets graph invariant calculation options passed to the module.- Returns:
- the graph invariant calculation option
- Since:
- Marvin 4.1.6
- See Also:
GRINV_NOHYDROGEN
,GRINV_DONT_STORE
,GRINV_OLDSTEREO
,GRINV_STEREO
,GRINV_USEMAPS
,GRINV_VALUE_OPTIONS
-
useOnlyFirstAtomInStereoCalculation
public void useOnlyFirstAtomInStereoCalculation(boolean f)
Set how parity module should interpret wedes. The difference between the two ideas wheter to interpret both (narrow and wide) endpoints of the wedge as chiral center or just the first atom (which is the narrow end of the MDL wedge).- Parameters:
f
- wheter to use only the first atom of the wedge for calculations- Since:
- Marvin 5.0
-
isOnlyFirstAtomInStereoCalculation
public boolean isOnlyFirstAtomInStereoCalculation()
Get how parity module interpret wedges. The difference between the two ideas whether to interpret both (narrow and wide) endpoints of the wedge as chiral center (return false) or just the first atom (which is the narrow end of the MDL wedge) (return true).- Returns:
- true if just the first atom of the bond is considered as chiral center, else false.
- Since:
- Marvin 5.0
-
sumConservedQuantities
protected void sumConservedQuantities(MolAtom a, int[] atoms, int sign)
For internal use only.- Since:
- Marvin 4.1.13, 09/19/2007
- See Also:
RxnMolecule.isIncompleteReaction()
-
getCtab
public int[][] getCtab()
Gets the connection table. If there is no connection table for the molecule graph, then creates it. ctab[i][j] will be the index of the j-th neighbor of the i-th atom. This array is cached, so clone it if you plan to modify it.- Returns:
- the ctab array
- Since:
- Marvin 2.6
-
getBondTable
public BondTable getBondTable()
Gets the bond (edge) table. If there is no bond table for the molecule, then creates it. btab.elementOf(i, j) will be the index of the bond between atoms i and j, or -1 if there is no bond. This array is cached, so clone it if you plan to modify it.- Returns:
- the
BondTable
of this molecule graph. - Since:
- Marvin 5.4
-
findFrags
@Deprecated public <C extends MoleculeGraph> C[] findFrags(Class<C> cl)
Deprecated.As of Marvin 5.6, replaced byfindFrags(Class, int)
andFRAG_KEEPING_MULTICENTERS
.
Usage:mol.findFrags(cl, MoleculeGraph.FRAG_KEEPING_MULTICENTERS);
Determines the disconnected fragments and puts them into an array. Multicenter groups are kept in the same fragment. Atoms are removed from the original molecule object unless the fragment class is SelectionMolecule.class. The original atom order is preserved in the returned fragments. Fragment order is also determined by the original atom order. The first fragment is the one containing atom 0, the second fragment is the one containing the smallest indexed atom not in the first fragment, etc.- Type Parameters:
C
- the class of the fragments- Parameters:
cl
- create fragment objects of this class- Returns:
- array of fragments
- Since:
- Marvin 3.0
- See Also:
findFrags(Class, int)
-
findFrags
public <C extends MoleculeGraph> C[] findFrags(Class<C> cl, int fragmentationType)
Determines the disconnected fragments and puts them into an array. Atoms are removed from the original molecule object unless the fragment class is SelectionMolecule.class. The original atom order is preserved in the returned fragments. Fragment order is also determined by the original atom order. The first fragment is the one containing atom 0, the second fragment is the one containing the smallest indexed atom not in the first fragment, etc. Fragmentation is performed depending on fragmentation type:- Merge only fragmented multicenter S-groups (see
FRAG_KEEPING_MULTICENTERS
) - Merge all types of S-groups (see
FRAG_KEEPING_SGROUPS
) - Keep all fragments separately, do not take into account the S-groups (see
FRAG_BASIC
)
- Type Parameters:
C
- the class of the fragments- Parameters:
cl
- create fragment objects of this classfragmentationType
- determines the type of fragmentation- Returns:
- array of fragments
- Since:
- Marvin 5.6
- See Also:
FRAG_BASIC
,FRAG_KEEPING_MULTICENTERS
,FRAG_KEEPING_SGROUPS
- Merge only fragmented multicenter S-groups (see
-
findComponentIds
@Deprecated public final int[] findComponentIds()
Deprecated.As of Marvin 6.0, replaced bygetFragIds(int)
andFRAG_BASIC
.
Usage:mol.getFragIds(MoleculeGraph.FRAG_BASIC);
Assigns a component ID to each connected component. S-groups are ignored. Do not modify the result array!- Returns:
- the component ID array (the i-th ID is the component ID for atom
i
) - Since:
- Marvin 4.0
-
findComponentIds
public final int[] findComponentIds(int[] inds)
Assigns a component ID to each connected component formed by the specified atom indexes. S-groups are ignored. Do not modify the result array!- Parameters:
inds
- atom index array,null
means all atoms- Returns:
- the corresponding component ID array (the i-th ID is the component ID for atom
inds[i]
or atomi
if the atom index array isnull
) - Since:
- Marvin 4.0
-
getFragCount
@Deprecated public final int getFragCount()
Deprecated.As of Marvin 5.6, replaced bygetFragCount(int)
andFRAG_KEEPING_MULTICENTERS
.
Usage:mol.getFragCount(MoleculeGraph.FRAG_KEEPING_MULTICENTERS);
Returns the number of fragments for fragmentation keeping multicenters.- Returns:
- the number of fragments
- Since:
- Marvin 3.01
- See Also:
getFragCount(int)
-
getFragCount
public final int getFragCount(int fragmentationType)
Returns the number of fragments for the given fragmentation type.- Parameters:
fragmentationType
- type of fragmentation- Returns:
- the number of fragments
- Since:
- Marvin 5.6
- See Also:
FRAG_BASIC
,FRAG_KEEPING_MULTICENTERS
,FRAG_KEEPING_SGROUPS
-
getFragIds
public final int[] getFragIds(int fragmentationType)
Gets an array containing the fragment id for each atom for the given fragmentation type. This array is cached, so clone it if you plan to modify it.- Parameters:
fragmentationType
- type of fragmentation- Returns:
- array of fragment identifiers
- Since:
- Marvin 5.6
- See Also:
FRAG_BASIC
,FRAG_KEEPING_MULTICENTERS
,FRAG_KEEPING_SGROUPS
-
regenGearch
protected final void regenGearch()
Recreate graph search results object.
-
findFrag
@Deprecated public final void findFrag(int i, MoleculeGraph frag)
Deprecated.As of Marvin 5.6, replaced byfindFrag(int, int, MoleculeGraph)
andFRAG_KEEPING_MULTICENTERS
.
Usage:mol.findFrag(i, MoleculeGraph.FRAG_KEEPING_MULTICENTERS, frag);
Determines the subgraph connected to the specified atom, considering multicenter S-groups as one fragment. Subsequent calls with different atom (i) argument are possible because only those atoms and bonds are added that are still not elements of frag. Atoms are removed from the original molecule graph unless the frag is a SelectionMolecule.- Parameters:
i
- atom indexfrag
- add the atoms and bonds to this MoleculeGraph- Since:
- Marvin 2.6
- See Also:
findFrag(int, int, MoleculeGraph)
-
findFrag
public final void findFrag(int i, int fragmentationType, MoleculeGraph frag)
Determines the subgraph connected to the specified atom. Subsequent calls with different atom (i) argument are possible because only those atoms and bonds are added that are still not elements of frag. Atoms are removed from the original molecule graph unless the frag is a SelectionMolecule.- Parameters:
i
- atom indexfragmentationType
- type of fragmentationfrag
- add the atoms and bonds to this MoleculeGraph- Since:
- Marvin 5.6
- See Also:
FRAG_BASIC
,FRAG_KEEPING_MULTICENTERS
,FRAG_KEEPING_SGROUPS
-
findFragById
public final void findFragById(int fragId, int fragmentationType, MoleculeGraph frag)
Determines the subgraph corresponding to the specific fragment ID. Atoms are removed from the original molecule graph unless the frag is a SelectionMolecule.- Parameters:
fragId
- fragment IDfragmentationType
- type of fragmentationfrag
- add the atoms and bonds to this MoleculeGraph- Since:
- Marvin 5.6
- See Also:
getFragIds(int)
,FRAG_BASIC
,FRAG_KEEPING_MULTICENTERS
,FRAG_KEEPING_SGROUPS
-
findBasicFrags
public final <C extends MoleculeGraph> C[] findBasicFrags(Class<C> cl)
Determines the disconnected fragments and puts them into an array. Atoms are removed from the original molecule object unless the fragment class is SelectionMolecule.class. The original atom order is preserved in the returned fragments. Fragment order is also determined by the original atom order. The first fragment is the one containing atom 0, the second fragment is the one containing the smallest indexed atom not in the first fragment, etc. This method provides the basic fragmentation that relies on classical graph theory and is not overwritten by successor class. DO NOT USE WITH OTHER FRAGMENTATION RELATED METHODS likegetFragCount()
! The length of the returned array and the returned value ofgetFragCount()
might be different in successor classes.- Parameters:
cl
- create fragment objects of this class- Returns:
- array of fragments
- Since:
- Marvin 5.0
-
createGearch
protected chemaxon.struc.gearch.MoleculeGraphGearch createGearch()
-
getMaxRgroupAttachmentPointOrder
public int getMaxRgroupAttachmentPointOrder()
Returns the maximal attachment point order of R-group attachment point atoms in this molecule graph.- Returns:
- the maximal attachment point order
- Since:
- Marvin 5.4
- See Also:
MolAtom.RGROUP_ATTACHMENT
,MolAtom.getRgroupAttachmentPointOrder()
-
mergeFrags
public int mergeFrags(int id1, int id2, int fragmentationType)
Merges two connected components of the given fragmentation type.- Parameters:
id1
- index of first atom to be merged into one fragmentid2
- index of second atom to be merged into one fragmentfragmentationType
- determines the type of fragmentation- Returns:
- the new ID of the merged connected components
- See Also:
FRAG_BASIC
,FRAG_KEEPING_MULTICENTERS
,FRAG_KEEPING_SGROUPS
-
setFlags
protected void setFlags(int f, int mask)
Sets specified bits in the flags.- Parameters:
f
- new value of the specified bitsmask
- bits to set
-
setValenceCheckEnabled
public void setValenceCheckEnabled(boolean b)
Enables or disables valence check on this molecule graph, depending on the value of the parameter b. Enabled valence check means that the valence check is called for all atoms in this molecule graph when needed. Valence check is enabled initially by default. To configure the options of the valence check seesetValenceCheckOptions(ValenceCheckOptions)
- Parameters:
b
- - If true, the valence check is enabled on this molecule graph; otherwise valence check is disabled- Since:
- Marvin 5.4
- See Also:
isValenceCheckEnabled()
-
isValenceCheckEnabled
public boolean isValenceCheckEnabled()
Determines whether valence check is enabled on this molecule graph. Enabled valence check means that the valence check is called for all atoms in this molecule graph when needed. Disabling means that valence check is not called anywhere. Valence check may be enabled or disabled by calling thesetValenceCheckEnabled
method. To configure the options of the valence check seesetValenceCheckOptions(ValenceCheckOptions)
- Returns:
- true if the valence check is enabled, false otherwise
- Since:
- Marvin 5.4
- See Also:
setValenceCheckEnabled(boolean b)
-
setValenceCheckState
@Deprecated public void setValenceCheckState(MoleculeGraph.ValenceCheckState state)
Deprecated.As of Marvin 6.0, replaced bysetValenceCheckOptions(ValenceCheckOptions)
andsetValenceCheckEnabled(boolean)
.
Usage:// Same as setValenceCheckState(ValenceCheckState.OFF): setValenceCheckEnabled(false); // Same as setValenceCheckState(ValenceCheckState.AMBIGUOUS_AROMATIC_ATOMS_IGNORED): setValenceCheckOptions(ValenceCheckOptions.DEFAULT); // Same as setValenceCheckState(ValenceCheckState.FULL): setValenceCheckOptions(new ValenceCheckOptions(false, true));
Enables or disables valence check on atoms of the molecule graph, depending on the value of the parameter state. Full valence check means that the valence check is called for all atoms in this molecule graph when needed. When ambiguous aromatic atoms are ignored then these kind of atoms are not checked, their implicit Hydrogen count is not set, they remain untouched. The possibility to ignore Nitrogen-like aromatic atoms is added for speedup reasons because for these atoms implicit Hydrogens can be stored (e.g. in cxsmiles format). Valence check is enabled initially by default.- Parameters:
state
- determines which atoms will be checked in the following calls ofvalenceCheck()
- Since:
- Marvin 5.9
- See Also:
getValenceCheckState()
,valenceCheck()
-
getValenceCheckState
@Deprecated public MoleculeGraph.ValenceCheckState getValenceCheckState()
Deprecated.As of Marvin 6.0, replaced bygetValenceCheckOptions()
andisValenceCheckEnabled()
.
Usage:// Same as getValenceCheckState() == ValenceCheckState.OFF: isValenceCheckEnabled() == true; // Same as getValenceCheckState() == ValenceCheckState.AMBIGUOUS_AROMATIC_ATOMS_IGNORED: getValenceCheckOptions.isLocalAromatic() == true; // Same as getValenceCheckState() == ValenceCheckState.FULL: getValenceCheckOptions.isLocalAromatic() == false;
- Returns:
- the valence check state
-
setValenceCheckOptions
public void setValenceCheckOptions(ValenceCheckOptions options)
Sets the options for valence checking. To just enable/disable valence check in the molecule usesetValenceCheckEnabled(boolean)
. Calling this function with a not null parameter automatically enables the valence check.- Parameters:
options
- the new valence check options- Since:
- Marvin 6.0
- See Also:
ValenceCheckOptions
-
getValenceCheckOptions
public ValenceCheckOptions getValenceCheckOptions()
Returns the options for valence checking. To see if the valence check is enabled on the molecule useisValenceCheckEnabled()
- Returns:
- the valence check options
- Since:
- Marvin 6.0
- See Also:
ValenceCheckOptions
-
isLargeMolecule
public boolean isLargeMolecule()
Returnstrue
if large molecule (number of atoms exceeds1000
).- Returns:
true
if large molecule
-
getFreeAttachmentPoints
public int getFreeAttachmentPoints(MolAtom atom)
- Specified by:
getFreeAttachmentPoints
in interfacechemaxon.core.calculations.valencecheck.MoleculeWithValence<MolAtom>
- Since:
- Marvin 5.11
-
getPossibleAttachmentPoints
@Deprecated protected int getPossibleAttachmentPoints(MolAtom molAtom)
Deprecated.As of Marvin 6.0, replaced bySuperatomSgroup.getAttachmentPointOrders(MolAtom)
andMolAtom.getAttachParentSgroup()
.
Usage:SuperatomSgroup group = (SuperatomSgroup)molAtom.getAttachParentSgroup()); List<Integer> orders = group.getAttachmentPointOrders(molAtom);
Calculates the possible attachment point value for an atom based on the attachment point settings of the atom.- Parameters:
molAtom
- the atom to calculate the possible attachment point value for- Returns:
- the calculated attachment point value
- Since:
- Marvin 5.10
- See Also:
MolAtom.getAttach()
-
getAtomReferenceList
@Deprecated public List<MolAtom> getAtomReferenceList()
Deprecated.Useatoms()
instead.- Since:
- Marvin 5.11
-
getLigandCount
public int getLigandCount(MolAtom atom)
- Specified by:
getLigandCount
in interfacechemaxon.core.calculations.valencecheck.MoleculeWithValence<MolAtom>
- Since:
- Marvin 5.11
-
getLigand
public MolAtom getLigand(MolAtom atom, int n)
- Specified by:
getLigand
in interfacechemaxon.core.calculations.valencecheck.MoleculeWithValence<MolAtom>
- Since:
- Marvin 5.11
-
getLigandBondType
public chemaxon.struc.BondType getLigandBondType(MolAtom atom, int i)
- Specified by:
getLigandBondType
in interfacechemaxon.core.calculations.valencecheck.MoleculeWithValence<MolAtom>
- Since:
- Marvin 5.11
-
getLigandAtno
public int getLigandAtno(MolAtom atom, int n)
- Specified by:
getLigandAtno
in interfacechemaxon.core.calculations.valencecheck.MoleculeWithValence<MolAtom>
- Since:
- Marvin 5.11
-
getCharge
public int getCharge(MolAtom atom)
- Specified by:
getCharge
in interfacechemaxon.core.calculations.valencecheck.MoleculeWithValence<MolAtom>
- Since:
- Marvin 5.11
-
getAtomicNumber
public int getAtomicNumber(MolAtom atom)
- Specified by:
getAtomicNumber
in interfacechemaxon.core.calculations.valencecheck.MoleculeWithValence<MolAtom>
- Since:
- Marvin 5.11
-
getRadicalCount
public int getRadicalCount(MolAtom atom)
- Specified by:
getRadicalCount
in interfacechemaxon.core.calculations.valencecheck.MoleculeWithValence<MolAtom>
- Since:
- Marvin 5.11
-
getValenceProperty
public int getValenceProperty(MolAtom atom)
- Specified by:
getValenceProperty
in interfacechemaxon.core.calculations.valencecheck.MoleculeWithValence<MolAtom>
- Since:
- Marvin 5.11
-
getImplicitHCount
public int getImplicitHCount(MolAtom atom)
- Specified by:
getImplicitHCount
in interfacechemaxon.core.calculations.valencecheck.MoleculeWithValence<MolAtom>
- Since:
- Marvin 5.11
-
isAtomInRing
public boolean isAtomInRing(MolAtom atom)
- Specified by:
isAtomInRing
in interfacechemaxon.core.calculations.valencecheck.MoleculeWithValence<MolAtom>
- Since:
- Marvin 5.11
-
isAcceptedSpecialLigand
public boolean isAcceptedSpecialLigand(MolAtom atom)
- Specified by:
isAcceptedSpecialLigand
in interfacechemaxon.core.calculations.valencecheck.MoleculeWithValence<MolAtom>
- Since:
- Marvin 5.11
-
isBondParallelWith
protected boolean isBondParallelWith(MolBond b)
Checks if there is a bond parallel (having same endpoints) with the given bond in this MoleculeGraph.- Parameters:
b
- bond- Returns:
- true if there is a bond parallel with the given bond else false
-
replaceAtom
public void replaceAtom(int i, MolAtom newAtom)
Replaces the atom on the given index with the parameter atom and removes the parameter atom from its original parent molecule if needed.- Parameters:
i
- the index of the original atomnewAtom
- the atom which will replace the original
-
connectOriginalBondsToNewAtom
protected void connectOriginalBondsToNewAtom(MolAtom newAtom, MolAtom orig, MolBond[] bonds)
Sets the original connections to the new atom.- Parameters:
newAtom
- the atom which replace the originalorig
- the original atombonds
- the original atoms bonds (before any modification)
-
getAtomIterator
public IteratorFactory.AtomIterator getAtomIterator()
Returns an iterator over the atoms in this molecule in proper sequence.- 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.- Returns:
- an iterator over the bonds in this molecule in proper sequence
- Since:
- Marvin 6.2, 2013.09.09.
-
setSupergraph
protected void setSupergraph(MoleculeGraph molecule)
Sets the given molecule as the supergraph of this graph.- Parameters:
molecule
- the molecule- Since:
- Marvin 14.7.7, Jul 2, 2014
-
atoms
public final List<MolAtom> atoms()
Provides a list view of the atoms in the molecule. It is a dynamic view, which follows every change of the molecule structure. However, you must not add or remove atoms and bonds during iteration.- Specified by:
atoms
in interfacechemaxon.core.calculations.valencecheck.MoleculeWithValence<MolAtom>
- Returns:
- a dynamic list view of the atoms
-
bonds
public final List<MolBond> bonds()
Provides a list view of the bonds in the molecule. It is a dynamic view, which follows every change of the molecule structure. However, you must not add or remove atoms and bonds during iteration.- Returns:
- a dynamic list view of the bonds
-
fixProperties
public void fixProperties()
Delegates to tracker's fixProperties().
-
-