# 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
Description
`boolean`
`backboneBlockVis`
`BioPolymer`
`bioPolymer`
`protected byte[]`
`offsets`

### Fields inherited from class Group

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

## Constructor Summary

Constructors
Constructor
Description
`Monomer()`

## Method Summary

Modifier and Type
Method
Description
`protected static final boolean`
`checkOptional(byte[] offsets, byte atom, int firstAtomIndex, int index)`
`protected final Atom`
`getAtomFromOffsetIndex(int offsetIndex)`
`int`
`getAtomIndex(String name, int offset)`
`int`
`getBioPolymerIndexInModel()`
`int`
`getBioPolymerLength()`
`protected boolean`
`getCrossLinkGroup(int i, Lst<Integer> vReturn, Group group, boolean crosslinkCovalent, boolean crosslinkHBond, boolean isNotCheck)`
`boolean`
`getCrossLinkVector(Lst<Integer> vReturn, boolean crosslinkCovalent, boolean crosslinkHBond)`
`char`
`getGroup1()`
`protected char`
`getGroup1b()`
`float`
`getGroupParameter(int tok)`
Monomers only
`protected Object`
`getHelixData2(int tokType, char qType, int mStep)`
`final Atom`
`getLeadAtom()`
`int`
`getMonomerIndex()`
`Map<String,Object>`
`getMyInfo(P3 ptTemp)`
`STR`
`getProteinStructureType()`
/////////////////////////////////////////////////////////////
`int`
`getSelectedMonomerCount()`
`int`
`getSelectedMonomerIndex()`
`protected final Atom`
`getSpecialAtom(byte[] interestingIDs, byte specialAtomID)`
`protected final P3`
`getSpecialAtomPoint(byte[] interestingIDs, byte specialAtomID)`
`String`
`getStructureId()`
`String`
`getUniqueID()`
`final Atom`
`getWingAtom()`
`protected static boolean`
`have(byte[] offsets, byte n)`
`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, String group3, int seqcode, int firstAtomIndex, int lastAtomIndex, byte[] interestingAtomOffsets)`
`void`
`setGroupID(String group3)`
`protected void`
`setLeadAtomIndex()`
`void`
`setStrucNo(int id)`
`String`
`toString()`
`protected boolean`
`updateOffsetsForAlternativeLocations(Atom[] atoms, BS bsSelected)`

### Methods inherited from class 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, unsetStrutPoint`

### Methods inherited from class Object

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

## Field Details

### bioPolymer

public BioPolymer bioPolymer

### offsets

protected byte[] offsets

### backboneBlockVis

public boolean backboneBlockVis

## Constructor Details

### Monomer

public Monomer()

## Method Details

### have

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

### set2

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

### setLeadAtomIndex

protected void setLeadAtomIndex()

### 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(String name, int offset)

Overrides:
  `getAtomIndex` in class `Group`
Parameters:
  `name` -
  `offset` -
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`
Parameters:
  `id` -

### getAtomFromOffsetIndex

protected final Atom getAtomFromOffsetIndex(int offsetIndex)

### getSpecialAtom

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

### getSpecialAtomPoint

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

### isLeadAtom

public boolean isLeadAtom(int atomIndex)

Overrides:
  `isLeadAtom` in class `Group`
Parameters:
  `atomIndex` -
Returns:
  T/F

### getLeadAtom

public final Atom getLeadAtom()

Overrides:
  `getLeadAtom` in class `Group`

### getWingAtom

public final Atom getWingAtom()

### getMyInfo

public Map<String,Object> getMyInfo(P3 ptTemp)

### getStructureId

public String getStructureId()

Overrides:
  `getStructureId` in class `Group`

### updateOffsetsForAlternativeLocations

protected boolean updateOffsetsForAlternativeLocations(Atom[] atoms, BS bsSelected)

### checkOptional

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

### getHelixData2

protected Object getHelixData2(int tokType, char qType, int mStep)

### getUniqueID

public String getUniqueID()

### isCrossLinked

public boolean isCrossLinked(Group g)

Overrides:
  `isCrossLinked` in class `Group`
Parameters:
  `g` -
Returns:
  T/F

### getCrossLinkVector

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

Overrides:
  `getCrossLinkVector` in class `Group`
Parameters:
  `vReturn` -
  `crosslinkCovalent` -
  `crosslinkHBond` -
Returns:
  T/F

### getCrossLinkGroup

protected boolean getCrossLinkGroup(int i, Lst<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()

### getGroupParameter

public float getGroupParameter(int tok)
Description copied from class: `Group`
Monomers only

Overrides:
  `getGroupParameter` in class `Group`
Parameters:
  `tok` -
Returns:
  NaN

### getGroup1

public char getGroup1()

Overrides:
  `getGroup1` in class `Group`

### getGroup1b

protected char getGroup1b()

### setGroupID

public void setGroupID(String group3)

Overrides:
  `setGroupID` in class `Group`
Parameters:
  `group3` -

### toString

public String toString()

Overrides:
  `toString` in class `Group`