Monomer
Date: 2019-10-22

org.jmol.modelsetbio

## Class Monomer

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

- All Implemented Interfaces:
    Structure
  Direct Known Subclasses:
    AlphaMonomer, CarbohydrateMonomer, PhosphorusMonomer

      public abstract class Monomer
      extends Group

  A class to maintain information about biomolecule groups that are (potentially) part of biopolymers -- peptides, nucleic acid strands, or complex carbohydrates. Note that it is possible that a monomer is created but is not part of a BioPolymer.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `boolean` | `backboneBlockVis`
    `BioPolymer` | `bioPolymer`
    `(package private) int` | `monomerIndex`
    `private float` | `mu`
    `protected byte[]` | `offsets`
    `private float` | `omega`
    `private float` | `phi`
    `private float` | `psi`
    `private float` | `straightness`
    `private float` | `theta`

    - ### Fields inherited from class org.jmol.modelset.Group

      `chain, dssrNT, firstAtomIndex, group1, group3Names, groupID, groupIndex, lastAtomIndex, leadAtomIndex, selectedIndex, seqcode, shapeVisibilityFlags, specialAtomNames, standardGroupList`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Monomer()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected static boolean` | `checkOptional(byte[] offsets, byte atom, int firstAtomIndex, int index)`
    `(package private) void` | `findNearestAtomIndex(int x, int y, Atom[] closest, short madBegin, short madEnd)` Selects LeadAtom when this Monomer is clicked iff it is closer to the user.
    `protected Atom` | `getAtomFromOffsetIndex(int offsetIndex)`
    `int` | `getAtomIndex(java.lang.String name, int offset)`
    `int` | `getBioPolymerIndexInModel()`
    `int` | `getBioPolymerLength()`
    `protected boolean` | `getCrossLinkGroup(int i, javajs.util.Lst<java.lang.Integer> vReturn, Group group, boolean crosslinkCovalent, boolean crosslinkHBond, boolean isNotCheck)`
    `boolean` | `getCrossLinkVector(javajs.util.Lst<java.lang.Integer> vReturn, boolean crosslinkCovalent, boolean crosslinkHBond)`
    `char` | `getGroup1()`
    `protected char` | `getGroup1b()`
    `float` | `getGroupParameter(int tok)` Monomers only
    `protected java.lang.Object` | `getHelixData2(int tokType, char qType, int mStep)`
    `(package private) Atom` | `getInitiatorAtom()`
    `Atom` | `getLeadAtom()`
    `int` | `getMonomerIndex()`
    `(package private) void` | `getMonomerSequenceAtoms(javajs.util.BS bsInclude, javajs.util.BS bsResult)`
    `java.util.Map<java.lang.String,java.lang.Object>` | `getMyInfo(javajs.util.P3 ptTemp)`
    `STR` | `getProteinStructureType()`
    `(package private) javajs.util.P3` | `getQuaternionFrameCenter(char qtype)`
    `int` | `getSelectedMonomerCount()`
    `int` | `getSelectedMonomerIndex()`
    `protected Atom` | `getSpecialAtom(byte[] interestingIDs, byte specialAtomID)`
    `protected javajs.util.P3` | `getSpecialAtomPoint(byte[] interestingIDs, byte specialAtomID)`
    `java.lang.String` | `getStructureId()`
    `(package private) Atom` | `getTerminatorAtom()`
    `java.lang.String` | `getUniqueID()`
    `Atom` | `getWingAtom()`
    `protected static boolean` | `have(byte[] offsets, byte n)`
    `(package private) abstract boolean` | `isConnectedAfter(Monomer possiblyPreviousMonomer)`
    `boolean` | `isConnectedPrevious()`
    `boolean` | `isCrossLinked(Group g)`
    `boolean` | `isHelix()`
    `boolean` | `isLeadAtom(int atomIndex)`
    `boolean` | `isSheet()`
    `protected static byte[]` | `scanForOffsets(int firstAtomIndex, int[] specialAtomIndexes, byte[] interestingAtomIDs)`
    `protected Monomer` | `set2(Chain chain, java.lang.String group3, int seqcode, int firstAtomIndex, int lastAtomIndex, byte[] interestingAtomOffsets)`
    `(package private) void` | `setBioPolymer(BioPolymer polymer, int index)`
    `void` | `setGroupID(java.lang.String group3)`
    `(package private) void` | `setGroupParameter(int tok, float f)`
    `protected void` | `setLeadAtomIndex()`
    `void` | `setStrucNo(int id)`
    `(package private) void` | `updateOffsetsForAlternativeLocations(Atom[] atoms, javajs.util.BS bsSelected)`

    - ### Methods inherited from class org.jmol.modelset.Group

      `addAtoms, fixIndices, getBSSideChain, getCarbonylOxygenAtom, getGroup3, getGroupInfo, getHelixData, getInsCode, getInsertionCode, getInsertionCodeChar, getInsertionCodeFor, getLeadAtomOr, getMinZ, getModel, getNitrogenAtom, getProteinStructureSubType, getProteinStructureTag, getQuaternion, getQuaternionFrame, getResno, getSeqcodeFor, getSeqcodeString, getSeqcodeStringFor, getSeqNumberFor, getStrucNo, getStructure, haveSequenceNumber, isAdded, isCarbohydrate, isCursorOnTopOf, isDna, isDnaByID, isNucleic, isNucleicMonomer, isProtein, isPurine, isPurineByID, isPyrimidine, isPyrimidineByID, isRna, isRnaByID, isSelected, isWithinStructure, scaleToScreen, setAtomBits, setAtomBitsAndClear, setGroup, setProteinStructureType, setResno, setShapeVisibility, toString`

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

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

- - ### Field Detail

    - #### bioPolymer

          public BioPolymer bioPolymer

    - #### offsets

          protected byte[] offsets

    - #### monomerIndex

          int monomerIndex

    - #### phi

          private float phi

    - #### psi

          private float psi

    - #### omega

          private float omega

    - #### straightness

          private float straightness

    - #### mu

          private float mu

    - #### theta

          private float theta

    - #### backboneBlockVis

          public boolean backboneBlockVis

  - ### Constructor Detail

    - #### Monomer

          public Monomer()

  - ### Method Detail

    - #### have

          protected static boolean have(byte[] offsets,
                                        byte n)

    - #### set2

          protected Monomer set2(Chain chain,
                                 java.lang.String group3,
                                 int seqcode,
                                 int firstAtomIndex,
                                 int lastAtomIndex,
                                 byte[] interestingAtomOffsets)

    - #### setLeadAtomIndex

          protected void setLeadAtomIndex()

    - #### setBioPolymer

          void setBioPolymer(BioPolymer polymer,
                             int index)

    - #### getSelectedMonomerCount

          public int getSelectedMonomerCount()

      Overrides:
        `getSelectedMonomerCount` in class `Group`

    - #### getSelectedMonomerIndex

          public int getSelectedMonomerIndex()

      Overrides:
        `getSelectedMonomerIndex` in class `Group`

    - #### getBioPolymerLength

          public int getBioPolymerLength()

      Overrides:
        `getBioPolymerLength` in class `Group`

    - #### getMonomerIndex

          public int getMonomerIndex()

      Overrides:
        `getMonomerIndex` in class `Group`

    - #### getAtomIndex

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

      Overrides:
        `getAtomIndex` in class `Group`
      Returns:
        index of atom based on offset

    - #### getBioPolymerIndexInModel

          public int getBioPolymerIndexInModel()

      Overrides:
        `getBioPolymerIndexInModel` in class `Group`

    - #### scanForOffsets

          protected static byte[] scanForOffsets(int firstAtomIndex,
                                                 int[] specialAtomIndexes,
                                                 byte[] interestingAtomIDs)

    - #### getProteinStructureType

          public STR getProteinStructureType()

      Overrides:
        `getProteinStructureType` in class `Group`

    - #### isHelix

          public boolean isHelix()

    - #### isSheet

          public boolean isSheet()

    - #### setStrucNo

          public void setStrucNo(int id)

      Overrides:
        `setStrucNo` in class `Group`

    - #### getAtomFromOffsetIndex

          protected final Atom getAtomFromOffsetIndex(int offsetIndex)

    - #### getSpecialAtom

          protected final Atom getSpecialAtom(byte[] interestingIDs,
                                              byte specialAtomID)

    - #### getSpecialAtomPoint

          protected final javajs.util.P3 getSpecialAtomPoint(byte[] interestingIDs,
                                                             byte specialAtomID)

    - #### isLeadAtom

          public boolean isLeadAtom(int atomIndex)

      Overrides:
        `isLeadAtom` in class `Group`
      Returns:
        T/F

    - #### getLeadAtom

          public final Atom getLeadAtom()

      Overrides:
        `getLeadAtom` in class `Group`

    - #### getWingAtom

          public final Atom getWingAtom()

    - #### getInitiatorAtom

          Atom getInitiatorAtom()

    - #### getTerminatorAtom

          Atom getTerminatorAtom()

    - #### isConnectedAfter

          abstract boolean isConnectedAfter(Monomer possiblyPreviousMonomer)

    - #### findNearestAtomIndex

          void findNearestAtomIndex(int x,
                                    int y,
                                    Atom[] closest,
                                    short madBegin,
                                    short madEnd)

      Selects LeadAtom when this Monomer is clicked iff it is closer to the user.
      Parameters:
        `x` -
        `y` -
        `closest` -
        `madBegin` -
        `madEnd` -

    - #### getMyInfo

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

    - #### getStructureId

          public java.lang.String getStructureId()

      Overrides:
        `getStructureId` in class `Group`

    - #### updateOffsetsForAlternativeLocations

          final void updateOffsetsForAlternativeLocations(Atom[] atoms,
                                                          javajs.util.BS bsSelected)

    - #### getMonomerSequenceAtoms

          final void getMonomerSequenceAtoms(javajs.util.BS bsInclude,
                                             javajs.util.BS bsResult)

    - #### checkOptional

          protected static final boolean checkOptional(byte[] offsets,
                                                       byte atom,
                                                       int firstAtomIndex,
                                                       int index)

    - #### getQuaternionFrameCenter

          javajs.util.P3 getQuaternionFrameCenter(char qtype)

      Parameters:
        `qtype` -
      Returns:
        center

    - #### getHelixData2

          protected java.lang.Object getHelixData2(int tokType,
                                                   char qType,
                                                   int mStep)

    - #### getUniqueID

          public java.lang.String getUniqueID()

    - #### isCrossLinked

          public boolean isCrossLinked(Group g)

      Overrides:
        `isCrossLinked` in class `Group`
      Returns:
        T/F

    - #### getCrossLinkVector

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

      Overrides:
        `getCrossLinkVector` in class `Group`
      Returns:
        T/F

    - #### getCrossLinkGroup

          protected boolean getCrossLinkGroup(int i,
                                              javajs.util.Lst<java.lang.Integer> vReturn,
                                              Group group,
                                              boolean crosslinkCovalent,
                                              boolean crosslinkHBond,
                                              boolean isNotCheck)

      Parameters:
        `i` -
        `vReturn` - null implies just checking for a specific group
        `group` - specific group to check or null to indicate just PREVIOUS group (carbohydrates)
        `crosslinkCovalent` - (S-S)
        `crosslinkHBond` - (hbond)
        `isNotCheck` - TODO
      Returns:
        true if there is a cross-link of the allowed type

    - #### isConnectedPrevious

          public boolean isConnectedPrevious()

      Overrides:
        `isConnectedPrevious` in class `Group`

    - #### setGroupParameter

          void setGroupParameter(int tok,
                                 float f)

    - #### getGroupParameter

          public float getGroupParameter(int tok)

      Description copied from class: `Group`
      Monomers only
      Overrides:
        `getGroupParameter` in class `Group`
      Returns:
        NaN

    - #### getGroup1

          public char getGroup1()

      Overrides:
        `getGroup1` in class `Group`

    - #### getGroup1b

          protected char getGroup1b()

    - #### setGroupID

          public void setGroupID(java.lang.String group3)

      Overrides:
        `setGroupID` in class `Group`