Class Molecule
- All Implemented Interfaces:
MoleculeWithValence<MolAtom>
,chemaxon.core.structure.MoleculeForBuilder
,chemaxon.struc.MObjectContainer
,MTransformable
,StereoConstants
,Serializable
- Direct Known Subclasses:
RgMolecule
,RxnMolecule
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class chemaxon.struc.MoleculeGraph
MoleculeGraph.ValenceCheckState
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Do not ungroup and do not expand S-group's children.static final int
Ungroup and expand (if possible) the child S-groups.static final int
Remove atoms from S-groups.static final int
Remove S-groups of removed superatoms.protected static final int
Remove S-group's children and remove S-group from its parent.protected static final int
Do not remove S-group's children.protected static final int
Do not remove central atom of multicenter S-groups.protected static final int
Do not remove S-group from its parent.Fields inherited from class chemaxon.struc.MoleculeGraph
AROM_AMBIGUOUS, AROM_BASIC, AROM_CHUCKEL, AROM_GENERAL, AROM_LOOSE, AROM_SUBSTRUCTURE, atomCount, AUTO_UNGROUP, bondCount, btab, CACHE_REMOVE_ALL, CACHE_REMOVE_AROMATAMODULE, CACHE_REMOVE_CACHEMEMORY, CACHE_REMOVE_GRINVMODULE, CACHE_REMOVE_PARITYMODULE, CACHE_REMOVE_SSSRMODULE, CACHE_REMOVE_TABS, cacheMemory, ctab, DEAROM_GENERAL, DEAROM_HUCKELCHECK, DEAROM_HUCKELCHECK_EX, DIM_MASK, FRAG_BASIC, FRAG_KEEPING_MULTICENTERS, FRAG_KEEPING_SGROUPS, FRAG_TYPE_COUNT, gearch, GRINV_DONT_STORE, GRINV_NOHYDROGEN, GRINV_OLDSTEREO, GRINV_STEREO, GRINV_USEMAPS, GRINV_VALUE_OPTIONS, grinvCC, INITIAL_CAPACITY, INVALID_LINKNODE_MESSAGE, MIN_RING_SIZE_FOR_TRANS_DB, OMIT_POSTCLEAN, orix, oriy, oriz, parentGraph, propertyContainer, RMCLEANUP_ALL, RMCLEANUP_EDGES, RMCLEANUP_FIXCOMPONENT, RMCLEANUP_MOBJECT, RMCLEANUP_NONE, RMCLEANUP_PARENTDOC, RMCLEANUP_STEREO, superGraph, theAtoms, theBonds, useOnlyFirstAtomInStereoCalculation, VALENCE_CHECK, VALENCE_CHECK_AMBIGUOUS
Fields inherited from interface chemaxon.struc.StereoConstants
ANTI, ATOMSTEREO_EITHER, ATOMSTEREO_MASK, ATOMSTEREO_NONE, ATOMSTEREO_SPECIFIC, CHIRALITY_M, CHIRALITY_MASK, CHIRALITY_P, CHIRALITY_r, CHIRALITY_R, CHIRALITY_s, CHIRALITY_S, CHIRALITYSUPPORT_ALL, CHIRALITYSUPPORT_ALL_POSSIBLE, CHIRALITYSUPPORT_NONE, CHIRALITYSUPPORT_SELECTED, CIS, CIS_TRANS, CTUMASK, CTUNKNOWN, CTUNSPEC, DBS_ALL, DBS_MARKED, DBS_NONE, ENDO, EXO, PARITY_ALLENE, PARITY_EITHER, PARITY_EVEN, PARITY_MASK, PARITY_NONE, PARITY_ODD, PARITY_TETRAHEDRAL, PARITY_UNSPEC, STGRP_ABS, STGRP_AND, STGRP_NONE, STGRP_OR, SYN, TRANS
-
Constructor Summary
ConstructorDescriptionMolecule()
Construct a 2 dimensional molecule.Construct a molecule or fragment with the specified number of atoms and bonds.Construct a molecule consisting of a single atom (node).Construct a molecule consisting of a single bond (edge). -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a bond to the molecule.protected void
Adds an atom.protected void
addAtomToFragment
(MolAtom atom) Adds an atom to a fragment.protected void
Adds a bond.void
Adds an S-group to this object.protected final void
addSgroupClones
(Molecule originalParent, Molecule originalChild, Molecule newChild) Adds the S-groups of a child molecule clone to the new parent molecule clone.protected final void
Adds S-groups to this object and its parent.void
aromatize
(int method) Aromatizes molecule.void
aromatize
(int method, boolean checkAmbiguity) Aromatizes molecule.double
Calculate the regular bond length for the unified structure.boolean
Tests whether an object of this class can be a reaction component.void
Deprecated, for removal: This API element is subject to removal in a future version.protected void
Checks the internal consisitency of S-groups.void
clear()
Clears the molecule.void
Clears extra atom labels.void
clearForImport
(String format) Initializes molecule for import.void
void
Clears RDfile/SDfile properties.clone()
Makes 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 and bonds of this molecule to another one.void
Makes another molecule identical to this one.protected void
Copies the all the contents except the S-groups into another molecule object.void
Deprecated.as of Marvin 6.3.
Not supported feature.Deprecated, for removal: This API element is subject to removal in a future version.as of Marvin 2014.09.01.0 useclone()
insteadMakes an identical copy of the molecule and its document.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.final boolean
Contracts all S-groups.final boolean
contractSgroups
(int opts) Contracts all S-groups.final Molecule[]
Converts this molecule to its disconnected fragments, expanding all S-groups and keeping disconnected Multicenter S-groups in the same fragment, but ungroupping and separating fragments in all other types of S-groups.final int
Counts the expandable and contractable S-groups.final int
Counts the ordered component S-groups.protected chemaxon.struc.gearch.MoleculeGraphGearch
boolean
Dearomatize molecule.void
endReuse
(int n) End reusing atoms.final boolean
Expands all S-groups.final boolean
expandSgroups
(int opts) Expands all S-groups.final byte[]
exportToBinFormat
(String fmt) Deprecated, for removal: This API element is subject to removal in a future version.As of Marvin 5.7, replaced byMolExporter.exportToBinFormat(Molecule, String)
.final String
exportToFormat
(String fmt) Deprecated, for removal: This API element is subject to removal in a future version.As of Marvin 5.7, replaced byMolExporter.exportToFormat(Molecule, String)
.exportToObject
(String fmt) Deprecated, for removal: This API element is subject to removal in a future version.As of Marvin 5.7, replaced byMolExporter.exportToObject(Molecule, String)
.protected void
Adds all atoms and bonds to the specified molecule.Sgroup[]
Finds all smallest S-groups containing the specified atom.Gets the containing multicenter S-group of a multicenter atom.final Sgroup
Finds an expanded residue.final Sgroup
Finds a contracted residue.final SelectionMolecule[]
Determines the disconnected fragments and puts them into an array.<C extends MoleculeGraph>
C[]Determines the disconnected fragments and puts them into an array.final Sgroup
Finds the largest S-group that contains the specified atom.final Sgroup
Finds the smallest S-group related to the specified atom.final Sgroup
Finds the smallest S-group that contains the specified atom.protected boolean
Fix a property containing reference to the molecule.protected void
fuse0
(MoleculeGraph graph, boolean check) Adds those atoms and bonds of a molecule graph to this one that are not already elements.protected MolBond[]
Returns the bonds attached to the given atom.Gets the comment.long
Gets the end position of this molecule in the input file.protected final SelectionMolecule
Gets a selection molecule containing all the atoms and bonds.getId()
final String
Gets the input file format.protected Molecule
Gets the simplified molecule object even if there is a parent document with other objects.getName()
Gets the molecule name/title that was set bysetName(String)
.int
getProperty
(String key) Deprecated, for removal: This API element is subject to removal in a future version.As of Marvin 5.7, this method is deprecated.int
Gets the total number of RDfile/SDfile properties.getPropertyKey
(int i) Gets an RDfile/SDfile property key.Enumeration<?>
Deprecated, for removal: This API element is subject to removal in a future version.As of Marvin 4.1, replaced byproperties()
.getKeys()
andproperties()
.getKeyEnumeration()
.
One-to-one replacement is methodgetKeyEnumeration()
but methodgetKeys()
is simpler to use.getPropertyObject
(String key) Gets an RDfile/SDfile property object.final Sgroup[]
Gets root s-groups (groups that are not embedded into another s-group).final Sgroup
getSgroup
(int i) Gets an S-group.final Sgroup[]
Gets the array of S-groups.final int
Gets the number of S-groups.Returns an iterator over the s-groups in this molecule in proper sequence.MolAtom[]
Gets the S-group's ligands if the structure represents an S-group.final Molecule
Gets the simplified molecule object.final Sgroup[]
Gets the sorted S-groups in parent-child order.long
Gets the starting position of this molecule in the input file.double[]
Returns the coordinates of the given atom (contained in the molecule).boolean
Tests whether the molecule graph has atom sets.boolean
Tests if the molecule has contracted S-groups or not.boolean
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:final int
Gets the array index of an S-group.boolean
isEmpty()
Tests whether the molecule is empty.final boolean
isExpandable
(int opts) Tests if the molecule is expandable with the specified options.final boolean
Deprecated.as of Marvin 6.2 replaced byhasContractedSgroup()
boolean
Checks if the structure represents a reaction or not.boolean
isSgroup()
Deprecated, for removal: This API element is subject to removal in a future version.As of Marvin 14.7.7, no replacement.
Not supported feature.protected void
Copies some properties of this molecule to the other one specified as argument.void
mergeAtoms
(MolAtom that, MolAtom node) 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.Creates a new Molecule object.Creates a new SelectionMolecule object appropriate for storing selection from this molecule.void
rearrangeSgroups
(int[] newIndexes) Orders S-groups in the vector of S-groups in the given order corresponding to the given new indexes.void
Removes all the atoms and bonds.void
Removes all bonds.protected void
Removes all S-groups.void
removeAtom
(int i, int cleanupFlags) Removes an atom and its bonds by index.void
removeAtom
(MolAtom atom, int cleanupFlags) Removes an atom and its bonds by reference.protected void
removeAtomFromChildren
(Sgroup sgroup, MolAtom atom) Removes the parameter atom from the parameter S-group and it's descendants.protected void
removeBond
(int i, int cleanupFlags) Removes a bond by index.protected void
removeBond
(MolBond bond, int cleanupFlags) Removes a bond by reference.void
removeObject
(MObject mo) protected void
Removes an S-group from the sgroupVector.protected final void
Removes S-groups from this object and its parent.protected final void
removeSgroupsOf
(Molecule m, int rmflags) Removes S-groups that are contained in a given molecule but not contained in another molecule.protected final void
Change parents of all S-groups in this molecule.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
replaceSgroup
(Sgroup sgroup, Sgroup newSgroup) Replaces an S-group with a new sgroup in the molecule.static String
residueSymbolOf
(int id) Gets the name of a residue.static int
residueTypeOf
(String name) Gets the residue identifier for a residue name.reuseAtom
(int z, int i) Reuse an atom or create a new one.void
selectAllObjects
(boolean s) protected void
Sets the atom at the specified index.void
setComment
(String s) Sets the comment.void
setDim
(int d) Sets the dimension.void
setEndPosition
(long off) Sets the end position of this molecule in the input file.final void
setGUIContracted
(boolean contract) Deprecated.as of Marvin 6.2, useexpandSgroups(int)
orcontractSgroups(int)
instead with option parameterExpandable.LEAVE_COORDS_UNCHANGED
final void
setGUIContracted
(boolean contract, int opts) Deprecated.as of Marvin 6.2, useexpandSgroups(int)
orcontractSgroups(int)
instead with option parameterExpandable.LEAVE_COORDS_UNCHANGED
void
void
setInputFormat
(String format) Sets the input file format.void
Sets the molecule name/title.void
setProperty
(String key, String value) Sets an RDfile/SDfile property.void
setPropertyObject
(String key, Object value) Sets an RDfile/SDfile property object.void
setSgroupParent
(MolAtom a, Sgroup sg, boolean set) Sets or unsets an S-group as a parent of an atom.void
setStartPosition
(long off) Sets the starting position of this molecule in the input file.void
Deprecated, for removal: This API element is subject to removal in a future version.As of Marvin 5.12, no replacement.
Crossing bonds of aSuperatomSgroup
do not need to be sorted any more.final byte[]
toBinFormat
(String fmt) Deprecated, for removal: This API element is subject to removal in a future version.Replaced byMolExporter.toBinFormat(Molecule, String)
.final String
Deprecated, for removal: This API element is subject to removal in a future version.Replaced byMolExporter.toFormat(Molecule, String)
.Deprecated, for removal: This API element is subject to removal in a future version.Replaced byMolExporter.toObject(Molecule, String)
.void
transform
(CTransform3D t, boolean incg) Apply a transformation matrix to the atomic coordinates and Data Sgroup coordinates.final boolean
ungroupSgroup
(int i) Deprecated, for removal: This API element is subject to removal in a future version.as of Marvin 6.3.final boolean
ungroupSgroup
(int i, int opts) Deprecated.as of Marvin 6.3.final boolean
ungroupSgroup
(Sgroup sg) Ungroups the specified S-group and expands it if it is an Expandable S-group.final boolean
ungroupSgroup
(Sgroup sg, int opts) Expand and ungroup the specified S-group.final boolean
Expands and ungroups all S-groups.final boolean
ungroupSgroups
(int type) Deprecated, for removal: This API element is subject to removal in a future version.as of Marvin 6.3.final boolean
ungroupSgroups
(EnumSet<SgroupType> types) Ungroups all S-groups of the specified types in this molecule.Methods inherited from class chemaxon.struc.MoleculeGraph
add, add, addAtomsAndBondsTo, addAtomWithoutChangingIt, addBondWithoutChangingIt, addExplicitHydrogens, addExplicitHydrogens, addExplicitLonePairs, addSimpleAtomWithoutChangingIt, adjustMultiChiralFlag, aromatize, aromatize, arrangeComponents, atoms, bonds, calcCenter, calcCenter, calcDehydrogenizedGrinv, calcHeight, calcHybridization, calcOutRect, calcOutRect, calcOutRectCenter, calcOutRectCenter, calcWidth, canBeCT, canBeCT, canBeCT, checkBondConsistency, clean, clean, clearCachedInfo, clonecopyMoleculeGraphWithoutSgroups, contains, contains, createDehydrogenizedReadOnlyGraph, createSmolecule, dearomatize, findAtom, findAtomClone, findBasicFrags, findBond, findComponentIds, findComponentIds, findFrag, findFrag, findFragById, findFrags, findInArray, fixProperties, fuse, fuse, getAromaticAndAliphaticRings, getAtom, getAtomArray, getAtomCount, getAtomCount, getAtomicNumber, getAtomIterator, getAtomReferenceList, getBond, getBondArray, getBondCount, getBondIterator, getBondTable, getCharge, getChirality, getCSSR, getCSSRIdxesForAtoms, getCtab, getDesiredLength, getDesiredLength, getDim, getDocument, getDocumentForChild, getEnclosingCube, getExactMass, getExplicitHcount, getExplicitLonePairCount, getEZStereo, getFlags, getForefather, getFormalCharge, getFormula, getFragCount, getFragCount, getFragIds, getFreeAttachmentPoints, getGraphUnion, getGrinv, getGrinv, getGrinv, getGrinv, getGrinvCC, getGrinvOptions, getImplicitHcount, getImplicitHCount, getLigand, getLigandAtno, getLigandBondType, getLigandCount, getLocalParity, getLocation, getLock, getLonePairCount, getMass, getMaxRgroupAttachmentPointOrder, getParent, getParentDocument, getParity, getParityType, getPoints, getPossibleAttachmentPoints, getRadicalCount, getSmallestRingSizeForIdx, getSSSR, getSSSRBonds, getSSSRBondsAsBitSet, getSSSRBondSet, getSSSRBondSetInLong, getSSSRIdxesForAtoms, getStereo2, getStereo2, getStereo2, getStereo2, getStereo2, getStereo2, getStereo2, getSubGraphCount, getSubGraphs, getSubGraphs, getTotalCharge, getValenceCheckOptions, getValenceCheckState, getValenceProperty, hasBondSet, hasExplicitLonePairs, hasExtraLabelSet, hasImplicitH, hasSelfReferringProperty, hasValenceError, hydrogenize, implicitizeHydrogens, implicitizeHydrogens, implicitizeHydrogens, incGrinvCC, incGrinvCC, incGrinvCCOnly, indexOf, indexOf, insertAtom, insertBond, insertBondInOrder, insertNullAtoms, insertNullBonds, isAbsStereo, isAcceptedSpecialLigand, isAtom, isAtomInRing, isBond, isBondParallelWith, isGrinvCCValid, isLargeMolecule, isMolecule, isMultiChiral, isolate, isolate, isOnlyFirstAtomInStereoCalculation, isQuery, isRealAtomParent, isRing, isRingBond, isSelfReference, isSimilarTo, isSymmetric, isValenceCheckEnabled, isValidLinkNode, mergeFrags, moveTo, pack, partialClean, partialClean, partialClean, properties, qpropCheck, regenBonds, regenBtab, regenCtab, regenGearch, removeAtom, removeAtom, removeBond, removeBond, removeExplicitLonePairs, removeIsolatedAtoms, removeIsolatedBonds, replaceBond, resetCtab, resetGrinvInParents, restoreCache, revalidateCoordDependentProps, saveCache, setAbsStereo, setAtom, setAtomSetSeqs, setBond, setBondSetSeqs, setChirality, setChirality, setFlags, setFlags, setGrinvCC, setGrinvOptions, setLinkNodeDefaultOuters, setLocalParity, setLocalParity, setLocation, setParity, setParity, setParity, setSupergraph, setValenceCheckEnabled, setValenceCheckOptions, setValenceCheckState, smol, sortBondsAccordingTo, stereoClean, sumConservedQuantities, toString, transform, updateDim, useOnlyFirstAtomInStereoCalculation, valenceCheck, valenceCheck
-
Field Details
-
RMCLEANUP_SGROUPATOMS
public static final int RMCLEANUP_SGROUPATOMSRemove S-groups of removed superatoms.- Since:
- Marvin 4.1, 07/27/2006
- See Also:
-
RMCLEANUP_FROMSGROUPS
public static final int RMCLEANUP_FROMSGROUPSRemove atoms from S-groups. The S-groups, which contain the atoms, are not removed from the molecule. The S-group removal is performed automatically only when all represented atoms were deleted from the S-group graph and the S-group graph is empty.- Since:
- Marvin 4.1, 07/27/2006
- See Also:
-
RMSG_DEFAULT
protected static final int RMSG_DEFAULTRemove S-group's children and remove S-group from its parent.- Since:
- Marvin 5.0, 03/27/2007
- See Also:
-
RMSG_KEEP_CHILDREN
protected static final int RMSG_KEEP_CHILDRENDo not remove S-group's children.- Since:
- Marvin 5.0, 03/27/2007
- See Also:
-
RMSG_KEEP_PARENT
protected static final int RMSG_KEEP_PARENTDo not remove S-group from its parent.- Since:
- Marvin 5.0, 03/27/2007
- See Also:
-
RMSG_KEEP_MULTICENTER
protected static final int RMSG_KEEP_MULTICENTERDo not remove central atom of multicenter S-groups.- Since:
- Marvin 5.0, 10/22/2007
- See Also:
-
RECURSIVE_UNGROUP
public static final int RECURSIVE_UNGROUPUngroup and expand (if possible) the child S-groups.- Since:
- Marvin 5.1, 06/05/2008
- See Also:
-
DEFAULT_UNGROUP
public static final int DEFAULT_UNGROUPDo not ungroup and do not expand S-group's children.- Since:
- Marvin 5.1, 06/05/2008
- See Also:
-
-
Constructor Details
-
Molecule
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
-
Molecule
Construct a molecule consisting of a single atom (node).- Parameters:
p
- the parent structurea
- the atom
-
Molecule
Construct a molecule consisting of a single bond (edge).- Parameters:
p
- the parent structureb
- the bond
-
Molecule
public Molecule()Construct a 2 dimensional molecule.
-
-
Method Details
-
setDim
public void setDim(int d) Sets the dimension.- Overrides:
setDim
in classMoleculeGraph
- Parameters:
d
- 0, 2, or 3- See Also:
-
clear
public void clear()Clears the molecule.- Overrides:
clear
in classMoleculeGraph
- See Also:
-
clearForImport
Initializes molecule for import.- Overrides:
clearForImport
in classMoleculeGraph
- Parameters:
format
- input file format- Since:
- Marvin 2.7
- See Also:
-
getStartPosition
public long getStartPosition()Gets the starting position of this molecule in the input file.- Returns:
- the starting position
-
setStartPosition
public void setStartPosition(long off) Sets the starting position of this molecule in the input file.- Parameters:
off
- the starting position
-
getEndPosition
public long getEndPosition()Gets the end position of this molecule in the input file.- Returns:
- the end position
-
setEndPosition
public void setEndPosition(long off) Sets the end position of this molecule in the input file.- Parameters:
off
- the end position
-
getName
Gets the molecule name/title that was set bysetName(String)
.- Overrides:
getName
in classMoleculeGraph
- Returns:
- the molecule name or an empty string
- Since:
- Marvin 2.7
-
setName
Sets the molecule name/title.- Parameters:
s
- the molecule name, empty string or null (null is equivalent to empty string)- Since:
- Marvin 2.7
-
getComment
Gets the comment.- Returns:
- the comment or empty string
- Since:
- Marvin 2.9
-
setComment
Sets the comment.- Parameters:
s
- the comment, empty string or null (null is equivalent to empty string)- Since:
- Marvin 2.9
-
getId
-
setId
-
hasId
-
getInputFormat
Gets the input file format. Set by the import module if the molecule is from a file.- Returns:
- "mrv", "mol", "mol:V3", "csmol", "sdf", "cssdf", "rdf", "csrdf", "smiles", "sybyl", "mol2", "pdb", "xyz" or "cube" or "inchi" or null if not imported from any format
- Since:
- Marvin 2.7
-
setInputFormat
Sets the input file format.- Parameters:
format
- the input format- Since:
- Marvin 2.7
- See Also:
-
clearProperties
public void clearProperties()Clears RDfile/SDfile properties. -
getPropertyCount
public int getPropertyCount()Gets the total number of RDfile/SDfile properties.- Returns:
- number of properties
- Since:
- Marvin 2.7
-
getPropertyKeys
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public Enumeration<?> getPropertyKeys()Deprecated, for removal: This API element is subject to removal in a future version.As of Marvin 4.1, replaced byproperties()
.getKeys()
andproperties()
.getKeyEnumeration()
.
One-to-one replacement is methodgetKeyEnumeration()
but methodgetKeys()
is simpler to use. -
getPropertyKey
Gets an RDfile/SDfile property key.- Parameters:
i
- property index- Returns:
- the property name
- Since:
- Marvin 2.7
-
getProperty
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public String getProperty(String key) Deprecated, for removal: This API element is subject to removal in a future version.As of Marvin 5.7, this method is deprecated. Replaced byMPropHandler.getPropertyString(MoleculeGraph, String)
.
Usage:String property = MPropHandler.getPropertyString(mol, key);
Gets an RDfile/SDfile property.- Parameters:
key
- property name- Returns:
- the value of the property, or null if the key is not found
-
getPropertyObject
Gets an RDfile/SDfile property object.- Parameters:
key
- property name- Returns:
- the value of the property, or null if the key is not found
- Since:
- Marvin 3.1.2
-
setProperty
Sets an RDfile/SDfile property. Setting null value removes the property.- Parameters:
key
- the property namevalue
- the value or null
-
setPropertyObject
Sets an RDfile/SDfile property object. Setting null value removes the property.- Parameters:
key
- the property namevalue
- the value or null- Since:
- Marvin 3.1.2
-
residueTypeOf
Gets the residue identifier for a residue name.- Parameters:
name
- residue name- Returns:
- the residue type
-
residueSymbolOf
Gets the name of a residue.- Parameters:
id
- the residue identifier- Returns:
- the residue symbol
-
setAtom0
Sets the atom at the specified index. Overridden because Sgroups must be set correctly in RgMolecule.clone() and RxnMolecule.clone().- Overrides:
setAtom0
in classMoleculeGraph
- Parameters:
i
- the atom indexnewAtom
- the atom
-
removeAtom
Removes an atom and its bonds by reference. This method is for internal use only. UseMoleculeGraph.removeAtom(MolAtom)
instead unless you are sure what you are doing.- Overrides:
removeAtom
in classMoleculeGraph
- Parameters:
atom
- the atomcleanupFlags
- extra clean-up methods- Since:
- Marvin 3.1
- See Also:
-
removeAtom
public void removeAtom(int i, int cleanupFlags) Removes an atom and its bonds by index. This method is for internal use only. UseMoleculeGraph.removeAtom(MolAtom)
instead unless you are sure what you are doing.- Overrides:
removeAtom
in classMoleculeGraph
- Parameters:
i
- the atom indexcleanupFlags
- extra clean-up methods- Since:
- Marvin 3.1
- See Also:
-
removeBond
Removes a bond by reference.- Overrides:
removeBond
in classMoleculeGraph
- 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.- Overrides:
removeBond
in classMoleculeGraph
- Parameters:
i
- the bond indexcleanupFlags
- extra clean-up methods- Since:
- Marvin 3.1
- See Also:
-
removeAllBonds
public void removeAllBonds()Removes all bonds.- Overrides:
removeAllBonds
in classMoleculeGraph
-
removeAll
public void removeAll()Removes all the atoms and bonds.- Overrides:
removeAll
in classMoleculeGraph
-
isEmpty
public boolean isEmpty()Tests whether the molecule is empty.- Overrides:
isEmpty
in classMoleculeGraph
- Returns:
true
if the molecule graph does not contain any atoms, bonds or non-empty S-groups,false
otherwise- Since:
- Marvin 4.1.1, 09/06/2006
-
aromatize
public void aromatize(int method) Aromatizes molecule.- Overrides:
aromatize
in classMoleculeGraph
- Parameters:
method
- Specifies the algorithm for aromatization.- Throws:
SecurityException
- cannot load module because of a security problem (firewall)- See Also:
-
aromatize
public void aromatize(int method, boolean checkAmbiguity) Aromatizes molecule.- Overrides:
aromatize
in classMoleculeGraph
- Parameters:
method
- Specifies the algorithm for aromatization.checkAmbiguity
- Specifies whether ANY bonds should be considered during aromatization.- Throws:
SecurityException
- cannot load module because of a security problem (firewall)- See Also:
-
dearomatize
public boolean dearomatize()Dearomatize molecule.- Overrides:
dearomatize
in classMoleculeGraph
- Returns:
- true if success, else false.
- Throws:
SecurityException
- cannot load module because of a security problem (firewall)
-
clonecopy
Makes another molecule identical to this one.- Overrides:
clonecopy
in classMoleculeGraph
- Parameters:
g
- the target molecule
-
fixSelfReferringProperty
Fix a property containing reference to the molecule. Called from clonelesscopy().- Overrides:
fixSelfReferringProperty
in classMoleculeGraph
- Parameters:
prop
- the property- Since:
- Marvin 4.1.6, 02/14/2007
- See Also:
-
addSgroupClones
protected final void addSgroupClones(Molecule originalParent, Molecule originalChild, Molecule newChild) Adds the S-groups of a child molecule clone to the new parent molecule clone.- Parameters:
originalParent
- the original parent moleculeoriginalChild
- the original child moleculenewChild
- the new child molecule (clone of the original)- Since:
- Marvin 3.4
-
clonecopy
Copies the specified atoms and bonds of this molecule to another one.- Overrides:
clonecopy
in classMoleculeGraph
- Parameters:
iatoms
- array of atom indices to copy ornull
g
- the target molecule graph- Since:
- Marvin 5.0.2, 03/11/2008
-
clonecopyWithoutSgroups
Copies the all the contents except the S-groups into another molecule object.- Parameters:
m
- the target molecule- Since:
- Marvin 3.4
-
cloneAtoms
Copies the specified atoms.- Overrides:
cloneAtoms
in classMoleculeGraph
- 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.
-
clonelesscopy
Deprecated.as of Marvin 6.3.
Not supported feature.Copies to selection. Makes another molecule identical to this one, but does not clone atoms, bonds, and the properties.- Overrides:
clonelesscopy
in classMoleculeGraph
- Parameters:
g
- the target molecule object (the selection)
-
cloneMoleculeWithDocument
Makes an identical copy of the molecule and its document. If the molecule does not have a parent, then copies non-molecular data: graphics objects, electron flows, text boxes, atom and bond sets (color, font and thickness). Otherwise (root, rgroup, component molecule) creates a new document.- Returns:
- the copy
- Since:
- Marvin 4.1, 01/16/2006
-
cloneMolecule
Deprecated, for removal: This API element is subject to removal in a future version.as of Marvin 2014.09.01.0 useclone()
insteadMakes an identical copy of the molecule. It also clones the atoms and bonds of the Molecule. Note that it does not clone the correspondingMDocument
, hence the atom and bond formatting (color, font, thickness) is lost.- Returns:
- the copy
- Since:
- Marvin 3.5.1, 11/20/2004
-
clone
Makes an identical copy of the molecule. It also clones the atoms and bonds of the Molecule. Note, that it does not clone the correspondingMDocument
, hence the atom and bond formatting (color, font, thickness) is lost.- Overrides:
clone
in classMoleculeGraph
- Returns:
- the copy
-
toFormat
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public final String toFormat(String fmt) Deprecated, for removal: This API element is subject to removal in a future version.Replaced byMolExporter.toFormat(Molecule, String)
.Creates a string representation of the molecule. The format descriptor string can also contain export options. Format and options are separated by a colon, multiple options can be separated by commas. See the text formats and their options on the File Formats in Marvin page. Examples:s1 = mol.toFormat("mol"); s2 = mol.toFormat("smiles:a-H"); // aromatize and remove Hydrogens
- Parameters:
fmt
- the format descriptor string- Returns:
- string representation of the molecule in the specified format
- Throws:
IllegalArgumentException
- Invalid format string.SecurityException
- Export module cannot be loaded because of security reasons (firewall).
-
exportToFormat
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public final String exportToFormat(String fmt) throws IOException Deprecated, for removal: This API element is subject to removal in a future version.As of Marvin 5.7, replaced byMolExporter.exportToFormat(Molecule, String)
.Creates a string representation of the molecule. Similar totoFormat(String)
, the only difference is that export exceptions are not converted toIllegalArgumentException
.- Parameters:
fmt
- the format descriptor string- Returns:
- string representation of the molecule in the specified format
- Throws:
IOException
MolExportException
- Export errorIllegalArgumentException
- Invalid format string.SecurityException
- Export module cannot be loaded because of security reasons (firewall).- Since:
- Marvin 4.0, 07/01/2005
-
toBinFormat
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public final byte[] toBinFormat(String fmt) Deprecated, for removal: This API element is subject to removal in a future version.Replaced byMolExporter.toBinFormat(Molecule, String)
.Creates a binary representation of the molecule. Works with all the text formats that are supported by thetoFormat
method, and also with the binary image formats (jpeg, msbmp, png). When creating an image, display options can also be specified in the format descriptor string. Format and options are separated by a colon, multiple options can be separated by commas. See the possible formats and their options on the File Formats in Marvin page. Examples:byte[] d1 = mol.toBinFormat("mol"); byte[] d2 = mol.toBinFormat("smiles:a-H"); // aromatize and remove H byte[] d3 = mol.toBinFormat("png:w300,h300,b32,#00ffff00"); byte[] d4 = mol.toBinFormat("jpeg:w300,h300,Q95,#ffff00,spacefill");
- Parameters:
fmt
- the format descriptor string- Returns:
- a binary representation of the molecule in the specified format
- Throws:
IllegalArgumentException
- Invalid format string.SecurityException
- Export module cannot be loaded because of security reasons (firewall).- Since:
- Marvin 2.7.11
-
exportToBinFormat
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public final byte[] exportToBinFormat(String fmt) throws IOException Deprecated, for removal: This API element is subject to removal in a future version.As of Marvin 5.7, replaced byMolExporter.exportToBinFormat(Molecule, String)
.Creates a binary representation of the molecule. Similar totoBinFormat(String)
, the only difference is that export exceptions are not converted toIllegalArgumentException
.- Parameters:
fmt
- the format descriptor string- Returns:
- a binary representation of the molecule in the specified format
- Throws:
MolExportException
- Export errorIllegalArgumentException
- Invalid format string.SecurityException
- Export module cannot be loaded because of security reasons (firewall).IOException
- Since:
- Marvin 4.0, 07/01/2005
-
toObject
Deprecated, for removal: This API element is subject to removal in a future version.Replaced byMolExporter.toObject(Molecule, String)
.Creates a String, byte[] array or Image representation of the molecule. When creating an image, display options can also be specified in the format descriptor string. Format and options are separated by a colon, multiple options can be separated by commas. See the possible formats and their options on the File Formats in Marvin page. Examples:import java.awt.Image; ... String s1 = (String)mol.toObject("mol"); String s2 = (String)mol.toObject("smiles:a-H"); // aromatize, remove H Image img = (Image)mol.toObject("image:w300,h300,#ffff00"); byte[] d3 = (byte[])mol.toObject("png:w300,h300,b32,#00ffff00"); byte[] d4 = (byte[])mol.toObject("jpeg:w300,h300,Q95,#ffff00,spacefill");
- Parameters:
fmt
- the format descriptor string- Returns:
- a String, a byte[] array or an Image
- Throws:
IllegalArgumentException
- Invalid format string.SecurityException
- Export module cannot be loaded because of security reasons (firewall).- Since:
- Marvin 2.8.1
-
exportToObject
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public Object exportToObject(String fmt) throws IOException Deprecated, for removal: This API element is subject to removal in a future version.As of Marvin 5.7, replaced byMolExporter.exportToObject(Molecule, String)
.Creates a String, byte[] array or Image representation of the molecule. Similar totoObject(String)
, the only difference is that export exceptions are not converted toIllegalArgumentException
.- Parameters:
fmt
- the format descriptor string- Returns:
- a String, a byte[] array or an Image
- Throws:
MolExportException
- Export errorIllegalArgumentException
- Invalid format string.SecurityException
- Export module cannot be loaded because of security reasons (firewall).IOException
- Since:
- Marvin 4.0, 07/01/2005
-
reuseAtom
Reuse an atom or create a new one. If an atom is reused, all its properties except the corners are initialized.- Parameters:
z
- the atomic numberi
- the atom index- Returns:
- the atom reference
- Since:
- Marvin 2.6
-
endReuse
public void endReuse(int n) End reusing atoms.- Parameters:
n
- number of atoms- Since:
- Marvin 2.6
-
newInstance
Creates a new Molecule object. The dimension and the origin coordinates will be the same as in the original molecule.- Overrides:
newInstance
in classMoleculeGraph
- Returns:
- a Molecule object
-
newSelectionMolecule
Creates a new SelectionMolecule object appropriate for storing selection from this molecule.- Returns:
- an empty selection molecule
- Since:
- Marvin 4.1, 11/24/2005
-
makeItSimilar
Copies some properties of this molecule to the other one specified as argument. Copies the input format.- Overrides:
makeItSimilar
in classMoleculeGraph
- Parameters:
g
- the molecule to change
-
getSimplifiedMolecule
Gets the simplified molecule object. It returnsthis
usually. In case ofRgMolecule
, it returns the simply modified root structure if there are no R-groups present. In this case theRgMolecule
will be inconsistent. It can simplify the molecule only if there is no parent document containing other objects.- Returns:
- the simplified molecule
- Since:
- Marvin 3.0.1
-
getMostSimplifiedMolecule
Gets the simplified molecule object even if there is a parent document with other objects. It returnsthis
usually. In case ofRgMolecule
, it returns the root structure if there are no R-groups present.- Returns:
this
in the default implementation- Since:
- Marvin 4.1.13, 09/20/2007
-
isReaction
public boolean isReaction()Checks if the structure represents a reaction or not.- Returns:
- false
- Since:
- Marvin 3.0
-
canBeReactionComponent
public boolean canBeReactionComponent()Tests whether an object of this class can be a reaction component. This implementation returnstrue
- Returns:
true
if it can be a reactant, product or agent,false
if adding it to anRxnMolecule
is not supported- Since:
- Marvin 4.1.13, 09/19/2007
-
isSgroup
Deprecated, for removal: This API element is subject to removal in a future version.As of Marvin 14.7.7, no replacement.
Not supported feature.Checks if the structure represents an S-group or not.- Returns:
true
if the structure is an S-group,false
otherwise- Since:
- Marvin 3.0
-
getSgroupLigands
Gets the S-group's ligands if the structure represents an S-group.- Returns:
- the array of ligands if the structure is an S-group with ligands, null otherwise
- Since:
- Marvin 3.0
-
findExpandableSgroup
Finds a contracted residue.- Returns:
- the S-group if found, null if all S-groups are expanded
- Since:
- Marvin 3.0
-
findContractableSgroup
Finds an expanded residue.- Returns:
- the S-group if found, null if all S-groups are contracted
- Since:
- Marvin 3.0
-
getSgroupArray
Gets the array of S-groups.Warning! Expansion or contraction of an S-group in this array may invalidate other array elements. Examples:
- contracting a MultipleSgroup removes any embedded SuperatomSgroup except those inside the repeating unit,
- expanding a MultipleSgroup adds n-1 new clones for each embedded SuperatomSgroup in the repeating unit.
- Returns:
- an array containing all the S-groups
- Since:
- Marvin 3.0
-
getSgroupCount
public final int getSgroupCount()Gets the number of S-groups.- Returns:
- the number of S-groups
- Since:
- Marvin 3.0
-
countExpandableContractableSgroups
public final int countExpandableContractableSgroups()Counts the expandable and contractable S-groups.- Returns:
- the number of expandable/contractable S-groups
- Since:
- Marvin 5.0, 02/28/2007
-
countOrderedComponentSgroups
public final int countOrderedComponentSgroups()Counts the ordered component S-groups.- Returns:
- the number of ordered component S-groups.
- Since:
- Marvin 4.1.6, 02/28/2007
-
getSgroup
Gets an S-group.- Parameters:
i
- S-group index- Since:
- Marvin 3.0
-
getSortedSgroups
Gets the sorted S-groups in parent-child order.Warning! Expansion or contraction of an S-group in this array may invalidate other array elements. Examples:
- contracting a MultipleSgroup removes any embedded SuperatomSgroup except those inside the repeating unit,
- expanding a MultipleSgroup adds n-1 new clones for each embedded SuperatomSgroup in the repeating unit.
- Returns:
- array containing the S-groups
- Since:
- Marvin 3.4, 05/04/2004
-
getRootSgroups
Gets root s-groups (groups that are not embedded into another s-group).- Returns:
- array containing the root s-groups (empty array if there are no s-groups)
- Since:
- Marvin 5.3.3, 31/03/2010
-
sortSgroupXBonds
Deprecated, for removal: This API element is subject to removal in a future version.As of Marvin 5.12, no replacement.
Crossing bonds of aSuperatomSgroup
do not need to be sorted any more. It is not advised to sort them anyway because then the indexes of bonds change in the parent molecule.Sorts superatom S-group crossing bonds in attachment point number order.- Since:
- Marvin 5.0, 12/07/2007
-
indexOf
Gets the array index of an S-group.- Parameters:
sg
- the S-group- Since:
- Marvin 3.0
-
findSgroupOf
Finds the smallest S-group related to the specified atom.- Parameters:
a
- the atom- Returns:
- the S-group or null if not found
- Since:
- Marvin 3.0
-
findSgroupContaining
Finds the largest S-group that contains the specified atom.- Parameters:
a
- the atom- Returns:
- the S-group or null if not found
- Since:
- Marvin 3.0
-
findSmallestSgroupContaining
Finds the smallest S-group that contains the specified atom.- Parameters:
a
- the atom- Returns:
- the S-group or null if not found
- Since:
- Marvin 3.4
-
findAllSgroupContaining
Finds all smallest S-groups containing the specified atom. There can be more groups containing the same atom and not embedding each other because of the data S-groups: they are not in the embedding hierarchy.- Parameters:
a
- the atom- Returns:
- the array of S-groups
- Since:
- Marvin 5.0.1
-
contains
Checks if the molecule graph contains the specified atom. If the atom is not found in the graph, looks in the sgroupgraphs of contracted Expandable-Sgroups.- Overrides:
contains
in classMoleculeGraph
- Parameters:
atom
- the atom- Returns:
- true if the graph or an sgroupgraph contains the object, false otherwise
-
setSgroupParent
Sets or unsets an S-group as a parent of an atom.- Parameters:
a
- the atomsg
- the S-groupset
- set (true) or unset (false)- Throws:
IllegalArgumentException
- molecule does not contain the atom- Since:
- Marvin 3.0
-
reparentSgroups
Change parents of all S-groups in this molecule.- Parameters:
p
- the new parent- Throws:
IllegalArgumentException
- molecule does not contain the atom- Since:
- Marvin 3.0
-
mergeAtoms
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public void mergeAtoms(MolAtom that, MolAtom node) 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 bonds of an atom with another atom, then adds the atom to the molecule.- Overrides:
mergeAtoms
in classMoleculeGraph
- Parameters:
that
- the atomnode
- the other atom
-
addAtom0
Adds an atom.- Overrides:
addAtom0
in classMoleculeGraph
- Parameters:
node
- the atom reference
-
addAtomToFragment
Adds an atom to a fragment. S-groups are added only if all atoms are already in the molecule.- Overrides:
addAtomToFragment
in classMoleculeGraph
- Parameters:
atom
- the atom reference
-
addBond0
Adds a bond.- Overrides:
addBond0
in classMoleculeGraph
- Parameters:
bond
- the bond reference
-
fuse0
Adds those atoms and bonds of a molecule graph to this one that are not already elements.- Overrides:
fuse0
in classMoleculeGraph
- Parameters:
graph
- the 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 moleclue graph is known to be disjoint from this one and this check can be safely skipped- Since:
- Marvin 5.0
-
contractSgroups
public final boolean contractSgroups()Contracts all S-groups.- Returns:
- true if the operation was successful, false if nothing changed
- Since:
- Marvin 3.0
-
contractSgroups
public final boolean contractSgroups(int opts) Contracts all S-groups.- Parameters:
opts
- contraction options- Returns:
- true if the operation was successful, false if nothing changed
- Since:
- Marvin 3.4
- See Also:
-
expandSgroups
public final boolean expandSgroups()Expands all S-groups.- Returns:
- true if the operation was successful, false if nothing changed
- Since:
- Marvin 3.0
- See Also:
-
expandSgroups
public final boolean expandSgroups(int opts) Expands all S-groups.- Parameters:
opts
- expansion options- Returns:
- true if the operation was successful, false if nothing changed
- Since:
- Marvin 3.3
- See Also:
-
isExpandable
public final boolean isExpandable(int opts) Tests if the molecule is expandable with the specified options.- Parameters:
opts
- expansion options- Returns:
- true if an S-group is GUI-contractable, false otherwise
- Since:
- Marvin 4.0.2, 10/26/2005
- See Also:
-
setGUIContracted
Deprecated.as of Marvin 6.2, useexpandSgroups(int)
orcontractSgroups(int)
instead with option parameterExpandable.LEAVE_COORDS_UNCHANGED
S-group expansion or contraction is performed depending on the parametercontract
.
Ifcontract
is set to:false
, then expansion happens to the contracted groups with no coordinate generation.true
, then contraction is performed for those s-groups that were expanded the way that was explained in the previous point.
- Parameters:
contract
- true for contraction, false for expansion- Since:
- Marvin 3.4, 05/04/2004
-
setGUIContracted
Deprecated.as of Marvin 6.2, useexpandSgroups(int)
orcontractSgroups(int)
instead with option parameterExpandable.LEAVE_COORDS_UNCHANGED
S-group expansion or contraction is performed depending on the parametercontract
.
Ifcontract
is set to:false
, then expansion happens to the contracted groups with no coordinate generation.true
, then contraction is performed for those s-groups that were expanded the way that was explained in the previous point.
- Parameters:
contract
- true for contraction, false for expansionopts
- for further expand options- Since:
- Marvin 3.4, 05/04/2004
-
isGUIContracted
Deprecated.as of Marvin 6.2 replaced byhasContractedSgroup()
Tests if the molecule has contracted S-groups or not.- Returns:
- true there is at least one contracted S-group, false otherwise
- Since:
- Marvin 3.4.1, 07/26/2004
-
hasContractedSgroup
public boolean hasContractedSgroup()Tests if the molecule has contracted S-groups or not.- Returns:
- true there is at least one contracted S-group, false otherwise
- Since:
- Marvin 6.2, 2013/09/25
-
ungroupSgroup
Ungroups the specified S-group and expands it if it is an Expandable S-group. Ungroups and expands the child S-groups also if they are Expandable S-groups. Calls a recursive ungroup.- Parameters:
sg
- the S-group- Returns:
- true if the operation was successful, false if nothing changed
- Since:
- Marvin 3.4
- See Also:
-
ungroupSgroup
Expand and ungroup the specified S-group.- Parameters:
sg
- the S-groupopts
- option to specify the ungroup type- Returns:
- true if the operation was successful, false if nothing changed
- Since:
- Marvin 5.1.2
- See Also:
-
ungroupSgroup
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public final boolean ungroupSgroup(int i) Deprecated, for removal: This API element is subject to removal in a future version.as of Marvin 6.3. useungroupSgroup(Sgroup)
instead.Ungroups the specified S-group and expands it if it is an Expandable S-group. Ungroups and expands the child S-groups also if they are Expandable S-groups.- Parameters:
i
- the S-group index- Returns:
- true if the operation was successful, false if nothing changed
- Since:
- Marvin 3.4
- See Also:
-
ungroupSgroups
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public final boolean ungroupSgroups(int type) Deprecated, for removal: This API element is subject to removal in a future version.as of Marvin 6.3. useungroupSgroups(EnumSet)
instead.Ungroups all S-groups of a specified type in this molecule. Performs expand before ungroup if the type is an expandable S-group type.- Parameters:
type
- the S-group type that specifies which S-groups to ungroup.- Returns:
- true if the operation was successful, false if nothing changed.
- Since:
- Marvin 5.2
- See Also:
-
ungroupSgroups
Ungroups all S-groups of the specified types in this molecule. Performs expand before ungroup if a type is an expandable S-group type. NOTE that givingSgroupType.SUPERATOM
as parameter will leave theSgroupType.AMINOACID
typed S-groups in unchanged state while the former method (ungroupSgroups(int)
) ungrouped theAminoAcidSgroups
as well.- Parameters:
types
- the S-group types that specifies which S-group types to ungroup.- Returns:
- true if the operation was successful, false if nothing changed.
- Since:
- Marvin 6.3
- See Also:
-
ungroupSgroup
Deprecated.as of Marvin 6.3. useungroupSgroup(Sgroup)
instead.Ungroups the specified S-group and expands it if it is an Expandable S-group. Ungroups and expands the child S-groups also if they are Expandable S-groups according to the specified option.- Parameters:
i
- the S-group indexopts
- option to specify the ungroup type- Returns:
- true if the operation was successful, false if nothing changed
- Since:
- Marvin 5.1
- See Also:
-
ungroupSgroups
public final boolean ungroupSgroups()Expands and ungroups all S-groups.- Returns:
- true if the operation was successful, false if nothing changed
- Since:
- Marvin 3.0
-
addSgroupsOf
Adds S-groups to this object and its parent. -
removeSgroupsOf
Removes S-groups that are contained in a given molecule but not contained in another molecule.- Parameters:
m
- the molecule whose S-groups are to removermflags
- removal flags- Since:
- Marvin 4.1.7
- See Also:
-
removeSgroupsOf
Removes S-groups from this object and its parent. -
removeAllSgroups
protected void removeAllSgroups()Removes all S-groups. -
removeSgroupFromList
Removes an S-group from the sgroupVector.- Since:
- Marvin 4.1, 07/28/2006
-
rearrangeSgroups
public void rearrangeSgroups(int[] newIndexes) Orders S-groups in the vector of S-groups in the given order corresponding to the given new indexes.- Parameters:
newIndexes
- array of new S-group indexes, ith element of the array contains the new index of the ith s-group in the s-group vector- Throws:
IllegalArgumentException
- if newIndexes are not in the range [0..getSgroupCount()] or not all values in this range are contained.- Since:
- Marvin 5.12, 2012.11.12.
-
addSgroup
Adds an S-group to this object.- Parameters:
sg
- the S-group to add.setparent
- if true then the parent of the S-group is set to this molecule and the S-group is removed from the old parent molecule.- Since:
- Marvin 5.2
-
removeAtomFromChildren
Removes the parameter atom from the parameter S-group and it's descendants. -
getGraphUnionAsSelection
Gets a selection molecule containing all the atoms and bonds. Returns the same object until the unified structure is (or might be) changed, then recreates it.- Returns:
- a selection molecule object containing the unified structure
- Since:
- Marvin 3.0, 11/05/2002
- See Also:
-
bondlength
public double bondlength()Calculate the regular bond length for the unified structure.- Overrides:
bondlength
in classMoleculeGraph
- Returns:
- the regular bond length
-
convertToFrags
Converts this molecule to its disconnected fragments, expanding all S-groups and keeping disconnected Multicenter S-groups in the same fragment, but ungroupping and separating fragments in all other types of S-groups.Warning: Atoms are removed from the original molecule object to the created fragments, therefore the original molecule becomes inconsistent.
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.
- Returns:
- array of fragments
- Since:
- Marvin 3.1
- 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.
If not using the FRAG_KEEPING_SGROUPS option and an S-group would contain more fragments, then it won't be added to any of them, and its parent-child relations with other S-groups will be removed.
Fragmentation is performed depending on fragmentation type:
- Merge only fragmented multicenter S-groups (see
MoleculeGraph.FRAG_KEEPING_MULTICENTERS
) - Merge all types of S-groups (see
MoleculeGraph.FRAG_KEEPING_SGROUPS
) - Keep all fragments separately, do not take into account the S-groups (see
MoleculeGraph.FRAG_BASIC
)
- Overrides:
findFrags
in classMoleculeGraph
- 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
-
findFrags
Determines the disconnected fragments and puts them into an array. Multicenter S-groups are kept in one fragment.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.
- Returns:
- array of fragments
- Since:
- Marvin 3.0
-
fillSelectionMolecule
Adds all atoms and bonds to the specified molecule.- Parameters:
s
- the selection molecule- Since:
- Marvin 3.0, 11/05/2002
-
clearExtraLabels
public void clearExtraLabels()Clears extra atom labels. -
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.- Overrides:
checkConsistency
in classMoleculeGraph
- Throws:
RuntimeException
- if inconsistency found- Since:
- Marvin 5.0, 11/06/2007
-
checkSgroupConsistency
protected void checkSgroupConsistency()Checks the internal consisitency of S-groups.- Throws:
RuntimeException
- if inconsistency found- Since:
- Marvin 5.0, 11/06/2007
-
getVisibleCoords
Returns the coordinates of the given atom (contained in the molecule). If the atom is part of a contracted superatom sgroup, its coordinates may be false, so this method returns the coordinates of the corresponding sgroup atom instead.- Overrides:
getVisibleCoords
in classMoleculeGraph
- Parameters:
ma
- The atom to be queried.- Returns:
- The real coordinates of ma.
- Since:
- Marvin 4.0 8/07/2005
-
transform
Apply a transformation matrix to the atomic coordinates and Data Sgroup coordinates.- Overrides:
transform
in classMoleculeGraph
- Parameters:
t
- the transformation matrixincg
- graph invariants are changed (true) or not (false)- Since:
- Marvin 4.0 2/09/2005
-
findContainingMulticenterSgroup
Gets the containing multicenter S-group of a multicenter atom.- Parameters:
atom
- the multicenter atom.- Returns:
- the containing multicenter S-group, null if none of the multicenter sgroups contains the multicenter atom.
- Since:
- Marvin 5.0 04/20/2007
- See Also:
-
createGearch
protected chemaxon.struc.gearch.MoleculeGraphGearch createGearch()- Overrides:
createGearch
in classMoleculeGraph
-
clearObjects
public void clearObjects()- Specified by:
clearObjects
in interfacechemaxon.struc.MObjectContainer
-
getObjectCount
public int getObjectCount()- Specified by:
getObjectCount
in interfacechemaxon.struc.MObjectContainer
-
removeObject
- Specified by:
removeObject
in interfacechemaxon.struc.MObjectContainer
-
selectAllObjects
public void selectAllObjects(boolean s) - Specified by:
selectAllObjects
in interfacechemaxon.struc.MObjectContainer
-
getAllObjects
- Specified by:
getAllObjects
in interfacechemaxon.struc.MObjectContainer
-
replaceSgroup
Replaces an S-group with a new sgroup in the molecule. Sets parent - child relations of the new sgroup according to the parent - child relations of the old sgroup.- Parameters:
sgroup
- the sgroup to replacenewSgroup
- the sgroup to replace with
-
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);
- Overrides:
implicitizeHydrogens0
in classMoleculeGraph
- Returns:
- true if success else false
-
add
Description copied from class:MoleculeGraph
Adds a bond to the molecule. If the molecule graph is a superGraph, the bond is also added to its endpoints (two MolAtom objects).- Overrides:
add
in classMoleculeGraph
- Parameters:
bond
- the bond object
-
replaceAtom
Replaces the atom on the given index with the parameter atom and removes the parameter atom from its original parent molecule if needed. Sets the sgroup hierarchy.- Overrides:
replaceAtom
in classMoleculeGraph
- Parameters:
i
- the index of the original atomnewAtom
- the atom which will replace the original
-
getBonds
Returns the bonds attached to the given atom.- Overrides:
getBonds
in classMoleculeGraph
- Parameters:
atom
- the atom- Returns:
- the bonds attached to the given atom in this molecule
- Since:
- Marvin 6.2
-
getSgroupIterator
Returns an iterator over the s-groups in this molecule in proper sequence.- Returns:
- an iterator over the s-groups in this molecule in proper sequence
- Since:
- Marvin 6.2, 2013.09.09.
-
connectOriginalBondsToNewAtom
Description copied from class:MoleculeGraph
Sets the original connections to the new atom.- Overrides:
connectOriginalBondsToNewAtom
in classMoleculeGraph
- Parameters:
newAtom
- the atom which replace the originalorig
- the original atombonds
- the original atoms bonds (before any modification)
-
hasAtomSet
public boolean hasAtomSet()Description copied from class:MoleculeGraph
Tests whether the molecule graph has atom sets.- Overrides:
hasAtomSet
in classMoleculeGraph
- Returns:
true
if there are atom sets,false
otherwise
-
Not intended for public use, it was intended only for internal debugging.