Class MoleculeGraph
- All Implemented Interfaces:
MoleculeWithValence<MolAtom>
,chemaxon.core.structure.MoleculeForBuilder
,MTransformable
,StereoConstants
,Serializable
- Direct Known Subclasses:
Molecule
,SelectionMolecule
- Since:
- Marvin 3.0, 10/11/2002
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Deprecated, for removal: This API element is subject to removal in a future version. -
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Aromatization type for ambiguous 5-membered rings.static final int
Basic aromatization.static final int
Huckel aromatization.static final int
General (Daylight conform) aromatization.static final int
Loose aromatization.static final int
Substructure aromatization.protected int
The number of atoms.protected static final int
Deprecated, for removal: This API element is subject to removal in a future version.protected int
The number of bonds.protected BondTable
Bond table.static final int
Cache removal option for clearing all cached info.static final int
Cache removal option for remove module used in aromatization.static final int
Cache removal option for cacheMemory.static final int
Cache removal option for remove module used in graph invariant calculation.static final int
Cache removal option for remove module used in parity calculation.static final int
Cache removal option for remove module used in sssr.static final int
Cache remove option to clear ctab and btab.protected int[][]
Connection table.static final int
General dearomatization.static final int
Dearomatize method which dearomatizes only that molecules which fullfills the Huckel's rule.static final int
Dearomatize method which dearomatizes only that molecules which fullfills the Huckel's rule.protected static final int
Dimension bits in flags.static final int
Basic fragmentation, only atom - atom connections (bond) are considered.static final int
Fragmentation without breaking multicenter S-groups.static final int
Fragmentation without breaking S-groups.static final int
Number of fragmentation types.chemaxon.struc.gearch.MoleculeGraphGearch
static final int
Graph invariant option to instruct that the graph invariant should not be stored in MoleculeGraph.static final int
Graph invariant option for ignoring explicit hydrogens.static final int
Graph invariant option for calculating graph invariants using the old stereo method.static final int
Graph invariant option for calculating graph invariants using stereo information.static final int
Graph invariant option for calculating graph invariants considering atom maps also.static final int
Unified mask of graph invariant options affecting grinv value.protected long
Graph invariant change count.protected static final int
Initial capacity of the atoms and bonds vectors.static final String
static final int
The minimal size of the ring for the existence of TRANS double bond.static final int
Omit arranging process after the hydrogen addition.protected double
Origin x.protected double
Origin y.protected double
Origin z.protected MoleculeGraph
The structure that contains this molecule graph as a substructure.protected MPropertyContainer
static final int
Perform all clean-up methods when removing an atom or a bond.static final int
When removing an atom or a bond, also remove the bond(s) from the atom object(s).protected static final int
Remove called from RxnMolecule.fixComponent.static final int
Remove graphics objects containing the removed atom.static final int
Do not perform any clean-up methods when removing an atom or a bond.static final int
Remove atom from parent document.static final int
When removing a H atom, keep stereo information unchanged.protected MoleculeGraph
Parent of all parents.protected MolAtom[]
The atoms (nodes).protected MolBond[]
The bonds (edges).protected boolean
protected static final int
Valence check calculation bit in flags.protected static final int
Deprecated, for removal: This API element is subject to removal in a future version.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
ConstructorDescriptionConstruct 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
Modifier and TypeMethodDescriptionvoid
Adds an atom to the molecule.void
Adds a bond to the molecule.void
Add a bond to the molecule.protected void
Adds an atom.protected void
Adds all atoms and bonds to the specified molecule.protected void
addAtomToFragment
(MolAtom atom) Adds an atom to a fragment.protected int
Adds an atom without setting its parentGraph and index fields.protected void
Adds a bond.protected final int
Adds a bond without setting its parentGraph and index fields.boolean
addExplicitHydrogens
(int f) Deprecated, for removal: This API element is subject to removal in a future version.As of Marvin 5.7, replaced byHydrogenize.convertImplicitHToExplicit(MoleculeGraph, MolAtom[], int)
.
Usage:boolean
addExplicitHydrogens
(int f, MolAtom[] atoms) Deprecated, for removal: This API element is subject to removal in a future version.As of Marvin 5.7, replaced byHydrogenize.convertImplicitHToExplicit(MoleculeGraph, MolAtom[], int)
.
Usage:void
Deprecated, for removal: This API element is subject to removal in a future version.As of Marvin 5.7, replaced byHydrogenize.convertImplicitLonePairsToExplicit(MoleculeGraph, MolAtom[])
.
Usage:protected int
Adds a non-SgroupAtom atom without setting its parentGraph and index fields.void
Checks whether the molecule has multiple chiral centresfinal void
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
Deprecated, for removal: This API element is subject to removal in a future version.As of Marvin 5.7, replaced byCleanUtil.arrangeComponents(MoleculeGraph, boolean, boolean)
.
Usage:atoms()
Provides an unmodifiable list view of the atoms in the molecule.double
Calculates the regular bond length.bonds()
Provides an unmodifiable list view of the bonds in the molecule.Calculates the geometrical center.void
Calculates the geometrical center.int
calcDehydrogenizedGrinv
(int[] gi) Calculates the graph invariants with the assumption that hydrogens are removed.double
Calculates the molecule height.void
Calculates and sets hybridazation state for each atom.Calculates the outer rectangle.void
Calculates the outer rectangle.Calculates the center of the outer rectangle.void
Calculates the center of the outer rectangle.double
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
Determines whether the given bond can be a CIS/TRANS or not.protected void
void
Deprecated, for removal: This API element is subject to removal in a future version.As of Marvin 5.7, no replacement.
Not intended for public use, it was intended only for internal debugging.boolean
Deprecated, for removal: This API element is subject to removal in a future version.As of Marvin 5.7, replaced byCleaner.clean(MoleculeGraph, int, String)
.boolean
clean
(int dim, String opts, MProgressMonitor pmon) Deprecated, for removal: This API element is subject to removal in a future version.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.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
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
Checks if the molecule graph contains the specified atom.boolean
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
Creates a dehydrogenized version of the molecule.protected chemaxon.struc.gearch.MoleculeGraphGearch
protected final Smolecule
Creates aSmolecule
represenation of this molecule.boolean
Dearomatize molecule.boolean
dearomatize
(int method) Dearomatize molecule.protected final int
Finds an atom in the atoms array.Finds the clone of an atom.final <C extends MoleculeGraph>
C[]findBasicFrags
(Class<C> cl) Determines the disconnected fragments and puts them into an array.protected final int
Finds a bond in the bonds array.final int[]
Deprecated, for removal: This API element is subject to removal in a future version.final int[]
findComponentIds
(int[] inds) Assigns a component ID to each connected component formed by the specified atom indexes.final void
findFrag
(int i, int fragmentationType, MoleculeGraph frag) Determines the subgraph connected to the specified atom.final void
findFrag
(int i, MoleculeGraph frag) Deprecated, for removal: This API element is subject to removal in a future version.As of Marvin 5.6, replaced byfindFrag(int, int, MoleculeGraph)
andFRAG_KEEPING_MULTICENTERS
.
Usage:final void
findFragById
(int fragId, int fragmentationType, MoleculeGraph frag) Determines the subgraph corresponding to the specific fragment ID.<C extends MoleculeGraph>
C[]Deprecated, for removal: This API element is subject to removal in a future version.<C extends MoleculeGraph>
C[]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
Delegates to tracker's fixProperties().protected boolean
Fix a property containing reference to the molecule.final 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.getAtom
(int n) Gets the nth atom.MolAtom[]
Creates an array of atoms.int
Gets the number of atoms.int
getAtomCount
(int atomicNumber) Gets the number of atoms with the given atomic number.int
getAtomicNumber
(MolAtom atom) Gets the atomic number of the given atom.Returns an iterator over the atoms in this molecule in proper sequence.Deprecated, for removal: This API element is subject to removal in a future version.Useatoms()
instead.getBond
(int n) Gets the nth bond.MolBond[]
Creates an array of bonds.int
Gets the number of bonds.Returns an iterator over the bonds in this molecule in proper sequence.protected MolBond[]
Returns the bonds attached to the given atom in this molecule graph.Gets the bond (edge) table.int
Gets the charge of the given 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.final int[][]
getCSSR()
Gets the Complete Set of Smallest Ring atom indexes array.int[][]
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, for removal: This API element is subject to removal in a future version.double
Deprecated, for removal: This API element is subject to removal in a future version.As of Marvin 5.11, replaced byMolBond.desiredLength(int, int, int, int)
,MolBond.getType()
andgetDim()
.
Usage:int
getDim()
Gets the dimension.Gets the document object.protected MDocument
Gets the parent document for a child molecule graph.DPoint3[]
Gets the cube that encloses the atoms of molecule graph.double
Calculates the molecular weight of the molecule using the mass of the most frequent natural isotope of the atoms.int
Gets the total number of explicit hydrogens attached to the molecule.int
getExplicitLonePairCount
(int i) Deprecated.For internal use only.getEZStereo
(MolBond bond) Gets E/Z stereo information for the given double bond.int
getFlags()
Gets the dimension and chiral flags.final MoleculeGraph
Gets the first parent.int
Gets the (total) formal charge of the molecule.Gets the molecular formula.final int
Deprecated, for removal: This API element is subject to removal in a future version.final int
getFragCount
(int fragmentationType) Returns the number of fragments for the given fragmentation type.final int[]
getFragIds
(int fragmentationType) Gets an array containing the fragment id for each atom for the given fragmentation type.int
Returns the number of the free attachment points for the given atom.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, for removal: This API element is subject to removal in a future version.As of Marvin 4.0, replaced bygetGrinv(int[], int)
.
Usage:int
getGrinv
(int[] gi, int options) Gets the graph invariants (canonical labels).final long
Gets the graph invariant change count.int
Gets graph invariant calculation options passed to the module.int
Gets the total number of implicit hydrogens attached to the molecule.int
getImplicitHCount
(MolAtom atom) Gets the number of implicit hydrogens attached to the given atom.Gets the n-th ligand of the given atom.int
getLigandAtno
(MolAtom atom, int n) Gets the atomic number of the n-th ligand of the given atom.getLigandBondType
(MolAtom atom, int i) Gets the type of the n-th ligand bond of the given atom.int
getLigandCount
(MolAtom atom) Gets the number of ligands of the given 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.Gets the origin of the molecule.final Object
getLock()
Gets the lock object for synchronization.int
getLonePairCount
(int i) Deprecated.useMolAtom.getLonePairCount()
insteaddouble
getMass()
Calculates the molecular weight of the molecule.int
Returns the maximal attachment point order of R-group attachment point atoms in this molecule graph.getName()
Gets the molecule title/name.final MoleculeGraph
Gets the parent graph that contains this substructure.protected MDocument
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[]
Gets an array containing the atom coordinates.protected int
getPossibleAttachmentPoints
(MolAtom molAtom) Deprecated, for removal: This API element is subject to removal in a future version.As of Marvin 6.0, replaced bySuperatomSgroup.getAttachmentPointOrders(MolAtom)
andMolAtom.getAttachParentSgroup()
.
Usage:int
getRadicalCount
(MolAtom atom) Gets the number of free electrons of the given atom.int[]
Get the smallest ring size in which the atom (specified with it's index) can be located.final int[][]
getSSSR()
Gets the Smallest Set of Smallest Ring atom indexes array.final int[][]
Gets the Smallest Set of Smallest Ring bond indexes array.final BitSet[]
Gets the Smallest Set of Smallest Ring edges as an array of BitSets, one BitSet for each ring.Get SSSR bond index bitset.long[]
Deprecated.as of 15.09.2014, usegetSSSRBondSet()
insteadint[][]
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
Gets cis/trans (Z/E) stereo information for the given bond.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.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.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
Gets the number of all "submolecules".final MoleculeGraph[]
Gets all "submolecules".protected void
getSubGraphs
(MoleculeGraph[] m, int off) Gets all "submolecules".int
Gets the total (formal) charge of the molecule.Returns the options for valence checking.Deprecated, for removal: This API element is subject to removal in a future version.int
getValenceProperty
(MolAtom atom) Gets the valence property of the given atom.double[]
Returns the coordinates of the given atom (contained in the molecule).boolean
Tests whether the molecule graph has atom sets.boolean
Tests whether the molecule graph has atom sets.boolean
Deprecated, for removal: This API element is subject to removal in a future version.useMDocument.hasExplicitLonePairs()
insteadboolean
boolean
Tests whether the molecule has implicit hydrogen atoms.final boolean
Tests whether the property list contains the molecule.boolean
Determines if this molecule has a valence error on any of its atoms.boolean
hydrogenize
(boolean add) Deprecated, for removal: This API element is subject to removal in a future version.As of Marvin 5.7, replaced byHydrogenize.convertImplicitHToExplicit(MoleculeGraph)
andHydrogenize.convertExplicitHToImplicit(MoleculeGraph)
.final void
implicitizeHydrogens
(int f) Deprecated, for removal: This API element is subject to removal in a future version.As of Marvin 5.7, replaced byHydrogenize.convertExplicitHToImplicit(MoleculeGraph, int)
.
Usage:void
implicitizeHydrogens
(int f, MolAtom[] atoms) Deprecated, for removal: This API element is subject to removal in a future version.As of Marvin 5.7, replaced byHydrogenize.convertExplicitHToImplicit(MoleculeGraph, MolAtom[], int)
.
Usage:void
implicitizeHydrogens
(int f, MolAtom[] atoms, boolean check) Deprecated, for removal: This API element is subject to removal in a future version.As of Marvin 5.7, replaced byHydrogenize.convertExplicitHToImplicit(MoleculeGraph, MolAtom[], int, boolean)
.
Usage:protected boolean
implicitizeHydrogens0
(int f, MolAtom[] atoms, boolean check) Deprecated, for removal: This API element is subject to removal in a future version.As of Marvin 5.7, replaced byHydrogenize.convertExplicitHToImplicit(MoleculeGraph, MolAtom[], int, boolean)
.
Usage:protected final void
Increases the graph invariant change count and sets grinv to null.protected final void
incGrinvCC
(boolean isSSSRReset) final void
Increases the graph invariant change count, but does not change grinv.int
Gets the index of the specified atom.int
Gets the index of the specified bond.final void
insertAtom
(int i, MolAtom atom) Deprecated.as of Marvin 6.2, may construct inconsistentMoleculeGraph
.final void
insertBond
(int i, MolBond bond) Deprecated.as of Marvin 6.2, may construct 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
Gets the absolute stereoconfiguration flag.boolean
Check if the ligand is a special atom which changes the ring atom column number with -1boolean
isAtom()
Deprecated.As of Marvin 14.7.7, no replacement.
Not supported feature.boolean
isAtomInRing
(MolAtom atom) Checks whether the atom is in ring.boolean
isBond()
Deprecated.As of Marvin 14.7.7, no replacement.
Not supported feature.protected boolean
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
Tests whether the graph invariant change count is valid.boolean
Returnstrue
if large molecule (number of atoms exceeds1000
).boolean
Deprecated, for removal: This API element is subject to removal in a future version.as of Marvin 14.7.7, no replacement.
Usage:boolean
Returns the multiple chirality flag.protected void
Isolates atom: a more efficient way of removing an atom thanremoveAtom(chemaxon.struc.MolAtom)
, especially for large molecule graphs.protected void
Isolates bond: a more efficient way of removing a bond thanremoveBond(chemaxon.struc.MolBond)
, especially for large molecule graphs.boolean
Get how parity module interpret wedges.boolean
isQuery()
Indicates if the molecule has query features: query atoms or query bonds.protected boolean
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
Tests whether the specified property is a self reference to the molecule.boolean
Tests if the molecule graph is similar to another graph.boolean
Tests whether the molecule graph is symmetric.boolean
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
Copies some properties of this molecule to the other one specified as argument.void
mergeAtoms
(MolAtom replacementAtom, MolAtom origAtom) Deprecated, for removal: This API element is subject to removal in a future version.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
Move the molecule.Creates a new MoleculeGraph object.void
pack()
Reduce memory usage.boolean
partialClean
(int dim, int[] fixed, String opts) Deprecated, for removal: This API element is subject to removal in a future version.As of Marvin 5.7, replaced byCleaner.partialClean(MoleculeGraph, int, int[], String)
.boolean
partialClean
(Molecule[] template, String opts) Deprecated, for removal: This API element is subject to removal in a future version.As of Marvin 5.7, replaced byCleaner.partialClean(Molecule, Molecule[], String)
.boolean
partialClean
(MoleculeGraph template, int[] map, String opts) Deprecated, for removal: This API element is subject to removal in a future version.As of Marvin 5.7, replaced byCleaner.partialClean(MoleculeGraph, MoleculeGraph, int[], String)
.Gets the property container.void
qpropCheck
(List<MolAtom> v) Check for query property errors.void
Regenerates the bond vector: remove its elements, then put the bond objects from the atoms into it.protected void
Regenerates the bond table.protected void
Regenerates the connection table.protected final void
Recreate graph search results object.void
Removes all the atoms and bonds.void
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
Deprecated, for removal: This API element is subject to removal in a future version.As of Marvin 5.7, replaced byHydrogenize.convertExplicitLonePairsToImplicit(MoleculeGraph)
.protected void
Removes thenull
atom entries in the atoms array and sets the index fields appropriately.protected void
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 construct inconsistentMoleculeGraph
.protected void
An operation performed that changed the connection table and the graph invariants.protected final void
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
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
Deprecated.as of Marvin 6.2, may construct inconsistentMoleculeGraph
.protected void
Sets the atom at the specified index.final void
setAtomSetSeqs
(int id) Sets the set sequence number of all atoms.void
Deprecated.as of Marvin 6.2, may construct inconsistentMoleculeGraph
.final 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 final void
setGrinvCC
(long g) Sets the graph invariant change count.void
setGrinvOptions
(int opt) Sets graph invariant calculation options passed to the module.void
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
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
Sets the options for valence checking.void
Deprecated, for removal: This API element is subject to removal in a future version.As of Marvin 6.0, replaced bysetValenceCheckOptions(ValenceCheckOptions)
andsetValenceCheckEnabled(boolean)
.
Usage:final 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
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.toString()
Overrides MoleculeGraph.toString() to ease debugging.void
Apply a transformation matrix to the atomic coordinates.void
transform
(CTransform3D t, boolean incg) Apply a transformation matrix to the atomic coordinates.protected final void
Updates the dimensions when fusing two structures.void
useOnlyFirstAtomInStereoCalculation
(boolean f) Set how parity module should interpret wedes.void
Check valence and query property errors for atoms.void
valenceCheck
(List<MolAtom> v) Check valence and query property errors.
-
Field Details
-
INITIAL_CAPACITY
protected static final int INITIAL_CAPACITYInitial capacity of the atoms and bonds vectors.- See Also:
-
AROM_BASIC
public static final int AROM_BASICBasic aromatization.- Since:
- Marvin 4.1, 12/09/2005
- See Also:
-
AROM_GENERAL
public static final int AROM_GENERALGeneral (Daylight conform) aromatization.- Since:
- Marvin 4.1, 12/09/2005
- See Also:
-
AROM_LOOSE
public static final int AROM_LOOSELoose aromatization.- Since:
- Marvin 5.2, 01/11/2008
- See Also:
-
AROM_SUBSTRUCTURE
public static final int AROM_SUBSTRUCTURESubstructure aromatization. Used internally.- Since:
- Marvin 5.3, 09/14/2009
- See Also:
-
AROM_AMBIGUOUS
public static final int AROM_AMBIGUOUSAromatization 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:
-
AROM_CHUCKEL
public static final int AROM_CHUCKELHuckel aromatization.- Since:
- Marvin 16.12, 09/12/2016
- See Also:
-
CHuckelAromatization
- Constant Field Values
-
DEAROM_GENERAL
public static final int DEAROM_GENERALGeneral dearomatization.- Since:
- Marvin 5.2.3, 06/29/2008
- See Also:
-
DEAROM_HUCKELCHECK
public static final int DEAROM_HUCKELCHECKDearomatize method which dearomatizes only that molecules which fullfills the Huckel's rule.- Since:
- Marvin 5.2.3, 06/29/2008
- See Also:
-
DEAROM_HUCKELCHECK_EX
public static final int DEAROM_HUCKELCHECK_EXDearomatize 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:
-
INVALID_LINKNODE_MESSAGE
- See Also:
-
DIM_MASK
protected static final int DIM_MASKDimension bits in flags.- See Also:
-
AUTO_UNGROUP
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) protected static final int AUTO_UNGROUPDeprecated, for removal: This API element is subject to removal in a future version.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:
-
VALENCE_CHECK
protected static final int VALENCE_CHECKValence check calculation bit in flags. Valence check will be called according to this flag.- Since:
- Marvin 5.4
- See Also:
-
VALENCE_CHECK_AMBIGUOUS
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) protected static final int VALENCE_CHECK_AMBIGUOUSDeprecated, for removal: This API element is subject to removal in a future version.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:
-
RMCLEANUP_NONE
public static final int RMCLEANUP_NONEDo not perform any clean-up methods when removing an atom or a bond.- Since:
- Marvin 3.1
- See Also:
-
RMCLEANUP_EDGES
public static final int RMCLEANUP_EDGESWhen removing an atom or a bond, also remove the bond(s) from the atom object(s).- Since:
- Marvin 3.1
- See Also:
-
CACHE_REMOVE_ALL
public static final int CACHE_REMOVE_ALLCache removal option for clearing all cached info.- See Also:
-
CACHE_REMOVE_CACHEMEMORY
public static final int CACHE_REMOVE_CACHEMEMORYCache removal option for cacheMemory. -
RMCLEANUP_STEREO
public static final int RMCLEANUP_STEREOWhen removing a H atom, keep stereo information unchanged.- Since:
- Marvin 3.1
- See Also:
-
RMCLEANUP_MOBJECT
public static final int RMCLEANUP_MOBJECTRemove graphics objects containing the removed atom.- Since:
- Marvin 4.1, 03/07/2006
- See Also:
-
RMCLEANUP_FIXCOMPONENT
protected static final int RMCLEANUP_FIXCOMPONENTRemove called from RxnMolecule.fixComponent. For internal use only.- Since:
- Marvin 4.1.3, 11/16/2006
- See Also:
-
RMCLEANUP_PARENTDOC
public static final int RMCLEANUP_PARENTDOCRemove atom from parent document.- Since:
- Marvin 4.1.13, 09/06/2007
- See Also:
-
RMCLEANUP_ALL
public static final int RMCLEANUP_ALLPerform all clean-up methods when removing an atom or a bond.- Since:
- Marvin 3.1
- See Also:
-
GRINV_NOHYDROGEN
public static final int GRINV_NOHYDROGENGraph invariant option for ignoring explicit hydrogens.- See Also:
-
GRINV_STEREO
public static final int GRINV_STEREOGraph invariant option for calculating graph invariants using stereo information. (Chirality & E/Z)- See Also:
-
GRINV_OLDSTEREO
public static final int GRINV_OLDSTEREOGraph invariant option for calculating graph invariants using the old stereo method. (Chirality only.)- See Also:
-
GRINV_USEMAPS
public static final int GRINV_USEMAPSGraph invariant option for calculating graph invariants considering atom maps also.- See Also:
-
GRINV_VALUE_OPTIONS
public static final int GRINV_VALUE_OPTIONSUnified 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:
-
GRINV_DONT_STORE
public static final int GRINV_DONT_STOREGraph invariant option to instruct that the graph invariant should not be stored in MoleculeGraph.- See Also:
-
CACHE_REMOVE_GRINVMODULE
public static final int CACHE_REMOVE_GRINVMODULECache removal option for remove module used in graph invariant calculation.- See Also:
-
CACHE_REMOVE_PARITYMODULE
public static final int CACHE_REMOVE_PARITYMODULECache removal option for remove module used in parity calculation.- See Also:
-
CACHE_REMOVE_AROMATAMODULE
public static final int CACHE_REMOVE_AROMATAMODULECache removal option for remove module used in aromatization.- See Also:
-
CACHE_REMOVE_SSSRMODULE
public static final int CACHE_REMOVE_SSSRMODULECache removal option for remove module used in sssr.- See Also:
-
CACHE_REMOVE_TABS
public static final int CACHE_REMOVE_TABSCache remove option to clear ctab and btab.- See Also:
-
MIN_RING_SIZE_FOR_TRANS_DB
public static final int MIN_RING_SIZE_FOR_TRANS_DBThe minimal size of the ring for the existence of TRANS double bond.- See Also:
-
OMIT_POSTCLEAN
public static final int OMIT_POSTCLEANOmit arranging process after the hydrogen addition.- See Also:
-
chemaxon.calculations.hydrogenize.Hydrogenize#convertImplicitHToExplicit(MoleculeGraph, int)
- Constant Field Values
-
FRAG_BASIC
public static final int FRAG_BASICBasic fragmentation, only atom - atom connections (bond) are considered.- See Also:
-
FRAG_KEEPING_MULTICENTERS
public static final int FRAG_KEEPING_MULTICENTERSFragmentation without breaking multicenter S-groups.- See Also:
-
FRAG_KEEPING_SGROUPS
public static final int FRAG_KEEPING_SGROUPSFragmentation without breaking S-groups.- See Also:
-
FRAG_TYPE_COUNT
public static final int FRAG_TYPE_COUNTNumber of fragmentation types.- See Also:
-
superGraph
Parent of all parents. -
parentGraph
The structure that contains this molecule graph as a substructure. -
theAtoms
The atoms (nodes). -
atomCount
protected transient int atomCountThe number of atoms. -
theBonds
The bonds (edges). -
bondCount
protected transient int bondCountThe number of bonds. -
orix
protected transient double orixOrigin x. -
oriy
protected transient double oriyOrigin y. -
oriz
protected transient double orizOrigin z. -
grinvCC
protected transient long grinvCCGraph invariant change count. The number of times the molecule (and the corresponding graph invariants) may have changed since the creation of the molecule. -
cacheMemory
-
ctab
protected transient int[][] ctabConnection table. -
btab
Bond table. -
gearch
public transient chemaxon.struc.gearch.MoleculeGraphGearch gearch -
propertyContainer
-
useOnlyFirstAtomInStereoCalculation
protected transient boolean useOnlyFirstAtomInStereoCalculation
-
-
Constructor Details
-
MoleculeGraph
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 Details
-
getParent
Gets the parent graph that contains this substructure.- Returns:
- the parent, or null if this is the supergraph
- Since:
- Marvin 2.6
-
getForefather
Gets the first parent.- Returns:
- parent of all parents
- Since:
- Marvin 2.9.11
-
getLock
Gets the lock object for synchronization. The lock object is the top parent.- Returns:
- the lock object
- Since:
- Marvin 2.6
-
add
Adds an atom to the molecule.- Parameters:
atom
- the atom object
-
add
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
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 object
-
addAtom0
Adds an atom.- Parameters:
atom
- the atom reference
-
addAtomWithoutChangingIt
Adds an atom without setting its parentGraph and index fields.- Parameters:
atom
- the atom reference- Returns:
- the new atom index
-
addSimpleAtomWithoutChangingIt
Adds a non-SgroupAtom atom without setting its parentGraph and index fields.- Parameters:
atom
- the atom reference- Returns:
- the new atom index
-
addAtomToFragment
Adds an atom to a fragment.- Parameters:
atom
- the atom reference
-
addBond0
Adds a bond.- Parameters:
bond
- the bond reference
-
addBondWithoutChangingIt
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
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
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
Gets the document object.- Returns:
- a Marvin document object
- Since:
- Marvin 3.3
-
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
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
Gets aSmolecule
representation of this molecule.- Returns:
- the
Smolecule
implementation - Since:
- Marvin 5.2.2, 04/24/2009
-
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. If the molecule is in 0D and set to 2D or 3D then stereo information is removed.- Parameters:
d
- 0, 2, or 3- See Also:
-
getDim
public int getDim()Gets the dimension.- Returns:
- 0, 2, or 3
- See Also:
-
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:
-
setAbsStereo
public void setAbsStereo(boolean c) Sets the absolute stereoconfiguration flag.- Parameters:
c
- the absolute stereoconfiguration flag- See Also:
-
clear
public void clear()Clears the molecule. Does the same as clearForImport() but also clears the atoms vector.- See Also:
-
clearForImport
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:
-
removeAtom
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:
-
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:
-
setAtom0
Sets the atom at the specified index.- Parameters:
i
- atom indexatom
- new atom reference
-
setBond
Deprecated.as of Marvin 6.2, may construct 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.as of Marvin 6.2, may construct 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(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public int getGrinv(int[] gi, boolean uniqueFlag) Deprecated, for removal: This API element is subject to removal in a future version.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
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:
-
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:
-
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:
-
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:
-
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:
-
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:
-
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:
-
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(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public boolean addExplicitHydrogens(int f) Deprecated, for removal: This API element is subject to removal in a future version.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:
-
addExplicitHydrogens
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public boolean addExplicitHydrogens(int f, MolAtom[] atoms) Deprecated, for removal: This API element is subject to removal in a future version.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:
-
hydrogenize
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public boolean hydrogenize(boolean add) Deprecated, for removal: This API element is subject to removal in a future version.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, for removal: This API element is subject to removal in a future version.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(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public void removeExplicitLonePairs()Deprecated, for removal: This API element is subject to removal in a future version.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(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public final void implicitizeHydrogens(int f) Deprecated, for removal: This API element is subject to removal in a future version.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(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public void implicitizeHydrogens(int f, MolAtom[] atoms) Deprecated, for removal: This API element is subject to removal in a future version.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(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public void implicitizeHydrogens(int f, MolAtom[] atoms, boolean check) Deprecated, for removal: This API element is subject to removal in a future version.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(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) protected boolean implicitizeHydrogens0(int f, MolAtom[] atoms, boolean check) Deprecated, for removal: This API element is subject to removal in a future version.As of Marvin 5.7, replaced byHydrogenize.convertExplicitHToImplicit(MoleculeGraph, MolAtom[], int, boolean)
.
Usage:Hydrogenize.convertExplicitHToImplicit(mol, atoms, f, check);
- Returns:
- true if success else false
-
fuse
Adds atoms and bonds of another molecule to this one. If the other molecule is in 2D and this molecule in 0D then stereo information is removed from this molecule.- 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
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
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, for removal: This API element is subject to removal in a future version.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
Updates the dimensions when fusing two structures.- Parameters:
m
- the other molecule- Since:
- Marvin 4.0.2, 08/26/2005
-
mergeAtoms
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public void mergeAtoms(MolAtom replacementAtom, MolAtom origAtom) Deprecated, for removal: This API element is subject to removal in a future version.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
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
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:
-
qpropCheck
Check for query property errors. Check all the atoms if the argument isnull
.- Parameters:
v
- contains the atoms to check- See Also:
-
isSimilarTo
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:
-
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.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.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
Gets the molecule title/name. It returns an empty string in this basic implementation.- Returns:
- empty string
- Since:
- Marvin 4.1, 05/28/2006
-
properties
Gets the property container.- 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.- 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.- 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
Gets the nth atom.- Parameters:
n
- the atom index- Returns:
- the atom object
-
getBond
Gets the nth bond.- Parameters:
n
- the bond index- Returns:
- the bond object
-
setAtom
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.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.as of Marvin 6.2, may construct 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
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
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
Creates an array of atoms.- Returns:
- array of atom objects
- Since:
- Marvin 2.6
-
getBondArray
Creates an array of bonds.- Returns:
- array of bond objects
- Since:
- Marvin 3.5, 09/02/2004
-
calcCenter
Calculates the geometrical center.- Parameters:
p
- reference to the object that will hold the result- Since:
- Marvin 2.7
-
calcOutRect
Calculates the outer rectangle.- Returns:
- the outer rectangle (x, y, and z direction width of the outer rectangle)
- Since:
- Marvin 4.1
-
calcOutRect
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
Calculates the center of the outer rectangle.- Returns:
- the center
- Since:
- Marvin 4.1
-
calcOutRectCenter
Calculates the center of the outer rectangle.- Parameters:
p
- reference to the object that will hold the result
-
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(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public double getDesiredLength(int atno1, int atno2, int type) Deprecated, for removal: This API element is subject to removal in a future version.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(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public double getDesiredLength(MolBond b) Deprecated, for removal: This API element is subject to removal in a future version.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
Gets the origin of the molecule.- Returns:
- the origin
- Since:
- Marvin 2.7
- See Also:
-
setLocation
Set the origin of the molecule.- Parameters:
o
- the origin- Since:
- Marvin 2.7
- See Also:
-
moveTo
Move the molecule.- Parameters:
o
- the new origin- Since:
- Marvin 2.7
- See Also:
-
transform
Apply a transformation matrix to the atomic coordinates.- Specified by:
transform
in interfaceMTransformable
- Parameters:
t
- the transformation matrix- Since:
- Marvin 2.7
-
transform
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
Gets an array containing the atom coordinates.- Returns:
- atom coordinates array
- Since:
- Marvin 2.9.1
-
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
Make another molecule identical to this one.- Parameters:
m
- the target molecule
-
clonecopy
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
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
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
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.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
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
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:
-
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
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:
-
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:
-
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:
-
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:
-
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:
-
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:
-
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:
-
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:
-
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:
-
setChirality
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:
-
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.See
getStereo2(chemaxon.struc.MolAtom, int, int, chemaxon.struc.MolAtom)
for detailed examples.- 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:
-
getStereo2
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 ("1" means set flag):
Dihedral Returned flags Remark CIS TRANS CTUNSPEC SMARTS bonds: C/C=C/C - 1 - C/C=C\C 1 - - CC=CC 1 1 - C/?C=C/C - 1 1 C/?C=C\C 1 - 1 ISIS bonds: C-C=C-C 1 1 - 180 degrees C-C X C-C 1 1 - "Cis" or "Trans" bond C/C="C/T?"=C/C - 1 1 "Not Cis" bond C/C="C/T?"=C\C 1 - 1 "Not trans" bond C-C="C/T?"=C-C 1 1 1 180 degrees - See Also:
-
getStereo2
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.See
getStereo2(chemaxon.struc.MolAtom, int, int, chemaxon.struc.MolAtom)
for detailed examples.- Parameters:
b
- the bonda1
- atom A1a4
- atom A4- Returns:
- the stereo flags
- See Also:
-
getStereo2
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.See
getStereo2(chemaxon.struc.MolAtom, int, int, chemaxon.struc.MolAtom)
for detailed examples.- Parameters:
b
- the bonda1
- atom A1a4
- atom A4grcheck
- true if check atom equivalences using graph invariants- Returns:
- the stereo flags
- See Also:
-
getEZStereo
Gets E/Z stereo information for the given double bond. The calculation considers the following:- If the bond is in a small ring (size<8) 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
- See Also:
- If the bond is in a small ring (size<8) then
-
getStereo2
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.See
getStereo2(chemaxon.struc.MolAtom, int, int, chemaxon.struc.MolAtom)
for detailed examples. SeegetEZStereo(MolBond)
for a similar method with different return values.- 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
- See Also:
-
getStereo2
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.See
getStereo2(chemaxon.struc.MolAtom, int, int, chemaxon.struc.MolAtom)
for detailed examples.- Parameters:
b
- the bonda1
- atom A1i2
- index of atom A2i3
- index of atom A3a4
- atom A4- Returns:
- the stereo flags
- See Also:
-
getStereo2
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.See
getStereo2(chemaxon.struc.MolAtom, int, int, chemaxon.struc.MolAtom)
for detailed examples.- 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:
-
removeBond
Removes a bond by reference.- Parameters:
bond
- the bondcleanupFlags
- extra clean-up methods- Since:
- Marvin 3.1
- See Also:
-
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:
-
regenBonds
public void regenBonds()Regenerates the bond vector: remove its elements, then put the bond objects from the atoms into it. -
isolate
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
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
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.useMolAtom.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.For internal use only.Gets 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
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:
-
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:
-
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:
-
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:
-
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
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
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
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
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
Gets the index of the specified atom.- Parameters:
atom
- the atom- Returns:
- the index, or -1 if not found
- Since:
- Marvin 2.7
-
indexOf
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:
-
findAtom
Finds an atom in the atoms array.- Returns:
- the atom index or -1 if not found
-
findBond
Finds a bond in the bonds array.- Returns:
- the bond index or -1 if not found
-
contains
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
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:
-
contains
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
Gets all "submolecules".- Since:
- Marvin 4.1.2
- See Also:
-
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
Gets all "submolecules".- Parameters:
m
- the output arrayoff
- offset- Since:
- Marvin 4.1.2
- See Also:
-
addAtomsAndBondsTo
Adds all atoms and bonds to the specified molecule.- Parameters:
s
- the selection molecule- Since:
- Marvin 4.1, 11/25/2005
-
hasExplicitLonePairs
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public boolean hasExplicitLonePairs()Deprecated, for removal: This API element is subject to removal in a future version.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(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public boolean clean(int dim, String opts) Deprecated, for removal: This API element is subject to removal in a future version.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(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public boolean partialClean(Molecule[] template, String opts) Deprecated, for removal: This API element is subject to removal in a future version.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(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public boolean partialClean(MoleculeGraph template, int[] map, String opts) Deprecated, for removal: This API element is subject to removal in a future version.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(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public boolean partialClean(int dim, int[] fixed, String opts) Deprecated, for removal: This API element is subject to removal in a future version.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(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public boolean clean(int dim, String opts, MProgressMonitor pmon) Deprecated, for removal: This API element is subject to removal in a future version.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:
-
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:
-
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:
-
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:
-
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:
-
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
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:
-
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
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.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:
-
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:
-
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
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
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:
-
getVisibleCoords
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
Saves caches like connection table, bond table, etc.- Since:
- Marvin 3.4
-
restoreCache
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, for removal: This API element is subject to removal in a future version.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:
-
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:
-
arrangeComponents
Deprecated, for removal: This API element is subject to removal in a future version.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:
-
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:
-
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
For internal use only.- Since:
- Marvin 4.1.13, 09/19/2007
- See Also:
-
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
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(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public <C extends MoleculeGraph> C[] findFrags(Class<C> cl) Deprecated, for removal: This API element is subject to removal in a future version.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
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:
- Merge only fragmented multicenter S-groups (see
-
findComponentIds
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public final int[] findComponentIds()Deprecated, for removal: This API element is subject to removal in a future version.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, for removal: This API element is subject to removal in a future version.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
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:
-
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:
-
regenGearch
protected final void regenGearch()Recreate graph search results object. -
findFrag
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public final void findFrag(int i, MoleculeGraph frag) Deprecated, for removal: This API element is subject to removal in a future version.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
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:
-
findFragById
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:
-
findBasicFrags
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 like
getFragCount()
! 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:
-
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:
-
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 see
setValenceCheckOptions(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
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:
-
setValenceCheckState
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public void setValenceCheckState(MoleculeGraph.ValenceCheckState state) Deprecated, for removal: This API element is subject to removal in a future version.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(ValenceCheckOptions.GLOBAL);
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
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public MoleculeGraph.ValenceCheckState getValenceCheckState()Deprecated, for removal: This API element is subject to removal in a future version.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
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:
-
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:
-
isLargeMolecule
public boolean isLargeMolecule()Returnstrue
if large molecule (number of atoms exceeds1000
).- Returns:
true
if large molecule
-
getFreeAttachmentPoints
Returns the number of the free attachment points for the given atom.- Specified by:
getFreeAttachmentPoints
in interfaceMoleculeWithValence<MolAtom>
- Parameters:
atom
- the atom- Returns:
- the number of the free attachment points or
0
if the atom is not located in any SuperatomSgroup - Since:
- Marvin 5.11
-
getPossibleAttachmentPoints
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) protected int getPossibleAttachmentPoints(MolAtom molAtom) Deprecated, for removal: This API element is subject to removal in a future version.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:
-
getAtomReferenceList
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public List<MolAtom> getAtomReferenceList()Deprecated, for removal: This API element is subject to removal in a future version.Useatoms()
instead.- Since:
- Marvin 5.11
-
getLigandCount
Gets the number of ligands of the given atom.- Specified by:
getLigandCount
in interfaceMoleculeWithValence<MolAtom>
- Parameters:
atom
- the atom- Returns:
- number of ligands
- Since:
- Marvin 5.11
-
getLigand
Gets the n-th ligand of the given atom.- Specified by:
getLigand
in interfaceMoleculeWithValence<MolAtom>
- Parameters:
atom
- the atomn
- index- Returns:
- the n-th ligand
- Since:
- Marvin 5.11
-
getLigandBondType
Gets the type of the n-th ligand bond of the given atom.- Specified by:
getLigandBondType
in interfaceMoleculeWithValence<MolAtom>
- Parameters:
atom
- the atomi
- index- Returns:
- the bond type
- Since:
- Marvin 5.11
-
getLigandAtno
Gets the atomic number of the n-th ligand of the given atom.- Specified by:
getLigandAtno
in interfaceMoleculeWithValence<MolAtom>
- Parameters:
atom
- the atomn
- index- Returns:
- the atomic number
- Since:
- Marvin 5.11
-
getCharge
Gets the charge of the given atom.- Specified by:
getCharge
in interfaceMoleculeWithValence<MolAtom>
- Parameters:
atom
- the atom- Returns:
- the charge
- Since:
- Marvin 5.11
-
getAtomicNumber
Gets the atomic number of the given atom.- Specified by:
getAtomicNumber
in interfaceMoleculeWithValence<MolAtom>
- Parameters:
atom
- the atom- Returns:
- the atomic number
- Since:
- Marvin 5.11
-
getRadicalCount
Gets the number of free electrons of the given atom.- Specified by:
getRadicalCount
in interfaceMoleculeWithValence<MolAtom>
- Parameters:
atom
- the atom- Returns:
- the number of free electrons
- Since:
- Marvin 5.11
-
getValenceProperty
Gets the valence property of the given atom.- Specified by:
getValenceProperty
in interfaceMoleculeWithValence<MolAtom>
- Parameters:
atom
- the atom- Returns:
- the valence or -1 if not set
- Since:
- Marvin 5.11
-
getImplicitHCount
Gets the number of implicit hydrogens attached to the given atom.- Specified by:
getImplicitHCount
in interfaceMoleculeWithValence<MolAtom>
- Parameters:
atom
- the atom- Returns:
- the number of implicit hydrogens
- Since:
- Marvin 5.11
-
isAtomInRing
Checks whether the atom is in ring.- Specified by:
isAtomInRing
in interfaceMoleculeWithValence<MolAtom>
- Parameters:
atom
- the atom reference- Returns:
- true if the atom is in ring, false otherwise
- Since:
- Marvin 5.11
-
isAcceptedSpecialLigand
Check if the ligand is a special atom which changes the ring atom column number with -1- Specified by:
isAcceptedSpecialLigand
in interfaceMoleculeWithValence<MolAtom>
- Parameters:
atom
- ligand- Returns:
- true if the ligand modifies the reference atom column number with -1 else false.
- Since:
- Marvin 5.11
-
isBondParallelWith
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
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
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
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
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
Sets the given molecule as the supergraph of this graph.- Parameters:
molecule
- the molecule- Since:
- Marvin 14.7.7, Jul 2, 2014
-
atoms
Provides an unmodifiable 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 interfaceMoleculeWithValence<MolAtom>
- Returns:
- a dynamic list view of the atoms
-
bonds
Provides an unmodifiable 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().
-
setValenceCheckOptions(ValenceCheckOptions)
andValenceCheckOptions
.