AlphaPolymer
Date: 2019-10-22

org.jmol.modelsetbio

## Class AlphaPolymer

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

- All Implemented Interfaces:
    Structure
  Direct Known Subclasses:
    AminoPolymer

      public class AlphaPolymer
      extends BioPolymer

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `private static class` | `AlphaPolymer.Code`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private static java.lang.String[]` | `dsspTypes`
    `int` | `pt0`

    - ### Fields inherited from class org.jmol.modelsetbio.BioPolymer

      `bioPolymerIndexInModel, bsSelectedMonomers, controlPoints, cyclicFlag, hasStructure, hasWingPoints, haveParameters, invalidControl, leadAtomIndices, leadMidpoints, leadPoints, model, monomerCount, monomers, reversed, sheetSmoothing, twistedSheets, type, TYPE_AMINO, TYPE_CARBOHYDRATE, TYPE_NOBONDING, TYPE_NUCLEIC, wingVectors`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AlphaPolymer(Monomer[] monomers, int pt0)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addStructure(STR type, java.lang.String structureID, int serialID, int strandCount, int startChainID, int startSeqcode, int endChainID, int endSeqcode, int istart, int iend, javajs.util.BS bsAssigned)`
    `boolean` | `addStructureProtected(STR type, java.lang.String structureID, int serialID, int strandCount, int indexStart, int indexEnd)`
    `private void` | `addStructuresFromTags(STR[] tags)`
    `private float[]` | `calculateAnglesInDegrees()`
    `private AlphaPolymer.Code[]` | `calculateCodes(float[] angles)`
    `private STR[]` | `calculateRunsFourOrMore(AlphaPolymer.Code[] codes)`
    `void` | `calculateStructures(boolean alphaOnly)` Uses Levitt & Greer algorithm to calculate protein secondary structures using only alpha-carbon atoms.
    `private void` | `checkBetaSheetAlphaHelixOverlap(AlphaPolymer.Code[] codes, float[] angles)`
    `void` | `clearStructures()`
    `private void` | `extendRuns(STR[] tags)`
    `protected javajs.util.P3` | `getControlPoint(int i, javajs.util.V3 v)`
    `ProteinStructure` | `getProteinStructure(int monomerIndex)`
    `private void` | `searchForTurns(AlphaPolymer.Code[] codes, float[] angles, STR[] tags)`
    `int` | `setStructureBS(int count, int dsspType, STR type, javajs.util.BS bs, boolean doOffset)` bits in the bitset determines the type

    - ### Methods inherited from class org.jmol.modelsetbio.BioPolymer

      `calcEtaThetaAngles, calcParameters, calcPhiPsiAngles, calcRasmolHydrogenBonds, calcSelectedMonomersCount, calculateRamachandranHelixAngle, findNearestAtomIndex, getControlPoints, getIndex, getLeadAtomIndices, getLeadMidPoint, getLeadMidpoints, getLeadPoint, getLeadPoints, getPolymerPointsAndVectors, getPolymerSequenceAtoms, getRange, getRangeGroups, getSelectedMonomerCount, getSequence, getType, getWingPoint, getWingVectors, isCyclic, isMonomerSelected, isNucleic, recalculateLeadMidpointsAndWingVectors, resetHydrogenPoints, set, setAtomBits, setAtomBitsAndClear, setConformation`

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

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

- - ### Field Detail

    - #### pt0

          public int pt0

    - #### dsspTypes

          private static final java.lang.String[] dsspTypes

  - ### Constructor Detail

    - #### AlphaPolymer

          AlphaPolymer(Monomer[] monomers,
                       int pt0)

  - ### Method Detail

    - #### getProteinStructure

          public ProteinStructure getProteinStructure(int monomerIndex)

      Overrides:
        `getProteinStructure` in class `BioPolymer`
      Returns:
        "HELIX" "TURN" etc

    - #### getControlPoint

          protected javajs.util.P3 getControlPoint(int i,
                                                   javajs.util.V3 v)

      Overrides:
        `getControlPoint` in class `BioPolymer`
      Returns:
        the leadPoint unless a protein sheet residue (see AlphaPolymer)

    - #### addStructure

          public void addStructure(STR type,
                                   java.lang.String structureID,
                                   int serialID,
                                   int strandCount,
                                   int startChainID,
                                   int startSeqcode,
                                   int endChainID,
                                   int endSeqcode,
                                   int istart,
                                   int iend,
                                   javajs.util.BS bsAssigned)

    - #### addStructureProtected

          public boolean addStructureProtected(STR type,
                                               java.lang.String structureID,
                                               int serialID,
                                               int strandCount,
                                               int indexStart,
                                               int indexEnd)

    - #### clearStructures

          public void clearStructures()

      Overrides:
        `clearStructures` in class `BioPolymer`

    - #### calculateStructures

          public void calculateStructures(boolean alphaOnly)

      Uses Levitt & Greer algorithm to calculate protein secondary structures using only alpha-carbon atoms.

      Levitt and Greer
      Automatic Identification of Secondary Structure in Globular Proteins
      J.Mol.Biol.(1977) 114, 181-293

      http://csb.stanford.edu/levitt/Levitt_JMB77_Secondary_structure.pdf

      Parameters:
        `alphaOnly` - caught by AminoPolymer and discarded if desired

    - #### calculateAnglesInDegrees

          private float[] calculateAnglesInDegrees()

    - #### calculateCodes

          private AlphaPolymer.Code[] calculateCodes(float[] angles)

    - #### checkBetaSheetAlphaHelixOverlap

          private void checkBetaSheetAlphaHelixOverlap(AlphaPolymer.Code[] codes,
                                                       float[] angles)

    - #### calculateRunsFourOrMore

          private STR[] calculateRunsFourOrMore(AlphaPolymer.Code[] codes)

    - #### extendRuns

          private void extendRuns(STR[] tags)

    - #### searchForTurns

          private void searchForTurns(AlphaPolymer.Code[] codes,
                                      float[] angles,
                                      STR[] tags)

    - #### addStructuresFromTags

          private void addStructuresFromTags(STR[] tags)

    - #### setStructureBS

          public int setStructureBS(int count,
                                    int dsspType,
                                    STR type,
                                    javajs.util.BS bs,
                                    boolean doOffset)

      bits in the bitset determines the type
      Parameters:
        `count` -
        `dsspType` -
        `type` -
        `bs` -
        `doOffset` - allows us to examine just a portion of the
      Returns:
        updated count