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 SummaryNested classes/interfaces inherited from class chemaxon.struc.MoleculeGraphMoleculeGraph.ValenceCheckState
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intDo not ungroup and do not expand S-group's children.static final intUngroup and expand (if possible) the child S-groups.static final intRemove atoms from S-groups.static final intRemove S-groups of removed superatoms.protected static final intRemove S-group's children and remove S-group from its parent.protected static final intDo not remove S-group parent, children and central atom (in the case of multicenter S-groups).protected static final intDo not remove S-group's children.protected static final intDo not remove central atom of multicenter S-groups.protected static final intDo not remove S-group from its parent.Fields inherited from class chemaxon.struc.MoleculeGraphAROM_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_AMBIGUOUSFields inherited from interface chemaxon.struc.StereoConstantsANTI, 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 SummaryConstructorsConstructorDescriptionMolecule()Constructs an empty 2-dimensional molecule.Constructs a molecule or fragment with the specified capacity for storing atoms and bonds.Deprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.useMolecule()andadd(MolBond)
- 
Method SummaryModifier and TypeMethodDescriptionvoidAdds a bond to the molecule.protected voidAdds an atom.protected voidaddAtomToFragment(MolAtom atom) Adds an atom to a fragment.protected voidAdds a bond.voidAdds an S-group to this object.protected final voidaddSgroupClones(Molecule originalParent, Molecule originalChild, Molecule newChild) Adds the S-groups of a child molecule clone to the new parent molecule clone.protected final voidAdds S-groups to this object and its parent.voidaromatize(int method) Aromatizes molecule.voidaromatize(int method, boolean checkAmbiguity) Aromatizes molecule.doubleCalculate the regular bond length for the unified structure.booleanTests whether an object of this class can be a reaction component.voidDeprecated, 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.protected voidChecks the internal consistency of S-groups.voidclear()Clears the molecule.voidClears extra atom labels.voidclearForImport(String format) Initializes molecule for import.voidvoidClears RDfile/SDfile properties.clone()Makes an identical copy of the molecule.protected intcloneAtoms(int[] cnodes, MoleculeGraph graph) Copies the specified atoms.voidclonecopy(int[] iatoms, MoleculeGraph g) Copies the specified atoms and bonds of this molecule to another one.voidMakes another molecule identical to this one.protected voidCopies the all the contents except the S-groups into another molecule object.voidDeprecated.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 voidconnectOriginalBondsToNewAtom(MolAtom newAtom, MolAtom orig, MolBond[] bonds) Sets the original connections to the new atom.booleanChecks if the molecule graph contains the specified atom.final booleanContracts all S-groups.final booleancontractSgroups(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 intDeprecated, for removal: This API element is subject to removal in a future version.final intDeprecated, for removal: This API element is subject to removal in a future version.protected chemaxon.struc.gearch.MoleculeGraphGearchbooleanDearomatize molecule.voidendReuse(int n) End reusing atoms.final booleanExpands all S-groups.final booleanexpandSgroups(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 StringexportToFormat(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 voidAdds all atoms and bonds to the specified molecule.Sgroup[]Deprecated, for removal: This API element is subject to removal in a future version.Finds all S-groups containing the specified atom.Gets the containing multicenter S-group of a multicenter atom.final SgroupDeprecated, for removal: This API element is subject to removal in a future version.final SgroupDeprecated, for removal: This API element is subject to removal in a future version.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 SgroupDeprecated.UsefindAllSgroupsContaining(MolAtom), as there can be multiple largest S-groups containing a certain atomfinal SgroupDeprecated.UsefindSmallestSgroupsContaining(MolAtom), as there can be multiple smallest S-groups containing a certain atomfinal SgroupDeprecated.UsefindSmallestSgroupsContaining(MolAtom), as there can be multiple smallest S-groups containing a certain atomFinds all smallest (minimal) S-groups containing the specified atom.protected booleanFix a property containing reference to the molecule.protected voidfuse0(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.longGets the end position of this molecule in the input file.protected final SelectionMoleculeGets a selection molecule containing all the atoms and bonds.getId()final StringGets the input file format.protected MoleculeGets 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).intgetProperty(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.intGets 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 SgroupgetSgroup(int i) Gets an S-group.final Sgroup[]Gets the array of S-groups.final intGets the number of S-groups.Returns an iterator over the S-groups in this molecule in proper sequence.MolAtom[]Deprecated, for removal: This API element is subject to removal in a future version.final MoleculeGets the simplified molecule object.final Sgroup[]Gets the sorted S-groups in parent-child order.longGets the starting position of this molecule in the input file.double[]Returns the coordinates of the given atom (contained in the molecule).booleanTests whether the molecule graph has atom sets.booleanTests if the molecule has contracted S-groups or not.booleanprotected booleanimplicitizeHydrogens0(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 intGets the array index of an S-group.booleanisEmpty()Tests whether the molecule is empty.final booleanisExpandable(int opts) Tests if the molecule is expandable with the specified options.final booleanDeprecated, for removal: This API element is subject to removal in a future version.as of Marvin 6.2 replaced byhasContractedSgroup()booleanChecks if the structure represents a reaction or not.booleanisSgroup()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 voidCopies some properties of this molecule to the other one specified as argument.voidmergeAtoms(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.voidrearrangeSgroups(int[] newIndexes) For internal use only.voidRemoves all the atoms and bonds.voidRemoves all bonds.protected voidRemoves all S-groups.voidremoveAtom(int i, int cleanupFlags) Removes an atom and its bonds by index.voidremoveAtom(MolAtom atom, int cleanupFlags) Removes an atom and its bonds by reference.protected voidremoveAtomFromChildren(Sgroup sgroup, MolAtom atom) Removes the parameter atom from the parameter S-group and it's descendants.protected voidremoveBond(int i, int cleanupFlags) Removes a bond by index.protected voidremoveBond(MolBond bond, int cleanupFlags) Removes a bond by reference.voidremoveObject(MObject mo) protected voidRemoves an S-group from the sgroupVector.protected final voidRemoves S-groups that are contained in a given molecule but not contained in another molecule.protected final voidremoveSgroupsOf(Molecule m, int rmflags) Removes S-groups that are contained in a given molecule but not contained in another molecule.protected final voidChange parents of all S-groups in this molecule.voidreplaceAtom(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.voidreplaceSgroup(Sgroup sgroup, Sgroup newSgroup) For internal use only.static StringresidueSymbolOf(int id) Gets the name of a residue.static intresidueTypeOf(String name) Gets the residue identifier for a residue name.reuseAtom(int z, int i) Reuse an atom or create a new one.voidselectAllObjects(boolean s) protected voidSets the atom at the specified index.voidsetComment(String s) Sets the comment.voidsetDim(int d) Sets the dimension.voidsetEndPosition(long off) Sets the end position of this molecule in the input file.final voidsetGUIContracted(boolean contract) Deprecated.as of Marvin 6.2, useexpandSgroups(int)orcontractSgroups(int)instead with option parameterExpandable.LEAVE_COORDS_UNCHANGEDfinal voidsetGUIContracted(boolean contract, int opts) Deprecated.as of Marvin 6.2, useexpandSgroups(int)orcontractSgroups(int)instead with option parameterExpandable.LEAVE_COORDS_UNCHANGEDvoidvoidsetInputFormat(String format) Sets the input file format.voidSets the molecule name/title.voidsetProperty(String key, String value) Sets an RDfile/SDfile property.voidsetPropertyObject(String key, Object value) Sets an RDfile/SDfile property object.voidsetSgroupParent(MolAtom a, Sgroup sg, boolean set) Sets or unsets an S-group as a parent of an atom.voidsetStartPosition(long off) Sets the starting position of this molecule in the input file.voidDeprecated, for removal: This API element is subject to removal in a future version.As of Marvin 5.12, no replacement.
 Crossing bonds of aSuperatomSgroupdo 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 StringDeprecated, 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).voidtransform(CTransform3D t, boolean incg) Apply a transformation matrix to the atomic coordinates and Data Sgroup coordinates.final booleanungroupSgroup(int i) Deprecated, for removal: This API element is subject to removal in a future version.as of Marvin 6.3.final booleanungroupSgroup(int i, int opts) Deprecated.as of Marvin 6.3.final booleanungroupSgroup(Sgroup sg) Ungroups the specified S-group and expands it if it is an Expandable S-group.final booleanungroupSgroup(Sgroup sg, int opts) Expand and ungroup the specified S-group.final booleanExpands and ungroups all S-groups.final booleanungroupSgroups(int type) Deprecated, for removal: This API element is subject to removal in a future version.as of Marvin 6.3.final booleanungroupSgroups(EnumSet<SgroupType> types) Ungroups all S-groups of the specified types in this molecule.Methods inherited from class chemaxon.struc.MoleculeGraphadd, 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, getAbbreviationAsMolecule, 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_SGROUPATOMSpublic static final int RMCLEANUP_SGROUPATOMSRemove S-groups of removed superatoms.- Since:
- Marvin 4.1, 07/27/2006
- See Also:
 
- 
RMCLEANUP_FROMSGROUPSpublic 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_DEFAULTprotected 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_CHILDRENprotected static final int RMSG_KEEP_CHILDRENDo not remove S-group's children.- Since:
- Marvin 5.0, 03/27/2007
- See Also:
 
- 
RMSG_KEEP_PARENTprotected static final int RMSG_KEEP_PARENTDo not remove S-group from its parent.- Since:
- Marvin 5.0, 03/27/2007
- See Also:
 
- 
RMSG_KEEP_MULTICENTERprotected static final int RMSG_KEEP_MULTICENTERDo not remove central atom of multicenter S-groups.- Since:
- Marvin 5.0, 10/22/2007
- See Also:
 
- 
RMSG_KEEP_ALLprotected static final int RMSG_KEEP_ALLDo not remove S-group parent, children and central atom (in the case of multicenter S-groups).- See Also:
 
- 
RECURSIVE_UNGROUPpublic static final int RECURSIVE_UNGROUPUngroup and expand (if possible) the child S-groups.- Since:
- Marvin 5.1, 06/05/2008
- See Also:
 
- 
DEFAULT_UNGROUPpublic 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- 
Moleculepublic Molecule()Constructs an empty 2-dimensional molecule.
- 
MoleculeConstructs a molecule or fragment with the specified capacity for storing atoms and bonds.- Parameters:
- parent- the parent molecule (can be null)
- atomCapacity- capacity for storing atoms (no reallocation needed until the number of atoms is less than or equal to this value)
- bondCapacity- capacity for storing bonds (no reallocation needed until the number of bonds is less than or equal to this value)
 
- 
Molecule@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2026) public Molecule(Molecule p, MolAtom a) Deprecated, for removal: This API element is subject to removal in a future version.useMolecule()andMoleculeGraph.add(MolAtom)Construct a molecule consisting of a single atom (node).- Parameters:
- p- the parent structure
- a- the atom
 
- 
Molecule@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2026) public Molecule(Molecule p, MolBond b) Deprecated, for removal: This API element is subject to removal in a future version.useMolecule()andadd(MolBond)Construct a molecule consisting of a single bond (edge).- Parameters:
- p- the parent structure
- b- the bond
 
 
- 
- 
Method Details- 
setDimpublic void setDim(int d) Sets the dimension.- Overrides:
- setDimin class- MoleculeGraph
- Parameters:
- d- 0, 2, or 3
- See Also:
 
- 
clearpublic void clear()Clears the molecule.- Overrides:
- clearin class- MoleculeGraph
- See Also:
 
- 
clearForImportInitializes molecule for import.- Overrides:
- clearForImportin class- MoleculeGraph
- Parameters:
- format- input file format
- Since:
- Marvin 2.7
- See Also:
 
- 
getStartPositionpublic long getStartPosition()Gets the starting position of this molecule in the input file.- Returns:
- the starting position
 
- 
setStartPositionpublic void setStartPosition(long off) Sets the starting position of this molecule in the input file.- Parameters:
- off- the starting position
 
- 
getEndPositionpublic long getEndPosition()Gets the end position of this molecule in the input file.- Returns:
- the end position
 
- 
setEndPositionpublic void setEndPosition(long off) Sets the end position of this molecule in the input file.- Parameters:
- off- the end position
 
- 
getNameGets the molecule name/title that was set bysetName(String).- Overrides:
- getNamein class- MoleculeGraph
- Returns:
- the molecule name or an empty string
- Since:
- Marvin 2.7
 
- 
setNameSets the molecule name/title.- Parameters:
- s- the molecule name, empty string or null (null is equivalent to empty string)
- Since:
- Marvin 2.7
 
- 
getCommentGets the comment.- Returns:
- the comment or empty string
- Since:
- Marvin 2.9
 
- 
setCommentSets the comment.- Parameters:
- s- the comment, empty string or null (null is equivalent to empty string)
- Since:
- Marvin 2.9
 
- 
getId
- 
setId
- 
hasId
- 
getInputFormatGets 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
 
- 
setInputFormatSets the input file format.- Parameters:
- format- the input format
- Since:
- Marvin 2.7
- See Also:
 
- 
clearPropertiespublic void clearProperties()Clears RDfile/SDfile properties.
- 
getPropertyCountpublic 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.
- 
getPropertyKeyGets 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
 
- 
getPropertyObjectGets 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
 
- 
setPropertySets an RDfile/SDfile property. Setting null value removes the property.- Parameters:
- key- the property name
- value- the value or null
 
- 
setPropertyObjectSets an RDfile/SDfile property object. Setting null value removes the property.- Parameters:
- key- the property name
- value- the value or null
- Since:
- Marvin 3.1.2
 
- 
residueTypeOfGets the residue identifier for a residue name.- Parameters:
- name- residue name
- Returns:
- the residue type
 
- 
residueSymbolOfGets the name of a residue.- Parameters:
- id- the residue identifier
- Returns:
- the residue symbol
 
- 
setAtom0Sets the atom at the specified index. Overridden because Sgroups must be set correctly in RgMolecule.clone() and RxnMolecule.clone().- Overrides:
- setAtom0in class- MoleculeGraph
- Parameters:
- i- the atom index
- newAtom- the atom
 
- 
removeAtomRemoves 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:
- removeAtomin class- MoleculeGraph
- Parameters:
- atom- the atom
- cleanupFlags- extra clean-up methods
- Since:
- Marvin 3.1
- See Also:
 
- 
removeAtompublic 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:
- removeAtomin class- MoleculeGraph
- Parameters:
- i- the atom index
- cleanupFlags- extra clean-up methods
- Since:
- Marvin 3.1
- See Also:
 
- 
removeBondRemoves a bond by reference.- Overrides:
- removeBondin class- MoleculeGraph
- Parameters:
- bond- the bond
- cleanupFlags- extra clean-up methods
- Since:
- Marvin 3.1
- See Also:
 
- 
removeBondprotected void removeBond(int i, int cleanupFlags) Removes a bond by index.- Overrides:
- removeBondin class- MoleculeGraph
- Parameters:
- i- the bond index
- cleanupFlags- extra clean-up methods
- Since:
- Marvin 3.1
- See Also:
 
- 
removeAllBondspublic void removeAllBonds()Removes all bonds.- Overrides:
- removeAllBondsin class- MoleculeGraph
 
- 
removeAllpublic void removeAll()Removes all the atoms and bonds.- Overrides:
- removeAllin class- MoleculeGraph
 
- 
isEmptypublic boolean isEmpty()Tests whether the molecule is empty.- Overrides:
- isEmptyin class- MoleculeGraph
- Returns:
- trueif the molecule graph does not contain any atoms, bonds or non-empty S-groups,- falseotherwise
- Since:
- Marvin 4.1.1, 09/06/2006
 
- 
aromatizepublic void aromatize(int method) Aromatizes molecule.- Overrides:
- aromatizein class- MoleculeGraph
- Parameters:
- method- Specifies the algorithm for aromatization.
- Throws:
- SecurityException- cannot load module because of a security problem (firewall)
- See Also:
 
- 
aromatizepublic void aromatize(int method, boolean checkAmbiguity) Aromatizes molecule.- Overrides:
- aromatizein class- MoleculeGraph
- 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:
 
- 
dearomatizepublic boolean dearomatize()Dearomatize molecule.- Overrides:
- dearomatizein class- MoleculeGraph
- Returns:
- true if success, else false.
- Throws:
- SecurityException- cannot load module because of a security problem (firewall)
 
- 
clonecopyMakes another molecule identical to this one.- Overrides:
- clonecopyin class- MoleculeGraph
- Parameters:
- g- the target molecule
 
- 
fixSelfReferringPropertyFix a property containing reference to the molecule. Called from clonelesscopy().- Overrides:
- fixSelfReferringPropertyin class- MoleculeGraph
- Parameters:
- prop- the property
- Since:
- Marvin 4.1.6, 02/14/2007
- See Also:
 
- 
addSgroupClonesprotected 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 molecule
- originalChild- the original child molecule
- newChild- the new child molecule (clone of the original)
- Since:
- Marvin 3.4
 
- 
clonecopyCopies the specified atoms and bonds of this molecule to another one.- Overrides:
- clonecopyin class- MoleculeGraph
- Parameters:
- iatoms- array of atom indices to copy or- null
- g- the target molecule graph
- Since:
- Marvin 5.0.2, 03/11/2008
 
- 
clonecopyWithoutSgroupsCopies the all the contents except the S-groups into another molecule object.- Parameters:
- m- the target molecule
- Since:
- Marvin 3.4
 
- 
cloneAtomsCopies the specified atoms.- Overrides:
- cloneAtomsin class- MoleculeGraph
- Parameters:
- cnodes- array of atom indices to copy or- null
- graph- the target molecule graph
- Returns:
- the atom count
- Since:
- Marvin 6.0, 2013.02.25.
 
- 
clonelesscopyDeprecated.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:
- clonelesscopyin class- MoleculeGraph
- Parameters:
- g- the target molecule object (the selection)
 
- 
cloneMoleculeWithDocumentMakes 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
 
- 
cloneMoleculeDeprecated, 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
 
- 
cloneMakes 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:
- clonein class- MoleculeGraph
- 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
- 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 thetoFormatmethod, 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
- Since:
- Marvin 4.0, 07/01/2005
 
- 
toObjectDeprecated, 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
- Since:
- Marvin 4.0, 07/01/2005
 
- 
reuseAtomReuse an atom or create a new one. If an atom is reused, all its properties except the corners are initialized.- Parameters:
- z- the atomic number
- i- the atom index
- Returns:
- the atom reference
- Since:
- Marvin 2.6
 
- 
endReusepublic void endReuse(int n) End reusing atoms.- Parameters:
- n- number of atoms
- Since:
- Marvin 2.6
 
- 
newInstanceCreates a new Molecule object. The dimension and the origin coordinates will be the same as in the original molecule.- Overrides:
- newInstancein class- MoleculeGraph
- Returns:
- a Molecule object
 
- 
newSelectionMoleculeCreates a new SelectionMolecule object appropriate for storing selection from this molecule.- Returns:
- an empty selection molecule
- Since:
- Marvin 4.1, 11/24/2005
 
- 
makeItSimilarCopies some properties of this molecule to the other one specified as argument. Copies the input format.- Overrides:
- makeItSimilarin class- MoleculeGraph
- Parameters:
- g- the molecule to change
 
- 
getSimplifiedMoleculeGets the simplified molecule object. It returnsthisusually. In case ofRgMolecule, it returns the simply modified root structure if there are no R-groups present. In this case theRgMoleculewill 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
 
- 
getMostSimplifiedMoleculeGets the simplified molecule object even if there is a parent document with other objects. It returnsthisusually. In case ofRgMolecule, it returns the root structure if there are no R-groups present.- Returns:
- thisin the default implementation
- Since:
- Marvin 4.1.13, 09/20/2007
 
- 
isReactionpublic boolean isReaction()Checks if the structure represents a reaction or not.- Returns:
- false
- Since:
- Marvin 3.0
 
- 
canBeReactionComponentpublic boolean canBeReactionComponent()Tests whether an object of this class can be a reaction component. This implementation returnstrue- Returns:
- trueif it can be a reactant, product or agent,- falseif adding it to an- RxnMoleculeis not supported
- Since:
- Marvin 4.1.13, 09/19/2007
 
- 
isSgroupDeprecated, 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:
- trueif the structure is an S-group,- falseotherwise
- Since:
- Marvin 3.0
 
- 
getSgroupLigands@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public MolAtom[] getSgroupLigands()Deprecated, for removal: This API element is subject to removal in a future version.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@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2026) public final Sgroup findExpandableSgroup()Deprecated, for removal: This API element is subject to removal in a future version.Finds a contracted residue.- Returns:
- the S-group if found, null if all S-groups are expanded
- Since:
- Marvin 3.0
 
- 
findContractableSgroup@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2026) public final Sgroup findContractableSgroup()Deprecated, for removal: This API element is subject to removal in a future version.Finds an expanded residue.- Returns:
- the S-group if found, null if all S-groups are contracted
- Since:
- Marvin 3.0
 
- 
getSgroupArrayGets 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
 
- 
getSgroupCountpublic final int getSgroupCount()Gets the number of S-groups.- Returns:
- the number of S-groups
- Since:
- Marvin 3.0
 
- 
countExpandableContractableSgroups@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2026) public final int countExpandableContractableSgroups()Deprecated, for removal: This API element is subject to removal in a future version.Counts the expandable and contractable S-groups.- Returns:
- the number of expandable/contractable S-groups
- Since:
- Marvin 5.0, 02/28/2007
 
