Package chemaxon.struc
Class SelectionMolecule
- java.lang.Object
-
- chemaxon.struc.MoleculeGraph
-
- chemaxon.struc.SelectionMolecule
-
- All Implemented Interfaces:
chemaxon.core.calculations.valencecheck.MoleculeWithValence<MolAtom>
,chemaxon.core.structure.MoleculeForBuilder
,chemaxon.core.structure.RootStructureForBuilder
,chemaxon.core.structure.StructureForBuilder
,Incomplecule
,MTransformable
,StereoConstants
,Serializable
@PublicAPI public class SelectionMolecule extends MoleculeGraph
A selection object which can contain atoms and bonds without real parent relationship (the real parent of atoms and bonds is another MoleculeGraph ancestor).- Since:
- Marvin 3.0
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class chemaxon.struc.MoleculeGraph
MoleculeGraph.ValenceCheckState
-
-
Field Summary
-
Fields inherited from class chemaxon.struc.MoleculeGraph
AROM_AMBIGUOUS, AROM_BASIC, AROM_CHUCKEL, AROM_GENERAL, AROM_LOOSE, AROM_SUBSTRUCTURE, atomCount, AUTO_UNGROUP, bondCount, btab, CACHE_REMOVE_ALL, CACHE_REMOVE_AROMATAMODULE, CACHE_REMOVE_CACHEMEMORY, CACHE_REMOVE_GRINVMODULE, CACHE_REMOVE_PARITYMODULE, CACHE_REMOVE_SSSRMODULE, CACHE_REMOVE_TABS, cacheMemory, ctab, DEAROM_GENERAL, DEAROM_HUCKELCHECK, DEAROM_HUCKELCHECK_EX, DIM_MASK, FRAG_BASIC, FRAG_KEEPING_MULTICENTERS, FRAG_KEEPING_SGROUPS, FRAG_TYPE_COUNT, gearch, GRINV_DONT_STORE, GRINV_NOHYDROGEN, GRINV_OLDSTEREO, GRINV_STEREO, GRINV_USEMAPS, GRINV_VALUE_OPTIONS, grinvCC, INITIAL_CAPACITY, INVALID_LINKNODE_MESSAGE, MIN_RING_SIZE_FOR_TRANS_DB, OMIT_POSTCLEAN, orix, oriy, oriz, parentGraph, propertyContainer, RMCLEANUP_ALL, RMCLEANUP_EDGES, RMCLEANUP_FIXCOMPONENT, RMCLEANUP_MOBJECT, RMCLEANUP_NONE, RMCLEANUP_PARENTDOC, RMCLEANUP_STEREO, superGraph, theAtoms, theBonds, useOnlyFirstAtomInStereoCalculation, VALENCE_CHECK, VALENCE_CHECK_AMBIGUOUS
-
Fields inherited from interface chemaxon.struc.StereoConstants
ANTI, ATOMSTEREO_EITHER, ATOMSTEREO_MASK, ATOMSTEREO_NONE, ATOMSTEREO_SPECIFIC, CHIRALITY_M, CHIRALITY_MASK, CHIRALITY_P, CHIRALITY_r, CHIRALITY_R, CHIRALITY_s, CHIRALITY_S, CHIRALITYSUPPORT_ALL, CHIRALITYSUPPORT_ALL_POSSIBLE, CHIRALITYSUPPORT_NONE, CHIRALITYSUPPORT_SELECTED, CIS, CIS_TRANS, CTUMASK, CTUNKNOWN, CTUNSPEC, DBS_ALL, DBS_MARKED, DBS_NONE, ENDO, EXO, PARITY_ALLENE, PARITY_EITHER, PARITY_EVEN, PARITY_MASK, PARITY_NONE, PARITY_ODD, PARITY_TETRAHEDRAL, PARITY_UNSPEC, STGRP_ABS, STGRP_AND, STGRP_NONE, STGRP_OR, SYN, TRANS
-
-
Constructor Summary
Constructors Constructor Description SelectionMolecule()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
add(MolAtom atom)
Adds an atom to the molecule.void
add(MolAtom atom, boolean addBonds)
Adds an atom to the molecule.void
add(MolBond bond)
Adds a bond to the graph.void
add(MolBond bond, boolean checkParallel)
Add a bond to the molecule.protected void
addAtom0(MolAtom atom)
Adds an atom.protected void
addAtomWithBonds(MolAtom atom)
Adds an atom to the molecule.protected int
addAtomWithoutChangingIt(MolAtom atom)
Adds an atom without setting its parentGraph and index fields.protected void
addBond0(MolBond bond)
Adds a bond.protected void
checkBondConsistency()
Empty implementation, bond consistency is not checked in case of selections.SelectionMolecule
clone()
Create a clone of this SelectionMolecule.void
clonecopy(MoleculeGraph graph)
Copies the clones of atoms and bonds of this graph to another one.protected boolean
clonecopyMoleculeGraphWithoutSgroups(int[] iatoms, MolBond[] cbonds, int nb, MoleculeGraph g)
Copies the specified atoms and bonds of this graph to another one.protected chemaxon.struc.gearch.MoleculeGraphGearch
createGearch()
protected void
fuse0(MoleculeGraph g, boolean check)
Adds those atoms and bonds of a graph to this one that are not already elements.Integer[]
getLigands(Integer atom)
protected boolean
isGrinvCCValid()
Tests whether the graph invariant change count is valid.protected boolean
isRealAtomParent()
Selection molecules are not real atom parents.protected void
regenBtab()
Regenerates the bond table.protected void
regenCtab()
Regenerates the connection table.void
removeAtom(int i)
Removes an atom and its bonds from the graph.void
removeAtom(MolAtom atom)
Removes an atom and its bonds.void
removeBond(int i)
Removes a bond from the graph.void
removeBond(MolBond bond)
Removes a bond by reference.protected void
setAtom0(int i, MolAtom atom)
Sets the atom at the specified index.void
setBond(int i, MolBond bond)
Deprecated.as of Marvin 6.2.void
swapAtoms(int i, int j)
Swap two atoms.void
transform(CTransform3D t)
Apply a transformation matrix to the atomic coordinates.-
Methods inherited from class chemaxon.struc.MoleculeGraph
addAtomsAndBondsTo, addAtomToFragment, addBondWithoutChangingIt, addExplicitHydrogens, addExplicitHydrogens, addExplicitLonePairs, addSimpleAtomWithoutChangingIt, adjustMultiChiralFlag, aromatize, aromatize, aromatize, aromatize, arrangeComponents, atoms, bondlength, bonds, calcCenter, calcCenter, calcDehydrogenizedGrinv, calcHeight, calcHybridization, calcOutRect, calcOutRect, calcOutRectCenter, calcOutRectCenter, calcWidth, canBeCT, canBeCT, canBeCT, checkConsistency, clean, clean, clear, clearCachedInfo, clearForImport, cloneAtoms, clonecopy, clonelesscopy, connectOriginalBondsToNewAtom, contains, contains, contains, createDehydrogenizedReadOnlyGraph, createSmolecule, dearomatize, dearomatize, findAtom, findAtomClone, findBasicFrags, findBond, findComponentIds, findComponentIds, findFrag, findFrag, findFragById, findFrags, findFrags, findInArray, fixProperties, fixSelfReferringProperty, fuse, fuse, getAromaticAndAliphaticRings, getAtom, getAtomArray, getAtomCount, getAtomCount, getAtomicNumber, getAtomIterator, getAtomReferenceList, getBond, getBondArray, getBondCount, getBondIterator, getBonds, 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, getName, 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, getVisibleCoords, hasAtomSet, hasBondSet, hasExplicitLonePairs, hasExtraLabelSet, hasImplicitH, hasSelfReferringProperty, hasValenceError, hydrogenize, implicitizeHydrogens, implicitizeHydrogens, implicitizeHydrogens, implicitizeHydrogens0, incGrinvCC, incGrinvCC, incGrinvCCOnly, indexOf, indexOf, insertAtom, insertBond, insertBondInOrder, insertNullAtoms, insertNullBonds, isAbsStereo, isAcceptedSpecialLigand, isAtom, isAtomInRing, isBond, isBondParallelWith, isEmpty, isLargeMolecule, isMolecule, isMultiChiral, isolate, isolate, isOnlyFirstAtomInStereoCalculation, isQuery, isRing, isRingBond, isSelfReference, isSimilarTo, isSymmetric, isValenceCheckEnabled, isValidLinkNode, makeItSimilar, mergeAtoms, mergeFrags, moveTo, newInstance, pack, partialClean, partialClean, partialClean, properties, qpropCheck, regenBonds, regenGearch, removeAll, removeAllBonds, removeAtom, removeAtom, removeBond, removeBond, removeExplicitLonePairs, removeIsolatedAtoms, removeIsolatedBonds, replaceAtom, replaceBond, resetCtab, resetGrinvInParents, restoreCache, revalidateCoordDependentProps, saveCache, setAbsStereo, setAtom, setAtomSetSeqs, setBondSetSeqs, setChirality, setChirality, setDim, 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
-
-
-
-
Method Detail
-
isRealAtomParent
protected boolean isRealAtomParent()
Selection molecules are not real atom parents. However, in some special cases a selection molecule can be an atom parent.- Overrides:
isRealAtomParent
in classMoleculeGraph
- Returns:
- false
- Since:
- Marvin 3.0
-
setBond
@Deprecated public void setBond(int i, MolBond bond)
Deprecated.as of Marvin 6.2. UseremoveBond(MolBond)
for bond removal andadd(MolBond)
for adding a new bond to the molecule.Sets the bond at the specified index.- Overrides:
setBond
in classMoleculeGraph
- Parameters:
i
- bond indexbond
- the bond reference
-
add
public void add(MolBond bond)
Adds a bond to the graph. If the bond doesn't have parent molecule then the bond is also added to its end-points.- Overrides:
add
in classMoleculeGraph
- Parameters:
bond
- the bond object
-
add
public void add(MolBond bond, boolean checkParallel)
Add a bond to the molecule. If the second parameter is true, there an exception thrown when there is already a bond between the given MolAtoms. There is no checking if either is SgroupAtom. If the molecule graph is a superGraph, the bond is also added to its endpoints (two MolAtom objects).- Overrides:
add
in classMoleculeGraph
- Parameters:
bond
- the bond objectcheckParallel
-
-
add
public void add(MolAtom atom)
Adds an atom to the molecule. It doesn't add the bonds of the atom to the molecule.- Overrides:
add
in classMoleculeGraph
- Parameters:
atom
- the atom object
-
add
public void add(MolAtom atom, boolean addBonds)
Adds an atom to the molecule. It the second parameter is true, then adds the bonds of the atom to the molecule, if the bond's other atom is already added.- Parameters:
atom
-addBonds
-- Since:
- Marvin 6.1, 04/30/2013
-
addAtomWithBonds
protected void addAtomWithBonds(MolAtom atom)
Adds an atom to the molecule. Adds the bonds of the atom to the molecule, if the bond's other atom is already added.- Parameters:
atom
-- Since:
- Marvin 6.1, 04/30/2013
-
swapAtoms
public void swapAtoms(int i, int j)
Swap two atoms.- Parameters:
i
- index of the first atomj
- index of the second atom- Since:
- Marvin 3.3, 11/04/2003
-
removeAtom
public void removeAtom(MolAtom atom)
Removes an atom and its bonds.- Overrides:
removeAtom
in classMoleculeGraph
- Parameters:
atom
- the atom
-
removeAtom
public void removeAtom(int i)
Removes an atom and its bonds from the graph.- Overrides:
removeAtom
in classMoleculeGraph
- Parameters:
i
- the atom index
-
removeBond
public void removeBond(MolBond bond)
Removes a bond by reference.- Overrides:
removeBond
in classMoleculeGraph
- Parameters:
bond
- the bond
-
removeBond
public void removeBond(int i)
Removes a bond from the graph.- Overrides:
removeBond
in classMoleculeGraph
- Parameters:
i
- the bond index
-
addAtom0
protected void addAtom0(MolAtom atom)
Adds an atom.- Overrides:
addAtom0
in classMoleculeGraph
- Parameters:
atom
- the atom reference
-
setAtom0
protected void setAtom0(int i, MolAtom atom)
Sets the atom at the specified index.- Overrides:
setAtom0
in classMoleculeGraph
- Parameters:
i
- atom indexatom
- new atom reference
-
addBond0
protected void addBond0(MolBond bond)
Adds a bond.- Overrides:
addBond0
in classMoleculeGraph
- Parameters:
bond
- the bond reference
-
regenCtab
protected void regenCtab()
Regenerates the connection table.- Overrides:
regenCtab
in classMoleculeGraph
- Since:
- Marvin 3.5.2, 12/16/2004
-
regenBtab
protected void regenBtab()
Regenerates the bond table.- Overrides:
regenBtab
in classMoleculeGraph
- Since:
- Marvin 16.06.06.
-
fuse0
protected void fuse0(MoleculeGraph g, boolean check)
Adds those atoms and bonds of a graph to this one that are not already elements.- Overrides:
fuse0
in classMoleculeGraph
- Parameters:
g
- the graphcheck
-true
if a containment check should be performed to ensure that only those atoms and bonds are added that are not already elements -false
if the graph is known to be disjoint from this graph and this check can be safely skipped- Since:
- Marvin 5.0
-
transform
public void transform(CTransform3D t)
Apply a transformation matrix to the atomic coordinates.- Specified by:
transform
in interfaceMTransformable
- Overrides:
transform
in classMoleculeGraph
- Parameters:
t
- the transformation matrix
-
clonecopy
public void clonecopy(MoleculeGraph graph)
Copies the clones of atoms and bonds of this graph to another one.- Overrides:
clonecopy
in classMoleculeGraph
- Parameters:
graph
- the target graph
-
clonecopyMoleculeGraphWithoutSgroups
protected boolean clonecopyMoleculeGraphWithoutSgroups(int[] iatoms, MolBond[] cbonds, int nb, MoleculeGraph g)
Copies the specified atoms and bonds of this graph to another one.- Overrides:
clonecopyMoleculeGraphWithoutSgroups
in classMoleculeGraph
- Parameters:
iatoms
- array of atoms indices to copycbonds
- array of bonds to copy ornull
to copy bonds in cbonds onlynb
- number of bondsg
- the target graph- Returns:
false
if the bonds array contains all bond end points,true
if there is at least one external bond- Since:
- Marvin 5.0.2, 03/07/2008
-
clone
public SelectionMolecule clone()
Create a clone of this SelectionMolecule.- Overrides:
clone
in classMoleculeGraph
- Returns:
- the cloned SelectionMolecule
-
isGrinvCCValid
protected boolean isGrinvCCValid()
Tests whether the graph invariant change count is valid.- Overrides:
isGrinvCCValid
in classMoleculeGraph
- Returns:
false
- Since:
- Marvin 5.0, 11/30/2007
-
checkBondConsistency
protected void checkBondConsistency()
Empty implementation, bond consistency is not checked in case of selections.- Overrides:
checkBondConsistency
in classMoleculeGraph
- Since:
- Marvin 5.0, 11/06/2007
-
createGearch
protected chemaxon.struc.gearch.MoleculeGraphGearch createGearch()
- Overrides:
createGearch
in classMoleculeGraph
-
addAtomWithoutChangingIt
protected final int addAtomWithoutChangingIt(MolAtom atom)
Adds an atom without setting its parentGraph and index fields.- Overrides:
addAtomWithoutChangingIt
in classMoleculeGraph
- Parameters:
atom
- the atom reference- Returns:
- the new atom index
-
-