# Class BioPolymer

java.lang.Object
org.jmol.modelsetbio.BioPolymer

All Implemented Interfaces:
  `Structure`

Direct Known Subclasses:
  `AlphaPolymer, CarbohydratePolymer, PhosphorusPolymer`

public abstract class BioPolymer extends Object implements Structure
A "BioPolymer" is a constructed set of contiguous (probably connected) "Monomers", which may be one of Alpha (Calpha atoms), Amino (Calpha + backbone), Phosphorus (P atoms), Nucleic (DNA/RNA), or Carbohydrate. BioPolymers are constructed after file loading and after various changes that might affect secondary structure. BioPolymers are not Chains. Chains are set at load time and just constitute collections of unique chain identifiers in the file.

## Field Summary

Fields
Modifier and Type
Field
Description
`int`
`bioPolymerIndexInModel`
`protected P3[]`
`controlPoints`
`int`
`cyclicFlag`
`protected boolean`
`hasStructure`
`protected boolean`
`hasWingPoints`
`boolean`
`haveParameters`
`protected boolean`
`invalidControl`
`protected int[]`
`leadAtomIndices`
`protected P3[]`
`leadMidpoints`
`protected P3[]`
`leadPoints`
`Model`
`model`
`int`
`monomerCount`
`Monomer[]`
`monomers`
`BS`
`reversed`
`protected float`
`sheetSmoothing`
`boolean`
`twistedSheets`
`protected int`
`type`
`protected static final int`
`TYPE_AMINO`
`protected static final int`
`TYPE_CARBOHYDRATE`
`protected static final int`
`TYPE_NOBONDING`
`protected static final int`
`TYPE_NUCLEIC`
`protected V3[]`
`wingVectors`

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`BioPolymer(Monomer[] monomers, boolean hasStructure)`

## Method Summary

Modifier and Type
Method
Description
`protected boolean`
`calcEtaThetaAngles()`
`boolean`
`calcParameters()`
`protected boolean`
`calcPhiPsiAngles()`
`void`
`calcRasmolHydrogenBonds(BioPolymer polymer, BS bsA, BS bsB, Lst<Bond> vHBonds, int nMaxPerResidue, int[][][] min, boolean checkDistances, boolean dsspIgnoreHydrogens)`
`void`
`calcSelectedMonomersCount(BS bsSelected)`
`protected float`
`calculateRamachandranHelixAngle(int m, char qtype)`
`void`
`clearStructures()`
`void`
`findNearestAtomIndex(int xMouse, int yMouse, Atom[] closest, short[] mads, int myVisibilityFlag, BS bsNot)`
`protected P3`
`getControlPoint(int i, V3 v)`
`P3[]`
`getControlPoints(boolean isTraceAlpha, float sheetSmoothing, boolean invalidate)`
`protected int`
`getIndex(int chainID, int seqcode, int istart, int iend)`
`int[]`
`getLeadAtomIndices()`
`P3[]`
`getLeadMidpoints()`
`int`
`getPolymerPointsAndVectors(int last, BS bs, Lst<P3[]> vList, boolean isTraceAlpha, float sheetSmoothing)`
`void`
`getPolymerSequenceAtoms(int group1, int nGroups, BS bsInclude, BS bsResult)`
`ProteinStructure`
`getProteinStructure(int monomerIndex)`
`void`
`getRange(BS bs, boolean isMutated)`
`void`
`getRangeGroups(int nResidues, BS bsAtoms, BS bsResult)`
`String`
`getSequence()`
`int`
`getType()`
`final V3[]`
`getWingVectors()`
`boolean`
`isCyclic()`
`boolean`
`isNucleic()`
`void`
`recalculateLeadMidpointsAndWingVectors()`
`protected void`
`resetHydrogenPoints()`
`void`
`setAtomBits(BS bs)`
`void`
`setAtomBitsAndClear(BS bs, BS bsOut)`
`void`
`setConformation(BS bsSelected)`
`String`
`toString()`

### Methods inherited from class Object

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

## Field Details

### model

public Model model

### monomers

public Monomer[] monomers

### hasStructure

protected boolean hasStructure

### leadMidpoints

protected P3[] leadMidpoints

### leadPoints

protected P3[] leadPoints

### controlPoints

protected P3[] controlPoints

### wingVectors

protected V3[] wingVectors

### leadAtomIndices

