Package chemaxon.struc.sgroup
Class SuperatomSgroup
- java.lang.Object
-
- chemaxon.struc.Sgroup
-
- chemaxon.struc.sgroup.SuperatomSgroup
-
- All Implemented Interfaces:
chemaxon.core.structure.AbbreviationForBuilder<Integer>
,chemaxon.core.structure.MoleculeForBuilder
,chemaxon.core.structure.RootStructureForBuilder
,chemaxon.core.structure.StructureForBuilder
,Expandable
,Serializable
@PublicAPI public class SuperatomSgroup extends Sgroup implements Expandable, chemaxon.core.structure.AbbreviationForBuilder<Integer>
Superatom S-group.- Since:
- Marvin 3.0, 11/05/2002
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class chemaxon.struc.Sgroup
atomSet, brackets, CHARGE_ON_ATOMS, CHARGE_ON_GROUP, parentSgroup, PR_ATSYMS, RA_IN_EXPAND, RA_REMOVE_EXCEPT_RU, SCN_EITHER_UNKNOWN, SCN_HEAD_TO_HEAD, SCN_HEAD_TO_TAIL, SGROUP_TYPE_COUNT, sgroupGraph, sgroupType, SORT_CHILD_PARENT, SORT_PARENT_CHILD, SST_ALTERNATING, SST_BLOCK, SST_RANDOM, ST_AMINOACID, ST_ANY, ST_COMPONENT, ST_COPOLYMER, ST_CROSSLINK, ST_DATA, ST_FORMULATION, ST_GENERIC, ST_GRAFT, ST_MER, ST_MIXTURE, ST_MODIFICATION, ST_MONOMER, ST_MULTICENTER, ST_MULTIPLE, ST_SRU, ST_SUPERATOM, XSTATE_C, XSTATE_NONE, XSTATE_X, XSTATE_XC
-
Fields inherited from interface chemaxon.struc.sgroup.Expandable
COORDS_UPDATE, DEFAULT_OPTIONS, FAST_COORDS, LEAVE_COORDS_UNCHANGED, MDL_EXPAND, NONRECURSIVE_EXPAND, REVERSIBLE_EXPAND
-
-
Constructor Summary
Constructors Modifier Constructor Description SuperatomSgroup(Molecule parent)
Constructs a superatom S-group in expanded state.SuperatomSgroup(Molecule parent, boolean expanded)
Constructs a superatom S-group.protected
SuperatomSgroup(SuperatomSgroup sg, Molecule m, Sgroup psg, int[] atomIndexMap)
Copy constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
add(MolAtom atom)
Adds a new atom to the S-group.int
addAttachmentPoint(MolAtom atom)
Adds a new free attachment point for an atom.int
addAttachmentPoint(MolAtom atom, int order)
Adds a new free attachment point of the given attachment atom and order.int
addAttachmentPoint(MolAtom atom, int order, MolBond bond)
Adds a new free attachment point.boolean
areChildSgroupsVisible()
Checks whether the child S-groups are visible.void
calculateAttachmentPoints()
Calculates the attachment points for the crossing atoms and crossing bonds and sets the calculated values.protected void
calculateCoordinates(Molecule parentMol, MolBond[] xbonds, MoleculeGraph g, int opts, boolean isContract, SelectionMolecule otherSgroup, List<Double> xBondLength)
Calculates the coordinates during expand and contract.protected void
checkBonds(MolAtom atom)
Add the bonds of the given atom to the sgroup if the given atom and the other atom of the selected bond is in the sgroup.protected boolean
checkSgroupGraphConsistency(Sgroup parent)
Checks whether the parameter s-group contain the proper atoms of thisSuperatomSgroup
.void
clearSavedAtomIndices()
SuperatomSgroup
clone()
Clones the SuperatomSgroup (and not the Molecule).protected void
cloneLeavingGroups(SuperatomSgroup sasg)
Deprecated.As of Marvin 6.2, no replacement.
Not supported feature.protected Sgroup
cloneSgroup(Molecule m, Sgroup psg, int[] atomIndexMap)
Gets a new Sgroup instance.boolean
contract(int opts)
Contracts this S-group.protected SuperatomSgroup
createGroup()
Molecule
createMolecule()
Creates a molecule object that contains only oneSuperatomSgroup
identical to this one.boolean
expand(int opts)
Expands this S-group.boolean
expandOther(int opts, Molecule moltoexpand)
Deprecated.as of Marvin 6.2.MolAtom
findAttachAtom()
Gets the attachment atom of attachment point with the smallest order.MolBond[]
findCrossingBonds()
Finds the crossing bonds.MolAtom[]
getAllAttachAtoms()
Gets the attachment atoms (atoms having attachment point).MolAtom[]
getAttachAtoms()
Deprecated.As of Marvin 6.0, replaced bygetBoundAttachAtoms()
.chemaxon.struc.sgroup.AttachmentPoint
getAttachmentPoint(int order)
Gets the attachment point that's order is given as parameterint
getAttachmentPointCount()
Gets the number of the attachment points.List<Integer>
getAttachmentPointOrders()
Gets the orders with which attachment point existsList<Integer>
getAttachmentPointOrders(MolAtom atom)
Gets the attachment orders of the given attachment atom.List<chemaxon.struc.sgroup.AttachmentPoint>
getAttachmentPoints()
Gets the sorted copy of the attachment point list.MolAtom[]
getBoundAttachAtoms()
Gets atoms with attachment point having crossing bond and the related leaving group is not visible.MolAtom[]
getCrossingAtoms(MolBond[] xbonds)
Gets the atoms from the S-group that have crossing bonds.int
getExternalConnections(MolAtom a)
Gets the number of bonds of a specified atom where the neighbor atom doesn't belong to the S-group.MolAtom[]
getFreeAttachAtoms()
Gets the atoms with free attachment points.int
getFreeAttachmentPointCount()
Gets the number of free attachment points.List<Integer>
getFreeAttachmentPointOrders()
Gets the increasingly sorted orders of the free attachment points.List<Integer>
getFreeAttachmentPointOrders(MolAtom atom)
Gets the sorted free attachment orders of the given attachment atom.MolAtom[]
getFreeLegalAttachAtoms()
Deprecated.As of Marvin 6.0, replaced bygetFreeAttachAtoms()
.MolAtom[]
getLegalAttachAtoms()
Deprecated.As of Marvin 6.0, replaced bygetAllAttachAtoms()
.SelectionMolecule
getParentSgroupGraph()
Deprecated.as of Marvin 6.2, intended for internal use, similar functionality can be reached bygetSgroupGraph()
SelectionMolecule
getSgroupGraph()
Gets the molecule graph as a selection.SgroupAtom
getSuperAtom()
Gets the superatom.boolean
hasAtom(MolAtom a)
Is the specified atom an element of this group?boolean
hasBrackets()
Checks if brackets should be painted or not.boolean
hasOrder(int order)
boolean
isAttachmentAtom(MolAtom a)
Checks whether the given atom is an attachment atom or not.boolean
isBracketVisible()
Tests whether the bracket is visible.boolean
isContracted()
Decides whether this S-group is contracted or not.boolean
isExpanded()
Is this S-group expanded?boolean
isFreeAttachAtom(MolAtom a)
Checks whether the specified atom has free attachment point.boolean
isFreeLegalAttachAtom(MolAtom a)
Deprecated.As of Marvin 6.0, replaced byisFreeAttachAtom(MolAtom a)
.boolean
isLegalAttachment(MolAtom atom)
Deprecated.As of Marvin 6.0, replaced byisAttachmentAtom(MolAtom)
.boolean
isTotalSelected(MoleculeGraph sel)
Decides if the whole superatom sgroup is selected or not.void
removeAllAttachmentPoints()
Removes all of the attachment points of the Superatom s-group.protected void
removeAtom(MolAtom atom, int opts)
Removes an atom from the S-group.void
removeAttachmentPoint(int order)
Removes the attachment point with the given order.void
removeAttachmentPoints(MolAtom atom)
Removes all attachment points of the given attachment atom.void
removeBond(MolBond bond)
Removes a the given bond from the S-group.void
removeLeavingGroup(int order)
Deprecated.As of Marvin 6.2, no replacement.
Not supported feature.void
replaceAtom(MolAtom oldAtom, MolAtom newAtom, int opts)
Replace an existing atom by a new one.void
setAtom(int i, MolAtom a)
Sets the specified atom in the S-group graph.void
setAttachmentPointOrder(MolAtom atom, int oldOrder, int newOrder)
Sets a new order for the given attachment point.void
setCrossingBond(int order, MolBond bond)
Change the crossing bond of an attachment point.void
setCrossingBondType(int order, chemaxon.struc.BondType newType)
Deprecated.As of Marvin 6.2, no replacement.
Not supported feature.boolean
setGUIStateRecursively(boolean v)
Sets the expanded/contracted state recursively.void
setLeavingGroup(int order, int atNo)
Deprecated.As of Marvin 6.2, no replacement.
Not supported feature.void
setLeavingGroup(int order, int atNo, String alternativeName)
Deprecated.As of Marvin 6.2, no replacement.
Not supported feature.void
setLeavingGroup(int order, int atNo, String alternativeName, chemaxon.struc.BondType crossingBondType)
Deprecated.As of Marvin 6.2, no replacement.
Not supported feature.void
setLeavingGroupAlternativeName(int order, String alternativeName)
Deprecated.As of Marvin 6.2, no replacement.
Not supported feature.void
setSgroupGraph(SelectionMolecule smol)
Sets the molecule graph.void
sortXBonds()
Deprecated.As of Marvin 5.12, no replacement.
Crossing bonds of aSuperatomSgroup
do not need to be sorted any more.String
toString(int opts)
Returns a string representation of the group.protected void
transformByParent(CTransform3D t, boolean incg)
Applies a transformation matrix to the Sgroup coordinates.void
updateAttachmentPoints()
Deprecated.as of Marvin 6.2, usecalculateAttachmentPoints()
instead-
Methods inherited from class chemaxon.struc.Sgroup
addBracket, addChildSgroup, checkBondConsistency, checkConsistencyInEmbeddings, clearObjects, cloneSgroup, cloneStructure, contains, containsAllAtomsOf, countAllAtoms, createMolecule, findSmallestSgroupContaining, findSmallestSgroupOf, getAtom, getAtomArray, getAtomCount, getAtomSymbolListAsString, getAttach, getBondArray, getBracketCount, getBrackets, getChargeLocation, getChildSgroup, getChildSgroupCount, getChildSgroups, getConnectivity, getId, getParentMolecule, getParentSgroup, getSgroupType, getSubscript, getSubType, getSuperscript, getTotalCharge, getType, getXState, indexOf, indexOf, initBrackets, isBracketCrossingBond, isDescendantOf, isEmpty, isOrderedComponentSgroup, isPartSelected, isRemovable, isSelected, isVisible, removeAtom, removeAtom, removeBonds, removeChildSgroup, removeGroupedAtom, removeObject, replaceAtom, selectAllObjects, setChargeLocation, setConnectivity, setGUIStateRecursively, setId, setParentMolecule, setSubscript, setSubType, setXState, setXState, setXState0, sort, toString
-
-
-
-
Constructor Detail
-
SuperatomSgroup
public SuperatomSgroup(Molecule parent)
Constructs a superatom S-group in expanded state. Its superatom is automatically created.- Parameters:
parent
- the parent molecule- Since:
- Marvin 3.5.3, 01/18/2005
- See Also:
Sgroup.ST_SUPERATOM
,MolAtom.SGROUP
,getSuperAtom()
-
SuperatomSgroup
public SuperatomSgroup(Molecule parent, boolean expanded)
Constructs a superatom S-group. Its superatom is automatically created. Please note the S-group is not added automatically to the parent molecule.- Parameters:
parent
- the parent moleculeexpanded
- whether the S-group is created in expanded state or not- See Also:
Molecule.addSgroup(Sgroup, boolean)
,Sgroup.ST_SUPERATOM
,MolAtom.SGROUP
,getSuperAtom()
-
SuperatomSgroup
protected SuperatomSgroup(SuperatomSgroup sg, Molecule m, Sgroup psg, int[] atomIndexMap)
Copy constructor.- Parameters:
sg
- the S-group to copym
- the new parent moleculepsg
- the new parent S-group or nullatomIndexMap
- indices of cloned atoms in the original molecule ornull
- Since:
- Marvin 5.0.2, 03/07/2008
-
-
Method Detail
-
getSuperAtom
public final SgroupAtom getSuperAtom()
Gets the superatom.- Returns:
- the superatom
-
getAttachAtoms
@Deprecated public final MolAtom[] getAttachAtoms()
Deprecated.As of Marvin 6.0, replaced bygetBoundAttachAtoms()
.Gets atoms with attachment point having crossing bond. This method should only be called when the residue is in contracted state.- Returns:
- the attachment atoms
- Since:
- Marvin 4.0.4, 01/09/2006
-
getBoundAttachAtoms
public final MolAtom[] getBoundAttachAtoms()
Gets atoms with attachment point having crossing bond and the related leaving group is not visible. This method should only be called when the residue is in contracted state.- Returns:
- the attachment atoms having crossing bond and not visible leaving group
- Since:
- Marvin 6.0, Dec 11, 2012
-
getFreeLegalAttachAtoms
@Deprecated public final MolAtom[] getFreeLegalAttachAtoms()
Deprecated.As of Marvin 6.0, replaced bygetFreeAttachAtoms()
.Gets the atoms with free attachment points. Free if the corresponding attachment point is free.- Returns:
- array of MolAtoms having free attachment point.
- See Also:
AttachmentPoint.isFree()
-
getFreeAttachAtoms
public final MolAtom[] getFreeAttachAtoms()
Gets the atoms with free attachment points. Free if the corresponding attachment point is free.- Returns:
- array of MolAtoms having free attachment point.
- Since:
- Marvin 6.0, Dec 11, 2012
- See Also:
AttachmentPoint.isFree()
-
isFreeLegalAttachAtom
@Deprecated public final boolean isFreeLegalAttachAtom(MolAtom a)
Deprecated.As of Marvin 6.0, replaced byisFreeAttachAtom(MolAtom a)
.Tests whether the specified atom has a free attachment point.- Parameters:
a
- the atom- Returns:
true
if it has free attachment point,false
otherwise- Since:
- 5.0, 09/23/2007
-
isFreeAttachAtom
public final boolean isFreeAttachAtom(MolAtom a)
Checks whether the specified atom has free attachment point.- Parameters:
a
- the atom- Returns:
true
if it has free attachment point,false
otherwise- Since:
- Marvin 6.0, Dec 11, 2012
- See Also:
AttachmentPoint.isFree()
,getFreeAttachAtoms()
-
getLegalAttachAtoms
@Deprecated public final MolAtom[] getLegalAttachAtoms()
Deprecated.As of Marvin 6.0, replaced bygetAllAttachAtoms()
.Gets all attachment atoms (from free and bound attachment points).- Returns:
- array of attachment atoms
-
getAllAttachAtoms
public final MolAtom[] getAllAttachAtoms()
Gets the attachment atoms (atoms having attachment point).- Returns:
- array of attach atoms
- Since:
- Marvin 6.0, Dec 11, 2012
-
isLegalAttachment
@Deprecated public final boolean isLegalAttachment(MolAtom atom)
Deprecated.As of Marvin 6.0, replaced byisAttachmentAtom(MolAtom)
.Checks whether the given atom is an attachment atom or not.- Parameters:
atom
- the atom- Returns:
true
if the given atom is an attachment atomfalse
otherwise- Since:
- 3.5, 11/04/2004
-
isAttachmentAtom
public final boolean isAttachmentAtom(MolAtom a)
Checks whether the given atom is an attachment atom or not.- Parameters:
a
- the atom- Returns:
true
if the given atom is an attachment atomfalse
otherwise- Since:
- Marvin 6.0, Dec 11, 2012
- See Also:
getAllAttachAtoms()
-
updateAttachmentPoints
@Deprecated public void updateAttachmentPoints()
Deprecated.as of Marvin 6.2, usecalculateAttachmentPoints()
insteadAdjusts attachment point information to current bonding.- Throws:
chemaxon.struc.sgroup.NoFreeAttachmentPointException
- if there are not enough free attachment point
-
getSgroupGraph
public SelectionMolecule getSgroupGraph()
Gets the molecule graph as a selection. The nodes are ordered, the first n are the attachment atoms.- Overrides:
getSgroupGraph
in classSgroup
- Returns:
- the molecule graph
- Since:
- Marvin 3.3, 11/04/2003
-
getParentSgroupGraph
@Deprecated public SelectionMolecule getParentSgroupGraph()
Deprecated.as of Marvin 6.2, intended for internal use, similar functionality can be reached bygetSgroupGraph()
Gets the parent exact sgroupgraph. Internal use only.- Returns:
- the sgroupGraph
-
setSgroupGraph
public void setSgroupGraph(SelectionMolecule smol)
Sets the molecule graph. If the S-group is in contracted state then:- In case of single attachment points the first n nodes are supposed to be the attachment points.
- In case of double attachment point the graph is searched for the attachment point.
- Overrides:
setSgroupGraph
in classSgroup
- Parameters:
smol
- the molecule graph- Since:
- Marvin 3.3, 11/04/2003
-
cloneSgroup
protected Sgroup cloneSgroup(Molecule m, Sgroup psg, int[] atomIndexMap)
Gets a new Sgroup instance.- Overrides:
cloneSgroup
in classSgroup
- Parameters:
m
- the new parent moleculepsg
- the new parent S-groupatomIndexMap
- indices of cloned atoms in the original molecule ornull
- Returns:
- the new object
- Since:
- 5.0.2, 03/07/2008
-
setAtom
public final void setAtom(int i, MolAtom a)
Sets the specified atom in the S-group graph.
-
removeAtom
protected final void removeAtom(MolAtom atom, int opts)
Removes an atom from the S-group.- Overrides:
removeAtom
in classSgroup
- Parameters:
atom
- the atomopts
- unused argument
-
removeBond
public final void removeBond(MolBond bond)
Removes a the given bond from the S-group.- Overrides:
removeBond
in classSgroup
- Parameters:
bond
- the bond
-
findCrossingBonds
public MolBond[] findCrossingBonds()
Finds the crossing bonds. Use only when the S-group is expanded.- Overrides:
findCrossingBonds
in classSgroup
- Returns:
- the attachment bonds
- Since:
- Marvin 3.3
-
getCrossingAtoms
public MolAtom[] getCrossingAtoms(MolBond[] xbonds)
Gets the atoms from the S-group that have crossing bonds.- Overrides:
getCrossingAtoms
in classSgroup
- Parameters:
xbonds
- the crossing bonds- Returns:
- the attachment atoms
- Since:
- Marvin 3.3
- See Also:
findCrossingBonds()
-
findAttachAtom
public MolAtom findAttachAtom()
Gets the attachment atom of attachment point with the smallest order.- Returns:
- the attachment point with the smallest order or
null
if there is not any attachment point - Since:
- Marvin 4.1, 03/08/2006
-
transformByParent
protected void transformByParent(CTransform3D t, boolean incg)
Applies a transformation matrix to the Sgroup coordinates. (Only absolute placement.) This method is called by the parent molecule'sMolecule.transform(CTransform3D, boolean)
method, thus only those atom coordinates are transformed here that are not handled inMoleculeGraph.transform(CTransform3D, boolean)
.- Overrides:
transformByParent
in classSgroup
- Parameters:
t
- the transformation matrixincg
- graph invariants are changed (true) or not (false)- Since:
- Marvin 5.0, 08/18/2007
-
hasBrackets
public boolean hasBrackets()
Checks if brackets should be painted or not.- Overrides:
hasBrackets
in classSgroup
- Returns:
- true if the group is in expanded state
- Since:
- Marvin 3.3
-
hasAtom
public boolean hasAtom(MolAtom a)
Is the specified atom an element of this group?
-
expand
public final boolean expand(int opts) throws IllegalArgumentException
Expands this S-group. Atom indexes are preserved during expansion. During the expand, the atoms of the superatom s-group get into MoleculeGraph.- Specified by:
expand
in interfaceExpandable
- Overrides:
expand
in classSgroup
- Parameters:
opts
- expansion options- Returns:
- true if the operation was successful, false if already expanded
- Throws:
IllegalArgumentException
- if the group is invisible (it has a non-expanded parent)- See Also:
Expandable.DEFAULT_OPTIONS
,Expandable.COORDS_UPDATE
,Expandable.LEAVE_COORDS_UNCHANGED
,Expandable.MDL_EXPAND
,Expandable.FAST_COORDS
,Expandable.NONRECURSIVE_EXPAND
-
expandOther
@Deprecated public final boolean expandOther(int opts, Molecule moltoexpand) throws IllegalArgumentException
Deprecated.as of Marvin 6.2. useexpand(int)
instead on the s-groups desired to be expandedExpands other S-group the same way as it would be this. The other Sgroup is the first S-group of the other molecule (moltoexpand). Atom indices are preserved during expansion.- Parameters:
opts
- expansion optionsmoltoexpand
- molecule containing an Sgroup that has to be expanded- Returns:
- true if the operation was successful, false if already expanded
- Throws:
IllegalArgumentException
- if the group is invisible (it has a non-expanded parent)
-
isExpanded
public final boolean isExpanded()
Is this S-group expanded?- Specified by:
isExpanded
in interfaceExpandable
- Returns:
- true if expanded, false if contracted
-
contract
public final boolean contract(int opts) throws IllegalArgumentException
Contracts this S-group. During the contraction, atoms of this superatom s-group vanish from the molecule graph and substituted with one superatom.- Specified by:
contract
in interfaceExpandable
- Overrides:
contract
in classSgroup
- Parameters:
opts
- contraction options- Returns:
- true if the operation was successful, false if already contracted
- Throws:
IllegalArgumentException
- if the group is invisible (it has a non-expanded parent)- See Also:
Expandable.NONRECURSIVE_EXPAND
,Sgroup.RA_REMOVE_EXCEPT_RU
,Expandable.LEAVE_COORDS_UNCHANGED
-
calculateCoordinates
protected void calculateCoordinates(Molecule parentMol, MolBond[] xbonds, MoleculeGraph g, int opts, boolean isContract, SelectionMolecule otherSgroup, List<Double> xBondLength)
Calculates the coordinates during expand and contract.- Parameters:
parentMol
- the parent molecule of the superatomSgroupxbonds
- array of the crossing bondsg
- graph of the sgroupopts
- expand optionisContract
- true if it is called from contract, false if do so from expandotherSgroup
- graph of the other sgroup in expandOther- Since:
- Marvin 6.2, Aug 8, 2013
-
isContracted
public final boolean isContracted()
Decides whether this S-group is contracted or not.- Returns:
- true if contracted false otherwise
-
isBracketVisible
public boolean isBracketVisible()
Tests whether the bracket is visible.- Overrides:
isBracketVisible
in classSgroup
- Returns:
false
, superatom S-group brackets are not visible- Since:
- Marvin 3.5.1, 11/12/2004
-
isTotalSelected
public boolean isTotalSelected(MoleculeGraph sel)
Decides if the whole superatom sgroup is selected or not. Overrides method in parent class.- Overrides:
isTotalSelected
in classSgroup
- Parameters:
sel
- molecule graph that contains the selection- Returns:
- true if the whole superatom group is selected
-
areChildSgroupsVisible
public boolean areChildSgroupsVisible()
Checks whether the child S-groups are visible.- Overrides:
areChildSgroupsVisible
in classSgroup
- Returns:
- true if children are visible, false otherwise
- Since:
- Marvin 3.4
-
sortXBonds
@Deprecated public void sortXBonds()
Deprecated.As of Marvin 5.12, no replacement.
Crossing bonds of aSuperatomSgroup
do not need to be sorted any more. It is not advised to sort them anyway because then the indexes of bonds change in the parent molecule.Sorts the crossing bonds in the parent molecule in attachment point number order.- Since:
- Marvin 5.0, 12/07/2007
-
getExternalConnections
public int getExternalConnections(MolAtom a)
Gets the number of bonds of a specified atom where the neighbor atom doesn't belong to the S-group.- Parameters:
a
- the atom whose connections to be checked- Returns:
- the number of external connection or 0 if the specified atom doesn't belong to the S-group.
-
createMolecule
public Molecule createMolecule()
Creates a molecule object that contains only oneSuperatomSgroup
identical to this one.- Overrides:
createMolecule
in classSgroup
- Returns:
- the molecule containing one
SuperatomSgroup
- Since:
- Marvin 3.4
-
createGroup
protected SuperatomSgroup createGroup()
-
replaceAtom
public final void replaceAtom(MolAtom oldAtom, MolAtom newAtom, int opts)
Replace an existing atom by a new one.- Overrides:
replaceAtom
in classSgroup
- Parameters:
oldAtom
- the original atomnewAtom
- the new atomopts
- options- Since:
- 4.1, 07/25/2006
- See Also:
Sgroup.RA_REMOVE_EXCEPT_RU
-
toString
public String toString(int opts)
Returns a string representation of the group.- Overrides:
toString
in classSgroup
- Parameters:
opts
- options or 0- Returns:
- the string representation
- Since:
- Marvin 4.1, 07/26/2006
- See Also:
Sgroup.PR_ATSYMS
-
setGUIStateRecursively
public final boolean setGUIStateRecursively(boolean v) throws IllegalArgumentException
Sets the expanded/contracted state recursively.- Overrides:
setGUIStateRecursively
in classSgroup
- Parameters:
v
- true setsSgroup.XSTATE_C
if previous state wasSgroup.XSTATE_XC
, false setsSgroup.XSTATE_XC
if previous state wasSgroup.XSTATE_C
, no operation in other cases- Returns:
- true if at least one S-group's state was changed, false otherwise
- Throws:
IllegalArgumentException
- if the group is invisible (it has a non-expanded parent)- Since:
- Marvin 5.1
- See Also:
Sgroup.setXState(int)
-
calculateAttachmentPoints
public void calculateAttachmentPoints()
Calculates the attachment points for the crossing atoms and crossing bonds and sets the calculated values.- The properly set crossing bond are kept
- Those attachment points that's bond is not-crossing bond will be removed
- For those crossing bonds that have no attachment point connected will be calculated one from the free ones or will be given a new one
-
hasOrder
public boolean hasOrder(int order)
-
removeAttachmentPoints
public void removeAttachmentPoints(MolAtom atom)
Removes all attachment points of the given attachment atom.- Parameters:
atom
- the attachment atom- Throws:
IllegalArgumentException
- if the given atom is not part of the superatom s-group
-
setAttachmentPointOrder
public void setAttachmentPointOrder(MolAtom atom, int oldOrder, int newOrder)
Sets a new order for the given attachment point. The order must be a positive number.- Parameters:
atom
- the attachment atom of the attachment pointoldOrder
- the old attachment order of the attachment pointnewOrder
- the new attachment order of the attachment point- Throws:
IllegalArgumentException
- if the given atom is not part of the superatom S-group or the given new order is negativ or zero- Since:
- Marvin 6.0, Dec 5, 2012
-
getAttachmentPointOrders
public List<Integer> getAttachmentPointOrders(MolAtom atom)
Gets the attachment orders of the given attachment atom.- Parameters:
atom
- the attachment atom- Returns:
- the list of the attachment orders
- Since:
- Marvin 6.0, Dec 5, 2012
-
getFreeAttachmentPointOrders
public List<Integer> getFreeAttachmentPointOrders(MolAtom atom)
Gets the sorted free attachment orders of the given attachment atom.- Parameters:
atom
- the attachment atom- Returns:
- the sorted list of the free attachment orders
- Since:
- Marvin 6.0, Dec 5, 2012
- See Also:
AttachmentPoint.isFree()
-
add
public void add(MolAtom atom)
Adds a new atom to the S-group.
-
getAttachmentPointCount
public int getAttachmentPointCount()
Gets the number of the attachment points.- Specified by:
getAttachmentPointCount
in interfacechemaxon.core.structure.AbbreviationForBuilder<Integer>
- Returns:
- the number of the attachment points
- Since:
- Marvin 6.0, Dec 4, 2012
-
checkBonds
protected void checkBonds(MolAtom atom)
Add the bonds of the given atom to the sgroup if the given atom and the other atom of the selected bond is in the sgroup. If the newly added bond was crossing bond then the attachment point connected to this bond will be removed.- Overrides:
checkBonds
in classSgroup
- Parameters:
atom
- the atom
-
getAttachmentPoints
public List<chemaxon.struc.sgroup.AttachmentPoint> getAttachmentPoints()
Gets the sorted copy of the attachment point list.- Returns:
- the list of the attachment points
- Since:
- Marvin 6.0, Dec 5, 2012
-
setCrossingBond
public void setCrossingBond(int order, MolBond bond)
Change the crossing bond of an attachment point.- Parameters:
order
- the order of the attachment pointbond
- the crossing bond to be set- Throws:
IllegalArgumentException
-- if no attachment point exists with the given order
- if the attachment atom for the given order is not the same as the original attachment atom in expanded state
- if the given bond is not a crossing bond for this superatom s-group
IllegalStateException
chemaxon.struc.sgroup.NoFreeAttachmentPointException
- if the attachment point for the given order is not free
-
addAttachmentPoint
public int addAttachmentPoint(MolAtom atom)
Adds a new free attachment point for an atom. The order will be the smallest non used order.- Parameters:
atom
- the attachment atom of the new attachment point- Returns:
- the attachment order of the new attachment point
- Throws:
IllegalArgumentException
- if the given atom is not part of the superatom S-group- Since:
- Marvin 6.0, Dec 5, 2012
-
addAttachmentPoint
public int addAttachmentPoint(MolAtom atom, int order)
Adds a new free attachment point of the given attachment atom and order. The order must be a positive number.- Parameters:
atom
- the attachment atom of the new attachment pointorder
- the attachment order of the new attachment point- Returns:
- the attachment order of the new attachment point
- Throws:
IllegalArgumentException
- if the order is a non positive number- Since:
- Marvin 6.0, Dec 5, 2012
-
addAttachmentPoint
public int addAttachmentPoint(MolAtom atom, int order, MolBond bond)
Adds a new free attachment point.- Parameters:
atom
- the attachment atom of the new attachment pointbond
- the crossing bond of the new attachment pointorder
- the attachment order of the new attachment point- Returns:
- the attachment order of the new attachment point
- Throws:
IllegalArgumentException
- if the given atom is not part of the superatom S-group- Since:
- Marvin 6.0, Dec 5, 2012
-
setLeavingGroup
@Deprecated public void setLeavingGroup(int order, int atNo)
Deprecated.As of Marvin 6.2, no replacement.
Not supported feature.Defines the leaving group for an attachment point.- Parameters:
order
- the order of the attachment point to which the leaving group information is addedatNo
- the atomic number of the leaving atom- Throws:
IllegalArgumentException
- if the given order does not exist in the superatom sgroup- Since:
- Marvin 6.0, 2013.02.11.
-
setLeavingGroup
@Deprecated public void setLeavingGroup(int order, int atNo, String alternativeName)
Deprecated.As of Marvin 6.2, no replacement.
Not supported feature.Defines the leaving group for an attachment point.- Parameters:
order
- the order of the attachment point to which the leaving group information is addedatNo
- the atomic number of the leaving atomalternativeName
- the alternative name of the leaving group. P.e.: in case of dna it can be 3', 5', etc.- Throws:
IllegalArgumentException
- if the given order does not exist in the superatom sgroup- Since:
- Marvin 6.0, 2013.02.11.
-
setLeavingGroup
@Deprecated public void setLeavingGroup(int order, int atNo, String alternativeName, chemaxon.struc.BondType crossingBondType)
Deprecated.As of Marvin 6.2, no replacement.
Not supported feature.Defines the leaving group for an attachment point.- Parameters:
order
- the order of the attachment point to which the leaving group information is addedatNo
- the atomic number of the leaving atomalternativeName
- the alternative name of the leaving group. P.e.: in case of DNA it can be 3', 5', etc.crossingBondType
- the type of the bond connecting the superatom sgroup and the leaving group- Throws:
IllegalArgumentException
-- if the given order does not exist in the superatom sgroup, or the type of the given bond is not single, double or triple
- if the given order is not free and the type of the current crossing bond is not the same as the given type of the leaving group bond
- Since:
- Marvin 6.0, Feb 12, 2013
- See Also:
BondType
,AttachmentPoint.isFree()
-
setLeavingGroupAlternativeName
@Deprecated public void setLeavingGroupAlternativeName(int order, String alternativeName)
Deprecated.As of Marvin 6.2, no replacement.
Not supported feature.Sets the alternative name of the given ordered attachment point's leaving group.- Parameters:
order
- the order of the attachment point to which the leaving group information is addedalternativeName
- the alternative name of the leaving group. P.e.: in case of DNA it can be 3', 5', etc.- Throws:
IllegalArgumentException
- if attachment point with the given attachment order does not exist, or the attachment point does not have leaving group- Since:
- Marvin 6.0, 2013.02.11.
-
removeLeavingGroup
@Deprecated public void removeLeavingGroup(int order)
Deprecated.As of Marvin 6.2, no replacement.
Not supported feature.Removes the leaving group of an attachment point and the leaving group atom as well.- Parameters:
order
- the attachment order- Since:
- Marvin 6.0, Feb 13, 2013
-
removeAllAttachmentPoints
public void removeAllAttachmentPoints()
Removes all of the attachment points of the Superatom s-group.- Since:
- Marvin 6.0, Dec 17, 2012
-
removeAttachmentPoint
public void removeAttachmentPoint(int order)
Removes the attachment point with the given order.- Parameters:
order
- the order which's attachment point will be removed
-
getFreeAttachmentPointOrders
public List<Integer> getFreeAttachmentPointOrders()
Gets the increasingly sorted orders of the free attachment points.- Returns:
- the list of the increasingly sorted orders of the free attachment points
-
getAttachmentPoint
public chemaxon.struc.sgroup.AttachmentPoint getAttachmentPoint(int order)
Gets the attachment point that's order is given as parameter- Parameters:
order
- the required attachment point's order- Returns:
- the attachment point that's order equals to the parameter
-
setCrossingBondType
@Deprecated public void setCrossingBondType(int order, chemaxon.struc.BondType newType)
Deprecated.As of Marvin 6.2, no replacement.
Not supported feature.Sets the type of the crossing bond.- Parameters:
order
- the attachment ordernewType
- new type of the crossing bond- Throws:
IllegalStateException
-- if the attachment point does not have a leaving group
- if the attachment point is not free
- Since:
- Marvin 6.0, Feb 15, 2013
-
getFreeAttachmentPointCount
public int getFreeAttachmentPointCount()
Gets the number of free attachment points.- Returns:
- the number of free attachment points.
-
clone
public SuperatomSgroup clone()
Clones the SuperatomSgroup (and not the Molecule).
-
cloneLeavingGroups
@Deprecated protected void cloneLeavingGroups(SuperatomSgroup sasg)
Deprecated.As of Marvin 6.2, no replacement.
Not supported feature.Clones the leaving groups of the given superatom s-group.- Parameters:
sasg
- the superatom s-group- Since:
- Marvin 6.1, 2013.05.27.
-
getAttachmentPointOrders
public List<Integer> getAttachmentPointOrders()
Gets the orders with which attachment point exists- Returns:
- the list of the orders of the attachment points
-
checkSgroupGraphConsistency
protected boolean checkSgroupGraphConsistency(Sgroup parent)
Checks whether the parameter s-group contain the proper atoms of thisSuperatomSgroup
. That means theSgroupAtom
of this s-group if it is contracted state or all of it's atoms if it is in expanded state.- Overrides:
checkSgroupGraphConsistency
in classSgroup
- Parameters:
parent
- parent of Sgroup- Returns:
- true if the s-group is consistent
-
clearSavedAtomIndices
public void clearSavedAtomIndices()
-
-