- 
countOrderedComponentSgroups@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2026) public final int countOrderedComponentSgroups()Deprecated, for removal: This API element is subject to removal in a future version.Counts the ordered component S-groups.- Returns:
- the number of ordered component S-groups.
- Since:
- Marvin 4.1.6, 02/28/2007
 
- 
getSgroupGets an S-group.- Parameters:
- i- S-group index
- Since:
- Marvin 3.0
 
- 
getSortedSgroupsGets 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
 
- 
getRootSgroupsGets 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
 
- 
sortSgroupXBondsDeprecated, for removal: This API element is subject to removal in a future version.As of Marvin 5.12, no replacement.
 Crossing bonds of aSuperatomSgroupdo 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
 
- 
indexOfGets the array index of an S-group.- Parameters:
- sg- the S-group
- Since:
- Marvin 3.0
 
- 
findSgroupOfDeprecated.UsefindSmallestSgroupsContaining(MolAtom), as there can be multiple smallest S-groups containing a certain atomFinds 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
 
- 
findSgroupContainingDeprecated.UsefindAllSgroupsContaining(MolAtom), as there can be multiple largest S-groups containing a certain atomFinds 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
 
- 
findSmallestSgroupContainingDeprecated.UsefindSmallestSgroupsContaining(MolAtom), as there can be multiple smallest S-groups containing a certain atomFinds 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@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2026) public Sgroup[] findAllSgroupContaining(MolAtom a) Deprecated, for removal: This API element is subject to removal in a future version.Finds all smallest S-groups containing the specified atom. There can be more groups containing the same atom and not embedding each other, for example, data S-groups can overlap with other S-groups.- Parameters:
- a- the atom
- Returns:
- the array of S-groups
- Since:
- Marvin 5.0.1
 