protected int[] leadAtomIndices

### type

protected int type

### bioPolymerIndexInModel

public int bioPolymerIndexInModel

### monomerCount

public int monomerCount

### TYPE_NOBONDING

protected static final int TYPE_NOBONDING

See Also:
  - Constant Field Values

### TYPE_AMINO

protected static final int TYPE_AMINO

See Also:
  - Constant Field Values

### TYPE_NUCLEIC

protected static final int TYPE_NUCLEIC

See Also:
  - Constant Field Values

### TYPE_CARBOHYDRATE

protected static final int TYPE_CARBOHYDRATE

See Also:
  - Constant Field Values

### cyclicFlag

public int cyclicFlag

### invalidControl

protected boolean invalidControl

### sheetSmoothing

protected float sheetSmoothing

### hasWingPoints

protected boolean hasWingPoints

### reversed

public BS reversed

### twistedSheets

public boolean twistedSheets

### haveParameters

public boolean haveParameters

## Constructor Details

### BioPolymer

protected BioPolymer(Monomer[] monomers, boolean hasStructure)

## Method Details

### setAtomBits

public void setAtomBits(BS bs)

Specified by:
  `setAtomBits` in interface `Structure`

### setAtomBitsAndClear

public void setAtomBitsAndClear(BS bs, BS bsOut)

Specified by:
  `setAtomBitsAndClear` in interface `Structure`

### getRange

public void getRange(BS bs, boolean isMutated)

### clearStructures

public void clearStructures()

### getLeadAtomIndices

public int[] getLeadAtomIndices()

### getIndex

protected int getIndex(int chainID, int seqcode, int istart, int iend)

### setConformation

public void setConformation(BS bsSelected)

### recalculateLeadMidpointsAndWingVectors

public void recalculateLeadMidpointsAndWingVectors()

### resetHydrogenPoints

protected void resetHydrogenPoints()

### getLeadMidpoints

public P3[] getLeadMidpoints()

### getControlPoints

public P3[] getControlPoints(boolean isTraceAlpha, float sheetSmoothing, boolean invalidate)

### getControlPoint

protected P3 getControlPoint(int i, V3 v)

Parameters:
  `i` -
  `v` -
Returns:
  the leadPoint unless a protein sheet residue (see AlphaPolymer)

### getWingVectors

public final V3[] getWingVectors()

### findNearestAtomIndex

public void findNearestAtomIndex(int xMouse, int yMouse, Atom[] closest, short[] mads, int myVisibilityFlag, BS bsNot)

### calcSelectedMonomersCount

public void calcSelectedMonomersCount(BS bsSelected)

### getPolymerPointsAndVectors

public int getPolymerPointsAndVectors(int last, BS bs, Lst<P3[]> vList, boolean isTraceAlpha, float sheetSmoothing)

### getSequence

public String getSequence()

### getPolymerSequenceAtoms

public void getPolymerSequenceAtoms(int group1, int nGroups, BS bsInclude, BS bsResult)

### getProteinStructure

public ProteinStructure getProteinStructure(int monomerIndex)

Parameters:
  `monomerIndex` -
Returns:
  "HELIX" "TURN" etc

### calcParameters

public boolean calcParameters()

### calcEtaThetaAngles

protected boolean calcEtaThetaAngles()

### calcPhiPsiAngles

protected boolean calcPhiPsiAngles()

### calculateRamachandranHelixAngle

protected float calculateRamachandranHelixAngle(int m, char qtype)

Parameters:
  `m` -
  `qtype` -
Returns:
  calculated value

### isNucleic

public boolean isNucleic()

### getRangeGroups

public void getRangeGroups(int nResidues, BS bsAtoms, BS bsResult)

### calcRasmolHydrogenBonds

public void calcRasmolHydrogenBonds(BioPolymer polymer, BS bsA, BS bsB, Lst<Bond> vHBonds, int nMaxPerResidue, int[][][] min, boolean checkDistances, boolean dsspIgnoreHydrogens)

Parameters:
  `polymer` -
  `bsA` -
  `bsB` -
  `vHBonds` -
  `nMaxPerResidue` -
  `min` -
  `checkDistances` -
  `dsspIgnoreHydrogens` -

### getType

public int getType()

### isCyclic

public boolean isCyclic()

### toString

public String toString()

Overrides:
  `toString` in class `Object`