# Class Group

java.lang.Object
org.jmol.modelset.Group

All Implemented Interfaces:
  `Structure`

Direct Known Subclasses:
  `Monomer`

public class Group extends Object implements Structure
The essential container for every atom. Possibly a Monomer, but not necessarily. Always a member of a chain; sometimes a member of a BioPolymer. Groups need not be contiguous. firstAtomIndex is always fine to use, but lastAtomIndex is only the end of the INITIAL set of atoms in the file and must be carefully used.

## Field Summary

Fields
Modifier and Type
Field
Description
`Chain`
`chain`
required
`Map<String,Object>`
`dssrNT`
`int`
`firstAtomIndex`
`char`
`group1`
`static String[]`
`group3Names`
`short`
`groupID`
`int`
`groupIndex`
`int`
`lastAtomIndex`
`int`
`leadAtomIndex`
`int`
`selectedIndex`
for coloring by group
`int`
`seqcode`
`int`
`shapeVisibilityFlags`
`static String[]`
`specialAtomNames`
`static String`
`standardGroupList`
`Point3fi`
`strutPoint`

## Constructor Summary

Constructors
Constructor
Description
`Group()`

## Method Summary

Modifier and Type
Method
Description
`void`
`addAtoms(int atomIndex)`
`void`
`fixIndices(int atomsDeleted, BS bsDeleted)`
`int`
`getAtomIndex(String name, int offset)`
`int`
`getBioPolymerIndexInModel()`
`int`
`getBioPolymerLength()`
`BS`
`getBSSideChain()`
`Atom`
`getCarbonylOxygenAtom()`
`boolean`
`getCrossLinkVector(Lst<Integer> vReturn, boolean crosslinkCovalent, boolean crosslinkHBond)`
`char`
`getGroup1()`
`String`
`getGroup3()`
`Map<String,Object>`
`getGroupInfo(int igroup, P3 ptTemp)`
`float`
`getGroupParameter(int tok)`
Monomers only
`Object`
`getHelixData(int tokType, char qType, int mStep)`
`final int`
`getInsCode()`
`char`
`getInsertionCode()`
`static char`
`getInsertionCodeChar(int seqcode)`
`static int`
`getInsertionCodeFor(int seqcode)`
`Atom`
`getLeadAtom()`
`Atom`
`getLeadAtomOr(Atom atom)`
`void`
`getMinZ(Atom[] atoms, int[] minZ)`
`Model`
`getModel()`
BE CAREFUL: FAILURE TO NULL REFERENCES TO model WILL PREVENT FINALIZATION AND CREATE A MEMORY LEAK.
`int`
`getMonomerIndex()`
`Atom`
`getNitrogenAtom()`
`STR`
`getProteinStructureSubType()`
`String`
`getProteinStructureTag()`
`STR`
`getProteinStructureType()`
`Quat`
`getQuaternion(char qType)`
`Quat`
`getQuaternionFrame(Atom[] atoms)`
`final int`
`getResno()`
/////////////////////////////////////////////////////////////
`int`
`getSelectedMonomerCount()`
`int`
`getSelectedMonomerIndex()`
`static int`
`getSeqcodeFor(int seqNo, char insCode)`
`final String`
`getSeqcodeString()`
`static String`
`getSeqcodeStringFor(int seqcode)`
`static final int`
`getSeqNumberFor(int seqcode)`
`int`
`getStrucNo()`
`Structure`
`getStructure()`
`String`
`getStructureId()`
`static final boolean`
`haveSequenceNumber(int seqcode)`
`boolean`
`isAdded(int atomIndex)`
`boolean`
`isCarbohydrate()`
`boolean`
`isCrossLinked(Group g)`
`protected boolean`
`isCursorOnTopOf(Atom atom, int x, int y, int radius, Atom champ)`
`boolean`
`isDna()`
group ID-based definition
`protected boolean`
`isDnaByID()`
group ID-based definition
`boolean`
`isLeadAtom(int atomIndex)`
`boolean`
`isNucleic()`
group ID-based definition
`boolean`
`isNucleicMonomer()`
`boolean`
`isProtein()`
group ID-based definition
`boolean`
`isPurine()`
group ID-based definition
`protected boolean`
`isPurineByID()`
group ID-based definition
`boolean`
`isPyrimidine()`
group ID-based definition
`protected boolean`
`isPyrimidineByID()`
`boolean`
`isRna()`
group ID-based definition
`protected boolean`
`isRnaByID()`
group ID-based definition
`boolean`
`isSelected(BS bs)`
`boolean`
`isWithinStructure(STR type)`
`protected float`
`scaleToScreen(int Z, int mar)`
`void`
`setAtomBits(BS bs)`
note that we may pick up additional bits here that were added later
`void`
`setAtomBitsAndClear(BS bs, BS bsOut)`
Setting and clearing
`Group`
`setGroup(Chain chain, String group3, int seqcode, int firstAtomIndex, int lastAtomIndex)`
`protected void`
`setGroupID(String group3)`
`int`
`setProteinStructureType(STR type, int monomerIndexCurrent)`
`void`
`setResno(int i)`
`final void`
`setShapeVisibility(int visFlag, boolean isVisible)`
`void`
`setStrucNo(int i)`
`String`
`toString()`
`void`
`unsetStrutPoint()`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Field Details