- 
findSmallestSgroupsContainingFinds all smallest (minimal) S-groups containing the specified atom. Note that there can be more S-groups containing the same atom and not embedding each other, for example, data S-groups can overlap with other S-groups, and multicenter S-groups can overlap with each other.- Parameters:
- a- the atom
- Returns:
- the set of minimal S-groups containing the atom
 
- 
findAllSgroupsContainingFinds all S-groups containing the specified atom.- Parameters:
- a- the atom
- Returns:
- the list of all S-groups containing the atom
 
- 
containsChecks 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:
- containsin class- MoleculeGraph
- Parameters:
- atom- the atom
- Returns:
- true if the graph or an sgroupgraph contains the object, false otherwise
 
- 
setSgroupParentSets or unsets an S-group as a parent of an atom.- Parameters:
- a- the atom
- sg- the S-group
- set- set (true) or unset (false)
- Throws:
- IllegalArgumentException- molecule does not contain the atom
- Since:
- Marvin 3.0
 
- 
reparentSgroupsChange 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:
- mergeAtomsin class- MoleculeGraph
- Parameters:
- that- the atom
- node- the other atom
 
- 
addAtom0Adds an atom.- Overrides:
- addAtom0in class- MoleculeGraph
- Parameters:
- node- the atom reference
 
