public class RepeatingUnitSgroup extends Sgroup
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:
If the polymer has one crossing bond on each bracket of the SRU there are three possibilities for the repeating pattern:
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:
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:
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
Modifier | Constructor and 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.
|
Modifier and Type | Method and 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.
|
static boolean |
isAcceptablePolymerGraph(MoleculeGraph molGraph)
Checks if the given molecular graph can be the graph of a polymer SRU
|
static boolean |
isAcceptableRSRUGraph(MoleculeGraph molGraph)
Checks if the given molecular graph can be the graph of an RSRU
|
static 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 |
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.
|
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, 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, setParentMolecule, setSgroupGraph, setSubscript, setSubType, setXState, setXState, setXState0, sort, toString, toString, transformByParent
public RepeatingUnitSgroup(Molecule parent, int type)
parent
- the parent moleculetype
- type of the repeating unit sgroup. Possible values:
public RepeatingUnitSgroup(Molecule parent, String connectivity, int type)
getSuperscript()
can be used to create another SRU S-group with the same connectivity data.parent
- the parent moleculeconnectivity
- the connectivity information possibilities:
type
- type of the repeating unit sgroup. Possible values:
Sgroup.SCN_HEAD_TO_TAIL
,
Sgroup.SCN_HEAD_TO_HEAD
,
Sgroup.SCN_EITHER_UNKNOWN
protected RepeatingUnitSgroup(RepeatingUnitSgroup sg, Molecule m, Sgroup psg, int[] atomIndexMap)
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, or null
otherwiseprotected RepeatingUnitSgroup(RepeatingUnitSgroup sg, Molecule m, Sgroup psg)
sg
- the S-group to copym
- the new parent moleculepsg
- the new parent S-group or nullprotected Sgroup cloneSgroup(Molecule m, Sgroup psg, int[] atomIndexMap)
cloneSgroup
in class Sgroup
m
- the new parent moleculepsg
- the new parent S-groupatomIndexMap
- indices of cloned atoms in the original molecule
or null
public String getSuperscript()
getSuperscript
in class Sgroup
public static boolean isAcceptableSru(String s)
public static boolean isAcceptablePolymerGraph(MoleculeGraph molGraph)
molGraph
- the molecular graph to checkpublic static boolean isAcceptableRSRUGraph(MoleculeGraph molGraph)
molGraph
- the molecular graph to checkpublic void addStarAtoms()
public void removeStarAtoms()
public boolean isStarAtom(MolAtom atom)
atom
- the atompublic MolBond[] findCrossingBonds()
findCrossingBonds
in class Sgroup
public void mergeBrackets(MolBond b1, MolBond b2)
b1
- first bondb2
- second bondpublic boolean isCrossingBond(MolBond b)
b
- the bondpublic MolBond getOtherCrossingBond(MolBond b)
b
- the bond which crosses a ladder-type bracketpublic boolean isFlipped()
flipped
public void setFlipped(boolean flipped)
flipped
- the value of flip propertyflipped
public MolBond[] getBondConnectionInfo()
public MolBond[] getBondCorrespondence()
public void setBondCorrespondence(MolBond[] b)
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.public boolean equalsTail(MolBond[] bonds)
bonds
- the bonds to compare withpublic boolean equalsHead(MolBond[] bonds)
bonds
- the bonds to compare withpublic void addCrossingBonds(List<MolBond> crsList, List<MolBond> list)
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 bracketheadCrossingBonds
,
tailCrossingBonds
public MolBond[] getHeadCrossingBonds()
public void setHeadCrossingBonds(MolBond[] b)
b
- the head crossing bonds.public MolBond[] getTailCrossingBonds()
public void setTailCrossingBonds(MolBond[] tailCrossingBonds)
tailCrossingBonds
- the tail crossing bonds.public void swapHeadTail()
public boolean containsLadderTypePolymer()