### standardGroupList

public static String standardGroupList

### group3Names

public static String[] group3Names

### specialAtomNames

public static String[] specialAtomNames

### chain

public Chain chain
required

### groupIndex

public int groupIndex

### group1

public char group1

### firstAtomIndex

public int firstAtomIndex

### leadAtomIndex

public int leadAtomIndex

### lastAtomIndex

public int lastAtomIndex

### seqcode

public int seqcode

### groupID

public short groupID

### selectedIndex

public int selectedIndex
for coloring by group

### shapeVisibilityFlags

public int shapeVisibilityFlags

### dssrNT

public Map<String,Object> dssrNT

### strutPoint

public Point3fi strutPoint

## Constructor Details

### Group

public Group()

## Method Details

### setGroup

public Group setGroup(Chain chain, String group3, int seqcode, int firstAtomIndex, int lastAtomIndex)

### setGroupID

protected void setGroupID(String group3)

Parameters:
  `group3` -

### isAdded

public boolean isAdded(int atomIndex)

### addAtoms

public void addAtoms(int atomIndex)

### setAtomBits

public void setAtomBits(BS bs)
note that we may pick up additional bits here that were added later

Specified by:
  `setAtomBits` in interface `Structure`
Parameters:
  `bs` -

### setAtomBitsAndClear

public void setAtomBitsAndClear(BS bs, BS bsOut)
Setting and clearing

Specified by:
  `setAtomBitsAndClear` in interface `Structure`
Parameters:
  `bs` -
  `bsOut` -

### isSelected

public boolean isSelected(BS bs)

### setShapeVisibility

public final void setShapeVisibility(int visFlag, boolean isVisible)

### getGroup3

public String getGroup3()

### getGroup1

public char getGroup1()

### getBioPolymerLength

public int getBioPolymerLength()

### getMonomerIndex

public int getMonomerIndex()

### getStructure

public Structure getStructure()

### getStrucNo

public int getStrucNo()

### getProteinStructureType

public STR getProteinStructureType()

### getProteinStructureSubType

public STR getProteinStructureSubType()

### setProteinStructureType

public int setProteinStructureType(STR type, int monomerIndexCurrent)

Parameters:
  `type` -
  `monomerIndexCurrent` -
Returns:
  type

### isProtein

public boolean isProtein()
group ID-based definition

Returns:
  boolean

### isNucleic

public boolean isNucleic()
group ID-based definition

Returns:
  boolean

### isDna

public boolean isDna()
group ID-based definition

Returns:
  boolean

### isRna

public boolean isRna()
group ID-based definition

Returns:
  boolean

### isPurine

public boolean isPurine()
group ID-based definition

Returns:
  boolean

### isPurineByID

protected boolean isPurineByID()
group ID-based definition

Returns:
  boolean

### isPyrimidine