- 
addAtomToFragmentAdds an atom to a fragment. S-groups are added only if all atoms are already in the molecule.- Overrides:
- addAtomToFragmentin class- MoleculeGraph
- Parameters:
- atom- the atom reference
 
- 
addBond0Adds a bond.- Overrides:
- addBond0in class- MoleculeGraph
- Parameters:
- bond- the bond reference
 
- 
fuse0Adds those atoms and bonds of a molecule graph to this one that are not already elements.- Overrides:
- fuse0in class- MoleculeGraph
- Parameters:
- graph- the molecule graph
- check-- trueif a containment check should be performed to ensure that only those atoms and bonds are added that are not already elements -- falseif the moleclue graph is known to be disjoint from this one and this check can be safely skipped
- Since:
- Marvin 5.0
 
- 
contractSgroupspublic final boolean contractSgroups()Contracts all S-groups.- Returns:
- true if the operation was successful, false if nothing changed
- Since:
- Marvin 3.0
 
- 
contractSgroupspublic 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:
 
- 
expandSgroupspublic final boolean expandSgroups()Expands all S-groups.- Returns:
- true if the operation was successful, false if nothing changed
- Since:
- Marvin 3.0
- See Also:
 
- 
expandSgroupspublic 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:
 
- 
isExpandablepublic 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:
 
