chemaxon.struc.sgroup
Class RepeatingUnitSgroup

java.lang.Object
  extended by chemaxon.struc.Sgroup
      extended by chemaxon.struc.sgroup.RepeatingUnitSgroup
All Implemented Interfaces:
java.io.Serializable

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:

The end groups of polymers are often unknown or unspecified which are represented by star atoms (*).

Repeating units with repetition ranges.

Implemented S-group types:

Since:
Marvin 5.0, 10/13/2006
Version:
5.3, 09/25/2009
Author:
Erika Biro
See Also:
Serialized Form

Field Summary
 
Fields inherited from class chemaxon.struc.Sgroup
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_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
  RepeatingUnitSgroup(Molecule parent, int type)
          Constructs an SRU S-group.
  RepeatingUnitSgroup(Molecule parent, java.lang.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
 void addCrossingBonds(java.util.List<MolBond> crsList, java.util.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.
 java.lang.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(java.lang.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.
 
Methods inherited from class chemaxon.struc.Sgroup
add, add, addBracket, addChildSgroup, areChildSgroupsVisible, clearObjects, cloneSgroup, cloneStructure, containsAllAtomsOf, contract, countAllAtoms, createMolecule, createMolecule, expand, findSmallestSgroupContaining, findSmallestSgroupOf, getAtom, getAtomArray, getAtomCount, getAtomSymbolListAsString, getBracketCount, getBrackets, getChargeLocation, getChildSgroup, getChildSgroupCount, getConnectivity, getCrossingAtoms, getParentMolecule, getParentSgroup, getSgroupGraph, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RepeatingUnitSgroup

public RepeatingUnitSgroup(Molecule parent,
                           int type)
Constructs an SRU S-group.

Parameters:
parent - the parent molecule
type - 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

RepeatingUnitSgroup

public RepeatingUnitSgroup(Molecule parent,
                           java.lang.String connectivity,
                           int type)
Constructs an SRU S-group with connectivity. The connectivity string returned by getSuperscript() can be used to create another SRU S-group with the same connectivity data.

Parameters:
parent - the parent molecule
connectivity - 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:
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 copy
m - the new parent molecule
psg - the new parent S-group or null
atomIndexMap - indices of cloned atoms in the original molecule in the case of partial cloning, or null otherwise
Since:
Marvin 4.1

RepeatingUnitSgroup

protected RepeatingUnitSgroup(RepeatingUnitSgroup sg,
                              Molecule m,
                              Sgroup psg)
Copy constructor.

Parameters:
sg - the S-group to copy
m - the new parent molecule
psg - 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 class Sgroup
Parameters:
m - the new parent molecule
psg - the new parent S-group
atomIndexMap - indices of cloned atoms in the original molecule or null
Returns:
the new object
Since:
Marvin 5.0.2, 03/07/2008

getSuperscript

public java.lang.String getSuperscript()
Gets the superscript for Sru S-groups. This contains the connectivity data.

Overrides:
getSuperscript in class Sgroup
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(java.lang.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 class Sgroup
Returns:
the attachment bonds
Since:
Marvin 5.0

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 bond
b2 - 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(java.util.List<MolBond> crsList,
                             java.util.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.