public class Molecule extends MoleculeGraph implements chemaxon.struc.MObjectContainer
hasSelfReferringProperty
MoleculeGraph.ValenceCheckState
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_UNGROUP
Do not ungroup and do not expand S-group's children.
|
static int |
RECURSIVE_UNGROUP
Ungroup and expand (if possible) the child S-groups.
|
static int |
RM_KEEP_LEAVINGGROUPS
Deprecated.
As of Marvin 6.2, no replacement.
Not supported feature. |
static int |
RMCLEANUP_FROMSGROUPS
Remove atoms from S-groups.
|
static int |
RMCLEANUP_SGROUPATOMS
Remove S-groups of removed superatoms.
|
protected static int |
RMSG_DEFAULT
Remove S-group's children and remove S-group from its parent.
|
protected static int |
RMSG_KEEP_CHILDREN
Do not remove S-group's children.
|
protected static int |
RMSG_KEEP_MULTICENTER
Do not remove central atom of multicenter S-groups.
|
protected static int |
RMSG_KEEP_PARENT
Do not remove S-group from its parent.
|
AROM_AMBIGUOUS, AROM_BASIC, 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
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_NONE, CHIRALITYSUPPORT_SELECTED, CIS, CTUMASK, CTUNKNOWN, CTUNSPEC, DBS_ALL, DBS_MARKED, DBS_NONE, ENDO, EXO, PARITY_ALLENE, PARITY_EITHER, PARITY_EVEN, PARITY_MASK, PARITY_ODD, PARITY_TETRAHEDRAL, PARITY_UNSPEC, STGRP_ABS, STGRP_AND, STGRP_NONE, STGRP_OR, SYN, TRANS
Constructor and Description |
---|
Molecule()
Construct a 2 dimensional molecule.
|
Molecule(Molecule p,
int na,
int nb)
Construct a molecule or fragment with the specified number of atoms
and bonds.
|
Molecule(Molecule p,
MolAtom a)
Construct a molecule consisting of a single atom (node).
|
Molecule(Molecule p,
MolBond b)
Construct a molecule consisting of a single bond (edge).
|
Modifier and Type | Method and Description |
---|---|
void |
add(MolBond bond)
Adds a bond to the molecule.
|
protected void |
addAtom0(MolAtom node)
Adds an atom.
|
protected void |
addAtomToFragment(MolAtom atom)
Adds an atom to a fragment.
|
protected void |
addBond0(MolBond bond)
Adds a bond.
|
void |
addSgroup(Sgroup sg,
boolean setparent)
Adds an S-group to this object.
|
protected void |
addSgroupClones(Molecule origparentm,
Molecule origm,
Molecule newm)
Adds the S-groups of a child molecule clone to the new parent molecule
clone.
|
protected void |
addSgroupsOf(Molecule m)
Adds S-groups to this object and its parent.
|
void |
aromatize(int method)
Aromatizes molecule.
|
void |
aromatize(int method,
boolean checkAmbiguity)
Aromatizes molecule.
|
double |
bondlength()
Calculate the regular bond length for the unified structure.
|
boolean |
canBeReactionComponent()
Tests whether an object of this class can be a reaction component.
|
void |
checkConsistency()
Deprecated.
As of Marvin 5.7, no replacement.
Not intended for public use, it was intended only for internal debugging. |
protected void |
checkSgroupConsistency()
Checks the internal consisitency of S-groups.
|
void |
clear()
Clears the molecule.
|
void |
clearExtraLabels()
Clears extra atom labels.
|
void |
clearForImport(String format)
Initializes molecule for import.
|
void |
clearObjects() |
void |
clearProperties()
Clears RDfile/SDfile properties.
|
Molecule |
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 |
clonecopy(MoleculeGraph g)
Makes another molecule identical to this one.
|
protected void |
clonecopyWithoutSgroups(Molecule m)
Copies the all the contents except the S-groups into another molecule
object.
|
void |
clonelesscopy(MoleculeGraph g)
Deprecated.
as of Marvin 6.3.
Not supported feature. |
Molecule |
cloneMolecule()
Deprecated.
as of Marvin 2014.09.01.0 use
clone() instead |
Molecule |
cloneMoleculeWithDocument()
Makes 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 |
contains(MolAtom atom)
Checks if the molecule graph contains the specified atom.
|
boolean |
contractSgroups()
Contracts all S-groups.
|
boolean |
contractSgroups(int opts)
Contracts all S-groups.
|
Molecule[] |
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.
|
int |
countExpandableContractableSgroups()
Counts the expandable and contractable S-groups.
|
int |
countOrderedComponentSgroups()
Counts the ordered component S-groups.
|
protected chemaxon.struc.gearch.MoleculeGraphGearch |
createGearch() |
boolean |
dearomatize()
Dearomatize molecule.
|
void |
endReuse(int n)
End reusing atoms.
|
boolean |
expandSgroups()
Expands all S-groups.
|
boolean |
expandSgroups(int opts)
Expands all S-groups.
|
byte[] |
exportToBinFormat(String fmt)
Deprecated.
As of Marvin 5.7, replaced by
MolExporter.exportToBinFormat(Molecule, String) . |
String |
exportToFormat(String fmt)
Deprecated.
As of Marvin 5.7, replaced by
MolExporter.exportToFormat(Molecule, String) . |
Object |
exportToObject(String fmt)
Deprecated.
As of Marvin 5.7, replaced by
MolExporter.exportToObject(Molecule, String) . |
protected void |
fillSelectionMolecule(SelectionMolecule s)
Adds all atoms and bonds to the specified molecule.
|
Sgroup[] |
findAllSgroupContaining(MolAtom a)
Finds all smallest S-groups containing the specified atom.
|
MulticenterSgroup |
findContainingMulticenterSgroup(MolAtom atom)
Gets the containing multicenter S-group of a multicenter atom.
|
Sgroup |
findContractableSgroup()
Finds an expanded residue.
|
Sgroup |
findExpandableSgroup()
Finds a contracted residue.
|
SelectionMolecule[] |
findFrags()
Determines the disconnected fragments and puts them into an array.
|
<C extends MoleculeGraph> |
findFrags(Class<C> cl,
int fragmentationType)
Determines the disconnected fragments and puts them into an array.
|
Sgroup |
findSgroupContaining(MolAtom a)
Finds the largest S-group that contains the specified atom.
|
Sgroup |
findSgroupOf(MolAtom a)
Finds the smallest S-group related to the specified atom.
|
Sgroup |
findSmallestSgroupContaining(MolAtom a)
Finds the smallest S-group that contains the specified atom.
|
protected boolean |
fixSelfReferringProperty(MProp prop)
Fix a property containing reference to the molecule.
|
List<MObject> |
getAllObjects() |
protected MolBond[] |
getBonds(MolAtom atom)
Returns the bonds attached to the given atom.
|
String |
getComment()
Gets the comment.
|
long |
getEndPosition()
Gets the end position of this molecule in the input file.
|
protected SelectionMolecule |
getGraphUnionAsSelection()
Gets a selection molecule containing all the atoms and bonds.
|
String |
getInputFormat()
Gets the input file format.
|
protected Molecule |
getMostSimplifiedMolecule()
Gets the simplified molecule object even if there is a parent document
with other objects.
|
String |
getName()
Gets the molecule name that was set by
setName(String) . |
int |
getObjectCount() |
String |
getProperty(String key)
Deprecated.
As of Marvin 5.7, replaced by
MPropHandler.convertToString(MProp, String) .Usage: String property = MPropHandler.convertToString(mol.properties(), key); |
int |
getPropertyCount()
Gets the total number of RDfile/SDfile properties.
|
String |
getPropertyKey(int i)
Gets an RDfile/SDfile property key.
|
Enumeration<?> |
getPropertyKeys()
Deprecated.
As of Marvin 4.1, replaced by
properties() .getKeys() and
properties() .getKeyEnumeration() .One-to-one replacement is method getKeyEnumeration() but
method getKeys() is simpler to use. |
Object |
getPropertyObject(String key)
Gets an RDfile/SDfile property object.
|
Sgroup[] |
getRootSgroups()
Gets root s-groups (groups that are not embedded into another s-group).
|
Sgroup |
getSgroup(int i)
Gets an S-group.
|
Sgroup[] |
getSgroupArray()
Gets the array of S-groups.
|
int |
getSgroupCount()
Gets the number of S-groups.
|
IteratorFactory.SgroupIterator |
getSgroupIterator()
Returns an iterator over the s-groups in this molecule in proper
sequence.
|
MolAtom[] |
getSgroupLigands()
Gets the S-group's ligands if the structure represents an S-group.
|
Molecule |
getSimplifiedMolecule()
Gets the simplified molecule object.
|
Sgroup[] |
getSortedSgroups()
Gets the sorted S-groups in parent-child order.
|
long |
getStartPosition()
Gets the starting position of this molecule in the input file.
|
double[] |
getVisibleCoords(MolAtom ma)
Returns the coordinates of the given atom (contained in the molecule).
|
boolean |
hasAtomSet()
Tests whether the molecule graph has atom sets.
|
boolean |
hasContractedSgroup()
Tests if the molecule has contracted S-groups or not.
|
protected boolean |
implicitizeHydrogens0(int f,
MolAtom[] atoms,
boolean check)
Deprecated.
As of Marvin 5.7, replaced by
Hydrogenize.convertExplicitHToImplicit(MoleculeGraph, MolAtom[], int, boolean) .Usage: Hydrogenize.convertExplicitHToImplicit(mol, atoms, f, check); |
int |
indexOf(Sgroup sg)
Gets the array index of an S-group.
|
boolean |
isEmpty()
Tests whether the molecule is empty.
|
boolean |
isExpandable(int opts)
Tests if the molecule is expandable with the specified options.
|
boolean |
isGUIContracted()
Deprecated.
as of Marvin 6.2 replaced by
hasContractedSgroup() |
boolean |
isReaction()
Checks if the structure represents a reaction or not.
|
boolean |
isSgroup()
Deprecated.
As of Marvin 14.7.7, no replacement.
Not supported feature. |
protected void |
makeItSimilar(MoleculeGraph g)
Copies some properties of this molecule to the other one specified as
argument.
|
void |
mergeAtoms(MolAtom that,
MolAtom node)
Deprecated.
As of Marvin 6.2, use
MergeUtil.mergeAtoms(MolAtom, MolAtom, boolean) instead. |
MoleculeGraph |
newInstance()
Creates a new Molecule object.
|
SelectionMolecule |
newSelectionMolecule()
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 |
removeAll()
Removes all the atoms and bonds.
|
void |
removeAllBonds()
Removes all bonds.
|
protected void |
removeAllSgroups()
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 |
removeSgroupFromList(Sgroup sg)
Removes an S-group from the sgroupVector.
|
protected void |
removeSgroupsOf(Molecule m)
Removes S-groups from this object and its parent.
|
protected void |
removeSgroupsOf(Molecule m,
int rmflags)
Removes S-groups that are contained in a given molecule but
not contained in another molecule.
|
protected void |
reparentSgroups(Molecule p)
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.
|
MolAtom |
reuseAtom(int z,
int i)
Reuse an atom or create a new one.
|
void |
selectAllObjects(boolean s) |
protected void |
setAtom0(int i,
MolAtom newAtom)
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.
|
void |
setGUIContracted(boolean contract)
Deprecated.
as of Marvin 6.2, use
expandSgroups(int) or
contractSgroups(int) instead with option parameter
Expandable.LEAVE_COORDS_UNCHANGED |
void |
setGUIContracted(boolean contract,
int opts)
Deprecated.
as of Marvin 6.2, use
expandSgroups(int) or
contractSgroups(int) instead with option parameter
Expandable.LEAVE_COORDS_UNCHANGED |
void |
setInputFormat(String format)
Sets the input file format.
|
void |
setName(String s)
Sets the molecule name.
|
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 |
sortSgroupXBonds()
Deprecated.
As of Marvin 5.12, no replacement.
Crossing bonds of a SuperatomSgroup 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. |
byte[] |
toBinFormat(String fmt)
Deprecated.
As of Marvin 5.7, replaced by
MolExporter.exportToBinFormat(Molecule, String) . |
String |
toFormat(String fmt)
Deprecated.
As of Marvin 5.7, replaced by
MolExporter.exportToFormat(Molecule, String) .
To get exact replacement use: try { String out = MolExporter.exportToFormat(this, fmt); } catch (IOException e){ } |
Object |
toObject(String fmt)
Deprecated.
As of Marvin 5.7, replaced by
MolExporter.exportToObject(Molecule, String) . |
void |
transform(CTransform3D t,
boolean incg)
Apply a transformation matrix to the atomic coordinates and Data Sgroup
coordinates.
|
boolean |
ungroupSgroup(int i)
Deprecated.
as of Marvin 6.3. use
ungroupSgroup(Sgroup) instead. |
boolean |
ungroupSgroup(int i,
int opts)
Deprecated.
as of Marvin 6.3. use
ungroupSgroup(Sgroup) instead. |
boolean |
ungroupSgroup(Sgroup sg)
Ungroups the specified S-group and expands it if it is an Expandable S-group.
|
boolean |
ungroupSgroup(Sgroup sg,
int opts)
Expand and ungroup the specified S-group.
|
boolean |
ungroupSgroups()
Expands and ungroups all S-groups.
|
boolean |
ungroupSgroups(EnumSet<SgroupType> types)
Ungroups all S-groups of the specified types in this molecule.
|
boolean |
ungroupSgroups(int type)
Deprecated.
as of Marvin 6.3. use
ungroupSgroups(EnumSet) instead. |
add, add, addAtomsAndBondsTo, addAtomWithoutChangingIt, addBondWithoutChangingIt, addExplicitHydrogens, addExplicitHydrogens, addExplicitLonePairs, addSimpleAtomWithoutChangingIt, adjustMultiChiralFlag, aromatize, aromatize, arrangeComponents, calcCenter, calcCenter, calcDehydrogenizedGrinv, calcHeight, calcHybridization, calcOutRect, calcOutRect, calcOutRectCenter, calcOutRectCenter, calcWidth, canBeCT, canBeCT, canBeCT, checkBondConsistency, clean, clean, clearCachedInfo, clonecopyMoleculeGraphWithoutSgroups, contains, contains, createBHtab, createCHtab, createDehydrogenizedReadOnlyGraph, createSmolecule, dearomatize, findAtom, findAtomClone, findBasicFrags, findBond, findComponentIds, findComponentIds, findFrag, findFrag, findFragById, findFrags, findInArray, fuse, fuse, fuse0, getAromaticAndAliphaticRings, getAtom, getAtomArray, getAtomCount, getAtomCount, getAtomicNumber, getAtomIterator, getAtomReferenceList, getBond, getBondArray, getBondCount, getBondIterator, getBondTable, getBtab, getCharge, getChirality, getCSSR, 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, regenCtabs, 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
public static final int RMCLEANUP_SGROUPATOMS
removeAtom(MolAtom, int)
,
removeAtom(int, int)
,
MoleculeGraph.RMCLEANUP_ALL
,
Constant Field Valuespublic static final int RMCLEANUP_FROMSGROUPS
removeAtom(MolAtom, int)
,
removeAtom(int, int)
,
MoleculeGraph.RMCLEANUP_ALL
,
Constant Field Values@Deprecated public static final int RM_KEEP_LEAVINGGROUPS
removeAtom(int, int)
,
removeAtom(MolAtom, int)
,
MoleculeGraph.RMCLEANUP_ALL
,
Constant Field Valuesprotected static final int RMSG_DEFAULT
protected static final int RMSG_KEEP_CHILDREN
protected static final int RMSG_KEEP_PARENT
protected static final int RMSG_KEEP_MULTICENTER
public static final int RECURSIVE_UNGROUP
public static final int DEFAULT_UNGROUP
public Molecule(Molecule p, int na, int nb)
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 valuepublic Molecule(Molecule p, MolAtom a)
p
- the parent structurea
- the atompublic Molecule(Molecule p, MolBond b)
p
- the parent structureb
- the bondpublic Molecule()
public void setDim(int d)
setDim
in class MoleculeGraph
d
- 0, 2, or 3MoleculeGraph.getFlags()
public void clear()
clear
in class MoleculeGraph
MoleculeGraph.clearForImport(java.lang.String)
,
MoleculeGraph.theAtoms
public void clearForImport(String format)
clearForImport
in class MoleculeGraph
format
- input file formatMoleculeGraph.theBonds
,
MoleculeGraph.orix
,
MoleculeGraph.oriy
,
MoleculeGraph.oriz
,
MoleculeGraph.setFlags(int)
public long getStartPosition()
public void setStartPosition(long off)
off
- the starting positionpublic long getEndPosition()
public void setEndPosition(long off)
off
- the end positionpublic String getName()
setName(String)
.getName
in interface Incomplecule
getName
in class MoleculeGraph
public void setName(String s)
s
- the molecule name, empty string or null
(null is equivalent to empty string)public String getComment()
public void setComment(String s)
s
- the comment, empty string or null
(null is equivalent to empty string)public final String getInputFormat()
public void setInputFormat(String format)
format
- the input formatgetInputFormat()
public void clearProperties()
public int getPropertyCount()
@Deprecated public Enumeration<?> getPropertyKeys()
properties()
.getKeys()
and
properties()
.getKeyEnumeration()
.getKeyEnumeration()
but
method getKeys()
is simpler to use.public String getPropertyKey(int i)
i
- property index@Deprecated public String getProperty(String key)
MPropHandler.convertToString(MProp, String)
.String property = MPropHandler.convertToString(mol.properties(), key);
key
- property namepublic Object getPropertyObject(String key)
key
- property namepublic void setProperty(String key, String value)
key
- the property namevalue
- the value or nullpublic void setPropertyObject(String key, Object value)
key
- the property namevalue
- the value or nullpublic static int residueTypeOf(String name)
name
- residue namepublic static String residueSymbolOf(int id)
id
- the residue identifierprotected void setAtom0(int i, MolAtom newAtom)
setAtom0
in class MoleculeGraph
i
- the atom indexnewAtom
- the atompublic void removeAtom(MolAtom atom, int cleanupFlags)
MoleculeGraph.removeAtom(MolAtom)
instead unless you are sure what you are doing.removeAtom
in class MoleculeGraph
atom
- the atomcleanupFlags
- extra clean-up methodsMoleculeGraph.RMCLEANUP_NONE
,
MoleculeGraph.RMCLEANUP_ALL
,
MoleculeGraph.RMCLEANUP_EDGES
,
MoleculeGraph.RMCLEANUP_STEREO
,
RMCLEANUP_FROMSGROUPS
public void removeAtom(int i, int cleanupFlags)
MoleculeGraph.removeAtom(MolAtom)
instead unless you are sure what you are doing.removeAtom
in class MoleculeGraph
i
- the atom indexcleanupFlags
- extra clean-up methodsMoleculeGraph.RMCLEANUP_NONE
,
MoleculeGraph.RMCLEANUP_ALL
,
MoleculeGraph.RMCLEANUP_EDGES
,
MoleculeGraph.RMCLEANUP_STEREO
,
RMCLEANUP_FROMSGROUPS
protected void removeBond(MolBond bond, int cleanupFlags)
removeBond
in class MoleculeGraph
bond
- the bondcleanupFlags
- extra clean-up methodsMoleculeGraph.RMCLEANUP_NONE
,
MoleculeGraph.RMCLEANUP_ALL
,
MoleculeGraph.RMCLEANUP_EDGES
,
MoleculeGraph.RMCLEANUP_STEREO
protected void removeBond(int i, int cleanupFlags)
removeBond
in class MoleculeGraph
i
- the bond indexcleanupFlags
- extra clean-up methodsMoleculeGraph.RMCLEANUP_NONE
,
MoleculeGraph.RMCLEANUP_ALL
,
MoleculeGraph.RMCLEANUP_EDGES
,
MoleculeGraph.RMCLEANUP_STEREO
public void removeAllBonds()
removeAllBonds
in class MoleculeGraph
public void removeAll()
removeAll
in class MoleculeGraph
public boolean isEmpty()
isEmpty
in class MoleculeGraph
true
if the molecule graph does not contain any atoms,
bonds or non-empty S-groups, false
otherwisepublic void aromatize(int method)
aromatize
in class MoleculeGraph
method
- Specifies the algorithm for aromatization.SecurityException
- cannot load module because of a security
problem (firewall)MoleculeGraph.AROM_BASIC
,
MoleculeGraph.AROM_GENERAL
,
MoleculeGraph.AROM_LOOSE
,
Document about aromatizationpublic void aromatize(int method, boolean checkAmbiguity)
aromatize
in class MoleculeGraph
method
- Specifies the algorithm for aromatization.checkAmbiguity
- Specifies whether ANY bonds should be considered
during aromatization.SecurityException
- cannot load module because of a security
problem (firewall)MoleculeGraph.AROM_BASIC
,
MoleculeGraph.AROM_GENERAL
,
MoleculeGraph.AROM_LOOSE
,
Document about aromatizationpublic boolean dearomatize()
dearomatize
in class MoleculeGraph
SecurityException
- cannot load module because of a security
problem (firewall)public void clonecopy(MoleculeGraph g)
clonecopy
in class MoleculeGraph
g
- the target moleculeprotected boolean fixSelfReferringProperty(MProp prop)
fixSelfReferringProperty
in class MoleculeGraph
prop
- the propertyMoleculeGraph.clonecopy(MoleculeGraph)
protected final void addSgroupClones(Molecule origparentm, Molecule origm, Molecule newm)
origparentm
- the original parent moleculeorigm
- the original child moleculenewm
- the new child molecule (clone of the original)public void clonecopy(int[] iatoms, MoleculeGraph g)
clonecopy
in class MoleculeGraph
iatoms
- array of atom indices to copy or null
g
- the target molecule graphprotected void clonecopyWithoutSgroups(Molecule m)
m
- the target moleculeprotected int cloneAtoms(int[] cnodes, MoleculeGraph graph)
cloneAtoms
in class MoleculeGraph
cnodes
- array of atom indices to copy or null
graph
- the target molecule graph@Deprecated public void clonelesscopy(MoleculeGraph g)
clonelesscopy
in class MoleculeGraph
g
- the target molecule object (the selection)public Molecule cloneMoleculeWithDocument()
@Deprecated public Molecule cloneMolecule()
clone()
insteadMDocument
,
hence the atom and bond formatting (color, font, thickness) is lost.public Molecule clone()
MDocument
,
hence the atom and bond formatting (color, font, thickness) is lost.clone
in class MoleculeGraph
@Deprecated public final String toFormat(String fmt)
MolExporter.exportToFormat(Molecule, String)
.
try { String out = MolExporter.exportToFormat(this, fmt); } catch (IOException e){ }
s1 = mol.toFormat("mol"); s2 = mol.toFormat("smiles:a-H"); // aromatize and remove Hydrogens
fmt
- the format descriptor stringIllegalArgumentException
- Invalid format string.SecurityException
- Export module cannot be loaded because of
security reasons (firewall).toObject(java.lang.String)
@Deprecated public final String exportToFormat(String fmt) throws IOException
MolExporter.exportToFormat(Molecule, String)
.toFormat(String)
, the only difference is that
export exceptions are not converted to
IllegalArgumentException
.fmt
- the format descriptor stringIOException
MolExportException
- Export errorIllegalArgumentException
- Invalid format string.SecurityException
- Export module cannot be loaded because of
security reasons (firewall).toFormat(String)
@Deprecated public final byte[] toBinFormat(String fmt)
MolExporter.exportToBinFormat(Molecule, String)
.toFormat
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");
fmt
- the format descriptor stringIllegalArgumentException
- Invalid format string.SecurityException
- Export module cannot be loaded because of
security reasons (firewall).toObject(java.lang.String)
@Deprecated public final byte[] exportToBinFormat(String fmt) throws IOException
MolExporter.exportToBinFormat(Molecule, String)
.toBinFormat(String)
, the only difference is that
export exceptions are not converted to
IllegalArgumentException
.fmt
- the format descriptor stringMolExportException
- Export errorIllegalArgumentException
- Invalid format string.SecurityException
- Export module cannot be loaded because of
security reasons (firewall).IOException
toBinFormat(String)
@Deprecated public Object toObject(String fmt)
MolExporter.exportToObject(Molecule, String)
.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");
fmt
- the format descriptor stringIllegalArgumentException
- Invalid format string.SecurityException
- Export module cannot be loaded because of
security reasons (firewall).toFormat(java.lang.String)
,
toBinFormat(java.lang.String)
@Deprecated public Object exportToObject(String fmt) throws IOException
MolExporter.exportToObject(Molecule, String)
.toObject(String)
, the only difference is that
export exceptions are not converted to
IllegalArgumentException
.fmt
- the format descriptor stringMolExportException
- Export errorIllegalArgumentException
- Invalid format string.SecurityException
- Export module cannot be loaded because of
security reasons (firewall).IOException
toObject(String)
public MolAtom reuseAtom(int z, int i)
z
- the atomic numberi
- the atom indexpublic void endReuse(int n)
n
- number of atomspublic MoleculeGraph newInstance()
newInstance
in class MoleculeGraph
public SelectionMolecule newSelectionMolecule()
protected void makeItSimilar(MoleculeGraph g)
makeItSimilar
in class MoleculeGraph
g
- the molecule to changepublic final Molecule getSimplifiedMolecule()
this
usually. In case of RgMolecule
, it returns the simply modified
root structure if there are no R-groups present. In this case the
RgMolecule
will be inconsistent. It can simplify the molecule
only if there is no parent document containing other objects.protected Molecule getMostSimplifiedMolecule()
this
usually.
In case of RgMolecule
, it returns the root structure if there
are no R-groups present.this
in the default implementationpublic boolean isReaction()
public boolean canBeReactionComponent()
true
true
if it can be a reactant, product or agent,
false
if adding it to an RxnMolecule
is not
supported@Deprecated public boolean isSgroup()
true
if the structure is an S-group,
false
otherwisepublic MolAtom[] getSgroupLigands()
public final Sgroup findExpandableSgroup()
public final Sgroup findContractableSgroup()
public final Sgroup[] getSgroupArray()
Warning! Expansion or contraction of an S-group in this array may invalidate other array elements. Examples:
public final int getSgroupCount()
public final int countExpandableContractableSgroups()
public final int countOrderedComponentSgroups()
public final Sgroup getSgroup(int i)
i
- S-group indexpublic final Sgroup[] getSortedSgroups()
Warning! Expansion or contraction of an S-group in this array may invalidate other array elements. Examples:
public final Sgroup[] getRootSgroups()
@Deprecated public void sortSgroupXBonds()
SuperatomSgroup
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.public final int indexOf(Sgroup sg)
sg
- the S-grouppublic final Sgroup findSgroupOf(MolAtom a)
a
- the atompublic final Sgroup findSgroupContaining(MolAtom a)
a
- the atompublic final Sgroup findSmallestSgroupContaining(MolAtom a)
a
- the atompublic Sgroup[] findAllSgroupContaining(MolAtom a)
a
- the atompublic boolean contains(MolAtom atom)
contains
in class MoleculeGraph
atom
- the atompublic void setSgroupParent(MolAtom a, Sgroup sg, boolean set)
a
- the atomsg
- the S-groupset
- set (true) or unset (false)IllegalArgumentException
- molecule does not contain the atomprotected final void reparentSgroups(Molecule p)
p
- the new parentIllegalArgumentException
- molecule does not contain the atom@Deprecated public void mergeAtoms(MolAtom that, MolAtom node)
MergeUtil.mergeAtoms(MolAtom, MolAtom, boolean)
instead.mergeAtoms
in class MoleculeGraph
that
- the atomnode
- the other atomprotected void addAtom0(MolAtom node)
addAtom0
in class MoleculeGraph
node
- the atom referenceprotected void addAtomToFragment(MolAtom atom)
addAtomToFragment
in class MoleculeGraph
atom
- the atom referenceprotected void addBond0(MolBond bond)
addBond0
in class MoleculeGraph
bond
- the bond referencepublic final boolean contractSgroups()
public final boolean contractSgroups(int opts)
opts
- contraction optionsExpandable.contract(int)
,
Expandable.DEFAULT_OPTIONS
,
Expandable.LEAVE_COORDS_UNCHANGED
,
Expandable.NONRECURSIVE_EXPAND
public final boolean expandSgroups()
expandSgroups(int)
public final boolean expandSgroups(int opts)
opts
- expansion optionsExpandable.expand(int)
,
Expandable.DEFAULT_OPTIONS
,
Expandable.MDL_EXPAND
,
Expandable.LEAVE_COORDS_UNCHANGED
public final boolean isExpandable(int opts)
opts
- expansion optionsExpandable.DEFAULT_OPTIONS
,
Expandable.LEAVE_COORDS_UNCHANGED
@Deprecated public final void setGUIContracted(boolean contract)
expandSgroups(int)
or
contractSgroups(int)
instead with option parameter
Expandable.LEAVE_COORDS_UNCHANGED
contract
.contract
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.contract
- true for contraction, false for expansion@Deprecated public final void setGUIContracted(boolean contract, int opts)
expandSgroups(int)
or
contractSgroups(int)
instead with option parameter
Expandable.LEAVE_COORDS_UNCHANGED
contract
.contract
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.contract
- true for contraction, false for expansionopts
- for further expand options@Deprecated public final boolean isGUIContracted()
hasContractedSgroup()
public boolean hasContractedSgroup()
public final boolean ungroupSgroup(Sgroup sg)
sg
- the S-groupRECURSIVE_UNGROUP
,
ungroupSgroup(int)
public final boolean ungroupSgroup(Sgroup sg, int opts)
sg
- the S-groupopts
- option to specify the ungroup typeRECURSIVE_UNGROUP
,
DEFAULT_UNGROUP
,
ungroupSgroup(int, int)
@Deprecated public final boolean ungroupSgroup(int i)
ungroupSgroup(Sgroup)
instead.i
- the S-group indexungroupSgroup(chemaxon.struc.Sgroup)
,
RECURSIVE_UNGROUP
@Deprecated public final boolean ungroupSgroups(int type)
ungroupSgroups(EnumSet)
instead.type
- the S-group type that specifies which S-groups to ungroup.ungroupSgroup(Sgroup sg)
public final boolean ungroupSgroups(EnumSet<SgroupType> types)
SgroupType.SUPERATOM
as parameter will leave the
SgroupType.AMINOACID
typed S-groups in unchanged state while the
former method (ungroupSgroups(int)
) ungrouped the
AminoAcidSgroups
as well.types
- the S-group types that specifies which S-group types to ungroup.SgroupType
@Deprecated public final boolean ungroupSgroup(int i, int opts)
ungroupSgroup(Sgroup)
instead.i
- the S-group indexopts
- option to specify the ungroup typeRECURSIVE_UNGROUP
,
DEFAULT_UNGROUP
,
ungroupSgroup(chemaxon.struc.Sgroup)
public final boolean ungroupSgroups()
protected final void addSgroupsOf(Molecule m)
protected final void removeSgroupsOf(Molecule m, int rmflags)
m
- the molecule whose S-groups are to removermflags
- removal flagsRMSG_DEFAULT
,
RMSG_KEEP_CHILDREN
,
RMSG_KEEP_PARENT
protected final void removeSgroupsOf(Molecule m)
protected void removeAllSgroups()
protected void removeSgroupFromList(Sgroup sg)
public void rearrangeSgroups(int[] newIndexes)
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 vectorIllegalArgumentException
- if newIndexes are not in the range
[0..getSgroupCount()] or not all values in this range are contained.public void addSgroup(Sgroup sg, boolean setparent)
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.protected void removeAtomFromChildren(Sgroup sgroup, MolAtom atom)
protected final SelectionMolecule getGraphUnionAsSelection()
SelectionMolecule
public double bondlength()
bondlength
in class MoleculeGraph
public final Molecule[] convertToFrags()
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.
MoleculeGraph.findFrags(Class, int)
public <C extends MoleculeGraph> C[] findFrags(Class<C> cl, int fragmentationType)
MoleculeGraph.FRAG_KEEPING_MULTICENTERS
)MoleculeGraph.FRAG_KEEPING_SGROUPS
)MoleculeGraph.FRAG_BASIC
)findFrags
in class MoleculeGraph
C
- the class of the fragmentscl
- create fragment objects of this classfragmentationType
- determines the type of fragmentationMoleculeGraph.FRAG_BASIC
,
MoleculeGraph.FRAG_KEEPING_MULTICENTERS
,
MoleculeGraph.FRAG_KEEPING_SGROUPS
public final SelectionMolecule[] findFrags()
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.
protected void fillSelectionMolecule(SelectionMolecule s)
s
- the selection moleculepublic void clearExtraLabels()
@Deprecated public void checkConsistency()
checkConsistency
in class MoleculeGraph
RuntimeException
- if inconsistency foundprotected void checkSgroupConsistency()
RuntimeException
- if inconsistency foundpublic double[] getVisibleCoords(MolAtom ma)
getVisibleCoords
in class MoleculeGraph
ma
- The atom to be queried.public void transform(CTransform3D t, boolean incg)
transform
in class MoleculeGraph
t
- the transformation matrixincg
- graph invariants are changed (true) or not (false)public MulticenterSgroup findContainingMulticenterSgroup(MolAtom atom)
atom
- the multicenter atom.MulticenterSgroup
,
MolAtom.MULTICENTER
protected chemaxon.struc.gearch.MoleculeGraphGearch createGearch()
createGearch
in class MoleculeGraph
public void clearObjects()
clearObjects
in interface chemaxon.struc.MObjectContainer
public int getObjectCount()
getObjectCount
in interface chemaxon.struc.MObjectContainer
public void removeObject(MObject mo)
removeObject
in interface chemaxon.struc.MObjectContainer
public void selectAllObjects(boolean s)
selectAllObjects
in interface chemaxon.struc.MObjectContainer
public List<MObject> getAllObjects()
getAllObjects
in interface chemaxon.struc.MObjectContainer
public void replaceSgroup(Sgroup sgroup, Sgroup newSgroup)
sgroup
- the sgroup to replacenewSgroup
- the sgroup to replace with@Deprecated protected boolean implicitizeHydrogens0(int f, MolAtom[] atoms, boolean check)
Hydrogenize.convertExplicitHToImplicit(MoleculeGraph, MolAtom[], int, boolean)
.Hydrogenize.convertExplicitHToImplicit(mol, atoms, f, check);
implicitizeHydrogens0
in class MoleculeGraph
public void add(MolBond bond)
add
in class MoleculeGraph
bond
- the bond objectpublic void replaceAtom(int i, MolAtom newAtom)
replaceAtom
in class MoleculeGraph
i
- the index of the original atomnewAtom
- the atom which will replace the originalprotected MolBond[] getBonds(MolAtom atom)
getBonds
in class MoleculeGraph
atom
- the atompublic IteratorFactory.SgroupIterator getSgroupIterator()
protected void connectOriginalBondsToNewAtom(MolAtom newAtom, MolAtom orig, MolBond[] bonds)
MoleculeGraph
connectOriginalBondsToNewAtom
in class MoleculeGraph
newAtom
- the atom which replace the originalorig
- the original atombonds
- the original atoms bonds (before any modification)public boolean hasAtomSet()
MoleculeGraph
hasAtomSet
in class MoleculeGraph
true
if there are atom sets,
false
otherwise