Group
Date: 2019-10-22

org.jmol.modelset

## Class Group

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

- All Implemented Interfaces:
    Structure
  Direct Known Subclasses:
    Monomer

      public class Group
      extends java.lang.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 and Description
    --- | ---
    `private javajs.util.BS` | `bsAdded`
    `Chain` | `chain` required
    `java.util.Map<java.lang.String,java.lang.Object>` | `dssrNT`
    `int` | `firstAtomIndex`
    `char` | `group1`
    `static java.lang.String[]` | `group3Names`
    `short` | `groupID`
    `int` | `groupIndex`
    `private static int` | `INSERTION_CODE_MASK`
    `int` | `lastAtomIndex`
    `int` | `leadAtomIndex`
    `int` | `selectedIndex` for coloring by group
    `int` | `seqcode`
    `private static int` | `SEQUENCE_NUMBER_FLAG`
    `private static int` | `SEQUENCE_NUMBER_SHIFT`
    `int` | `shapeVisibilityFlags`
    `static java.lang.String[]` | `specialAtomNames`
    `static java.lang.String` | `standardGroupList`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Group()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addAtoms(int atomIndex)`
    `private void` | `checkMinZ(Atom atom, int[] minZ)`
    `void` | `fixIndices(int atomsDeleted, javajs.util.BS bsDeleted)`
    `int` | `getAtomIndex(java.lang.String name, int offset)`
    `int` | `getBioPolymerIndexInModel()`
    `int` | `getBioPolymerLength()`
    `javajs.util.BS` | `getBSSideChain()`
    `Atom` | `getCarbonylOxygenAtom()`
    `boolean` | `getCrossLinkVector(javajs.util.Lst<java.lang.Integer> vReturn, boolean crosslinkCovalent, boolean crosslinkHBond)`
    `char` | `getGroup1()`
    `java.lang.String` | `getGroup3()`
    `java.util.Map<java.lang.String,java.lang.Object>` | `getGroupInfo(int igroup, javajs.util.P3 ptTemp)`
    `float` | `getGroupParameter(int tok)` Monomers only
    `java.lang.Object` | `getHelixData(int tokType, char qType, int mStep)`
    `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()`
    `java.lang.String` | `getProteinStructureTag()`
    `STR` | `getProteinStructureType()`
    `javajs.util.Quat` | `getQuaternion(char qType)`
    `javajs.util.Quat` | `getQuaternionFrame(Atom[] atoms)`
    `int` | `getResno()`
    `int` | `getSelectedMonomerCount()`
    `int` | `getSelectedMonomerIndex()`
    `static int` | `getSeqcodeFor(int seqNo, char insCode)`
    `java.lang.String` | `getSeqcodeString()`
    `static java.lang.String` | `getSeqcodeStringFor(int seqcode)`
    `static int` | `getSeqNumberFor(int seqcode)`
    `int` | `getStrucNo()`
    `Structure` | `getStructure()`
    `java.lang.String` | `getStructureId()`
    `static boolean` | `haveSequenceNumber(int seqcode)`
    `boolean` | `isAdded(int atomIndex)`
    `boolean` | `isCarbohydrate()`
    `boolean` | `isConnectedPrevious()`
    `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(javajs.util.BS bs)`
    `boolean` | `isWithinStructure(STR type)`
    `protected float` | `scaleToScreen(int Z, int mar)`
    `void` | `setAtomBits(javajs.util.BS bs)` note that we may pick up additional bits here that were added later
    `void` | `setAtomBitsAndClear(javajs.util.BS bs, javajs.util.BS bsOut)` Setting and clearing
    `Group` | `setGroup(Chain chain, java.lang.String group3, int seqcode, int firstAtomIndex, int lastAtomIndex)`
    `protected void` | `setGroupID(java.lang.String group3)`
    `int` | `setProteinStructureType(STR type, int monomerIndexCurrent)`
    `void` | `setResno(int i)`
    `void` | `setShapeVisibility(int visFlag, boolean isVisible)`
    `void` | `setStrucNo(int i)`
    `java.lang.String` | `toString()`

    - ### Methods inherited from class java.lang.Object

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

- - ### Field Detail

    - #### standardGroupList

          public static java.lang.String standardGroupList

    - #### group3Names

          public static java.lang.String[] group3Names

    - #### specialAtomNames

          public static java.lang.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

    - #### bsAdded

          private javajs.util.BS bsAdded

    - #### seqcode

          public int seqcode

    - #### groupID

          public short groupID

    - #### selectedIndex

          public int selectedIndex

      for coloring by group

    - #### SEQUENCE_NUMBER_FLAG

          private static final int SEQUENCE_NUMBER_FLAG

      See Also:
        Constant Field Values

    - #### INSERTION_CODE_MASK

          private static final int INSERTION_CODE_MASK

      See Also:
        Constant Field Values

    - #### SEQUENCE_NUMBER_SHIFT

          private static final int SEQUENCE_NUMBER_SHIFT

      See Also:
        Constant Field Values

    - #### shapeVisibilityFlags

          public int shapeVisibilityFlags

    - #### dssrNT

          public java.util.Map<java.lang.String,java.lang.Object> dssrNT

  - ### Constructor Detail

    - #### Group

          public Group()

  - ### Method Detail

    - #### setGroup

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

    - #### setGroupID

          protected void setGroupID(java.lang.String group3)

      Parameters:
        `group3` -

    - #### isAdded

          public boolean isAdded(int atomIndex)

    - #### addAtoms

          public void addAtoms(int atomIndex)

    - #### setAtomBits

          public void setAtomBits(javajs.util.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(javajs.util.BS bs,
                                          javajs.util.BS bsOut)

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

    - #### isSelected

          public boolean isSelected(javajs.util.BS bs)

    - #### setShapeVisibility

          public final void setShapeVisibility(int visFlag,
                                               boolean isVisible)

    - #### getGroup3

          public java.lang.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 java.lang.String getSeqcodeString()

    - #### getSeqcodeFor

          public static int getSeqcodeFor(int seqNo,
                                          char insCode)

    - #### getSeqcodeStringFor

          public static java.lang.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 javajs.util.Quat getQuaternion(char qType)

      Parameters:
        `qType` -
      Returns:
        quaternion

    - #### getQuaternionFrame

          public javajs.util.Quat getQuaternionFrame(Atom[] atoms)

    - #### setStrucNo

          public void setStrucNo(int i)

      Parameters:
        `i` -

    - #### getHelixData

          public java.lang.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 java.lang.String getProteinStructureTag()

    - #### getStructureId

          public java.lang.String getStructureId()

    - #### getBioPolymerIndexInModel

          public int getBioPolymerIndexInModel()

    - #### isCrossLinked

          public boolean isCrossLinked(Group g)

      Parameters:
        `g` -
      Returns:
        T/F

    - #### getCrossLinkVector

          public boolean getCrossLinkVector(javajs.util.Lst<java.lang.Integer> vReturn,
                                            boolean crosslinkCovalent,
                                            boolean crosslinkHBond)

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

    - #### isConnectedPrevious

          public boolean isConnectedPrevious()

    - #### getNitrogenAtom

          public Atom getNitrogenAtom()

    - #### getCarbonylOxygenAtom

          public Atom getCarbonylOxygenAtom()

    - #### fixIndices

          public void fixIndices(int atomsDeleted,
                                 javajs.util.BS bsDeleted)

    - #### getGroupInfo

          public java.util.Map<java.lang.String,java.lang.Object> getGroupInfo(int igroup,
                                                                               javajs.util.P3 ptTemp)

    - #### getMinZ

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

    - #### checkMinZ

          private void checkMinZ(Atom atom,
                                 int[] minZ)

    - #### getGroupParameter

          public float getGroupParameter(int tok)

      Monomers only
      Parameters:
        `tok` -
      Returns:
        NaN

    - #### getAtomIndex

          public int getAtomIndex(java.lang.String name,
                                  int offset)

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

    - #### getBSSideChain

          public javajs.util.BS getBSSideChain()

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### isNucleicMonomer

          public boolean isNucleicMonomer()