- 
setGUIContractedDeprecated.as of Marvin 6.2, useexpandSgroups(int)orcontractSgroups(int)instead with option parameterExpandable.LEAVE_COORDS_UNCHANGEDS-group expansion or contraction is performed depending on the parametercontract.
 Ifcontractis 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
 
- 
setGUIContractedDeprecated.as of Marvin 6.2, useexpandSgroups(int)orcontractSgroups(int)instead with option parameterExpandable.LEAVE_COORDS_UNCHANGEDS-group expansion or contraction is performed depending on the parametercontract.
 Ifcontractis 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
- opts- for further expand options
- Since:
- Marvin 3.4, 05/04/2004
 
- 
isGUIContracted@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2026) public final boolean isGUIContracted()Deprecated, for removal: This API element is subject to removal in a future version.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
 
- 
hasContractedSgrouppublic 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
 
- 
ungroupSgroupUngroups 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:
 
- 
ungroupSgroupExpand and ungroup the specified S-group.- Parameters:
- sg- the S-group
- opts- 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:
 
- 
ungroupSgroupsUngroups 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.SUPERATOMas parameter will leave theSgroupType.AMINOACIDtyped S-groups in unchanged state while the former method (ungroupSgroups(int)) ungrouped theAminoAcidSgroupsas 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:
 
