Class RepeatingUnitSgroup
- java.lang.Object
-
- chemaxon.struc.Sgroup
-
- chemaxon.struc.sgroup.RepeatingUnitSgroup
-
- All Implemented Interfaces:
Serializable
@PublicAPI public class RepeatingUnitSgroup extends Sgroup
Source-based and structure-based representation of repeating unit groups (polymers and repeating units with repetition ranges).
Source and structure structure-based representation of polymers.
The polymer structure consists of structural fragments. These fragments are enclosed by polymer brackets. The meaning of an SRU bracket is that the fragment within the brackets can repeat with itself. The fragment within the bracket is called repeating unit. Each SRU S-group has two or more dedicated bonds, called crossing bonds, that cross the brackets. The crossing bonds of an SRU show how the repeating units may connect in several ways to each other within the polymer. Depending on the number of crossing bonds and brackets we differentiate the following polymers and connectivities within the polymer:- Polymers with two crossing bonds.
If the polymer has one crossing bond on each bracket of the SRU there are three possibilities for the repeating pattern:
- head-to-tail
- head-to-head
- either/unknown
- Ladder-Type Polymers
Polymers with paired brackets and with two crossing bonds on each bracket are called ladder-type polymers. Here it must be specified how the two crossing bonds on each bracket connect to the corresponding bonds of the adjoining repeating units. Additionally to the head-to-tail, head-to-head connectivity information there is a flip information to specify whether the repeating unit flips around the polymer backbone when it connects to the adjoining SRU. This information is handled only in case of brackets with exactly two crossing bonds on both side (head and tail side). We differentiate the following polymer connectivities:
- head-to-tail with no flip
- head-to-tail with flip
- head-to-head with no flip
- head-to-head with flip
- either/unknown
- Polymers with three or more brackets.
If the polymer has three or more bonds with a separated bracket on each bond, the polymer always has the either/unknown repeating pattern.
Repeating units with repetition ranges.
Implemented S-group types:
- Sgroup.ST_ANY
- Sgroup.ST_SRU
- Sgroup.ST_COPOLYMER
- Sgroup.ST_CROSSLINK
- Sgroup.ST_GRAFT
- Sgroup.ST_MODIFICATION
- Since:
- Marvin 5.0, 10/13/2006
- 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
-
-
Constructor Summary
Constructors Modifier Constructor Description RepeatingUnitSgroup(Molecule parent, int type)
Constructs an SRU S-group.RepeatingUnitSgroup(Molecule parent, String connectivity, int type)
Constructs an SRU S-group with connectivity.protected
RepeatingUnitSgroup(RepeatingUnitSgroup sg, Molecule m, Sgroup psg)
Copy constructor.protected
RepeatingUnitSgroup(RepeatingUnitSgroup sg, Molecule m, Sgroup psg, int[] atomIndexMap)
Copy constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCrossingBonds(List<MolBond> crsList, List<MolBond> list)
Sets the crossing bonds (head and tail) of a ladder-type polymer.void
addStarAtoms()
Changes terminal carbon atoms to star atoms (*).protected Sgroup
cloneSgroup(Molecule m, Sgroup psg, int[] atomIndexMap)
Gets a new Sgroup instance.boolean
containsLadderTypePolymer()
Decides whether the structure of this sgroup contains a ladder-type repeating unit.boolean
equalsHead(MolBond[] bonds)
Decides whether the head bonds equal the given bonds.boolean
equalsTail(MolBond[] bonds)
Decides whether the tail bonds equal the given bonds.MolBond[]
findCrossingBonds()
Finds the crossing bonds.MolBond[]
getBondConnectionInfo()
Gets a bond triplet which stores the crossing bond and flip information.MolBond[]
getBondCorrespondence()
Gets four bonds that store the crossing bond and flip information.MolBond[]
getHeadCrossingBonds()
Gets the head crossing bonds.MolBond
getOtherCrossingBond(MolBond b)
Gets the other bond if a bond is a crossing bond in a ladder-type polimer bracket.String
getSuperscript()
Gets the superscript for Sru S-groups.MolBond[]
getTailCrossingBonds()
Gets the tail crossing bonds.String
internalsToString()
Print state to a String.static boolean
isAcceptablePolymerGraph(MoleculeGraph molGraph)
Checks if the given molecular graph can be the graph of a polymer SRUstatic boolean
isAcceptableRSRUGraph(MoleculeGraph molGraph)
Checks if the given molecular graph can be the graph of an RSRUstatic boolean
isAcceptableSru(String s)
boolean
isCrossingBond(MolBond b)
Decides whether the bond is a crossing bond in a ladder-type polymer bracket.boolean
isFlipped()
Decides whether this sgroup is flipped.boolean
isOuterAtom(MolAtom candidate)
Decides whether an atom is part of this repeating unit.boolean
isStarAtom(MolAtom atom)
Decides whether an atom is a star atom in this S-group.void
mergeBrackets(MolBond b1, MolBond b2)
Sets the crossing bonds of this sgroup so that they will share a common bracket.void
removeStarAtoms()
Changes terminal star atoms (*) to carbon atoms (C).void
setBondCorrespondence(MolBond[] b)
Sets the crossing bonds (head and tail) of a ladder-type polymer.void
setFlipped(boolean flipped)
Sets the flip property of this sgroup.void
setHeadCrossingBonds(MolBond[] b)
Sets the head crossing bonds.void
setTailCrossingBonds(MolBond[] tailCrossingBonds)
Sets the tail crossing bonds.void
swapHeadTail()
Swaps the head and tail bonds of this sru if both are set.-
Methods inherited from class chemaxon.struc.Sgroup
add, addBracket, addChildSgroup, areChildSgroupsVisible, checkBondConsistency, checkBonds, checkConsistencyInEmbeddings, checkSgroupGraphConsistency, clearObjects, cloneSgroup, cloneStructure, contains, containsAllAtomsOf, contract, countAllAtoms, createMolecule, createMolecule, expand, findSmallestSgroupContaining, findSmallestSgroupOf, getAtom, getAtomArray, getAtomCount, getAtomSymbolListAsString, getAttach, getBondArray, getBracketCount, getBrackets, getChargeLocation, getChildSgroup, getChildSgroupCount, getChildSgroups, getConnectivity, getCrossingAtoms, getId, getParentMolecule, getParentSgroup, getSgroupGraph, getSgroupType, getSubscript, getSubType, getTotalCharge, getType, getXState, hasAtom, hasBrackets, indexOf, indexOf, initBrackets, isBracketCrossingBond, isBracketVisible, isDescendantOf, isEmpty, isOrderedComponentSgroup, isPartSelected, isRemovable, isSelected, isTotalSelected, isVisible, removeAtom, removeAtom, removeAtom, removeBond, removeBonds, removeChildSgroup, removeGroupedAtom, removeObject, replaceAtom, replaceAtom, selectAllObjects, setAtom, setChargeLocation, setConnectivity, setGUIStateRecursively, setGUIStateRecursively, setId, setParentMolecule, setSgroupGraph, setSubscript, setSubType, setXState, setXState, setXState0, sort, toString, toString, transformByParent
-
-
-
-
Constructor Detail
-
RepeatingUnitSgroup
public RepeatingUnitSgroup(Molecule parent, int type)
Constructs an SRU S-group. Please note the S-group is not added automatically to the parent molecule.- Parameters:
parent
- the parent moleculetype
- type of the repeating unit sgroup. Possible values:- Sgroup.ST_ANY
- Sgroup.ST_SRU
- Sgroup.ST_COPOLYMER
- Sgroup.ST_CROSSLINK
- Sgroup.ST_GRAFT
- Sgroup.ST_MODIFICATION
- See Also:
Molecule.addSgroup(Sgroup, boolean)
-
RepeatingUnitSgroup
public RepeatingUnitSgroup(Molecule parent, String connectivity, int type)
Constructs an SRU S-group with connectivity. The connectivity string returned bygetSuperscript()
can be used to create another SRU S-group with the same connectivity data. Please note the S-group is not added automatically to the parent molecule.- Parameters:
parent
- the parent moleculeconnectivity
- the connectivity information possibilities:- "htn" or "ht,n" or "ht" - head to tail & no flip,
- "htf" or "ht,f" - head to tail & flip,
- "hhn" or "hh,n" or "hh" - head to head & no flip,
- "hhf" or "hh,f" - head to head & flip,
- "eun" or "eu,n" or "eu" - either/unknown.
type
- type of the repeating unit sgroup. Possible values:- See Also:
Molecule.addSgroup(Sgroup, boolean)
,Sgroup.SCN_HEAD_TO_TAIL
,Sgroup.SCN_HEAD_TO_HEAD
,Sgroup.SCN_EITHER_UNKNOWN
-
RepeatingUnitSgroup
protected RepeatingUnitSgroup(RepeatingUnitSgroup 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 in the case of partial cloning, ornull
otherwise- Since:
- Marvin 4.1
-
RepeatingUnitSgroup
protected RepeatingUnitSgroup(RepeatingUnitSgroup sg, Molecule m, Sgroup psg)
Copy constructor.- Parameters:
sg
- the S-group to copym
- the new parent moleculepsg
- the new parent S-group or null- Since:
- Marvin 4.1
-
-
Method Detail
-
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:
- Marvin 5.0.2, 03/07/2008
-
getSuperscript
public String getSuperscript()
Gets the superscript for Sru S-groups. This contains the connectivity data.- Overrides:
getSuperscript
in classSgroup
- Returns:
- the superscript:
- "ht" - head to tail & no flip,
- "ht,f" - head to tail & flip,
- "hh" - head to head & no flip,
- "hh,f" - head to head & flip,
- "eu" - either/unknown.
-
isAcceptableSru
public static boolean isAcceptableSru(String s)
-
isAcceptablePolymerGraph
public static boolean isAcceptablePolymerGraph(MoleculeGraph molGraph)
Checks if the given molecular graph can be the graph of a polymer SRU- Parameters:
molGraph
- the molecular graph to check- Returns:
- true if the molecular graph is acceptable for a polymer SRU
-
isAcceptableRSRUGraph
public static boolean isAcceptableRSRUGraph(MoleculeGraph molGraph)
Checks if the given molecular graph can be the graph of an RSRU- Parameters:
molGraph
- the molecular graph to check- Returns:
- true if the molecular graph is acceptable for an RSRU
-
addStarAtoms
public void addStarAtoms()
Changes terminal carbon atoms to star atoms (*).
-
removeStarAtoms
public void removeStarAtoms()
Changes terminal star atoms (*) to carbon atoms (C).
-
isStarAtom
public boolean isStarAtom(MolAtom atom)
Decides whether an atom is a star atom in this S-group.- Parameters:
atom
- the atom- Returns:
- true if the atom is star atom false otherwise
-
findCrossingBonds
public MolBond[] findCrossingBonds()
Finds the crossing bonds.- Overrides:
findCrossingBonds
in classSgroup
- Returns:
- the attachment bonds
- Since:
- Marvin 5.0
-
isOuterAtom
public final boolean isOuterAtom(MolAtom candidate)
Decides whether an atom is part of this repeating unit.- Parameters:
candidate
- The atom possibly outside of repeating unit- Returns:
true
if the atom is not part of the repeating unit
-
mergeBrackets
public void mergeBrackets(MolBond b1, MolBond b2)
Sets the crossing bonds of this sgroup so that they will share a common bracket.- Parameters:
b1
- first bondb2
- second bond
-
isCrossingBond
public boolean isCrossingBond(MolBond b)
Decides whether the bond is a crossing bond in a ladder-type polymer bracket.- Parameters:
b
- the bond- Returns:
- true if the bond is a crossing bond in a ladder-type polymer bracket, false otherwise
-
getOtherCrossingBond
public MolBond getOtherCrossingBond(MolBond b)
Gets the other bond if a bond is a crossing bond in a ladder-type polimer bracket.- Parameters:
b
- the bond which crosses a ladder-type bracket- Returns:
- the other bond if the given bond is in a ladder-type polimer bracket, null otherwise.
-
isFlipped
public boolean isFlipped()
Decides whether this sgroup is flipped.- Returns:
- true if the sgroup is flipped, false otherwise
- See Also:
flipped
-
setFlipped
public void setFlipped(boolean flipped)
Sets the flip property of this sgroup.- Parameters:
flipped
- the value of flip property- See Also:
flipped
-
getBondConnectionInfo
public MolBond[] getBondConnectionInfo()
Gets a bond triplet which stores the crossing bond and flip information.- Returns:
- array of bonds In case of ladder-type sru sgroups: 0. and 1. bond in the array are the crossing bond-pair that share a common bracket, 2. bond in the array is a crossing bond in repeating unit that attaches to the 0. item of this array. Null if the this sgroup contains a non ladder-type polymer.
-
getBondCorrespondence
public MolBond[] getBondCorrespondence()
Gets four bonds that store the crossing bond and flip information.- Returns:
- array of bonds In case of ladder-type sru sgroups: 0. and 2. bond in the array are the crossing bond-pair that share a common bracket, 1. bond in the array is a crossing bond in repeating unit that attaches to the 0. item of this array, 3. bond in the array is a crossing bond in repeating unit that attaches to the 2. item of this array. Null if the this sgroup contains a non ladder-type polymer.
-
setBondCorrespondence
public void setBondCorrespondence(MolBond[] b)
Sets the crossing bonds (head and tail) of a ladder-type polymer. If head and tail crossing bonds are not yet set then adds the bonds from the bond array. If only head is already set, sets the tail bonds. Here the head bonds should be in the array, otherwise does nothing. Calculates the flip property according the connection given in the array.- Parameters:
b
- array of four bonds. The order of bonds should be the following: 0. and 2. bond belong to the same bracket, 1. and 3. as well. When the sru connects to the adjoining sru, it does via 0. and 1. bond, 2. and 3. bond.
-
equalsTail
public boolean equalsTail(MolBond[] bonds)
Decides whether the tail bonds equal the given bonds.- Parameters:
bonds
- the bonds to compare with- Returns:
- true if the bonds equal with the tail bonds (order is not important)
-
equalsHead
public boolean equalsHead(MolBond[] bonds)
Decides whether the head bonds equal the given bonds.- Parameters:
bonds
- the bonds to compare with- Returns:
- true if the bonds equal with the head bonds (order is not important)
-
addCrossingBonds
public void addCrossingBonds(List<MolBond> crsList, List<MolBond> list)
Sets the crossing bonds (head and tail) of a ladder-type polymer.- Parameters:
crsList
- list that contains a pair of crossing bonds that share a common bracket (0. and 1. item of this list) and a crossing bond that connects to the 0. item of this list.list
- list of all crossing bonds that share a common bracket- See Also:
headCrossingBonds
,tailCrossingBonds
-
getHeadCrossingBonds
public MolBond[] getHeadCrossingBonds()
Gets the head crossing bonds.- Returns:
- exactly two head crossing bonds if this sgroup contains a ladder-type polymer, null otherwise
-
setHeadCrossingBonds
public void setHeadCrossingBonds(MolBond[] b)
Sets the head crossing bonds. Exactly two or null head crossing bonds should be specified.- Parameters:
b
- the head crossing bonds.
-
getTailCrossingBonds
public MolBond[] getTailCrossingBonds()
Gets the tail crossing bonds.- Returns:
- the tail crossing bonds if this sgroup contains a ladder-type polymer, null otherwise
-
setTailCrossingBonds
public void setTailCrossingBonds(MolBond[] tailCrossingBonds)
Sets the tail crossing bonds. Exactly two or null head crossing bonds should be given.- Parameters:
tailCrossingBonds
- the tail crossing bonds.
-
swapHeadTail
public void swapHeadTail()
Swaps the head and tail bonds of this sru if both are set.
-
containsLadderTypePolymer
public boolean containsLadderTypePolymer()
Decides whether the structure of this sgroup contains a ladder-type repeating unit.- Returns:
- true if this sgroup contains a ladder-type repeating unit.
-
internalsToString
public String internalsToString()
Print state to a String. This method is intended for internal use only!- Returns:
- Internal state as a multi line String
-
-