public boolean isPyrimidine()
group ID-based definition

Returns:
  boolean

### isPyrimidineByID

protected boolean isPyrimidineByID()

### isRnaByID

protected boolean isRnaByID()
group ID-based definition

Returns:
  boolean

### isDnaByID

protected boolean isDnaByID()
group ID-based definition

Returns:
  boolean

### isCarbohydrate

public boolean isCarbohydrate()

### getResno

public final int getResno()
/////////////////////////////////////////////////////////////

### setResno

public void setResno(int i)

### getSeqNumberFor

public static final int getSeqNumberFor(int seqcode)

### haveSequenceNumber

public static final boolean haveSequenceNumber(int seqcode)

### getSeqcodeString

public final String getSeqcodeString()

### getSeqcodeFor

public static int getSeqcodeFor(int seqNo, char insCode)

### getSeqcodeStringFor

public static String getSeqcodeStringFor(int seqcode)

### getInsertionCode

public char getInsertionCode()

### getInsCode

public final int getInsCode()

### getInsertionCodeFor

public static int getInsertionCodeFor(int seqcode)

### getInsertionCodeChar

public static char getInsertionCodeChar(int seqcode)

### scaleToScreen

protected float scaleToScreen(int Z, int mar)

### isCursorOnTopOf

protected boolean isCursorOnTopOf(Atom atom, int x, int y, int radius, Atom champ)

### getModel

public Model getModel()
BE CAREFUL: FAILURE TO NULL REFERENCES TO model WILL PREVENT FINALIZATION AND CREATE A MEMORY LEAK.

Returns:
  associated Model

### getSelectedMonomerCount

public int getSelectedMonomerCount()

### getSelectedMonomerIndex

public int getSelectedMonomerIndex()

### isLeadAtom

public boolean isLeadAtom(int atomIndex)

Parameters:
  `atomIndex` -
Returns:
  T/F

### getLeadAtomOr

public Atom getLeadAtomOr(Atom atom)

### getLeadAtom

public Atom getLeadAtom()

### getQuaternion

public Quat getQuaternion(char qType)

Parameters:
  `qType` -
Returns:
  quaternion

### getQuaternionFrame

public Quat getQuaternionFrame(Atom[] atoms)

### setStrucNo

public void setStrucNo(int i)

Parameters:
  `i` -

### getHelixData

public Object getHelixData(int tokType, char qType, int mStep)

Parameters:
  `tokType` -
  `qType` -
  `mStep` -
Returns:
  helix data of some sort

### isWithinStructure

public boolean isWithinStructure(STR type)

Parameters:
  `type` -
Returns:
  T/F

### getProteinStructureTag

public String getProteinStructureTag()

### getStructureId

public String getStructureId()

### getBioPolymerIndexInModel

public int getBioPolymerIndexInModel()

### isCrossLinked

public boolean isCrossLinked(Group g)

Parameters:
  `g` -
Returns:
  T/F

### getCrossLinkVector

public boolean getCrossLinkVector(Lst<Integer> vReturn, boolean crosslinkCovalent, boolean crosslinkHBond)

Parameters:
  `vReturn` -
  `crosslinkCovalent` -
  `crosslinkHBond` -
Returns:
  T/F

### getNitrogenAtom

public Atom getNitrogenAtom()

### getCarbonylOxygenAtom

public Atom getCarbonylOxygenAtom()

### fixIndices

public void fixIndices(int atomsDeleted, BS bsDeleted)

### getGroupInfo

public Map<String,Object> getGroupInfo(int igroup, P3 ptTemp)

### getMinZ

public void getMinZ(Atom[] atoms, int[] minZ)

### getGroupParameter

public float getGroupParameter(int tok)
Monomers only

Parameters:
  `tok` -
Returns:
  NaN

### getAtomIndex

public int getAtomIndex(String name, int offset)

Parameters:
  `name` -
  `offset` -
Returns:
  index of atom based on offset

### getBSSideChain

public BS getBSSideChain()

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### isNucleicMonomer

public boolean isNucleicMonomer()

### unsetStrutPoint

public void unsetStrutPoint()