- 
ungroupSgroupDeprecated.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 index
- opts- option to specify the ungroup type
- Returns:
- true if the operation was successful, false if nothing changed
- Since:
- Marvin 5.1
- See Also:
 
- 
ungroupSgroupspublic final boolean ungroupSgroups()Expands and ungroups all S-groups.- Returns:
- true if the operation was successful, false if nothing changed
- Since:
- Marvin 3.0
 
- 
addSgroupsOfAdds S-groups to this object and its parent.
- 
removeSgroupsOfRemoves S-groups that are contained in a given molecule but not contained in another molecule.- Parameters:
- m- the molecule whose S-groups are to remove
- rmflags- removal flags
- Since:
- Marvin 4.1.7
- See Also:
 
- 
removeSgroupsOfRemoves S-groups that are contained in a given molecule but not contained in another molecule.
- 
removeAllSgroupsprotected void removeAllSgroups()Removes all S-groups.
- 
removeSgroupFromListRemoves an S-group from the sgroupVector.- Since:
- Marvin 4.1, 07/28/2006
 
- 
rearrangeSgroupspublic void rearrangeSgroups(int[] newIndexes) For internal use only. 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.
 
- 
addSgroupAdds 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
 
- 
removeAtomFromChildrenRemoves the parameter atom from the parameter S-group and it's descendants.
- 
getGraphUnionAsSelectionGets 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:
 
- 
bondlengthpublic double bondlength()Calculate the regular bond length for the unified structure.- Overrides:
- bondlengthin class- MoleculeGraph
- Returns:
- the regular bond length
 
- 
convertToFragsConverts 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:
 
- 
findFragsDetermines 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:
- findFragsin class- MoleculeGraph
- Type Parameters:
- C- the class of the fragments
- Parameters:
- cl- create fragment objects of this class
- fragmentationType- determines the type of fragmentation
- Returns:
- array of fragments
- Since:
- Marvin 5.6
- See Also:
 
- Merge only fragmented multicenter S-groups (see 
- 
findFragsDetermines 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
 
- 
fillSelectionMoleculeAdds all atoms and bonds to the specified molecule.- Parameters:
- s- the selection molecule
- Since:
- Marvin 3.0, 11/05/2002
 
- 
clearExtraLabelspublic void clearExtraLabels()Clears extra atom labels.
- 
checkConsistencyDeprecated, 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:
- checkConsistencyin class- MoleculeGraph
- Throws:
- RuntimeException- if inconsistency found
- Since:
- Marvin 5.0, 11/06/2007
 
- 
checkSgroupConsistencyprotected void checkSgroupConsistency()Checks the internal consistency of S-groups.- Throws:
- RuntimeException- if inconsistency found
- Since:
- Marvin 5.0, 11/06/2007
 
- 
getVisibleCoordsReturns 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 S-group atom instead.- Overrides:
- getVisibleCoordsin class- MoleculeGraph
- Parameters:
- ma- The atom to be queried.
- Returns:
- The real coordinates of ma.
- Since:
- Marvin 4.0 8/07/2005
 
- 
transformApply a transformation matrix to the atomic coordinates and Data Sgroup coordinates.- Overrides:
- transformin class- MoleculeGraph
- Parameters:
- t- the transformation matrix
- incg- graph invariants are changed (true) or not (false)
- Since:
- Marvin 4.0 2/09/2005
 
- 
findContainingMulticenterSgroupGets 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 S-groups contains the multicenter atom.
- Since:
- Marvin 5.0 04/20/2007
- See Also:
 
- 
createGearchprotected chemaxon.struc.gearch.MoleculeGraphGearch createGearch()- Overrides:
- createGearchin class- MoleculeGraph
 
- 
clearObjectspublic void clearObjects()- Specified by:
- clearObjectsin interface- chemaxon.struc.MObjectContainer
 
- 
getObjectCountpublic int getObjectCount()- Specified by:
- getObjectCountin interface- chemaxon.struc.MObjectContainer
 
- 
removeObject- Specified by:
- removeObjectin interface- chemaxon.struc.MObjectContainer
 
- 
selectAllObjectspublic void selectAllObjects(boolean s) - Specified by:
- selectAllObjectsin interface- chemaxon.struc.MObjectContainer
 
- 
getAllObjects- Specified by:
- getAllObjectsin interface- chemaxon.struc.MObjectContainer
 
- 
replaceSgroupFor internal use only. Replaces an S-group with a new S-group in the molecule. Sets parent-child relations of the new S-group according to the parent - child relations of the old sgroup.- Parameters:
- sgroup- the S-group to replace
- newSgroup- the S-group 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:
- implicitizeHydrogens0in class- MoleculeGraph
- Returns:
- true if success else false
 
- 
addDescription copied from class:MoleculeGraphAdds a bond to the molecule. If the molecule graph is a superGraph, the bond is also added to its endpoints (two MolAtom objects).- Overrides:
- addin class- MoleculeGraph
- Parameters:
- bond- the bond object
 
- 
replaceAtomReplaces the atom on the given index with the parameter atom and removes the parameter atom from its original parent molecule if needed. Sets the S-group hierarchy.- Overrides:
- replaceAtomin class- MoleculeGraph
- Parameters:
- i- the index of the original atom
- newAtom- the atom which will replace the original
 
- 
getBondsReturns the bonds attached to the given atom.- Overrides:
- getBondsin class- MoleculeGraph
- Parameters:
- atom- the atom
- Returns:
- the bonds attached to the given atom in this molecule
- Since:
- Marvin 6.2
 
- 
getSgroupIteratorReturns 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.
 
- 
connectOriginalBondsToNewAtomDescription copied from class:MoleculeGraphSets the original connections to the new atom.- Overrides:
- connectOriginalBondsToNewAtomin class- MoleculeGraph
- Parameters:
- newAtom- the atom which replace the original
- orig- the original atom
- bonds- the original atoms bonds (before any modification)
 
- 
hasAtomSetpublic boolean hasAtomSet()Description copied from class:MoleculeGraphTests whether the molecule graph has atom sets.- Overrides:
- hasAtomSetin class- MoleculeGraph
- Returns:
- trueif there are atom sets,- falseotherwise
 
 
- 
Molecule()andMoleculeGraph.add(MolAtom)